Skip to content

Instantly share code, notes, and snippets.

@Bunny350
Last active January 15, 2025 06:49
Show Gist options
  • Select an option

  • Save Bunny350/eaf623df3c16872108da747738e4cefc to your computer and use it in GitHub Desktop.

Select an option

Save Bunny350/eaf623df3c16872108da747738e4cefc to your computer and use it in GitHub Desktop.
Wait heat bed to cool down before completing print - based of Voron Tap wait to cool downs
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice
description: Complete printing macro
gcode:
# safe anti-stringing move coords
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
{% set BED_COOLDOWN_TEMP = 60 %}
{% set BED_REPORTED_TEMP = printer.heater_bed.temperature %}
SAVE_GCODE_STATE NAME=STATE_PRINT_END
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-5.0 F1800 ; retract filament
TURN_OFF_HEATERS
G90 ; absolute positioning
G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
{% if BED_REPORTED_TEMP > BED_COOLDOWN_TEMP %}
{ action_respond_info('Heater bed too hot to touch, reported %.1fC , waiting for cooldown to %.1fC to complete' % (BED_REPORTED_TEMP, BED_COOLDOWN_TEMP)) }
M117 Bed cooling
TEMPERATURE_WAIT SENSOR=heater_bed MAXIMUM={ BED_COOLDOWN_TEMP }
{% endif %}
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
M107 ; turn off fan
M117
BED_MESH_CLEAR
M18 ; Shutdown steppers to stop making heat
RESTORE_GCODE_STATE NAME=STATE_PRINT_END
STATUS_READY
# Other variables above
{% set BED_COOLDOWN_TEMP = 60 %}
{% set BED_REPORTED_TEMP = printer.heater_bed.temperature %}
# Steps to move toolhead away to prevent string above
{% if BED_REPORTED_TEMP > BED_COOLDOWN_TEMP %}
{ action_respond_info('Heater bed too hot to touch, reported %.1fC , waiting for cooldown to %.1fC to complete' % (BED_REPORTED_TEMP, BED_COOLDOWN_TEMP)) }
M117 Bed cooling
TEMPERATURE_WAIT SENSOR=heater_bed MAXIMUM={ BED_COOLDOWN_TEMP }
{% endif %}
# Park toolhead steps below
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment