potentiometer that acts as a rotary switch

Started by Dimitree, June 17, 2014, 06:32:43 PM

Previous topic - Next topic

R.G.

Quote from: Dimitree on June 19, 2014, 06:24:05 PM
Quote. Also think about whether some minor hysteresis on each comparator would be useful. In general, no comparator should be left entirely without hysteresis,
And how do I add that? Adding a capacitor to ground on the comparator input perhaps?
The simplest way is with two resistors; one from the output to the non-inverting input, another in series with the non-inverting input to the signal being compared. If you make the resistor from output to (+) input large compared to the other resistor, the output voltage pulls the (+) input voltage slightly higher or lower than it would otherwise be, and adds a small "snap over" zone where there can be no intermediate oscillation. Unless you have a need for specific hysteresis, making the positive feedback resistor quite large compared to the other resistors is a good idea. This adds only a few millivolts of hysteresis but eliminates the funny stuff at changeover. In this case, 1M and 1k would get you 10mV of hysteresis. It might be a good starting point.
Quote
Quote
Hmmm. Also, check out the common mode input range on your comparators. You're asking the comparators to function properly with an input at 0V. Some comparators can, some can't.
You mean 0V when the pot is fully on one side? If so, should I add resistors in series with the pot to limit the voltage range a bit?
Actually, I just read the datasheet. The LM339 happens to have a common mode range that includes ground. You're fine on this point, by lucky pick of the comparator.
Quote
Quote
. Also worry a little bit about whether the output dithering back and forth if the input signal has some ripple or noise on it and wants to sit right on the middle between two states will be a problem.
This only happens when the pot in near the limit between two states?
Yes. Having hysteresis helps, as you won't get random oscillations, but it would be even better to have your "select here" zones in your resistor chain separated by a few millivolts so that you have some dead zone where both comparators at the threshold don't try to flip at exactly the same time. Your xors help with this by including the lower comparator's output as a condition of the higher comparator output being gated through, but it can still get tricky at the transitions.
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.

boogietone

Hysteresis on the comparators will keep the output from bouncing back and forth when you are near/at the switching point.
An oxymoron - clean transistor boost.