Designing an automated pot

Started by suncrush, September 09, 2016, 08:44:47 AM

Previous topic - Next topic

suncrush

Here's what I want to do.

I want a wah pedal, but instead of a treadle, I want it to start in heel-down mode, then hit a momentary switch to have it rock smoothly to toe-down, and back to heel-down.  Once it returns to heel-down, I want it to stay there.  I also want a time control, so that it can do this rapidly, or slowly.  (The slowest speed should be about 8 beats at 90 bpm, so a bit over 5 seconds.)

So, I want to automate a pot so that it starts at 0, then can be triggered to sweep to 100k, then return to 0 and stop.

My first thought is to try a 256-step digipot connected to a 7555 clock chip, basically adapting this project: http://makezine.com/projects/make-43/digital-potentiometers/

A couple questions--

1. What's the current through the wah pot in a typical design?
2. I'm having trouble reading digipot data sheets.  I know some default to 0/full (depending how you wire it), and others to the midpoint.  How do I tell the difference?

R.G.

Quote1. What's the current through the wah pot in a typical design?
Tiny. That's not going to be a problem for you. It can't be any bigger than the full power supply divided by the pot, or 9v/100K = 90uA, and in fact it can't be that big because the signal is never a steady 9V. So it's much less than that, down in the units of uA.

Quote2. I'm having trouble reading digipot data sheets.  I know some default to 0/full (depending how you wire it), and others to the midpoint.  How do I tell the difference?
Sadly, the only way to tell is to read the data sheets, or to get someone to interpret them for you.

There are some issues you're going to run into that will give you more trouble though. Taken all together, these issues strongly suggest that you use a small microcontroller to do the controlling, not a batch of analog stuff. I know that may be a big hurdle to get over, but it replaces a lot of hardwired bits and pieces with one $0.75 part, and gives you complete control of what the pot does.

Here are some of the issues.
- wah pots do not sweep their full range; the gear mechanism does not spin the pot from fully counterclockwise to clockwise and vice versa. So your setup would have to either have a bigger wah travel than most actual wah pedals, or have some tinkering to limit the travel. Not impossible, and probably can be handled with additional resistors at the ends of the digipot, but something that will need addressed. If you don't want the extra sweep range more than a regular wah, you'd need to pre-count it up to a certain minimum, count up only to a certain maximum while sweeping, and the re-count it down to the minimum again. There are ways to do this, but the circuit complexity grows.
- digital pots can only handle signals smaller than their power supply, sometimes quite a bit smaller than their power supply. The signal in a wah pedal gets bigger at resonance - that's what resonance is - and how big depends on what's feeding the wah circuit, the power supply on the wah pedal, and the value of the resonance resistor. Again, not impossible, but something to be addressed. Signal handling size is one of those things the digital pot data sheet would address.

It is possible that using an LDR-resistor circuit instead of the wah pot and doing an analog voltage sweep up/down to light the LDR would get you most of what you want. But that circuit gets complex too.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

suncrush

If I figured out how to do it with an Arduino, would that be transferable to a small, permanent microcontroller?

suncrush

Ooh, I'm brainstorming a vactrol-based design.

R.G.

Quote from: suncrush on September 09, 2016, 11:01:24 AM
If I figured out how to do it with an Arduino, would that be transferable to a small, permanent microcontroller?
Maybe. Arduinos are a highly specialized "sandbox" environment that shields you from a lot of the picky datasheet and application not stuff on the underlying microprocessor.  The program logic and code would be the same, but for a permanent uC, you'd have to add to it the picky stuff that the Arduino environment does for you to make just that one uC work with the code.

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

robthequiet

Is this not the same as a one-shot triggered envelope?

Rixen

Quote from: suncrush on September 09, 2016, 11:01:24 AM
If I figured out how to do it with an Arduino, would that be transferable to a small, permanent microcontroller?

Yes, I do this frequently, although sometimes there are things that don't work or don't work properly.

I think the easiest way is to read through this:

http://highlowtech.org/?p=1695

suncrush

I figured it out.  If you have a 256-step digipot, you need an 8-bit counter to control direction of the sweep.  With a 16-bit counter, you can use bit nine to control power to the 7555.  0=on, 1=off.  Then when it sweeps down, it'll kill the clock, and the digipot will stop changing.

If your counter is volatile, making the footswitch momentary off will depower everything, return the clock to 0, and start a new sweep.  You can also start a new sweep and any time with the switch for the same reason.


R.G.

Quote from: suncrush on September 12, 2016, 07:38:59 AM
I figured it out.  If you have a 256-step digipot, you need an 8-bit counter to control direction of the sweep.  With a 16-bit counter, you can use bit nine to control power to the 7555.  0=on, 1=off.  Then when it sweeps down, it'll kill the clock, and the digipot will stop changing.
??
If you have a 256 step digital pot, it's 255 steps up from 0 and 255 steps back down to zero. You could use bit nine to control the direction, not power to the 7555. You could use bit 10 to gate the output of the 7555, stopping the sweeping. This might be a reset pin on the 7555 or an external gate. On 555 family chips, the first interval from a fully discharged state is longer than later intervals. If you do it this way, you'd have to get the 0-state on bit 10 in the counter to be the correct polarity, so it inhibits your oscillator. Might be simpler to use a NAND gate.

QuoteIf your counter is volatile, making the footswitch momentary off will depower everything, return the clock to 0, and start a new sweep.  You can also start a new sweep and any time with the switch for the same reason.
Maybe. If your footswitch just pulled the reset line on the counter, that would not need de-powering everything. This is good because that particular digital pot does not start at 0 or 255, but in the middle (according to the article you quoted). So you need power-up to be special, running the digi-pot down to 0 with 127 "down" pulses before anything else happens.

But other than that, yes, using a counter for a state machine is a good idea. Again, I'd use an 8-pin uC, a pot (for sweep speed) and a footswitch. In fact, the logic winds up being a hardware implementation of the software.

I noticed last night that there is a mod to the stock Arduino setup that will let it program a ATtiny 44 or 45. That would do this job.  If you do it that way, the programming in the chip does a pre-setup of issuing 127 "down" pulses to the digipot (or whatever another digipot might need) and then waiting for a footswitch. When footswitch happens, set direction pin to "up", and pulse the count pin every so often at a rate controlled by the pot as read by the A-D on the chip. When you get to 255, flip the direction pin to "down", and count down 255, then stop. Two 8-pin chips, a pot, a switch. Probably a 78L05 to power them, although a 5V zener might work. hmmm. You'll probably need to bias the pot up into the middle of its 5V DC range to get best results on swing, so two caps and four resistors.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

potul

I remember having seen a design of a wah pedal that was doing exactly what you are looking for, 100% analog, without uC. If I remember correctly, it was using a slow discharging RC network and some sort of FET probably.
I will try to find it because I don't fully recall where it was.

potul

I found it.... I haven't tried myself, so I can't really tell if it works.

http://members.shaw.ca/roma/wah.html