Skip to content

loadcell: make HX711 frame validity MCU-owned - #265

Closed
pdscomp wants to merge 2 commits into
mainfrom
doom/loadcell
Closed

loadcell: make HX711 frame validity MCU-owned#265
pdscomp wants to merge 2 commits into
mainfrom
doom/loadcell

Conversation

@pdscomp

@pdscomp pdscomp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pin Kalico to the HX711 reliability implementation, replacing the superseded host/MCU glitch-filter patch.
  • Make the bed MCU the authority on serial-frame validity, with deterministic reset/settling qualification and fail-safe probe aborts for invalid acquisition.
  • Add HX711.md documenting the protocol, comparison against the data sheet/Elegoo/upstream/Prusa implementations, design choices, preserved reverse-engineering artifacts, and on-printer validation plan. The full design record is also available as an HX711 reliability gist.

Kalico dependency

This PR consumes the implementation in draft Kalico PR #5.

Why

The prior workaround retained or classified corrupted values differently on the host and MCU. This follow-up makes invalid frames explicit and prevents them from reaching tare, filters, or probing decisions.

Tested on CC1 hardware (2026-07-23)

  • 10 consecutive BED_MESH_CALIBRATE BED_TEMP=60 passes — 392k frames, zero hard faults, zero ADC recovery cycles.
  • 20 consecutive BED_MESH_CALIBRATE BED_TEMP=100 passes (chamber ~60 °C) — 937k frames, zero hard faults, zero recovery cycles.
  • Baseline firmware failed every mesh macro at ~1 hard fault per 9 seconds.
  • Per-commit failure→fix evidence and raw counters: design-record gist and Kalico PR #5.

Offline validation

  • Python byte-compilation passed.
  • STM32F401 bed-MCU build passed.
  • Full CC1 eMMC/SWU build passed (6,521 tasks).
  • Build resolves Kalico to c368f84e (see PR head).

Pin Kalico to the reliability implementation that emits explicit frame quality, resets and qualifies acquisition deterministically, rejects invalid data before filtering or tare, and fails an active probe safely. Remove the superseded host/MCU glitch-filter patch.

Document the source comparison, design decisions, hot-chamber incident evidence, and required on-printer validation.
@github-actions

Copy link
Copy Markdown

✅ Build Artifacts

Branch: doom/loadcell
Build: e1fb70d (merge into main)

Artifact Size
CC1 Firmware 91.31 MB

View workflow run

…g-pass tolerance

Kalico paul/hx711-reliability @ c368f84e is the five-iteration stack that
completed 10/10 consecutive BED_MESH_CALIBRATE BED_TEMP=60 runs on the CC1
test printer (zero hard faults in 392k frames):
- timing-miss reclassification (skips instead of resets)
- drift-safety band gates arming sample only
- first-crossing trigger default (upstream semantics)
- per-channel spike rejection (>100k single-sample glitches)
- bounded bulk-overflow tolerance (<=2/session)

macros.cfg: LOADCELL_Z_HOME cleaning passes get SAMPLES_TOLERANCE=0.1 —
they are ooze management, not measurement, and the squish cycles mangle
the edge contact; the final center probe keeps 0.05.
@pdscomp
pdscomp temporarily deployed to approval-given July 23, 2026 17:26 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

✅ Build Artifacts

Branch: doom/loadcell
Build: c0856bd (merge into main)

Artifact Size
CC1 Firmware 91.32 MB

View workflow run

@pdscomp

pdscomp commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Test build available 🧪

The PR build artifact carries the validated HX711 stack (kalico c368f84e — see kalico PR #5 — plus the LOADCELL_Z_HOME cleaning-pass tolerance fix):

flash-artifact https://github.com/OpenCentauri/cosmos/actions/runs/30029412594

This exact artifact went 10/10 consecutive BED_MESH_CALIBRATE BED_TEMP=60 and 20/20 at BED_TEMP=100 on the CC1 test printer — zero hard faults across ~1.3M frames. If you've been bitten by invalid HX711 sample, force exceeded drift_safety_limit, or mesh probing dying mid print-start, this is the build to try.

Feedback especially welcome on:

  • load_cell_probe sensor_health counters after long prints (hard faults and recovery cycles should stay at zero)
  • any drift_safety_limit or samples_tolerance aborts
  • hot-bed (≥90 °C) behavior over long sessions

Raw evidence and per-commit rationale: design record.

@bniggemyer

Copy link
Copy Markdown

going to run a few more prints, but so far, flawless.

root@elegooner:/board-resource# grep glitch klippy.log.fail | wc -l
651
root@elegooner:/board-resource# grep glitch klippy.log.pr265 | wc -l
0

@pdscomp pdscomp closed this Jul 26, 2026
@pdscomp

pdscomp commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing because OBE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants