Automatic Gyro/Accelerometer Calibration

Automatic Gyro/Accelerometer Calibration

navX-sensors require calibration in order to yield optimal results.  Although this calibration occurs automatically, we highly recommend taking the time to understand this calibration process – successful calibration is vital to ensure optimal performance.

NOTEIf using a navX2-sensor, the navXConfig utility provides tools to calibrate gyroscope and accelerometer for optimal accuracy.  The navXConfig tools are more comprehensive than the Automatic Gyro/Accelerometer Calibration.

Accurate Gyroscope Calibration is crucial in order to yield valid yaw angles. Although this process occurs automatically, understanding how it works is required to obtain the best results.

If you are tempted to ignore this information, please read the section entitled “The Importance of Stillness” at the end of this page.

Calibration Process

The navX-sensor Calibration Process is comprised of three calibration phases:

  • Factory Calibration
  • Startup Calibration
  • On-the-fly Calibration

 

CalibrationProcess

Factory Calibration

Before navX-sensors are shipped, the accelerometers and gyroscopes are initially calibrated at the factory; this calibration data is stored in flash memory and applied automatically to the accelerometer and gyroscope data each time the navX-sensor circuit board is powered on.

Note that the onboard gyroscopes are sensitive to temperature changes. Therefore, since the average ambient temperature at the factory (on the island of Kauai in Hawaii) may be different than in your environment, you can optionally choose to re-calibrate the gyroscope by pressing and holding the “CAL” button for at least 10 seconds. When you release the “CAL” button, ensure that the “CAL” Led flashes briefly, and then press the “RESET” button to restart navX-sensor. When navX-sensor is re-started, it will perform the Initial Gyro Calibration – the same process that occurs at our factory. NOTE: It is very important to hold navX-sensor still, and parallel to the earth’s surface, during this Initial Gyro Calibration period. You might consider performing this process before using your robot the first time it is used within a new environment (e.g., when you arrive at a FTC competition event).

The value of re-running Factory Calibration at the same temperature navX-sensor will be operated at is potentially increased yaw accuracy as well as faster Startup Calibration. If a significant temperature shift has occurred since the last Factory Calibration, the Startup Calibration time may take longer than normal, and it’s possible that yaw accuracy will be diminished until the next On-the-fly Gyro Calibration completes.

“Second Generation” navX-sensor Factory Calibration Time (if still):  ~2 seconds

“Classic” navX-sensor Factory Calibration Time (if still):  ~15 seconds

Startup Calibration

Startup Calibration occurs each time the navX-sensor is powered on, and requires that the sensor be held still in order to complete successfully.  Using the Factory Calibration as a starting point, the sensor calibrates the accelerometers and adjusts the gyroscope calibration data as well based upon current temperature conditions.

If the sensor continues to move during startup calibration, Startup Calibration will eventually timeout – and as a result, the navX-sensor yaw angle may not be as accurate as expected.

“Second Generation” navX-sensor Startup Calibration Time (if still):  ~1 second

“Classic” navX-sensor Startup Calibration Time (if still):  ~15 seconds

Initial Yaw Offset Calibration

During Startup Calibration, an Initial Yaw Offset is automatically calculated. The purpose of the Initial Yaw Offset is to ensure that whatever direction the “front” of the navX-sensor circuit board is pointed to at startup (after initial calibration is applied) will be considered “0 degrees”.

Yaw Offset Calibration requires that navX-sensor be still during Startup Calibration. After approximately 2 seconds of no motion, the navX-sensor will acquire the current yaw angle, and will subtract it from future yaw measurements automatically. The navX-sensor protocol and libraries provide a way to determine the yaw offset value it is currently using.

NOTE: If navX-sensor is moving during startup, this Yaw Offset Calibration may take longer than 2 seconds, and may not be calculated at all if the sensor continues moving long enough. Therefore it is important to keep a navX-sensor still until initial calibration and Initial Yaw Offset calibration completes.

On-the-fly Gyro Calibration

In addition to Startup Calibration, during normal operation navX-sensor will automatically re-calibrate the gyroscope (e.g., to account for ongoing temperature changes) during operation, whenever it detects several seconds of no motion. This process is completely transparent to the user. Therefore each time navX-sensor for several seconds, the gyroscopes are re-calibrated “on-the-fly”. The purpose of On-the-fly Gyro re-calibration is to help maintain yaw accuracy when shifts in ambient temperature occur during operation.

This On-the-fly Gyro Calibration can help deal with cases where the sensor was moving during Startup Calibration, but note that the yaw is not zeroed at the completion of On-the-fly Calibration.  So once again, it’s important to keep the sensor still during Startup Calibration.

Runtime Yaw Zeroing

Your robot software can optionally provide the robot operator a way to reset the yaw angle to Zero at any time. Please see the documentation for the navX-sensor libraries for more details.

The importance of stillness

This is the most important takeaway from this discussion: It is very important that navX-sensor be held still during the above calibration periods. In support of this, navX-sensors indicate when they are calibrating; we recommend you incorporate this information into your software. Please see the discussion of the navXUI, and the navX-sensor libraries for more details on this indication.