navX2-sensor Yaw Angle Accuracy Issue Update

Kauai Labs has a few important notes for teams using a navX2-sensor.

  1. Gyro Scale Factor Ratio Issue

With the most recent “newest batch” of navX2 sensors, several teams have reported issues with significant yaw angle inaccuracy. Kauai Labs has verified an inaccuracy due to incorrect values of the navX2-sensor’s Gyro Scale Factor Ratio.

Recommendation: all teams using a “Generation 2” navX2-sensor - ~especially if they are from the “newest batch”~ - should perform Gyro Scale Ratio Factor calibration, using the navXConfig utility’s Sensor Fusion Tab; this is discussed in the article “Optimizing Accuracy of a Generation 2 navX-Sensor”.

Note: the navXConfig Utility also contains other useful features including Advanced Accelerometer Calibration and adjusting of sensing ranges.

The navX2-sensors in this “newest batch” can be identified by the color of the 4 fiducial markings in the corners of the PCB, and the four debug connector through-holes labeled VCC, GND, DAT, CLK. The “newest batch” features gold-colored plating in these areas, as shown in the photo below; previous batches have silver-colored plating.

  1. Firmware Update (for teams using a vertically-mounted navX2-sensor)

Related to item 1) above, updated firmware (version 4.0.433) is available for those teams using the “Omnimount” feature to enable vertical mounting of a navX2-MXP sensor; this update enables the Gyro Scale Factor Ratio discussed above to work correctly with vertical mounting. This update is available for download via the “Download” button on the navX2-MXP sensor software page. Instructions for updating the firmware can be found here.

Here at Kauai Labs, we’re working to understand the cause of the differences in this “newest batch” of sensors; perhaps it’s due to the changing supply chain forced by the current component shortage. For sure, this difference was missed during internal board testing of the “newest batch”, something we need to improve.

2 Likes

The scale factor calibration doesn’t appear to do anything with either of our NavX2 boards, either the one purchased more than a year ago, or the one purchased this year.

So what we do is pull the Rotation2d value of the heading/yaw from the API (note that we have it calibrated in the vertical position). This value is a continuous value that continually increases as you turn and never rolls over. Then we manually figured out what the scale factor should be and did the multiplication ourselves in the RoboRIO. It works.

The scale factor for the old board is 1.03125 (which is because we told the robot to turn 1440 degrees and it was out by pretty much exactly 45 degrees too far).

The scale factor for the new board is 0.9375 (which is because we told the robot to turn 1440 degrees and it was out by pretty much exactly 90 degrees too little).

Sure is funny that one is out by exactly 1/32nd in one direction, and the other is out by 2/32nd in the other direction.

1 Like

What version of firmware is loaded onto these two boards? For vertical mounting, you’ll want to ensure you’re running version 4.0.433 - which addresses an issue with applying the gyro scale factor ratio in vertical “omnimount” orientation. Then, with the board in the vertical orientation, run factory calibration which “locks in” the correct angle as the yaw angle. Then, perform the Gyro Scale Factor Ratio calibration with the sensor in the vertical orientation. Given this most recent firmware update and the above steps, the yaw angle can be calibrated using navXConfig’s Sensor Fusion Tab.

In early 2021 we purchased a new NavX2 which was billed as a drop-in replacement for the NavX classic but with less gyro drift. Our robot at the time had the NavX mounted in the upside down orientation. We plugged it in, calibrated it, and we immediately saw a scale factor error. I emailed Kauai about this at the time, but I believe I referred to the problem as super fast yaw drift, which would be incorrect. I didn’t understand what a scale offset factor was at the time. I just knew it wasn’t a drop-in replacement. :slight_smile:

We competed in the 2021 season using the NavX classic. You released new firmware (4.0.424) in April 2021 which was supposed to fix this problem. We didn’t get around to testing the new firmware until the very end of 2021, but it didn’t seem to fix the scale offset error for us. In particular, if I tilted the board when I rotated it, the yaw angle was off (by a lot). Doing this same simple experiment with NavX classic, it seemed to handle the tilt just fine.

Please understand we’re a couple days away from our first competition of 2022, and we have a working robot with field-oriented swerve, and I’m very apprehensive about loading new firmware onto a board that is so absolutely critical to our ability to drive. This is especially true since you seem to think this scale offset error is only related to new boards, but it’s clearly been a problem with boards over a year old.

I’d be happy to upgrade in the off-season, but I feel it’s very risky to upgrade now. We have a ton of stress right now, and we don’t need to brick a NavX2 or have some subtle new bug surface.

Is FIRST going to enforce this as a mandatory firmware update?

Likely not as it is not a core control system component.

2 Likes

That’s what I figured, so while I’d like to try the new firmware, I’m going to put it at the end of the other 54,893 items on the must-fix-by-Friday list. :laughing:

No, FIRST doesn’t dictate any particular version of firmware for navX-sensors, so no rules require this change. The update is a recommendation for teams with a board exhibiting issues or using the sensor in a vertically-mounted orientation.

2 Likes

Thanks for providing this detail, so it could be checked. Here’s what was going on:

With the 2021 navX2 firmware, the gyro scale factor ratio was applied only to the Z axis gyro, which is the default orientation most teams use. The issue is it wasn’t also applied to the X and Y gyro axes as it should have been.

The navX sensor fusion algorithm integrates in angular change from all 3 axes into the yaw angle; typically, the only significant input to the yaw angle is the “yaw axis”. However, if the pitch and roll angles are changing also, these also are integrated into the yaw angle (the greater their angle, the more they are taken into account).

So in a nutshell, since the X/Y axes were previously uncorrected by gyro scale factor ratio, error was introduced into the integrated yaw angle. The undesired behavior you saw was verified using the previous firmware version from 2021; it’s also verified that this issue has been resolved in version 4.0.433.

2 Likes

Well it looks like we have some 2 poorly calibrated NavX2 sensors too; but I’m also seeing another issue. The pitch and roll axes are switched in our sensors. The naxUI shows the little airplane, and I tip the sensor about X and the image shows the airplane pitching up (good); but the display shows that the Roll axis value is changing. I’m about to start going through the advanced calibration and I don’t know yet if I can swap them.

OK Looks like doing a full factory recal (CAL button held for 10 sec, etc.) fixed the roll/pitch issue. On to yaw calibration

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.