forked from Nathan22211/Z9V5-mixing-klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.cfg
93 lines (85 loc) · 2.84 KB
/
macros.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park_x2: 150 # try half your bed size.
variable_park_y2: 300
variable_z_lift2: 10
variable_velocity2: 60
variable_retract2: 0.5
gcode:
TURN_OFF_HEATERS
# safe park coords
{% set th = printer.toolhead %}
{% set park_x2 = [params.X|default(park_x2)|int, th.axis_maximum.x-2]|min %}
{% set park_y2 = [params.Y|default(park_y2)|int, th.axis_maximum.y-10]|min %}
{% set park_z2 = [th.position.z + params.Z_LIFT|default(z_lift2)|int, th.axis_maximum.z]|min %}
{% set park_feedrate2 = params.VELOCITY|default(velocity2)|int * 60 %}
G91
G1 E-{retract2} F3000
# park toolhead
G90
G0 X{park_x2} Y{park_y2} Z{park_z2} F{park_feedrate2}
CANCEL_PRINT_BASE
# End of gcode script
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro BED_PID_60]
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=60
[gcode_macro EXTRUDER_PID_200]
gcode:
M106 S179
PID_CALIBRATE HEATER=extruder TARGET=200