From 098700934e645bfceea0899fac108569fc3cb699 Mon Sep 17 00:00:00 2001 From: pi Date: Mon, 21 Apr 2025 12:39:04 +1000 Subject: [PATCH] m_m106_adjust.cfg modified - 21/04/25 - 12:39:00 --- .../config/~UNUSED~/m_m106_adjust.cfg | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 printer_data/config/~UNUSED~/m_m106_adjust.cfg diff --git a/printer_data/config/~UNUSED~/m_m106_adjust.cfg b/printer_data/config/~UNUSED~/m_m106_adjust.cfg deleted file mode 100644 index 425053f..0000000 --- a/printer_data/config/~UNUSED~/m_m106_adjust.cfg +++ /dev/null @@ -1,53 +0,0 @@ -[gcode_macro M106] -rename_existing: G106 -description: Compresses fan speeds into 10–30% range if bed temp ≥ 70°C - -# === OVERVIEW === -# This macro overrides the default M106 behavior to apply a thermal-aware fan speed limiter. -# When the bed temperature is at or above 70°C, it compresses the part cooling fan speed range -# into a safer 10–30% range (i.e., 26–76 PWM) to reduce warping or delamination in high-temp materials. -# -# === WHY USE THIS === -# - Prevents excessive part cooling when printing materials like ABS, ASA, or PC. -# - Helps maintain stable chamber temperatures and reduce thermal shock. -# - Minimizes curling or layer splitting due to sudden cooling on hot beds. -# -# === HOW TO USE === -# Simply use M106 S as usual in your G-code or slicer. -# The macro will automatically adjust the fan speed if needed based on bed temperature. -# -# === NOTES === -# - This logic only applies when the bed temperature is 70°C or higher. -# - Below 70°C, full-range fan control is allowed. -# - You can customize the input/output compression range if needed. - -# === PARAMETERS === -# S: Standard fan speed in 0–255 (required by M106) - -# Internal constants: -# min_input = 26 (10% of 255) -# max_input = 255 (100%) -# min_output = 26 (10%) -# max_output = 76 (30%) - -gcode: - {% set fan_speed = params.S|default(0)|int %} - {% set bed_temp = printer["heater_bed"].temperature %} - {% set min_input = 26 %} - {% set max_input = 255 %} - {% set min_output = 26 %} - {% set max_output = 76 %} - - {% if bed_temp >= 70 %} - # If below threshold, limit fan to the lower compressed range (10–30%) - {% if fan_speed < min_input %} - {% set compressed_speed = min_output %} - {% else %} - {% set compressed_speed = (min_output + ((fan_speed - min_input) * (max_output - min_output) / (max_input - min_input)))|int %} - {% endif %} - G106 S{compressed_speed} - {% else %} - # Below threshold, allow full fan speed as requested - G106 S{fan_speed} - {% endif %} -