How to control the speed of a servo motor?

MaxHeadRoom

Joined Jul 18, 2013
28,617
When you say Servo Motor, it depends on whether you wish to incorporate it in a PID (closed) loop or open loop velocity mode.
Usually now either is done with PWM to drive the motor itself.
Need a little more on the application?
Max.
 

Thread Starter

thar07

Joined Jan 3, 2015
71
When you say Servo Motor, it depends on whether you wish to incorporate it in a PID (closed) loop or open loop velocity mode.
Usually now either is done with PWM to drive the motor itself.
Need a little more on the application?
Max.
I'm planing to use two servo motors ( for the wheels ) for a simple line following robot but I don't know how to control the speed. That is why I asked the question.
 

tshuck

Joined Oct 18, 2012
3,534
It's also important to make the distinction between servomotor and those R/C servos. Judging by the application, it seems you are trying to use some continuous rotation R/C servos, in which case, the speed is controlled by the 10-20% PWM signals a standard R/C servo expects.

See here.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
You either need to use steppers that move a prescribed number of steps with no feedback, or as i said before, if you are looking at servo motor with PID you need a feedback element attached to the motor and some kind of drive that monitors the loop and provides the necessary power to the motor, this especially if you want synchronization between the pair of motors.
With no feedback, the rpm can change with load, regardless of the controller.
Max.
 

Thread Starter

thar07

Joined Jan 3, 2015
71
Ok then. If could please tell me how to control the speed of the "SG90 9G Micro" servo motor when there is no load ?
 

tshuck

Joined Oct 18, 2012
3,534
Ok then. If could please tell me how to control the speed of the "SG90 9G Micro" servo motor when there is no load ?
...like I said:
[...] the speed is controlled by the 10-20% PWM signals a standard R/C servo expects.

See here.
If you are trying to control the speed at which it moves to the commanded position (not continuous rotation), the only way I can think to do it is to command it to a much farther point in the sweep and quickly switch the command to the desired point.

Anything else and you'll likely have to replace the electronics in the servo...
 

jpanhalt

Joined Jan 18, 2008
11,087
The way I think speed to a commanded position is controlled is by taking small steps (say 0.5 to 2 uS) at various rates. For example, if the step was 1uS and the rate was one step per 20 milliseconds, moving from a position of 1.5 mS pulse width to 1.8 mS pulse width (i.e., 300 uS change in pulse width) would take 6 seconds. That would be quite slow. Most variable speed applications are for things like flaps, landing gear, and canopies.

John
 

John P

Joined Oct 14, 2008
2,025
I still don't understand how you can "use two servo motors ( for the wheels ) for a simple line following robot" if you want to use conventional hobby servos, because those are limited to 90 degrees of travel (sometimes more, but that's standard). But if the subject has now changed to how to drive hobby servos so as to control the speed, by far the easiest way to do it is with a microcontroller. I'm sure there's a way to do it with analog components or digital counters, but it's going to be pretty complicated.

My limited experience is that at low speeds, hobby servos can be quite jerky, not giving you an arbitrarily low speed at all. The kind with a digital processor inside seem much better, if that's what you need.
 

tshuck

Joined Oct 18, 2012
3,534
The hobby R/C servos can be modified to allow for continuous rotation by taking the potentiometer off of the drive shaft (and removing any physical blocks).

It is common among hobbyists to use these servos as motors - it's got a gearbox, is small, is easily controlled, and doesn't require a special motor driver, all for the low cost of a servo (as compared against the "normal" method of sourcing your own parts).
 

John P

Joined Oct 14, 2008
2,025
OK, but the guy hasn't mentioned modifying his servos, and if he does that, I wish him good luck on controlling the speed, or for that matter making sure that the motors ever stop. Yes, 1.5msec pulse to stop the motor, but will it, really?
 

tshuck

Joined Oct 18, 2012
3,534
OK, but the guy hasn't mentioned modifying his servos, and if he does that, I wish him good luck on controlling the speed, or for that matter making sure that the motors ever stop. Yes, 1.5msec pulse to stop the motor, but will it, really?
A continuous rotation servo is the only way one could use a servo to drive the wheels, that I'm aware of, without some additional mechanical linkages.

It's hard to know for sure when the OP refuses to give anything other than little bits of information at a time.
 
Top