I don't have access to LabView or RobotC currently but the pseudo-code should be:
Code:
reset encoder;
while (encoder<some_value) //assuming positive is forward
{
motors go forward;
}
motors stop;
Quote:
|
sometimes the robot moves correctly, other times it never stops moving, sometimes it moves the opposite direction, and sometimes it barely moves.
|
All of the possibilities above might be related to an encoder problem except moving in the opposite direction. Referring to the pseudo-code above, the motors only go one way (forward). If your teams and other teams are using built-in functions or blocks, then it might be possible that the "block" is not setup correctly (like negative encoder count is forward but a positive encoder count is used hence never reaching the value).
The code above has no feedback control and with a reliable reasonable drivetrain, it should consistently be +/- 1 in. per 2 feet.