Toy Servo Control Question:

I am playing with a small and medium servo. I have gotten it to mostly work and understand the signals are in ms control 75 - 225 etc. What I have not been able to do is accurate positioning via say, three buttons for three different positions. I guess my main question is can a toy servo be accurately positioned with ms and if so what concept am I not understanding.
 

hippy

Technical Support
Staff member
I would have expected the servo to be positionable. Most servos are controlled by a 1ms to 2ms pulse every 20ms. The 75-225 value in the SERVO and SERVOPOS commands should cover that range of pulses.

Perhaps post the code for what you have. If you are repeating SERVO commands too quickly that might be the issue. Using a SERVO at the start then SERVOPOS later may solve the problem.
 

erco

Senior Member
Most cheap servos have good accuracy and repeatability. They need a constant stream of ms pulses, so you should either use the SERVO command or make your program loop to send nonstop, properly spaced pulseouts.
 

papaof2

Senior Member
What erco said.
The servo needs a continuous reference about where it should be as it is constantly comparing its position (via internal feedback) to the "Where should I be?" of the incoming datastream. If there is no constant stream of pulses, the servo can NOT hold a set position.
SERVO for the first command, then SERVOPOS for any changes to have that constant stream of pulses.
 

lbenson

Senior Member
I am sure there are differences by server, but I have found that for my pan and tilt rivercam, the servos hold if you give them 2 pulses (but not with just one). Live minutes ago:
25967

I'm happy to be in Florida, 1,440 miles away as the crow flies (if the crow could fly that far over water most of the way).
 

erco

Senior Member
Agreed, you can stop the pulse stream after the servo moves to its new position, however long it takes to get there. A servo will stop in its last position when the pulse stream stops, but it won't hold that position against external loads. Different servos and the voltage used will affect transit speeds.
 

hippy

Technical Support
Staff member
I have found that it's mainly the pulse width which is important, that the frame time or repeat rate is much less critical but YMMV.
 
Top