Quote:
|
Originally Posted by thinkpad
I am sorry I did not completely understand your question. I wanted to say that when i put this code in the commands.h file:
struct commands command_list[] = {
{CMD_GYRO_BIAS, 0, 0, 0},
{CMD_DRIVE, 1500, 0, 0},
{CMD_WAIT, 20000, 0, 0},
{CMD_STOP, 0, 0, 0},
{NULL, 0, 0, 0}
};
the robot just keeps on going forward for a long time without stopping at all. If you meant something else please let me know.
Thanks.
|
Sounds like a sign problem. Make sure that when both motors are commanded forward, they spin in the direction that will propel the 'bot forward. This is done by setting the sign on these #defines in pid.h:
#define LEFT_DIR (-1)
#define RIGHT_DIR (1)
Next make sure the PID software properly detects the rotational direction by setting the sign on these #defines in encoder.h:
#define LEFT_ENCODER_TICK_DELTA -1
#define RIGHT_ENCODER_TICK_DELTA 1
When you're done, the encoder count will increase as the 'bot drives forward.
-Kevin