Shop OBEX P1 Docs P2 Docs Learn Events
Need Boe-Bot help: Right servo twitching.. — Parallax Forums

Need Boe-Bot help: Right servo twitching..

CeiliCeili Posts: 2
edited 2009-07-09 20:22 in Robotics
Hello Everyone,

I'm pretty much a beginner in robotics so right now I'm just going through the whole Boe-Bot book to learn.

I just assembled my Boe-Bot and got to chapter 4 where you actually make it move and after my first program, I noticed my right servo was twitching as if it was being sent a short pulse about every second, but only after it completed the program. So it went forward for three seconds, seemed to stop,·then the right servo pulsed, just a bit, every second afterward. And here's that program:

·· ' Robotics with the Boe-Bot - BoeBotForwardThreeSeconds.bs2
·· ' Make the Boe-Bot roll forward for three seconds.

·· ' {$STAMP BS2}
·· ' {$PBASIC 2.5}

·· DEBUG "Program Running!"

·· counter······· VAR··· Word

·· FREQOUT 4, 2000, 3000··············' Signal program start/reset

·· FOR counter = 1 TO 122············· ' Run servos for 3 seconds
···· PULSOUT 13, 850
···· PULSOUT 12, 650
···· PAUSE 20
·· NEXT

·· END

I tested·my Boe-Bot·and it can perform any program (including·the·ones from chapter 3 that are used to test the servos)·with the servos working fine, but once it finishes, my right servo twitches continually until I disconnect power.·I changed the batteries and that did not make a difference.

Anyone have any ideas to help me? confused.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-09 18:58
    This is a well known behavior due to the way the END statement works. Put a STOP statement before the END.

    Basically, the END statement puts the Stamp into a low power mode where it goes to sleep for short periods of time to save power. When this happens, the I/O pins will float and this back and forth between floating and their previous state may make the servos twitch. See the chapter on the STOP and END statements in the Basic Stamp Syntax and Reference Manual.
  • CeiliCeili Posts: 2
    edited 2009-07-09 20:22
    Oh, I see. Thanks so much, that worked and now I understand! [noparse]:)[/noparse]
Sign In or Register to comment.