MiniStamp project Accelerometer Help
Ronbert
Posts: 20
I'm working on the mini stamp project for inclining sensing with an accelerometer. I'm at the portion were the boe bot should be driving in a rectangle but instead it just goes in complete circles. Why would this be?
This is the project I'm refering to: http://forums.parallax.com/showthread.php/76732-Boe-Bot®-Robot-Navigation-with-Accelerometer-Incline-Sensing
EepromNavigationWithRamping.bs2 is the section I'm working on. I can't figure out the problem here. I can't attach my code because to my unfortunate dismay I lost my flash drive.... but I've checked over and over again and verified the code is 100% the same as the tutorial/mini project.
This is the project I'm refering to: http://forums.parallax.com/showthread.php/76732-Boe-Bot®-Robot-Navigation-with-Accelerometer-Incline-Sensing
EepromNavigationWithRamping.bs2 is the section I'm working on. I can't figure out the problem here. I can't attach my code because to my unfortunate dismay I lost my flash drive.... but I've checked over and over again and verified the code is 100% the same as the tutorial/mini project.
Comments
I just want to reittirate that I have double checked the wiring schem and I've unplugged ALL exterior attachments in order to use pins 6 and 7 to ensure the code is perfect.
EDIT: For the purposes of this thread I've rewritten the EEPROM navigation code and am still having the same problem... code attached.
EDIT2: Okay, I'm not sure why but suddenly the code works. First two times I ran the code and the bot just turned in a 360 over and over again. Third time it did the full rectangle. I'm sure the batteries were fresh, Odd.
Try a program such as BoeBotForwardThreeSeconds.bs2 from Robotics with the BOE-Bot.
Give all your wires and parts a wiggle and see if anything changes. Also make sure the wires and parts are fully inserted into the breadboard.
Verify that the Boe-Bot starts out by moving forward.· Depending on your servos, it may curve to the left or the right a little, which is okay.·
Fine tune the distances so that they make your Boe-Bot travel in a rectangle.· The turn at the first corner should be left, 90°.· The second should be right, 270°, and the third should be another left at 90°.
The distances are stored in the DATA statement under EEPROM Data
·
UphillBoeBot.bs2 has several errors in it:
'Initialization
FREQOUT 4, 2000, 3000 ' Program had 500 instead of 2000
'Navigation decisions
IF ABS(x) > 40 THEN
pulseLeft = 750 - x ' Program had +
'Increment/decrement routine
IF pulseLeft >
IF pulseLeft < (pulseLeftOld - 8) THEN pulseLeft = pulseLeftOld - 8 ' Program had >
IF pulseRight >
IF pulseRight < (pulseRightOld -8) THEN pulseRight = pulseRightOld - 8 ' Program had >
All the code can be downloaded from here:
http://learn.parallax.com/project/boe-bot-robot-navigation-accelerometer-incline-sensing