Add a bed check: warn about bumps and flatness, pause PRINT_START on a failure

BED_SCAN_CHECK levels, scans and warns, without heating or touching the bed.
extras/mesh_check.py fits a smooth surface to the mesh and reports areas more
than 0.03 mm from it, and a range over 0.30 mm.

In PRINT_START a failed check pauses before the nozzle heats. Resume sets the
print file back to the PRINT_START line (M26), so it runs again as normal file
G-code. BED_CHECK_IGNORE lets the next failed check only warn.

Tested on saved scans and rendered macros only, not yet on the printer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-11-06 16:16:36 +01:00
1 parent e540e40cf7
commit 99b7109b5b
7 files changed
+358 -5

No files matched your search

+8
View File
@@ -57,6 +57,11 @@ detection, `filament_error_sensitivity`), iHeater chamber heater.
After a PAUSE, `_RESUME_PRINT` first purges with `BLOBIFIER_CHECKED`
(`_RESUME_PURGE`); a failed check raises an error, which aborts the whole
chain (AFC_RESUME's restore too), so the printer stays paused.
- A failed bed check in `PRINT_START` (`calibration/bed_scan_check.cfg`) pauses
with `_BED_CHECK_STATE.pending` set: `PAUSE` then only pauses, and `RESUME`
calls `_BED_CHECK_RETRY`, which sets the print file back to the `PRINT_START`
line (`M26`) and resumes. Everything after the check belongs in
`_PRINT_START_FINISH`: a pause does not stop a running macro.
- Only one `[save_variables]`, in `macros/save_variables.cfg`.
- `PRINT_END` and `CANCEL_PRINT` share `_PRINT_CLEANUP` (heaters including
`iHEATER_OFF`, fan, `M221 S100`, bdwidth off). Anything that must happen
@@ -106,6 +111,9 @@ detection, `filament_error_sensitivity`), iHeater chamber heater.
in log mode); a light finger push on the cold nozzle gives 41
(threshold 30).
- Z check after a contact homing: Beacon vs Klipper Z about 0.06 mm.
- Bed check (mesh_check, limits 0.03 and 0.30 mm): clean plate, worst deviation
0.016 mm cold and on a hot PLA print, range 0.12-0.17. Residue on the plate:
0.06-0.09 mm with the mesh ending at its edge, 0.30 mm with the mesh over it.
- XY drift check: endstop noise about 0.01-0.02 mm; limit 0.1 mm (one motor
skipping one cycle = 0.4 mm shows as 0.2 mm in X and Y).