Shop OBEX P1 Docs P2 Docs Learn Events
More help with servos — Parallax Forums

More help with servos

StickySticky Posts: 42
edited 2009-04-20 00:59 in Robotics
Hi I need some more help with servos. I got the ping servo centered and it works but I'd like to understand how it works. I read the BOEBOT manual (Roboticsv2_2.pdf) and from what I understand a pulsout XX, 750 , pause 20 should center the servo, ok it sort of does. I tried a pulsout XX, 650 , pause 20 and the motor turns a bit and then stops. If I run the program again the servo doesn't turn again. If I do a pulsout XX, 850 , pause 20 it turns the other way and if I go back to the 650 it turns a bit again. I have the servo attached to the servo connector at the pin 13 spot. I cut and pasted the code, here it is:

' Robotics with the Boe-Bot – ServoP13Clockwise.bs2
' Run the servo connected to P13 at full speed clockwise.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
DO
PULSOUT 13, 650
PAUSE 20
LOOP

It won't turn in a circle. I've tried a fresh 9 volt energizer and then a wall plug 8 volt dc converter, I've tried using the jumper at vdd and vin. I've tried it at another pin. Any ideas what I am doing wrong?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-19 21:47
    It sounds like you have a conventional servo as opposed to a continuous motion servo. Servos normally move to a position specified by the pulse width of a control pulse. With a BS2, the width of the pulse is twice the value given in the PULSOUT statement (in microseconds). A value of 750 gives a pulse width of 1500us or 1.5ms. Servos respond to pulses roughly from 1ms to 2ms in width with 1ms as one end of the range of travel and 2ms as the other end of the range. Continuous motion servos have the servo mechanism disabled so they move continuously in one direction with a pulse width of 1ms and continuously in the other direction with a pulse width of 2ms. A 1.5ms pulse causes the servo motor to stop and pulses in between cause motion at speeds roughly proportional to the pulse width (relative to stop).

    The "Robotics with the BoeBot" tutorial has a discussion of servo motors and how to control them with Stamps.
  • StickySticky Posts: 42
    edited 2009-04-19 23:45
    Thanks again, the servos are Parallax standard servos so I took it for granted that they were continuous. I missed the part about the different kind of servos that existed in the Robotics manual, I'll reread it.
  • StickySticky Posts: 42
    edited 2009-04-20 00:59
    The secret to the whole mystery was using the documentation for the PING))) Mounting Bracket Kit, everything was perfectly clear after that. I was looking at the BOEBOT documentation -bah!
Sign In or Register to comment.