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!

Servo Control with Sine Cosine Potentiometers 2

Status
Not open for further replies.

AndreyG

Electrical
Nov 24, 2010
29
Servo control with Sine cosine potentiometers.

I have controller and motorized rotating device both rotating over full 360 degrees – no limits. Both Controller and device are equipped with Sine Cosine Potentiometers.

I am looking for simple (and preferably analog) way to compare outputs of the two Sine Cosine Potentiometers and generate error signal.

 
Replies continue below

Recommended for you

Square-up the circle:

If X is low, use Y
If Y is low, use X
If X is high, use -Y
If Y is high, use -X

Where X and Y are the two error signals.

Maybe.
 
Analog Devices and others make various 4 quadrant multiplier/divider and log/antilog blocks that can approximate various trig functions via approximations such as truncated Taylor expansions and exponentials.

For example, according to my old copy of Analog Devices "nonlinear circuits handbook", arctan(Vb / Va) is approximately
pi/2 * [(Vb/Va)^1.2125] / [1+[(Vb/Va)^1.2125] over one quadrant.
A couple comparators to detect the quadrant and a couple absolute value circuits and there you go.

Of course it'll probably cost you more than a PIC or Atmel chip with a couple 10 bit ADCs and a PWM output, and there may be some glitches when you cross from one quadrant to another.

I did something similar with an analog joystick, converting the position to a color circle and controlling a 10 watt RGB LED for a small spot light using an Arduino.
 




Looks like the resolver synchro methods of yesteryear. Not the beat way to do it but consider the derived signal

sinA*cosB-cosA*sinB=sin(A-B)


The error is A-B . The servo "error" can be sin(A-B)used to drive the system to null error since as the error approaches 0 the sine and the angle are almost equal, thus approaching a linear servo.
But when A-B=+-Pi the system is unstable and will quickly go towards A=B.t can be "pushed " to speedup the response by considering the derived signal

CosAcosB+sinAsinB=cos(A-B)

At +-Pi this is =-1 so the test for null is only achieved when cos(A-B)=+1
 
Just noticed that the "error" term I cited above can be improved by dividing the 2 signals
sin(A-B)/cos(A-B) which is
tan(A-B)
For values in the range -Pi to +Pi the error has the correct polarity albeit that it is nonlinear; but similar to the sine (A-B), it behaves linearly as the error approaches the null.

The differential equation that describes the servo dynamics for this system is approximately

JA"+CA'=Ktan(A-B)


Providing the gain K is not too large this system should be well behaved> The low frequency inherent in a follower system described makes this very attractive.i.e., as B moves A should follow very closely with proper values of K and the damping term C.

 
Corrections:
sign error

JA"+CA'=-Ktan(A-B) which has the correct polarity in the range
-Pi/2 top +Pi/2

To cover the entire range
-Pi to +Pi you can use

sgn{cos(A-B)}*tan(A-B)= sin(A-B)/abs[cos(A-B)] as the error function

where
sgn means sign Of

 
AndreyG,

I would be curious about your choice of a simple controller?

I think you have 2 viable simple solutions, 1 posted by IRstuff and one posted by me.

IRstuff solution is linear butI believe more complicated since the atan is duplicit in 2 quadrants at a time .

The ones I proposed, (and now I am leaning to the sine(A-B)) solution is straightforward involving only 2 multiplications and a subtraction of signals and using only the two pairs of sine/cosine pots you have,

sinA*cosB-cosA*sinB=sin(A-B) for the range -Pi>(A-B)<Pi

BTW, this is not my invention. I believe I have seen it in the distant past and even used it some 40 years ago.

The beauty of it is that there is only one stable solution to the dynamics problem , (A-B)=0; (A-B)=+-Pi is unstable and will quickly go toward the stable solution.

This means that if you turn the system "on", no matter where the motor and joystick are the motor will go toward the null and once the motion is established the control will be linear and accurate considering the low frequency of the input.

I must say in the interest of full disclosure I am not an agent for the sin(A-B) people, but only give my opinion based on merit.



 
I made it working on PLC: I detect in which quadrant is controller and the motor. Move motor to the same quadrant as controller. Then I compare Sin 's or Cos ' depending which quadrant i am. I select quadrant boundaries as +/- 45 degrees (+ 90 deg increment) so Sin A is almost linear (quadrants 1, 3) or Cos A is almost linear (quadrants 2, 4). That's the core idea.
 
Very nice. Novel concept. I see, you get 4 linear quadrants and once you get the motor to enter the quadrant of the controller you're in the linear region where you easily get a lock and for the low frequency motion of the joystick,it will follow but what happens when the controller passes thru the quadrant boundaries. I guess you have some additional logic to make it seamless.

Alas,the joys of the PLC and logic.

But I'll take the poor man's solution of sin(A-B) for my "money"... no
money, no logic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor