Shop OBEX P1 Docs P2 Docs Learn Events
control a servo motor — Parallax Forums

control a servo motor

gregory12345gregory12345 Posts: 10
edited 2009-06-05 04:43 in BASIC Stamp
Hi all,

I am working with servo motors and using basic stamp B2sx to program it. I have figured out that it needs a value of 500 to 3000 to get from 0 degrees to 180 degrees. Can anyone help explain to me why 500 to 3000?

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2009-06-02 13:30
    Greg

    Servos are controlled with a pulse width. Most are 1000uSec for full left, 1500uSec centered,and 2000uSec full right.The pulse width must be updated typically 50 times a Sec. or every 20 milliSec. Different Stamps run at different CLK. speeds So then CON values will vary from one stamp to another

    Take a look at experiment#26 pg.146 of the Stamp Works Manuel for more info.

    _________$WMc%______

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • W9GFOW9GFO Posts: 4,010
    edited 2009-06-02 14:09
    $WMc% said...
    Most are 1000uSec for full left, 1500uSec centered,and 2000uSec full right.

    I think that is the more of a standard range than the limits of movement. Most (because I have not tried every one) of my servos respond to values between around .500 mS to 2.500 mS for approximately 180 degrees of total travel.

    Rich H
  • gregory12345gregory12345 Posts: 10
    edited 2009-06-05 04:24
    hi! i am using a basic stamp BS2sx, and 1 unit in that stamp is 0.8microseconds. Which means, the value of 500 is 500 * 08microseconds = 0.4ms . and the value of 3000 is 3000 * 0.8micros = 2.4ms. So this means my servo goes from 0 - 180 with 0.4ms-2.4ms pulsewidth instead of 1ms - 2ms?
    thx
  • W9GFOW9GFO Posts: 4,010
    edited 2009-06-05 04:43
    The pulsewidth where servos hit their stops is not the same for all servos. Be sure not to use a value so high (or low) that the servo is pushing against the stop.

    If 1 unit equals .8 uS then,

    Center = 1500 uS = 1875 units

    LowEnd = 500 uS = 625 units
    HighEnd = 2500 uS = 3125 units

    NormalHigh = 2000 uS = 2500 units
    NormalLow = 1000 uS = 1250 units

    So I would say that your servo is behaving pretty much as expected. Remember though, typical range used for servos is much less than 180 degrees even though most can go that far - or even further.

    Rich H

    Post Edited (W9GFO) : 6/5/2009 4:54:05 AM GMT
Sign In or Register to comment.