Vex Iq Robot Is Ending up Turning When Programmed to Drive Straight

Hi! Our team is having a problem with programming. Whenever the robot is programmed to drive straight it goes the correct distance but when it gets to the end it suddenly turns about 12 degrees left which isn’t in the code. It looks like the right drivetrain is running longer than the left one. Any thoughts on what it could be and how to fix it? We use RobotC graphical and do have a gyro sensor. This issue makes our program inconsistent because the additional turn varies and makes it harder to program.

Can you post your code so we can see what’s happening and help debug?

Yeah sure! In this part of the program the robot goes the .7 rotations it is told to but when it finishes going forward it suddenly ends up turned to the left. It’s like one drivetrain stops before the other. I tried replacing the motor but it doesn’t do anything.

It looks like your command in line 27 sets the condition for stopping as the gyro degress < -13. That means iit won’t stop until it sees a magnitude of 13 and will keep moving until then. Perhaps you want something > -13 or perhaps < 13. And you might be able to use a degree tolerance with magnitude smaller than 13.

1 Like

Hi. I’d just replied to your other thread. Hope that helped. Using Two Gyro Sensors to Turn - #12 by spaghetti_code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.