-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanta_M8P_V2_0_Voron_300.cfg
894 lines (727 loc) · 29.5 KB
/
manta_M8P_V2_0_Voron_300.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
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
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
[include mainsail.cfg]
[include stealthburner_leds.cfg]
#####################################################################
# UUID Setting
#####################################################################
[mcu]
canbus_uuid:4b94c57be78e #YOURS WILL BE DIFFERENT - CHANGE IT TO MATCH
[mcu EBBCan]
canbus_uuid: 2f0b1ce14660 #YOURS WILL BE DIFFERENT - CHANGE IT TO MATCH
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 8000
max_z_velocity: 25
max_z_accel: 350
square_corner_velocity: 5.0
#####################################################################
# X/Y Stepper Settings
#####################################################################
## X Stepper on Motor1(B Motor rear left)
[stepper_x]
step_pin: PE6
dir_pin: PE5
enable_pin: !PC14
microsteps: 64
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
homing_positive_dir: true
#endstop_pin: ^PF4
position_max: 300
##--------------------------------------------------------------------
homing_speed: 100 #Max 100
homing_retract_dist: 5
homing_positive_dir: true
[tmc2209 stepper_x]
uart_pin: PC13
interpolate: False
run_current: 1.2
sense_resistor: 0.110
stealthchop_threshold: 0
driver_SGTHRS: 255
diag_pin: ^PF4 # use the same pin that was previously the endstop_pin!
## Y Stepper on Motor2 (A Motor rear right)
[stepper_y]
step_pin: PE2
dir_pin: PE1
enable_pin: !PE4
microsteps: 64
rotation_distance: 40
#endstop_pin: ^PF3
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_min: 0
position_endstop: 300
position_max: 300
##--------------------------------------------------------------------
homing_speed: 100 #MAX 100
homing_retract_dist: 5
homing_positive_dir: true
tmc2209 stepper_y]
uart_pin: PE3
interpolate: False
run_current: 1.2
sense_resistor: 0.110
stealthchop_threshold: 0
driver_SGTHRS: 255
diag_pin: ^^PF3 # use the same pin that was previously the endstop_pin!
#####################################################################
# Z Stepper Settings
#####################################################################
## Z0 Stepper - Front Left on MOTOR3
[stepper_z]
step_pin: PB8
dir_pin: !PB7
enable_pin: !PE0
microsteps: 16
rotation_distance: 40
gear_ratio: 80:16
#endstop_pin: ^PF2
#endstop_pin: ^PF5
endstop_pin: probe:z_virtual_endstop
position_max: 290
##--------------------------------------------------------------------
position_min: -5
homing_speed: 8
second_homing_speed: 3
homing_retract_dist: 3
[tmc2209 stepper_z]
uart_pin: PF9
interpolate: True
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
#[stepper_]## Z1 Stepper - Rear Left on Motor4
[stepper_z1]
step_pin: PB4
dir_pin: PB3
enable_pin: !PB6
#endstop_pin: ^PF1
rotation_distance: 40
gear_ratio: 80:16
microsteps: 16
[tmc2209 stepper_z1]
uart_pin: PB5
interpolate: True
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
## Z2 Stepper - Rear Right on Motor5
[stepper_z2]
step_pin: PG13
dir_pin: PG12
enable_pin: !PG15
rotation_distance: 40
gear_ratio: 80:16
microsteps: 16
[tmc2209 stepper_z2]
uart_pin: PG14
interpolate: True
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
## Z3 Stepper - Front Right on Motor6
[stepper_z3]
step_pin: PG9
dir_pin: PD7
enable_pin: !PG11
rotation_distance: 40
gear_ratio: 80:16
microsteps: 16
[tmc2209 stepper_z3]
uart_pin: PG10
interpolate: True
run_current: 1.0
sense_resistor: 0.110
stealthchop_threshold: 0
[extruder]
step_pin: EBBCan: PD0
dir_pin: EBBCan: PD1
enable_pin: !EBBCan: PD2
microsteps: 16
rotation_distance: 21.928277 # 22.6789511 ORIGINAL SETTING
gear_ratio: 50:10
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: EBBCan: PB13
pressure_advance: 0.036
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 300
min_extrude_temp: 0 ## use this for estep calbration only##
#min_extrude_temp: 230 ## enable this ones you have done extruder calibration steps and comment out the above line.
max_extrude_cross_section: 5# KAMP setting needed
# NTC100K B3950
sensor_type: Generic 3950 #ATC Semitec 104NT-4-R025H42G
sensor_pin: EBBCan: PA3 #if you renamed your board make sure to match the board assignment in front of the pin
# PT100 / PT1000
# sensor_type: MAX31865
# sensor_pin: EBBCan: PA4
# spi_bus: spi1
# rtd_nominal_r: 100
# rtd_reference_r: 430
# rtd_num_of_wires: 2
[tmc2209 extruder]
uart_pin: EBBCan: PA15
run_current: 0.3
stealthchop_threshold: 999999
[fan]
pin: EBBCan: PA1
kick_start_time: 0.5
off_below: 0.5
[heater_fan hotend_fan]
pin: EBBCan: PA0
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
## If you are experiencing back flow, you can reduce fan_speed
#fan_speed: 1.0
[heater_bed]
heater_pin: PA1
sensor_type: Generic 3950
sensor_pin: PB1
max_power: 1.0
min_temp: 0
max_temp: 120
control: pid
pid_kp: 58.437
pid_ki: 2.347
pid_kd: 363.769
[temperature_sensor buildplate]
sensor_type: Generic 3950
sensor_pin: PB0
min_temp: -40
max_temp: 120
[temperature_sensor chamber]
sensor_type: Generic 3950
sensor_pin: PC5
min_temp: -40
max_temp: 120
[temperature_sensor EBB_NTC]
sensor_type: Generic 3950
sensor_pin: EBBCan: PA2
min_temp: -40
max_temp: 100
[temperature_sensor CB1]
sensor_type: temperature_host
[probe]
pin: ^EBBCan: PB5
z_offset: 0
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.006
samples_tolerance_retries: 3
##################################################################
# TAP MACRO TO CHECK OVER 150DEGREES #
##################################################################
## THE BELOW CODE STOPS THE TAP HOMING INTO THE BED AT PROBE TEMPS OVER 150°C##
activate_gcode:
{% set PROBE_TEMP = 150 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}
{% if TARGET_TEMP > PROBE_TEMP %}
{ action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
M109 S{ PROBE_TEMP }
{% else %}
# Temperature target is already low enough, but nozzle may still be too hot.
{% if ACTUAL_TEMP > MAX_TEMP %}
{ action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
{% endif %}
{% endif %}
[multi_pin controller_fans]
pins: PF7,PF9
[controller_fan controller_fan]
## Controller fan
pin: multi_pin:controller_fans
max_power: 0.4
kick_start_time: 0.5
heater: heater_bed
[heater_fan nevermore_fan]
# Exhaust fan - Nevermore Filter
pin: PF8 #3rd from left below voltage jumpers
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed
heater_temp: 60
fan_speed: 1.0
[quad_gantry_level]
gantry_corners:
-60,-10
360,370
points:
50,25
50,225
250,225
250,25
#--------------------------------------------------------------------
speed: 300
horizontal_move_z: 10
retries: 5
retry_tolerance: 0.0075
max_adjust: 10
[bed_mesh]
speed: 300
horizontal_move_z: 5
mesh_min: 10,10
mesh_max: 290,290
probe_count: 9,9
algorithm: bicubic
bicubic_tension: 0.2
[adxl345]
cs_pin: EBBCan: PB12
spi_software_sclk_pin: EBBCan: PB10
spi_software_mosi_pin: EBBCan: PB11
spi_software_miso_pin: EBBCan: PB2
axes_map: z,-y,x
[resonance_tester]
probe_points: 150, 150, 20
accel_chip: adxl345
[display]
# mini12864 LCD Display
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
rst_pin: EXP1_5
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
contrast: 63
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP2_6
spi_software_sclk_pin: EXP2_2
[neopixel btt_mini12864]
# To control Neopixel RGB in mini12864 display
pin: EXP1_6
chain_count: 3
initial_RED: 0.1
initial_GREEN: 0.5
initial_BLUE: 0.0
color_order: RGB
## Set RGB values on boot up for each Neopixel.
## Index 1 = display, Index 2 and 3 = Knob
[delayed_gcode setdisplayneopixel]
initial_duration: 1
gcode:
SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
#################################################
################### Disco Led ###################
#################################################
[neopixel disco1]
pin: PD15
chain_count: 25
color_order: BGRW
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0
[neopixel disco2]
pin: PB15
chain_count: 25
color_order: BGRW
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0
[board_pins]
aliases:
# EXP1 header
EXP1_1=PE7, EXP1_2=PG1,
EXP1_3=PG0, EXP1_4=PF15,
EXP1_5=PF14, EXP1_6=PF13, # Slot in the socket on this side
EXP1_7=PF12, EXP1_8=PF11,
EXP1_9=<GND>, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PE13, EXP2_2=PE12,
EXP2_3=PE15, EXP2_4=PE11,
EXP2_5=PE10, EXP2_6=PE14, # Slot in the socket on this side
EXP2_7=PE8, EXP2_8=<RST>,
EXP2_9=<GND>, EXP2_10=<NC>
##------------------------------------------------------------------------
# Enable object exclusion
[exclude_object]
# Enable arcs support
[gcode_arcs]
resolution: 0.3
#####################################################################
# Macros
#####################################################################
#KNOMI#
#[gcode_macro BED_MESH_CALIBRATE]
#rename_existing: BED_MESH_CALIBRATE_BASE
#variable_probing:False
#gcode:
# SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=probing VALUE=True
# BED_MESH_CALIBRATE_BASE
# SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=probing VALUE=False
#[gcode_macro G28]
#rename_existing: G0028
#variable_homing:False
#gcode:
# SET_GCODE_VARIABLE MACRO=G28 VARIABLE=homing VALUE=True
# G0028
# SET_GCODE_VARIABLE MACRO=G28 VARIABLE=homing VALUE=False
# REV 1.4 07-10-23
# NEOPIXEL_DISPLAY LED="disco1" TYPE=bed_temp MODE=glow just like this
##########################
# SPEED BABY #
##########################
# Home, get position, throw around toolhead, home again.
# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured.
# We only measure to a full step to accomodate for endstop variance.
# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10
[gcode_macro TEST_SPEED]
gcode:
# Speed
{% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %}
# Iterations
{% set iterations = params.ITERATIONS|default(5)|int %}
# Acceleration
{% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %}
# Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions)
{% set bound = params.BOUND|default(20)|int %}
# Size for small pattern box
{% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %}
# Large pattern
# Max positions, inset by BOUND
{% set x_min = printer.toolhead.axis_minimum.x + bound %}
{% set x_max = printer.toolhead.axis_maximum.x - bound %}
{% set y_min = printer.toolhead.axis_minimum.y + bound %}
{% set y_max = printer.toolhead.axis_maximum.y - bound %}
# Small pattern at center
# Find X/Y center point
{% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %}
{% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %}
# Set small pattern box around center point
{% set x_center_min = x_center - (smallpatternsize/2) %}
{% set x_center_max = x_center + (smallpatternsize/2) %}
{% set y_center_min = y_center - (smallpatternsize/2) %}
{% set y_center_max = y_center + (smallpatternsize/2) %}
# Save current gcode state (absolute/relative, etc)
SAVE_GCODE_STATE NAME=TEST_SPEED
# Output parameters to g-code terminal
{ action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) }
# Home and get position for comparison later:
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28
# QGL if not already QGLd (only if QGL section exists in config)
{% if printer.configfile.settings.quad_gantry_level %}
{% if printer.quad_gantry_level.applied == False %}
QUAD_GANTRY_LEVEL
#G28 Z ### <--commented out
{% endif %}
{% endif %}
# Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24)
G90
G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60}
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 ### <--changed from G28 XY
G90 ### <--added to correct issue 66
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
G4 P1000
GET_POSITION
# Go to starting position
G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}
# Set new limits
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
{% for i in range(iterations) %}
# Large pattern diagonals
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
# Large pattern box
G0 X{x_min} Y{y_min} F{speed*60}
G0 X{x_min} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_max} F{speed*60}
G0 X{x_max} Y{y_min} F{speed*60}
# Small pattern diagonals
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
# Small patternbox
G0 X{x_center_min} Y{y_center_min} F{speed*60}
G0 X{x_center_min} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_max} F{speed*60}
G0 X{x_center_max} Y{y_center_min} F{speed*60}
{% endfor %}
# Restore max speed/accel/accel_to_decel to their configured values
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
# Re-home and get position again for comparison:
M400 # Finish moves - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/66
G28 # This is a full G28 to fix an issue with CoreXZ - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/12
# Go to XY home positions (in case your homing override leaves it elsewhere)
G90
G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60}
G4 P1000
GET_POSITION
# Restore previous gcode state (absolute/relative, etc)
RESTORE_GCODE_STATE NAME=TEST_SPEED
######################################################################
# Filament Change
######################################################################
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.
[pause_resume]
[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
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
[gcode_macro DISABLE_STEPPERS]
gcode:
M84
[gcode_macro CHANGE_FILAMENT]
gcode:
G0 X100 Y0 Z100
[gcode_macro PARK]
gcode:
{% set th = printer.toolhead %}
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y//2} Z30
[gcode_macro G32]
gcode:
SAVE_GCODE_STATE NAME=STATE_G32
G90
G28
QUAD_GANTRY_LEVEL
G28
PARK
RESTORE_GCODE_STATE NAME=STATE_G32
[gcode_macro INPUT_SHAPER_CALIBRATE]
gcode:
SHAPER_CALIBRATE
# Enable object exclusion
[exclude_object]
# Enable arcs support
[gcode_arcs]
resolution: 0.3
[gcode_macro OFF]
gcode:
M84 ; turn steppers off
TURN_OFF_HEATERS ; turn bed / hotend off
M107 ; turn print cooling fan off
#SET_PIN PIN=nevermore VALUE=0 ; turn nevermore fan off
#SET_PIN PIN=neopixel disco1 VALUE=0 ; turn case light off
#SET_PIN PIN=neopixel disco2 VALUE=0 ; turn case light off
#SET_FAN_SPEED FAN=Exhaust SPEED=0 ; turn exhaust fan off
#SET_FAN_SPEED FAN=BedFans SPEED=0 ; bed fan off
#SET_PIN PIN=caselight VALUE=0 ; turn case light off
# [delayed_gcode setdiscosticks]
#initial_duration: 1
#gcode:
#NEOPIXEL_DISPLAY LED="disco1" TYPE=extruder_temp MODE=glow
#NEOPIXEL_DISPLAY LED="disco2" TYPE=bed_temp MODE=glow
################################################
###### STANDARD INPUT_SHAPER CALIBRATIONS ######
################################################
# Written by Frix_x#0161 #
# @version: 1.3
# CHANGELOG:
# v1.3: added possibility to override the default parameters
# v1.2: added EXCITATE_AXIS_AT_FREQ to hold a specific excitating frequency on an axis and diagnose mechanical problems
# v1.1: added M400 to validate that the files are correctly saved to disk
# v1.0: first version of the automatic input shaper workflow
# -------------------------------------------------------------------------------------------------------------------------
# If you want to use it into your own config, please install it as a standalone macro as described in the
# installation section of this file: docs > features > is_workflow.md
# -------------------------------------------------------------------------------------------------------------------------
### What is it ? ###
# This macro helps you to configure the input shaper algorithm of Klipper by running the tests sequencially and calling an automatic script
# that generate the graphs, manage the files and so on. It's basically a fully automatic input shaper calibration workflow.
# Results can be found in your config folder using FLuidd/Maisail file manager.
# The goal is to make it easy to set, share and use it.
# Usage:
# 1. Call the AXES_SHAPER_CALIBRATION macro, wait for it to end and compute the graphs. Then look for the results in the results folder.
# 2. Call the BELTS_SHAPER_CALIBRATION macro, wait for it to end and compute the graphs. Then look for the results in the results folder.
# 3. If you find out some strange noise, you can use the EXCITATE_AXIS_AT_FREQ macro to diagnose the origin
[gcode_macro AXES_SHAPER_CALIBRATION]
description: Run standard input shaper test for all axes
gcode:
{% set verbose = params.VERBOSE|default(true) %}
{% set min_freq = params.FREQ_START|default(5)|float %}
{% set max_freq = params.FREQ_END|default(133.3)|float %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=X FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=Y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=SHAPER
[gcode_macro BELTS_SHAPER_CALIBRATION]
description: Run custom demi-axe test to analyze belts on CoreXY printers
gcode:
{% set verbose = params.VERBOSE|default(true) %}
{% set min_freq = params.FREQ_START|default(5)|float %}
{% set max_freq = params.FREQ_END|default(133.33)|float %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=b FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=a FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=BELTS
[gcode_macro EXCITATE_AXIS_AT_FREQ]
description: Maintain a specified input shaper excitating frequency for some time to diagnose vibrations
gcode:
{% set FREQUENCY = params.FREQUENCY|default(25)|int %}
{% set TIME = params.TIME|default(10)|int %}
{% set AXIS = params.AXIS|default("x")|string|lower %}
TEST_RESONANCES OUTPUT=raw_data AXIS={AXIS} FREQ_START={FREQUENCY-1} FREQ_END={FREQUENCY+1} HZ_PER_SEC={1/(TIME/3)}
M400
#####################################################################
# print_start macro
#####################################################################
## *** THINGS TO UNCOMMENT: ***
## Bed mesh (2 lines at 2 locations)
## Z_TILT_ADJUST if your printer is a Trident
## Quad gantry level if your printer is a V2
## Nevermore - if you have one
[gcode_shell_command plot_graph]
command: bash /home/biqu/printer_data/config/scripts/plot_graphs.sh
timeout: 500.0
verbose: True
#[delayed_gcode setdiscosticks]
#initial_duration: 1
#gcode:
# NEOPIXEL_DISPLAY LED="disco1" TYPE=extruder_temp MODE=glow
# NEOPIXEL_DISPLAY LED="disco2" TYPE=bed_temp MODE=glow
[gcode_macro PRINT_START]
#YOU MUST ADD THES LINES TO super SLICER PRINT START COED IN THE PRTER SETTINGS SECTION OR NOT OF THIS WLL WORK - EACH LINE MUST BE UNCOMMENTED
#M104 S0 ; Stops PrusaSlicer from sending temp waits separately
#M140 S0
#print_start EXTRUDER=[first_layer_temperature[initial_extruder]] BED=[first_layer_bed_temperature]
gcode:
# This part fetches data from your slicer. Such as bed temp, extruder temp, chamber temp and size of your printer.
{% set target_bed = params.BED|int %}
{% set target_extruder = params.EXTRUDER|int %}
{% set target_chamber = params.CHAMBER|default("40")|int %}
{% set x_wait = printer.toolhead.axis_maximum.x|float / 2 %}
{% set y_wait = printer.toolhead.axis_maximum.y|float / 2 %}
# Homes the printer, sets absolute positioning and updates the Stealthburner leds.
SET_DISPLAY_TEXT MSG="HOMING ALL" # Displays info
STATUS_HOMING # Sets SB-leds to homing-mode
G28 # Full home (XYZ)
G90 # Absolut position
## Uncomment for bed mesh (1 of 2)
BED_MESH_CLEAR # Clears old saved bed mesh (if any)
SET_DISPLAY_TEXT MSG="CLEAR MESH" # Displays info
# Checks if the bed temp is higher than 90c - if so then trigger a heatsoak.
{% if params.BED|int > 90 %}
SET_DISPLAY_TEXT MSG="BED HEAT: {target_bed}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
M106 S255 # Turns on the PT-fan
## Uncomment if you have a Nevermore.
SET_PIN PIN=nevermore VALUE=1 # Turns on the nevermore
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M190 S{target_bed} # Sets the target temp for the bed
SET_DISPLAY_TEXT MSG="Heatsoak: {target_chamber}c" # Displays info
TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={target_chamber} # Waits for chamber to reach desired temp
# If the bed temp is not over 90c, then it skips the heatsoak and just heats up to set temp with a 5min soak
{% else %}
SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M190 S{target_bed} # Sets the target temp for the bed
SET_DISPLAY_TEXT MSG="Soak for 1min" # Displays info
G4 P6000 # Waits 5 min for the bedtemp to stabilize
{% endif %}
# Heating nozzle to 150 degrees. This helps with getting a correct Z-home
SET_DISPLAY_TEXT MSG="TAPPITY TaP 150c" # Displays info
M109 S150 # Heats the nozzle to 150c
## Uncomment for Trident (Z_TILT_ADJUST)
#SET_DISPLAY_TEXT MSG="Z-tilt adjust" # Displays info
#STATUS_LEVELING # Sets SB-leds to leveling-mode
#Z_TILT_ADJUST # Levels the buildplate via z_tilt_adjust
#G28 Z # Homes Z again after z_tilt_adjust
## Uncomment for V2 (Quad gantry level AKA QGL)
SET_DISPLAY_TEXT MSG="QGL" # Displays info
STATUS_LEVELING # Sets SB-leds to leveling-mode
quad_gantry_level # Levels the buildplate via QGL
SET_DISPLAY_TEXT MSG="CALIBRATING Z" # Displays info
status_calibrating_z
G28 Z # Homes Z again after QGL
## Uncomment for Klicky auto-z
#CALIBRATE_Z # Calibrates Z-offset with klicky
#SET_DISPLAY_TEXT MSG="Z-offset" # Displays info
## Uncomment for bed mesh (2 of 2)
SET_DISPLAY_TEXT MSG="BED MESHING" # Displays info
STATUS_MESHING # Sets SB-leds to bed mesh-mode
bed_mesh_calibrate # Starts bed mesh
# Heats up the nozzle up to target via data from slicer
SET_DISPLAY_TEXT MSG="Hotend: {target_extruder}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M107 # Turns off partcooling fan
M109 S{target_extruder} # Heats the nozzle to printing temp
SET_DISPLAY_TEXT MSG="RUBBA-SCRUB!" # Displays info
status_cleaning
CLEAN_NOZZLE
# Gets ready to print by doing a purge line and updating the SB-leds
SET_DISPLAY_TEXT MSG="Printer goes brr" # Displays info
STATUS_PRINTING # Sets SB-leds to printing-mode
G0 X{x_wait - 50} Y4 F10000 # Moves to starting point
G0 Z0.4 # Raises Z to 0.4
G91 # Incremental positioning
G1 X100 E20 F1000 # Purge line
G90 # Absolut position
##------------------------------------------------------------------------------------------##
################################ END PRINT ###################################################
##------------------------------------------------------------------------------------------##
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
# safe anti-stringing move coords
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
SAVE_GCODE_STATE NAME=STATE_PRINT_END
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-5.0 F1800 ; retract filament
TURN_OFF_HEATERS
G90 ; absolute positioning
G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
M107 ; turn off fan
BED_MESH_CLEAR
SET_DISPLAY_TEXT MSG="NEVERMORE SHUT DOWN" # Displays info
SET_PIN PIN=nevermore VALUE=0 # Turns OFF the nevermore
SET_DISPLAY_TEXT MSG="JOB 100% COMPLETE" # Displays info
status_off
OFF
RESTORE_GCODE_STATE NAME=STATE_PRINT_END
# z off was -0.385
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = -0.405