Solutions for Erratic Potentiometers?

Treebeard

Member
Hello,

I'm currently in a bit of a pickle regarding a batch of 60mm, 10k linear potentiometers that I received.

For this application, I have used some Bourns sliders in the past; however, there were some changes in the availability/manufacturing of those parts: the specific item skew is no longer made/stocked as of 2020 and what was recommended as an alternative(PTL60-15G1-103B2) has a small detent in the middle which prevents continuous, smooth travel over the length of the slider. Additionally, the operating force to move the slider is greater than the older model. Both Digikey and Mouser suggested I try an Alps alternative (RS6011SP6003), as the only thing I would be losing is the LED and the operating force is closer to the discontinued Bourns pot—not that big of a deal. I have a box of motorized Alps that I like, so I didnt think twice about the substitution.

Having gone through the shipment, I weeded out the lemons that were clearly DOA; however, after trying some on a few test boards, I keep having some weird-sporadic readings that I'm not sure are a reflection of the potentiometer quality or an indication that I also need some filtering before the ADC.

Typically, I have been able to get away with predominately handling all filtering via software, but right now, I will sometimes get random spikes from say, 240 up to 1023 for a split moment and then have it come back to 240. That, or it will skitter around +/- 20 when moving through certain zones before settling down to the current value the potentiometer. It isnt consistent, though. Sometimes restarting the whole circuit/Teensy alleviates the problem for awhile.

Usually, I have found this means something has damaged the potentiometer, but at this point I have had this behaviour across enough of the "not clearly dead pots" that means I either gotten really unlucky with my order from Mouser, or I'm just not accounting for the components that I received and their idiosyncrasies. That said, I have broken a few of these Alps faders by just putting the knobs on, so I'm also worried that these are just really delicate.

On the software side, I'm currently applying some hysteresis to a fader class that I made in a separate c++ file—nothing really else:

Code:
PotArray[i]->FaderRead(); 
if (PotArray[i]->currentPinRead > (PotArray[i]->hystPinRead + PotArray[i]->hystValue))
{
	PotArray[i]->currentPinRead = PotArray[i]->hystPinRead;

	//call decrease
	if (PotArray[i]->pDecrease) 
	{
		PotArray[i]->pDecrease(PotArray[i]->currentPinRead, PotArray[i]->IconstMidiChannel, PotArray[i]->IconstMidiCc);
	}
}
else if (PotArray[i]->hystPinRead > (PotArray[i]->currentPinRead + PotArray[i]->hystValue))
{
	PotArray[i]->currentPinRead = PotArray[i]->hystPinRead;
	// call increase
	if (PotArray[i]->pIncrease) 
	{
		PotArray[i]->pIncrease(PotArray[i]->currentPinRead, PotArray[i]->IconstMidiChannel, PotArray[i]->IconstMidiCc);
	}
}

Same logic checks for if the value is not changing.

What other solutions are available for smoothing out and potentially dealing with noisy potentiometers, or am I dealing with problematic hardware?

Having gone through this and a few other forums, here are some things I have found but am not currently implementing:

1) Placing a .1uF ceramic capacitor on the analog pin to ground.
2) Making a RC Lowpass filter on the analog pin to ground
3) Apply an EMA to average the values in code.

While I understand 1 and 3, I'm not quite sure how to determine the correct Resistor and Capacitor combination values for 2. What frequency should I be aiming for, if this is the better option, and when given the ability to modify both Resistance and Capacitance values in that formula, which of the two should I favor? I have seen threads where some people prefer a larger value capacitor and smaller resistor and others that suggest to weight the resistance more than the capacitor.

Finally, in addition to utilizing either 1 and 2, would it still be advisable to do an EMA calculation pre or post hysteresis?

The biggest thing I am trying to avoid are the large, short lived spikes from relatively small values up to max, as this could blow out some equipment and synths on the other side.
 
Typically, I have been able to get away with predominately handling all filtering via software, but right now, I will sometimes get random spikes from say, 240 up to 1023 for a split moment and then have it come back to 240. That, or it will skitter around +/- 20 when moving through certain zones before settling down to the current value the potentiometer. It isnt consistent, though. Sometimes restarting the whole circuit/Teensy alleviates the problem for awhile.

One thing to check is to make sure that you are *not* calling pinMode with INPUT or INPUT_PULLUP for the mode on the analog pins you are using to read the pots. See <this> post for more background. I missed if you said exactly which Teensy you are using, but the info at the referenced link should apply across the entire Teensy family.

Mark J Culross
KD5RXT
 
How many sliders are you using? Are they going through a multiplexer? Do they need some contact cleaner (IPA) on them?
 
Its wise to always use caps wiper-to-ground to prevent RF pickup. Value is not critical for this use, but should be ceramic and 1nF or more will work, close as possible to the analog pin on the Teensy. With a fader the tab sticks up through the box like a little antenna - which is exactly what it is if there's a nearby mobile phone, for instance. Rotary pots can be nicely shielded by a metal enclosure and might be fine as is, but faders are open to RF ingress by their nature.

To smooth over scratchy pots you'd pick a sensible time constant that is long enough to combat the scratchiness but retains rapid reponse to movement, 1/20 of a second perhaps, which for 10k pot means 22uF electrolytic or so. This won't help much with RF though, so you might want both caps. The placement of an electrolytic isn't critical like an RF suppression cap.

I find it hard to believe a batch of genuine Alps faders are so bad, perhaps some grey imports have snuck into the supply chain. Or perhaps its some RF...
 
Hi All,

Thanks for the comments!

Regarding the number of pots, I'm just running 8 that are going directly into their respective pins. No multiplexers for this one.

Regarding the large value spikes, I was able to curb this via modifying the ResponsiveAnalogRead library via its default functionality but also adding in a value check to make sure that it drops any errant spikes, either up or down. That has all been perfectly fine!!!

However, a new problem has crept up.

Currently, one of the faders seems to be acting up, see picture from Cubase with original data and desired line. Unfortunately, this occurs randomly, but it has been getting worse. This did not occur when I made my original post, but it has been becoming more frequent.

Unfortunately for me, the values that it likes to dance around within my +/- range, and I have not been able to settle in a value via the original ResponsiveAnalogRead lib that curbs the new issue.

Scratchy Data:


ScratchyPot_OriginalData.png


Desired Data:
ScratchyPot_DesiredData.png



I have some Faderlube coming in, so hopefully this is just a case of a dirty pot, but I'm wondering if this is something that can still be addressed in code or if it is a component issue at this point.

I think from now on, when I have a board made, I should probably just add the smd footprints into the design and solder them on as needed. I was hoping to keep them as "snappy" and responsive as possible, but I do not remember the last time I have had this many issues until this shipment of pots.
 
Back
Top