Quote:
|
Originally Posted by Kevin Watson
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
|
Thanks for responding Mr. Watson.
I just double-checked the code and it is set as per your reccomendations, but we get the same undesired results.
Is there a way to see the readings of the encoder counts in the PID files, i tried adding in printf statements in the PID.c file where the encoder count values are being called:
long int Get_Encoder_Count(int motor)
{
if (motor == 0)
{
temp = Get_Left_Encoder_Count();
printf("/rLeft count: %5d", (int)temp);
return (temp);
}
else if (motor == 1)
{
temp = Get_Right_Encoder_Count();
printf("/rRight count: %5d", (int)temp);
return (temp);
}
but this just prints out the values of Right count: 0 and Left count: 0. Can anyone tell why this can be?
I know i am being annoying, but we are really desperate about this, so please keep the inputs flowing.
Thanks for your suport,
Vick.