Kauai Labs navX-MXP User manual

navX-MXP Robotics Navigation Sensor User Guide
Kauai Labs
Copyright — 2019

Table of Contents
Overview
2
navX-MXP 2
Features 3
Technical Specifications 3
"Behind the Design"
4
Frequently-asked Questions 6
Installation
10
Installation 10
RoboRIO Installation 10
FTC Installation
12
Orientation 14
OmniMount
19
I/O Expansion
21
Alternative Installation Options
25
Creating an Enclosure 28
Software 30
Software 30
RoboRIO Libraries
30
Android Library (FTC)
31
Linux Library
32
Arduino Library 33
navXUI
34
Tools
36
Examples
38
Examples
38
Field-Oriented Drive (FRC) 38
Rotate to Angle (FRC) 42
Automatic Balancing (FRC) 45
Collision Detection (FRC) 48
Motion Detection (FRC) 51
Data Monitor (FRC) 53
MXP I/O Expansion (FRC)
56
Guidance
60
Best Practices
60
Terminology 62
Selecting an Interface
68
Gyro/Accelerometer Calibration 69
Magnetometer Calibration Tool
73
Yaw Drift 73
Support 76
Support 76
Firmware Archive
76
Factory Test Procedure
76
Software Archive 76
Advanced 78

Overview
navX-MXP
Overview
navX-MXP
navX-MXP is a 9-axis inertial/magnetic sensor and motion processor. Designed for plug-n-
play installation onto a National Instruments RoboRIO™, navX-MXP also provides RoboRIO I/O
Expansion.
navX-MXP is a must-have add on to any RoboRIO-based control system, and includes free
software libraries, example code and many more features.
navx-MXP works with the Kauai Labs Sensor Fusion Framework (SF2) to provide even more
advanced capabilities.
Super-charge your robot:
Field-Oriented Drive
Auto-balance
Auto-rotate to angle
Motion Detection
Collision Detection
and more…
1

Overview
navX-MXP
Expand your RoboRIO™:
10 Digital I/Os
4 Analog Inputs
2 Analog Outputs
I2C, SPI & UART Interfaces
Selectable Output Voltage
Features
Sophisticated Motion Processing
High Accuracy, Low-latency Yaw, Pitch and Roll Angles
Automatic Accelerometer/Gyroscope Calibration
Gravity-corrected Linear Acceleration
High-sensitivity Motion Detection
Tilt-compensated Compass Heading
9-Axis absolute heading w/Magnetic disturbance detection
Configurable Update Rate from 4 to 200Hz
Easy to Use
Plug-n-Play Installation via RoboRIO MXP Interface
USB, TTL UART, I2C and SPI communication interfaces
RoboRIO libraries and sample code
Tools for Magnetometer Calibration
Conformal-coated circuit board
Protective Enclosure
A custom navX-MXP enclosure can be created with a 3D printer using provided
Enclosure design files
Alternatively, the navX-MXP enclosure can be purchased online.
Open-Source
board schematics and bill of materials.
The Eclipse IDE and a free version of an ARM compiler can be downloaded for those
wishing to customize the firmware.
Firmware updates can be easily downloaded to the navX-MXP circuit board via the USB
port.
2

Overview
Technical Specifications
Technical Specifications
The navX-MXP circuit board and official firmware provide inertial and magnetic measurements,
with a range, accuracy and update rate as described on this page.
Note that certain performance specifications are only valid after a start-up
Gyroscope/Accelerometer Calibration period, during which time the navX-MXP circuit board
must be held still.
Additional details can be found in the navX-MXP datasheet.
Electrical Specifications
Voltage: 5V DC
Current Consumption: 50 millamps
Communications Interface: USB, TTL UART, SPI, I2C
Power Connector: USB and/or 5VDC/GND Pins on MXP
Connector
USB Connector: USB Mini-B
"Behind the Design"
navX-MXP is mentioned several times (pages 214-217, 227 and 231) within “FIRST Robots – Behind the Design –
30 Profiles of Design, Manufacturing and Control” (2015, USFIRST).
Team 624’s 2015 Robot
3

Overview
"Behind the Design"
navX-MXP on Team 2062’s 2015 Robot
About the “Behind the Design” Book
“Behind the Design – 30 Profiles of Design, Manufacturing and Control” has six chapters that focus on CAD
modeling, traditional machining, CNC mills and lathes, CNC cutting, 3D printing, and sensors/control. Each chapter
profiles five FRC teams to illustrate how these technologies apply to robot design, manufacturing, and control. The
book also includes vignettes between the chapters that illustrate the purpose of FIRST and its impact.
Frequently-asked Questions
Will navX-MXP work with the National Instruments RoboRIO™?
Yes, the navX-MXP is designed specifically to work with the RoboRIO. Please see the
instructions for installing navX-MXP onto a FIRST FRC robot for more details, as there
are several installation options.
5

Overview
Frequently-asked Questions
Will navX-MXP work with the Android-based FTC Control System?
Yes, navX-MXP can be used with the Android-based FTC Control System, via its I2C
interface. For more information, please see the FTC Robot Installation instructions and
the description of the Android Libraries.
Will navX-MXP work with the older National Instruments CRIO™ robot controller?
Yes, navX-MXP can be used with the National Instruments CRIO robot controller by
using the nav6 libraries, which are available on the . You will need a USB-to-RS232
serial converter in order to connect navX-MXP to the CRIO’s RS-232 port, and you will
also need a 12VDC-to-5VDConverter to provid power/ground to the power pins on the
navX-MXP’s MXP Connector.
Please note that the legacy nav6 libraries only use the navX-MXP serial interfaces, and
do not provide access to new navX-MXP features including 9-axis headings,
magnetometer calibration and magnetometer disturbance detection.
What interface/installation options are available for the navX-MXP?
Plug-n-play install to the RoboRIO MXP port
Connection to the RoboRIO MXP port via a male-to-female floppy-disk-style
ribbon cable
Connection to one of the RoboRIO USB Connectors via a USB Cable
Connection of power (+5VDC)/ground to the navX-MXP’s MXP Connector,
and direct connection to the TTL UART, I2C or SPI pins.
Aren’t the magnetometer (compass heading) readings unreliable when the navX-MXP is
used on a Robot with powerful motors?
Yes, this is correct. If navX-MXP is mounted nearby any energized motors, the
magnetometer’s ability to measure the (weak) earth’s magnetic field is severely
diminished.
However, at the beginning of each FIRST FRC match, the robot is turned on for about a
minute before the match begins. During this time period, the motors are not energized
and thus do not add magnetic interference that would disturb the magnetometer
6

Overview
Frequently-asked Questions
readings. Once the magnetometer is calibrated, navX-MXP will return either an accurate
magnetometer reading, or an indication that its measurement of the earth’s magnetic
field has been disturbed.
Magnetometer readings taken at the beginning of a match, when combined with the
navX-MXP yaw measurements, enable a robot’s pose and absolute heading to be
maintained throughout the match. This feature of the navX-MXP is referred to as a
“9-axis” heading.
Why do the Yaw angles provided by the navX-MXP drift over time?
The short answer is that the yaw angle is calculated by integrating reading from a
gyroscope which measures changes in rotation, rather than absolute angles. Over time,
small errors in the rotation measurements build up over time. The navX-MXP features
sophisticated digital motion processing and calibration algorithms that limit this error in
the yaw angle of ~1 degree per minute. For further details, please see the Yaw Drift
page.
Can the navX-MXP “Displacement” estimates be used for tracking a FRC or FTC robot’s
change in position (dead-reckoning) during autonomous?
Accelerometer data from the navX-MXP’s onboard MPU-9250 are double-integrated by
the navX-MXP firmware to estimate displacement, and are accurate to approximately 1
meter of error during a 15 second period.
To track a FRC or FTC robot’s position during autonomous requires an accuracy of
about 1 cm of error per 15 seconds. While the accuracy of the navX-MXP displacement
estimates might be good enough to track the position of an automobile on a road, it is
too low for use in tracking a FRC or FTC robot’s position during the 15 second
autonomous period.
The root cause of the displacement estimate error rate is accelerometer noise.
Estimating displacement requires first that each acceleration sample be multiple by itself
twice (cubed), and then integrated over time. Practically, if a noisy signal is cubed, the
result is very noisy, and when this very noisy value is integrated over time, the total
amount of error grows very quickly.
The current noise levels (approximately 150 micro-g per square-root-hertz) would need
to be reduced by a factor of 100 (two orders of magnitude) before displacement
estimates with 1 cm of error per 15 seconds can be achieved by double-integration of
7

Overview
Frequently-asked Questions
accelerometers.
MEMS accelerometers which feature these low noise levels are beginning to emerge,
but are currently very expensive. KauaiLabs is actively researching these technology
developments and projects that MEMS technology that is both (a) low noise (1 micro-g
per square root hertz) and (b) available at low cost will be available in approximately 5
years (~2020). KauaiLabs plans to develop a product which can be used for
accelerometer-based dead-reckoning at that time.
Did Invensense finally publicly release a description of the DMP (Digital Motion
Processor) and interface specs, or are you using what other people reverse engineered a
while ago?
The navX-MXP firmware uses the officially released Invensense MotionDriver version
6.1. Kauai Labs has ported this driver to work correctly on the navX-MXP’s STM32F411
micro-controller.
What’s the difference between navX-MXP and the navX-MXP Aero?
navX-MXP and the navX-MXP Aero share a single design. navX-MXP Aero adds a
pressure sensor (MS5611) providing additional altitude measurements with a resolution
of 10 cm.
Since the pressure sensor is an expensive component, this sensor was left off of navX-
MXP, decreasing the cost for those not desiring an altitude measurement.
8

Installation
Installation
Installation
Installation
Plug-n-play: navX-MXP is designed for rapid, plug-n-play installation on a
National Instruments RoboRIO™, making it easy to install and integrate onto robots including
a FIRST FRC Robot. navX-MXP and supports plug-n-play installation onto an Android-based
FTC Robot.
Orientation: Tips and tricks for ensuring navX-MXP measurements are aligned with your robot,
including the new Omnimount flexible mounting feature.
I/O Expansion: In addition to sophisticated motion processing, navX-MXP also provides analog
and digital I/O expansion on a RoboRIO.
Flexibility: To allow flexible customization, navX-MXP also supports several alternative
installation options as well as several communication options, providing flexibility
when integrating with other components.
Enclosure: To protect an installed navX-MXP, an enclosure is available – which can be either
purchased, or printed on a 3D printer using open-source design files.
RoboRIO Installation
navX-MXP is designed for plug-n-play installation onto the National Instruments RoboRIO™.
This installation takes about only a minute. To install, simply place the 34-pin “MXP” Connector
on the bottom of the navX-MXP circuit board into the corresponding MXP slot on the top of the
RoboRIO, as shown below.
9

Installation
RoboRIO Installation
10

Installation
RoboRIO Installation
Securing navX-MXP to the RoboRIO
Next, secure navX-MXP to the RoboRIO using two #4-40 screws, each with a length of 3/16th
inch. You can also use a 1/4 inch-long screw if you place a small washer between it and the top
of the navX-MXP circuit board.
Image not found
Securing the navX-MXP circuit board and RoboRIO to the robot chassis
The navX-MXP circuit board should be mounted such that it is firmly attached to the robot
chassis. The quality of this mounting will be directly reflected in the quality of navX-MXP
inertial measurements. To ensure quality, carefully follow these guidelines:
The RoboRIO on which the navX-MXP circuit board is placed should be tightly mounted;
it should be a part of the chassis mass, and should move exactly as the chassis moves.
Avoid mounting the navX-MXP circuit board in an area of the chassis that might be
flexible, as this could introduce vibration to the inertial sensors that does not represent
the chassis inertial properties.
The navX-MXP circuit board should be mounted in the center of the chassis, which
ensures the origin of the yaw/pitch/roll axes truly represent the chassis center.
Be sure to understand the orientation of the navX-MXP circuit board, relative to the
chassis, and decide whether OmniMount is needed.
Housing the navX-MXP circuit board in some form of protective enclosure is highly
recommended, to protect it from damage. This should both protect the circuit board from
damage, and provide strain relief for the cables that connect to the navX-MXP circuit
board.
(Note that there are several other installation options available.)
FTC Installation
Note: navX-MXP firmware version 2.2 or higher is required to use navX-MXP w/the FTC
Android-Based Robot Control System.
navX-MXP can be used with the FTC Android-Based Robot Control System released in 2015.
Both power to and signaling to/from navX-MXP occurs via the I2C interface by way of the Core
Device Interface Module (DIM) from Modern Robotics, Inc, as shown in the below diagram:
11

Installation
FTC Installation
Electrical Wiring Instructions
Select one of the 6 I2C ports on the DIM, as shown below. Note that the ports are
numbered from 0, starting at the bottom-most port on the left-hand side of the DIM.
Connect the +5V, Data (SDA), Clock (SCL) and GND pins on the selected DIM I2C port
to the corresponding pins on the navX-MXP External I2C Port Connector.
12

Installation
FTC Installation
To ensure the +5V from the DIM is used to power the navX-MXP board circuitry, ensure
that the “Voltage Select” jumper is set to 5V.
Electrical Wiring Verification
If properly wired, when power is applied to the DIM, the Red 3.3V LED on the navX-MXP should
light up.
Double-check that the SDA and the SCL wires on the DIM match the corresponding pins on the
navX-MXP circuit board.
Physical Installation on the Robot
The navX-MXP circuit board should be mounted such that it is firmly attached to the robot
chassis. The quality of this mounting will be directly reflected in the quality of navX-MXP
inertial measurements. To ensure quality, carefully follow these guidelines:
Whereever the navX-MXP circuit board is placed, it should be tightly mounted; it should
be a part of the chassis mass, and should move exactly as the chassis moves. Avoid
mounting the navX-MXP circuit board in an area of the chassis that might be flexible, as
this could introduce vibration to the inertial sensors that does not represent the chassis
inertial properties.
The navX-MXP circuit board should be mounted in the center of the chassis, which
ensures the origin of the yaw/pitch/roll axes truly represent the chassis center.
Be sure to understand the orientation of the navX-MXP circuit board, relative to the
chassis, and decide whether OmniMount is needed.
Housing the navX-MXP circuit board in some form of protective enclosure is highly
recommended, to protect it from damage. This should both protect the circuit board from
damage, and provide strain relief for the cables that connect to the navX-MXP circuit
board.
13

Installation
Orientation
Orientation
navX-MXP measures a total of 9 sensor axes (3 gyroscope axes, 3 accelerometer axes and 3
magnetometer axes) and fuses them into a 3-D coordinate system. In order to effectively use
the values reported by navX-MXP, a few key concepts must be understood in order to correctly
install navX-MXP on a robot.
3-D Coordinate System
When controlling a robot in 3 dimensions a set of 3 axes are combined into a 3-D coordinate
system, as depicted below:
In the diagram above, the green rounded arrows represent Rotational motion, and the
remaining arrows represent Linear motion.
Axis Orientation Linear motion Rotational Motion
X (Pitch) Left/Right – Left / + Right + Tilt Backwards
Y (Roll) Forward/Backward + Forward / – Backward + Roll Left
Z (Yaw) Up/Down + Up / – Down + Clockwise/ – Counter-
wise
More details are available on the Terminology page.
Reference Frames
Note that the 3-axis coordinate system describes relative motion and orientation; it doesn’t
specify the orientation with respect to any other reference. For instance, what does “left” mean
once a robot has rotated 180 degrees?
14

Installation
Orientation
To address this, the concept of a reference frame was developed. There are three separate
three-axis “reference frames” that should be understood:
Coordinate
System Technical Term X Axis Y Axis
Field World Frame Side of Field Front (Head) of Field
Robot Body Frame Side of Robot Front (Head) of Robot
navX MXP Board Frame See diagram Below See diagram below
Joysticks and Reference Frames
Since a three-axis joystick is typically used to control a robot, the robot designer must
select upon which Reference Frame the driver joystick is based. This selection of
Reference Frame typically depends upon the drive mode used:
Drive mode Reference Frame Coordinate Orientation
Standard
Drive Body Frame Forward always points to
the front (head) of the robot
Field-
oriented
Drive
World Frame Forward always points to
the front (head) of the field
navX-MXP Board Orientation (Board Frame)
Aligning Board Frame and Body Frame
In order for the navX-MXP sensor readings to be easily usable by a robot control application,
the navX-MXP Coordinate System (Board Frame) must be aligned with the Robot Coordinate
system (Body Frame).
Aligning the Yaw (Z) axis and Gravity
15

Installation
Orientation
The navX-MXP motion processor takes advantage of the fact that gravity can be measured with
its onboard accelerometers, fusing this information with the onboard gyroscopes to yield a very
accurate yaw reading with a low rate of drift. In order to accomplish this, the yaw (Z) axis must
be aligned with the “gravity axis” (the axis that points directly up and down with respect
to the earth).
When installing navX-MXP on a robot, the navX-MXP yaw (Z) axis and the gravity axis must be
aligned.
Default navX-MXP Board Orientation
The default navX-MXP circuit board orientation is with the navX-MXP logo on the Rear
Left, with the top of the circuit board pointing up (with respect to the earth).
Since Body Frame and Board Frame coordinates should be aligned, and because the Yaw axis
must be aligned with gravity, by default you must orient the navX-MXP with the top of the board
facing up, and with the Y axis (on the circuit board) pointing to the front of the robot.
If you need to mount the navX-MXP circuit board in a different orientation (vertically,
horizontally, or upside down), you can use the new OmniMount feature to transform the
orientation.
16

Installation
Orientation
17
Table of contents
Popular Accessories manuals by other brands

Olympus
Olympus AS2400 - AS Transcription Kit Mode d'emploi

Naterial
Naterial ANEMO DC116 Assembly, Use, Maintenance Manual

Southern Enterprises
Southern Enterprises Holton Assembly instructions

Detection Systems
Detection Systems DS720i installation instructions

dbx
dbx 903 instruction manual

IFM Electronic
IFM Electronic efector 250 O2D22x operating instructions

GF
GF Signet 2850 operating instructions

Siko
Siko LE100 Translation of the original installation instructions

Dragon Wholesaling
Dragon Wholesaling Veranda EVO Operations and Maintenance, Instructions of shipment, unpacking and installation

PCB Piezotronics
PCB Piezotronics 357A05 Installation and operating manual

Philips
Philips CRP381 brochure

Mophie
Mophie power reserve user manual