feat(bmm150): heading, tilt compensation, and hard-iron calibration - #313
Merged
Conversation
Add compass heading with optional accel-sensor tilt fusion, YAML axis remapping, declination, and a calibrate action that only persists offsets after per-axis delta checks.
…bration If accel IDs are set but unpublished, keep heading unknown and log enter/leave. Stamp calibration with version, mag axes, and uT scale so YAML remaps cannot reload old offsets.
…ration usable Re-init after five consecutive read/overflow failures. Default to yaw-only calibration with a relaxed Z gate, add heading_offset, and let the test accel templates actually publish.
Check bus_error_ before chip_id so boot-time and runtime NAKs do not mark_failed. Apply yaw Z offset when delta exceeds the Z gate, and always reset soft-iron Z scale to 1 when disabled.
A missing chip is indistinguishable from a dead bus (both NAK). Keep retrying but do not spam the log every update_interval.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bmm150.calibrate; persist only if each axis delta > 20 uT;on_calibration_finishedwith success boolTest plan
esphome compile tests/components/bmm150/test.esp32-idf.yaml(heading + accel IDs + calibrate action)git diffconfirmsbmm150_lib.c/handbmm150_defs.huntouchedMade with Cursor