Skip to content

Commit

Permalink
MACRO: fix toolhead standby (#321)
Browse files Browse the repository at this point in the history
* MACRO: fix toolhead standby
  • Loading branch information
HelgeKeck authored Dec 9, 2024
1 parent 2367644 commit 2bb5581
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions macros/idex/idex.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions macros/idex/toolheads.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand Down

0 comments on commit 2bb5581

Please sign in to comment.