From 1dcbc50bf6db7faf8f7a959483105b8fa5534356 Mon Sep 17 00:00:00 2001 From: MangaValk Date: Fri, 6 Nov 2026 16:18:38 +0100 Subject: [PATCH] Bed fans off during prints without a heated chamber, remove unused bed PID With the chamber open the bed fans only blow room air past the bed. PRINT_WARMUP sets print_fans_off for CHAMBER 30 or less, _PRINT_CLEANUP clears it. Chamber prints, the cooldown and heating the bed outside a print are unchanged. The PID values in PRINT_WARMUP never took effect: the SET_HEATER_TEMPERATURE override in bed_fans.cfg only passes on the target. The bed keeps its config values; the misleading console messages are gone. Tested with rendered macros only, not yet on the printer. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- macros/heating/bed_fans.cfg | 26 +++++++++++++++++--------- macros/print/print_start_end.cfg | 13 ++++++------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3465a86..2bc1755 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ everything below, grouped by topic. Comment out what you do not use there. | **heating/** | | | | `heat_soak.cfg` | `HEAT_SOAK`, `STOP_HEAT_SOAK`, `CANCEL_HEAT_SOAK`, `HEAT_SOAK_RESUME`, `RESUME` | — | | `soak_my_bed.cfg` | `SOAK_MY_BED` (homes and levels first) | soak-my-bed | -| `bed_fans.cfg` | Bed fans through `SET_HEATER_TEMPERATURE`/`M190`/`M140`/`TURN_OFF_HEATERS` overrides | `[fan_generic BedFans]` | +| `bed_fans.cfg` | Bed fans through `SET_HEATER_TEMPERATURE`/`M190`/`M140`/`TURN_OFF_HEATERS` overrides; off during a print without a heated chamber (`PRINT_WARMUP CHAMBER=` 30 or less), on during the cooldown after any print | `[fan_generic BedFans]` | | `chamber_iheater.cfg` | iHeater MCU, heater and sensors, `M141`, `M191`, `iHEATER_ON`, `iHEATER_OFF` | iHeater chamber heater | | `filament_drying.cfg` | `START_DRYING`, `STOP_DRYING`, `STATUS_DRYING` | bed fans, chamber heater (optional) | | **afc/** | | | diff --git a/macros/heating/bed_fans.cfg b/macros/heating/bed_fans.cfg index 4f8c064..9d5b6bb 100644 --- a/macros/heating/bed_fans.cfg +++ b/macros/heating/bed_fans.cfg @@ -1,4 +1,9 @@ # Bed fans driven by the bed heater (based on Ellis' bed fan macros) +# +# During a print without a heated chamber the fans stay off while the bed heats, +# soaks and prints: with the chamber open they only blow room air past the bed. +# PRINT_WARMUP sets print_fans_off, _PRINT_CLEANUP clears it. The cooldown after +# the print and heating the bed outside a print are not affected. ############### Config options ################## @@ -7,6 +12,7 @@ variable_threshold: 50 # If bed temp target is above this threshold, fans will variable_fast: 1.0 # Fan speed once bed temp is reached variable_slow: 0.5 # Fan speed while bed is heating variable_cooldown_temp: 40 # NEW: fans stop below this temp +variable_print_fans_off: False # set by PRINT_WARMUP for a print without a heated chamber gcode: ########## Aliases ######### @@ -41,7 +47,8 @@ gcode: # Vars {% set THRESHOLD = printer["gcode_macro _BEDFANVARS"].threshold|int %} {% set COOLDOWN = printer["gcode_macro _BEDFANVARS"].cooldown_temp|int %} - + {% set FANS_OFF = printer["gcode_macro _BEDFANVARS"].print_fans_off %} + {% if HEATER|lower == "extruder" %} M104 S{TARGET} @@ -67,13 +74,13 @@ gcode: # Stop normal heating loop if running UPDATE_DELAYED_GCODE ID=bedfanloop DURATION=0 - {% elif TARGET >= THRESHOLD %} + {% elif TARGET >= THRESHOLD and not FANS_OFF %} # Heating above threshold BEDFANSSLOW UPDATE_DELAYED_GCODE ID=bedfanloop DURATION=1 {% else %} - # Low temp request + # Low temp request, or a print without a heated chamber BEDFANSOFF UPDATE_DELAYED_GCODE ID=bedfanloop DURATION=0 {% endif %} @@ -93,9 +100,10 @@ gcode: {% set S = params.S|int %} # Vars {% set THRESHOLD = printer["gcode_macro _BEDFANVARS"].threshold|int %} - - {% if S >= THRESHOLD %} - BEDFANSSLOW # >= Threshold temp: Low speed fans while heating + {% set FANS_ON = S >= THRESHOLD and not printer["gcode_macro _BEDFANVARS"].print_fans_off %} + + {% if FANS_ON %} + BEDFANSSLOW # >= Threshold temp: Low speed fans while heating {% else %} BEDFANSOFF # < Threshold temp: Turn bed fans off {% endif %} @@ -109,8 +117,8 @@ gcode: {% endif %} # Post-heating fan speeds - {% if S >= THRESHOLD %} - BEDFANSFAST # >= Threshold temp: Higher speed fans after heating finished + {% if FANS_ON %} + BEDFANSFAST # >= Threshold temp: Higher speed fans after heating finished {% endif %} # Replace M140 (Set Bed Temperature) to just be an alias of SET_HEATER_TEMPERATURE (which has associated bed fan logic if enabled) @@ -152,7 +160,7 @@ gcode: # Vars {% set THRESHOLD = printer["gcode_macro _BEDFANVARS"].threshold|int %} - {% if printer.heater_bed.target >= THRESHOLD %} # Continue only if target temp greater than threshold. + {% if printer.heater_bed.target >= THRESHOLD and not printer["gcode_macro _BEDFANVARS"].print_fans_off %} # Continue only if target temp greater than threshold. {% if printer.heater_bed.temperature|int >= (printer.heater_bed.target|int - 1) %} BEDFANSFAST # If within 1 degree of target temp: Higher speed fans {% else %} diff --git a/macros/print/print_start_end.cfg b/macros/print/print_start_end.cfg index 76ee3ef..1bb3dae 100644 --- a/macros/print/print_start_end.cfg +++ b/macros/print/print_start_end.cfg @@ -40,14 +40,12 @@ gcode: SKEW_PROFILE LOAD=Califlower M106 S0 + # Bed fans only help to heat a closed chamber: off for this print without + # one (heating/bed_fans.cfg). Set before the bed target, which reads it. + SET_GCODE_VARIABLE MACRO=_BEDFANVARS VARIABLE=print_fans_off VALUE={target_chamber <= 30} + # Bed first, so it heats during the rest of the warmup - {% if target_bed < 60 %} - RESPOND MSG="Using PID for <60°C bed" - SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={target_bed} PID_KP=33.606 PID_KI=0.694 PID_KD=407.058 - {% else %} - RESPOND MSG="Using PID for ≥60°C bed" - SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={target_bed} pid_Kp=46.843 pid_Ki=2.002 pid_Kd=274.034 - {% endif %} + SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={target_bed} # Only to get the toolhead over the bed for the soak; the Z that counts # is the contact calibration in PRINT_START on the soaked bed @@ -347,6 +345,7 @@ description: Heaters (incl. chamber heater) and part fan off, flow back to 100%, gcode: _GUARD_OFF ; a print start that failed while it was armed _BED_CHECK_RESET ; cancelled while the bed check had it paused + SET_GCODE_VARIABLE MACRO=_BEDFANVARS VARIABLE=print_fans_off VALUE=False TURN_OFF_HEATERS iHEATER_OFF ; stops the chamber heater control loop too M107