This season our team is working on a new swerve drive. We want to drive field-oriented so we implemented a NavX yaw reading into our code. We got it to work for a while but now whenever we do several spins and return to our initial orientation, the NavX reads 30 degrees in Yaw instead of the expected 0. We swapped the navX that was mounted on the rio and this kept happening.
Has anyone has had a similar problem in the past or know of a possible fix to try? Thanks
Most gyros will drift a bit over time, and can only handle a certain rate of rotational change before you begin to increase error exponentially. I know the NavX does a lot of data fusion to help eliminate drift, but some Yaw Drift is always expected. I’d suspect spinning in place very rapidly, especially multiple times in a row, could lead to a significant increase in this error, but I do not have a ton of experience with the NavX.
Another thing to check for is any electromagnetic loads nearby, make sure the sensor is as centered on the bot, but also as far from any motors, as possible.
One of the suggestions for dealing with yaw drift in the link below is to manually adjust an offset (say with a button press) for the yaw when you are in the zero yaw position.