Skip to content

Commit

Permalink
Merge pull request #666 from mjonuschat/feature/hotend-off-on-pause
Browse files Browse the repository at this point in the history
feat: Turn off hotend on pause
  • Loading branch information
Frix-x authored Jan 6, 2025
2 parents 2e10580 + 61a73f2 commit dc01ae0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 15 additions & 0 deletions macros/base/pause_resume.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Pause the print and park
gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set light_intensity_start_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_start_print %}
{% set turn_off_extruder = printer["gcode_macro _USER_VARIABLES"].turn_off_extruder_on_pause %}

{% if printer.pause_resume.is_paused %}
RESPOND MSG="Print is already paused"
Expand All @@ -12,19 +13,27 @@ gcode:
{% if light_enabled %}
LIGHT_ON S={light_intensity_start_print}
{% endif %}

BASE_PAUSE
PARK

{% if turn_off_extruder %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=extruder_target_temp VALUE={printer.extruder.target}
M104 S0
{% endif %}
{% endif %}


[gcode_macro RESUME]
rename_existing: BASE_RESUME
description: Resume the print after an optional unretract
variable_extruder_target_temp: 0
gcode:
{% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed %}
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %}
{% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %}
{% set turn_off_extruder = printer["gcode_macro _USER_VARIABLES"].turn_off_extruder_on_pause %}

{% if not printer.pause_resume.is_paused %}
RESPOND MSG="Print is not paused. Resume ignored"
Expand All @@ -38,9 +47,15 @@ gcode:
{% else %}
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St}
{% endif %}

{% if light_enabled %}
LIGHT_ON S={light_intensity_printing}
{% endif %}

{% if turn_off_extruder and extruder_target_temp > 0 %}
M109 S{extruder_target_temp|int}
{% endif %}

BASE_RESUME
{% endif %}

Expand Down
9 changes: 6 additions & 3 deletions user_templates/variables.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ variable_brush_clean_accel: 1500
variable_probe_dock_accel: 2000


#################################################
# Homing, start_print and end_print variables
#################################################
#####################################################
# Homing, start_print, end_print and pause variables
#####################################################

## Physical Z endstop pin position. This variable is used only if
## you don't use the automatic z_calibration plugin: if this plugin is
Expand Down Expand Up @@ -71,6 +71,9 @@ variable_disable_motors_in_end_print: False
## Automatically turn-off heaters in the END_PRINT macro
variable_turn_off_heaters_in_end_print: True

## Automatically turn-off the extruder/hotend when a print job is paused
variable_turn_off_extruder_on_pause: False

## Automatically reset velocity limits to configured values in the END_PRINT macro
variable_reset_velocity_limits_in_end_print: True

Expand Down

0 comments on commit dc01ae0

Please sign in to comment.