Shop OBEX P1 Docs P2 Docs Learn Events
Servos and PULSOUT in the BS2p — Parallax Forums

Servos and PULSOUT in the BS2p

mweigandmweigand Posts: 3
edited 2005-12-29 01:41 in BASIC Stamp
I have been trying to run a simple servo lesson I found on the Parallax website on my Basic Stamp2p40, however the servo has been acting completely unpredictably.
I checked the documentation under the command PULSOUT and found that contrary to what I believed the time length for PULSOUT for a BS2P is something like 1.14 u-seconds instead of 2 u-seconds, as it is for the BS2...

Any suggestions on how the get the servo to work with the weird timing on the BS2P??

I tried working the math but none of my solutions seem to work at the moment... Help Please!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-27 23:19
    Try values of 2500 to 1250 for the PULSOUT with a center value of 1875.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • mweigandmweigand Posts: 3
    edited 2005-12-28 02:27
    I tired it... no luck

    With the bellow code the servo moves very slowly clockwise, then the pause, then moves very fast counter clockwise for several full rotations, then the second pause, and then behaves the same way again - moving very fast counter clockwise for several full rotations.

    Any more values to suggest?

    PS im using a Hitec HS-55 sub micro servo from one of my RC model airplanes. I checked some documentation online and I have every reason to believe that they should work identically to the Fatuba servos you guys sell so I dont think its the servo its self...

    Heres the code im using:

    {
    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}
    counter VAR Word

    FOR counter = 1 TO 50
    PULSOUT 14, 2500
    PAUSE 20
    NEXT

    PAUSE 1000

    FOR counter = 1 TO 50
    PULSOUT 14, 1250
    PAUSE 20
    NEXT

    PAUSE 1000

    FOR counter = 1 TO 50
    PULSOUT 14, 1875
    PAUSE 20
    NEXT
    END
    }
  • Tom WalkerTom Walker Posts: 509
    edited 2005-12-28 16:01
    Well, making several assumptions (circuit is correct, continuous rotation servo, BS2p), your description of the operation using this code suggests that your servo is not "centered" on a pulse value of 1875, but probably closer to 2200 (guess). This can either be dealt with by using the centering potentiometer in the case (assuming that you are using the Parallax continuous rotation servo). or adapting your code to use a different "center" value.

    HTH

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...

    Post Edited (Tom Walker) : 12/28/2005 8:24:50 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-28 19:17
    Another thing you could look into is the power supply for the servos and also, do you have a common ground between the servo power supply and the BS2p?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • mweigandmweigand Posts: 3
    edited 2005-12-28 23:55
    Well today I tried everything out on another servo. Everything worked like a charm. I took the 'broken' servo apart - nothing was wrong with it as far as I could tell. I reset the pot. and now its working "almost normally."
    Servo was just bad, the new values work like a charm. (thumbs up on that one!)

    Thanks so much guys!

    Have a wonderful New Year!

    smile.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-29 01:41
    Well, it's a little late now, but something that might have happened, and this could help you in the future, is you may have, at some point, over voltaged the servo.· This can damage the section of the servo that compares the pulse signal to the current position.· That may have damaged it.· You should always keep the voltage as close to 6V as possible, unless the servo is specifically rated for higher voltages.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.