forked from 3DPrintDemon/Demon_Klipper_Essentials_Unified
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemon_setup_helpers_v1.5.7.cfg
More file actions
535 lines (393 loc) · 17.5 KB
/
Copy pathdemon_setup_helpers_v1.5.7.cfg
File metadata and controls
535 lines (393 loc) · 17.5 KB
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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
###################################################
#######>>>>>>>>>> 3DPrintDemon <<<<<<<<<<<#######
####### https://github.com/3DPrintDemon #######
# Heres some super basic but quality of life improving macros for your Klipper printer from your friendly 3DPrintDemon!
# www.3dprintdemon.com
# they're ideal if you're just starting out or just hate typing console commands!
# If you have Klipperscreen some of these functions will be included there, so you can either delete or comment out the ones you dont want here.
# Or you can simply hide the macros you dont want in the Macros browser interface settings window.
# !!!!!IMPORTANT!!!!!
# To get this to work copy & paste the line directly below into your printer.cfg file & save....
# [include demon_essentials.cfg]
# NOTE: remove the "#" at the beginning to enable the line once it is pasted into your printer.cfg file
# Pressure_Advance_Test_Mode
# Automatically sets the printer up ready to calibrate your pressure advance.
# Hit this macro then print the file linked here: https://www.klipper3d.org/prints/square_tower.stl
# further reference to work out your resut here: https://www.klipper3d.org/Pressure_Advance.html
# NOTE: Pressure Advance must be enabled in your system's Extruder section
# Stepper_Buzz_Cycle
# Will give you a guided test of all your motors by buzzing them 1mm to the positive side then back again, if any go negative (to home) then reverse
# their direction by placing a "!" in front of the "Dir" pin for that stepper.
# watch the status window for messages & countdown to which stepper is up next!
# NOTE: If you only have 4 drivers on your system you will need to comment out the line to test stepper_z1
# NOTE: It will NOT test your Extruder - you will have to do that manually
# Use "STEPPER_BUZZ STEPPER=extruder" & be sure to have the nozzle hot for this!
# Printer_PID_Tune
# This will setup & run a full PID tune on your printer with a single click of the macro button.
# It will home your printer, raise the nozzle 50mm, start the parts cooling fan to 50% & heat the printer to full printing temperature.
# Then it will run the hotend PID tune test. Once compteted it shut off the parts cooling fan & start the Bed PID tune.
# NOTE: The FULL hotend & bed PID tune takes a long time! Please wait for it to complete, messages will keep you informed of the systems progress!
# NOTE: You MUST use the SAVE_CONFIG command manually after both tests have completed in the Console or the button at the top of the browser window to save the new values or they will be lost!!
# Auto_Shaper_X
# This will run the input shaping auto calibration of the X axis
# Auto_Shaper_Y
# This will run the input shaping auto calibration of the Y axis
[gcode_macro ONE_CLICK_EDDY_NG_SETUP]
description: Run the Eddy NG setup process. EDDY NG ONLY!
gcode:
{% set bedtemp = params.BED_TEMP|default(60)|int %}
{% if 'probe_eddy_ng btt_eddy' in printer or 'probe_eddy_ng eddy' in printer %}
RESPOND TYPE=COMMAND MSG="Starting Eddy NG setup! Bed heating to {bedtemp}c"
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bedtemp}
G28 X Y
G90
G0 X{printer.toolhead.axis_maximum.x|float / 2} Y{printer.toolhead.axis_maximum.y|float / 2}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={bedtemp|int -2} MAXIMUM={bedtemp|int + 5}
PROBE_EDDY_NG_SETUP
{% else %}
{action_raise_error("Operation Cancelled! You don't appear to have an active Eddy NG probe in your system!")}
{% endif %}
[gcode_macro EDDY_TEMP_COMP]
description: Run the BTT Eddy thermal compensation routine. FOR USB/DUO EDDY ONLY!
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set temp = params.NOZ_TEMP|default(220)|int %}
{% set bedtemp = params.BED_TEMP|default(100)|int %}
{% set e_tar = params.EDDY_TEMP_TARGET|default(56)|int %}
{% set e_step = params.EDDY_TEMP_STEP|default(4)|int %}
{% if 'probe_eddy_ng btt_eddy' in printer or 'probe_eddy_ng eddy' in printer %}
{action_raise_error("Operation Cancelled! You appear to have an active Eddy NG probe in your system!")}
{% else %}
{% if 'mcu eddy' in printer and 'probe_eddy_current btt_eddy' in printer %}
_AUTO_LIGHTS
_CONDITIONAL_HOME
G0 X{start_vars.eddy_park_x} Y{start_vars.eddy_park_y} Z20 F9000
G0 Z5
SET_IDLE_TIMEOUT TIMEOUT=36000
SET_DISPLAY_TEXT MSG="Hotend heating..."
RESPOND TYPE=COMMAND MSG="Hotend heating..."
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={temp}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={temp|int -2} MAXIMUM={temp|int + 5}
{% if start_vars.nozzle_cleaner == True %}
CLEAN_NOZZLE
G0 X{start_vars.eddy_park_x} Y{start_vars.eddy_park_y} Z20 F9000
G0 Z5
M400
{% endif %}
SET_DISPLAY_TEXT MSG="HEATING BED TO NEAR MAX...!"
RESPOND TYPE=COMMAND MSG="HEATING BED TO NEAR MAX...!"
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={bedtemp}
TEMPERATURE_PROBE_CALIBRATE PROBE=btt_eddy TARGET={e_tar} STEP={e_step}
{% else %}
RESPOND TYPE=error MSG="Operation canceled: USB/DUO BTT Eddy probe not present!"
{% endif %}
{% endif %}
[gcode_macro EDDY_CURRENT_CALIBRATION]
description: Run the BTT Eddy current calibration - Z AXIS MUST BE AT 20mm OFF THE BED!
gcode:
{% if 'probe_eddy_ng btt_eddy' in printer or 'probe_eddy_ng eddy' in printer %}
{action_raise_error("Operation Cancelled! You appear to have an active Eddy NG probe in your system!")}
{% elif 'cartographer' in printer %}
{action_raise_error("Operation Cancelled! You appear to have an active Cartographer probe in your system!")}
{% else %}
_AUTO_LIGHTS
SET_DISPLAY_TEXT MSG="NOZZLE MUST BE AT 20mm OFF THE BED!"
RESPOND TYPE=COMMAND MSG="NOZZLE MUST BE AT 20mm OFF THE BED!"
{% if 'probe_eddy_current btt_eddy' in printer %}
LDC_CALIBRATE_DRIVE_CURRENT CHIP=btt_eddy
{% elif 'probe_eddy_current eddy' in printer %}
LDC_CALIBRATE_DRIVE_CURRENT CHIP=eddy
{% endif %}
{% endif %}
[gcode_macro EDDY_HEIGHT_SETUP]
description: Run the BTT Eddy height setup routine.
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% if 'probe_eddy_ng btt_eddy' in printer or 'probe_eddy_ng eddy' in printer %}
{action_raise_error("Operation Cancelled! You appear to have an active Eddy NG probe in your system!")}
{% elif 'cartographer' in printer %}
{action_raise_error("Operation Cancelled! You appear to have an active Cartographer probe in your system!")}
{% else %}
{% if 'xy' not in printer.toolhead.homed_axes %}
G28 X Y
{% endif %}
BED_MESH_CLEAR
G0 X{start_vars.eddy_park_x} Y{start_vars.eddy_park_y} F9000
{% if 'z' not in printer.toolhead.homed_axes %}
SET_KINEMATIC_POSITION Z={printer.toolhead.axis_maximum.z|int -1}
{% endif %}
{% if 'probe_eddy_current btt_eddy' in printer %}
PROBE_EDDY_CURRENT_CALIBRATE CHIP=btt_eddy
{% elif 'probe_eddy_current eddy' in printer %}
PROBE_EDDY_CURRENT_CALIBRATE CHIP=eddy
{% endif %}
{% endif %}
[gcode_macro Pressure_Advance_Test_Mode]
description: Automate the standard Klipper settings for testing PA. Click to ready & then print the Klipper PA test. DO NOT USE FOR ORCA SLICER PA TEST FILE!
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
_CONDITIONAL_HOME
M117 PRESSURE ADVANCE TEST MODE ACTIVE! NOT FOR ORCA TEST
M118 PRESSURE ADVANCE TEST MODE ACTIVE! NOT FOR ORCA TEST
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500
TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.005 # DIRECT DRIVE
SET_DISPLAY_TEXT MSG="The KLIPPER pressure_advance value can then be calculated as pressure_advance = start + measured_height x factor. For example, 0 + 12.90 x 0.005 = 0.064 THIS IS NOT FOR ORCA TEST"
RESPOND TYPE=echo MSG="The KLIPPER pressure_advance value can then be calculated as pressure_advance = start + measured_height x factor. For example, 0 + 12.90 x 0.005 = 0.064 THIS IS NOT FOR ORCA TEST"
[gcode_macro Stepper_Buzz_Cycle]
description: Run a full system or partial system stepper_buzz on each motor one after the other to check setup. Motors always move in a positive direction first then return.
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set buzzX = params.X_BUZZ|default('Yes')|string %}
{% set buzzY = params.Y_BUZZ|default('Yes')|string %}
{% set buzzZ = params.Z_BUZZ|default('Yes')|string %}
{% set buzzZone = params.Z1_BUZZ|default('Yes')|string %}
{% set buzzZtwo = params.Z2_BUZZ|default('Yes')|string %}
{% set buzzZthree = params.Z3_BUZZ|default('Yes')|string %}
{% if buzzX|lower not in ['yes', 'true'] and buzzY|lower not in ['yes', 'true'] and buzzZ|lower not in ['yes', 'true'] and buzzZone|lower not in ['yes',
'true'] and buzzZtwo|lower not in ['yes', 'true'] and buzzZthree|lower not in ['yes', 'true'] %}
{ action_raise_error("No buzz specified, operation cancelled") }
{% endif %}
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
{% if buzzX|lower in ['yes', 'true'] %}
M117 Stepper X Buzz Cycle in 10 Seconds!
M118 Stepper X Buzz Cycle in 10 Seconds!
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper X! READY GO!
M118 Stepper X! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_x
M400
{% elif buzzX|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="X_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="X_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
{% if buzzY|lower in ['yes', 'true'] %}
M117 Stepper Y Buzz Cycle in 10 Seconds
M118 Stepper Y Buzz Cycle in 10 Seconds
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper Y! READY GO!
M118 Stepper Y! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_y
M400
{% elif buzzY|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="Y_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="Y_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
{% if buzzZ|lower in ['yes', 'true'] %}
M117 Stepper Z Buzz Cycle in 10 Seconds
M118 Stepper Z Buzz Cycle in 10 Seconds
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper Z! READY GO!
M118 Stepper Z! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_z
M400
{% elif buzzZ|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="Z_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="Z_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
{% if buzzZone|lower in ['yes', 'true'] %}
{% if ('stepper_z1' in printer.configfile.config) %}
M117 Stepper Z1 Buzz Cycle in 10 Seconds
M118 Stepper Z1 Buzz Cycle in 10 Seconds
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper Z1! READY GO!
M118 Stepper Z1! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_z1
M400
{% else %}
M118 Stepper Z1 is not available to this system
{% endif %}
{% elif buzzZone|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="Z1_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="Z1_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
{% if buzzZtwo|lower in ['yes', 'true'] %}
{% if ('stepper_z2' in printer.configfile.config) %}
M117 Stepper Z2 Buzz Cycle in 10 Seconds
M118 Stepper Z2 Buzz Cycle in 10 Seconds
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper Z2! READY GO!
M118 Stepper Z2! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_z2
M400
{% else %}
M118 Stepper Z2 is not available to this system
{% endif %}
{% elif buzzZtwo|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="Z2_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="Z2_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
{% if buzzZthree|lower in ['yes', 'true'] %}
{% if ('stepper_z3' in printer.configfile.config) %}
M117 Stepper Z3 Buzz Cycle in 10 Seconds
M118 Stepper Z2 Buzz Cycle in 10 Seconds
G4 P5000
M117 5 Seconds!
M118 5 Seconds!
G4 P3000
M117 Stepper Z3! READY GO!
M118 Stepper Z3! READY GO!
G4 P2000
STEPPER_BUZZ STEPPER=stepper_z3
M400
{% else %}
M118 Stepper Z3 is not available to this system
{% endif %}
{% elif buzzZthree|lower in ['no', 'false'] %}
RESPOND TYPE=COMMAND MSG="Z3_BUZZ skipped"
{% else %}
RESPOND TYPE=error MSG="Z3_BUZZ skipped. User input not recognised! Please use yes/no or true/false"
{% endif %}
M117 CYCLE COMPLETE!
M118 CYCLE COMPLETE!
G4 P6000
M117
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
[gcode_macro PID_Tune_Mode]
description: Activates PID tests for the hotend & bed. Choose which to run! Macro auto saves after test. Long test!
gcode:
{% set ceal = printer["gcode_macro CUSTOM_EXPANSION_ACTIVE_LIST"] %}
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
{% set noz_temp = params.NOZZLE_TARGET|default(200)|float %} #<<<<<<<<<<<<<<<<<<< Edit default nozzle test temp (200)
{% set bed_temp = params.BED_TARGET|default(60)|float %} #<<<<<<<<<<<<<<<<<<<< Edit default bed test temp (60)
{% set pid_noz = params.PID_NOZ|default('Yes')|string %}
{% set pid_bed = params.PID_BED|default('Yes')|string %}
{% set x_park = printer.toolhead.axis_maximum.x|float / 2 %}
{% set y_park = printer.toolhead.axis_maximum.y|float / 2 %}
##################################################################
{% if pid_noz|lower not in ['yes', 'true'] and pid_bed|lower not in ['yes', 'true'] %}
{ action_raise_error("No PID specified, operation cancelled") }
{% endif %}
_AUTO_LIGHTS
{% if ceal.ceal_master_enable == True %}
{% if ceal.pre_pid_tune_mode == True %}
_CUSTOM_PRE_PID_Tune_Mode {rawparams}
{% endif %}
{% endif %}
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
G90 # Use absoulte coordinates
M117 PID Tune Mode! Long Test!
M118 PID Tune Mode! Long Test!
_CONDITIONAL_HOME
M400
{% if pid_noz|lower in ['yes', 'true'] %}
G0 X{x_park} Y{y_park} Z5 F9000 # Goes to center of the bed
M106 S155
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
M117 EXTRUDER PID TUNE! PLEASE WAIT!
M118 EXTRUDER PID TUNE! PLEASE WAIT!
PID_CALIBRATE HEATER=extruder TARGET={noz_temp}
M400
M106 S0
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
{% endif %}
{% if pid_bed|lower in ['yes', 'true'] %}
M117 EXTRUDER TEST END! DONT SAVE YET!!
M118 EXTRUDER TEST END! DONT SAVE YET!!
G4 P10000
G0 Z50 F9000
{% if start_vars.neopixel_led == True %}
STATUS_HEATING
{% endif %}
M117 HEAT BED PID TUNE! LONG TEST PLEASE WAIT!
M118 HEAT BED PID TUNE! LONG TEST PLEASE WAIT!
PID_CALIBRATE HEATER=heater_bed TARGET={bed_temp}
M400
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
M117 HEAT BED TEST END!
M118 HEAT BED TEST END!
{% endif %}
G4 P10000
{% if ceal.ceal_master_enable == True %}
{% if ceal.post_pid_tune_mode == True %}
_CUSTOM_POST_PID_Tune_Mode {rawparams}
{% endif %}
{% endif %}
M400
SET_DISPLAY_TEXT MSG="SAVING CONFIG PLEASE WAIT..."
RESPOND TYPE=echo MSG="SAVING CONFIG PLEASE WAIT..."
G4 P5000
SAVE_CONFIG
[gcode_macro Auto_Shaper_Calibrate]
description: Runs the auto shaper test for input shaping
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
##################################################################
_AUTO_LIGHTS
_CONDITIONAL_HOME
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
_Z_PARK # Goes to center of the bed
SHAPER_CALIBRATE
[gcode_macro Resonance_Test_X]
description: Runs the input shaper resonance test for the X axis
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
_AUTO_LIGHTS
_CONDITIONAL_HOME
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
M117 Testing X axis please wait...
TEST_RESONANCES AXIS=X
M117
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
M118 To build graph paste this message into your SSH terminal ............................................ ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
[gcode_macro Resonance_Test_Y]
description: Runs the input shaper resonance test for the Y axis
gcode:
{% set start_vars = printer["gcode_macro _START_VARIABLES"] %}
_AUTO_LIGHTS
_CONDITIONAL_HOME
{% if start_vars.neopixel_led == True %}
STATUS_BUSY
{% endif %}
M117 Testing Y axis please wait...
TEST_RESONANCES AXIS=Y
M117
{% if start_vars.neopixel_led == True %}
STATUS_READY
{% endif %}
M118 To build graph paste this message into your SSH terminal ............................................ ~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png
[gcode_macro _SETUP_HELPERS_VERSION]
variable_demon_setup: "1.5.7"
gcode: