Gyro not working correctly

My team’s gyro is not sending right values.

We are using vex code, and we have a function that requests the value of the gyro in degrees. We were trying to do gyro-based turns with PID, sometimes it worked, sometimes it didn’t. Let me describe you the behavior of the gyro:

For teleoperated driving, the gyro sends perfect values for the console, but in some time it will start sending nonsense values, like, it starts decreasing or increasing constantly, forever. I noticed that happens when the robot is driven to fast.

In autonomous for driving straight with PID, it works just fine, the robot autocorrects its path to a specific degree, but again, after a certain time the gyro’s values start sending nonsense data and the robot starts spinning.

For autonomous to turn to a specific degree with PID, it will only work if the target is 0. Whenever I ask to go to a different target, like 90 or 180, it starts sending the wrong values, and the bot just spins.

Has that ever happened to your gyro? I don’t know if I’m using it incorrectly, or if it is an actual malfunction on the component. We don’t have an extra-gyro to check if it is a problem on the compenent. If you know what’s wrong, please let me know.

1 Like

That’s very strange, I’ve never heard about that happening. From my experience with VEX IQ, I have learned that having two gyros, one upside down, one right side up, stacked on top of each other, will eliminate a lot of the drifting you get. if you use code to take the average of the two. I don’t think that will help in this case though, have you tried switching it to a new gyro?

we don’t have other gyro. We are currently working on getting a new one. Thanks for the reply