-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcancel_print.cfg
54 lines (51 loc) · 1.54 KB
/
cancel_print.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
[gcode_macro CANCEL_PRINT]
#
# CANCEL_PRINT
#
# Move the print head to the middle rear of the bed and perform a 4mm retraction
description: Cancel the currently running print
rename_existing: BASE_CANCEL_PRINT
gcode:
M117 Cancelling...
{% set x_mid = printer.toolhead.axis_maximum.x|float / 2.0 %}
{% set y_max = printer.toolhead.axis_maximum.y|float %}
{% set z_max = printer.toolhead.axis_maximum.z|float %}
# SET_SKEW CLEAR=1
STATUS_BUSY
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set z_safe = z_max * 0.66 %}
{% if act_z > z_safe %}
{% set z_safe = act_z %}
{% endif %}
G90
G1 X{x_mid} Y0 Z{z_safe}
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract filament
M84 ; disable steppers
TURN_OFF_HEATERS
M106 S0
CLEAR_PAUSE
SDCARD_RESET_FILE
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=10
STATUS_READY
{% if printer.configfile.config["bed_mesh"] %}
BED_MESH_CLEAR
{% endif %}
{% if printer['fan_generic exhaust_fan'] %}
STOP_TEMP_MONITOR
SET_FAN_SPEED FAN=exhaust_fan SPEED=1.0
FAN_DELAY FAN=exhaust_fan DELAY=300
{% else %}
M118 No exhaust fan configured
{% endif %}
{% if printer['fan_generic cooling_fan'] %}
SET_FAN_SPEED FAN=cooling_fan SPEED=1.0
FAN_DELAY FAN=cooling_fan DELAY=300
{% else %}
M118 No cooling fan configured
{% endif %}
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=60
M117 Print cancelled
BASE_CANCEL_PRINT