Shop OBEX P1 Docs P2 Docs Learn Events
MiniStamp project Accelerometer Help — Parallax Forums

MiniStamp project Accelerometer Help

RonbertRonbert Posts: 20
edited 2014-03-04 01:08 in Learn with BlocklyProp
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.

Comments

  • GenetixGenetix Posts: 1,754
    edited 2014-02-10 14:50
    Check if both wheels turn when the BOE-Bot moves and weak batteries are known to cause all kinds of servo issues.
  • RonbertRonbert Posts: 20
    edited 2014-02-12 10:53
    Both wheels turn in opposite directions actually. Something must be wrong here.
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2014-02-12 11:05
    Have you made sure that your servos are centered properly?
  • RonbertRonbert Posts: 20
    edited 2014-02-12 11:37
    Yup! I just changed the batteries now to be sure they are fresh, I also ran the calibration code to make sure the acceleromoter measure on the axis properly and double verified my wiring schematic. I'm just not sure what the problem here is.
  • GenetixGenetix Posts: 1,754
    edited 2014-02-12 13:44
    You didn't answer Courtney's question about centering your servos. Also post your code.
  • RonbertRonbert Posts: 20
    edited 2014-02-14 09:43
    I did answer Courtney's question :) I also can't post the original code, see original post for why. I have tried writing the code for going uphill (from the same page) and that too has the never ending circle problem. I will attach code for that.

    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.
  • GenetixGenetix Posts: 1,754
    edited 2014-02-16 10:00
    Did you calibrate the servos or the accelerometer?

    Try a program such as BoeBotForwardThreeSeconds.bs2 from Robotics with the BOE-Bot.
  • RonbertRonbert Posts: 20
    edited 2014-02-24 09:42
    The servos and accelerometer have been calibrated. I still havn't discovered what caused the program to work suddenly but everything has been fine since.
  • GenetixGenetix Posts: 1,754
    edited 2014-02-24 13:41
    Intermittent problems are very annoying.
    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.
  • GenetixGenetix Posts: 1,754
    edited 2014-03-04 01:08
    The instructions for EepromNavigationWithRamping.bs2 say:
    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
Sign In or Register to comment.