-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer (CartoTAP).cfg
910 lines (806 loc) · 39.9 KB
/
printer (CartoTAP).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
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
## This settings need following plugins:
## Carto Touch: https://docs.cartographer3d.com/cartographer-probe/installation-and-setup/installation/migrating-from-cartographer-to-scanner
## TMC-Autotune: https://github.com/andrewmcgr/klipper_tmc_autotune
## AWD Motor-Sync: https://github.com/MRX8024/motors-sync
## Shaketune: https://github.com/Frix-x/klippain-shaketune
## KAMP: https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging
## (optional for testing): https://github.com/Anonoei/klipper_auto_speed
####################################################################
## extra components:
## silicon nozzle cleaner: https://just-printing.de/products/nozzle-wiper?_pos=2&_sid=5a1aaf391&_ss=r&variant=49214868259162
####################################################################
## slicer settings: activate firmware rectraction / activate aux fan
## startcode: PRINT_START EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single] Chamber=[chamber_temperature] PRINT_MIN={first_layer_print_min[0]},{first_layer_print_min[1]} PRINT_MAX={first_layer_print_max[0]},{first_layer_print_max[1]}
#####################################################################
## printer settings
#####################################################################
[include mainsail.cfg] # Include configuration from mainsail.cfg file
[include reshelper.cfg]
[include nozzle_clean.cfg]
[include KAMP_Settings.cfg]
[include shell_command.cfg]
[include gshellcode.cfg]
#####################################################################
# Cartographer V3 (ADXL345)
#####################################################################
[scanner] # update cartographer to scanner
canbus_uuid:171819a3e4ff
speed: 2.0
backlash_comp: 0.02
x_offset: 0.0
y_offset: 21.1
calibration_method: touch
sensor: cartographer
sensor_alt: carto
mesh_runs: 2
[temperature_sensor Cartographer_MCU]
sensor_type: temperature_mcu
sensor_mcu: scanner
min_temp: 0
max_temp: 105
[adxl345]
cs_pin: scanner:PA3 # Chip select pin for ADXL345 accelerometer
spi_bus: spi1 # SPI bus used for communication
[resonance_tester]
accel_chip: adxl345 # Specifies ADXL345 accelerometer for resonance testing
probe_points:
175, 175, 20 # Coordinates of the probe points for resonance testing
#####################################################################
## Bed Mesh Calibration
#####################################################################
[bed_mesh]
speed: 350 # Calibration speed
horizontal_move_z: 5 # Z-axis movement speed
mesh_min: 45,25 # Minimum calibration point coordinates x, y
mesh_max: 290,290 # Maximum calibration point coordinates x, y
probe_count: 5,5 # Number of sampling points (7X7 is 49 points)
mesh_pps: 2,2 # Additional sampling points
algorithm: bicubic # Algorithm model
bicubic_tension: 0.2 # Algorithm interpolation, no movement
zero_reference_position: 175, 175
################################################################
[screws_tilt_adjust]
screw1: 30, 30
screw1_name: front left screw
screw2: 155, 30
screw2_name: front right screw
screw3: 155, 190
screw3_name: rear right screw
screw4: 30, 190
screw4_name: rear left screw
horizontal_move_z: 10.
speed: 50.
screw_thread: CW-M3
[virtual_sdcard]
path: /home/biqu/printer_data/gcodes # Path to the virtual SD card directory
on_error_gcode: CANCEL_PRINT # G-code to execute on error (defined in CANCEL_PRINT macro)
[gcode_arcs]
resolution: 0.3 # Arc interpolation resolution, handles G2/G3 commands
[exclude_object] # Exclude object for cancellation
[force_move]
enable_force_move: true # Enable force move feature
[input_shaper]
shaper_type_x: 3hump_ei
shaper_freq_x: 85.6
shaper_type_y: ei
shaper_freq_y: 73
[printer] # Printer configuration
kinematics: corexy # Printer type: corexy
max_velocity: 500 # Maximum velocity (max 300)
max_accel: 5000 # Maximum acceleration (max 4000)
max_z_velocity: 50 # Maximum Z-axis velocity
max_z_accel: 100 # Maximum Z-axis acceleration
minimum_cruise_ratio: 0.5 # Default 0.5
square_corner_velocity: 5 # Square corner velocity
#####################################################################
## TMC autotune
#####################################################################
[autotune_tmc stepper_x]
motor: siboor-42sth48-2504(s45)
[autotune_tmc stepper_y]
motor: siboor-42sth48-2504(s45)
[autotune_tmc stepper_x1]
motor: siboor-42sth48-2504(s45)
[autotune_tmc stepper_y1]
motor: siboor-42sth48-2504(s45)
[autotune_tmc extruder]
motor: ldo-36sth20-1004ahg-9T
#####################################################################
## Shaketune
#####################################################################
[shaketune]
# result_folder: ~/printer_data/config/ShakeTune_results
# The folder where the results will be stored. It will be created if it doesn't exist.
number_of_results_to_keep: 3
# The number of results to keep in the result_folder. The oldest results will
# be automatically deleted after each runs.
# keep_raw_csv: False
# If True, the raw CSV files will be kept in the result_folder alongside the
# PNG graphs. If False, they will be deleted and only the graphs will be kept.
show_macros_in_webui: True
# Mainsail and Fluidd doesn't create buttons for "system" macros that are not in the
# printer.cfg file. If you want to see the macros in the webui, set this to True.
# timeout: 300
# The maximum time in seconds to let Shake&Tune process the CSV files and generate the graphs.
#####################################################################
## auto speed
#####################################################################
[auto_speed]
#axis: diag_x, diag_y ; One or multiple of `x`, `y`, `diag_x`, `diag_y`, `z`
margin: 40 ; How far away from your axes to perform movements
#settling_home: 1 ; Perform settling home before starting Auto Speed
#max_missed: 1.0 ; Maximum full steps that can be missed
#endstop_samples: 3 ; How many endstop samples to take for endstop variance
accel_min: 1000.0 ; Minimum acceleration test may try
accel_max: 500000.0 ; Maximum acceleration test may try
#accel_accu: 0.05 ; Keep binary searching until the result is within this percentage
velocity_min: 50.0 ; Minimum velocity test may try
velocity_max: 1000.0 ; Maximum velocity test may try
velocity_accu: 0.05 ; Keep binary searching until the result is within this percentage
#derate: 0.8 ; Derate discovered results by this amount
#validate_margin: Unset ; Margin for VALIDATE, Defaults to margin
#validate_inner_margin: 20.0 ; Margin for VALIDATE inner pattern
#validate_iterations: 50 ; Perform VALIDATE pattern this many times
#results_dir: ~/printer_data/config ; Destination directory for graphs
#####################################################################
## EBB SB2209(RP2040) Config
#####################################################################
[mcu EBBCan]
canbus_uuid: b9fb3ee7dcd4 # Unique identifier for the CAN bus interface
# Acceleration sensor on cartographer sensor is recommended,
# so the configuration of EBB is commented
# [adxl345]
# cs_pin: EBBCan:gpio1 # Chip select pin
# spi_software_sclk_pin: EBBCan:gpio2 # SPI clock pin
# spi_software_mosi_pin: EBBCan:gpio0 # SPI master out slave in pin
# spi_software_miso_pin: EBBCan:gpio3 # SPI master in slave out pin
# axes_map: z,-y,x # Axis mapping settings
##SHAPER_CALIBRATE
# [resonance_tester] # Resonance tester configuration
# probe_points: 175, 175, 20 # Probe point positions
# accel_chip: adxl345 # Acceleration chip used
[mcu] # Main MCU configuration
#serial: /dev/serial/by-id/usb-Klipper_stm32h723xx_slipper-if00 # Serial port setting, this line is commented out
canbus_uuid: 044efcb2c424 # CAN bus UUID
canbus_interface: can0 # CAN bus interface
#####################################################################
## Temperature Monitoring
#####################################################################
[temperature_sensor EBB_NTC] # EBB_NTC temperature sensor configuration
sensor_type: Generic 3950 # Sensor type
sensor_pin: EBBCan:gpio28 # Sensor pin
[temperature_sensor BTT-MCU] # BTT-MCU temperature sensor configuration
sensor_type: temperature_mcu # Sensor type
[temperature_sensor SOC] # BTT-PI temperature sensor configuration
sensor_type: temperature_host # Sensor type
#####################################################################
## Filament Monitoring
#####################################################################
#[filament_switch_sensor pregate]
#pause_on_runout: True
#switch_pin: !EBBCan:gpio21
[filament_switch_sensor pregate]
pause_on_runout: True
switch_pin: ^EBBCan:gpio6
#####################################################################
## X Axis
#####################################################################
[stepper_x]
step_pin: PE6 # X-axis motor pulse pin setting
dir_pin: !PE5 # X-axis motor direction pin setting
enable_pin: !PC14 # X-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 40 # Active pulley circumference mm (2GT-20T pulley 40, 2GT-16T pulley 32)
full_steps_per_rotation: 200 # Number of pulses required for a single motor revolution (1.8 degree motor: 200, 0.9 degree motor: 400)
endstop_pin: EBBCan:gpio24 # Limit switch PIN setting (X-)
position_min: 0 # X-axis minimum travel - software limit
position_endstop: 350 # Mechanical reset point coordinates for X-axis
position_max: 350 # X-axis maximum travel - software limit
homing_speed: 150 # Homing speed maximum 100
homing_retract_dist: 5 # Setback distance after the first trigger of the homing switch
homing_positive_dir: true # Direction of homing (generally no change required)
[tmc2240 stepper_x]
cs_pin: PC13 # Chip select pin
spi_software_sclk_pin: PG8 # SPI clock pin
spi_software_mosi_pin: PG6 # SPI master out slave in pin
spi_software_miso_pin: PG7 # SPI master in slave out pin
driver_TPFD: 0 # Driver setting
run_current: 1.7 # Running current
interpolate: true # Interpolation
stealthchop_threshold: 0
[stepper_x1]
step_pin: PD4 # X1-axis motor pulse pin setting
dir_pin: !PD3 # X1-axis motor direction pin setting
enable_pin: !PD6 # X1-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 40 # Active pulley circumference mm (2GT-20T pulley 40, 2GT-16T pulley 32)
full_steps_per_rotation: 200 # Number of pulses required for a single motor revolution (1.8 degree motor: 200, 0.9 degree motor: 400)
[tmc2240 stepper_x1]
cs_pin: PD5 # Chip select pin
spi_software_sclk_pin: PG8 # SPI clock pin
spi_software_mosi_pin: PG6 # SPI master out slave in pin
spi_software_miso_pin: PG7 # SPI master in slave out pin
driver_TPFD: 0 # Driver setting
run_current: 1.7 # Running current
interpolate: true # Interpolation
stealthchop_threshold: 0
#####################################################################
## Y Axis
#####################################################################
[stepper_y]
step_pin: PC7 # Y-axis motor pulse pin setting
dir_pin: !PC8 # Y-axis motor direction pin setting
enable_pin: !PD2 # Y-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 40 # Active pulley circumference mm (2GT-20T pulley 40, 2GT-16T pulley 32)
full_steps_per_rotation: 200 # Number of pulses required for a single motor revolution (1.8 degree motor: 200, 0.9 degree motor: 400)
endstop_pin: PF2 # Limit switch PIN setting (Y-)
position_min: 0 # Y-axis minimum travel - software limit
position_endstop: 360 # Mechanical reset point coordinates for Y-axis (change to 350 for 350 models)
position_max: 360 # Y-axis maximum travel - software limit (change to 350 for 350 models)
homing_speed: 150 # Homing speed maximum 100
homing_retract_dist: 5 # Setback distance after the first trigger of the homing switch
homing_positive_dir: true # Direction of homing (generally no change required)
[tmc2240 stepper_y]
cs_pin: PC6 # Chip select pin
spi_software_sclk_pin: PG8 # SPI clock pin
spi_software_mosi_pin: PG6 # SPI master out slave in pin
spi_software_miso_pin: PG7 # SPI master in slave out pin
driver_TPFD: 0 # Driver setting
run_current: 1.7 # Running current
interpolate: true # Interpolation
stealthchop_threshold: 0
[stepper_y1]
step_pin: PE2 # Y1-axis motor pulse pin setting
dir_pin: !PE1 # Y1-axis motor direction pin setting
enable_pin: !PE4 # Y1-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 40 # Active pulley circumference mm (2GT-20T pulley 40, 2GT-16T pulley 32)
full_steps_per_rotation: 200 # Number of pulses required for a single motor revolution (1.8 degree motor: 200, 0.9 degree motor: 400)
[tmc2240 stepper_y1]
cs_pin: PE3 # Chip select pin
spi_software_sclk_pin: PG8 # SPI clock pin
spi_software_mosi_pin: PG6 # SPI master out slave in pin
spi_software_miso_pin: PG7 # SPI master in slave out pin
driver_TPFD: 0 # Driver setting
run_current: 1.7 # Running current
interpolate: true # Interpolation
stealthchop_threshold: 0
#####################################################################
# -------z1-------
# | |
# | |
# | |
# | |
# | |
# | |
# z0--- display ---z2
#####################################################################
## Z0 Axis
#####################################################################
[stepper_z]
step_pin: PB8 # Z0-axis motor pulse pin setting
dir_pin: !PB7 # Z0-axis motor direction pin setting
enable_pin: !PE0 # Z0-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 4 # Active pulley circumference mm
endstop_pin: probe:z_virtual_endstop # Limit switch PIN setting (Z0-)
position_max: 235 # Z0-axis maximum travel - software limit
position_min: -5.0 # Z0-axis minimum travel - software limit
homing_speed: 20 # Homing speed
homing_retract_dist: 0 # Setback distance after the first trigger of the homing switch
homing_positive_dir: False # Direction of homing (generally no change required)
#--------------------------------------------------------------------
[tmc2209 stepper_z] # TMC2209 driver settings
uart_pin: PB9 # Driver communication port
interpolate: false # Enable 256 microstep interpolation
run_current: 0.8 # Motor running current (mA)
hold_current: 0.8 # Holding current (mA)
#--------------------------------------------------------------------
[stepper_z1]
step_pin: PB4 # Z1-axis motor pulse pin setting
dir_pin: !PB3 # Z1-axis motor direction pin setting
enable_pin: !PB6 # Z1-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 4 # Active pulley circumference mm
#--------------------------------------------------------------------
[tmc2209 stepper_z1] # TMC2209 driver settings
uart_pin: PB5 # Driver communication port
interpolate: false # Enable 256 microstep interpolation
run_current: 0.8 # Motor running current (mA)
hold_current: 0.8 # Holding current (mA)
#--------------------------------------------------------------------
[stepper_z2]
step_pin: PG13 # Z2-axis motor pulse pin setting
dir_pin: !PG12 # Z2-axis motor direction pin setting
enable_pin: !PG15 # Z2-axis motor enable pin setting
microsteps: 128 # Motor microsteps setting
rotation_distance: 4 # Active pulley circumference mm
#--------------------------------------------------------------------
[tmc2209 stepper_z2] # TMC2209 driver settings
uart_pin: PG14 # Driver communication port
interpolate: false # Enable 256 microstep interpolation
run_current: 0.8 # Motor running current (mA)
hold_current: 0.8 # Holding current (mA)
#####################################################################
## Extruder Motor
#####################################################################
[extruder]
step_pin: EBBCan:gpio18 # Step pin
dir_pin: EBBCan:gpio19 # Direction pin, "!" indicates logic inversion
enable_pin: !EBBCan:gpio17 # Enable pin, "!" indicates logic inversion
full_steps_per_rotation: 200 # Number of pulses required for a single motor revolution (1.8 degree motor: 200, 0.9 degree motor: 400)
microsteps: 16 # Microsteps setting
## When calibrating the extruder, update the following value
## Assume you request 100mm feed but get 98mm,
## New value = old value x (actual extruded length / target length)
## 22.6789511 is our recommended value
gear_ratio: 9:1
rotation_distance: 47.088
#gear_ratio: 50:10 # Gear ratio CW2
#rotation_distance: 22.6789511 # Rotation distance CW2
nozzle_diameter: 0.400 # Nozzle diameter
filament_diameter: 1.750 # Filament diameter
heater_pin: EBBCan:gpio7 # Heater pin
#control: pid # Control method
#pid_Kp: 24.328 # Proportional parameter of the PID controller
#pid_Ki: 1.908 # Integral parameter of the PID controller
#pid_Kd: 77.543 # Derivative parameter of the PID controller
min_temp: 0 # Minimum temperature
max_temp: 350 # Maximum temperature
min_extrude_temp: 170 # Minimum extrude temperature
pressure_advance: 0.05 # Pressure advance - try to keep pressure below 1.0
pressure_advance_smooth_time: 0.040 # Pressure advance smooth time - default is 0.040
max_extrude_cross_section: 10
## Nozzle temperature PID calibration command: "PID_CALIBRATE HEATER=extruder TARGET=245"
sensor_type: MAX31865 # Temperature sensor type
sensor_pin: EBBCan:gpio9 # Sensor pin
spi_software_sclk_pin: EBBCan:gpio10 # SPI clock pin
spi_software_mosi_pin: EBBCan:gpio8 # SPI master out slave in pin
spi_software_miso_pin: EBBCan:gpio11 # SPI master in slave out pin
rtd_nominal_r: 1000 # RTD nominal resistance
rtd_reference_r: 4300 # RTD reference resistance
rtd_num_of_wires: 2 # Number of wires for the RTD
[tmc2209 extruder]
uart_pin: EBBCan:gpio20 # UART communication pin
interpolate: true # Enable 256 microstep interpolation
run_current: 0.7 # Running current
#--------------------------------------------------------------------
[verify_heater extruder] # Heater block temperature tolerance configuration
max_error: 120 # Maximum error
check_gain_time: 120 # Tolerance time
hysteresis: 50 # Tolerance temperature
heating_gain: 2 # Heating gain
#####################################################################
## Heated Bed
#####################################################################
[heater_bed]
heater_pin: PA1 # (BE0) Heater pin
sensor_pin: PB1 # Sensor interface (TB) sensor pin
sensor_type: ATC Semitec 104GT-2 # ATC Semitec 104GT-2 temperature sensor type
control: pid # Control method
## Heated bed temperature PID calibration command: "PID_CALIBRATE HEATER=heater_bed TARGET=100"
pid_kp: 53.467 # PID Kp value
pid_ki: 0.931 # PID Ki value
pid_kd: 767.921 # PID Kd value
min_temp: -20 # Minimum temperature
max_temp: 135 # Maximum temperature
max_power: 0.7 # Maximum power
#####################################################################
## Idle Timeout for Heated Bed
#####################################################################
[idle_timeout]
timeout: 1800 # Turn off heated bed if idle for more than 30 minutes
#####################################################################
## Autosync
#####################################################################
[motors_sync]
axes: x,y
# Axes on which calibration will be performed.
accel_chip_x: adxl345
accel_chip_y: adxl345
# Accelerometers for vibration collection: adxl345 / mpu9250 / lis2dw,
# etc. Are indicated for each axis on which calibration is performed.
microsteps: 16
# Maximum microstepping displacement of the stepper motor rotor. It's
# not necessary to increase the value above 16 with 20t pulley, these
# fluctuations are elusive.
# model: exponential
# Model of the dependence of the displacement of microsteps on the
# shaft of a stepper motor depends on the magnitude of the measured
# oscillations. Supported models: linear, quadratic, cubic, power, root,
# hyperbolic, exponential.
# model_coeffs: 33209.5335602645,
# Coefficients above the described model, for calculating microsteps.
#max_step_size: 5
# The maximum number of microsteps that the motor can take move at time,
# to achieve the planned magnitude.
#retry_tolerance: 999999
# The forced threshold to which a pair of stepper motors on one belt
# will have to lower the magnitude of the oscillations. It's recommended
# to configure in order to filter possible inaccuracies. After several
# iterations of starting synchronization, you will find the edge, to
# which this parameter should be omitted.
#retries: 0
# Maximum number of repetitions to achieve a forced threshold of motor
# synchronization deviations.
[gcode_macro SYNC_MOTORS]
rename_existing: SYNC_MOTORS_BASE
gcode:
{% set axes = params.AXES|default('default')|string|lower %}
{% set retry_tolerance = params.RETRY_TOLERANCE|default('default')|string|lower %}
{% set retries = params.THRESHOLD_RETRIES|default('default')|string|lower %}
{% set force_run = params.FORCE_RUN|default(0)|int %}
{% if not printer.motors_sync.applied or force_run %}
{% if axes == 'default' %}
{% set axes = printer.configfile.config.motors_sync.axes %}
{% endif %}
{% if retry_tolerance == 'default' %}
{% if 'retry_tolerance' in printer.configfile.config.motors_sync %}
{% set retry_tolerance = printer.configfile.config.motors_sync.retry_tolerance %}
{% else %}
{% set retry_tolerance = 0 %}
{% endif %}
{% endif %}
{% if retries == 'default' %}
{% if 'retries' in printer.configfile.config.motors_sync %}
{% set retries = printer.configfile.config.motors_sync.retries %}
{% else %}
{% set retries = 0 %}
{% endif %}
{% endif %}
SYNC_MOTORS_BASE AXES={axes} RETRY_TOLERANCE={retry_tolerance} RETRIES={retries}
{% else %}
M118 Motors sync already applied! If you want force sync, run with FORCE_RUN=1 argument
{% endif %}
###################################################################
## Fans
#####################################################################
[fan_generic fan2]
pin: PA0
kick_start_time: 2 # Startup time
off_below: 0.10 # Turn off fan below this value
max_power: 1 # Maximum power
cycle_time: 0.00003 # Cycle time
[gcode_macro M106]
gcode:
{% set fan = 'fan' + (params.P|int if params.P is defined else 0)|string %}
{% set speed = (params.S|float / 255 if params.S is defined else 1.0) %}
SET_FAN_SPEED FAN={fan} SPEED={speed}
[fan_generic fan0]
pin:EBBCan:gpio13 # Fan pin
kick_start_time: 0.5 # Startup time
off_below: 0.10 # Turn off fan below this value
max_power: 1 # Maximum power
#cycle_time: 0.00003 # Cycle time
[heater_fan hotend_fan]
pin: EBBCan:gpio14 # Hotend fan pin
heater: extruder # Associated heating device
heater_temp: 50.0 # Temperature to start the fan
cycle_time: 0.01
[fan_generic fan3]
pin: PF7
max_power: 1
kick_start_time: 0.250
off_below: 0.30
# hardware_pwm: True
cycle_time: 0.00003
[controller_fan side_fan] # Side frame fan 1
pin: PF9
max_power: 0.5 # Maximum power
shutdown_speed: 0.0 # Shutdown speed
fan_speed: 1.0 # Fan speed when heater or stepper driver is active (0.0 to 1.0). Default is 1.0.
idle_timeout: 90 # Time in seconds to keep the fan running after the stepper driver or heater is no longer active. Default is 30 seconds.
idle_speed: 0.5 # Fan speed after the stepper driver is no longer active and before idle_timeout is reached (0.0 to 1.0). Default is fan_speed.
stepper: stepper_x
cycle_time: 0.03
[controller_fan mcu_fan] # Side frame fan 1
pin: PF6
max_power: 0.5 # Maximum power
shutdown_speed: 0.0 # Shutdown speed
fan_speed: 1.0 # Fan speed when heater or stepper driver is active (0.0 to 1.0). Default is 1.0.
idle_timeout: 90 # Time in seconds to keep the fan running after the stepper driver or heater is no longer active. Default is 30 seconds.
idle_speed: 0.5 # Fan speed after the stepper driver is no longer active and before idle_timeout is reached (0.0 to 1.0). Default is fan_speed.
stepper: stepper_x
cycle_time: 0.03
[controller_fan driver_fan] # Driver cooling fan
pin: PF8
max_power: 0.8 # Maximum power
shutdown_speed: 0.0 # Shutdown speed
fan_speed: 1.0 # Fan speed when heater or stepper driver is active (0.0 to 1.0). Default is 1.0.
idle_timeout: 90 # Time in seconds to keep the fan running after the stepper driver or heater is no longer active. Default is 30 seconds.
idle_speed: 0.5 # Fan speed after the stepper driver is no longer active and before idle_timeout is reached (0.0 to 1.0). Default is fan_speed.
stepper: stepper_x
cycle_time: 0.03
#####################################################################
## Firmware Retract
#####################################################################
[firmware_retraction]
# G10 to retract and G11 to unrectract
retract_length: 0.5
# unretract_extra_length: 0
retract_speed: 40
unretract_speed: 30
#####################################################################
## RGB-LED Lights
#####################################################################
[neopixel hotend_rgb]
pin: EBBCan:gpio16 # LED pin
chain_count: 3 # Number of LEDs
color_order: GRBW # Color order
initial_RED: 0.2 # Initial red brightness
initial_GREEN: 0.2 # Initial green brightness
initial_BLUE: 0.2 # Initial blue brightness
[neopixel my_neopixel]
pin: PD15 # Signal interface
chain_count: 50 # Number of LEDs
color_order: GRB # Color order
initial_RED: 0.2 # Initial red brightness
initial_GREEN: 0.2 # Initial green brightness
initial_BLUE: 0.2 # Initial blue brightness
##################################################################################
## Homing Override
####################################################################################
[homing_override]
axes: z # Override homing for the Z axis only
set_position_z: 0 # Set the Z position to 0 after homing
gcode:
G90 # Set to absolute positioning mode
G0 Z10 F1200 # Move Z axis to 10mm above the bed at 1200 mm/min
G28 Y # Home Y axis
G28 X # Home X axis
G1 X175 Y175 F7200 # Move to a specific coordinate (125, 125) at 7200 mm/min
G28 Z # Home Z axis again
G0 Z10 F1200
####################################################################################
## Z Tilt Adjustment
####################################################################################
[z_tilt]
## Use Z_TILT_ADJUST to level the bed.
## z_positions: Location of toolhead
z_positions:
-50, 18
175, 398
400, 18
points:
50, 50
175, 300
300, 50
##--------------------------------------------------------------------
speed: 400 # Speed of Z tilt adjustment
horizontal_move_z: 4 # Z axis move speed for adjustments
retries: 10 # Number of retries for adjustment points
retry_tolerance: 0.0075 # Retry tolerance for adjustment accuracy
####################################################################################
## macros
####################################################################################
[gcode_macro Z_TILT_ADJUST] # IDM/Cartographer optimized 3Z leveling macro
rename_existing: _Z_TILT_ADJUST
gcode:
SAVE_GCODE_STATE NAME=STATE_Z_TILT # Save current state for Z tilt adjustment
BED_MESH_CLEAR # Clear bed mesh
{% if not printer.z_tilt.applied %}
_Z_TILT_ADJUST horizontal_move_z=10 retry_tolerance=1 # Adjust Z tilt with higher tolerance initially
{% endif %}
_Z_TILT_ADJUST horizontal_move_z=2 # Fine-tune Z tilt adjustment
RESTORE_GCODE_STATE NAME=STATE_Z_TILT # Restore saved state after adjustment
[gcode_macro LOAD_FILAMENT]
variable_load_distance: 50
variable_purge_distance: 25
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
SAVE_GCODE_STATE NAME=load_state
G91
G92 E0
G1 E{load_distance} F{max_velocity} # fast-load
G1 E{purge_distance} F{speed} # purge
RESTORE_GCODE_STATE NAME=load_state
[gcode_macro UNLOAD_FILAMENT]
variable_unload_distance: 50
variable_purge_distance: 25
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
SAVE_GCODE_STATE NAME=unload_state
G91
G92 E0
G1 E{purge_distance} F{speed} # purge
G1 E-{unload_distance} F{max_velocity} # fast-unload
RESTORE_GCODE_STATE NAME=unload_state
#################################################################################################
## Bed Leveling and Height Calibration Macro
####################################################################################
[gcode_macro G32]
# Defines a G-code macro for bed leveling and height calibration
gcode:
BED_MESH_CLEAR # Clear bed mesh
G28 # Home all axes
Z_TILT_ADJUST # Perform gantry leveling
G28 # Home all axes
G0 X175 Y175 Z30 F3600 # Fast move to X150 Y150 Z30 at 3600 mm/min
#--------------------------------------------------------------------
[gcode_macro DRAW_LINES]
gcode:
G90 # Absolute positioning
# G92 E0 # Reset Extruder (commented out for now)
# G1 Z5.0 F7200 # Move Z Axis up (commented out for now)
G1 X50 Y2 F7200 # Move to start position
M83 # Set extruder to relative mode
G1 E15 F400 # Extrude filament
G1 Z0.28 F7200 # Lower Z axis
G1 X200 Y5 Z0.28 F1200 E17 # Draw the first line
G1 X200 Y6 Z0.28 F2400 # Move to side a little
G1 X55 Y6 Z0.28 F1200 E34 # Draw the second line
G92 E0 # Reset Extruder
G90 # Return to absolute positioning
[gcode_macro PRINT_START]
gcode:
BED_MESH_CLEAR
{% set BED_TEMP = params.BED_TEMP|default(50)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(200)|float %}
_set_status STATE="status_busy"
_cpufreq_set GOVERNOR=performance
M117 Heating bed...
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED_TEMP}
#SET_HEATER_TEMPERATURE HEATER=extruder TARGET={200}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED_TEMP}
M117 Homing...
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
M117 Sync Motors...
{% if not printer.motors_sync.applied %}
SYNC_MOTORS
{% endif%}
M117 Z_tilt_adjusting...
Z_TILT_ADJUST
G28Z
M117 Rehoming...
M109 S{EXTRUDER_TEMP}
CLEAN_NOZZLE
BED_MESH_CALIBRATE ADAPTIVE=1
SET_FAN_SPEED FAN=fan0 SPEED=100
SET_FAN_SPEED FAN=fan2 SPEED=100
CARTOGRAPHER_TOUCH
SET_FAN_SPEED FAN=fan0 SPEED=0
SET_FAN_SPEED FAN=fan2 SPEED=0
G90
G1 X25 Y15 Z10 F7200
G90
M117 Drawing lines...
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER_TEMP}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={EXTRUDER_TEMP}
LINE_PURGE
G91
G1 Z5
G90
M117 # Clearing text messages from console
#--------------------------------------------------------------------
[gcode_macro PRINT_END]
gcode:
{% 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 + 20, 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-2.0 F3600 ; retract filament
TURN_OFF_HEATERS
SET_FAN_SPEED FAN=fan3 SPEED=0
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
# The purpose of the SAVE_GCODE_STATE/RESTORE_GCODE_STATE
# command pair is to restore the printer's coordinate system
# and speed settings since the commands above change them.
# However, to prevent any accidental, unintentional toolhead
# moves when restoring the state, explicitly set MOVE=0.
RESTORE_GCODE_STATE NAME=STATE_PRINT_END MOVE=0
#--------------------------------------------------------------------
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
#--------------------------------------------------------------------
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
#--------------------------------------------------------------------
[gcode_macro CANCEL_PRINT]
# Defines a G-code macro to cancel the actual running print
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
variable_park = True
gcode =
G28 Y # Home Y axis
_TOOLHEAD_PARK_PAUSE_CANCEL # Call _TOOLHEAD_PARK_PAUSE_CANCEL macro
TURN_OFF_HEATERS # Turn off all heaters
CANCEL_PRINT_BASE # Call CANCEL_PRINT_BASE to cancel print
#--------------------------------------------------------------------
[gcode_macro MOVE]
gcode =
G0 X250 Y250 F3600
G0 Z150 F1500
G0 Z40 F1500
G0 X185 Y175 F3600
G0 Z20 F3600
G0 X185 Y30 Z5 F3600
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 26.307
#*# pid_ki = 2.698
#*# pid_kd = 64.121
#*#
#*# [scanner model default]
#*# model_coef = 1.4012808190691624,
#*# 1.8328111297281853,
#*# 0.7804473523566617,
#*# 0.36068259000059366,
#*# 0.2645015902480223,
#*# 0.28412110020135284,
#*# -0.03228744593661637,
#*# -0.15318583167884167,
#*# 0.13493939044954886,
#*# 0.12839821051957168
#*# model_domain = 3.2518791510322046e-07,3.362645187213205e-07
#*# model_range = 0.100000,5.000000
#*# model_temp = 26.935647
#*# model_offset = 0.00000
#*#
#*# [scanner]
#*# scanner_touch_threshold = 1500