ANavS® Binary Sensor Raw Data Format

The Multi-Sensor RTK Module (MSRTK) combines all sensor data into single streams which could be saved depending on the user settings. It’s also possible to stream the raw data for other applications.

 

ANavS® Binary Protocol

At the core of MSRTK module is minimum one GNSS receiver, which presents its data in a binary format. The binary protocol is a packet oriented protocol, which features two synchronization bytes, one byte class ID and one byte message ID. This is followed by a two byte, little endian payload length field and the actual payload. Each packet ends with a two byte checksum that is calculated with fletcher’s algorithm (module 256).

0xB5 0x62 classID msgID lngLow lngHigh Payload (<lng> bytes) chkA chkB

 

The firmware of the MSRTK module tries to transparently pass all GNSS data while adding the other sensor data streams compliant to the binary protocol without breaking individual packets apart. As only a fraction of the 16 bit class and message id space is used by the GNSS receiver, the MSRTK module can safely use unallocated IDs for its own purposes.

classID msgID Name Description
0x02 0xf0 IMU raw data rev 0 Sensor data (deprecated)
0x02 0x49 IMU raw data rev 1 Sensor data
0x02 0xf1 baro raw data rev 0 Sensor data (deprecated)
0x02 0x42 baro raw data rev 1 Sensor data
0x02 0xf2 Filter debug data A Debug data for IMU time stamp estimation
0x02 0xf5 Filter debug data B Debug data for IMU time stamp estimation
0x02 0xf3 Unexpected reset packet Error data
0x02 0xf4 Stop error packet Error data
0x02 0x0a String message Status and debug information
0x02 0xf6 Idle time message Debug information
0x02 0xf7 Info packet Information on firmware and hardware status
0x02 0xf8 Alternate stream packet Packet containing a tunnel stream
0x02 0xf9 SM3 config packet Configuration command
0x02 0xfa SM3 serial number Hardware serial number of micro controller
0x02 0xfb SM3 data answer Answer to config commands that request data
0x02 0xfc Debug data Debug data
0x02 0xfd Odometer measurement Sensor data
0x05 0x81 SM3 ACK Answer to UBX packet successfully handled
0x05 0x80 SM3 NACK Answer to UBX packet handled with error

 

0x02 0x49 IMU raw data rev 1

This packet contains gyroscope, accelerometer and magnetometer data for a single epoch with a time stamp in a local timebase that is synchronized to GPS time as good as possible, typically to an error within a few microseconds as soon as the GNSS receiver is able to calculate the GPS time. The units of the sensor raw data are specified in the info packet.

Payload fields:

Offset Data type Field Description
0 bitfield8 timingInfo Information on time stamp reliability
1 uint64_t towUs Time stamp in GPS time of week as microseconds
9 int16_t ax Accelerometer x axis
11 int16_t ay Accelerometer y axis
13 int16_t az Accelerometer z axis
15 int16_t gx Gyroscope x axis
17 int16_t gy Gyroscope y axis
19 int16_t gz Gyroscope z axis
21 int16_t mx Magnetometer x axis
23 int16_t my Magnetometer y axis
25 int16_t mz Magnetometer z axis

 

Bitfield timingInfo:

reserved reserved reserved reserved imuFilterState timerState
7 6 5 4 3 2 1 0

 

Field imuFilterState:

As the oscillator that is used to capture the measurement time shows jitter and drift that needs to be filtered away. This field holds information on the filtering process.

imuFilterState State of the filter Description
0 Steady The filter is running in its steady state
1 Converging The filter is still in the process of convergence
2 Initial Value The filter is still in its initial state
3 reserved

 

Field timerState:

timerState Time reference Description
0 system compensated GNSS system time, micro controller clock error is compensated with continuous GNSS measurements.
1 system uncompensated GNSS system time, not enough data to fully compensate micro controller clock error. This may cause small clock glitches for a few seconds.
2 local uncompensated Time is measured relative to the last micro controller reset, there is no data to compensate the micro controller clock error.
3 reserved

 

0x02 0x42 Baro raw data rev 1

This packet contains pressure and temperature data for a single epoch with a time stamp in a local timebase that is synchronized to GPS time as good as possible, typically to an error within a few microseconds as soon as the GNSS receiver is able to calculate the GPS time. The units of the sensor raw data are specified in the info packet.

Payload fields:

Offset Data type Field Description
0 bitfield8 timingInfo Information on time stamp reliability
1 uint64_t towUs Time stamp in GPS time of week as microseconds
9 int16_t temp Junction temperature at the barometer IC
11 uint16_t pressure Barometric pressure

 

Bitfield timingInfo:

reserved reserved reserved reserved imuFilterState timerState
7 6 5 4 3 2 1 0

 

Field imuFilterState:

As the micro controller oscillator that is used to capture the measurement time shows jitter and drift that needs to be filtered away. This field holds information on the filtering process.

imuFilterState State of the filter Description
0 Steady The filter is running in its steady state
1 Converging The filter is still in the process of convergence
2 Initial Value The filter is still in its initial state
3 reserved

 

Field timerState:

timerState Time reference Description
0 system compensated GNSS system time, micro controller clock error is compensated with continuous GNSS measurements.
1 system uncompensated GNSS system time, not enough data to fully compensate micro controller clock error. This may cause small clock glitches for a few seconds.
2 local uncompensated Time is measured relative to the last micro controller reset, there is no data to compensate the micro controller clock error.
3 reserved

 

0x02 0xf3 Unexpected reset packet

This packet is sent if the firmware startup vector gets executed without a preceding power-up-reset. It contains only the reset source register of the micro controller.

Payload fields:

Offset Data type Field Description
0 bitfield8 resetSource Contains flags for all possible reset sources

 

Field resetSource:

reserved Spike Det Software PDI Watchdog Brown Out Ext Rst Power On
7 6 5 4 3 2 1 0

 

0x02 0xf4 Stop error packet

If the firmware detects an error that it cannot recover from, it runs its stop error routine that switches to a secure execution mode, waits for a short stand-off period where it sends 10000 zero bytes to guarantee to put the receiver decoder into a neutral ready state and then transmits this packet with an error code. After the transmitting hardware is flushed and a second stand-off period is over, a controlled software reset is executed. While the USB module remains unchanged, barometer, IMU and GNSS are reinitialized, however without a power cycle.

Payload fields:

Offset Data type Field Description
0 uint64_t lmicros  Microcontroller clock in microseconds
8 uint64_t timestamp GPS time of week in microseconds
16 uint16_t errorCode Error code
18 uint16_t freeRAM Bytes that were not allocted at the time of the error
20 uint32_t errorFlags Guard error flags
24 uint32_t reserved
28 bitfield8 resetSource Source of the last preceding reset

 

Field resetSource:

reserved Spike Det Software PDI Watchdog Brown Out Ext Rst Power On
7 6 5 4 3 2 1 0

 

Field errorFalgs:

This field contains all detected deviations from nominal behavior. A single detected deviation is never sufficient to detect a faulty state in hardware and firmware, thus the soft watchdog accumulates evidence before it issues a stop error. Because of this, error flags turn up and down even in normal operation.

Flags shown in this field are the source only for stop error codes 600 through 699.

In stop error conditions with other codes, these flags may be true but are never the reason for the stop error.

Bit Name Description
0 BARO_ILLEGAL_PERIOD Barometer measurement period was wrong.
1 BARO_STUCK Barometer measurement values did not change.
2 BARO_ILLEGAL_TEMPERATURE Temperature measurement was out of bounds.
3 IMU_ILLEGAL_PERIOD IMU measurement period was wrong.
4 IMU_STUCK IMU measurement values did not change.
5 MAG_ILLEGAL_PERIOD Magnetometer measurement period was wrong.
6 MAG_STUCK Magnetometer measurement values did not change.
7 BARO_MISSING There were no barometer measurements at all.
8 BARO_TIMEOUT There are no recent barometer measurements.
9 IMU_MISSING There were no IMU measurements at all.
10 IMU_TIMEOUT There are no recent IMU measurements.
11 MAG_MISSING There were no magnetometer measurements at all.
12 MAG_TIMEOUT There are no recent magnetometer measurements.
13 SERIAL_REPETITION Received the same byte multiple times from LEA.
14 UBX_GARBAGE Data received from LEA did not check out as UBX.
15-31 reserved

 

0x02 0x0a String message

ASCII coded status and debug information. These packets are almost exclusively sent as a response to MSRTK commands.

Payload fields:

Offset Data type Field Description
0 … length – 1 char payload Contents of the string message

 

0x02 0xf7 Info packet

Contains information on configured measurement periods, sensor data units, firmware version and debug data.

Payload fields:

Offset Data type Field Description
0 uint32_t gnssPeriod GNSS measurement period
4 uint32_t imuPeriod IMU measurement period
8 uint32_t baroPeriod Barometer measurement period
12 float accScale Multiply accelerometer raw value with this to get m/s²
16 float gyroScale Multiply gyroscope raw value with this to get °/s
20 float magScale Multiply magnetometer raw value with this to get mT
24 float tempScale Multiply temperature raw value with this to get °C
28 float pressScale Multiply pressure raw value with this to get hPa
32 uint32_t xmClock Precise estimate of Xmega clock frequency in Hz
36 uint32_t errorFlags Guard error flags. See stop error packet.
40 uint8_t battery Remaining battery charge in percent (0xff if not present)
41 uint8_t powerState Power manager flags
42 14 bytes reserved
56 uint32_t uartErrCnt Number of bytes received from GNSS that did not comply to UBX
60 uint32_t ubxErrCnt Number of UBX packages with wrong checksum
64 uint32_t ubxOkCnt Number of UBX packages with correct checksum
68 uint8_t watchdog State of the soft watchdog, where 0 is nominal.
69 uint64_t uptime  Microcontroller clock in microseconds
77 uint64_t fwVersion Firmware version number
85 uint8_t revision Revision of the SM3 protocol (this document uses rev 0x01)

 

Field powerState:

reserved reserved reserved reserved reserved Peripherals

enabled

Usb power present Battery present
7 6 5 4 3 2 1 0

 

0x02 0xf9 MSRTK config packet

This packet contains configuration and commands for the MSRTK module.

Details on the supported commands and fields can be found in MSRTK Configuration Specification.

Payload fields:

Offset Data type Field Description
0 uint8_t mode 0 – configuration command

1 – parameter mode

2 – MMC control

1 uint8_t id Mode-dependent identifier of the command
2 uint32_t param Parameter of the command

 

0x02 0xfa SM3 serial number packet

Contains the serial number of the embedded micro controller + antenna-ID.

Payload fields:

Offset Data type Field Description
0 11 bytes Serial Number Unique serial number of the micro controller, assigned by the manufacturer + antenna-ID.

 

0x02 0xfb SM3 data answer

Some MSRTK config packets require a response, which is given in this packet type.

Details on the supported commands and fields can be found in MSRTK Configuration Specification.

Payload fields:

Offset Data type Field Description
0 uint8_t mode The mode of the requesting packet
1 uint8_t id Mode dependent identifier of the requesting packet
2 … length – 1 byte data mode + id dependent answer

 

0x02 0xfd Odometer raw data

External odometer raw data packet with GPS timestamp. Odometer data is fed via UART. The SM3 firmware records the time of arrival in the current GPS timebase and wraps both in this packet.

Payload fields:

Offset Data type Field Description
0 uint64_t towUs GPS time of week in microseconds. This is a smoothed estimate based on time of arrival in the microcontroller.
8 int16_t leftRate Left wheel revolution speed in RPM
10 int16_t rightRate Right wheel revolution speed in RPM
12 int16_t leftCurr Left wheel measured drive current in mA
14 int16_t rightCurr Right wheel measured drive current in mA

 

0x05 0x81 MSRTK ACK

Answer to binary packet successfully handled by MSRTK firmware. As all packets are also passed on to the GNSS receiver, the receiver will answer most likely with ACK-NACK, an auxiliary MSRTK-ACK packet has to be defined.

Payload fields:

Offset Data type Field Description
0 uint8_t classID Class of packet this ACK refers to
1 uint8_t messageID ID of packet this ACK refers to

 

0x05 0x80 MSRTK NACK

Answer to binary packet handled with error by MSRTK firmware.  As all packets are also passed on to the GNSS receiver, the receiver will answer most likely with ACK-NACK, an auxiliary MSRTK-NACK packet has to be defined.

Payload fields:

Offset Data type Field Description
0 uint8_t classID Class of packet this NACK refers to
1 uint8_t messageID ID of packet this NACK refers to