Servo Controll

Hello,

When I send T=1500 to a servo this is the nutral position.
When I wont the servo move for 45 degrees to the right what do I need for T?

Is there a general formula?

I will use this to calculate the distance from the central hart of the robot arm.

Thanks in advance.

Jan Kromhout
Hellevoetsluis-NL

Hi,

I guess this is a more general question and the T is just a variable you are using for the actual pwm value.

Answer to your question would be:

T = (((Angle+90)/0.10588238)+650)

When Angle=0 the T would be 1500 and Angle=45 gives a T=1925.

But you would get an even better result if you calibrated each servo for finding the actual pwm/deg factor.

Or you could use LynxTerm, SEQ or something similar to find the “numbers” you need to position your servos.

Having an algorithm would of course fit into a dynamic program easier. And if you do IK, you’ll need to do just such an equation. Study either the arm or the hexapod code available, and you’ll see the steps necessary.

Alan KM6VV

Could be he’s asking for SSC-32 help. If so it’s not T that sets the position, but P instead.

Check out the manual.
lynxmotion.com/ViewPage.aspx … ID=70#serv

Only Jan know the answer to that…

I was thinking the same, but since he didn’t mention the SSC or that he had problem controlling the servo at all it sounded more like a general question.

Jan,

Study the hexapod code, you see typical values for T. You’ll also find scaling calculations to convert degrees to PWM values.

Code from AH3R:

[code]HipH_Pulse(Index) = (((HipH_PulseMax - HipH_PulseMin) * (HipH_Angle - HipH_AngleMin) / (HipH_AngleMax - HipH_AngleMin) + HipH_PulseMin) max HipH_PulseMax) min HipH_PulseMin

serout SSC32,i38400,"#",RRHH,RRHH2,“P”,DEC HipH_Pulse(0),"#", “T190”,13][/code]

Here HipH_Angle is scaled by the Angle min/max and Pulse min/max values defined elsewhere in the program.

the snip of serout code shows the resultant HipH_Pulse being sent with a time of T190. Don’t forget the carriage return (13).

Alan KM6VV