Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Analog error angle between two sine-cosine potentiometers 1

Status
Not open for further replies.

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.
 
Replies continue below

Recommended for you

Sounds just like zekeman's solution to me. Besides, the OP found a superior (to them) solution - detect the quadrant and drive towards same quadrant if they're different, then use sine or cosine as error depending on the quadrant. Ultimately both solutions simply consider [tt]sin(a)[/tt] and [tt]cos(a)[/tt] as approx equal to [tt]a[/tt] over a certain domain, which for control purposes is probably fine since they tend towards the same values.
 
LiteYear, I agree with you. I saw "synchro" and my eyes just glazed over. Then all I saw were all the quadrant detections, and I didn't like that as a purist. I never registered that zekeman had a good small-angle solution.

Good catch!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor