vzbot330-klipper/basic_macros.cfg
2024-05-12 18:16:09 -07:00

149 lines
3.9 KiB
INI

[gcode_macro PRINT_START]
gcode:
# Parameters
{% set bedTemp = params.BED|int %}
{% set hotendTemp = params.HOTEND|int %}
{% set DWELL = params.DWELL|default(300)|int %}
{% set X = 200 %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={hotendTemp|float*0.8} # set extruder pre warm temp
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bedTemp} # set bed temp to warm while starting up
G28 # home after setting temps
SET_DISPLAY_TEXT MSG="Waiting for temperatures..."
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bedTemp} MAXIMUM={bedTemp+1} ; Wait for bed temp (within 1 degree)
HEATSOAK DWELL={DWELL} # Dwelling
#ATTACH_PROBE # Have probe ready for calibration
CLEAN_NOZZLE # Clean before getting offsets
G28 Z
#BED_MESH_CALIBRATE
#CALIBRATE_Z # Auto calibrate the bed height
GO_TO_BUCKET # No cleanup from nozzle ooze
SET_DISPLAY_TEXT MSG="Waiting for final temperatures..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={hotendTemp} # Set extruder to printing temperature
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={hotendTemp} MAXIMUM={hotendTemp+3} ; Wait for hotend temp (within 3 degrees)
CLEAN_NOZZLE # Final clean before print
SET_DISPLAY_TEXT MSG="Print starting"
G90
G1 X{X} F{1000*60} # Avoid brush
G91
[gcode_macro PRINT_END]
gcode:
SAFE_RETRACT
M106 S0 # Part fan off
TURN_OFF_HEATERS
GO_TO_BUCKET
BED_MESH_CLEAR
DISABLE_MOTORS
[gcode_macro HEATSOAK]
gcode:
SET_DISPLAY_TEXT MSG="Waiting for thermal expansion..."
G4 P{params.DWELL|int*1000/4}
SET_DISPLAY_TEXT MSG="Waiting for thermal expansion 25% done"
G4 P{params.DWELL|int*1000/4}
SET_DISPLAY_TEXT MSG="Waiting for thermal expansion 50% done"
G4 P{params.DWELL|int*1000/4}
SET_DISPLAY_TEXT MSG="Waiting for thermal expansion 75% done"
G4 P{params.DWELL|int*1000/4}
SET_DISPLAY_TEXT MSG="Thermal expansion done"
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
M104 S0
M140 S0
M106 S0 # Part fan off
G91 E-2
CLEAR_PAUSE
BASE_CANCEL_PRINT
SDCARD_RESET_FILE
M221 S100
BED_MESH_CLEAR
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
#Edit this#
{% set Z = 2 %}
###########
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
SAFE_RETRACT
G1 Z{Z}
GO_TO_BUCKET
G91
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
#Edit this#
{% set Z = 10 %}
###########
CLEAN_NOZZLE
G91
G1 Z{Z}
G91
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro UNLOAD_FILAMENT]
gcode:
M118 Filament unloading!
M117 Filament unloading!
M82 #set extruder to absolute mode
G92 E0
{% if printer.extruder.can_extrude|lower != 'true' %} # checing for minimum extrusion temperature
# check if temperature is over the minimum extrusion temp. min_extrude_temp must be defined in the extruder config (to about 185)
M118 Hotend heating!
M109 S235 T0 # set temperature and wait
{% endif %}
G1 E10 F{5*60} # extrude a little to soften tip
G0 E-5 F{60*60} # extract filament to cold end
G0 E-70 F{5*60} # continue extraction slow allow filament to be cooled enough before reaches the gears
M400
M118 Filament unload complete!
M117 Filament unload complete!
[gcode_macro M600]
gcode:
PAUSE
[gcode_macro DISABLE_MOTORS]
gcode:
M18
[idle_timeout]
gcode:
TURN_OFF_HEATERS
DISABLE_MOTORS
[gcode_macro GO_TO_BUCKET]
gcode:
#Edit this#
{% set X = 55 %}
{% set Y = 312 %}
{% set Z = 2 %}
###########
SAFE_RETRACT
G91
G1 Z{Z}
G90
G1 X{X} Y{Y} F{1000*60}
#G1 Y{Y} F{1000*60}
G91
[gcode_macro safe_retract]
gcode:
{% if printer.extruder.can_extrude %}
G10
{% endif %}
[gcode_macro safe_unretract]
gcode:
{% if printer.extruder.can_extrude %}
G11
{% endif %}