Shop OBEX P1 Docs P2 Docs Learn Events
what happens if I don't wait 20ms between pulses for servos — Parallax Forums

what happens if I don't wait 20ms between pulses for servos

MatthewMatthew Posts: 200
edited 2005-01-20 06:11 in BASIC Stamp
What happens if I don't wait 20ms between pulses for servos, and instead do it slightly quicker or slower?

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-19 13:51
    20 ms is optimal -- you will be fine with a delay of anything betwee 10 and 40 ms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-19 14:05
    The pulse repetition rate is sending a control signal to comparator hardware in the Servo. The specification is fairly loose -- 20 mSec to 50 mSec is acceptable -- and from what Jon says, 10 mSec will work.

    If you get too long, the Servo won't hold its position as strongly. I don't know what happens if you get too short, you'll probably confuse the comparator -- resulting in vibration? inconsistent positioning? I don't know.

    So set your refresh for 20 mSec, and then whatever other code runs has to complete in 30 mSec so the refresh doesn't get too long. This is perfect for the BS2, since it can do a lot in 20 to 50 mSec, and you don't HAVE to refresh the servo right on the dot.
  • MatthewMatthew Posts: 200
    edited 2005-01-20 06:11
    This is great. I love microcontrollers!

    Thanks guys.
Sign In or Register to comment.