-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmacros.cfg
280 lines (246 loc) · 7.51 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[gcode_macro test_speed_fast]
default_parameter_SPEED: 100 # speed
default_parameter_ACCEL: 1000 # acceleration
default_parameter_SC: 4.0 # square corner velocity
default_parameter_XMIN: 10 # min x
default_parameter_XMAX: 240 # max x
default_parameter_YMIN: 10 # min y
default_parameter_YMAX: 220 # max y
default_parameter_CURRENT: 0.95 # stepper current (amps)
gcode:
SAVE_GCODE_STATE NAME=test_speed_fast_state
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={CURRENT} HOLDCURRENT={CURRENT}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={CURRENT} HOLDCURRENT={CURRENT}
G90
SET_VELOCITY_LIMIT VELOCITY=200 ACCEL=1000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=4.0
G28
GET_POSITION
G1 F100000
SET_VELOCITY_LIMIT VELOCITY={SPEED} ACCEL={ACCEL} ACCEL_TO_DECEL={ACCEL|float / 2} SQUARE_CORNER_VELOCITY={SC}
G1 X{XMIN} Y{YMIN}
{% for i in range(2) %}
G1 X{XMAX} Y{YMAX}
G1 X{XMIN} Y{YMIN}
{% endfor %}
G1 X{XMIN} Y{YMAX}
{% for i in range(2) %}
G1 X{XMIN} Y{YMAX}
G1 X{XMAX} Y{YMIN}
{% endfor %}
G1 X{XMIN} Y{YMAX}
G1 X{XMIN} Y{YMIN}
G1 X{XMAX} Y{YMAX}
G1 X{XMIN} Y{YMAX}
G1 X{XMIN} Y{YMIN}
SET_VELOCITY_LIMIT VELOCITY=200 ACCEL=1500 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=4.0
G28
GET_POSITION
RESTORE_GCODE_STATE NAME=test_speed_fast_state
[gcode_macro INITIALIZE_FILAMENT]
gcode:
{% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed
G28 ; home
{% endif %}
{% if params.TYPE == 'abs' %}
BED_MESH_PROFILE LOAD=high_temp
{% if params.BRAND == 'kvp' %}
SET_PRESSURE_ADVANCE ADVANCE=0.056
{% elif params.BRAND == 'paramount' %}
#TODO: needs calibrating
{% endif %}
{% elif params.TYPE == 'pla' %}
BED_MESH_PROFILE LOAD=low_temp
{% if params.BRAND == 'overture' %}
#TODO: needs calibrating
{% endif %}
{% elif params.TYPE == 'plapro' %}
BED_MESH_PROFILE LOAD=low_temp
{% if params.BRAND == 'overture' %}
#TODO: needs calibrating
{% endif %}
{% elif params.TYPE == 'petg' %}
BED_MESH_PROFILE LOAD=high_temp
SET_GCODE_OFFSET Z_ADJUST=0.04 MOVE=1 ; don't squish petg as much
{% if params.BRAND == 'overture' %}
SET_PRESSURE_ADVANCE ADVANCE=0.09
{% endif %}
{% endif %}
[gcode_macro START_PRINT]
gcode:
M117 Starting print
CLEAR_PAUSE
G90 ; absolute positioning
M82 ; absolute extruder mode
M107 ; turn fan off
BED_MESH_CLEAR ; clear any bed mesh
{% if params.BED %}
M140 S{params.BED} ; set bed final temp
M190 S{params.BED} ; wait for bed final temp
{% endif %}
{% if params.EXTRUDER %}
M104 S{params.EXTRUDER} ; set extruder final temp
M109 S{params.EXTRUDER} ; wait for extruder final temp
{% endif %}
{% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed
G28 ; home
{% endif %}
# PRIME_LINE
M117 Printing
# prime the nozzle
[gcode_macro PRIME_LINE]
gcode:
M117 Priming Line
{% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed
G28 ; home
{% endif %}
SAVE_GCODE_STATE NAME=PRIME_LINE_state
G90 ; absolute positioning
G92 E0 ; reset extruder
G1 Z5.0 F3000 ; move Z Axis up
G1 X10 Y10 Z0.24 F5000.0 ; move to start position
G1 X10 Y200 Z0.24 F1500.0 E15 ; draw the first line
G1 X10.4 Y200 Z0.24 F5000.0 ; move to side a little
G1 X10.4 Y10 Z0.24 F1500.0 E30 ; draw the second line
G92 E0 ; reset Extruder
G1 Z5.0 F3000 ; move Z Axis up
RESTORE_GCODE_STATE NAME=PRIME_LINE_state
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
default_parameter_X: 250
default_parameter_Y: 230
default_parameter_Z: 10
gcode:
M104 S0
M140 S0
M141 S0
M106 S0
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro END_PRINT]
gcode:
M117 Ending print
M400 ; wait for buffer to clear
PARK
M107 ; turn fan off
TURN_OFF_HEATERS
M84 ; turn off all motors
BED_MESH_CLEAR
M117 Complete!
# Filament change
[gcode_macro M600]
gcode:
M117 Filament change
PAUSE
UNLOAD
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_X: 125
default_parameter_Y: 10
default_parameter_Z: 10
gcode:
M117 Pausing
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
RESPOND TYPE=command MSG=action:paused
G91
G1 E-1.7 F2100
G1 Z{Z}
G90
G1 X{X} Y{Y} F10000
G91
SET_IDLE_TIMEOUT TIMEOUT=3600
M117 Paused
[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1
gcode:
M117 Resuming
SET_IDLE_TIMEOUT TIMEOUT=600
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
RESPOND TYPE=command MSG=action:resumed
M117 Printing
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
M117 Cancelling
TURN_OFF_HEATERS
M107 ; turn off fan
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
PARK
M117 Cancelled
[gcode_macro PARK]
default_parameter_X: 250
default_parameter_Y: 230
default_parameter_Z: 210
default_parameter_E: 1
gcode:
M117 Parking
SAVE_GCODE_STATE NAME=PARK_state
G91
G1 E-{E} F2100
G90
G1 X{X} Y{Y} Z{Z} F6000
RESTORE_GCODE_STATE name=PARK_state
M117 Parked
# PROBE_CALIBRATE wrapper
[gcode_macro PROBE_CALIBRATE]
rename_existing: BASE_PROBE_CALIBRATE
gcode:
{% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed
G28 ; move to origin
{% endif %}
G1 X125 Y127 Z10 F10000 ; align with bed mesh relative index
BASE_PROBE_CALIBRATE
# Bed mesh
[gcode_macro BED_MESH]
gcode:
M117 Generating bed mesh
BED_MESH_CLEAR
BED_MESH_PROFILE REMOVE={params.NAME}
{% if "z" not in printer.toolhead.homed_axes %} ; G28 Home if needed
G28 ; move to origin
{% endif %}
BED_MESH_CALIBRATE
G1 X125 Y115 Z50 F10000
BED_MESH_PROFILE SAVE={params.NAME}
SAVE_CONFIG
[gcode_macro SET_CASELIGHT]
# Control chamber LED, 0.0-1.0
default_parameter_S=1.0
gcode:
set_pin pin=caselight value={S}
[gcode_macro store_extruder_temp]
variable_temp: 0
gcode:
SET_GCODE_VARIABLE MACRO=store_extruder_temp VARIABLE=temp VALUE={printer.extruder.target}
[gcode_macro restore_extruder_temp]
gcode:
{% if printer["gcode_macro store_extruder_temp"].temp >0 %}
M104 S{printer["gcode_macro store_extruder_temp"].temp}
{% endif %}
[gcode_macro restore_and_wait_extruder_temp]
gcode:
{% if printer["gcode_macro store_extruder_temp"].temp >0 %}
M109 S{printer["gcode_macro store_extruder_temp"].temp}
{% endif %}
[gcode_macro store_bed_temp]
variable_temp: 0
gcode:
SET_GCODE_VARIABLE MACRO=store_bed_temp VARIABLE=temp VALUE={printer.heater_bed.target}
[gcode_macro restore_bed_temp]
gcode:
{% if printer["gcode_macro store_bed_temp"].temp >0 %}
M140 S{printer["gcode_macro store_bed_temp"].temp}
{% endif %}
[gcode_macro restore_and_wait_bed_temp]
gcode:
{% if printer["gcode_macro store_bed_temp"].temp >0 %}
M190 S{printer["gcode_macro store_bed_temp"].temp}
{% endif %}