-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprinter.cfg
722 lines (587 loc) · 16.2 KB
/
printer.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
#MAX3
# This file contains common pin mappings for MKS SKIPR b
# boards. To use this config, the firmware should be compiled for the
# stm32f407. When running "make menuconfig", select the 48KiB
# bootloader, and enable "Serial for communication" and select the "on USART1 PA10/PA9"
# The "make flash" command does not work on the MKS SKIPR. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "mks_skipr.bin" on an SD card and then restart the
# MKS SKIPR with that SD card.
# This file contains common pin mappings for MKS SKIPR
# boards. To use this config, the firmware should be compiled for the
# stm32f407. When running "make menuconfig", select the 48KiB
# bootloader, and enable "Serial for communication" and select the "on USART1 PA10/PA9"
# The "make flash" command does not work on the MKS SKIPR. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "mks_skipr.bin" on an SD card and then restart the
# MKS SKIPR with that SD card.
# See docs/Config_Reference.md for a description of parameters.
########################################
# Included Files
########################################
#[include MKS_THR.cfg]
[include Adaptive_Mesh.cfg]
[include config_backup.cfg]
[include macros.cfg]
[exclude_object]
#[include timelapse.cfg]
[include Line_Purge.cfg]
[gcode_arcs]
resolution: 1.0
[pause_resume]
[display_status]
[mcu]
# The hardware use USART1 PA10/PA9 connect to RK3328
#serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_4D0045001850314335393520-if00
#canbus_uuid: 11aa22bb33cc
serial: /dev/ttyS0
restart_method: command
[mcu MKS_THR]
serial:/dev/serial/by-id/usb-Klipper_rp2040_45044E15377B6458-if00
[force_move]
enable_force_move : false #if bed gets stuck at top and BL touch wont deploy make true and move bed down.
[input_shaper]
shaper_freq_x: 58.2
shaper_type_x: mzv
shaper_freq_y: 43.4
shaper_type_y: mzv
[idle_timeout]
timeout: 5400
[virtual_sdcard]
path:/home/mks/uploads
path: ~/gcode_files
[duplicate_pin_override]
pins: PA1,PC9
# A comma separated list of pins that may be used multiple times in
# a config file without normal error checks. This parameter must be
# provided.
[pause_resume]
recover_velocity: 50.0
########################################
# Printer & MCU Settings
########################################
#[mcu MKS_THR]
#serial:/dev/serial/by-id/usb-Klipper_rp2040_D5CE4D9543D14858-if00
#canbus_uuid: 11aa22bb33cc
[printer]
kinematics:corexy
max_velocity: 600
max_accel: 20000
max_accel_to_decel: 10000
max_z_velocity: 20
max_z_accel: 500
square_corner_velocity: 8
[mcu rpi]
serial: /tmp/klipper_host_mcu
########################################
# Input Shaper Settings
########################################
[adxl345]
cs_pin: MKS_THR:gpio13
spi_software_sclk_pin: MKS_THR:gpio14
spi_software_mosi_pin: MKS_THR:gpio15
spi_software_miso_pin: MKS_THR:gpio12
axes_map: -x, z, -y
[resonance_tester]
accel_chip:adxl345
probe_points:160, 160, 20 # an example
#160, 160, 20 # an example
min_freq: 30
max_freq: 137
[gcode_macro SHAPER_CALIBRATE]
rename_existing: RESHAPER_CALIBRATE
gcode:
RESHAPER_CALIBRATE FREQ_START=30 FREQ_END=150#########
########################################
# Extruder & Driver Settings
########################################
[extruder]
step_pin: MKS_THR:gpio5
dir_pin: MKS_THR:gpio4
enable_pin: !MKS_THR:gpio10
rotation_distance: 53.5 #22.6789511 #Bondtech 5mm Drive Gears
gear_ratio: 1628:170
microsteps: 16
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.75
min_temp: 0
max_temp: 360
min_extrude_temp: 170
smooth_time: 0.000001
heater_pin: MKS_THR:gpio0
sensor_type:MAX6675
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
# One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865".
sensor_pin:MKS_THR:gpio17
# The chip select line for the sensor chip. This parameter must be
# provided.
spi_speed: 100000
# The SPI speed (in hz) to use when communicating with the chip.
# The default is 4000000.
#spi_bus:spi1
spi_software_sclk_pin:MKS_THR:gpio18
spi_software_mosi_pin:MKS_THR:gpio19
spi_software_miso_pin:MKS_THR:gpio16
# See the "common SPI settings" section for a description of the
# above parameters.
#tc_type: K
#tc_use_50Hz_filter: False
#c_averaging_count: 1
# The above parameters control the sensor parameters of MAX31856
# chips. The defaults for each parameter are next to the parameter
# name in the above list.
max_power: 1.0
control : pid
pid_Kp=14.734
pid_Ki=6.549
pid_Kd=8.288
pressure_advance: 0.032
pressure_advance_smooth_time: 0.03
max_extrude_cross_section:500
instantaneous_corner_velocity: 10.000
max_extrude_only_distance: 100.0
max_extrude_only_velocity:5000
max_extrude_only_accel:2000
step_pulse_duration:0.000002
[tmc2209 extruder]
uart_pin: MKS_THR:gpio6
interpolate: True
run_current: 0.714
#hold_current: 0.5
#sense_resistor: 0.110
stealthchop_threshold: 0
########################################
# X Stepper Motor & Driver Settings
########################################
[stepper_x]
step_pin:PB4
dir_pin:PB3
enable_pin:!PB5
microsteps:16
rotation_distance: 39.94
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:tmc2209_stepper_x:virtual_endstop
position_min: -7
position_endstop:-7
position_max:325
homing_speed:40
homing_retract_dist:0
homing_positive_dir:False
step_pulse_duration:0.000002
[tmc2209 stepper_x]
uart_pin: PD2
run_current:1.07
#hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
diag_pin:^PB8
driver_SGTHRS: 85
#driver_SGTHRS: 130
########################################
# Y Stepper Motor & Driver Settings
########################################
[stepper_y]
step_pin:PC14
dir_pin:PC13
enable_pin:!PC15
microsteps: 16
rotation_distance: 39.94
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin:tmc2209_stepper_y:virtual_endstop
position_min: -10.5
position_endstop: -10.5
position_max: 325
homing_speed:40
homing_retract_dist:0
homing_positive_dir:False
step_pulse_duration:0.000002
[tmc2209 stepper_y]
uart_pin: PB9
run_current: 1.07
#hold_current: 0.5
interpolate: True
stealthchop_threshold: 0
diag_pin:^PC0
driver_SGTHRS: 85
#driver_SGTHRS: 145
########################################
# Z Stepper Motor & Driver Settings
########################################
[stepper_z]
step_pin:PC10
dir_pin:PA15
enable_pin: !PC11
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin:probe:z_virtual_endstop #!PC3 #for Z-max; endstop have'!' is NO
#position_endstop:326
position_max:325
position_min: -6
homing_speed: 10
homing_retract_dist: 8.0
second_homing_speed: 8
homing_positive_dir:false
step_pulse_duration:0.000002
[tmc2209 stepper_z]
uart_pin: PC5
run_current: 0.90
#hold_current: 0.6
interpolate: True
stealthchop_threshold: 1200
########################################
# Bed Settings
########################################
[heater_bed]
heater_pin:PC8
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA0
max_power: 1.0
control = pid
pid_kp = 71.039
pid_ki = 2.223
pid_kd = 567.421
min_temp: -50
max_temp: 125
########################################
# Temp Settings
########################################
[verify_heater hot]
max_error: 120
check_gain_time:480
hysteresis: 5
heating_gain: 1
[verify_heater extruder]
max_error: 120
check_gain_time:20
hysteresis: 5
heating_gain: 1
[verify_heater heater_bed]
max_error: 120
check_gain_time:60
hysteresis: 5
heating_gain: 1
[temperature_sensor RPI]
sensor_type: rpi_temperature # alternate def
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
##########################
# Chamber, Fans &
#############################
########CHAMBER#########
[heater_generic hot]
#gcode_id:
# 使用M105查询温度时使用的ID。
# 必须提供此参数。
heater_pin:PB10
max_power:1.0
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin:PA1
control:pid
control = pid
pid_Kp=63.418
pid_Ki=1.342
pid_Kd=749.125
min_temp:-100
max_temp:70
#########SIDE FAN FAN2#################
[output_pin fan2] #fan2
pin: PA8
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0.00
scale: 255
shutdown_value: 0.0
##########CHAMBER FAN FAN###################
[output_pin fan3]
pin:PC9
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0.0
scale: 255
shutdown_value: 0.0
[temperature_fan chamber] #fan3
pin:PC9
max_power: 1
#-shutdown_speed:
#-cycle_time:
hardware_pwm: false
#-kick_start_time:
off_below:.1
#- See the "fan" section in example.cfg for a description of the
#- above parameters.
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA1
control : pid
pid_kp : 60
pid_ki : 1
pid_kd : 900
pid_deriv_time:120
min_temp:0
max_temp:90
#- See the "extruder" section in example.cfg for a description of the
#- above parameters.
target_temp: 50.0
#- A temperature (in Celsius) that will be the target temperature.
#- The default is 40 degrees.
max_speed: 1
min_speed: 0.0
gcode_id:hot
######## Hotend fan ###############
[heater_fan hotend_fan]
pin:MKS_THR:gpio1
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
off_below: 0
########### PARTS FAN FAN0#############
[output_pin fan0]
pin: MKS_THR:gpio2
pwm: True
cycle_time: 0.0100
hardware_pwm: false
value: 0
scale: 255
shutdown_value: 0.0
#########
# LED #
#########
##LED 灯
[output_pin caselight]
## Chamber Lighting - In 5V-RGB Position
pin: PC7
pwm: true
shutdown_value: 0
value:1.0 #the brightness at startup (0-1)
cycle_time: 0.01
##pwm: false
##shutdown_value:0
##value:1
#cycle_time:0.01
[output_pin beeper]
## Chamber Lighting - In 5V-RGB Position
pin: PA2
pwm: false
shutdown_value:0
value:0
[output_pin pwc]
pin: PA3
pwm: False
value: 1
shutdown_value: 1
########################################
# Filament Sensor Settings
########################################
[filament_switch_sensor fila]
pause_on_runout: True
runout_gcode:
PAUSE
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
event_delay: 3.0
pause_delay: 0.5
switch_pin: !PC1
##############################
## Bed mesh / KAMP ##
##############################
[screws_tilt_adjust]
horizontal_move_z: 4
screw_thread: CCW-M4
speed: 300
screw1: 7,37
screw1_name: front left
screw2: 262,37
screw2_name: front right
screw3: 262,297
screw3_name: rear right
screw4: 7,297
screw4_name: rear left
[bed_mesh]
speed:150
horizontal_move_z:10
mesh_min:30,15
mesh_max:310,310
probe_count: 9,9
algorithm:bicubic
bicubic_tension:0.2
mesh_pps: 4, 4
[bltouch]
sensor_pin:^MKS_THR:gpio21
control_pin:MKS_THR:gpio11
stow_on_each_sample: False
#[probe]
#pin: ^!MKS_THR:gpio21
x_offset: 28
y_offset: 4.4
z_offset: 0.0
speed: 5
samples: 3
samples_result: average
sample_retract_dist: 3.0
samples_tolerance: 0.08
samples_tolerance_retries:3
#[gcode_macro G30]
# G28
# G1 X100 Y130 Z10
# PROBE_CALIBRATE
[homing_override]
set_position_X:0
set_position_y:0
set_position_z:0
axes:xy
gcode:
{% set HOME_CUR = 1 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current %}
{% set HOLD_CUR = driver_config.hold_current %}
{% if params.X is defined %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
G28 X
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 X10 F1200
{% endif %}
{% if params.Y is defined %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.8}
G28 Y
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 Y10 F1200
{% endif %}
{% if params.Z is defined %}
# G90
# G1 X{printer.toolhead.axis_maximum.x/2 - printer.probe["x_offset"]} Y{printer.toolhead.axis_maximum.y/2 - printer.probe["y_offset"]} F7800
# G91
G28 Z
G1 Z20 F600
BEEP I=1 DUR=100
{% endif %}
{% if params.X is undefined %}
{% if params.Y is undefined %}
{% if params.Z is undefined %}
G91
# G1 Z5 F600
G1 X10 F2400
G1 Y10 F2400
G4 P2000
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR * 0.8}
G28 X
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G1 X10 F1200
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR * 0.8}
G28 Y
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
BEEP I=1 DUR=100
G90
G1 X{printer.toolhead.axis_maximum.x/2 - printer.probe["x_offset"]} Y{printer.toolhead.axis_maximum.y/2 - printer.probe["y_offset"]} F7800
G91
G28 Z
BEEP I=1 DUR=100
G1 Z50 F600
{% endif %}
{% endif %}
{% endif %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
M204 S10000
G90
# G1 X0 Y0 F7800
##Kamp##
[gcode_macro G31]
gcode:
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=1
[gcode_macro G32]
gcode:
SET_GCODE_VARIABLE MACRO=G29 VARIABLE=k VALUE=0
[gcode_macro G29]
variable_k:1
gcode:
{% if k|int==1 %}
BED_MESH_CLEAR #清除调平数据
# G28
BED_MESH_CALIBRATE PROFILE=kamp #自动调平
{% endif %}
[gcode_macro M204]
rename_existing: M99204
gcode:
{% if params.S is defined %}
{% set s = params.S|float %}
{% endif %}
{% if params.P is defined %}
{% if params.T is defined %}
{% set s = [params.P|float ,params.T|float] | min %}
{% endif %}
{% endif %}
SET_VELOCITY_LIMIT ACCEL={s}
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={s/2}
[respond]
#default_type: echo
# Sets the default prefix of the "M118" and "RESPOND" output to one
# of the following:
# echo: "echo: " (This is the default)
# command: "// "
# error: "!! "
#default_prefix: echo:
# Directly sets the default prefix. If present, this value will
# override the "default_type".
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [x_twist_compensation default]
#*# recommended_z_offset = 0
#*# z_compensations = 0, 0
#*#
#*# [bltouch]
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.130000, -0.115833, -0.124167, -0.123333, -0.106667, -0.093333, -0.085000, -0.101667, -0.095000
#*# -0.098333, -0.079167, -0.103333, -0.091667, -0.079167, -0.067500, -0.055000, -0.067500, -0.061667
#*# -0.077500, -0.058333, -0.070000, -0.067500, -0.055000, -0.043333, -0.041667, -0.050000, -0.039167
#*# -0.057500, -0.040000, -0.055833, -0.038333, -0.036667, -0.025833, -0.002500, -0.029167, -0.018333
#*# -0.030000, -0.010833, -0.020000, 0.001667, 0.010833, 0.000000, 0.007500, -0.003333, 0.000000
#*# -0.029167, -0.015833, -0.027500, -0.018333, -0.010000, -0.006667, 0.007500, -0.006667, 0.002500
#*# -0.075000, -0.061667, -0.072500, -0.066667, -0.063333, -0.055000, -0.053333, -0.067500, -0.052500
#*# -0.093333, -0.078333, -0.101667, -0.102500, -0.091667, -0.089167, -0.085833, -0.114167, -0.108333
#*# -0.078333, -0.085833, -0.105833, -0.105833, -0.100833, -0.070000, -0.084167, -0.101667, -0.071667
#*# tension = 0.2
#*# min_x = 30.0
#*# algo = bicubic
#*# y_count = 9
#*# mesh_y_pps = 4
#*# min_y = 15.0
#*# x_count = 9
#*# max_y = 309.96
#*# mesh_x_pps = 4
#*# max_x = 310.0
#*#
#*# [bed_mesh kamp]
#*# version = 1
#*# points =
#*# 0.096667, 0.030000, -0.016667, -0.044167, -0.047500, -0.061667, -0.046667, -0.026667, -0.018333
#*# 0.127500, 0.065000, 0.025833, 0.010000, 0.000000, -0.015833, -0.005833, 0.031667, 0.040833
#*# 0.130000, 0.074167, 0.045833, 0.032500, 0.024167, 0.008333, 0.021667, 0.050000, 0.064167
#*# 0.120000, 0.065000, 0.042500, 0.022500, 0.025000, 0.013333, 0.029167, 0.057500, 0.064167
#*# 0.087500, 0.045000, 0.024167, 0.011667, 0.013333, 0.009167, 0.015833, 0.039167, 0.040833
#*# 0.021667, -0.010000, -0.030833, -0.040000, -0.040833, -0.041667, -0.024167, 0.002500, -0.008333
#*# -0.065000, -0.091667, -0.104167, -0.101667, -0.108333, -0.100833, -0.086667, -0.070833, -0.083333
#*# -0.185833, -0.207500, -0.213333, -0.211667, -0.203333, -0.200000, -0.180000, -0.168333, -0.160000
#*# tension = 0.2
#*# min_x = 22.0
#*# algo = bicubic
#*# y_count = 8
#*# mesh_y_pps = 4
#*# min_y = 38.75
#*# x_count = 9
#*# max_y = 286.2
#*# mesh_x_pps = 4
#*# max_x = 308.72