Shop OBEX P1 Docs P2 Docs Learn Events
Servo control - cannot reverse — Parallax Forums

Servo control - cannot reverse

nader9nader9 Posts: 9
edited 2010-02-03 18:32 in Robotics
Hello,

I'm using a Standard Servo and have to questions;

1. Is there a way to center the Servo with a pulse ?
2. Using the following code (where MFwdSlow=800 and MRevSlow=700):

'move 90 East from center
FOR mv = 1 TO 200
PULSOUT MMotor,MFwdSlow
PAUSE 20
NEXT

'move 270 west
FOR mv = 1 TO 200
PULSOUT MMotor,MRevSlow
PAUSE 20
NEXT

I've tried many (and obv. not enough) pulse values mentioned in forums and manuals but the Servo continues to rotate East. Whats wrong ?

regards

Comments

  • dandreaedandreae Posts: 1,375
    edited 2010-02-03 15:53
    Here is a code that centers the servo:

    DO
    · PULSOUT 14, 750
    · PAUSE 20
    LOOP

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-02-03 16:40
    I assume your using a continuous rotation servo (sounds like you are)........

    Send the code to the servo that Dave Andreae posted. The use a screwdriver to adjust the balance pot on the servo until it stops rotating. It should work great after that.
  • ScopeScope Posts: 417
    edited 2010-02-03 16:52
    What if it's not continuous rotation? How would you center it then?

    I can do this w/my r/c servos - I just plug them in and make sure my trim tabs are centered but I'm not sure I know how to do this w/standard rotation servos using a BOE, or similar.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-03 17:13
    You use the little program that Dave posted in order to move the servo to the middle of its range, then you remove the screw in the middle of the disk or "horn" or whatever you're using on the servo shaft and turn it so it's centered, then reinstall the screw. Because there are splines on the servo shaft, the center position is not infinitely adjustable. If it's still off a little and you can't mechanically center it, you may have to use a different pulse width for center instead of 750 (1.5ms). It's kind of a trial and error process to get it right on. Maybe center would be 745 or 755 or 747 or 743. If you have to do this, you'll have to adjust your programs as well since most assume that center is 750. In cases where this has been an issue, I've defined a constant called CENTER as 750 and everything in the program is in terms of this. If I have to adjust the servo's center position, I can just change the constant definition and recompile the program and it's all adjusted.
  • nader9nader9 Posts: 9
    edited 2010-02-03 17:57
    The Servo is a Parallax with a a tag on STD, so its not a cont. rotation.
    I've tried all 745, 755, etc.. and no the servo does nothing.

    Nevertheless, I also can't make it reverse.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-03 18:28
    All of the things suggested will work if you have a standard servo. If the servo only moves in one direction no matter what you send it in terms of pulses:

    1) The servo might be a continuous motion servo despite what's marked on it (unlikely, but possible). Try pulse widths of 1ms, 1.5ms, and 2ms (PULSOUT values of 500, 750, and 1000) and see what happens.

    2) The servo might be a continuous motion servo with the calibration pot way out off center. If there's no calibration pot, it has to be a standard servo.

    3) The servo might be defective.

    If the servo just doesn't move, all sorts of things might be wrong from a bad connection, no power, bad Stamp, etc. It sounds like this is something that can't be solved via this forum. Call Parallax Tech Support.
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-02-03 18:32
    Also note that the "500, 600, 750 (center), 800" values are for a BS2 'plain'. If you have some other 'flavor' of BS2 (like a BS2-sx for instance) then the constants need to be changed.

    The goal is to output a 1.5 millisecond pulse. "PULSOUT MyPin, 750" will do that for a BS2 'plain', but other flavors need "PULSOUT MyPin, <some-other-number>" to generate a 1.5 mSec pulse.
Sign In or Register to comment.