Top Banner

of 43

IMU Movi Dat

Jul 07, 2018

Download

Documents

Sofi Diaz
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/18/2019 IMU Movi Dat

    1/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 1 -

    Device OverviewThe CHR-6dm AHRS is a cost-effective

    orientation sensor providing yaw, pitch, androll angle outputs at up to 300 Hz. AnExtended Kalman Filter (EKF) combines datafrom onboard accelerometers, rate gyros,and magnetic sensors to produce yaw, pitch,and roll angle estimates.

    Communication with the CHR-6dm isperformed over a TTL (3.3V) UART at 115200Baud. The AHRS can be configured totransmit raw sensor in addition to angle estimates, and the transmission rate can be configuredin 1 Hz increments from 20 Hz to 300 Hz. Alternatively, the CHR-6dm can operate in "silentmode," where data is transmitted only when specific requests are received over the UART.

    Regardless of the transmission mode and rate, internal angle estimates are maintained at over500 Hz to ensure long-term accuracy.

    The CHR-6dm simplifies integration by providing a number of automatic calibration routines,including rate gyro bias calibration, magnetometer hard and soft iron calibration, andaccelerometer "zeroing" to compensate for AHRS-platform misalignment. All calibration routinesare triggered by sending simple commands over the serial interface.

     An onboard 3.3V regulator also simplifies integration. With possible input voltages ranging from+3.3V to +12V, and with 5V tolerant IO pins, the CHR-6dm is easily integrated with a wide range ofsystems. The CHR-6dm also provides +3.3V outputs that can supply up to 400mA of current forpowering other peripheral devices.

    For custom applications, the CHR-6dm makes 6 extra GPIO pins available, which can beconfigured as digital inputs and outputs and as a TTL UART and an SPI bus. The extra pins canbe used for motor control, GPS integration, pressure sensor integration, and communication withother digital devices, among other things. Free development tools are available, and our firmwareis available as a reference.

    Summary of Features

    •  Onboard EKF produces yaw, pitch, and roll angle estimates

    •  Automatic gyro bias calibration

    •  Soft and hard iron calibration

    •  Cross-axis misalignment correction1 

    •  Adjustable output rates (20 Hz - 300 Hz)

    •  Onboard 3.3V regulator simplifies integration

    •  +3.3V output sources up to 400mA for powering other peripherals (ie. GPS)•  Open-source firmware with free development tools

    •  Open-source PC software for data visualization and AHRS configuration

    •  Two UARTs and one SPI bus routed out for custom applications

    1 Soft and hard iron calibration matrices and cross-axis alignment matrices must be determined

    and set by the end user. The CHR-6dm configuration software includes routines for computing softand hard iron calibration data.

  • 8/18/2019 IMU Movi Dat

    2/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 2 -

    Common Applications

    •  Robotics

    •  Platform Stabilization

    •  Motion Tracking

    •  Enhanced GPS Navigation

    •  General Motion Sensing

    •  Image Stabilization

  • 8/18/2019 IMU Movi Dat

    3/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 3 -

    1.  Revision History ......................................................................................................................... 4 

    2.   Absolute Maximum Ratings ....................................................................................................... 4 3.  Electrical Characteristics............................................................................................................4 4.  Pin Configuration and Functional Descriptions ..........................................................................5 5.  Mechanical Drawing...................................................................................................................6 6.  Basic Operation..........................................................................................................................7 

    6.1.  Sampling, Filtering, and Angle Estimation.........................................................................8 6.1.1.  EKF Assumptions and Limitations ............................................................................8 6.1.2.  EKF tuning ................................................................................................................9 

    6.2.  Calibration........................................................................................................................10  6.2.1.  Gyro and Accelerometer Biases .............................................................................10 6.2.2.  Magnetometer Hard and Soft Iron Calibration........................................................11 6.2.3.  Gyro Scale Factor Calibration.................................................................................11 6.2.4.  Gyro Cross-Axis Alignment Calibration ..................................................................12 

    6.2.5.   Accel Cross-Axis Alignment Calibration ................................................................. 13 6.2.6.  Magnetometer and Accelerometer Reference Vectors ..........................................13 

    6.3.  Self-Test ..........................................................................................................................13 7.  Communication with the CHR-6dm..........................................................................................14 

    7.1.  CHR-6dm RX Packets.....................................................................................................14 7.1.1.  CHR-6dm RX Packet Overview..............................................................................14 7.1.2.  SET_ACTIVE_CHANNELS .................................................................................... 17 7.1.3.  SET_SILENT_MODE .............................................................................................17 7.1.4.  SET_BROADCAST_MODE....................................................................................18  7.1.5.  SET_GYRO_BIAS ..................................................................................................18 7.1.6.  SET_ACCEL_BIAS.................................................................................................19  7.1.7.  SET_ACCEL_REF_VECTOR.................................................................................19  7.1.8.   AUTO_SET_ACCEL_REF......................................................................................19 

    7.1.9.  ZERO_RATE_GYROS ...........................................................................................20 7.1.10.  SELF_TEST............................................................................................................20  7.1.11.  SET_START_CAL ..................................................................................................20 7.1.12.  SET_PROCESS_COVARIANCE ...........................................................................21 7.1.13.  SET_MAG_COVARIANCE.....................................................................................21  7.1.14.  SET_ACCEL_COVARIANCE ................................................................................. 21 7.1.15.  SET_EKF_CONFIG................................................................................................22  7.1.16.  SET_GYRO_ALIGNMENT .....................................................................................22 7.1.17.  SET_ACCEL_ALIGNMENT....................................................................................23  7.1.18.  SET_MAG_REF_VECTOR ....................................................................................23 7.1.19.   AUTO_SET_MAG_REF .........................................................................................23 7.1.20.  SET_MAG_CAL......................................................................................................24  7.1.21.  SET_MAG_BIAS.....................................................................................................24  7.1.22.  SET_GYRO_SCALE...............................................................................................24  7.1.23.  EKF_RESET ...........................................................................................................25 7.1.24.  RESET_TO_FACTORY..........................................................................................25  7.1.25.  WRITE_TO_FLASH................................................................................................25  7.1.26.  GET_DATA .............................................................................................................26 7.1.27.  GET_ACTIVE_CHANNELS....................................................................................26  7.1.28.  GET_BROADCAST_MODE ...................................................................................26 7.1.29.  GET_ACCEL_BIAS ................................................................................................27 7.1.30.  GET_ACCEL_REF_VECTOR ................................................................................ 27 7.1.31.  GET_GYRO_BIAS..................................................................................................27  

  • 8/18/2019 IMU Movi Dat

    4/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 4 -

    7.1.32.  GET_GYRO_SCALE ..............................................................................................28 7.1.33.  GET_START_CAL..................................................................................................28  

    7.1.34.  GET_EKF_CONFIG................................................................................................28  7.1.35.  GET_ACCEL_COVARIANCE.................................................................................29  7.1.36.  GET_MAG_COVARIANCE ....................................................................................29 7.1.37.  GET_PROCESS_COVARIANCE ...........................................................................29 7.1.38.  GET_STATE_COVARIANCE ................................................................................. 30 7.1.39.  GET_GYRO_ALIGNMENT.....................................................................................30  7.1.40.  GET_ACCEL_ALIGNMENT ...................................................................................30 7.1.41.  GET_MAG_REF_VECTOR .................................................................................... 31 7.1.42.  GET_MAG_CAL .....................................................................................................31 7.1.43.  GET_MAG_BIAS ....................................................................................................31 

    7.2.  CHR-6dm TX Packets ..................................................................................................... 32 7.2.1.  CHR-6dm TX Packet Overview ..............................................................................32 7.2.2.  COMMAND_COMPLETE .......................................................................................33 

    7.2.3.  COMMAND_FAILED ..............................................................................................33 7.2.4.  BAD_CHECKSUM..................................................................................................34  7.2.5.  BAD_DATA_LENGTH ............................................................................................34 7.2.6.  UNRECOGNIZED_PACKET ..................................................................................34 7.2.7.  BUFFER_OVERFLOW...........................................................................................35 7.2.8.  STATUS_REPORT.................................................................................................35  7.2.9.  SENSOR_DATA ..................................................................................................... 35 7.2.10.  GYRO_BIAS_REPORT ..........................................................................................36 7.2.11.   ACCEL_BIAS_REPORT......................................................................................... 37 7.2.12.   ACTIVE_CHANNEL_REPORT...............................................................................38 7.2.13.  BROADCAST_MODE_REPORT............................................................................42  

    8.  Disclaimer.................................................................................................................................43  

    1. Revision History

    Rev. 1.1 - Initial Release

    2. Absolute Maximum Ratings

    Table 1 - CHR-6dm Absolute Maximum Ratings 

    Symbol Ratings Maximum Value Unit

    Vdd Supply voltage -0.3 to +12V V

    Vin Input voltage on any digital IO pin -0.3 to 5.1 V V

    3000 g  for .5 ms A Acceleration

    10000 g  for .1 ms

    Top Operating temperature range -40 to +85 °C 

    Tstg Storage temperature range -40 to +125 °C 

    3. Electrical Characteristics

    Symbol Parameter Test condition Min. Typ. Max. Unit

  • 8/18/2019 IMU Movi Dat

    5/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 5 -

    Vdd Supply voltage 3.3 3.3 - 9 12 V

    Idd Supply current 50 52 58 mA

    Table 2 - Gyro Electrical Characteristics Symbol Parameter Test Condition Min. Typ. Max. Unit

    FSA 4x OUT (amplified) +/- 100 °/s

    FS

    MeasurementRange OUT (not amplified) +/- 400 °/s

    SoA 4x OUT (amplified) 10 mV/°/s 

    So

    Sensitivity

    OUT (not amplified) 2.5 mV/°/s

    SoDr Sensitivity changevs temperature

    Delta from 25 °C .03 %/°/s

    Voff Zero-rate level 1.23 V

    Vref Reference Voltage 1.23 V

    OffDr Zero-rate level

    change vs.temperature

    Delta from 25 °C .02 °/s/°C

    NL Non linearity Best fit straight line +/- 1 % FS

    BW Bandwidth 140 Hz

    Rn Rate noise density 0.017 °/s/rt Hz

    Table 3 - Accelerometer Electrical Characteristics Symbol Parameter Test Condition Min. Typ. Max. Unit

    aFS Measurement Range +/- 3 +/- 3.6  g

    SoXYZ Sensitivity Vdd = 3 V 270 300 330 mV/ g 

    Stemp Sensitivity change

    due to temperature

    Vs = 3 V 0.01 %/°C

    nXY X,Y noise density 150 ug/rt Hz

    nZ Z noise density 300 ug/rt Hz

    offXY X,Y 0 g voltage Vs = 3 V 1.35 1.5 1.65 V

    offZ Z 0 g voltage Vs = 3 V 1.2 1.5 1.8 V

    aNL Non linearity +- .03 % FS

    aBW With external filter 140 Hz

    4. Pin Configuration and Functional Descriptions

    Top View (note: drawing is not to scale)

  • 8/18/2019 IMU Movi Dat

    6/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 6 -

    1

    9

    10

    13

    1

    9

    10

    13

     

    Table 4 - Pin DescriptionsPin Description

    Pin # Pin Name Description

    1 TX TX (output)

    2 RX RX (input)

    3 PGM Bootloader activation pin. Pull high to activate bootloader - leavedisconnected for normal operation.

    4 D1 GPIO pin 1 (TX2)

    5 D2 GPIO pin 2 (RX2)

    6 D3 GPIO pin 3 (MOSI)

    7 D4 GPIO pin 4 (MISO)

    8 D5 GPIO pin 5 (SCK)

    9 D6 GPIO pin 6 (SS)

    10 Vdd Input voltage (3.3 - 12 V)

    11 GND Ground

    12 GND Ground13 +3.3V +3.3V output.

    5. Mechanical Drawing

    Top View (Not to Scale)

    X

    Y Z

  • 8/18/2019 IMU Movi Dat

    7/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 7 -

    0.1”

    0.96”

    1.0”

    0.08”

    0.188”

    0.06”

    0.18”

    0.08”

    0.08”

    0.58”

    0.0675”

    .06”

    0.063” x 40.1”

    0.96”

    1.0”

    0.08”

    0.188”

    0.06”

    0.18”

    0.08”

    0.08”

    0.58”

    0.0675”

    .06”

    0.063” x 4

     

    6. Basic Operation

    The CHR-6dm is factory-configured to broadcast angles and angular rates at 200 Hz over a TTLUART at 115200 baud. The serial protocol uses 8 data bits, 1 stop bit, and no parity. The UARTlogic level is 3.3V, but the pins are 5V tolerant for simple integration with +5V systems.

    Data from the AHRS is transmitted in a specific packet structure outlined in Section 7,"Communication with the CHR-6dm." On first power-up, the CHR-6dm will begin transmittingSENSOR_DATA packets at the aforementioned rate. See Section 7.2.9 for details about theSENSOR_DATA packet.

    By default, the CHR-6dm only transmits yaw, pitch, and roll angles, and angular rates. However,the AHRS can also be configured to send sensor data from any set of sensors by sending a thesensor a SET_ACTIVE_CHANNELS packet. Only data from "active" channels will be transmitted bythe AHRS.

    Angle estimates and sensor measurements are returned as 16-bit 2's complement integers. Toobtain actual angles and sensor measurements, the data returned by the AHRS should bemultiplied by a scale factor. Scale factors for each channel are given below

  • 8/18/2019 IMU Movi Dat

    8/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 8 -

    Table 5 - Data output scale factors

    ChannelScaleFactor Units

    Yaw 0.0109863 °/LSB

    Pitch 0.0109863 °/LSB

    Roll 0.0109863 °/LSB

    Yaw rate 0.0137329 °/s/LSB

    Pitch rate 0.0137329 °/s/LSB

    Roll rate 0.0137329 °/s/LSB

    Mag x 0.061035 mGauss/LSB

    Mag y 0.061035 mGauss/LSB

    Mag z 0.061035 mGauss/LSB

    Gyro x 0.01812 °/s/LSBGyro y 0.01812 °/s/LSB

    Gyro z 0.01812 °/s/LSB

     Accel x 0.106812 mg/LSB

     Accel y 0.106812 mg/LSB

     Accel z 0.106812 mg/LSB

    The CHR-6dm AHRS operates in one of two modes: in Broadcast Mode, the AHRS automaticallytransmits sensor data at a user-configurable frequency between 20 Hz and 300 Hz. In SilentMode, the AHRS only transmits data when a GET_DATA packet is received over the UART. TheCHR-6dm is set to Broadcast Mode by default. The default transmission frequency is 200 Hz.

    Regardless of the broadcast frequency, the AHRS output registers are updated internally at a

    rate of 500 Hz. When the AHRS transmits sensor data and states, the most recent samples aresent. Sensor data is always sent in a SENSOR_DATA packet.

    Broadcast Mode is enabled by sending a SET_BROADCAST_MODE packet to the AHRS. TheSET_BROADCAST_MODE packet also configures the broadcast frequency. Silent Mode is enabledby sending a SET_SILENT_MODE packet to the AHRS.

    All changes made to the AHRS configuration are stored in RAM. To make the configurationpersistent, a WRITE_TO_FLASH packet should be sent to the AHRS.

    6.1. Sampling, Filtering, and Angle Estimation

    The CHR-6dm oversamples and decimates the ADC data on all channels to reduce quantizationnoise and increase the effective ADC resolution to 16 bits. Decimated sensor data is then passedto the EKF for angle estimation.

    6.1.1. EKF Assumptions and Limitations

    The CHR-6dm uses a continuous-discrete implementation of the EKF, where rate gyromeasurements are used to drive the prediction step, and the accelerometer and magnetometer areused for drift correction in the update step. Two major assumptions are made:

  • 8/18/2019 IMU Movi Dat

    9/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 9 -

    1. On average, the accelerometers measure the gravity vector. The EKF "knows" which way is

    down by observing the direction of the gravity vector. There are a number of cases where thisassumption breaks down, particularly in aircraft. When an aircraft makes a coordinated turn,the measured acceleration will always point in the direction of the bottom of the fuselage. Overa long turn, the AHRS pitch and roll angle estimates will therefore tend to zero. To correct thisproblem, additional sensors must be used for centripetal compensation. The CHR-6dm has nonative support for centripetal compensation.

    2. Distortion of the magnetic field measurement is predictable. Distortion from objects that rotateand translate with the AHRS can be corrected, but other distortions (from power lines, ferrousmetal objects, etc.) will cause erroneous angle measurements.

     As long as the two preceding assumptions are valid, the AHRS can provide better than .5 degreeaccuracy in pitch and roll, and 1 degree accuracy in yaw under static conditions.

     All AHRS angle measurements are made with respect to a North-East-Down (NED) inertial frame.The inertial frame x-axis is aligned with magnetic north, the y-axis is aligned with magnetic east,and the z-axis points down toward the center of the Earth. The "pitch" angle represents positiverotation about the x-axis, "roll" represents positive rotation about the y-axis, and "yaw" representspositive rotation about the z-axis.

    The sequence of rotations used to give the orientation of the AHRS is first yaw, then pitch, then roll.

    Note that since Euler angles (yaw, pitch, roll) are used to represent the orientation of the AHRS,there is a singularity at pitch = +/-90 degrees. That is, when the pitch angle reaches +/-90 degrees,there is more than one way to represent the AHRS orientation, and the angle estimate may nolonger be valid. The CHR-6dm therefore cannot be used to measure orientation if it is

    expected to approach a pitch angle of +/-90 degrees.  To fix this problem, a quaternionrepresentation must be used instead of Euler Angles. At this time, the CHR-6dm does not supportquaternions.

    In the event that the CHR-6dm encounters a singularity, the angle estimate and covariance can bereset by sending the AHRS an EKF_RESET packet.

    In some cases, it may be necessary to ignore data received by the accelerometers or by themagnetometer. For example, if the AHRS is to be used in an environment where the magnetic fieldreadings aren't reliable (ie. indoors or next to an RF transmitter), then magnetometer inputs to theEKF can be disabled. Accelerometer inputs can be similarly disabled, and the EKF can be turnedoff entirely if desired. The EKF is configured by sending a SET_EKF_CONFIG packet to the AHRS.

    6.1.2. EKF tuning

    EKF performance can be tuned by adjusting the process noise covariance matrix and themeasurement noise covariance matrices (there are two measurement noise matrices - one for theaccels, and one for the magnetometer). Generally the measurement noise matrices should remainfixed at the factory default, and the process noise matrix should be adjusted. Measurement noisematrices can be adjusted by sending SET_MAG_MEASUREMENT_NOISE andSET_ACCEL_MEASUREMENT_NOISE packets. The process noise matrix can be adjusted bysending a SET_PROCESS_NOISE packet.

  • 8/18/2019 IMU Movi Dat

    10/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 10 -

    Loosely speaking, the process noise matrix is used to specify how much the EKF "trusts" data from

    the gyros with respect to data from the magnetic sensors and accelerometers. The lower thevalues along the diagonal of the matrix, the more the rate gyros are trusted. Conversely, if thediagonal elements are large, the gyros are trusted less and the accels and magnetometers areweighted more heavily.

    Trusting gyros more heavily increases the effect of time-varying gyro output biases, essentiallyincreasing DC errors in the angle estimates. Trusting accels and magnetic sensors more heavilyincreases AHRS sensitivity to vibrations and distorted magnetic field measurements.

    Optimal selection of the process noise matrix depends on the specific environment in which the AHRS will be operating. If the AHRS will be subjected to large accelerations that interfere withgravity vector measurement, then the diagonal terms of the process noise matrix should be small.On a more stationary platform, on the other hand, the accels can be trusted more. Increase the

    diagonal terms of the process noise matrix to reduce bias errors.

    6.2. Calibration

    The CHR-6dm comes ready to report angles immediately, but in precision applications it is oftenbeneficial to perform extra calibration to improve accuracy. There are a variety of calibrationprocedures that can be performed ranging from very simple to more complex. Possible calibrationoptions are:

    1. Rate gyro bias calibration2. Rate gyro scale factor calibration3. Accelerometer bias calibration4. Magnetometer soft and hard iron calibration5. Accelerometer and magnetometer reference vectors6. Accelerometer and rate gyro cross-axis misalignment correction

    Details about each calibration procedure are given below.

    6.2.1. Gyro and Accelerometer Biases

    The zero-rate output the rate gyros and the zero-acceleration output of the accelerometers isdevice-dependent, and the gyro biases vary with temperature. The 16-bit signed value returned bythe AHRS for each axis is given by

    data = ADC_data - bias

    where ADC_data is the unsigned filtered ADC data, and bias is a configurable 16-bit signed value.By default, bias is set at 0 for both the rate gyros and the accelerometers. While the default biasesmay be sufficient for the accelerometers, the biases for the rate gyros should generally bereconfigured at run-time.

    The bias for the x, y, and z gyro axes can be configured using the SET_ GYRO_BIAS packet. The AHRS also includes an auto-zero command that samples the rate gyro channels and automaticallysets the bias to zero the output data. Automatic gyro calibration is triggered by sending a

  • 8/18/2019 IMU Movi Dat

    11/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 11 -

    ZERO_RATE_GYROS packet to the AHRS. During automatic calibration, which takesapproximately three seconds, the AHRS should be stationary.

    By default, the rate gyros are re-calibrated automatically on AHRS startup. Automatic startupcalibration can be disabled and re-enabled by sending a SET_START_CAL packet to the AHRS.

    The bias for the accelerometers is set using the SET_ ACCEL_BIAS packet.

    6.2.2. Magnetometer Hard and Soft Iron Calibration

    Metal and magnetic objects near the AHRS distort magnetometer measurements, creatingsignificant errors in estimated angles. Distortions from objects that are not in a fixed positionrelative to the AHRS cannot generally be corrected. On the other hand, distortions from objects

    that are in a fixed position with respect to the AHRS can be detected and corrected. For example,if the AHRS is mounted to a platform using steel screws, the magnetic field will be distorted; but,since the screws rotate and translate with the AHRS, the distortions can be corrected. In contrast,if a screwdriver were placed close to the AHRS, then the resulting distortions could not becorrected because the screwdriver does not move with the sensor.

    For magnetometer soft and hard iron calibration the common procedure is to mount the AHRS in itsfinal configuration and then perform calibration.

    Magnetic field inputs to the EKF are first multiplied by a field correction matrix which can be set bysending a SET_MAG_CAL packet to the AHRS. By default, the correction matrix is the identity (ie.no calibration is performed). The CHR-6dm configuration utility can be used to determine the fieldcorrection matrix and write it to the AHRS.

    6.2.3. Gyro Scale Factor Calibration

    For improved accuracy, the internal rate gyro scale factor can be changed by the user. Theinternal rate gyro scale factor is different from the scale factor described in Section 6. The scalefactor described in Section 6 is used by the end user to convert the 16-bit signed integer output ofthe AHRS to an actual angular rate. The scale factor mentioned here is used internally to convertraw sensor data to a floating point angular rate used by the EKF. This rate is later converted to a16-bit signed integer for transmission from the AHRS.

    Internal gyro rate measurements are given by

    rate_output  = scale_factor *( ADC_data - bias)

    in degrees per second. The CHR-6dm comes with a preset scale factor that is close to the truevalue. While the preset scale factor is accurate enough for most applications, better dynamic angleaccuracy can be obtained by calibrating the device.

    To calibrate the scale factor, a user would rotate the AHRS at a known rate (using a turn-table withan encoder or hall effect sensor for rate measurement) and measure the rate gyro outputs. Thescale factor is given simply by

  • 8/18/2019 IMU Movi Dat

    12/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 12 -

    scale_factor  = actual_rate / gyro_output  

    where 'actual_rate' is given in degrees per second. The scale factor for each gyro axis can be setby sending a SET_X_GYRO_SCALE, SET_Y_GYRO_SCALE, or SET_Z_GYRO_SCALE packet.To revert to factory settings, a RESET_TO_FACTORY packet should be sent.

    6.2.4. Gyro Cross-Axis Alignment Calibration

    The CHR-6dm measures rotation rates about three axes. Under ideal circumstances, these threeaxes would be perfectly orthogonal, so that rotation about a single AHRS axis would only produceoutputs on the rate gyro for that axis. Due to manufacturing tolerances, however, the axes arenever perfectly aligned. While cross-axis misalignment is often small enough that it can beignored, precision applications may require that misalignment be corrected.

    Cross-axis misalignment correction can be understood in terms of a change of basis from a non-orthogonal basis formed by the axes of the rate gyros to an orthogonal basis formed by the bodyframe of the sensor (see Section 6.1 for details about coordinate frames used by the AHRS). Wewill say that the basis vectors for the body coordinate frame are given by the elementary basis

    vectors { }321

      eee . The basis vectors for the non-orthogonal rate gyro axes, expressed in

    terms of the elementary basis vectors, are given by  z  y x   vvv .

    The rotation rates measured by the rate gyros are expressed in terms of the basis z  y x

      vvv .

    Let the vector x is be composed of the x , y , and z  rotation rates measured by the rate gyros at anygiven time. Then the rotation rates expressed in the body frame are given by

    xxx   T vvv  z  y xe   ==  

    This is simply a change of basis operation. By default, T is the identity matrix (ie. no cross-axiscalibration is performed). If cross-axis calibration is to be performed, T  must be determinedexperimentally. The matrix T  can then be set be the user by sending a SET_GYRO_ALIGNMENTpacket to the AHRS.

    To determine T  experimentally, the AHRS should be mounted on the center of a turn-table that canrotate the AHRS at a constant rate about any body frame axis. The exact rate is not important. Itis important, however, that the AHRS is mounted so that when the turn-table is spinning, there isonly rotation about one body frame axis at a time. The mechanical fixture used to mount the AHRSmust therefore have tight tolerances.

    By rotating the AHRS about one body frame axis and measuring the response of all the rate gyros,

    it is possible to determine the vectors needed to perform the change of basis. Let xv̂  be the

    measured response of the rate gyros to rotation about the body frame x-axis. Let y

    v̂  and  z v̂  be

    similarly defined. Then the matrix T  is given by

    [ ] 1ˆˆˆ   −= z  y x   vvvT  .

  • 8/18/2019 IMU Movi Dat

    13/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 13 -

    To prevent unwanted scaling, each column vector in T should be normalized.

    6.2.5. Accel Cross-Axis Alignment Calibration

    The accelerometers on the CHR-6dm would ideally be perfectly aligned to the body frame of thedevice. Much like the onboard gyros, however, manufacturing tolerances cause smallmisalignments in the accelerometer axes with respect to the body frame. While cross-axismisalignment is often small enough that it can be ignored, precision applications may require thatmisalignment be corrected.

    Cross-axis calibration of the accelerometers is performed in the same fashion as rate gyro cross-axis calibration, except that the AHRS should be aligned with the gravity vector for each axisinstead of being rotated about the body frame axes.

    The accelerometer cross-axis alignment matrix can be set by sending aSET_ACCEL_ALIGNMENT packet to the AHRS.

    6.2.6. Magnetometer and Accelerometer Reference Vectors

    The AHRS uses two reference vectors to determine its orientation. The accelerometer referencevector corresponds to the measured gravity vector when pitch and roll angles are zero. Themagnetometer reference vector represents the measured magnetic field of the Earth when yaw,pitch, and roll angles are zero. When the accelerometer and magnetometer reference vectorsmatch the output of the sensors, the AHRS is oriented with zero yaw, pitch, and roll.

    By default, the accelerometer reference vector corresponds to a zero reading on the X and Y accelaxes, and the acceleration of gravity on the Z axis. Thus, if the sensor is perfectly "flat" withrespect to the Earth, pitch and roll angles will remain at zero. In some cases, the AHRS will not bemounted perfectly level. The accelerometer reference vector can be reset so that the currentorientation of the AHRS corresponds to zero pitch and roll. This is accomplished by sending the AHRS an AUTO_SET_ACCEL_REF packet. When the packet has been received, the AHRS willtake the current accelerometer readings and use them as the reference vector. The accelreference vector can also be set manually by sending a SET_ACCEL_REF_VECTOR packet to the AHRS.

    By default, the magnetometer reference vector is set as the magnetic field measurement whenyaw, pitch, and roll angles are zero (ie. the x-axis of the sensor is aligned with magnetic north).Since the magnetic field of the Earth changes depending on location, the magnetometer referencevector should be reset to correspond to its location. This can be accomplished by orienting the AHRS so that it is pointed magnetic north (y-axis reading should be zero) and sending an AUTO_SET_MAG_REF packet to the unit. Alternatively, the reference vector can be set manuallybe sending a SET_MAG_REF_VECTOR packet to the AHRS.

    6.3. Self-Test

    The CHR-6dm includes a self-test feature that checks rate gyro and accelerometer channels forproper functionality. The self-test sequence is started by sending a SELF_TEST packet to the

  • 8/18/2019 IMU Movi Dat

    14/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 14 -

     AHRS. On completion, a STATUS_REPORT packet is returned to report whether each sensorchannel passed the self-test.

    7. Communication with the CHR-6dm

    The CHR-6dm communicates over a logic-level UART at 115200 baud, 8 data bits, 1 stop bit, andno parity. While the logic level is 3.3 V, the IO pins are 5V tolerant for simple integration with5V systems. 

    7.1. CHR-6dm RX Packets

    RX Packets are packets that can be received by the CHR-6dm. Each packet received by the AHRSmust begin with the three byte sequence "snp" to signal the beginning of a new packet. Thefourth byte is Packet Type indicator (PT), which identifies the packet being received. The fifth

    byte, N, is the number of bytes contained in the data section of the packet. The N-byte datasection immediately follows data length byte, and the packet is finally ended with a two bytechecksum, which contains the sum of all previous bytes in the packet.

    If the Packet Type indicator is unrecognized, the AHRS will transmit anUNRECOGNIZED_COMMAND packet.

    RX Packet Structure

    Function 's' 'n' 'p' PT N d1  dN  CHK

    Byte 1 2 3 4 5 6 N+5 N+6 N+7

    RX Packet Description

    1 - 3 Each received packet must begin with the three-byte (character) sequence"snp" to signal the beginning of a new packet.

    4 PT specifies the packet type.

    5 N specifies the number of data bytes to expect.

    6 - (N+5) d1 through dN contain the N data bytes in the packet. 

    (N+6) - (N+7)  CHK is a two-byte checksum. 

    The total size of a packet with N data bytes is (N + 7) bytes. After the CHR6-dm receives a fullpacket, it checks to ensure that the checksum given in the last two bytes matches the sum of allpreceding bytes in the packet. If the checksum is invalid, a BAD_CHECKSUM packet istransmitted in response.

    7.1.1. CHR-6dm RX Packet Overview

    PT Packet Name Description

    0x80 SET_ACTIVE_CHANNELS Specifies which channel data should be transmittedover the UART.

    0x81 SET_SILENT_MODE Enables "Silent Mode." In Silent Mode, the AHRSonly reports data when a GET_DATA packet is

  • 8/18/2019 IMU Movi Dat

    15/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 15 -

    received.

    0x82 SET_BROADCAST_MODE Enables "Broadcast Mode." In Broadcast Mode, the AHRS automatically transmits sensor data every Ts milliseconds, where Ts is encoded in the data sectionof the SET_BROADCAST_MODE packet.

    0x83 SET_GYRO_BIAS Manually sets the x-axis rate gyro bias term. The biasterm can be automatically set for all gyro axes bysending a ZERO_RATE_GYROS packet.

    0x84 SET_ACCEL_BIAS Manually sets the x-axis accelerometer bias term.

    0x85 SET_ACCEL_REF_VECTOR Manually sets the accelerometer reference vectorused by the EKF to determine "which way is down"

    0x86 AUTO_SET_ACCEL_REF Causes the AHRS to set the current accelerometer

    measurements as the reference vector (sets pitch androll angles to zero for the given orientation).

    0x87 ZERO_RATE_GYROS Starts internal self-calibration of all three rate gyroaxes. By default, rate gyros are zeroed on AHRSstartup, but gyro startup calibration can be disabled(or re-enabled) by sending a SET_START_CALpacket.

    0x88 SELF_TEST Instructs the AHRS to perform a self-test of all sensorchannels. A STATUS_REPORT packet is transmittedafter the self-test is complete.

    0x89 SET_START_CAL Enables or disables automatic startup calibration ofrate gyro biases.

    0x8A SET_PROCESS_COVARIANCE Sets the 3x3 matrix representing the covariance of the

    process noise used in the prediction step of the EKF.0X8B SET_MAG_COVARIANCE Sets the 3x3 matrix representing the covariance of the

    measurement noise used in the magnetometer updatestep of the EKF

    0x8C SET_ACCEL_COVARIANCE Sets the 3x3 matrix representing the covariance of themeasurement noise used in the accelerometer updatestep of the EKF

    0x8D SET_EKF_CONFIG Sets the EKF_CONFIG register. Can be used toenable/disable the EKF, or to enable/disableaccelerometer and magnetometer updates.

    0x8E SET_GYRO_ALIGNMENT Sets the 3x3 matrix used to correct rate gyro cross-axis misalignment.

    0x8F SET_ACCEL_ALIGNMENT Sets the 3x3 matrix used to correct accelerometer

    cross-axis misalignment0x90 SET_MAG_REF_VECTOR Sets the reference vector representing the expected

    output of the magnetometer when yaw, pitch, and rollangles are zero.

    0x91 AUTO_SET_MAG_REF Sets the current magnetometer output as thereference vector.

    0x92 SET_MAG_CAL Sets the 3x3 magnetic field distortion correction matrixto compensate for soft-iron distortions, axismisalignment, and sensor scale inconsistencies.

    0x93 SET_MAG_BIAS Sets the magnetic field measurement bias to

  • 8/18/2019 IMU Movi Dat

    16/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 16 -

    compensate for hard iron distortions

    0x94 SET_GYRO_SCALE Sets the scale factors used to convert raw ADC datato rates for angle estimation on the EKF.

    0x95 EKF_RESET Sets all terms in the current state covariance matrix tozero and re-initializes angle estimates.

    0x96 RESET_TO_FACTORY Resets all AHRS setting to factory default values

    0xA0 WRITE_TO_FLASH Writes current AHRS configuration to on-board flash,so that the configuration persists when the power iscycled.

    0x01 GET_DATA In Listen Mode, causes the AHRS to transmit datafrom all active channels in a SENSOR_DATA packet.

    0x02 GET_ACTIVE_CHANNELS Reports which channels are "active" in an

     ACTIVE_CHANNELS_REPORT packet. Activechannels are sensor channels that are measured andtransmitted in response to a GET_DATA packet, orperiodically in Broadcast Mode.

    0x03 GET_BROADCAST_MODE Returns the BROADCAST_MODE_REPORT packet,which specifies whether the AHRS is in BroadcastMode or Silent Mode.

    0x04 GET_ACCEL_BIAS Return the bias values for all three accel axes in a ACCEL_BIAS_REPORT packet.

    0x05 GET_ACCEL_REF_VECTOR Returns the accelerometer reference vector in an ACCEL_REF_VECTOR_REPORT packet

    0x06 GET_GYRO_BIAS Returns the bias values for all three rate gyros in aGYRO_BIAS_REPORT packet.

    0x07 GET_GYRO_SCALE Returns the rate gyro scale factors used internally toconvert raw rate gyro data to actual rates in aGYRO_SCALE_REPORT packet.

    0x08 GET_START_CAL Reports whether the AHRS is configured to calibraterate gyro biases automatically on startup in aSTART_CAL_REPORT packet.

    0x09 GET_EKF_CONFIG Returns the one byte EKF configuration register in anEKF_CONFIG_REPORT packet.

    0X0A GET_ACCEL_COVARIANCE Returns the variance of the accelerometermeasurements used by the EKF update step

    0x0B GET_MAG_COVARIANCE Returns the variance of the magnetometermeasurements used by the EKF update step

    0x0C GET_PROCESS_COVARIANCE Returns the variance of the EKF prediction step

    0x0D GET_STATE_COVARIANCE Returns the 3x3 matrix representing the covariance ofthe current EKF state estimates in aSTATE_COVARIANCE_REPORT packet.

    0x0E GET_GYRO_ALIGNMENT Returns the 3x3 matrix used to correct rate gyrocross-axis misalignment

    0x0F GET_ACCEL_ALIGNMENT Returns the 3x3 matrix used to correct accelerometercross-axis misalignment

    0x10 GET_MAG_REF_VECTOR Returns the magnetometer reference vector in aMAG_REF_VECTOR_REPORT packet

  • 8/18/2019 IMU Movi Dat

    17/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 17 -

    0x11 GET_MAG_CAL Returns the 3x3 magnetometer correction matrix in anMAG_CAL_REPORT packet

    0x12 GET_MAG_BIAS Returns the magnetometer bias correction used bythe EKF. The bias is reported in aMAG_BIAS_REPORT packet.

    7.1.2. SET_ACTIVE_CHANNELS

    Description

    Specifies which channel data should be transmitted over the UART in response to a GET_DATApacket, or periodically in Broadcast Mode. Any combination of sensor channels can be set asactive or inactive.

    Packet Definition

    PT = 0x80N = 2

    D1 D2

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    yaw pitch rollyawrate

    pitchrate

    rollrate mx my mz gx gy gz ax ay az 0

    If the bit corresponding to a sensor channel is set (i.e. gz = 1), then the channel is active. If the bitis cleared (i.e. gz = 0), then the channel is inactive, and data from that channel will not be

    transmitted.

    yaw = yaw angle estimatepitch = pitch angle estimateroll = roll angle estimateyaw rate = yaw rate estimatepitch rate = pitch rate estimateroll rate = roll rate estimatemx = magnetometer x-axis datamy = magnetometer y-axis datamz = magnetometer z-axis datagx = gyro x-axis datagy = gyro y-axis datagz = gyro z-axis dataax = accel x-axis dataay = accel y-axis dataaz = accel z-axis data

    7.1.3. SET_SILENT_MODE

    Description

  • 8/18/2019 IMU Movi Dat

    18/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 18 -

    Enables "Silent Mode." In Silent Mode, the AHRS only reports data when a GET_DATA packet is

    received.

    Packet Definition 

    PT = 0x81N = 0

    The SET_SILENT_MODE packet includes no data bytes (the data length byte is followedimmediately by the checksum).

    7.1.4. SET_BROADCAST_MODE

    Description

    Enables "Broadcast Mode." In Broadcast Mode, the AHRS automatically transmits sensor data atregular time intervals.

    Packet Definition 

    PT = 0x82N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

     x

    The broadcast frequency is given byf  = ((280/255)* x  + 20) Hz

    where f  is the broadcast frequency, and x  is the data byte passed in theSET_BROADCAST_MODE packet. The broadcast frequency thus ranges between 300 Hz (x =255) and 20 Hz (x = 0).

    7.1.5. SET_GYRO_BIAS

    Description

    Manually sets the rate gyro bias on the X, Y, and Z rate gyros. The bias can be automatically set

    for all gyro axes by sending a ZERO_RATE_GYROS packet. The biases must be 16-bit 2'scomplement integers.

    Packet Definition

    PT = 0x83N = 6

    D1 D2 D3 D4 D5 D6

  • 8/18/2019 IMU Movi Dat

    19/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 19 -

    Z Gyro Bias Y Gyro Bias X Gyro Bias

    7.1.6. SET_ACCEL_BIAS

    Description

    Manually sets the accelerometer biases on the X, Y, and Z accelerometers. The biases must be16-bit 2's complement integers.

    Packet Definition

    PT = 0x84

    N = 6

    D1 D2 D3 D4 D5 D6

    Z Accel Bias Y Accel Bias X Accel Bias

    7.1.7. SET_ACCEL_REF_VECTOR

    Description

    Manually sets the accelerometer reference vector. The data in the SET_ACCEL_REF_VECTORpacket corresponds to the raw accelerometer measurements expected when the pitch and rollangles are zero. The data for each axis should be a 16-bit 2's complement integer.

    Packet Definition

    PT = 0x85N = 6

    D1 D2 D3 D4 D5 D6

    Z ref Y ref X ref

    7.1.8. AUTO_SET_ACCEL_REF

    Description

    Sets the accel reference vector to the most recent data acquired by the accelerometers. Returnsthe new reference vector in a ACCEL_REF_VECTOR_REPORT packet.

    Packet Definition

    PT = 0x86N = 0

  • 8/18/2019 IMU Movi Dat

    20/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 20 -

    The AUTO_SET_ACCEL_REF packet includes no data bytes (the data length byte is followedimmediately by the checksum).

    7.1.9. ZERO_RATE_GYROS

    Description

    Starts internal self-calibration of all three rate gyro axes. By default, rate gyros are zeroed on AHRS startup, but gyro startup calibration can be disabled (or re-enabled) by sending aSET_START_CAL packet

    Packet Definition

    PT = 0x87N = 0

    There are no data bytes associated with the ZERO_RATE_GYROS packet. The checksumimmediately follows the data length byte.

    7.1.10. SELF_TEST

    Description

    Instructs the AHRS to perform a self-test of the accelerometer and gyro sensor channels. The self-test sequence takes approximately 570 milliseconds to complete. During this time, the AHRSshould be kept stationary. A STATUS_REPORT packet is transmitted after the self-test is

    complete.

    Packet Definition

    PT = 0x88N = 0

    There are no data bytes associated with the SELF_TEST packet. The checksum immediatelyfollows the data length byte.

    7.1.11. SET_START_CAL

    Description

    Enables or disables automatic startup calibration of rate gyros.

    Packet Definition 

    PT = 0x89N = 1

  • 8/18/2019 IMU Movi Dat

    21/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 21 -

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0NA NA NA NA NA NA NA en

    If 'en' = 1, then startup calibration will be enabled.

    7.1.12. SET_PROCESS_COVARIANCE

    Description

    Sets the process covariance to be used in the prediction step of the EKF. The unit assumes thatthe process covariance will be a diagonal matrix with equivalent diagonal entries. TheSET_PROCESS_COVARIANCE packet thus includes only one 32-bit floating point value for thecovariance matrix.

    Packet Definition 

    PT = 0x8AN = 4

    D1 D2 D3 D4

    32-bit IEEE floating point value

    7.1.13. SET_MAG_COVARIANCE

    Description

    Sets the covariance to be used in the magnetometer update step of the EKF. The unit assumesthat the magnetometer covariance will be a diagonal matrix with equivalent diagonal entries. TheSET_MAG_COVARIANCE packet thus includes only one 32-bit floating point value for thecovariance matrix.

    Packet Definition 

    PT = 0x8BN = 4

    D1 D2 D3 D4

    32-bit IEEE floating point value

    7.1.14. SET_ACCEL_COVARIANCE

    Description

    Sets the covariance to be used in the accelerometer update step of the EKF. The unit assumesthat the accelerometer covariance will be a diagonal matrix with equivalent diagonal entries. The

  • 8/18/2019 IMU Movi Dat

    22/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 22 -

    SET_ACCEL_COVARIANCE packet thus includes only one 32-bit floating point value for thecovariance matrix.

    Packet Definition 

    PT = 0x8CN = 4

    D1 D2 D3 D4

    32-bit IEEE floating point value

    7.1.15. SET_EKF_CONFIG

    Description

    Sets the EKF configuration register. This packet is used to enable/disable accelerometer andmagnetometer updates to the angle estimates.

    Packet Definition 

    PT = 0x8DN = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    NA NA NA NA NA NA Accel_EN Mag_EN

    If Mag_EN = 1, then magnetometer updates are used for yaw angle correction. If 0, thenmagnetometer correction is disabled.If Accel_EN = 1, then accelerometer updates are used for pitch and roll angle correction. If 0, thenaccelerometer correction is disabled.

    7.1.16. SET_GYRO_ALIGNMENT

    Description

    Sets the 3x3 calibration matrix used to correct cross-axis misalignment of the rate gyro outputs.Each element in the matrix is a 32-bit IEEE floating point value.

    Packet Definition 

    PT = 0x8EN = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

  • 8/18/2019 IMU Movi Dat

    23/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 23 -

    mat[i,j] corresponds to the i-th row and j-th column of the correction matrix.

    7.1.17. SET_ACCEL_ALIGNMENT

    Description

    Sets the 3x3 calibration matrix used to correct cross-axis misalignment of the acclerometer outputs.Each element in the matrix is a 32-bit IEEE floating point value.

    Packet Definition 

    PT = 0x8FN = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i-th row and j-th column of the correction matrix.

    7.1.18. SET_MAG_REF_VECTOR

    Description

    Manually sets the magnetometer reference vector. The data in the SET_MAG_REF_VECTORpacket corresponds to the raw magnetometer measurements expected when the pitch, roll, and

    yaw angles are zero. The data for each axis should be a 16-bit 2's complement integer.

    Packet Definition

    PT = 0x90N = 6

    D1 D2 D3 D4 D5 D6

    Z ref Y ref X ref

    7.1.19. AUTO_SET_MAG_REF

    Description

    Sets the magnetic field reference vector to the most recent magnetic sensor measurement.Returns a MAG_REF_VECTOR_REPORT PACKET with the new reference vector.

    Packet Definition

    PT = 0x91N = 0

  • 8/18/2019 IMU Movi Dat

    24/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 24 -

    The AUTO_SET_MAG_REF packet includes no data bytes (the data length byte is followed

    immediately by the checksum).

    7.1.20. SET_MAG_CAL

    Description

    Sets the 3x3 calibration matrix used for soft and hard iron calibration, axis misalignment calibration,and scale calibration of the magnetometer.

    Packet Definition 

    PT = 0x92N = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i-th row and j-th column of the correction matrix.

    7.1.21. SET_MAG_BIAS

    Description

    Sets the magnetic field bias term to compensate for hard-iron distortions of the magnetic field.Each bias term is a 16-bit 2's complement integer.

    Packet Definition

    PT = 0x93N = 6

    D1 D2 D3 D4 D5 D6

    Z mag bias Y mag bias X mag bias

    7.1.22. SET_GYRO_SCALE

    Description

    Sets the scale factors used to compute rates from raw gyro data on all axes. Scale factors in theSET_GYRO_SCALE packet must be 32-bit IEEE floating-point values

    Packet Definition

    PT = 0x94

  • 8/18/2019 IMU Movi Dat

    25/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 25 -

    N = 12

    D1-D4 D5-D8 D9-D12

    Z gyro scale Y gyro scale X gyro scale

    7.1.23. EKF_RESET

    Description

    Sets each term in the state covariance matrix to zero and re-initializes the EKF. This commandcan be used for recovery if the state is corrupted by passing too close to the singularity at pitch =90 degrees.

    Packet Definition 

    PT = 0x95N = 0

    There are no data bytes in the EKF_RESET packet. The checksum immediately follows the datalength byte.

    7.1.24. RESET_TO_FACTORY

    Description

    Resets all AHRS configuration to the factory defaults. This includes calibration parameters, biases,communication settings, etc. The factory defaults are written to RAM. To make them persistent, aWRITE_TO_FLASH packet must be sent following the RESET_TO_FACTORY command.

    Packet Definition 

    PT = 0x96N = 0

    There are no data bytes in the EKF_RESET packet. The checksum immediately follows the datalength byte.

    7.1.25. WRITE_TO_FLASH

    Description

    Writes AHRS configuration to on-board flash so that the configuration persists when the power iscycled.

    Packet Definition

  • 8/18/2019 IMU Movi Dat

    26/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 26 -

    PT = 0xA0N = 0

    There are no data bytes associated with the WRITE_TO_FLASH packet. The checksumimmediately follows the data length byte.

    7.1.26. GET_DATA

    Description

    In Silent Mode, the AHRS waits to receive a GET_DATA packet before transmitting sensor data.The most recent data from all active sensor channels is transmitted in response to a GET_DATApacket. In Broadcast Mode, a GET_DATA packet is ignored.

    Packet Definition

    PT = 0x01N = 0

    There are no data bytes associated with the GET_DATA packet. The checksum immediatelyfollows the data length byte.

    7.1.27. GET_ACTIVE_CHANNELS

    Description

    Reports which channels are "active." Active channels are sensor channels that are measured andtransmitted in response to a GET_DATA packet, or periodically in Broadcast Mode. Activechannels are reported in an ACTIVE_CHANNEL_REPORT packet.

    Packet Definition

    PT = 0x02N = 0

    There are no data bytes associated with the GET_ACTIVE_CHANNELS packet. The checksumimmediately follows the data length byte.

    7.1.28. GET_BROADCAST_MODE

    Description

    Causes the AHRS to send a BROADCAST_MODE_REPORT packet, which specifies whether the AHRS is in Broadcast Mode or Silent Mode.

    Packet Definition

  • 8/18/2019 IMU Movi Dat

    27/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 27 -

    PT = 0x03N = 0

    There are no data bytes associated with the GET_BROADCAST_MODE packet. The checksumimmediately follows the data length byte.

    7.1.29. GET_ACCEL_BIAS

    Description

    Return the bias values for all three accel axes in an ACCEL_BIAS_REPORT packet.

    Packet Definition

    PT = 0x04N = 0

    There are no data bytes associated with the GET_ACCEL_BIAS packet. The checksumimmediately follows the data length byte.

    7.1.30. GET_ACCEL_REF_VECTOR

    Description

    Return the accelerometer reference vector in a ACCEL_REF_VECTOR_REPORT.

    Packet Definition

    PT = 0x05N = 0

    There are no data bytes associated with the GET_ACCEL_REF_VECTOR packet. The checksumimmediately follows the data length byte.

    7.1.31. GET_GYRO_BIAS

    Description

    Returns the bias values for all three rate gyros in a GYRO_BIAS_REPORT packet.

    Packet Definition

    PT = 0x06N = 0

  • 8/18/2019 IMU Movi Dat

    28/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 28 -

    There are no data bytes associated with the GET_GYRO_BIAS packet. The checksumimmediately follows the data length byte.

    7.1.32. GET_GYRO_SCALE

    Description

    Returns the scale factors used to convert raw gyro measurements to angular rates. Data isreturned in a GYRO_SCALE_REPORT packet.

    Packet Definition

    PT = 0x07

    N = 0

    There are no data bytes associated with the GET_GYRO_SCALE packet. The checksumimmediately follows the data length byte.

    7.1.33. GET_START_CAL

    Description

    Reports whether gyro startup calibration is enabled by sending a START_CAL_REPORT packet.

    Packet Definition

    PT = 0x08N = 0

    There are no data bytes associated with the GET_START_CAL packet. The checksumimmediately follows the data length byte.

    7.1.34. GET_EKF_CONFIG

    Description

    Returns the value of the EKF configuration register in a EKF_CONFIG_REPORT packet.

    Packet Definition

    PT = 0x09N = 0

    There are no data bytes associated with the GET_EKF_CONFIG packet. The checksumimmediately follows the data length byte.

  • 8/18/2019 IMU Movi Dat

    29/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 29 -

    7.1.35. GET_ACCEL_COVARIANCE

    Description

    Returns the covariance to be used in the accelerometer update step of the EKF. Covariance istransmitted in a ACCEL_COVARIANCE_REPORT packet.

    Packet Definition 

    PT = 0x0AN = 0

    There are no data bytes associated with the GET_ACCEL_COVARIANCE packet. The checksumimmediately follows the data length byte.

    7.1.36. GET_MAG_COVARIANCE

    Description

    Returns the covariance to be used in the magnetometer update step of the EKF. Covariance istransmitted in a MAG_COVARIANCE_REPORT packet.

    Packet Definition 

    PT = 0x0BN = 0

    There are no data bytes associated with the GET_MAG_COVARIANCE packet. The checksumimmediately follows the data length byte.

    7.1.37. GET_PROCESS_COVARIANCE

    Description

    Returns the covariance to be used in the prediction step of the EKF. Covariance is transmitted in aPROCESS_COVARIANCE_REPORT packet.

    Packet Definition 

    PT = 0x0CN = 0

    There are no data bytes associated with the GET_PROCESS_COVARIANCE packet. Thechecksum immediately follows the data length byte.

  • 8/18/2019 IMU Movi Dat

    30/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 30 -

    7.1.38. GET_STATE_COVARIANCE

    Description

    Returns the 3x3 covariance matrix of the current state estimates in the EKF. The covariancematrix is sent in a STATE_COVARIANCE_REPORT packet.

    Packet Definition 

    PT = 0x0DN = 0

    There are no data bytes associated with the GET_STATE_COVARIANCE packet. The checksumimmediately follows the data length byte.

    7.1.39. GET_GYRO_ALIGNMENT

    Description

    Returns the 3x3 matrix used to correct gyro cross-axis misalignment. The alignment matrix isreturned in a GYRO_ALIGNMENT_REPORT packet.

    Packet Definition 

    PT = 0x0EN = 0

    There are no data bytes associated with the GET_GYRO_ALIGNMENT packet. The checksumimmediately follows the data length byte.

    7.1.40. GET_ACCEL_ALIGNMENT

    Description

    Returns the 3x3 matrix used to correct accelerometer cross-axis misalignment. The alignmentmatrix is returned in an ACCEL_ALIGNMENT_REPORT packet.

    Packet Definition 

    PT = 0x0FN = 0

    There are no data bytes associated with the GET_ACCEL_ALIGNMENT packet. The checksumimmediately follows the data length byte.

  • 8/18/2019 IMU Movi Dat

    31/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 31 -

    7.1.41. GET_MAG_REF_VECTOR

    Description

    Returns the magnetic field reference vector in a MAG_REF_VECTOR_REPORT packet.

    Packet Definition 

    PT = 0x10N = 0

    There are no data bytes associated with the GET_MAG_REF_VECTOR packet. The checksumimmediately follows the data length byte.

    7.1.42. GET_MAG_CAL

    Description

    Returns the 3x3 matrix used to correct magnetometer soft iron distortions, axis misalignment, andscale factors. The calibration matrix is returned in a MAG_CAL_REPORT packet.

    Packet Definition 

    PT = 0x11N = 0

    There are no data bytes associated with the GET_MAG_CAL packet. The checksum immediatelyfollows the data length byte.

    7.1.43. GET_MAG_BIAS

    Description

    Returns the magnetometer biases used to correct hard iron distortions. Biases are returned in aMAG_BIAS_REPORT packet.

    Packet Definition 

    PT = 0x12N = 0

    There are no data bytes associated with the GET_MAG_BIAS packet. The checksum immediatelyfollows the data length byte.

  • 8/18/2019 IMU Movi Dat

    32/43

    CH Robotics

    CHR-6dm Attitude and Heading Reference SystemProduct datasheet - Rev. 1.0, Preliminary

    - 32 -

    7.2. CHR-6dm TX Packets

    TX Packets are packets that can be transmitted by the AHRS. The structure of transmitted packetsis exactly the same as the structure of RX packets.

    TX Packet Structure

    Function 's' 'n' 'p' PT N d1  dN  CHK

    Byte 1 2 3 4 5 6 N+5 N+6 N+7

    TX Packet Description1 - 3 Each received packet must begin with the three-byte (character) sequence

    "snp" to signal the beginning of a new packet.

    4 PT specifies the packet type.

    5 N specifies the number of data bytes to expect.

    6 - (N+5) d1 through dN contain the N data bytes in the packet. (N+6) - (N+7)  CHK is a two-byte checksum. 

    The total size of a packet with N data bytes is (N + 7) bytes.

    7.2.1. CHR-6dm TX Packet Overview

    PT Packet Name Description

    0xB0 COMMAND_COMPLETE Transmitted by the AHRS upon successfulcompletion of a command that does not require

    data to be returned.0xB1 COMMAND_FAILED Transmitted by the AHRS when a command

    received over the UART could not be executed.

    0xB2 BAD_CHECKSUM Transmitted by the AHRS when a receivedpacket checksum does not match the sum of theother bytes in the packet.

    0xB3 BAD_DATA_LENGTH Transmitted by the AHRS when a receivedpacket contained more or less data thanexpected for a given packet type.

    0xB4 UNRECOGNIZED_PACKET Transmitted if the AHRS receives anunrecognized packet.

    0xB5 BUFFER_OVERFLOW Transmitted by the AHRS when the internalreceive buffer overflows before a full packet is

    received.0xB6 STATUS_REPORT Transmitted at the end of a self-test procedure,triggered by a SELF_TEST command.

    0xB7 SENSOR_DATA Sent in response to a GET_DATA packet, or sentautomatically in Broadcast Mode.

    0xB8 GYRO_BIAS_REPORT Sent in response to the GET_GYRO_BIAScommand.

    0xB9 GYRO_SCALE_REPORT Sent in response to a GET_GYRO_SCALEcommand.

  • 8/18/2019 IMU Movi Dat

    33/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 33 -

    0xBA START_CAL_REPORT Sent in response to a GET_START_CALcommand.

    0xBB ACCEL_BIAS_REPORT Sent in response to the GET_ACCEL_BIAScommand.

    0xBC ACCEL_REF_VECTOR_REPORT Sent in response to aGET_ACCEL_REF_VECTOR command, or sentafter an AUTO_SET_ACCEL_REF command.

    0xBD ACTIVE_CHANNEL_REPORT Sent in response to aGET_ACTIVE_CHANNELS command.

    0xBE ACCEL_COVARIANCE_REPORT Sent in response to aGET_ACCEL_COVARIANCE command

    0xBF MAG_COVARIANCE_REPORT Sent in response to a GET_MAG_COVARIANCEcommand.

    0xC0 PROCESS_COVARIANCE_REPORT Sent in response to aGET_PROCESS_COVARIANCE command

    0xC1 STATE_COVARIANCE_REPORT Sent in response to aGET_STATE_COVARIANCE command

    0xC2 EKF_CONFIG_REPORT Sent in response to a GET_EKF_CONFIGcommand.

    0xC3 GYRO_ALIGNMENT_REPORT Sent in response to a GET_GYRO_ALIGNMENTcommand.

    0xC4 ACCEL_ALIGNMENT_REPORT Sent in response to aGET_ACCEL_ALIGNMENT command.

    0xC5 MAG_REF_VECTOR_REPORT Sent in response to a GET_MAG_REF_VECTORcommand

    0xC6 MAG_CAL_REPORT Sent in response to a GET_MAG_CAL command

    0xC7 MAG_BIAS_REPORT Sent in response to a GET_MAG_BIAScommand

    0XC8 BROADCAST_MODE_REPORT Sent in response to aGET_BROADCAST_MODE command.

    7.2.2. COMMAND_COMPLETE

    Description Transmitted by the AHRS upon successful completion of a command that does not require data tobe returned.

    Packet Definition PT = 0xB0N = 1

    D1bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    Packet Type (TP) identifier for executed command

    7.2.3. COMMAND_FAILED

    Description Transmitted by the AHRS when a command received over the UART could not be executed.

  • 8/18/2019 IMU Movi Dat

    34/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 34 -

    Packet Definition PT = 0xB1N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    Packet Type (TP) identifier for command that could not be executed

    7.2.4. BAD_CHECKSUM

    Description Transmitted by the AHRS when a received packet checksum does not match the sum of the otherbytes in the packet.

    Packet Definition PT = 0xB2N = 0

    7.2.5. BAD_DATA_LENGTH

    Description Transmitted by the AHRS when a received packet contained more or less data than expected for agiven packet type.

    Packet Definition PT = 0xB3N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    Packet Type (TP) identifier of the received packet

    7.2.6. UNRECOGNIZED_PACKET

    Description Transmitted if the AHRS receives an unrecognized packet

    Packet Definition 

    PT = 0xB4N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    Packet Type (TP) identifier of unrecognized command

  • 8/18/2019 IMU Movi Dat

    35/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 35 -

    7.2.7. BUFFER_OVERFLOW

    Description 

    Transmitted by the AHRS when the internal receive buffer overflows before a full packet isreceived.

    Packet Definition PT = 0xB5N = 0

    7.2.8. STATUS_REPORT

    Description Transmitted at the end of a self-test procedure, triggered by a SELF_TEST command.

    Packet Definition 

    PT = 0xB6N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    NA NAgyro_zerror

    gyro_yerror

    gyro_xerror

    accel_zerror

    accel_yerror

    accel_xerror

    If the self-test failed for any of the channels, then the corresponding bit will be set (i.e. if the z-axisgyro fails the self-test, then bit 5 will be set, etc.)

    7.2.9. SENSOR_DATA

    Description Sent in response to a GET_DATA packet, or sent automatically in Broadcast Mode. Only activechannels are included in the packet.

    Packet Definition PT = 0xB7N = 2 + 2*(# of active channels)

    The first two bytes following the PT byte indicate which channels are active. The actual sensordata is contained in the remaining data bytes.

    If all channels are active, then data is given in the following order: { yaw, pitch, roll, yaw_rate,pitch_rate, roll_rate, mag_z, mag_y, mag_x, gyro_z, gyro_y, gyro_x, accel_z, accel_y, accel_x }.Data bytes D3 and D4 correspond to the yaw angle, D5 and D6 to the pitch angle, etc. Data isreturned as 16-bit two's-complement integers.

    When one or more channel is inactive, then the data is returned in the same order, but skipping theinactive channels. For example, if all magnetic field and rate gyro channels are disabled, then thedata is given in the following order: { yaw, pitch, roll, accel_z, accel_y, accel_x }

  • 8/18/2019 IMU Movi Dat

    36/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 36 -

    D1 D2 D3 D4 D5 D6

    7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0

    yaw pitch roll

    yaw

    rate

    pitch

    rate

    roll

    rate mx my mz gx gy gz ax ay az 0

    1stactive

    channel

    2ndactive

    channel

    yaw = 1 if yaw angle is active, 0 otherwisepitch = 1 if pitch angle is active, 0 otherwiseroll = 1 if roll angle is active, 0 otherwiseyaw_rate = 1 if yaw rate is active, otherwisepitch_rate = 1 if pitch rate is active, otherwiseroll_rate = 1 if roll rate is active, otherwisemx = 1 if x-axis magnetometer is active, 0 otherwisemy = 1 if y-axis magnetometer is active, 0 otherwisemz = 1 if z-axis magnetometer is active, 0 otherwisegz = 1 if the z-axis gyro is active, 0 otherwisegy = 1 if the y-axis gyro is active, 0 otherwisegx = 1 if the x-axis gyro is active, 0 otherwise

    az = 1 if the z-axis accelerometer is active, 0 otherwiseay = 1 if the y-axis accelerometer is active, 0 otherwiseax = 1 if the x-axis accelerometer is active, 0 otherwise

    Note that yaw, pitch, and roll rates are not equivalent to gyro rate outputs - gyros measure rotationrates in the body frame, while yaw, pitch, and roll rates are specified in the inertial frame (seeSection 6 for more details).

    7.2.10. GYRO_BIAS_REPORT

    Description Sent in response to the GET_GYRO_BIAS command. Returns the gyro biases for the X, Y, and Z

    gyro axes as 16-bit 2's complement signed integers.

    Packet Definition PT = 0xB8N = 6

    D1 D2 D3 D4 D5 D6

    gyro_z bias gyro_y bias gyro_x bias

    7.2.11. GYRO_SCALE_REPORT

    Description 

    Sent in response to the GET_GYRO_SCALE command. Returns the scale factors used to convertthe X, Y, and Z gyro raw data to angular rates. Scale factors are returns as 32-bit IEEE floating-point values.

    Packet Definition PT = 0xB9N = 12

  • 8/18/2019 IMU Movi Dat

    37/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 37 -

    D1-D4 D5-D8 D9-D12

    Z gyro scale Y gyro scale X gyro scale

    7.2.12. START_CAL_REPORT

    Description Sent in response to the GET_START_CAL command. Returns the gyro bias startup calibrationstatus (enabled or disabled).

    Packet Definition PT = 0xBAN = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0NA NA NA NA NA NA NA en

    If 'en' = 1, then startup gyro bias calibration is enabled.

    7.2.13. ACCEL_BIAS_REPORT

    Description Sent in response to the GET_ACCEL_BIAS command. Returns the accelerometer biases for the X,Y, and Z accel axes as 16-bit 2's complement signed integers.

    Packet Definition PT = 0xBBN = 6

    D1 D2 D3 D4 D5 D6

    accel_z bias accel_y bias accel_x bias

    7.2.14. ACCEL_REF_VECTOR_REPORT

    Description Sent in response to the GET_ACCEL_REF_VECTOR command. Returns the expected

    accelerometer output when pitch and roll angles are zero.

    Packet Definition PT = 0xBCN = 6

    D1 D2 D3 D4 D5 D6

    accel_z ref accel_y ref accel_x ref

  • 8/18/2019 IMU Movi Dat

    38/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 38 -

    7.2.15. ACTIVE_CHANNEL_REPORT

    Description Sent in response to a GET_ACTIVE_CHANNELS command

    Packet DefinitionPT = 0xBDN = 2

    D1 D2

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    yaw pitch rollyawrate

    pitchrate

    rollrate mx my mz gx gy gz ax ay az 0

    If the bit corresponding to a sensor channel is set (i.e. gz = 1), then the channel is active. If the bitis cleared (i.e. gz = 0), then the channel is inactive, and data from that channel is not transmitted.

    yaw = yaw angle estimatepitch = pitch angle estimateroll = roll angle estimateyaw rate = yaw rate estimatepitch rate = pitch rate estimateroll rate = roll rate estimatemx = magnetometer x-axis datamy = magnetometer y-axis datamz = magnetometer z-axis datagx = gyro x-axis data

    gy = gyro y-axis datagz = gyro z-axis dataax = accel x-axis dataay = accel y-axis dataaz = accel z-axis data

    7.2.16. ACCEL_COVARIANCE_REPORT

    Description

    Returns the covariance used in the accelerometer update step of the EKF. The AHRS assumesthat the accelerometer covariance is a diagonal matrix with equivalent diagonal entries. The

     ACCEL_COVARIANCE_REPORT packet thus includes only one 32-bit floating point value for thecovariance matrix.

    Packet Definition 

    PT = 0xBEN = 4

    D1 D2 D3 D4

  • 8/18/2019 IMU Movi Dat

    39/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 39 -

    32-bit IEEE floating point value

    7.2.17. MAG_COVARIANCE_REPORT

    Description

    Returns the covariance used in the magnetometer update step of the EKF. The AHRS assumesthat the magnetometer covariance is a diagonal matrix with equivalent diagonal entries. TheMAG_COVARIANCE_REPORT packet thus includes only one 32-bit floating point value for thecovariance matrix.

    Packet Definition 

    PT = 0xBFN = 4

    D1 D2 D3 D4

    32-bit IEEE floating point value

    7.2.18. PROCESS_COVARIANCE_REPORT

    Description

    Returns the covariance used in the prediction step of the EKF. The AHRS assumes that theprocess covariance is a diagonal matrix with equivalent diagonal entries. ThePROCESS_COVARIANCE_REPORT packet thus includes only one 32-bit floating point value forthe covariance matrix.

    Packet Definition 

    PT = 0xC0N = 4

    D1 D2 D3 D4

    32-bit IEEE floating point value

    7.2.19. STATE_COVARIANCE_REPORT

    Description

    Returns the 3x3 covariance matrix of the current yaw, pitch, and roll state estimates from the EKF.Each matrix element is a 32-bit IEEE floating-point value.

    Packet Definition 

    PT = 0xC1N = 36

  • 8/18/2019 IMU Movi Dat

    40/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 40 -

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i,jth element in the matrix.

    7.2.20. EKF_CONFIG_REPORT

    DescriptionSent in response to a GET_EKF_CONFIG report. Reports whether the accelerometer andmagnetometer are used in the EKF update step.

    Packet Definition 

    PT = 0xC2N = 1

    D1

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

    NA NA NA NA NA NA Accel_EN Mag_EN

    If Mag_EN = 1, then magnetometer updates are used for yaw angle correction. If 0, thenmagnetometer correction is disabled.If Accel_EN = 1, then accelerometer updates are used for pitch and roll angle correction. If 0, thenaccelerometer correction is disabled.

    7.2.21. GYRO_ALIGNMENT_REPORT

    Description

    Returns the 3x3 matrix used to correct gyro cross-axis misalignment. Each value in the matrix is a32-bit IEEE floating-point value.

    Packet Definition 

    PT = 0xC3N = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i,jth element in the matrix.

    7.2.22. ACCEL_ALIGNMENT_REPORT

    Description

  • 8/18/2019 IMU Movi Dat

    41/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 41 -

    Returns the 3x3 matrix used to correct accelerometer cross-axis misalignment. Each value in thematrix is a 32-bit IEEE floating-point value.

    Packet Definition 

    PT = 0xC4N = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i,jth element in the matrix.

    7.2.23. MAG_REF_VECTOR_REPORT

    Description Sent in response to the GET_MAG_REF_VECTOR command. Returns the expectedmagnetometer output when yaw, pitch, and roll angles are zero. Each value returned is a 16-bit 2'scomplement signed integer representing the raw magnetometer output.

    Packet Definition PT = 0xC5N = 6

    D1 D2 D3 D4 D5 D6

    mag_z ref mag_y ref mag_x ref

    7.2.24. MAG_CAL_REPORT

    Description

    Returns the 3x3 matrix used to correct magnetometer axis misalignment and soft iron distortioneffects. Each value in the matrix is stored as a 32-bit IEEE floating-point value.

    Packet Definition 

    PT = 0xC6N = 36

    D1-D4 D5-D8 D9-D12 D13-D16 D17-D20 D21-D24 D25-D28 D29-D32 D33-D36

    mat[0,0] mat[0,1] mat[0,2] mat[1,0] mat[1,1] mat[1,2] mat[2,0] mat[2,1] mat[2,2]

    mat[i,j] corresponds to the i,jth element in the matrix.

  • 8/18/2019 IMU Movi Dat

    42/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    - 42 -

    7.2.25. MAG_BIAS_REPORT

    Description 

    Sent in response to the GET_MAG_BIAS command. Returns the bias terms used to compensatefor hard-iron magnetic field distortions. Each value returned is a 16-bit 2's complement signedinteger representing the raw magnetometer output.

    Packet Definition PT = 0xC7N = 6

    D1 D2 D3 D4 D5 D6

    mag_z bias mag_y bias mag_x bias

    7.2.26. BROADCAST_MODE_REPORT

    Description Sent in response to a GET_BROADCAST_MODE packet. Specifies whether the AHRS is inBroadcast Mode or Silent Mode. Also specifies the broadcast frequency if the AHRS is inBroadcast Mode.

    Packet DefinitionPT = 0xC8N = 2

    D1 D2

    bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0

     x NA NA NA NA NA NA NA mode

    The broadcast frequency is given byf  = ((280/255)* x  + 20) Hz

    where f  is the broadcast frequency, and x  is the byte stored in D1. The broadcast frequency thusranges between 300 Hz (when x  = 255) and 20 Hz (when x  = 0).

    If mode = 1, then the AHRS is in Broadcast Mode.If mode = 0, then the AHRS is in Silent Mode.

  • 8/18/2019 IMU Movi Dat

    43/43

    CH RoboticsCHR-6dm Digital AHRS datasheet

    8. Disclaimer

    This document is provided as reference only; "typical" device specifications must be evaluated bythe end-user. CH Robotics reserves the right to modify this document and the products itdescribes without notice.

    CH Robotics products are not intended for use in weapons systems, aircraft, life-saving orlife-sustaining systems, automobiles, or any other application where failure could result ininjury, death, property damage, or environmental damage.