-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
demon_clean_load_v1.9.cfg
493 lines (364 loc) · 15.9 KB
/
demon_clean_load_v1.9.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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
###################################################
#######>>>>>>>>>> 3DPrintDemon <<<<<<<<<<<#######
####### https://github.com/3DPrintDemon #######
# IF YOU USE & LIKE THESE MACROS PLEASE CONSIDER SUPPORTING MY EFFORTS AT
# https://www.https://ko-fi.com/3dprintdemon
# Macro set includes all NEW fully automated LOAD/UNLOAD_CLEAN macros for one click loading & unloading followed
# by nozzle cleaning & cooldown, customise all macros via variables, plus selectable temps & load speeds!
# CHECK YOUR VALUES ARE CORRECT BEFORE USE, THIS IS VITAL & TOTALLY ON YOU!
# DO NOT BLINDLY USE THESE DEFAULTS!!
# USE THESE MACROS AT OWN RISK!
# DONT CRY TO ME IF YOU DIDN'T CHECK/CHANGE VALUES & YOU BREAK THINGS!
[gcode_macro LOAD_FILAMENT]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set ceal = printer["gcode_macro CUSTOM_EXPANSION_ACTIVE_LIST"] %}
{% set speed = params.SPEED_MMsec|default(7)|float * 60 %}
{% set temp = params.TEMP|default(250)|int %}
{% set cool = params.COOL|default('No')|string %}
{% set cool_temp = params.COOL_TEMP|default(160)|int %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
_MAX_EXTRUDE_CHECK
SAVE_GCODE_STATE NAME=load_state
_ENCODER_FEED_CHECK_PREP
M400
{% if ceal.ceal_master_enable == True %}
{% if ceal.pre_load == True %}
_CUSTOM_PRE_LOAD {rawparams}
{% endif %}
{% endif %}
{% if printer.print_stats.state not in ['printing', 'paused'] %}
SET_DISPLAY_TEXT MSG="Load hotend heating..."
RESPOND TYPE=COMMAND MSG="Load hotend heating..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={temp|int -2} MAXIMUM={temp|int + 5}
M117
{% endif %}
M83
G92 E0
G1 E{start_vars.load_length} F{max_velocity}
M400
_ENCODER_FEED_CHECK
G1 E{start_vars.load_purge_length} F{speed}
{% if cool in ['Yes', 'yes', 'True', 'true']|string %}
{% if printer.print_stats.state not in ['printing', 'paused'] and (temp >= printer.configfile.settings['extruder'].min_extrude_temp) %}
SET_DISPLAY_TEXT MSG="Post load hotend cooling..."
RESPOND TYPE=COMMAND MSG="Post load hotend cooling..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={cool_temp}
M117
{% elif printer.print_stats.state in ['printing', 'paused'] %}
SET_DISPLAY_TEXT MSG="Load cooling denied, print in progress!"
RESPOND TYPE=COMMAND MSG="Load cooling denied, print in progress!"
{% endif %}
{% endif %}
{% if ceal.ceal_master_enable == True %}
{% if ceal.post_load == True %}
_CUSTOM_POST_LOAD {rawparams}
{% endif %}
{% endif %}
RESTORE_GCODE_STATE NAME=load_state
[gcode_macro UNLOAD_FILAMENT]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set ceal = printer["gcode_macro CUSTOM_EXPANSION_ACTIVE_LIST"] %}
{% set speed = params.SPEED_MMsec|default(7)|float * 60 %}
{% set temp = params.TEMP|default(250)|int %}
{% set cool = params.COOL|default('No')|string %}
{% set cool_temp = params.COOL_TEMP|default(160)|int %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
_MAX_EXTRUDE_CHECK
SAVE_GCODE_STATE NAME=unload_state
_ENCODER_FEED_CHECK_PREP
M400
{% if ceal.ceal_master_enable == True %}
{% if ceal.pre_unload == True %}
_CUSTOM_PRE_UNLOAD {rawparams}
{% endif %}
{% endif %}
{% if printer.print_stats.state not in ['printing', 'paused'] %}
SET_DISPLAY_TEXT MSG="Unload hotend heating..."
RESPOND TYPE=COMMAND MSG="Unload hotend heating..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={temp|int -2} MAXIMUM={temp|int + 5}
M117
{% endif %}
M83
G92 E0
G1 E{start_vars.unload_purge_length} F{speed}
M400
_ENCODER_FEED_CHECK
G1 E-5 F{max_velocity}
G4 P8000
G1 E-{start_vars.unload_length} F{max_velocity}
{% if cool in ['Yes', 'yes', 'True', 'true']|string %}
{% if printer.print_stats.state not in ['printing', 'paused'] and (temp >= printer.configfile.settings['extruder'].min_extrude_temp) %}
SET_DISPLAY_TEXT MSG="Post unload hotend cooling..."
RESPOND TYPE=COMMAND MSG="Post unload hotend cooling..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={cool_temp}
M117
{% elif printer.print_stats.state in ['printing', 'paused'] %}
SET_DISPLAY_TEXT MSG="Unload cooling denied, print in progress!"
RESPOND TYPE=COMMAND MSG="Unload cooling denied, print in progress!"
{% endif %}
{% endif %}
{% if ceal.ceal_master_enable == True %}
{% if ceal.post_unload == True %}
_CUSTOM_POST_UNLOAD {rawparams}
{% endif %}
{% endif %}
RESTORE_GCODE_STATE NAME=unload_state
[gcode_macro CLEAN_NOZZLE]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set clean_vars = printer["gcode_macro _CLEAN_VARIABLES"] %}
{% if clean_vars.have_you_set_this_up != True %}
{action_raise_error("This error is caused by you not setting up this feature before first use. Check demon_user_settings file & set this feature up correctly for your printer!")}
{% else %}
{% if start_vars.nozzle_cleaner == True %}
G90
M83
_CONDITIONAL_HOME
SET_DISPLAY_TEXT MSG="Cleaning Nozzle"
RESPOND TYPE=COMMAND MSG="Cleaning Nozzle"
{% if start_vars.neopixel_led == True %}
STATUS_CLEANING
{% endif %}
{% if clean_vars.random_clean_x == False and clean_vars.random_clean_y == False %}
G0 X{clean_vars.linear_clean_start_x} Y{clean_vars.linear_clean_start_y} F{clean_vars.clean_travel_speed * 60|int}
G0 Z{clean_vars.linear_clean_start_z} F4000
M400
{% if clean_vars.linear_clean_axis in ['X', 'x']|string %}
{% for passes in range(1, (clean_vars.linear_pass_count)) %}
_LINEAR_STEP_CONTROL_X
{% endfor %}
{% elif clean_vars.linear_clean_axis in ['Y', 'y']|string %}
{% for passes in range(1, (clean_vars.linear_pass_count)) %}
_LINEAR_STEP_CONTROL_Y
{% endfor %}
{% endif %}
{% elif clean_vars.random_clean_x == True or clean_vars.random_clean_y == True %}
G0 X{clean_vars.start_x} Y{clean_vars.start_y} F{clean_vars.clean_travel_speed * 60|int}
G0 Z{clean_vars.start_z} F4000
M400
{% for passes in range(1, (clean_vars.pass_count)) %}
_step_control
{% endfor %}
{% endif %}
G0 Z{clean_vars.park_z} F4000
{% if printer.print_stats.state != 'printing' %}
G0 X{clean_vars.end_position_x} Y{clean_vars.end_position_y}
G0 X{clean_vars.park_x} Y{clean_vars.park_y} Z{clean_vars.park_z} F4000
{% endif %}
M117
M400
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
_SAVE
{% else %}
{action_raise_error("This error is caused by the nozzle_cleaner variable not being enabled, check the demon_user_settings file!")}
{% endif %}
{% endif %}
[gcode_macro LOAD_CLEAN]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set clean_vars = printer["gcode_macro _CLEAN_VARIABLES"] %}
{% set ceal = printer["gcode_macro CUSTOM_EXPANSION_ACTIVE_LIST"] %}
{% set temp = params.TEMP|default(250)|float %}
{% set speed = params.SPEED_MMsec|default(7)|float * 60 %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
_MAX_EXTRUDE_CHECK
{% if clean_vars.have_you_set_this_up != True %}
{action_raise_error("This error is caused by you not setting up this feature before first use. Check demon_user_settings file & set this feature up correctly for your printer!")}
{% elif printer.print_stats.state in ['printing', 'paused'] %}
RESPOND TYPE=error MSG="Request denied, current printer state is printing/paused"
{% else %}
{% if start_vars.nozzle_cleaner == True and start_vars.purge_bucket == True %}
SAVE_GCODE_STATE NAME=load_clean_state
_RUNOUT_SENSOR_CHECK
M400
{% if ceal.ceal_master_enable == True %}
{% if ceal.pre_load_clean == True %}
_CUSTOM_PRE_LOAD_CLEAN {rawparams}
{% endif %}
{% endif %}
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
M117 HEATING...
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={clean_vars.nozzle_pre_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={clean_vars.nozzle_pre_temp - 5} MAXIMUM={clean_vars.nozzle_pre_temp + 50}
_CONDITIONAL_HOME
G90
M83
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
{% if printer.toolhead.position.z|float < 20 %}
G0 Z20 F3600
{% endif %}
_random_spot
G0 Z{clean_vars.purge_z_park} F3000 # park to purge
M400
M117 Heating to Load...
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={temp - 2} MAXIMUM={temp + 5}
M106 S255 # Fans to max.
M117 LOADING.....
{% if start_vars.neopixel_led == True %}
STATUS_PRINTING
{% endif %}
_ENCODER_FEED_CHECK_PREP
G92 E0 # reset extruder
G1 E{clean_vars.load_clean_load_dist} F{max_velocity} # Max extrude only speed
M400
_ENCODER_FEED_CHECK
G1 E{clean_vars.load_clean_purge_dist} F{speed} # fast purge
G4 P10000
_random_spot
M107 # fans off
# M106 S255 # Fans to max.
G1 E-5 F300 # slow retract
G4 P10000
_random_spot
M106 S255 # Fans to max.
M400 # wait for all moves to complete
M117 Post Load Cooling...
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={clean_vars.nozzle_post_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={clean_vars.nozzle_post_temp - 5} MAXIMUM={clean_vars.nozzle_post_temp + 10}
_random_spot
M107 # fans off
M118 WARNING Nozzle Cleaning 5 Seconds...
M117 WARNING Nozzle Cleaning 5 Seconds...
G4 P5000 # 5 second wait
M118 Nozzle Cleaning...
M117 Nozzle Cleaning...
CLEAN_NOZZLE
M400
M117
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
{% if start_vars.runout_sensor == True %}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
{% endif %}
{% if ceal.ceal_master_enable == True %}
{% if ceal.post_load_clean == True %}
_CUSTOM_POST_LOAD_CLEAN {rawparams}
{% endif %}
{% endif %}
RESTORE_GCODE_STATE NAME=load_clean_state
_SAVE
{% else %}
{action_raise_error("This error is caused by the nozzle_cleaner & purge_bucket both not being enabled Check demon_user_settings file!")}
{% endif %}
{% endif %}
[gcode_macro UNLOAD_CLEAN]
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set clean_vars = printer["gcode_macro _CLEAN_VARIABLES"] %}
{% set ceal = printer["gcode_macro CUSTOM_EXPANSION_ACTIVE_LIST"] %}
{% set temp = params.TEMP|default(250)|float %}
{% set speed = params.SPEED_MMsec|default(7)|float * 60 %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
_MAX_EXTRUDE_CHECK
{% if clean_vars.have_you_set_this_up != True %}
{action_raise_error("This error is caused by you not setting up this feature before first use. Check demon_user_settings file & set this feature up correctly for your printer!")}
{% elif printer.print_stats.state in ['printing', 'paused'] %}
RESPOND TYPE=error MSG="Request denied, current printer state is printing/paused"
{% else %}
{% if start_vars.nozzle_cleaner == True and start_vars.purge_bucket == True %}
SAVE_GCODE_STATE NAME=unload_clean_state
_RUNOUT_SENSOR_CHECK
M400
{% if ceal.ceal_master_enable == True %}
{% if ceal.pre_unload_clean == True %}
_CUSTOM_PRE_LOAD_CLEAN {rawparams}
{% endif %}
{% endif %}
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
M117 HEATING...
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={clean_vars.nozzle_pre_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={clean_vars.nozzle_pre_temp - 5} MAXIMUM={clean_vars.nozzle_pre_temp + 50}
_CONDITIONAL_HOME
{% if start_vars.runout_sensor == True %}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
{% endif %}
G90
M83
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
{% if printer.toolhead.position.z|float < 20 %}
G0 Z20 F3600
{% endif %}
_random_spot
G0 Z{clean_vars.purge_z_park} F3000 # park to purge
M400
M117 Heating to Unload...
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={temp - 2} MAXIMUM={temp + 5}
M117 UNLOADING.....
{% if start_vars.neopixel_led == True %}
STATUS_PRINTING
{% endif %}
_ENCODER_FEED_CHECK_PREP
G92 E0 # reset extruder
G1 E{clean_vars.unload_clean_purge_dist} F{speed} # fast purge
M400
_ENCODER_FEED_CHECK
G4 P5000
_random_spot
G1 E-{clean_vars.unload_clean_unload_dist} F{max_velocity} # Max extrude only speed
M106 S255 # Fans to max.
G4 P5000
_random_spot
M400 # wait for all moves to complete
M117 Post Unload Cooling...
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={clean_vars.nozzle_post_temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={clean_vars.nozzle_post_temp - 5} MAXIMUM={clean_vars.nozzle_post_temp + 10}
M107 # fans off
M118 WARNING Nozzle Cleaning 5 Seconds...
M117 WARNING Nozzle Cleaning 5 Seconds...
G4 P5000 # 5 second wait
M118 Nozzle Cleaning...
M117 Nozzle Cleaning...
CLEAN_NOZZLE
M400
M117
TURN_OFF_HEATERS
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
{% if start_vars.runout_sensor == True %}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
{% endif %}
{% if ceal.ceal_master_enable == True %}
{% if ceal.post_unload_clean == True %}
_CUSTOM_POST_UNLOAD_CLEAN {rawparams}
{% endif %}
{% endif %}
RESTORE_GCODE_STATE NAME=unload_clean_state
_SAVE
{% else %}
{action_raise_error("This error is caused by the nozzle_cleaner & purge_bucket both not being enabled. Check demon_user_settings file!")}
{% endif %}
{% endif %}
[gcode_macro _CLEAN_LOAD_VERSION]
variable_demon_clean_load: 1.9
gcode: