Skip to content

Commit 371d0dc

Browse files
committed
add more variables and better start integration
1 parent 4aa57dc commit 371d0dc

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

config/hardware/filters/controllable_exhaust_filter.cfg

-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[gcode_macro _USER_VARIABLES]
2-
variable_startprint_actions: "bed_soak", "extruder_preheating", "chamber_soak", "clean", "tilt_calib", "z_offset", "custom1", "bedmesh", "extruder_heating", "purge", "clean", "primeline"
32
variable_exhaust_enabled: True
43
variable_exhaust_name: "exhaust"
54
gcode: # do not remove this line
@@ -16,15 +15,6 @@ gcode:
1615
{% set exhaust_name = printer["gcode_macro _USER_VARIABLES"].exhaust_name %}
1716
SET_FAN_SPEED FAN={exhaust_name} SPEED={SPEED}
1817

19-
[gcode_macro _MODULE_CUSTOM1]
20-
gcode:
21-
{% set verbose = printer["gcode_macro _USER_VARIABLES"].verbose %}
22-
{% set exhaust_filter_speed = printer["gcode_macro _USER_VARIABLES"].exhaust_filter_speed|default(0.3)|float %}
23-
24-
{% if verbose %}
25-
RESPOND MSG="Start exhaust fan."
26-
{% endif %}
27-
START_EXHAUST SPEED={exhaust_filter_speed}
2818

2919
[gcode_macro STOP_EXHAUST]
3020
gcode:

macros/base/start_print.cfg

+14
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ gcode:
6464
{% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %}
6565
{% set firmware_retraction_enabled = printer["gcode_macro _USER_VARIABLES"].firmware_retraction_enabled %}
6666
{% set filter_enabled = printer["gcode_macro _USER_VARIABLES"].filter_enabled %}
67+
{% set exhaust_enabled = printer["gcode_macro _USER_VARIABLES"].exhaust_enabled %}
68+
{% set exhaust_filter_speed = printer["gcode_macro _USER_VARIABLES"].exhaust_filter_speed|default(30)|int %}
6769
{% set filament_sensor_enabled = printer["gcode_macro _USER_VARIABLES"].filament_sensor_enabled %}
6870
{% set part_fan_tach_enabled = printer["gcode_macro _USER_VARIABLES"].part_fan_tach_enabled %}
6971
{% set hotend_fan_tach_enabled = printer["gcode_macro _USER_VARIABLES"].hotend_fan_tach_enabled %}
@@ -104,6 +106,14 @@ gcode:
104106
STOP_FILTER
105107
{% endif %}
106108

109+
# If a exhaust filter is enabled and already running due to a print that just finished, we stop
110+
# it now and deactivate the pending delayed gcode that could be running. The filter
111+
# could be restarted later in the START_PRINT sequence depending of the parameters
112+
{% if exhaust_enabled %}
113+
UPDATE_DELAYED_GCODE ID=_STOP_EXHAUST_DELAYED DURATION=0
114+
STOP_EXHAUST
115+
{% endif %}
116+
107117
# If a tachometer is enabled on one of the fans, we check them:
108118
# - It's done only once for the part fan to be sure nothing block it before starting the print
109119
# - And as a safety feature, we start a monitoring loop for the hotend fan (that is automatically stopped at the end of a print)
@@ -208,6 +218,10 @@ gcode:
208218
{% if filter_enabled %}
209219
START_FILTER SPEED={material.filter_speed / 100}
210220
{% endif %}
221+
{% if exhaust_enabled %}
222+
{% set exhaust_speed = material.exhaust_speed|default(exhaust_filter_speed)|int %}
223+
START_EXHAUST SPEED={exhaust_speed / 100}
224+
{% endif %}
211225

212226
{% if filament_sensor_enabled %}
213227
SET_FILAMENT_SENSOR SENSOR="runout_sensor" ENABLE=0

user_templates/variables.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ variable_mmu_check_errors_on_start_print: False # Set to True if you want an ea
221221

222222
variable_filter_default_time_on_end_print: 600 # seconds
223223
variable_exhaust_filter_default_time_on_end_print: 600 # seconds
224-
variable_exhaust_filter_speed: 0.3 # percent
224+
variable_exhaust_filter_speed: 30 # percent
225225

226226
################################################
227227
# Other hardware options used in the macros

0 commit comments

Comments
 (0)