Shop OBEX P1 Docs P2 Docs Learn Events
ActivityBot, simple drive_goto(26,-26) just keeps spinning in a circle — Parallax Forums

ActivityBot, simple drive_goto(26,-26) just keeps spinning in a circle

Hello,
I am having trouble with my ActivityBot.
I have not been able to get it to move correctly.
The "calibration" program seems to me to have run correctly, successfully.

But when I load this simple program,

#include "simpletools.h"
#include "abdrive.h"

int main()
{


drive_goto(28,28);
pause(4000);

}

The ActivityBot spins in an almost circle.

I realize the pause there is superfluous. I had it there because at first I had a while(1) and I was going to watch it do quarter turns every few seconds. But when it just sat and spun, I took the while out.

I want to be able to get it to turn a quarter turn, or a half turn.
Half turn being approx. drive_goto(54,-54) I think.

thanks for any help/advice you can give.



Comments

  • I was going to ask, I tried to rerun the calibration program.
    I loaded it to EEPROM and let it run.
    Is that ok?
    Might I have caused a problem with that?

    thanks
  • I might have it working better.
    I have kind of fought with it off and on today.
    The calibration looking like it was working, but then it wouldn't move, or it twitched, or it would move continually often mostly in a circle.

    I displayed the calibration numbers and the left wheel's numbers were almost all 0's.
    I reran calibration again and there are numbers there now.
    I am new to this, an older guy, but new to this and am not sure what I was doing wrong.

    Thanks much
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2016-03-29 18:09
    Hello dakotaknut,

    Here are some suggestions for you to try/look for first:
    • Are you using fresh batteries? If not, try re-running calibration with a fresh set of 5-AA batteries, and make sure to let the P26/P27 lights turn off after the calibration program runs before you turn off power to the robot.
    • Check your servo and encoder connections. Servo Header P12 is Servo Left, P13 is Servo Right, P14 is Encoder Left, P15 is Encoder right. Make sure the black wire of the cables are closest to the breadboard, white wires closest to the top of the board.
    • Ensure your 20k resistors are in place (and the correct value) on the breadboard (P14/P15).

      If possible, include a picture of the board/cable connections here so our forum community can help you identify possible connection errors. You can also contact technical support if you would like one-on-one troubleshooting assistance.

      Loading the calibration program to EEPROM is correct. You will need to load the program to EEPROM anytime you wish to re-run the calibration. If, when you power on your robot after calibrating, the calibration program starts running again, then you did not let the program complete and you need to wait until the lights at P26/P27 go off after calibration before powering your robot off.
Sign In or Register to comment.