Skip to content
Tercio IMU

IMU protocol

3 min read

The IMU is a protocol v2 node like the Tercio S1: the same identifiers, frame shapes, system commands and status codes, described in CAN protocol. This page lists what is specific to the IMU.

The contract is Firmware/src/protocol/Protocol.h in the Tercio-imu repository.

ID Function
0x000 Broadcast: the IMU answers GetInfo and AssignNodeId; it ignores Enable, Stop, EmergencyStop and Sync
0x080 + node Fault events
0x100 + node Commands
0x180 + node Replies
0x200 + node Telemetry, frame type 0x03

The default node is 100 (0x164 for commands, 0x264 for telemetry), away from the S1’s default of 1.

GetInfo’s reply ends with a device class byte: 0 for a Tercio S1, 1 for a Tercio IMU. The byte before the node ID is device-specific: the S1’s encoder, the IMU’s fusion mode.

GetInfo reply data21 bytes
OffsetFieldTypeMeaning
0protocolu82
1fw majoru8Firmware version
2fw minoru8
3fw patchu8
4hw revu8Hardware revision
5fusion modeu80 IMU, 1 NDOF
6node idu8Current node ID
7info flagsu8bit 0: running from the crystal
8uid12 bytesUnique ID
20deviceu81: Tercio IMU
Opcode Command Arguments Reply / refusals
0x00 GetInfo — Info, 21 bytes
0x01 SaveConfig — Settings, zero and calibration to flash. StorageError if the write failed.
0x02 FactoryReset — Defaults in RAM, node ID kept; clears the zero and the saved calibration.
0x03 Reboot — Restarts 20 ms after the reply.
0x04 ClearFaults — Faulted while the sensor is still unhealthy.
0x05 AssignNodeId [uid 12][u8 id] Broadcast only.
0x08 GetParam [u8 param] [u8 param][4-byte value]
0x09 SetParam [u8 param][4-byte value] The value as applied. BadValue when out of range.
0x30 Zero [u8 mode], optional 0 all axes (default), 1 heading only. Busy until the sensor runs.
0x31 ClearZero —
0x32 SaveCalibration — Stores the calibration and saves to flash. NotCalibrated before full calibration.
ID Parameter Type Range Default
0x01 Node ID u8 1–127 100
0x02 Telemetry rate u16 0–100 Hz (0 = off) 50
0x70 Fusion mode u8 0 IMU, 1 NDOF 0
0x71 Axis mapping u8 0–7: BNO055 placement P0–P7 1

All can change at any time. Fusion mode and axis mapping take the sensor through its configuration mode for about 50 ms.

IMU telemetry (after the 0x03 frame type)62 bytes
OffsetFieldTypeMeaning
0stateu80 starting, 1 running, 2 fault
1flagsu8See below
2faultsu16Latched fault bits
4warningsu16Live warning bits
6calibrationu8sys << 6 | gyro << 4 | accel << 2 | mag, each 0–3
7sequenceu8Counts up per frame
8qwf32Quaternion, relative to the zero
12qxf32
16qyf32
20qzf32
24rollf32Degrees, (−180, 180]
28pitchf32Degrees, [−90, 90]
32yawf32Degrees, (−180, 180]
36axf32m/s², gravity included, sensor axes
40ayf32
44azf32
48gxf32deg/s, sensor axes
52gyf32
56gzf32
60temperaturei16Board, 0.1 °C

Angles are Z-Y-X (yaw, then pitch, then roll), derived from the reported quaternion.

Bit Flag Set when
0 zeroed A zero reference is applied.
1 zero heading only …and it only affects yaw.
2 calibration stored A saved calibration exists and was written to the sensor.
3 magnetometer NDOF fusion is active.
4 calibrated Fully calibrated for the active fusion mode.
Bit Fault Meaning
0 Sensor not responding The BNO055 stopped answering on I²C. The IMU keeps retrying and resumes by itself.
1 Sensor error The BNO055 reported a system error; it was reset.
2 Self-test failed The BNO055’s power-on self-test failed.
Bit Warning Meaning
0 Not calibrated Calibration incomplete for the active fusion mode.
5 CAN errors The CAN controller is error-passive.
7 Save failed The last write to flash failed.

Faults latch until ClearFaults, as on the S1. A new fault is sent at once as an event on 0x080 + node: [0x02][u16 faults][u16 warnings][u8 state].