From 2bb5581f94e44e386098b09059b6220b491934a1 Mon Sep 17 00:00:00 2001 From: HelgeKeck Date: Mon, 9 Dec 2024 16:38:20 +0100 Subject: [PATCH] MACRO: fix toolhead standby (#321) * MACRO: fix toolhead standby --- macros/idex/idex.cfg | 9 +++++++-- macros/idex/toolheads.cfg | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/macros/idex/idex.cfg b/macros/idex/idex.cfg index 01bece32b..0b844bb8d 100644 --- a/macros/idex/idex.cfg +++ b/macros/idex/idex.cfg @@ -514,12 +514,17 @@ gcode: # deactivate old toolhead _DEACTIVATE_TOOLHEAD TOOLHEAD={old_toolhead} + # get extruder temperatures + {% set extruder_first_layer_temp = (printer["gcode_macro START_PRINT"].extruder_first_layer_temp|default("")).split(",") %} + {% set extruder_other_layer_temp = (printer["gcode_macro START_PRINT"].extruder_other_layer_temp|default("")).split(",") %} + # wait for new extruder to heat up {% if printer["gcode_macro _ON_LAYER_CHANGE"].layer_number|int < 2 %} - {% set extruder_temp = printer["gcode_macro START_PRINT"].extruder_first_layer_temp[new_toolhead]|float %} + {% set extruder_temp = extruder_first_layer_temp[new_toolhead]|float %} {% else %} - {% set extruder_temp = printer["gcode_macro START_PRINT"].extruder_other_layer_temp[new_toolhead]|float %} + {% set extruder_temp = extruder_other_layer_temp[new_toolhead]|float %} {% endif %} + SET_HEATER_TEMPERATURE HEATER={'extruder' if new_toolhead == 0 else 'extruder1'} TARGET={extruder_temp} TEMPERATURE_WAIT SENSOR={'extruder' if new_toolhead == 0 else 'extruder1'} MINIMUM={extruder_temp} MAXIMUM={extruder_temp + 5} # preextrude filament diff --git a/macros/idex/toolheads.cfg b/macros/idex/toolheads.cfg index d84ab8c86..f981cec65 100644 --- a/macros/idex/toolheads.cfg +++ b/macros/idex/toolheads.cfg @@ -252,13 +252,18 @@ gcode: {% set square_corner_velocity = printer.toolhead.square_corner_velocity|float %} SET_VELOCITY_LIMIT ACCEL={acceleration} MINIMUM_CRUISE_RATIO=0 SQUARE_CORNER_VELOCITY=20 + # get extruder temperatures + {% set extruder_first_layer_temp = (printer["gcode_macro START_PRINT"].extruder_first_layer_temp|default("")).split(",") %} + {% set extruder_other_layer_temp = (printer["gcode_macro START_PRINT"].extruder_other_layer_temp|default("")).split(",") %} + # set new toolhead temperature {% if needs_wakeup %} {% if printer["gcode_macro _ON_LAYER_CHANGE"].layer_number|int < 2 %} - {% set temp = printer["gcode_macro START_PRINT"].extruder_first_layer_temp[toolhead]|float %} + {% set temp = extruder_first_layer_temp[toolhead]|float %} {% else %} - {% set temp = printer["gcode_macro START_PRINT"].extruder_other_layer_temp[toolhead]|float %} + {% set temp = extruder_other_layer_temp[toolhead]|float %} {% endif %} + SET_HEATER_TEMPERATURE HEATER={'extruder' if toolhead == 0 else 'extruder1'} TARGET={temp} TEMPERATURE_WAIT SENSOR={'extruder' if toolhead == 0 else 'extruder1'} MINIMUM={temp} MAXIMUM={temp + 5} {% endif %}