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

75 lines
No EOL
3.8 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..."
# Home the printer, set absolute positioning and update the Stealthburner LEDs.
BED_MESH_CLEAR # Clear old saved bed mesh (if any)
{% if "xyz" not in printer.toolhead.homed_axes %}
RESPOND PREFIX="PRINT_START: " MSG="Homing all axes"
LEDS_STATUS_HOMING # Set LEDs to homing-mode
G28 # Full home (XYZ)
{% endif %}
G90 # Absolute position
# Check if the bed temp is higher than 90c - if so then trigger a heatsoak.
{% if target_bed > 90 %}
RESPOND PREFIX="PRINT_START: " MSG="Heating bed to: {target_bed}c"
LEDS_STATUS_HEATING
# Turn on the bed fans here.... once they exist.
# #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
RESPOND PREFIX="PRINT_START: " MSG="Heat soking until chamber temperature reaches: {target_chamber}"
# uncoment below once real
# TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={target_chamber} # Waits for chamber temp
{% 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
RESPOND PREFIX="PRINT_START: " MSG="Waiting for bed to fully soak to temperature [5 mins]"
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
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