Ok so here’s my problem randomly throughout my autons my robot will just start spinning or turn to a random angle and then continue to the wrong spot, I’m using an inertial sensor in ez template but I recently was using jar template and it was give me the same problem that’s why I switched but I’m continuing to have the same problem has anyone had this problem before and how they fixed it, all my autons used to work on my old robot but on my new one they don’t.
The things I’ve done already to try and fix it:
Change inertial sensor
Changed wires for inertial
Changed ports for inertial
Changed wires for drive motors
Changed ports for drive motors
Tuned my pid to an extent in both jar and ez template
Fixed friction in my drive
Made sure all the motor encoders work
Check if the angle is directly mentioned anywhere in the code (not super likely)
Troubleshoot any areas of the code that have any output to the motors which may cause the motors to turn (one way to do this is copy-pasting sections of your code into a separate program to isolate them and test them for errors individually)
If it is inconsistent:
Check for any areas in the code where you may have used a random number generator (not super likely)
Troubleshoot any areas of the code that have any output to the motors which may cause the motors to turn (one way to do this is copy-pasting sections of your code into a separate program to isolate them and test them for errors individually)
sometimes it swerves either way like on a drive the right side will like stop moving with left side, or sometimes the turn turns in a circle and then stops at the completly wrong heading, and sometimes it also will just spin in a cricle.
This issue specifically could be due to loosely connected axles slipping out of your drivetrain’s motors. Double-check that your axles are all the way in and then tighten your axle collars if necessary.
Overall, however, it’s most likely a coding issue affecting how the robot reacts to the outputs from its sensors. Here is a VEX Forum post with an example PID that you can compare yours to to help you troubleshoot it: VEXCode PID Tutorial