Repository navigation
fix(bed): locate a toolhead camera against the reference before judging plate state - #758
Open
alex-mextner wants to merge 2 commits into
Open
alex-mextner wants to merge 2 commits into
alex-mextner wants to merge 2 commits into
Conversation
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.
Refs #757
Cause
The K1 SE camera rides on the toolhead, so after a job the same empty plate is seen shifted (~100 px, a few % zoom) from where the reference was taken. The 2026-11-13 preflight frames (20:37 / 20:38) show the plate on and empty; the only reference at the time (Z 125.0) was taken from yet another place. Compared pixel by pixel that read ~70% of the plate surface changed ->
plate missing-> preflight FAIL, start refused, andbed check --assume-emptyrefuses a plate-missing verdict so it could not override. Not Z (124.8 vs 125.0 is within tolerance), LED or thresholds.Change
lib/bed_pose.pylocates the frame against its reference first, by the scene round the bed region (what a plate or part cannot change):unknown(preflight WARN) with the fix:3d printer bed reference NAME --capturefrom where the camera is now (check thewatch.bed.roioutline), or put the toolhead back--no-platereference from another view is not used; a frame judged from a moved/lost camera never becomes the reference by itself (bed_refs.refresh_refusal)Evidence
Real saved frames in
tests/data/bed/k1se_*.jpg(camera frames of 2026-11-13, scaled to 640 px).Tests
tests/test_bed_pose.py: 30 tests, e.g. both preflight frames against the old reference give unknown/WARN with the fix; the 20:37 frame passes against the 20:38 reference from ~100 px away; a plate taken off and a part on the plate still FAIL, also with the camera moved or zoomed; U1 parts/spaghetti/night light are never lost; empty/whole-frame ROI. With the pose check disabled the lost-pose test fails fail.pytest tests/test_bed_*.py: 591 passed.Not done / follow-ups
bed reference k1se --capturefrom the idle view must wait until the running print ends; do not move the bed meanwhile. Review notes not addressed: a MOVED frame judges only the part of the bed region the moved frame still covers (>= 90 %), nobin/3de2e test.