Shop OBEX P1 Docs P2 Docs Learn Events
servo steering — Parallax Forums

servo steering

kimmkimm Posts: 2
edited 2007-05-10 22:22 in BASIC Stamp
please can you tell me what is wrong in this listing
I have a bs2 and a standard servo.
I try to let the servo turn clockwise/anticlockwise in a loop
but the servo turns only in one direction depending on the
first pulsout value and then stops.

counter VAR Word
For counter = 1 to 10
Pulsout 15, 800
Pause 50
Next················ ' stops
For counter = 1 to 10
Pulsout 15, 200
Pause 50
Next

j.g.reuser@hetnet.nl

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-05-10 11:58
    The servo expects a range of pulses from 1mS to 2mS, with 1.5 mS being center position.

    Your first loop gives 800 x 2uS = 1.6 mS which is pretty close to center position.

    Your second loop gives 200 x 2uS = 0.4 mS which is probably ignored by the servo as being too fast.

    Change your pulse values to give 1mS for one extreme and 2mS for the other.

    Also, as shown, your program only executes once.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • kimmkimm Posts: 2
    edited 2007-05-10 21:24
    Hi Stamptrol.
    Thanks for the replay.
    I have made the first pulsout = 200 The second pulsout = 800
    and it's the same faulty result (stops for the first "next")
    Even if I made both pulsouts the same 800 then the prog. stops
    by the first "Next".
  • stamptrolstamptrol Posts: 1,731
    edited 2007-05-10 22:22
    You have to make one about 1000 and the other about 500.

    This is also in the docs on the Parallax site where the servos are described.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
Sign In or Register to comment.