Modbus RTU Protocol
Models supporting Modbus RTU respond on COM1 (some models also respond on COM2 using the same slave ID). Defaults: 115200 bps, 8N1 (no parity, 1 stop bit), slave ID 80 (0x50).
WARNING
Before using a non-RS-485 model as a Modbus slave, disable periodic serial streaming via ASCII commands (LOG HI91 ONTIME 0 + SAVECONFIG for permanent use; LOG DISABLE for quick tests), otherwise binary frames collide with Modbus replies. RS-485 models ship with streaming disabled.
Framing & Rules
- 16-bit registers are big-endian (MSB first); 32-bit values span two consecutive registers, high word first (PLC ABCD order). Checksum is standard Modbus CRC-16 (init
0xFFFF, poly0xA001, low byte first). - Use FC03 (
0x03, Read Holding Registers, 1–125 registers per read — not FC04) and FC06 (0x06, Write Single Register). - Transmit all bytes of a frame contiguously; disable inter-byte delays on USB-RS485 adapters.
- Configuration writes may erase/write Flash: set host write timeout ≥ 1 s and never write configuration registers periodically.
- Use slave IDs
1–247; do not use broadcast address0. - A reply function code with MSB set (
0x83/0x86) indicates rejection. Reading undefined or write-only registers returns0without an error. Echoed writes do not prove acceptance — read back critical settings to confirm.
Reference master code and multi-node polling examples: Python SDK modbus.py and modbus_multinode.py.
Register Map
Addresses below are 0-based protocol hex addresses; for PLC 4xxxx addressing, compute 40001 + decimal address (e.g. 0x0034 = 52 → 40053). After writing settings, write 0x0000 to 0x0000 to save; for entries marked "Reboot", also write 0x00FF to 0x0000. Writes of 0x00FF or 0x0001 reset immediately before replying — wait ~1 s before resuming communication.
Control & Configuration Registers
| Addr | Name | Type | R/W | Description | Effective |
|---|---|---|---|---|---|
0x0000 | CTRL | u16 | W | 0x0000 save; 0x0001 factory reset (may revert link settings); 0x00FF reboot | Immediate |
0x0004 | UART1_BAUD | u16 | R/W | Baud rate code 0–9 (see "Change Baud Rate") | Reboot |
0x0005 | MD_ID | u16 | R/W | Modbus slave ID (1–247, default 0x50); shared as I2C address (0x08–0x77) on -I2C models | Immediate |
0x0006 | PROFILE | u16 | R/W | Operating mode: 0 6-axis, 1 9-axis, 4 humanoid, 5 low-speed robot, 7 low-dynamic/inclinometer | Reboot |
0x0007 | COORD | u16 | R/W | Output axes: 0 RFU (default), 4 ROS (FLU) | Reboot |
0x0008 | MCAL_START | u16 | W | Start magnetic calibration: 1 = 3D, 2 = 2D | Immediate |
0x0009 | MAIN_STATUS | u16 | R | Main status word; see MAIN_STATUS Status Word (bit12 always 0) | — |
0x000A | MCAL_STATUS | u16 | R | Magnetic calibration state: 0 idle, 1 running, 3 done, 4 failed | — |
0x000B | MCAL_PROGRESS | u16 | R | Magnetic calibration progress (0–99%, 100 on success) | — |
0x00A5 | ATT_RST | u16 | W | Attitude zeroing: 0 zero all, 1 temp zero yaw, 2 level only, 3 auto-level, 5 clear zero | Immediate |
0x00A6 | URFR | u16 | R/W | Mounting code as decimal value (e.g. 024 → 24 = 0x0018; see URFR Table) | Reboot |
Real-Time Data Registers (Read-Only)
Reading a contiguous block in one FC03 transaction (e.g. 0x0034–0x004D, 26 registers) guarantees a coherent snapshot. Physical value = raw × scale. Acceleration, gyro, and magnetometer scale to ±16 G, ±2000 deg/s, and ±1000 μT and saturate at those limits (use HI91/HI83 for extended range).
| Addr | Name | Type | Scale & Unit | Description |
|---|---|---|---|---|
0x0034–0x0036 | ACC X/Y/Z | i16 | × 0.00048828 G | 3-axis acceleration (16 / 32768) |
0x0037–0x0039 | GYR X/Y/Z | i16 | × 0.061035 deg/s | 3-axis angular rate (2000 / 32768) |
0x003A–0x003C | MAG X/Y/Z | i16 | × 0.030517 μT | 3-axis magnetic field (1000 / 32768) |
0x003D–0x003E | ROLL | i32 | × 0.001 deg | Roll angle (high word first) |
0x003F–0x0040 | PITCH | i32 | × 0.001 deg | Pitch angle (high word first) |
0x0041–0x0042 | YAW | i32 | × 0.001 deg | Yaw angle, ±180°, CCW positive (high word first) |
0x0043 | TEMP | i16 | × 0.01 °C | Module temperature |
0x0044–0x0045 | PRS | i32 | × 0.01 Pa | Barometric pressure (high word first) |
0x0046–0x0049 | Q0–Q3 | i16 | × 0.0001 | Quaternion W, X, Y, Z |
0x004A–0x004B | INCLI_X / Y | i16 | × 0.011 deg | X (roll) / Y (pitch) inclination, fixed Right-Front-Up |
0x004C–0x004D | CPUTIME | u32 | 1 ms | Sample uptime in ms (unaffected by UTC sync; wraps ~49.7 days) |
0x004E–0x0050 | HEAVE / SURGE / SWAY | i16 | × 0.01 m | MRU 3-axis displacement (MRU models only) |
0x0051–0x0053 | HEAVE / SURGE / SWAY_FRQ | i16 | × 0.01 Hz | MRU 3-axis frequency (MRU models only) |
Combine both 16-bit registers of ROLL, PITCH, YAW, PRS, and CPUTIME into a 32-bit value before multiplying by the scale factor.
Version & Identity Registers (Read-Only)
Read 19 registers from 0x0070 (request 50 03 00 70 00 13 08 5D, returns 38 data bytes):
| Registers | Data Byte Offset | Content |
|---|---|---|
0x0070–0x0077 | 0–15 | Model name PNAME (ASCII, high byte first per word) |
0x0078 / 0x0079 | 16–17 / 18–19 | Firmware SW_VER (matches APP_VER) / Bootloader BL_VER |
0x007A–0x007E | 20–29 | Reserved, ignore |
0x007F–0x0082 | 30–37 | Unique chip ID (UUID) |
Common Operations
All frames below assume default slave ID 0x50; recalculate the trailing 2-byte CRC if you change the ID or data.
Change Baud Rate (0x0004)
Write the baud code, save (50 06 00 00 00 00 84 4B), and reboot (50 06 00 00 00 FF C4 0B). After reboot, switch the host to the new baud rate and read back 0x0004:
| Code | Baud Rate | Write Frame (ID = 0x50) | Code | Baud Rate | Write Frame (ID = 0x50) |
|---|---|---|---|---|---|
0 | 4800 | 50 06 00 04 00 00 C5 8A | 5 | 115200 | 50 06 00 04 00 05 05 89 |
1 | 9600 | 50 06 00 04 00 01 04 4A | 6 | 230400 | 50 06 00 04 00 06 45 88 |
2 | 19200 | 50 06 00 04 00 02 44 4B | 7 | 460800 | 50 06 00 04 00 07 84 48 |
3 | 38400 | 50 06 00 04 00 03 85 8B | 8 | 921600 | 50 06 00 04 00 08 C4 4C |
4 | 57600 | 50 06 00 04 00 04 C4 49 | 9 | 256000 | 50 06 00 04 00 09 05 8C |
Note that 256000 is code 9, out of ascending rate order.
Change Slave ID (0x0005)
The new ID takes effect immediately (connect only one module when changing IDs). Example changing 0x50 → 0x51:
→ 50 06 00 05 00 51 55 B6 write 0x0005 = 0x0051
← 50 06 00 05 00 51 55 B6 echo on old ID
→ 51 03 00 05 00 01 98 5B read back with new ID 0x51
← 51 03 02 00 51 B9 B4
→ 51 06 00 00 00 00 85 9A save with new IDRead Live IMU & Attitude Data (0x0034, 15 Registers)
→ 50 03 00 34 00 0F 49 81
← 50 03 1E FF 01 03 B0 06 50 FC C9 FF 7C 00 91 01 D5 FD DB FD 27 00 00 21 FF 00 00 7F F6 FF FD 73 E7 3F 04Decoded values:
- Acc:
FF 01(−255) →−0.1245 G,03 B0(944) →0.4609 G,06 50(1616) →0.7891 G - Gyro:
FC C9(−823) →−50.232 deg/s,FF 7C(−132) →−8.057 deg/s,00 91(145) →8.850 deg/s - Mag:
01 D5(469) →14.312 μT,FD DB(−549) →−16.754 μT,FD 27(−729) →−22.247 μT - Euler: Roll
00 00 21 FF(8703) →8.703°, Pitch00 00 7F F6(32758) →32.758°, YawFF FD 73 E7(−166937) →−166.937°
Magnetic Calibration via Modbus
Prepare the site and mounting per Magnetic Calibration, then run:
- Write
1to0x0006(PROFILE) → save (0x0000 = 0x0000) → reboot (0x0000 = 0x00FF) and wait ~1 s. - Write
1(3D) or2(2D) once to0x0008(MCAL_START), then rotate the vehicle without rewriting0x0008. - Poll
0x000A(MCAL_STATUS) and0x000B(MCAL_PROGRESS) every 1–2 s until status becomes3(succeeded, auto-saved) or4(failed). - Rotate 360° level and verify heading closure error ≤ 5°.
