[sdiy] sin/cos pot
Ove Ridé
nitro2k01 at gmail.com
Tue Jul 11 01:41:44 CEST 2017
On 11 July 2017 at 00:36, <rsdio at audiobanshee.com> wrote:
> I see your point, but I don't think that there is always a difference in a practical implementation - at least not for embedded systems.
Actually, come to think of it, triangular would be better be better
than an actual sin/cos response in two ways. In terms of pot
construction, since all you need is a linear (ie constant width)
carbon track. And also from a software point of view, since the
voltage changes linearly with the angle, so the math becomes simpler.
Actual cos/sin would have one advantage over triangles, though. Since
a sinusoid is naturally flat on its peaks, the problem of the
flattened peak of the triangle becomes less of an issue. This has
mathematical justification too. While a triangle function is
continuous, it is not smooth -- it's derivative is a square wave,
which is discontinuous at those points. As one might predict, it's not
ideally represented in the real world! For sinusoids, you could use an
arcsin law on the input values, and then proceed with the same math as
with a triangle wave.
> Even with the triangular waveform pot response, as soon as the wiper gets close to an extreme it becomes more difficult to determine whether it is right before or right after the peak, since both product the same voltage. At that point, you might as well focus on the other dimension because it has a clear indication of the position as long as you're aware of the polarity of the dimension near an extreme.
Yes, indeed, you would have to use some strategy of discarding values
near the peaks if you wanted ideal linearity. Although, a naive
average of the two would cut that error in half, since one value would
be guaranteed to come from a linear region.
> Two linear ramps would be practically the same, because when one is in the region of discontinuity, you can just focus on the other dimension for an accurate reading. There are certainly endless pots designed this way, and the associated firmware can handle it.
I'm sure it can be done, but here are the problems I see with it: You
need a physical discontinuity in the taper. As the wiper moves across
a discontinuity, the user might feel a slight detent in the movement.
(Not sure how significant this is in practice.) But worse, I'd fear
that the wiper, if left in a position where it's disconnected from the
taper, could pick up interference from the surrounding world and give
erroneous values. You could create solutions to that, like using a
metal enclosure that's grounded for the pot body, external pulldown
resistors or handling it in software by discarding changes that seem
to move impossibly fast from the previously read value. But, this is a
problem that a cos/sin type pot fundamentally doesn't have since its
taper is a continuous track all the way around.
--
/Ove
Blog: <http://blog.gg8.se/>
"Here is Evergreen City. Evergreen is the color of green forever."
More information about the Synth-diy
mailing list