-
Notifications
You must be signed in to change notification settings - Fork 1
/
macros.cfg
156 lines (141 loc) · 3.94 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
[gcode_macro auto_align_z]
description: Use ABL to align X gantry Z
gcode:
G28
Z_TILT_ADJUST
G91
G1 F7500 X115
[gcode_macro bltouch_reset]
description: Reset BLTouch
gcode:
BLTOUCH_DEBUG COMMAND=reset
BLTOUCH_DEBUG COMMAND=pin_up
BLTOUCH_DEBUG COMMAND=pin_down
BLTOUCH_DEBUG COMMAND=pin_up
[gcode_macro CANCEL_PRINT]
description: Cancel the running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:
## Move head and retract only if not already in the pause state and park set to true
{% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
[gcode_macro PAUSE]
description: Pause the running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL
[gcode_macro RESUME]
description: Resume the running print
rename_existing: RESUME_BASE
gcode:
##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
{% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
#### 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' %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:
##### 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 %}
{% set z_park_delta = 2.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 - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro bed_tramming]
gcode:
G28
BED_SCREWS_ADJUST
[gcode_macro tram_ok]
gcode:
ACCEPT
[gcode_macro tram_adjust]
gcode:
ADJUSTED
[gcode_macro tram_done]
gcode:
ABORT
[gcode_macro filament_load]
gcode:
M104 T0 S210
G28
G91
G1 X-40 F6000 ; centre
G1 Z+20 F1000 ; raise hot-end
M109 T0 S215
M83
G1 E140 F300
G4 P2000 ; 2s purging time
G1 E30 F10
G90
{action_respond_info("Purging filament 10s")}
G4 P10000 ; 10s purging time
M104 T0 S0
{action_respond_info("Load complete")}
[gcode_macro filament_unload]
gcode:
M104 T0 S210
G28 ; home toolhead
G91
G1 X-40 F6000 ; centre
M109 T0 S210 ; wait until temp reached
M83
{action_respond_info("Retracting filament")}
G1 E7 F300 ; push into meltzone
G4 P1000 ; wait 1 second
G1 E-80 F400 ; retract
G90
M104 T0 S0 ; turn off hotend
[force_move]
enable_force_move: true ; enable FORCE_MOVE and SET_KINEMATIC_POSITION
[gcode_macro REBOOT]
gcode:
{action_call_remote_method("reboot_machine")}
[gcode_macro SHUTDOWN]
gcode:
{action_call_remote_method("shutdown_machine")}
[gcode_macro _TOGGLE_RELAY1]
gcode:
SET_PIN PIN=relay1 VALUE={(not printer["output_pin relay1"].value)|int}