From ebf8b69c66fb30242bd9d6aa5f9ea9effcbe7e46 Mon Sep 17 00:00:00 2001 From: j3kestrel Date: Sun, 18 Oct 2026 22:08:18 -0400 Subject: [PATCH] fix(qmc5883p): scale for the +-2 G range is 15000 LSB/G (#29301) The driver selects RNG = 11 (+-2 G) and checks it, but scaled the data by 1/12000, so every field reading was 1.25x too large (measured 1.252x the world magnetic model), which also triggers the strong magnetic interference preflight check. The QST datasheet (13-52-19 Rev A) gives 15000 LSB/G for the +-2 G range. Existing compass calibrations must be redone after this change: the stored offsets are in the old units. Assisted-by: Claude:claude-opus-5-5 --- src/drivers/magnetometer/qmc5883p/QMC5883P.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/magnetometer/qmc5883p/QMC5883P.cpp b/src/drivers/magnetometer/qmc5883p/QMC5883P.cpp index bbb2f02db83..6a9e50d676f 100644 --- a/src/drivers/magnetometer/qmc5883p/QMC5883P.cpp +++ b/src/drivers/magnetometer/qmc5883p/QMC5883P.cpp @@ -261,7 +261,7 @@ bool QMC5883P::Configure() } } - _px4_mag.set_scale(1.f / 12000.f); // 12000 LSB/Gauss (Field Range = ±2G) + _px4_mag.set_scale(1.f / 15000.f); // 15000 LSB/Gauss (Field Range = ±2G) _px4_mag.set_range(2.f); return success;