Shop OBEX P1 Docs P2 Docs Learn Events
Servo rotates when turned on — Parallax Forums

Servo rotates when turned on

asptamerasptamer Posts: 3
edited 2008-05-18 16:25 in BASIC Stamp
Hello.

I'm using BS2 with parallax servos (continuous rotation and modified standard) and I'm afraid that I've stumbled onto something that will give me trouble unless I find a workaround.
The moment I turn on the board, the servo rotates a little bit independently of what the program is. I realize why this happens, but is there a way to make it NOT rotate?
How do people deal with this? If I'm building a robot with several servos, I don't want them to rotate the moment I turn my robot on... They should only act if I'm telling them to do so via program.

Please help!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-17 12:14
    Have you "calibrated" your servos so that the initial control pulse output by your program is the width (usually 1.5ms) needed for no movement.

    Other than that, there's not much you can do. You might do better with various digital servos since those might have a better controlled behavior on power up, but there's no guarantee.

    Other things that might help include a pull down resistor of roughly 10K on the control pin of the servo. It might be that noise on the servo control pin before the BS2 initializes its I/O pin is causing the twitch.
  • asptamerasptamer Posts: 3
    edited 2008-05-17 12:47
    Thank you for your reply.

    Don't think this helps. The servo has been calibrated to 1.5ms and still twitches a little if Vdd is interrupted and connected back (same as start up).
    10k Resistor between pin and servo produced the same result as w/o it. Unless I need to connect it somehow differently?
  • FireHopperFireHopper Posts: 180
    edited 2008-05-17 13:03
    all servos tend to twitch a bit when turning on the power.. thats just the way they work.
  • P!-RoP!-Ro Posts: 1,189
    edited 2008-05-18 01:05
    Try using a transistor that is attatched to the servo. Then, when you want to use the servo, you turn on the transistor by making a pin high, then run the servo without it twitching upon startup. The problem with this, though, is it requires extra programming and wiring. So, my advise is don't worry about it unless it really bugs you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Pi Guy
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-05-18 01:12
    asptamer,

    You may have misunderstood Mike's suggestion regarding a pulldown resistor. Such a resistor doesn't go between the pin and the servo, but between the pin, which is connected directly to the servo, and ground (Vss). This forces the servo to "see" a logic low while the Stamp is in reset. Otherwise, the pin, which floats during that time, could wander high, creating a phantom pulse.

    -Phil
  • RXleonardRXleonard Posts: 7
    edited 2008-05-18 01:24
    Can we see your program? maybe its on the program. We can also try it on our stamp( I got BS2 also) and if the same thing happen or maybe we find what is wrong we could notify you right away.
  • asptamerasptamer Posts: 3
    edited 2008-05-18 16:25
    Thank you for timely responses

    PhilPi: This still doesn't work (I just tried) because it's connection of the servo to Vdd that makes it twitch, not the pin.
    I LIKE PI: Sounds like a great idea, I'll probably go with this.
    RX: It's not the program, it's the original high voltage that's being supplied to the motor. Since it's connected to Vdd, it's always on HIGH, but to operate it requires pulses. So it twitches, and then waits for PULSOUT.

    My temporary workaround was to make the servos spin in the direction opposite to the twitch upon initialization, but it's not the way to go. I think the problem will be resolved with the transistor.

    Thanks again, and consider this topic closed.

    Post Edited (asptamer) : 5/18/2008 4:45:17 PM GMT
Sign In or Register to comment.