This page summarizes the recommended best practices when integrating navX-Micro with a robot, such as a FIRST FTC or FRC robot. Following these best practices will help ensure high reliability and consistent operation.
1) Secure navX-Micro circuit board to the Robot Chassis
Excessive vibration will reduce the quality of navX-Micro sensor measurements. The navX-Micro circuit board should be mounted in such a way that it as firmly attached to the robot chassis.
2) Understand and Plan for Calibration
Gyro/Accelerometer Calibration is vital to achieving high-quality navX-Micro readings. Be sure to understand this process, and ensure that it completes successfully each time you use the robot.
If your robot moves during calibration, or if noticeable temperature changes occur during calibration, the calibration process may take longer than normal.
Using the navX-Micro yaw angle before calibration completes may result in errors in robot control. To avoid this situation, your robot software should verify that calibration has completed before using navX-Micro data.
3) Protect the Sensor
navX-Micro contains sensitive circuitry. The navX-Micro circuit board should be handled carefully.
An enclosure is recommended to protect the navX-Micro circuit board from excessive handling, “swarf”, electro-static discharge (ESD) and other elements that could potentially damage navX-Micro circuitry.
4) Plan for Catastrophic Sensor Failure
Any electronic component can fail. To ensure that your robot can still function during use even if such a failure does occur, your robot software should handle cases when communication with sensors such as the navX-Micro is disrupted.
An easy way to accomplish this is to use the “isConnected()” indication, and only use navX-Micro sensor data to control your robot when this is true.
Additionally, displaying whether the robot software is connected to the navX-Micro circuit board on the driver “dashboard” can help the drivers quickly detect a connection problem.
5) Provide a “Zero Yaw” feature (for Field-Oriented Drive)
The navX-Micro gyro “yaw” angle will drift over time (approximately 1 degree/minute). While this does not normally impact the robot during a FIRST FTC or FRC match, if using field-oriented drive during extended practice sessions it may be necessary to periodically “zero” the yaw. Drivers should be provided a simple way (e.g., a joystick button) with which to zero the yaw.
6) If possible, mount navX-Micro near the center of rotation
Since navX-Micro measures rotation, errors in the measured angles can occur if navX-Micro is mounted at a point not near the robot center of rotation. For optimal results, navx-Micro should be mounted at the robot’s center of rotation. If navX-Micro cannot be mounted near the robot’s center of rotation, the offset from the center of rotation can be used to correct the yaw angle.
7) Use OmniMount if navX-Micro is not mounted horizontally
By default, the navX-Micro’s motion processing requires the unit be mounted horizontally, parallel to the earth’s surface; the yaw (Z) axis should be perpendicular to the earths surface.
If you need to mount navX-Micro vertically or upside-down, you will need to enable the “OmniMount” feature in order to get reliable, accurate yaw (Z) axis readings.
8) Learn how the sensor behaves by using the navXUI
The navXUI provides insight into the key navX-Micro features, and can help debug issues you may encounter when integrating navX-Micro onto your robot. Running this user interface is highly recommended for anyone using navX-Micro.
9) Plan for RoboRIO Brownouts [FRC-specific]
The RoboRIO contains circuitry to remove power from the RoboRIO MXP and Onboard I2C connectors when it detects an input voltage drop below a certain voltage level; this is known as a Stage 2 brownout. While brownouts do not typically occur during a FRC match (since fresh batteries are typically used at these times), during extended practice matches brownouts are common. If the robot drive train draws large amounts of current, even for a short time, brownouts could potentially occur even with a competition FRC match.
navX-Micro maintains state information that will be reset when the navX-Micro circuit board is restarted.Avoiding navX-Micro restarts is very important if your robot software uses the “yaw” angle.
Fortunately, the RoboRIO provides just such a power supply, since its onboard USB interface is powered by a boost regulator which will provide 5V of power even when the RoboRIO input voltage (VIN) drops as low as 4.4 volts (once the RoboRIO VIN drops lower than this, the RoboRIO itself will restart). navX-Micro provides a secondary power supply, and will automatically switch to that power supply if ever the I2C connector power supply is not present.
Thus to address this situation, simply connect a USB cable from the navX-Micro circuit board to the RoboRIO; if a brownout does occur, the navX-Micro circuit board will automatically switch to use power from the RoboRIO’s USB port.
