From f65eb98d18976da7aa0de80bdb51aeb12e218d05 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Mon, 30 Nov 2026 18:38:56 +0100 Subject: [PATCH] =?UTF-8?q?Docs:=20the=20HMC5883L=20heading=20=E2=80=94=20?= =?UTF-8?q?ESPHome's=20atan2(-x,=20y)=20is=20=E2=88=92180..180,=20the=20no?= =?UTF-8?q?de=20now=20adds=20360=20to=20the=20negatives=20(they=20arrived?= =?UTF-8?q?=20as=200=20in=20its=200..360=20encoding)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.adoc | 4 +++- docs/deployment.adoc | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TODO.adoc b/TODO.adoc index adf642b..d9e68c0 100644 --- a/TODO.adoc +++ b/TODO.adoc @@ -186,7 +186,9 @@ already reaches the home MQTT broker (`mqtt_ext`) from ESPHome nodes in `~/espho *** [x] The compass (HMC5883L on node 0x21, TPDO 0x221) as `imu.heading` + `mag.x/y/z` in `can.json` — for orienting while standing; driving uses the GNSS course *** [ ] Tilt compensation (pitch/roll from the IMU) and hard-/soft-iron calibration of the - heading — ESPHome's is a plain `atan2(y, x)`; in the node, like the levelling + heading — ESPHome's is a plain `atan2(-x, y)`; in the node, like the levelling +*** [x] The node sent the heading encoded 0..360 but ESPHome's is −180..180, negatives arrived + as 0 — fixed in the node (`x < 0 ? x + 360 : x` filter on `heading:`, 2026-11-30) *** [ ] IMU every 100–200 ms (the node reads it every 5 s today) and levelling done by the node itself, set by an SDO write from a button in `/can.html` — design in home-gitops `docs/canopen-nodes.adoc` ("Nulovanie náklonu a rýchlosť IMU") diff --git a/docs/deployment.adoc b/docs/deployment.adoc index 8959980..56e485e 100644 --- a/docs/deployment.adoc +++ b/docs/deployment.adoc @@ -253,8 +253,9 @@ same node) isn't in the firmware yet: Speed's scale also converts km/h to m/s (`300 / 65534 / 3.6`). 0x221 is the HMC5883L (TPDO 4 → `0x200 + node`): the field ±200 µT and ESPHome's -heading 0..360°, plain `atan2(y, x)` — no tilt compensation or hard-iron -calibration yet, so only roughly right standing level. The node +heading 0..360° (ESPHome's plain `atan2(-x, y)` is −180..180, the node +adds 360 to the negatives — a filter on `heading:`). No tilt compensation +or hard-iron calibration yet, so only roughly right standing level. The node goes operational by itself, so no `nmt_start`. === Map data (one way)