Robot Doesn't Fully Turn in Autonomous

I ran the code you sent me yesterday on a “Frankenrobot” (ie. all the non drive motors were just sitting on top and not doing anything). The code runs correctly, the robot was doing the turns as you had programmed them, so it’s hard to tell what may be wrong with yours, but here are a few suggestions to check.

  1. make sure everything is plugged into the correct ports.
  2. make sure you are not moving the robot right after you run the program, the gyro will be calibrating during the 2 seconds after you run the code (it is displaying “gyro calibrating” on the brain).
  3. make sure the battery is good, if there is a lot of friction in your drive, that can cause battery voltage to drop, especially if the battery is old, the voltage drop can sometimes cause the gyro to reset. If you notice the led on the brain going red when you run the code, even with a fresh battery, I would be concerned about that.
  4. Do you have a 1:1 gear ratio between your drive motors and the wheels ? That would affect how far the robot would drive when you ask it to drive forwards (it would not directly impact turns), that may be something to check and fix in robot configuration.
  5. Try a simpler program (ie. make a new program) that just focuses on the drive and turning, perhaps disconnect some of the other motors to reduce stress on the battery. Once this is working, then slowly add back in some of the arm and claw motor code. If you find this works before adding all the motors, but starts to fail when they are added, then my conclusion might be back to point 3, the gyro can be quite susceptible to battery condition and/or voltage drops.