View Single Post
  #4   Spotlight this post!  
Unread 06-02-2005, 21:28
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Problems with PID- PLEASE HELP!!!

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
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org