How to control the speed of a servo motor?

Discussion in 'Embedded Systems and Microcontrollers' started by thar07, Mar 25, 2015.

  1. thar07

    Thread Starter Member

    Jan 3, 2015
    71
    0
    what are the methods available to control, speed up and slow down, the speed of a servo motor ?
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,555
    2,375
    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.
     
  3. thar07

    Thread Starter Member

    Jan 3, 2015
    71
    0
    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.
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,555
    2,375
    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.
     
  6. thar07

    Thread Starter Member

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

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    ...like I said:
    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...
     
    thar07 likes this.
  8. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,699
    907
    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
     
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,555
    2,375
    [​IMG]

    upload_2015-3-26_9-0-29.png

    Max.
     
  10. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    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.
     
  11. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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).
     
  12. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    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?
     
  13. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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.
     
Loading...