ASCII Data, Status & Commands¶
For IMU600-V2 / firmware 0.11.2 / GUI v1.6.1.
Complete protocol chapters: 2. Data output (2.1–2.5) · 3. Status and statistics (3.1–3.4), with full formats and field definitions.
Framing & Timestamps¶
$<body>*<XX>\r\n
The first body field is the SPNV message name; remaining fields are comma-separated. XX is the two-digit hexadecimal XOR of ASCII bytes between $ and *. Synchronize on $, discard a line on checksum failure, dispatch by message name and allow future trailing fields.
ts_us is a 64-bit microsecond clock reset at boot, marking the end of the integration window for IMU data. All three RAW messages and fused output share it for a given window. It is not UTC. Gyro uses °/s and specific force m/s²; Δθ uses rad, Δv m/s and dt seconds. Use actual dt, not a fixed 1/RATE.
def spnv_checksum(body: str) -> str:
value = 0
for byte in body.encode("ascii"):
value ^= byte
return f"{value:02X}"
body = "SPNVCMD,RATE,100"
command = f"${body}*{spnv_checksum(body)}\r\n".encode("ascii")
# ser.write(command)
Main Data Fields¶
Field order after each message name is shown below; complete lines also contain $, the name, *XX and CRLF.
SPNVIMURAW:
id,ts_us,gx,gy,gz,ax,ay,az,temp,n,status,dthx,dthy,dthz,dvx,dvy,dvz,dt
SPNVIMU:
ts_us,gx,gy,gz,ax,ay,az,temp,dthx,dthy,dthz,dvx,dvy,dvz,dt,n_used,flags
SPNVBARO:
ts_us,press_hpa,temp_c,alt_m,status
SPNVAHRS:
ts_us,roll,pitch,yaw,q0,q1,q2,q3,align,flags,bgx,bgy,bgz,zb_s
SPNVPPS:
ts_us,edges,captures,state,err_ppm,age_ms,align
SPNVSTAT:
id,dry,out,crc_err,frame_err,spi_timeout,dropped,dcnt_skip,dry_timeout,dry_kicks,dry_pin,isr_us_max,isr_us_last,isr_cpu,resync[,read_retry,read_bad]
SPNVFUS:
outputs,rej1,rej2,rej3,incomplete,degraded,gth,ath
- RAW has three lines per window, id = 1 / 2 / 3. n counts integrated raw samples, about 29–30 at 50 Hz. Δθ / Δv include coning / sculling compensation.
- Fused output is one line per window; n_used is the number used. used_mask exists only in binary. BARO contains hPa / °C / ISA altitude in m for relative-height reference; status = 0 is normal.
- AHRS angles use degrees, q maps body FRD → NED (scalar q0), bg uses °/s and zb_s is stationary bias-calibration progress from 0–10 s. STAT reports per-IMU 1 Hz statistics, FUS fusion statistics; increasing SYS uart_drop / u2_drop indicates the respective UART is overloaded.
IMU Status¶
Status is the OR of raw-sample flags across the window. Use status & 0x7F for quality; fusion normally excludes an IMU if this is nonzero. If all three have error flags, it falls back to all three, so continued FUSED output does not establish valid data. Interpret PPS bit7 separately.
| Bit | Value | Name | Meaning |
|---|---|---|---|
| 0 | 1 | SPI_CRC | Internal communication error; invalid |
| 1 | 2 | CE | Invalid request; raw data remains valid, but excluded from fusion |
| 2 | 4 | IDS | Abnormal internal data state; suspect |
| 3 | 8 | S_ERROR | Sensor diagnostic error; invalid |
| 4 | 16 | S_SAT | Range exceeded; clipped |
| 5 | 32 | S_INIT | Initializing (about 250 ms); invalid |
| 7 | 128 | PPS | ts_us marks a PPS rising edge; not an error |
Common values: 0 normal; 16 saturated; 12 sensor error; 32 / 44 startup initialization.
Fusion Flags¶
| Bit | Value | Meaning |
|---|---|---|
| 0–2 | 1 / 2 / 4 | IMU 1 / 2 / 3 rejected |
| 3 | 8 | SPREAD_WARN |
| 4 | 16 | DEGRADED: fewer than two usable IMUs |
| 5 | 32 | INCOMPLETE: missing IMU data in this window |
| 6 | 64 | SATURATED: at least one IMU clipped |
| 7 | 128 | PPS: timing marker |
AHRS Alignment & Flags¶
| align | State |
|---|---|
| 0 | Initializing; remain still for about one second |
| 1 | Valid roll / pitch; relative yaw |
| 2 | Manual heading set by HDG |
| Bit | Meaning |
|---|---|
| 0 | Dynamic motion |
| 1 | Bias estimation paused |
| 2 | Heading set by HDG |
| 3 | Accelerometer not used for this update |
| 4 | Moved during alignment; hold still and use AHRS,reset |
| 5 | Bias estimated during ≥10 s of stillness; status, not warning |
| 6 | Stationary during the last 10 s; status |
Configuration Commands¶
UART1 commands always use ASCII: $SPNVCMD,<key>,<value>[*XX] followed by CRLF. Checksums are optional for manual entry; commands are case-insensitive. Replies are $SPNVACK,<key>,<actual value> or $SPNVNAK,<key>,<reason>. Ordinary changes affect RAM. Use SAVE if you want the settings to survive a power cycle.
| Key | Value | Default | Function |
|---|---|---|---|
RATE |
5 / 10 / 25 / 50 / 100 / 200 / 400 / 500 / 1000 |
50 | IMU output Hz |
OUT |
raw / fused / both / none |
both | UART1 IMU content |
BARO |
0 / 1 |
1 | UART1 barometer enable |
BRATE |
10 / 25 / 50 / 100 |
50 | Barometer output Hz |
AHRS |
0 / 1 / reset |
1 | Attitude output; keep still 1 s after reset |
HDG |
−360 … 360 |
— | Manual heading deg; requires align ≥1 |
AKP / AKI |
0 … 50 |
2.0 / 0.05 | AHRS proportional / integral gains |
GTH / ATH |
0 < v ≤100 |
0.5 / 0.5 | Fusion rejection thresholds °/s / m/s² |
STAT |
0 / 1 / now |
1 | 1 Hz statistics; now sends one set |
HB |
0 / 1 |
0 | Diagnostic heartbeat SPNVHB |
MODE |
ascii / binary |
ascii | UART1 format; ACK in old format |
BAUD |
460800 / 921600 / 1500000 / 2000000 |
460800 | UART1 baud; switch after ACK at old baud |
U2OUT |
raw + fused + ahrs + baro + stat; none; all |
raw | Combine UART2 outputs with + |
U2MODE |
ascii / binary |
binary | UART2 format |
U2BAUD |
115200 / 230400 / 460800 / 921600 / 1500000 / 2000000 |
460800 | UART2 baud |
PPS |
0 / 1 |
1 | GPS PPS window alignment |
TRIG |
0 / 1 |
0 | 0 continuous; 1 external trigger |
AZB |
0 / 1 |
1 | AHRS stationary 10 s bias estimate, including Z |
SPI |
off / ardupilot / stream |
off | SPI3 output mode |
SPIOUT |
raw + fused + ahrs + baro + stat; none; all |
none | SPI stream content |
SPIMODE |
ascii / binary |
binary | SPI stream format |
SPICK |
3 / 0 |
3 | SPI Mode 3 / Mode 0 |
SAVE |
1 |
— | Save settings to flash; output briefly pauses |
FACTORY |
1 |
— | Reset settings, preserve calibration; 460800 ASCII |
CFG |
1 |
— | Read SPNVCFG, SPNVU2, SPNVSPI |
INFO |
1 |
— | Version, reset cause, serial, initialization results |
REINIT |
1 |
— | Reinitialize all three IMUs |
PING |
Any string |
— | Echo test |
BOOT |
1 |
— | Reboot and load saved settings |
CAL |
1 |
— | Read calibration SPNVCAL |
ACAL |
<imu>,<bx>,<by>,<bz>,<kx>,<ky>,<kz> |
— | a = (a_raw − b) × k; |b| ≤2, 0.95 ≤k ≤1.05 |
FWGT |
g / a,<w1>,<w2>,<w3> |
1,1,1 | Gyro / acceleration relative weights; 0 < w ≤100 |
CALSAVE |
1 |
— | Save calibration and weights to flash |
CALCLR |
1 |
— | Clear calibration |
DBG |
1 |
— | Full device information; ACK then BOOT / RESET / AUTH / INIT / DBG. |
For FWGT, choose g or a, for example FWGT,g,1,1,1. Shipping firmware emits no startup banner; INFO reports reset causes such as POR (power-on), EXTR(MCLR), SWR (software reset) and WDTO (watchdog).
Minimal Configuration Example¶
Send each checksum-free manual command with CRLF; this selects 100 Hz fused output and saves it.
$SPNVCMD,CFG,1
$SPNVCMD,RATE,100
$SPNVCMD,OUT,fused
$SPNVCMD,SAVE,1
$SPNVCMD,CFG,1
RAW & FUSED Field Reference¶
| Field | ASCII Precision / Unit | Definition |
|---|---|---|
| id | integer | RAW IMU number 1–3 |
| ts_us | u64 · µs | IMU integration endpoint; shared clock and boundary for a RAW / FUSED batch |
| gx / gy / gz | 4 decimals · °/s | Angular rate from nominal 1475 Hz samples; dth/dt is rad/s, multiply by 180/π for °/s |
| ax / ay / az | 4 decimals · m/s² | Mean specific force, including gravity response at rest |
| temp | 2 decimals · °C | RAW sensor temperature; FUSED averages participating sensors |
| n | integer | RAW sample count: about 14–15 at 100 Hz, 29–30 at 50 Hz, 295 at 5 Hz |
| dthx / dthy / dthz | 7 decimals · rad | Rotation vector with trapezoidal integration and second-order coning compensation |
| dvx / dvy / dvz | 6 decimals · m/s | Velocity increment with rotation / sculling compensation; level at rest dvz ≈ −9.79 × dt |
| dt | 6 decimals · s | Actual integration duration; FUSED averages participating dt values |
| n_used | integer | FUSED IMU count, 1–3 |
The three sampling clocks differ slightly. Even with the same ts_us, n can differ by one and actual sample coverage / dt can differ. A common timestamp does not imply perfectly simultaneous raw sampling.
A single sensor S[1:0] response selects one state, with priority initialization > error > saturation > normal. Batch status ORs responses and may contain bits 3 / 4 / 5 together. SPI_CRC may also indicate a response-address mismatch. SPREAD_WARN means deviation above half the effective threshold, including deviations not yet persistent enough for rejection.
BARO: Timestamp & Conversion Delay¶
In Forced mode, ts_us is the barometer conversion trigger time, not completion or the IMU integration endpoint. In Normal mode it is when fresh data readiness is detected. Matching BARO and IMU timestamps do not describe identical measurement intervals; consult SPNVINIT,B conv_us for conversion time.
| BRATE | OSR pressure / temperature | IIR |
|---|---|---|
| 10 / 25 Hz | 16× / 2× | 3 |
| 50 Hz | 8× / 2× | 3 |
| 100 Hz | 4× / 1× | 3 |
Firmware keeps conversion time within the period minus 3 ms. press_hpa is hPa (mbar); multiply by 100 for Pa. Four decimal places give 0.01 Pa display resolution, not measurement accuracy. temp_c is chip temperature. alt_m = 44330.77 × [1 − (p/1013.25)^0.190263], affected by weather and possibly negative. Status bit0 records an I2C NACK / collision recovered by retry before this sample.
AHRS Detailed Interpretation¶
| Field / Flag | Range / Condition |
|---|---|
| roll / pitch / yaw | ASCII 3 decimals, degrees; roll −180…180, pitch −90…90, yaw 0…360 |
| q0…q3 | ASCII 6 decimals; Hamilton quaternion, scalar q0, v_n = R(q) · v_b |
| bgx / bgy / bgz | ASCII 4 decimals, °/s; estimated body-axis gyro bias |
| zb_s | ASCII 1 decimal, 0–10 s; motion resets it, AZB=0 holds it at zero |
| HIGH_DYN (bit0) | Specific-force magnitude differs from g by >0.5 m/s², angular rate >50 °/s, or gravity-direction error >5°; Kp becomes 0.2 |
| BIAS_FROZEN (bit1) | Dynamic state, angular rate >5 °/s, or specific-force magnitude differs from g by >0.2 m/s²; only bias learning pauses |
| ACC_REJECT (bit3) | Specific-force magnitude differs from g by >3 m/s²; gyro-only update |
Attitude uses fused Δθ to update the quaternion and Δv/dt to observe gravity. Every 10 s, AZB checks gyro standard deviation <0.1 °/s on each axis, an acceleration criterion <0.1 m/s² and no dynamic flag. Passing data estimates three-axis bias; the first estimate is applied directly and sets BIAS_CAL.
Command Details & NAK¶
Commands may end with CR or LF (CRLF recommended); lines over 127 characters are discarded. A bad supplied checksum returns SPNVNAK,CMD,checksum. DBG,1 requests fuller diagnostics than INFO. BAUD switches about 5 ms after completing ACK at the old baud; MODE and FACTORY also acknowledge using the old format / baud.
| Command / Reply | Meaning |
|---|---|
| DBG,1 | ACK then full BOOT / RESET / AUTH / INIT / DBG information |
| CFG saved=1 | Means NVM contains saved settings, not that current RAM is fully saved |
| BRATE | Barometer reconfiguration takes up to about 15 ms without affecting IMU; OSR adapts to rate |
| SPI / TRIG | SPI also accepts 0 / 1 / 2; TRIG accepts continuous / trigger |
| U2OUT / SPIOUT | Combine content with +, comma or vertical bar; + is recommended |
Single-character shortcuts need no terminator: 1–6 select 5 / 10 / 25 / 50 / 100 / 1000 Hz; s requests statistics, r reinitializes. Use full RATE commands for 200 / 400 / 500 Hz.
checksum
not SPNVCMD
missing value
unknown key
range
osr/odr invalid
i2c error
i2c timeout
not leveled yet
nvm not available
write failed
no bootloader (dev build)
These are common NAK reasons; use ... lists accepted choices, as in the command table. HDG requires leveling first. Preserve failed SAVE / CALSAVE replies for diagnosis.
Communication details also follow Protocol v1.1, pages 4–21. See the protocol overview.
Configuration Readback and Replies¶
$SPNVCMD,<key>,<value>[*XX]\r\n
$SPNVACK,<key>,<actual_value>*XX
$SPNVNAK,<key>,<reason>*XX
Formats above are schematic; CRLF is represented by literal \r\n. ACK carries the applied value; retain the full value, since ACAL/FWGT replies include commas. CFG reports current RAM settings, while NVM reports stored settings. CAL returns one line for each of the three sensors, followed by a W line.
$SPNVCMD,CFG,1
$SPNVACK,CFG,1*XX
$SPNVCFG,baud=460800,mode=ascii,rate=50,out=3,stat=1,hb=0,baro=1,brate=50,ahrs=1,gth=0.500,ath=0.500,akp=2.000,aki=0.0500,saved=1,fw=0.11.2,trig=0,azb=1*XX
$SPNVU2,out=raw,mode=binary,baud=460800,drop=0,pps=1,pps_state=1,pps_err_ppm=0.000*XX
$SPNVSPI,mode=off,out=none,fmt=binary,ck=3,txn=0,ok=0,short=0,delivered=0,drop=0,...*XX
Source document:IMU600-V2 User Manual v1.1 · PDF pages 17–25