I’m the programmer for my team and were competing in TSA Nationals. In TSA states, we had to reset the gyro every two turns to get consistent turns. I’m talking about a gyro drift of 20 degrees after 4 turns and going forward and backward twice.
So far, I’ve tried a brand new gyro from our other team. That didn’t work. I tried moving the gyro from the side to the direct center away from wires. I am using rubber spacers and I’m calibrating the gyro in pre auton. I tried making a gyro drift correction task as well as using the QCC library. Nothing has worked.
So to update, I tried the QCC code again, this time decreasing the standard deviation and it actually worked really well. Didn’t have anything to do with positioning or anything like that. I’m still going to experiment with encoders for turning and maybe see if I can combine them depending on how accurate they end up being.
If possible, I’d be interested in knowing which version of the QCC2 code you’re using. It would help in directing other people to address some of their gyro issues.
Also, the standard deviation of a data set is not something you change. It’s a property of the data itself. So I assume you mean you altered the number of standard deviations that are used to filter out “jittery” data. Again, it would be helpful for others to know what you used for the altered filtering.
I don’t think you can be sure of that based on what you’ve said here. @jmmckinney used improved filtering (jitter dropout and oversampling) specifically because the data can sometimes be noisy. The noise is most definitely affected by where the gyro is mounted, how it is mounted, and how much electrical noise is present in the system. The fact that better filtering helped your gyro performance is an indication that you were experiencing some form of increased noise, since many people are able to use the gyros effectively with the stock filtering.
I’m also assuming that he changed the preprocessor def for the filter. I’m curious on how much variance there is from sensor to sensor regarding inherent noise. It might be worth setting up a test where multiple gyros are ran in a controlled environment (ie. running on a robot and swapping the sensor out), and seeing if there’s a significant difference in the sensitivity of the chips. The defaults are what work really well for my setup: a hard mounted sensor in the center of a small deferentially driven robot’s wheelbase.
I do realize that positioning does play a part, but for me it didn’t make a noticeable difference. But currently it is the most isolated that it can be from other wires, but when you end up with tons of wires everywhere, even with good cable management it is hard to place a gyro.
I agree that this isn’t normal. It may be the cortex itself. I don’t know. We’re doing a rebuild anyway so we’ll be able to test that. But this is useful so that I can get a pretty accurate value without too much trouble.
Thank you, that’s great (and very useful) information.
@jmmckinney noted that his code would cause slight drift when the robot isn’t moving, but that it is overall more accurate when measuring turns. Which is what you’re reporting as well. Good to know.
Since you tried multiple gyros and multiple mounting points, it seems likely you’ve got electrical noise. The electrical noise in a VEX system can come from a motor, motor controller, power expander, or the Cortex, or even an intermittent wire connection. It doesn’t have to be on a wire directly attached to the gyro. Some other noise process could be putting noise on the power rail or in the analog sensor ports.
Sounds like you’ve got things workable now; changing a few things may reduce the noise. But based on @jmmckinney’s experience, it’s still going to drift slightly. The amount you’ve measured shouldn’t be a problem.