forked from jhaury/maker-select-klipper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacros.cfg
255 lines (238 loc) · 10.3 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#----------------------------------------//--------------------------------------------------------
#START/END MACROS
#----------------------------------------//--------------------------------------------------------
[gcode_macro START_PRINT]
gcode:
#Find Extruder and Bed temperatures on Slicer settings and place them below or set them on dashboard
{% set BED_TEMP = params.BED_TEMP|default(75)|float %} ; Slicer Bed Temp PLA = 60 PETG = 75
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(230)|float %} ; Slicer FirstLayer Temp PLA = 205 PETG = 230
SAVE_GCODE_STATE NAME=start_print
#Preheat Bed
M117 Warming Up
M140 S{BED_TEMP} ; Set Bed temp (PLA = 60 PETG = 70)
M109 S{EXTRUDER_TEMP - 10} T0 ; Set temporary nozzle temp of to prevent oozing during homing and auto bed leveling
G4 S10 ; Allow partial nozzle warmup
G90 ; Use absolute coordinates
BED_MESH_PROFILE LOAD=default ; Load the approapriate Bed Mesh Profile instead of Marlin G29 (default = Name of mesh profile)
G28 ; Home all axes
#Preheat Extruder
G92 E0 ; Reset Extruder
G1 X230 Y175 F5000 ; Present bed and extruder for cleaning
G1 Z80 ; Move Z up 80
M83 ; Extruder relative mode
M109 S{EXTRUDER_TEMP} T0 ; Set Extruder temp and wait for it to be reached
#Precondition Extruder
G1 Z2.0 F3000 ; Move Z up little to prevent scratching of Bed
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y220.0 Z0.3 F1500.0 E20 ; Draw the first line down
G1 X0.4 Y220.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line up
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z up little to prevent scratching of Bed
G1 X6 Y20 Z0.3 F5000.0 ; Move over to avoid line
M117 Standing By...
RESTORE_GCODE_STATE NAME=start_print
[gcode_macro END_PRINT]
gcode:
SAVE_GCODE_STATE NAME=end_print
G91 ; Relative positioning
G1 E-2 F2700 ; Retract 2
G1 E-10 Z0.2 F2400 ; Retract 10 and raise Z .2
G1 Z10 ; Move Z up 10 from current position
G90 ; Absolute positioning
PARK ; Present print To Time Lapse Location
G1 X230 F6000 ; Move Extruder to the side for cleaning
M106 S0 ; Turn-off fan
M104 S0 ; Turn-off hotend
M140 S0 ; Turn-off bed
M84 ; Disable steppers
M117 Print Complete!
RESTORE_GCODE_STATE NAME=end_print
#----------------------------------------//--------------------------------------------------------
#CUSTOM MACROS
#----------------------------------------//--------------------------------------------------------
[gcode_macro WIPE]
description: Wipes the nozzle
gcode:
{% set wipe_count = 10 %} ; Set number of "wipe" movements along X
{% set Y = printer.toolhead.position.y %}
SAVE_GCODE_STATE NAME=wipe_state
G90 ; Absolute positioning
G0 F13000 ; Move Fast
{% for wipe in range(wipe_count) %} ; Will wipe 8 times at Coordinates
{% for coordinate in [(242, Y),(239, Y)] %} ; Brush pos X239 to X242 and current Y pos Example: [(242, 5),(239, 5)]
G0 X{coordinate[0]} Y{coordinate[1] + 0.0 * wipe} F13000 ; Go to Wipe position at 12000 mm/s and wipe on X and Y
{% endfor %}
{% endfor %}
RESTORE_GCODE_STATE NAME=wipe_state
[gcode_macro PARK]
description: Park Extruder at Time Lapse position
gcode:
SAVE_GCODE_STATE NAME=park_state
G91 ; Relative positioning
G0 Z5 ; Move Z up 5 before moving
G90 ; Absolute positioning
G0 X242 Y175 F6000 ; Time Lapse PARK_HEAD position X240 Y175
RESTORE_GCODE_STATE NAME=park_state
[gcode_macro MAINTENANCE]
description: Raises Z to predetermined height
gcode:
SAVE_GCODE_STATE NAME=maint_state
G90 ; Absolute positioning
G0 X117.5 Y20 F6000 ; Move Extruder to center and bed out of the way
G0 Z150 ; Move Z up 150
RESTORE_GCODE_STATE NAME=maint_state
[gcode_macro GANTRY_CALIBRATION]
description: Raises Z to 152.5mm from Base
gcode:
SAVE_GCODE_STATE NAME=cal_state
G90 ; Absolute positioning
G0 X117.5 Y20 F6000 ; Move Extruder to center and bed out of the way
G0 Z57.20 ; To Calibrate X Gantry - Use Ruller 152.5mm from Base (Tuned for individual printer)
M117 152.5mm from Base
RESTORE_GCODE_STATE NAME=cal_state
[gcode_macro CENTER]
description: Nozzle Center
gcode:
SAVE_GCODE_STATE NAME=center_state
G90 ; Absolute positioning
G0 Z5 ; Go Up 5mm before moving
G0 X117.5 Y117.5 F6000 ; Move to Center of Bed
G1 Z0 ; Lower to Z0
RESTORE_GCODE_STATE NAME=center_state
[gcode_macro FRONT_LT]
description: Nozzle Front Left
gcode:
SAVE_GCODE_STATE NAME=frtl_state
G90 ; Absolute positioning
G0 Z5 ; Go Up 5mm before moving
G0 X28 Y38 F6000 ; Move to Front Left Bed Screw
G0 Z0 ; Lower to Z0
RESTORE_GCODE_STATE NAME=frtl_state
[gcode_macro FRONT_RT]
description: Nozzle Front Right
gcode:
SAVE_GCODE_STATE NAME=frtr_state
G0 Z5 ; Go Up 5mm before moving
G0 X200 Y38 F6000 ; Move to Front Right Bed Screw
G0 Z0 ; Lower to Z0
RESTORE_GCODE_STATE NAME=frtr_state
[gcode_macro BACK_LT]
description: Nozzle Back Left
gcode:
SAVE_GCODE_STATE NAME=bckl_state
G90 ; Absolute positioning
G0 Z5 ; Go Up 5mm before moving
G0 X28 Y208 F6000 ; Move to Back Left Bed Screw
G0 Z0 ; Lower to Z0
RESTORE_GCODE_STATE NAME=bckl_state
[gcode_macro BACK_RT]
description: Nozzle Back Right
gcode:
SAVE_GCODE_STATE NAME=bckr_state
G90 ; Absolute positioning
G0 Z5 ; Go Up 5mm before moving
G0 X200 Y208 F6000 ; Move to Back Right Bed Screw
G0 Z0 ; Lower to Z0
RESTORE_GCODE_STATE NAME=bckr_state
[gcode_macro G29]
gcode:
G28 ; Home all axes
G0 Z10 F600 ; Move Z up 10 from home
BED_MESH_CLEAR
BED_MESH_CALIBRATE
BED_MESH_PROFILE LOAD=default
[gcode_macro SAVE_AT_END]
variable_save: 0
gcode:
SET_GCODE_VARIABLE MACRO=SAVE_AT_END VARIABLE=save VALUE=1
[gcode_macro SAVE_IF_SET]
gcode:
{% if printer["gcode_macro SAVE_AT_END"].save == 1 %}
{printer.gcode.action_respond_info("saving and restarting now")}
SAVE_CONFIG
{% endif %}
[gcode_macro M600]
default_parameter_X: 50
default_parameter_Y: 0
default_parameter_Z: 10
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
#----------------------------------------//--------------------------------------------------------
#REQUIRED SYSTEM MACROS
#----------------------------------------//--------------------------------------------------------
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
variable_extrude: 1.0 # change this if you need more or less extrusion
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 CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
G91 ; Relative positioning
G1 E-2 F2700 ; Retract 2
G1 E-10 F2400 ; Retract 10 and raise Z .2
G0 Z10 ; Lift Z10
M117 Print Cancelled!
SDCARD_RESET_FILE
CANCEL_PRINT_BASE