Shop OBEX P1 Docs P2 Docs Learn Events
Servo Programming help — Parallax Forums

Servo Programming help

stevertrstevertr Posts: 14
edited 2010-08-23 18:52 in BASIC Stamp
Hey all,

Hope everyone is having an awesome day.

Can one of you experts help me with something please?

I received our servos today
http://www.servocity.com/html/hs-225mg_mighty_mini.html

I need to create a command string which will rotate the servo 180 counter-clockwise as rapidly as possible, then wait a given time, lets say 2 minutes, and rotate it 180 clockwise.

This shows what pulse it needs to move to each position but I'm not sure I understand it.
http://www.servocity.com/assets/images/Servo_Angle_Schematic_180_3.8.jpg

Regards

Steve

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-23 18:52
    Most servos require a pulse whose width specifies the servo position. The minimum range is 1ms to 2ms although most servos will respond to pulses in the range 0.5ms to 2.5ms repeated about every 20ms. There's no exact correspondence between pulse width and servo position and each different servo has to be calibrated individually although 1ms and 2ms commonly result in positions about 100-150 degrees apart.

    Parallax has a tutorial called "Robotics with the BoeBot" which contains lots of information on servos and examples of their use with a Stamp as controller. You can download it from Parallax's download page. Go to their main webpage and click on the Downloads button.

    You'd use the PULSOUT statement to generate the pulse and the PAUSE statement to produce the 20ms delay between pulses and the 2 minute pause (about 1 minute per maximum PAUSE).
Sign In or Register to comment.