Hi all,
I’m working on bringing up a custom flight controller board (Lectron FMU_CM5, STM32H753-based, FMUv6X-compatible) with ArduPilot, and I’ve run into what appears to be an axis orientation issue specific to the ICM-42670-P IMU.
## Hardware Setup
- FMU MCU: STM32H753IIK6 - IMU 0: ICM-42670-P on SPI1 (FMU baseboard) - IMU 1: ICM-42670-P on SPI2 (separate sensor board) - IMU 2: BMI270 on SPI3 (sensor board) - ArduPilot: latest master, ArduCopter
## Observed Behavior
With `ROTATION_NONE` in hwdef.dat: Board held level → zacc = +1000 (expected: -1000) Board pitched forward → xacc = +1000 ✓ (correct) Board rolled right → yacc = +1000 ✓ (correct) Only the Z-axis is inverted. X and Y are correct.
## Key Observation The same board runs correctly under PX4 with: icm42670p -s -b 1 -R 0 start (ROTATION_NONE) Z-axis reads correctly in PX4 with no rotation applied.
## Root Cause Hypothesis Looking at the ICM-42670-P and ICM-42688P datasheets, their axis orientations differ: - ICM-42688P: +Y direction to the Right Side - ICM-42670-P: +Y direction to Left the Side — or vice versa If AP_InertialSensor_Invensensev3 applies the same axis convention for both chips without a chip-specific correction, this would produce exactly the Z-inversion we’re seeing.
## Questions 1. Does AP_InertialSensor_Invensensev3 apply any chip-specific axis correction for ICM-42670-P vs ICM-42688P? 2. If the axis conventions differ between these two chips, is there a hwdef.dat mechanism to handle this without modifying driver source code? 3. Would a minimal driver patch — controlled by a hwdef define such as `HAL_INS_ICM42670_Z_NEGATE` — be an acceptable approach for an upstream PR?
## What I’ve Tried Pure rotation combinations cannot solve a single-axis inversion (determinant = -1, reflection not achievable via rotation matrix). ROTATION_ROLL_180 fixes Z but inverts Y as a side effect.
Any guidance appreciated. Happy to test patches and submit a PR. hwdef.dat available on request.
Thanks