From 720ad095f0d3a007894c88ab356af3595c47c214 Mon Sep 17 00:00:00 2001 From: Bassam Husain Date: Sat, 17 May 2025 22:32:43 -0400 Subject: [PATCH] Merge bedtempNotExact into master. --- .vscode/settings.json | 14 ++++++++++++++ cfgs/misc-macros.cfg | 24 +++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 06e7bc3..62f90bd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -67,4 +67,18 @@ "titleBar.inactiveForeground": "#e7e7e799" }, "peacock.color": "#512e0a" + // "[html][jinja][jinja-html]": { + // "editor.formatOnSave": false, + // "editor.defaultFormatter": "monosans.djlint", + // "editor.detectIndentation": true, + // "editor.linkedEditing": true, + // "editor.tabSize": 4, + + // "djlint.enableLinting": true, + // "djlint.profile": "jinja" + // }, + // "djlint.showInstallError": true, + // "djlint.useVenv": false, + // "djlint.pythonPath": "/home/bassam/.local/share/uv/tools", + // "djlint.formatLanguages": ["django-html", "jinja", "jinja-html"] } diff --git a/cfgs/misc-macros.cfg b/cfgs/misc-macros.cfg index 02727c0..14e8f27 100644 --- a/cfgs/misc-macros.cfg +++ b/cfgs/misc-macros.cfg @@ -29,9 +29,11 @@ gcode: SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 [gcode_macro _globals] +# NOTE 0 = false; 1 = true variable_filament_sensor_enabled: 0 # NOTE Enable(1) or disable(0) the filament sensor, if one is connected variable_beeping_enabled: 1 # NOTE Enable(1) or disable(0) beeping everywhere except during gantry calibration variable_bed_temp_over: 10 # NOTE Start print if bed temperature is over by this amount, otherwise wait for temperature drop +variable_bed_temp_not_exact: 1 # NOTE Start print if bed temperature is `target temperature - 1` but continue to heat until target is reached variable_kamp_enable: 0 # NOTE Enable(1) or disable(0) KAMP (adaptive mesh) variable_pre_purge_prime_length: 1.40 gcode: @@ -75,12 +77,20 @@ gcode: [gcode_macro M190] rename_existing: M99190 gcode: - #Parameters + # Global variables/settings + {% set bedtempNotExact = printer["gcode_macro _globals"].bed_temp_not_exact|default(1)|int %} + + # Parameters {% set s = params.S|float %} M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set bed temp {% if s != 0 %} - TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree) + {% if bedtempNotExact == 1 %} + TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-1} MAXIMUM={s+1} ; set & wait for bed temp (within -1 or +1 degree) + M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; set & don't wait for bed temp + {% else %} + TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within +1 degree) + {% endif %} {% endif %} [gcode_macro PURGE_LINE] @@ -97,7 +107,7 @@ gcode: # Set safe speeds {% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %} - {% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %} + {% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %} G92 E0.0 ; reset extruder G90 ; Absolute positioning @@ -132,7 +142,7 @@ gcode: {% set bedtempSlicer = bedtemp %} {% set bedtempOver = printer["gcode_macro _globals"].bed_temp_over|default(0)|int %} {% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %} - {% set maxVelocityAdjusted = (0.90 * maxVelocity * 60)|int %} + {% set maxVelocityAdjusted = (0.90 * maxVelocity * 60)|int %} {% set kampEnabled=printer["gcode_macro _globals"].kamp_enable|default(0)|int %} {% if printer.configfile.settings.safe_z_home %} @@ -195,8 +205,8 @@ gcode: # Set safe speeds {% set zVelocity = printer.configfile.settings.printer.max_z_velocity|default(15)|int %} {% set maxVelocity = printer.configfile.settings.printer.max_velocity|default(200)|int %} - {% set zVelocityAdjusted = (0.95 * zVelocity * 60)|int %} - {% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %} + {% set zVelocityAdjusted = (0.95 * zVelocity * 60)|int %} + {% set maxVelocityAdjusted = (0.95 * maxVelocity * 60)|int %} # Get Boundaries {% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %} @@ -326,4 +336,4 @@ gcode: G4 P{dur} SET_PIN PIN=beeper VALUE=0 G4 P{dur} - {% endfor %} \ No newline at end of file + {% endfor %}