Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot won't run the same way twice — Parallax Forums

Boe-Bot won't run the same way twice

New to Boe-Bot.

I have executed the following code:

' 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, 10000, 3000 ' Signal program start/reset.

FOR counter = 1 TO 122 ' Run servos for 3 seconds.
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
FOR counter = 1 TO 70
' Run servos for 3 seconds.
PULSOUT 13, 750
PULSOUT 12, 750
PAUSE 100
NEXT
FOR counter = 1 TO 122 ' Run servos for 3 seconds.
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
FOR counter = 1 TO 73 ' Run servos for 3 seconds.
PULSOUT 13, 750
PULSOUT 12, 750
PAUSE 100
NEXT
END

Boe-bot doesn't run consistently. He overturns or underturns but doesn't do the same thing each time.
Any troubleshooting suggestions?

Comments

  • ercoerco Posts: 20,253
    Welcome to the forums, Paulax. Boebot doesn't have wheel encoders, so all turns and distances travelled will be approximate. To help improve accuracy, make sure your servos are properly centered/nulled and use fresh alkaline batteries, or better yet, use rechargeable batteries. Also make gentle turns (slow speed) and keep your wheels clean to avoid slippage.

    Dead reckoning is an art & science, some patience and persistence is required. There's an bolt-on kit to add encoders and a companion PDF by my hero and forumista favorite PhiPi, which adds the accuracy you seek to Boebot: https://www.parallax.com/product/28107
  • As erco points out, adding encoders is the "standard" solution for this sort of thing.

    Another way to improve the BOE-Bot's repeatability is to use a voltage regulator between the batteries and the servos.

    I was having a heck of a time trying to get my cheap-bot to perform a figure 8. I was using a couple Li-Ion batteries but the dropping voltage changed the way the motors behaved each run. Adding a regulator made the motor speed much more consistent. I include information about the regulator I used in this thread.
  • ercoerco Posts: 20,253
    BTW, your code looks like it should only go straight, stop, go straight, and stop. If it's turning when you intend to go straight, you'll have to tweak your 850 and 650 values to straighten your travel path. And again, without encoders there is no guarantee of consistency, so the best you can do is get reasonably close. It can be frustrating, but we've all been there. Hang in there!
  • Paulax,

    Now might also be a good time to check your batteries.
Sign In or Register to comment.