Metastable
Nuclear
- Jan 17, 2013
- 2
thread240-291259 in 2011 never arrived at an elegant solution. I think this is such a solution, using two analog multiplies:
If C1, S1 are the cosine and sine outputs of potentiometer 1, and C2, S2 are from pot 2, then
C1 * S2 - S1 * C2 = sine of error angle.
Similarly,
S1 * S2 + C1 * C2 = cosine of error angle.
You could find some analog ATAN2 function, and get a nice linear sawtooth error signal from -PI to +PI, but simply using the sine of the error angle might be the gentlest to your system (when slipping cycles, especially). The sine function kind of saturates at +/- PI/2, then kind of gives up as you approach +/- PI, instead of throwing your motor a sharp discontinuity as it crosses PI.
If C1, S1 are the cosine and sine outputs of potentiometer 1, and C2, S2 are from pot 2, then
C1 * S2 - S1 * C2 = sine of error angle.
Similarly,
S1 * S2 + C1 * C2 = cosine of error angle.
You could find some analog ATAN2 function, and get a nice linear sawtooth error signal from -PI to +PI, but simply using the sine of the error angle might be the gentlest to your system (when slipping cycles, especially). The sine function kind of saturates at +/- PI/2, then kind of gives up as you approach +/- PI, instead of throwing your motor a sharp discontinuity as it crosses PI.