PDA

View Full Version : [Question(s)] Servo mirroring



ohbowz
10-24-2010, 06:41 PM
What is the easiest way to have two servos moving mirror opposite to each other? So if one servo is at 150 degrees, the other will be at 30 degrees? What would the math look like? I'm going to be using the AX-12 servos to do this. Any suggestions, insight?

Since the AX-12 have 150degrees as a halfway point, (instead of 90) would that change the approach? So if one servo is 120 degrees, I would want the other to be 180 degrees. I might be answering my own questions here, but I want to be sure...

if servo1 = 120
servo2 = (150 - 120)+150
servo2 = 180

would this work?
if not I'm looking for the best way.

thanks!
-joe

billyzelsnack
10-24-2010, 07:59 PM
x=1023-x ?

Mitch
10-24-2010, 10:09 PM
if the range of x is known

inverse = maxRange - x

so... for 180

x = 160
xInverse = 180-x


for 300

x = 234
xInverse = 300 - x

MikeG
10-25-2010, 09:21 AM
Billy absolutely right.

I use trig functions so position calculations are not coupled to the AX-12 hardware values. Then simply convert angles to AX-12 goal position. Also the center value of 150 is is only a reference. Center can be whatever you want.

ohbowz
10-25-2010, 06:13 PM
Thanks everyone, the solution seems pretty straight forward.
I appreciate the help.