From 2629e70fadf4b41ae140dd9bd65864b163522acf Mon Sep 17 00:00:00 2001 From: MangaValk Date: Tue, 17 Nov 2026 11:16:50 +0100 Subject: [PATCH] Auto-resume only on NOT FEEDING; purge check fails on pressure left after the purge A CLOG DETECTED pause is usually a real blockage: on 2026-11-17 a nozzle blocked right after a swap, the purge check passed (a blocked nozzle also builds pressure) and the automatic resume only printed air until the next CLOG pause. CLOG messages are still cleared after a resume, so a leftover one cannot hide the next NOT FEEDING message. The purge check now also fails when bd_pressure's delta is still above pressure_max_delta (15) when the check stops: 16 good purges -3..+10, two long purges into the blocked nozzle +19/+21 (the short ones did not show it). Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- macros/afc/auto_resume.cfg | 17 ++++++++++++----- macros/afc/purge_check.cfg | 14 +++++++++++++- macros/print/pause_resume.cfg | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 237cbae..2b7d478 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ everything below, grouped by topic. Comment out what you do not use there. | `lane_tools.cfg` | `LANE_FEED_UNTIL_HUB_OPEN`, `LANE_FEED_ABORT` | AFC | | `purge_check.cfg` | `BLOBIFIER_CHECKED`: checks every AFC purge with bd_pressure (and optionally bdwidth motion); a bd_pressure that does not answer fails the check, `PURGE_CHECK_IGNORE_SENSOR` lets the current print finish without it; when the previous filament (saved `nozzle_last_temp`) needs more than 10°C above the new one, the purge runs at the previous filament's temperature and the nozzle cools back afterwards, so its leftover melts out | Blobifier, AFC, `bdpressure_check.py` from the bd_pressure repo + its load-check firmware, `extras/bdwidth_status.py` | | `flex_lanes.cfg` | Lanes holding TPU/TPE (material from Spoolman) get slower long moves (50 mm/s, AFC's minimum) through the tube; back to the configured speed when the lane holds something else. Polls every 5 s, reapplies after a restart. The last stretch into the extruder (`tool_load_speed`) stays as configured | AFC | -| `auto_resume.cfg` | After an AFC buffer fault pause ("AFC NOT FEEDING", "CLOG DETECTED") during a print, runs `RESUME` by itself after 5 s, so the lane check and the purge check decide; a failed check keeps it paused. At most 2 per print and none within 10 min of printing after the previous one; not during `PRINT_START` or a PA test. Off: `enabled` in `_AUTO_RESUME_CFG` | `print/pause_resume.cfg`, `purge_check.cfg`, AFC | +| `auto_resume.cfg` | After an AFC "NOT FEEDING" buffer fault pause during a print (not "CLOG DETECTED": usually a real blockage), runs `RESUME` by itself after 5 s, so the lane check and the purge check decide; a failed check keeps it paused. At most 2 per print and none within 10 min of printing after the previous one; not during `PRINT_START` or a PA test. Off: `enabled` in `_AUTO_RESUME_CFG` | `print/pause_resume.cfg`, `purge_check.cfg`, AFC | | `purge_until_empty.cfg` | `PURGE_UNTIL_EMPTY`: purges a snapped filament out until there is no more nozzle pressure | same as `purge_check.cfg` | | **pressure_advance/** | | | | `bd_pressure.cfg` | `[bdpressure bd_pa]` (I2C on the Nitehawk) and the vendor macros `PA_CALIBRATE`, `PA_E`, `PA_RESET`, `PA_STATE`; `PA_CALIBRATE` no longer sets Z back to a value read before the test (wrong after a Z hop in `G28 XY`) | `bdpressure.py` from the bd_pressure repo | diff --git a/macros/afc/auto_resume.cfg b/macros/afc/auto_resume.cfg index c6828ec..5eaa8a7 100644 --- a/macros/afc/auto_resume.cfg +++ b/macros/afc/auto_resume.cfg @@ -1,6 +1,6 @@ -# Automatic resume after an AFC buffer fault ("AFC NOT FEEDING" / "CLOG DETECTED") +# Automatic resume after an AFC "NOT FEEDING" buffer fault # -# When AFC pauses a print because the buffer stayed empty or full too long, +# When AFC pauses a print because the buffer stayed empty too long, # PAUSE (print/pause_resume.cfg) calls _AUTO_RESUME_ARM. After `delay` seconds # _AUTO_RESUME runs the normal RESUME: AFC clears its error, the lane check # runs, and _RESUME_PRINT purges into the Blobifier with the purge check. A @@ -24,7 +24,12 @@ variable_enabled: True variable_max_per_print: 2 # automatic resumes per print variable_min_interval: 10 # minutes of printing since the previous automatic resume variable_delay: 5 # seconds after the pause (AFC finishes its own pause first) -variable_faults: ['NOT FEEDING', 'CLOG DETECTED'] # text in AFC's error message +variable_faults: ['NOT FEEDING'] # text in AFC's error message +# Not 'CLOG DETECTED' (buffer stayed full: the extruder takes no filament): +# that is usually a real blockage. On 2026-11-17 a nozzle blocked right after a +# swap; the purge check still passed (a blocked nozzle also builds pressure), +# so the automatic resume only printed air until the next CLOG pause. +variable_clear_faults: ['NOT FEEDING', 'CLOG DETECTED'] # removed from AFC's queue after any resume # State (set by the macros) variable_active: False # True from _PRINT_START_FINISH to the end of the print variable_count: 0 # automatic resumes in this print @@ -88,12 +93,14 @@ gcode: {% endif %} # Called by _RESUME_PRINT after a resume: remove a buffer fault message from -# the front of AFC's queue, so the next pause reads its own message +# the front of AFC's queue, so the next pause reads its own message. Also a +# CLOG message after a manual RESUME: left at the front, it would hide the next +# NOT FEEDING message and block that automatic resume. [gcode_macro _AUTO_RESUME_CLEAR_FAULT] description: Helper: drop AFC's buffer fault message after a resume gcode: {% set cfg = printer["gcode_macro _AUTO_RESUME_CFG"] %} {% set msg = printer.AFC.message.message|default('') if 'AFC' in printer else '' %} - {% if msg and cfg.faults|select('in', msg)|list %} + {% if msg and cfg.clear_faults|select('in', msg)|list %} AFC_CLEAR_MESSAGE {% endif %} diff --git a/macros/afc/purge_check.cfg b/macros/afc/purge_check.cfg index 916a6d3..f09c95d 100644 --- a/macros/afc/purge_check.cfg +++ b/macros/afc/purge_check.cfg @@ -9,6 +9,10 @@ # the nozzle pressure stayed above the threshold. Catches filament # that never reached the melt zone. Skipped automatically on stock # firmware or when bdpressure_check.py is not installed. +# A blocked nozzle builds pressure too, so that alone passes it. The +# pressure left when the check stops (delta, a few seconds after the +# purge, once the blob is dropped) catches some: it bleeds off slowly +# through a blocked nozzle (pressure_max_delta). # # Needs: bdwidth_status.py in ~/klipper/klippy/extras/ # bdpressure_check.py in ~/klipper/klippy/extras/ (optional) @@ -46,6 +50,11 @@ variable_motion_check: False # False: skip the bdwidth motion check, pressure variable_min_ratio: 0.4 # placeholder: sensed mm / extruded mm below this = not feeding variable_min_extrude: 20 # skip the checks for purges shorter than this (mm) variable_pressure_min_ms: 5000 # placeholder: longest continuous pressure needed (ms) +# Pressure still above the baseline when the check stops = nozzle (partly) +# blocked; 0 = off. Data 2026-11-12..17: 16 good purges -3..+10, the two long +# purges into a blocked nozzle (2026-11-17) +19 and +21; the two 40 mm purges +# into that nozzle gave -2 and -12, so it does not catch every blockage. +variable_pressure_max_delta: 15 # bdwidth is not reading after SET_BDWIDTH ... COMMAND=DISABLE and after # every Klipper restart until an ENABLE (outside a print, often early in a # print start). The check then switches it on and waits this long for the @@ -188,10 +197,13 @@ gcode: {% endif %} {% if 'bdpressure_check' in printer and printer.bdpressure_check.available %} {% set p = printer.bdpressure_check %} - {% set press = "pressure longest %d ms, total %d ms, peak %d" % (p.longest_ms, p.above_ms, p.peak) %} + {% set press = "pressure longest %d ms, total %d ms, peak %d, left %d" % (p.longest_ms, p.above_ms, p.peak, p.delta) %} {% if p.longest_ms < cfg.pressure_min_ms %} {% set _ = failed.append("no sustained nozzle pressure") %} {% endif %} + {% if cfg.pressure_max_delta > 0 and p.delta > cfg.pressure_max_delta %} + {% set _ = failed.append("pressure stays high after the purge (%d > %d): nozzle blocked?" % (p.delta, cfg.pressure_max_delta)) %} + {% endif %} {% elif 'bdpressure_check' in printer %} {% if cfg.ignore_missing_sensor %} {% set press = "pressure skipped: bd_pressure not answering (ignored, PURGE_CHECK_IGNORE_SENSOR)" %} diff --git a/macros/print/pause_resume.cfg b/macros/print/pause_resume.cfg index 5f2c9ef..a1c335d 100644 --- a/macros/print/pause_resume.cfg +++ b/macros/print/pause_resume.cfg @@ -16,7 +16,7 @@ # (the lane AFC was loading when a tool change failed, otherwise the loaded # lane), and RESUME stops with an error when another lane (or none) is loaded. # RESUME LANE_CHECK=0 resumes anyway (e.g. after remapping with SET_MAP). -# An AFC buffer fault pause ("AFC NOT FEEDING" / "CLOG DETECTED") during a +# An AFC "NOT FEEDING" buffer fault pause (not "CLOG DETECTED") during a # print runs this RESUME by itself after a few seconds, within limits # (afc/auto_resume.cfg). # A failed bed check in PRINT_START (calibration/bed_scan_check.cfg) pauses with