-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer.cfg
614 lines (531 loc) · 16 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
# This file contains common pin mappings for ELEGOO
# 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"
# See docs/Config_Reference.md for a description of parameters.
[include plr.cfg]
[mcu]
# The hardware use USART1 PA10/PA9 connect to RK3328
serial: /dev/ttyS0
restart_method: command
[stepper_x]
step_pin:PC14
dir_pin:PC13
enable_pin:!PC15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation:200
#endstop_pin:PC0
endstop_pin:tmc2209_stepper_x:virtual_endstop
position_min: 0
position_endstop: 0
position_max: 427
homing_speed:50
homing_retract_dist:0
homing_positive_dir:false
step_pulse_duration:0.000002
[stepper_y]
step_pin:PB4
dir_pin:PB3
enable_pin:!PC15
microsteps:16
rotation_distance: 40
full_steps_per_rotation:200
#endstop_pin:PB8
endstop_pin:tmc2209_stepper_y:virtual_endstop
position_min: 0
position_endstop:0
position_max:426
homing_speed:60
homing_retract_dist:0
homing_positive_dir:false
step_pulse_duration:0.000002
[stepper_z]
step_pin:PC10
dir_pin:!PA13
enable_pin: !PC11
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 200
endstop_pin:probe:z_virtual_endstop ## PB12 for Z-max; endstop have'!' is NO
## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
## (+) value = endstop above Z0, (-) value = endstop below
## Increasing position_endstop brings nozzle closer to the bed
## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
#position_endstop:-5
position_max: 497
position_min: -5
homing_speed: 8
second_homing_speed: 3
[extruder]
step_pin:PA5
dir_pin:!PA6
enable_pin:!PA4
microsteps:16
rotation_distance: 29 #Bondtech 5mm Drive Gears
gear_ratio: 52:10
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.600
filament_diameter: 1.750
min_temp: 0
max_temp: 330
heater_pin: PA7
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin: PA1
max_power: 1
control = pid
pid_kp = 35.144
pid_ki = 9.762
pid_kd = 31.630
pressure_advance: 0.03
pressure_advance_smooth_time: 0.04
max_extrude_cross_section:500
instantaneous_corner_velocity: 10.000
max_extrude_only_distance: 150
max_extrude_only_velocity:5000
max_extrude_only_accel:2000
step_pulse_duration:0.000002
max_extrude_cross_section: 10
min_extrude_temp:0
[verify_heater extruder]
max_error: 120
check_gain_time:120
hysteresis: 10
heating_gain: 2
[heater_bed]
heater_pin:PB10
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: PA0
max_power: 1.0
#control = watermark
control = pid
pid_kp = 75.397
pid_ki = 0.823
pid_kd = 1727.531
min_temp: 0
max_temp: 100
[verify_heater heater_bed]
max_error: 120
#check_gain_time:120
check_gain_time:360
hysteresis: 10
heating_gain: 2
[heater_fan fan1]
pin: PC7
shutdown_speed: 1
#fan for printed model FAN2
[fan]
pin: PB7
[fan_generic fan3]
pin: PC9
[fan_generic fan4]
pin: PA8
[fan_generic fan5]
pin: PA15
[printer]
kinematics:cartesian
max_velocity: 500
max_accel: 2000
max_accel_to_decel: 2000
max_z_velocity: 20
max_z_accel: 300
square_corner_velocity: 5.0
[input_shaper]
#shaper_type_x = zv
#shaper_freq_x = 116.2
#shaper_type_y = zv
#shaper_freq_y = 38.8
####################################################################
# Homing and Gantry Adjustment Routines
#####################################################################
[idle_timeout]
timeout: 36000
#[safe_z_home]
#home_xy_position: 215,215
#speed: 100
#z_hop: 10
#z_hop_speed: 5
[gcode_macro G29]
gcode:
BED_MESH_CLEAR
G28
BED_MESH_CALIBRATE
G0 X205 Y205 Z5 F3000
G0 Z0 F300
#####################################################################
# Probe
#####################################################################
[probe]
pin:^PA11
x_offset: -24.25
y_offset: 20.45
z_offset: 0.0
speed: 10.0
samples: 2
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.1
samples_tolerance_retries: 1
[bed_mesh]
speed:120
horizontal_move_z:10
mesh_min:10,21
mesh_max:397,404
probe_count:11,11
algorithm:bicubic
bicubic_tension:0.2
mesh_pps: 4, 4
fade_start:1.0
fade_end:30.0
#####################################################################
# LED Control
#####################################################################
[gcode_macro MODLELIGHT_ON]
description: Turn on Logo LEDs
gcode:
SET_PIN PIN=caselight1 VALUE=1
[gcode_macro MODLELIGHT_OFF]
description: Turn off Logo LEDs
gcode:
SET_PIN PIN=caselight1 VALUE=0
[filament_switch_sensor fila]
pause_on_runout: True
runout_gcode:
SET_FILAMENT_SENSOR SENSOR=fila ENABLE=1
event_delay: 3.0
pause_delay: 0.5
switch_pin: PA12
########################################
# TMC UART configuration
########################################
[tmc2209 stepper_x]
uart_pin: PB9
run_current: 1.2
hold_current: 0.8
interpolate: True
stealthchop_threshold:99999
driver_SGTHRS:65
diag_pin:^PC0
[tmc2209 stepper_y]
uart_pin: PD2
run_current: 1.5
hold_current: 1.2
interpolate: True
stealthchop_threshold:99999
driver_SGTHRS:45
diag_pin:^PB8
[tmc2209 stepper_z]
uart_pin: PC5
run_current: 0.8
hold_current: 0.8
interpolate: True
stealthchop_threshold: 120
[tmc2209 extruder]
uart_pin: PC4
run_current: 0.9
hold_current: 0.5
interpolate: True
stealthchop_threshold: 400
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl345 x]
cs_pin: rpi:None
spi_bus: spidev0.0
axes_map:x,z,-y
[adxl345 y]
cs_pin: rpi:None
spi_bus: spidev0.1
axes_map:-x,-y,-z
[resonance_tester]
accel_chip_x: adxl345 x
accel_chip_y: adxl345 y
probe_points:
215, 215, 20 # an example
[force_move]
enable_force_move : true
[virtual_sdcard]
path: ~/gcode_files
#####################################################################
# 回零动作
####################################################################
[homing_override]
gcode:
{% if params.X is defined %}
{% if params.Y is undefined %}
{% if params.Z is undefined %}
_HOME_X
{% endif %}
{% endif %}
{% endif %}
{% if params.Y is defined %}
{% if params.X is undefined %}
{% if params.Z is undefined %}
_HOME_Y
{% endif %}
{% endif %}
{% endif %}
{% if params.Z is defined %}
{% if params.X is undefined %}
{% if params.Y is undefined %}
G91
G1 Z10 F500
_HOME_X
_HOME_Y
G90
G1 X215 Y215 F5000
G28 Z F500
{% endif %}
{% endif %}
{% endif %}
{% if params.X is defined %}
{% if params.Y is defined %}
{% if params.Z is undefined %}
_HOME_X
_HOME_Y
{% endif %}
{% endif %}
{% endif %}
{% if params.X is undefined %}
{% if params.Y is undefined %}
{% if params.Z is undefined %}
G91
G1 Z10 F500
_HOME_X
_HOME_Y
G90
G1 X215 Y215 F5000
G28 Z F500
{% endif %}
{% endif %}
{% endif %}
[gcode_macro _HOME_X]
gcode:
# Always use consistent run_current on A/B steppers during sensorless homing
{% set RUN_CURRENT_X = printer.configfile.settings['tmc2209 stepper_x'].run_current|float %}
{% set RUN_ACCEL = printer.configfile.settings['printer'].max_accel|float %}
{% set HOME_CURRENT = 0.8 %}
{% set HOME_ACCEL = 100.0 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CURRENT}
SET_VELOCITY_LIMIT ACCEL={HOME_ACCEL}
# Home
G28 X
#Move away
#G91
#G1 X5 F1200
# Wait just a second… (give StallGuard registers time to clear)
G4 P1000
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CURRENT_X}
SET_VELOCITY_LIMIT ACCEL={RUN_ACCEL}
G90
[gcode_macro _HOME_Y]
gcode:
# Set current for sensorless homing
{% set RUN_CURRENT_Y = printer.configfile.settings['tmc2209 stepper_y'].run_current|float %}
{% set RUN_ACCEL = printer.configfile.settings['printer'].max_accel|float %}
{% set HOME_CURRENT = 0.8 %}
{% set HOME_ACCEL = 60.0 %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CURRENT}
SET_VELOCITY_LIMIT ACCEL={HOME_ACCEL}
# Home
G28 Y
#Move away
#G91
#G1 Y20 F1200
# Wait just a second… (give StallGuard registers time to clear)
G4 P1000
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CURRENT_Y}
SET_VELOCITY_LIMIT ACCEL={RUN_ACCEL}
G90
[gcode_macro PRINT_START]
gcode:
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=True
G92 E0
BED_MESH_CLEAR
G90
BED_MESH_PROFILE LOAD=default
CLEAR_PAUSE
M117 Printing
[gcode_macro PRINT_END]
gcode:
SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False
RUN_SHELL_COMMAND CMD=clear_plr
clear_last_file
{% set RUN_VELOCITY = printer.configfile.settings['printer'].max_velocity|float %}
{% set RUN_ACCEL = printer.configfile.settings['printer'].max_accel|float %}
{% set RUN_DECEL = printer.configfile.settings['printer'].max_accel_to_decel|float %}
SET_VELOCITY_LIMIT VELOCITY={RUN_VELOCITY} ACCEL={RUN_ACCEL} ACCEL_TO_DECEL={RUN_DECEL}
[pause_resume]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
PRINT_END
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
SDCARD_RESET_FILE
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-10.0 F1200 ; retract filament
G91 ; relative positioning
TURN_OFF_HEATERS
M107 ; turn off fan
G1 Z2 F3000 ; move nozzle up 2mm
G90 ; absolute positioning
G0 X0 Y225 F3600 ; park nozzle at rear
M84
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
M400
{% set z = params.Z|default(10)|int %}
{% set e = params.E|default(2.5) %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target}
SAVE_GCODE_STATE NAME=PAUSE
M25
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %}
G91
M83
G1 E-{e} F2100
G1 Z{z} F900
{% else %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
SAVE_GCODE_STATE NAME=PAUSEPARK
G90
G1 X0 Y220 F6000
G1 E{e} F2100
SET_IDLE_TIMEOUT TIMEOUT=43200
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
{% set e = params.E|default(2.5)|int %}
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
G91
M83
G1 E-{e} F900
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100
{% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
G1 Z{zhop * -1} F900
G1 E{e+0.5} F900
{% else %}
G1 Z{zhop * -1} F900
{% endif %}
M400
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60
M24
[verify_heater extruder]
max_error: 120
check_gain_time:120
hysteresis: 10
heating_gain: 2
[gcode_macro M109]
rename_existing: M99109
gcode:
#Parameters
{% set s = params.S|float %}
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %}
{% if s != 0 %}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s-4} MAXIMUM={s+10}
{% endif %}
[display_status]
[gcode_macro M84]
rename_existing:M84.1
gcode:
SET_STEPPER_ENABLE STEPPER=stepper_x enable=0
SET_STEPPER_ENABLE STEPPER=stepper_y enable=0
SET_STEPPER_ENABLE STEPPER=stepper_z enable=0
SET_STEPPER_ENABLE STEPPER=extruder enable=0
SET_KINEMATIC_POSITION
[delayed_gcode KINEMATIC_POSITION]
initial_duration:0.2
gcode:
SET_KINEMATIC_POSITION X=110
SET_KINEMATIC_POSITION Y=110
SET_KINEMATIC_POSITION Z=0
[gcode_macro M205]
description: Sets square corner velocity.
Usage: M205 [X<velocity>] [Y<velocity>]
gcode:
{% if 'X' in params or 'Y' in params %}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="{
(params.X|default(0)|float, params.Y|default(0)|float)|min}"
{% else %}
SET_VELOCITY_LIMIT
{% endif %}
[gcode_macro M203]
description: Sets maximum velocity.
Usage: M203 [X<velocity>] [Y<velocity>]
gcode:
{% if 'X' in params or 'Y' in params %}
{% set velocity = (params.X|default(params.Y)|float,
params.Y|default(params.X)|float)|min %}
SET_VELOCITY_LIMIT VELOCITY="{velocity}"
{% else %}
SET_VELOCITY_LIMIT
{% endif %}
[gcode_arcs]
[gcode_macro M140]
rename_existing: M99140
gcode:
{% set s = params.S|float %}
{% if params.S is defined %}
{% if params.S|float >= 100 %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=100
{% else %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={params.S|int}
{% endif %}
{% endif %}
[gcode_macro M190]
rename_existing: M99190
gcode:
{% set s = params.S|float %}
{% if params.S is defined %}
{% if params.S|float >= 95 %}
{% if params.S|float >= 100 %}
{% set s = 90 %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=100
{% else %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={params.S|int}
{% endif %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-5} MAXIMUM={s+5}
{% else %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={params.S|int}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-1} MAXIMUM={s+1}
{% endif %}
{% endif %}
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.016250, -0.018750, -0.053750, -0.076250, -0.097500, -0.092500, -0.076250, -0.065000, -0.072500, -0.047500, 0.062500
#*# 0.011250, -0.021250, -0.048750, -0.065000, -0.081250, -0.076250, -0.096250, -0.090000, -0.097500, -0.061250, 0.025000
#*# 0.027500, 0.002500, -0.013750, -0.030000, -0.042500, -0.056250, -0.068750, -0.057500, -0.058750, -0.043750, 0.027500
#*# -0.002500, -0.001250, -0.003750, -0.013750, -0.040000, -0.058750, -0.062500, -0.041250, -0.045000, -0.032500, 0.056250
#*# 0.040000, 0.057500, 0.076250, 0.062500, 0.030000, 0.003750, -0.005000, 0.007500, 0.000000, 0.008750, 0.052500
#*# 0.008750, 0.048750, 0.060000, 0.055000, 0.030000, 0.015000, -0.006250, 0.012500, 0.003750, 0.000000, 0.052500
#*# -0.006250, 0.027500, 0.033750, 0.043750, 0.026250, -0.003750, -0.025000, 0.000000, -0.018750, -0.020000, 0.008750
#*# -0.040000, -0.012500, 0.002500, -0.007500, -0.037500, -0.053750, -0.063750, -0.010000, -0.017500, -0.030000, 0.003750
#*# -0.057500, -0.042500, -0.043750, -0.047500, -0.033750, -0.060000, -0.068750, -0.052500, -0.057500, -0.047500, 0.001250
#*# -0.010000, -0.012500, -0.046250, -0.052500, -0.060000, -0.055000, -0.056250, -0.047500, -0.046250, -0.030000, 0.020000
#*# 0.090000, 0.075000, 0.020000, -0.007500, -0.016250, -0.010000, -0.011250, 0.011250, 0.003750, 0.022500, 0.105000
#*# tension = 0.2
#*# min_x = 10.0
#*# algo = bicubic
#*# y_count = 11
#*# mesh_y_pps = 4
#*# min_y = 21.0
#*# x_count = 11
#*# max_y = 403.9
#*# mesh_x_pps = 4
#*# max_x = 397.0
#*#
#*# [input_shaper]
#*# shaper_type_y = mzv
#*# shaper_freq_y = 23.0
#*# shaper_type_x = zv
#*# shaper_freq_x = 70.6