My team is currently using the Gyro and we’ve noticed that if left alone without touching it, the gyro drifts its value. For example, if we start the program and just print out the heading of the gyro, it starts and zero and just gradually increases its value. We’ve had issues where after a minute of driving, we turn the robot back to what we think is “0” heading, but the gyro reads 90+. Is there any recommended way to help with this drifting issue? We’ve noticed the drift isn’t as bad if we move the robot inside and the field is not elevated. We’ve tried to “calibrate” the gyro for 8 seconds, but there’s still a drift (but may not be as bad).
We’re currently using Vex IQ code blocks, but can switch if the API is more extensive for Vex code text. I looked at the c++ vex_gyro.h and saw that @jpearman wrote that class.
Some drift is to be expected but if the gyro is calibrated at the start of the program (which happens by default if you have it as part of the Drivetrain) then that level of drift is by no means normal. Can you post your code?
Thanks. We’re not using the drivetrain because the kids implemented for an X-Drive and Kiwi drive. Calibrating helps, but it the rate the gyro is changing gets worst when driving. In other words, if we don’t touch the robot after start, the drive is +2/100th every second, but if they drive around for a few seconds, then look at the gyro, the rate of change increases to around +30/100th every second and gets worst if they drive longer.
In my personal opinion, vex iq gyros are low quality and not worth the hours of research and frustration. I know it seams appealing to educators and students but if you don’t want every line in your code at motor speed 10, there are better options. A few things you can do are:
-make sure your drive motors actually spin at the same speed in device settings. different factory batches and levels of wear matter here
-use the tightest gears you have where it matters. worn gears have more give and cause inconsistencies
-make sure the shaft types are the same on both sides. For example, avoid having all metal on one side and plastic on the other
-use motor encoders and while loops on turns. we found that they work better than the typical turnRight/Left command
-use the straight edge of your robot to align against the wall by backing up for a set time. this serves as a kind of course correction for long auto sequences.
a person who has possibly the highest recorded squared away auto without sensors