artichoke-klipper-backup/printer_data/config/macros/print_start.cfg

74 lines
No EOL
3.9 KiB
INI

[gcode_macro PRINT_START]
gcode:
{% set target_bed = params.BED|int %}
{% set target_extruder = params.EXTRUDER|int %}
{% set target_chamber = params.CHAMBER|default("45")|int %}
{% set x_wait = printer.toolhead.axis_maximum.x|float / 2 %}
{% set y_wait = printer.toolhead.axis_maximum.y|float / 2 %}
RESPOND PREFIX="PRINT_START: " MSG="Preparing printer..."
# Check if the bed temp is higher than 90c - if so then trigger a heatsoak.
{% if target_bed > 90 %}
CANCEL_PRINT
# TODO!
# SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Display info on display
# STATUS_HEATING # Set LEDs to heating-mode
# M106 S255 # Turn on the PT-fan
# ## Uncomment if you have a Nevermore.
# #SET_PIN PIN=nevermore VALUE=1 # Turn on the nevermore
# G1 X{x_wait} Y{y_wait} Z15 F9000 # Go to center of the bed
# M190 S{target_bed} # Set the target temp for the bed
# SET_DISPLAY_TEXT MSG="Heatsoak: {target_chamber}c" # Display info on display
# TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={target_chamber} # Waits for chamber temp
# If the bed temp is not over 90c, then skip the heatsoak and just heat up to set temp with a 5 min soak
{% else %}
RESPOND PREFIX="PRINT_START: " MSG="Heating bed to: {target_bed}c"
LEDS_STATUS_HEATING # Set LEDs to heating-mode
G1 X{x_wait} Y{y_wait} Z15 F9000 # Go to center of the bed
M190 S{target_bed} # Set the target temp for the bed
# SET_DISPLAY_TEXT MSG="Soak for 5 min" # Display info on display
# G4 P300000 # Wait 5 min for the bedtemp to stabilize
{% endif %}
#
# All the calibration bits: Homing & QGL & Meshing
#
RESPOND PREFIX="PRINT_START: " MSG="Heating hotend (for calibration) to: 140c"
LEDS_STATUS_HEATING # Set LEDs to heating-mode
M109 S140 # Heat hotend to 140c
# Home the printer, set absolute positioning and update the Stealthburner LEDs.
BED_MESH_CLEAR # Clear old saved bed mesh (if any)
RESPOND PREFIX="PRINT_START: " MSG="Homing all axes"
LEDS_STATUS_HOMING # Set LEDs to homing-mode
G28 # Full home (XYZ)
G90 # Absolute position
RESPOND PREFIX="PRINT_START: " MSG="Performing QGL"
LEDS_STATUS_LEVELING # Set LEDs to leveling-mode
QUAD_GANTRY_LEVEL # Level the printer via QGL
G28 Z # Home Z again after QGL
RESPOND PREFIX="PRINT_START: " MSG="Creating bed mesh" # Display info on display
LEDS_STATUS_MESHING # Set LEDs to bed mesh-mode
BED_MESH_CALIBRATE # Start the bed mesh (add ADAPTIVE=1) for adaptive bed mesh
RESPOND PREFIX="PRINT_START: " MSG="Smart parking the nozzle"
SMART_PARK # Go to center of the bed
# Heat to target temp
RESPOND PREFIX="PRINT_START: " MSG="Heating hotend (for first layer) to: {target_extruder}c"
LEDS_STATUS_HEATING # Set LEDs to heating-mode
M107 # Turn off partcooling fan
M109 S{target_extruder} # Heat the hotend to set temp
RESPOND PREFIX="PRINT_START: " MSG="Purging nozzle"
LEDS_STATUS_PRINTING
VORON_PURGE
RESPOND PREFIX="PRINT_START: " MSG="Starting the print..."
LEDS_STATUS_PRINTING