Shop OBEX P1 Docs P2 Docs Learn Events
Problem with basic forward and reverse of a servo motor. BS2p24 — Parallax Forums

Problem with basic forward and reverse of a servo motor. BS2p24

1tguy1tguy Posts: 2
edited 2013-12-09 18:59 in BASIC Stamp
I have a BOE-BOT that had come with a BS2 . When I had programmed it originally I had no issues with the servo motors turning clockwise or counterclockwise. However, I have put a BS2p24 in replacement of the BS2. The code for pulsout 12, 500 does nothing different than pulsout 12, 1000. Is it a hardware problem? Thanks

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-12-07 14:34
    The BS2p is faster than the BS2 and all of the statements that involve timing except PAUSE have to have their numeric time values changed. PULSOUT on the BS2 uses a 2us unit while the BS2p uses a 0.8us unit. This includes the Baud constants in SERIN and SEROUT. The BASIC Stamp Syntax and Reference Manual has all the values for all of the statements involved (except for the BS2px which has a separate supplement for this).
  • ercoerco Posts: 20,257
    edited 2013-12-07 23:21
    +1 to Mike's reply. The 2p runs 2-1/2 times faster than the BS2 (2/0.8=2.5), so all of your pulsouts (and pauses and pulsins) happen 2.5 times faster. So on a BS2P24, your pulsout 1000 works behaves a pulsout 400, and your pulsout 500 behaves like a pulsout 125. Assuming your servo is properly centered, you can try these values:

    Full forward=2.5 x 500 = 1250 (minimum value)
    Stop=2.5 x 750 = 1875
    Full reverse = 2.5 x 1000 = 2500
  • 1tguy1tguy Posts: 2
    edited 2013-12-09 18:59
    Thank you! You all were right on! I changed the values and was moving in the right direction. Thank you.
Sign In or Register to comment.