Hello,
I have been searching around everywhere and cannot seem to find anything on converting servo pulses to degrees. Does anyone know how to do this?
Thanks.
Hello,
I have been searching around everywhere and cannot seem to find anything on converting servo pulses to degrees. Does anyone know how to do this?
Thanks.
You need to move the servo to known points, then assign an angle to these two points. For example if 1500 is centered, you move the servo by pulse control to -90° note the pulse required to do this. Move the servo to +90° and note the pulse required to do this. Then find the range, higher pulse minus lower pulse, then divide by 180°. Viola you now have a pulse to angle relationship.
Thanks Robot Dude.
I’d better try this…
Ok, I got it to work.
1500 / 8.3 = 180
It works perfectly! Thanks again.
Did your servo turn out to have a range of 1500 for 180°. Just want to make sure you really got it. It could be a coincidence that the range for your servo is the same as the centered value.
I took a 422 and connected it to an SSC-32, adjusted 90° left of center was 590 and 90° right of center was 2390.
2390 - 590 is 1800
1800 / 180 = 10
10uS per degree.
…lol I can’t even remember what I did.
Ah…I guess I have to try again.
I though the range of the 422 was 750 = left and 2250 = right?
Edit:
I remember what I did now. I did 2250 - 750 / 180 = 8.33333333333
Unless I’m wrong, 180 is the center of the servo, right?
Sigh… the answer to your question is in my post above. Any more input from me and I’m just repeating myself. Good luck with it.
heh let me give it a shot.
because servos vary from one to the next you need to actually measure a distance (in degrees) and relate that to the number of mS needed to travel the distance.
for instance if you send 1000mS the servo should be at about -45 degrees. mark the position on a protractor or something. now send the servo to 2000mS which should be roughly +45 degrees. Use the protractor to see how many degrees it actually traveled. now divide the number of degrees by (2000ms-1000ms) to get degrees / mS. so say for example (using the 1000 to 2000 values) the servo really traveled from -43 to +46 we have 89 degrees over 1000mS for 0.089 degrees / ms (which is pretty close the the oft quoted 0.09 degrees / ms).
now it doesn’t matter a whole lot whether you use 1000 to 2000 or 750 to 2250 so long as you measure the number of degrees and divide by the difference in ms. generally speaking the larger the degrees the more accurate your answer may be but there are some tolerances in servos themselves that probably limit the accuracy more than your measurement range so don’t go crazy over it.
QED?
:mrgreen:
EddieB, I think you’ve pretty much explained it to me. It would be a lot easier though If i had a protractor.
lol, I think they can be had in the school supplies aisle of any large-ish grocery store… be like $2 for $0.02 of plastic and $0.15 of packaging.
i’m not stupid. for one thing I don’t have a car 'cause i’m only 14 and my parents don’t have a lot of time to take me out to get pieces of plastic.
Now Brandon no one called you stupid…
Eddies method is using fixed pulses to determine the angles to do the math. My example uses fixed angles to determine the pulses to do the math. Both are very good solutions. But my method doesn’t require a protractor, just a piece of standard writing paper to use to get the +/- 90°range. dog ear the corner and line one of the edges with the centered position of the output shaft. It should be relatively easy to find the pulses that move the output shaft into the two extreme positions using the 90° angle standard on a piece of paper. 8) Then just do the math.
Or you can just use the 10uS per degree I found. It should be close enough for most Hitec servos.
I was only kidding.
Well, considering it means less work and less time for me, and the fact that you went out of your way to get this value, then I would be happy to use it.
One probably could print out a protractor from the images in the below google search (if one has a printer).