-
Notifications
You must be signed in to change notification settings - Fork 1
/
macros.cfg
348 lines (313 loc) · 10.5 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
[gcode_macro PRINT_START]
gcode:
M204 X Y S15000
M117 Z_Calbrating...
STATUS_CALIBRATING_Z #ToolHead LED
M117 Tilting...
Z_TILT_ADJUST
M117 Meshing...
STATUS_MESHING #ToolHead LED
BED_MESH_CLEAR
BED_MESH_CALIBRATE
G1 Z10 F2400
G1 X-30 Y50 F27000
SKEW_PROFILE LOAD=my_skew
[gcode_macro PURGE]
gcode:
M117 Cleaning...
G1 Z0.1 F1000
G92 E0
G1 X-30 Y50 E6.0 F120
G1 X-15 Y50 F6000
G92 E0
INNER_LED_OFF
INNER_LED_ON
G1 Z0.3 F1000
G1 E10.0 F150
G92 E0
G1 X-15 Y100 E6.05
G92 E0
G1 X-10 Y100 E0.55
G92 E0
G1 X-10 Y80 E2.38
G92 E0
G1 X-20 Y80 E1.15
G92 E0
M117 Printing...
[gcode_macro echo_moment_vars]
description: Echo MomentOS variables to the console.
gcode:
{% for var, value in printer["gcode_macro Moment"].items() %}
{action_respond_info(var ~ ": " ~ value)}
{% endfor %}
[gcode_macro ECHO_MOMENTOS_VARS]
description: Echo MomentOS variables to the console.
gcode:
{% for var, value in printer["gcode_macro MomentOS"].items() %}
{action_respond_info(var ~ ": " ~ value)}
{% endfor %}
[gcode_macro MomentOS]
description: MomentOS variable storage macro, will echo variables to the console when run.
variable_relative_extrusion: False
variable_force_absolute_position: False
variable_preheat_extruder: True
variable_preheat_extruder_temp: 150
variable_calibrate_bed_mesh: True
variable_nozzle_priming: "primeblob"
variable_nozzle_prime_start_x: "max" # min, max or number
variable_nozzle_prime_start_y: "min" # min, max or number
variable_nozzle_prime_direction: "auto" # auto, forwards, backwards
variable_filament_unload_length: 130
variable_filament_unload_speed: 6000
variable_filament_load_length: 80
variable_filament_load_speed: 20
variable_start_print_park_in: "back"
variable_end_print_park_in: "back"
variable_pause_print_park_in: "front"
variable_macro_travel_speed: 150
variable_macro_z_speed: 15
variable_end_print_park_z_hop: 20
variable_homing: "endstops"
variable_z_probe: "static"
variable_safe_home_x: "middle"
variable_safe_home_y: "middle"
variable_stowable_probe_stop_on_error: False
gcode:
ECHO_MOMENTOS_VARS
[gcode_macro PAUSE]
description: Pauses the printer
rename_existing: PAUSE_BASE
variable_extrude: 1.5
gcode:
M117 Pause...
SAVE_GCODE_STATE NAME=PAUSE_state
# Define park positions
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
{% set speed = printer["gcode_macro MomentOS"].macro_travel_speed|float * 60 %}
{% set z_speed = printer["gcode_macro MomentOS"].macro_z_speed|float * 60 %}
# Calculate safe Z position
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 20.0) %}
{% set z_safe = 20.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
PAUSE_BASE
G91
# Retract
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
# Move to park position
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F{z_speed}
_PARK LOCATION={printer["gcode_macro MomentOS"].pause_print_park_in} X={printer["gcode_macro MomentOS"].pause_print_park_x}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resumes the print if the printer is paused.
rename_existing: RESUME_BASE
gcode:
M117 Printing...
STATUS_PRINTING
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
# Prime
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
G90
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
RESUME_BASE
[gcode_macro CANCEL_PRINT]
description: Cancels the printer
rename_existing: CANCEL_PRINT_BASE
gcode:
M117 Cancel...
END_PRINT
CLEAR_PAUSE
CANCEL_PRINT_BASE
[gcode_macro END_PRINT]
description: End print procedure, use this in your Slicer.
gcode:
SAVE_GCODE_STATE NAME=end_print_state
{% set z_max = printer.toolhead.axis_maximum.z %}
G92 E0
G0 E-1.0 F6000 ; rectract
G1 Z{z_max} ; move Z max
G28 X ; move X home
G28 Y ; move Y home
G92 E0
G1 E5 F3600 ; extrude
M107 ; parts fan off (on is M106)
M84 ; motor off
M104 S0 ; hotend off
M140 S0 ; bed off
G91 ; relative positioning
BED_MESH_CLEAR
STATUS_READY
INNER_LED_OFF
INNER_LED_ON
SET_TMC_CURRENT STEPPER=stepper_z CURRENT=0.6
SET_TMC_CURRENT STEPPER=stepper_z1 CURRENT=0.6
SET_TMC_CURRENT STEPPER=stepper_z2 CURRENT=0.6
SET_SKEW CLEAR=1
M106 P3 S51 #(SET_FAN_SPEED FAN=Exhaust_fan SPEED=0.2)
#M106 P2 S0 #(SET_FAN_SPEED FAN=Auxiliary_fan SPEED=0)
M117 Finished...
RESTORE_GCODE_STATE NAME=end_print_state
[gcode_macro _END_PRINT_PARK]
gcode:
_PARK LOCATION={printer["gcode_macro MomentOS"].end_print_park_in} X={printer["gcode_macro MomentOS"].end_print_park_x}
[gcode_macro _PARK]
gcode:
{% set speed = printer["gcode_macro MomentOS"].macro_travel_speed|float * 60 %}
# Get X position
{% if params.X != '' %}
{% if params.X|float >= printer.toolhead.axis_minimum.x + 5 and params.X|float <= printer.toolhead.axis_maximum.x - 5 %}
{% set safe_x = params.X|float %}
{% else %}
{action_respond_info('The requested X co-ordinate is outside the defined axis bounds - using defaults')}
{% set safe_x = printer.toolhead.axis_maximum.x / 2 %}
{% endif %}
{% else %}
{% set safe_x = printer.toolhead.axis_maximum.x / 2 %}
{% endif %}
# Get Y position
{% if params.LOCATION|default('back')|lower == 'back' %}
{% set y = printer.toolhead.axis_maximum.y - 5 %}
{% elif params.LOCATION|lower == 'front' %}
{% set y = printer.toolhead.axis_minimum.y + 5 %}
{% elif params.LOCATION|lower == 'center' %}
{% set y = printer.toolhead.axis_maximum.y / 2 %}
{% endif %}
G90
G0 X{safe_x} Y{y} F{speed}
[gcode_macro M600]
description: Executes a color change by pausing the printer an unloading the filament.
gcode:
PAUSE
UNLOAD_FILAMENT
M117 Please load new filament and resume
[gcode_macro M601]
description: Puase macro
gcode:
PAUSE
UNLOAD_FILAMENT
M117 Please load new filament and resume
[gcode_macro UNLOAD_FILAMENT]
description: Unloads the filament. The function is applied to the screen.
gcode:
SAVE_GCODE_STATE NAME=unload_state
{% set current_temp = printer.extruder.temperature %}
{% if current_temp >= 215 %}
{% set unload_speed = printer["gcode_macro MomentOS"].filament_unload_speed|float * 60 %}
{% set unload_length = printer["gcode_macro MomentOS"].filament_unload_length|float %}
STATUS_LOAD_UNLOAD
M117 Unloading filament...
G92 E0 #Reset the current position of the extruder. Unloading without this command may cause a lot of motor spinning or an "extrude only move too long" error.
G0 E5 F3600 # Push back the filament to smash any stringing
G0 E-45 F6000 # Extract back fast into the cold zone
# Start - Cooling, hardening, shaping filament process
G4 P15000 # Wait for 15 seconds
# End - Cooling, hardening, shaping filament process
G0 E-{unload_length} F{unload_speed} # Extract quickly to ensure no seals or blockages.
STATUS_READY
M117 Filament unloaded...
{% endif %}
RESTORE_GCODE_STATE NAME=unload_state
[gcode_macro LOAD_FILAMENT]
description: Loads new filament. The function is applied to the screen.
gcode:
SAVE_GCODE_STATE NAME=load_state
{% set current_temp = printer.extruder.temperature %}
{% if current_temp < 215 %}
M117 Heating...
M104 S215
TEMPERATURE_WAIT SENSOR=extruder MINIMUM=215
{% endif %}
{% set load_speed = printer["gcode_macro MomentOS"].filament_load_speed|float * 60 %}
{% set load_length = printer["gcode_macro MomentOS"].filament_load_length|float %}
M117 Loading filament...
STATUS_LOAD_UNLOAD
G92 E0 #Reset the current position of the extruder. Unloading without this command may cause a lot of motor spinning or an "extrude only move too long" error.
G0 E{load_length} F{load_speed} # Load the filament into the hotend area.
G4 P1000 # Wait a secod
G0 E100 F100 # Purge
#M400 # Wait for purge to complete
STATUS_READY
M117 Filament loaded...
RESTORE_GCODE_STATE NAME=load_state
#####################################################################
# Inner LED Macro
#####################################################################
[gcode_macro INNER_LED_SEMI_HEATING]
gcode:
SET_LED LED="Inner_LED" RED=1 GREEN=0.2 BLUE=0 WHITE=0 SYNC=0 TRANSMIT=1
[gcode_macro INNER_LED_HEATING]
gcode:
SET_LED LED="Inner_LED" RED=1 GREEN=0 BLUE=0 WHITE=0 SYNC=0 TRANSMIT=1
[gcode_macro INNER_LED_ON]
gcode:
SET_LED LED="Inner_LED" RED=0.5 GREEN=0.5 BLUE=0.5 WHITE=1 SYNC=0 TRANSMIT=1
[gcode_macro INNER_LED_OFF]
gcode:
SET_LED LED="Inner_LED" RED=0 GREEN=0 BLUE=0 WHITE=0 SYNC=0 TRANSMIT=1
#####################################################################
# Toolhead LED Macro
#####################################################################
[gcode_macro TOOLHEAD_LED_ON]
gcode:
SET_LED LED="Toolhead_LED" RED=0.5 GREEN=0.5 BLUE=0.5 WHITE=1
[gcode_macro TOOLHEAD_LED_OFF]
gcode:
SET_LED LED="Toolhead_LED" RED=0 GREEN=0 BLUE=0 WHITE=0
#####################################################################
# PID
#####################################################################
[gcode_macro PID_Hotend230]
gcode:
PID_CALIBRATE HEATER=extruder TARGET=230
[gcode_macro PID_Hotend280]
gcode:
PID_CALIBRATE HEATER=extruder TARGET=280
[gcode_macro PID_Bed_Heater60]
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=60
[gcode_macro PID_Bed_Heater100]
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=100
#####################################################################
# R&D
#####################################################################
[gcode_macro Calibration_IS_X]
gcode:
TEST_RESONANCES AXIS=X
[gcode_macro Calibration_IS_Y]
gcode:
TEST_RESONANCES AXIS=Y
[gcode_macro Auto_Calibration_IS_XY]
gcode:
SHAPER_CALIBRATE
#####################################################################
# ETC
#####################################################################
[gcode_macro T0]
gcode:
[gcode_macro PROBE_ACCURACY_Samples]
gcode:
M140 S60
M104 S150
M190 S60
M109 S150
G28
PROBE_ACCURACY samples=100
G1 Z50 F2400
M104 S0
M140 S0