Purge check: fail when bd_pressure does not answer, add override

A bd_pressure that does not answer used to be reported as "pressure
skipped" and the purge passed unchecked. It now fails the check, so in
enforce mode the printer pauses (and a resume purge stays paused).
PURGE_CHECK_IGNORE_SENSOR lets purges pass without the sensor until the
print ends; _PRINT_CLEANUP clears it so the next print checks again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-12 21:18:21 +02:00
1 parent 25891640b8
commit 536db5836d
3 files changed
+28 -3

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ everything below, grouped by topic. Comment out what you do not use there.
| **afc/** | | | | **afc/** | | |
| `xy_safety_check.cfg` | `AFC_XY_SAFETY_CHECK`, `_AFC_STORE_HOME_REFERENCE`, `AFC_XY_RESUME`: lost-step check around tool changes | `extras/xy_drift.py` (CoreXY) | | `xy_safety_check.cfg` | `AFC_XY_SAFETY_CHECK`, `_AFC_STORE_HOME_REFERENCE`, `AFC_XY_RESUME`: lost-step check around tool changes | `extras/xy_drift.py` (CoreXY) |
| `lane_tools.cfg` | `LANE_FEED_UNTIL_HUB_OPEN`, `LANE_FEED_ABORT` | AFC | | `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) | Blobifier, AFC, `extras/bdpressure_check.py` + bd_pressure load-check firmware, `extras/bdwidth_status.py` | | `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 | Blobifier, AFC, `extras/bdpressure_check.py` + bd_pressure load-check firmware, `extras/bdwidth_status.py` |
| `purge_until_empty.cfg` | `PURGE_UNTIL_EMPTY`: purges a snapped filament out until there is no more nozzle pressure | same as `purge_check.cfg` | | `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/** | | | | **pressure_advance/** | | |
| `bd_pa_spoolman.cfg` + `bd_pa_*.sh` | `LANE_CALIBRATE_PA`, `PA_CALIBRATE_ALL_LANES`, `LANE_RECAL_PA`, `SET_SPOOL_ID`, `PA_STATUS`: pressure advance per lane/spool, cached locally and in Spoolman; a calibration with no result, a pause during the test or too few/stuck sensor readings is rejected and not saved | bd_pressure, AFC, Spoolman, `gcode_shell_command` | | `bd_pa_spoolman.cfg` + `bd_pa_*.sh` | `LANE_CALIBRATE_PA`, `PA_CALIBRATE_ALL_LANES`, `LANE_RECAL_PA`, `SET_SPOOL_ID`, `PA_STATUS`: pressure advance per lane/spool, cached locally and in Spoolman; a calibration with no result, a pause during the test or too few/stuck sensor readings is rejected and not saved | bd_pressure, AFC, Spoolman, `gcode_shell_command` |
+24 -2
View File
@@ -32,7 +32,10 @@
[bdwidth_status] [bdwidth_status]
sensor: fila_width_0 sensor: fila_width_0
# Remove this section if bdpressure_check.py is not installed # Remove this section if bdpressure_check.py is not installed. With it
# installed, a bd_pressure that does not answer (stock firmware, hung or
# unplugged sensor) fails the check, so in enforce mode every purge pauses;
# PURGE_CHECK_IGNORE_SENSOR lets the current print finish without it.
[bdpressure_check] [bdpressure_check]
sensor: bd_pa sensor: bd_pa
@@ -50,6 +53,7 @@ variable_bdwidth_warmup_ms: 15000
variable_start_counts: 0 variable_start_counts: 0
variable_start_e: 0.0 variable_start_e: 0.0
variable_last_failed: False # last check failed in enforce mode (read by _RESUME_PURGE_VERIFY) variable_last_failed: False # last check failed in enforce mode (read by _RESUME_PURGE_VERIFY)
variable_ignore_missing_sensor: False # set by PURGE_CHECK_IGNORE_SENSOR, cleared at print end
gcode: gcode:
[gcode_macro BLOBIFIER_CHECKED] [gcode_macro BLOBIFIER_CHECKED]
@@ -144,8 +148,15 @@ gcode:
{% if p.longest_ms < cfg.pressure_min_ms %} {% if p.longest_ms < cfg.pressure_min_ms %}
{% set _ = failed.append("no sustained nozzle pressure") %} {% set _ = failed.append("no sustained nozzle pressure") %}
{% endif %} {% endif %}
{% elif 'bdpressure_check' in printer %}
{% if cfg.ignore_missing_sensor %}
{% set press = "pressure skipped: bd_pressure not answering (ignored, PURGE_CHECK_IGNORE_SENSOR)" %}
{% else %} {% else %}
{% set press = "pressure skipped (no check firmware)" %} {% set press = "bd_pressure not answering" %}
{% set _ = failed.append("bd_pressure not answering (power-cycle the sensor, or PURGE_CHECK_IGNORE_SENSOR to finish this print without the check)") %}
{% endif %}
{% else %}
{% set press = "pressure skipped (no bdpressure_check)" %}
{% endif %} {% endif %}
{% set checked = motion_on or 'bdpressure_check' in printer and printer.bdpressure_check.available %} {% set checked = motion_on or 'bdpressure_check' in printer and printer.bdpressure_check.available %}
{% set verdict = 'FAIL: ' ~ failed|join(', ') if failed else ('OK' if checked else 'NOTHING CHECKED') %} {% set verdict = 'FAIL: ' ~ failed|join(', ') if failed else ('OK' if checked else 'NOTHING CHECKED') %}
@@ -156,3 +167,14 @@ gcode:
PAUSE ; no effect while already paused (resume purge): see _RESUME_PURGE_VERIFY PAUSE ; no effect while already paused (resume purge): see _RESUME_PURGE_VERIFY
{% endif %} {% endif %}
{% endif %} {% endif %}
[gcode_macro PURGE_CHECK_IGNORE_SENSOR]
description: Let purges pass without bd_pressure until the print ends (ENABLE=0 to undo)
gcode:
{% if params.ENABLE|default(1)|int %}
SET_GCODE_VARIABLE MACRO=_PURGE_CHECK_CFG VARIABLE=ignore_missing_sensor VALUE=True
RESPOND MSG="PURGE_CHECK: an unavailable bd_pressure is ignored until the print ends (purges are not checked for pressure then)"
{% else %}
SET_GCODE_VARIABLE MACRO=_PURGE_CHECK_CFG VARIABLE=ignore_missing_sensor VALUE=False
RESPOND MSG="PURGE_CHECK: an unavailable bd_pressure fails the check again"
{% endif %}
+3
View File
@@ -257,6 +257,9 @@ gcode:
M221 S100 M221 S100
BED_MESH_CLEAR BED_MESH_CLEAR
SET_SKEW CLEAR=1 SET_SKEW CLEAR=1
{% if 'gcode_macro _PURGE_CHECK_CFG' in printer %}
SET_GCODE_VARIABLE MACRO=_PURGE_CHECK_CFG VARIABLE=ignore_missing_sensor VALUE=False
{% endif %}
# Retract/unretract that is remembered across prints and restarts. # Retract/unretract that is remembered across prints and restarts.
# Klipper's G10 only retracts once until a G11, and nothing sends G11 here, # Klipper's G10 only retracts once until a G11, and nothing sends G11 here,