-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprinter.cfg
582 lines (522 loc) · 15 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
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v2.0. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader" and USB communication. Also,
# select "Enable extra low-level configuration options" and configure
# "GPIO pins to set at micro-controller startup" to "!PA14".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
# See docs/Config_Reference.md for a description of parameters.
[include OrbiterSensor.cfg]
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 64
rotation_distance: 40
#endstop_pin: ^PC0
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: -22
position_min: -22
position_max: 235
homing_speed: 80
homing_retract_dist: 0
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.600
stealthchop_threshold: 999999
diag_pin: PC0
driver_SGTHRS: 100
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 64
rotation_distance: 40
#endstop_pin: ^PC1
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: -18
position_min: -18
position_max: 230
homing_speed: 80
homing_retract_dist: 0
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
run_current: 0.800
stealthchop_threshold: 999999
diag_pin: PC1
driver_SGTHRS: 90
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
microsteps: 64
rotation_distance: 32
gear_ratio: 80:16
endstop_pin: probe:z_virtual_endstop
position_max: 250
position_min: -2
homing_speed: 20
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
run_current: 0.800
stealthchop_threshold: 999999
[extruder]
max_extrude_only_distance: 500
max_extrude_only_velocity: 120
max_extrude_cross_section: 50 # default 0.640
step_pin: PB3
dir_pin: PB4
enable_pin: !PD2
microsteps: 16
rotation_distance: 4.637
full_steps_per_rotation: 200
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
#control: pid
#pid_kp: 21.726
#pid_ki: 0.911
#pid_kd: 129.540
min_temp: 0
max_temp: 300
min_extrude_temp: 190
pressure_advance: 0.025
pressure_advance_smooth_time: 0.03
[tmc2209 extruder]
uart_pin: PC11
tx_pin: PC10
uart_address: 3
interpolate: true
run_current: 0.850
hold_current: 0.100
sense_resistor: 0.11
stealthchop_threshold: 0
driver_TBL: 0
driver_HEND: 6
driver_HSTRT: 7
driver_TOFF: 4
[heater_bed]
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC3
control: pid
# tuned for stock hardware with 50 degree Celsius target
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[bltouch]
sensor_pin: PC14
control_pin: PA1
x_offset: -36.5
y_offset: -4
#z_offset: 2
pin_up_touch_mode_reports_triggered: False
sample_retract_dist: 2.0
speed: 50
lift_speed: 100
probe_with_touch_mode: True
stow_on_each_sample: False
samples: 2
[idle_timeout]
timeout: 1800
[safe_z_home]
home_xy_position: 154,119 # Change coordinates to the center of your print bed
z_hop: 10 # Move up 10mm
z_hop_speed: 60
speed: 450
[force_move]
enable_force_move: true
[bed_mesh]
speed: 80
horizontal_move_z: 4
mesh_min: 10, 10
mesh_max: 190, 220
probe_count: 12, 12
algorithm: bicubic
mesh_pps: 3, 3
bicubic_tension: 0.3
#fade_start: 1
#fade_end: 10
#fade_target: 0
[screws_tilt_adjust]
screw1: 68,34
screw1_name: front left screw
screw2: 232,34
screw2_name: front right screw
screw3: 232,204
screw3_name: rear right screw
screw4: 68,204
screw4_name: rear left screw
horizontal_move_z: 5
speed: 450
screw_thread: CW-M4
[input_shaper]
shaper_freq_x: 35.2
shaper_type_x: ei
shaper_freq_y: 35.2
shaper_type_y: mzv
[heater_fan heatbreak_fan]
pin: PC6
max_power: 1.0
shutdown_speed: 0.0
fan_speed: 1.0
[fan]
pin: PC7
off_below: 0.08
kick_start_time: 0.400
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_35FFD7054254383927880857-if00
restart_method: command
[static_digital_output usb_pullup_enable]
pins: !PA14
[printer]
kinematics: cartesian
max_velocity: 450
max_accel: 10000
max_z_velocity: 288
max_z_accel: 2000
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>
[virtual_sdcard]
path: ~/printer_data/gcodes
[gcode_arcs]
resolution: 0.6
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[resonance_tester]
accel_chip: adxl345
probe_points: 117.5,115,20 # middle of print bed
[adxl345]
cs_pin: PB5 #CS blue purple
spi_software_sclk_pin: PB9 #SCL orange yellow
spi_software_mosi_pin: PB8 #SDA white blue
spi_software_miso_pin: PB15 #SDO green green
# #+5V red white
# #gnd black grey
[display_status]
[exclude_object]
[pause_resume]
# Only home if needed.
[gcode_macro G28]
rename_existing: G28.1
gcode:
{% if printer.toolhead.homed_axes != "xyz" %}
G28.1
{% endif %}
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
##### debug info #####
GET_POSITION
M117 Toolhead Position: X{printer.toolhead.position.x}, Y{printer.toolhead.position.y}, Z{printer.toolhead.position.z}
M117 Gcode Position: X{printer.gcode_move.gcode_position.x}, Y{printer.gcode_move.gcode_position.y}, Z{printer.gcode_move.gcode_position.z}, E{printer.gcode_move.gcode_position.e}
##### set defaults #####
{% set x = params.X|default(220) %} #edit to your park position
{% set y = params.Y|default(220) %} #edit to your park position
{% set z = params.Z|default(30)|float %} #edit to your park position
{% set e = params.E|default(1) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% 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}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### set defaults #####
{% set e = params.E|default(1) %} #edit to your retract length
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
Unload_Filament
TURN_OFF_HEATERS
M106 S0
CANCEL_PRINT_BASE
M18
[gcode_macro Load_Filament]
gcode:
M117 Loading...
G91
G1 E20 F300
G1 E-1 F1200
G90
M117 Filament loaded
[gcode_macro Unload_Filament]
gcode:
M117 Unloading...
G91
G1 E-5 F1200 ; goto cold area
G4 S3 ; sleep 3s
G1 E5 F1200 ; back to hot area, smash strings
G1 E-40 F600 ; extract slow
G90
M117 Filament unloaded
[gcode_macro M600]
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
Unload_Filament
RESTORE_GCODE_STATE NAME=M600_state
[gcode_macro PURGE]
gcode:
M117 Purging hotend...
G91
G1 E45.0 F250
G90
M117 Purged
[gcode_macro M900]
gcode:
##### set defaults #####
{% set K = params.K|default(0) %}
SET_PRESSURE_ADVANCE ADVANCE={K}
[gcode_macro Bed_Level]
gcode:
G28
SCREWS_TILT_CALCULATE
#M18
[gcode_macro MD_WARMUPPOS]
gcode:
{% set speed = (printer.configfile.settings['printer'].max_z_velocity * 60) /2 %}
G28
G90; absolute
G1 X0.45 Y0 Z40 F{speed} ; this is a good start heating position
[gcode_macro MD_PRIME]
gcode:
#M117 Prime Line
G90; absolute
G92 E0 ;Reset Extruder
# move z axis
G1 Y0 Z2.0 F1500 ;Move Z Axis up and Y out
# move to prime position
G1 X0.45 Y0 Z0.28 F1500 ;Move to start position
G1 X0.45 Y120 Z0.28 F1500 E9 ;Draw the first line (slightly under extrude)
G1 X1.20 Y120 Z0.28 F5000 ;Move to side a little
G1 X1.20 Y30 Z0.28 F1500 E18 ;Draw the second line (slightly over extrude)
;G1 Z20 F30000 ;Move up quick
G92 E0 ;Reset Extruder
[gcode_macro MD_EXERCISE]
gcode:
{% set repeat_fan = params.REPEAT_FAN|default(4)|int %}
{% set repeat_x = params.REPEAT_X|default(4)|int %}
{% set repeat_y = params.REPEAT_Y|default(4)|int %}
{% set repeat_c = params.REPEAT_C|default(8)|int %}
{% set repeat_z = params.REPEAT_Z|default(2)|int %}
{% set max_velocity = printer.configfile.settings['printer'].max_velocity * 60 %}
{% set max_z_velocity = printer.configfile.settings['printer'].max_z_velocity * 60 %}
{% set x_min = printer.configfile.settings['stepper_x'].position_min + 20 %}
{% set x_max = printer.configfile.settings['stepper_x'].position_max - 20 %}
{% set x_mid = ( printer.configfile.settings['stepper_x'].position_max + printer.configfile.settings['stepper_x'].position_min ) / 2 %}
{% set y_min = printer.configfile.settings['stepper_x'].position_min + 20 %}
{% set y_max = printer.configfile.settings['stepper_x'].position_max - 20 %}
{% set y_mid = ( printer.configfile.settings['stepper_x'].position_max + printer.configfile.settings['stepper_x'].position_min ) / 2 %}
{% set z_home = printer.configfile.settings['stepper_z'].position_min + 12 %}
{% set z_min = printer.configfile.settings['stepper_z'].position_min + 50 %}
{% set z_max = printer.configfile.settings['stepper_z'].position_max - 100 %}
#G28
G1 X{x_mid} Y{y_mid} Z{z_home} F{3*max_velocity/4}
{% if repeat_fan > 0 %}
{% for i in range(repeat_fan) %}
M106 S255
G4 P800
M106 S0
G4 P200
{% endfor %}
{% endif %}
{% if repeat_y > 0 %}
{% for i in range(repeat_y) %}
G1 Y{y_min} F{max_velocity}
G1 Y{y_max} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_x > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_x) %}
G1 X{x_min} F{max_velocity}
G1 X{x_max} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_c > 0 %}
G1 X{x_mid/2} Y{y_mid} F{max_velocity}
{% for i in range(repeat_c) %}
G2 X{3*x_mid/2} Y{y_mid} I{x_mid/2} J{x_mid/2} F{max_velocity}
G2 X{x_mid/2} Y{y_mid} I{0-x_mid/2} J{x_mid/2} F{max_velocity}
{% endfor %}
{% endif %}
{% if repeat_z > 0 %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
{% for i in range(repeat_z) %}
G1 Z{z_max} F{max_z_velocity}
G1 Z{z_min} F{max_z_velocity}
{% endfor %}
G1 Z{z_home} F{max_z_velocity/12}
{% endif %}
G1 X{x_mid} Y{y_mid} F{max_velocity}
G1 Z{z_home} F{max_z_velocity/12}
[gcode_macro MD_STARTPRINT]
gcode:
{% set bedtemp = params.BED_TEMP|default(65)|float %}
{% set extrudertemp = params.EXTRUDER_TEMP|default(200)|float %}
M140 S{bedtemp}
{% if printer.extruder.temperature < 120 %}
M104 S120
{% else %}
M104 S{extrudertemp}
{% endif %}
#M117 Homing
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
#SET_GCODE_OFFSET Z=0.0
# Home the printer
G28
# Use the bed mesh
BED_MESH_PROFILE LOAD=default
# Move the nozzle near the bed
MD_WARMUPPOS
#M117 Waiting for temperature
# Start heating
M190 S{bedtemp}
M109 S{extrudertemp}
#G1 X0.45 Y-8 F5000 ;Move to PRIME position for cleaner filament load
Load_Filament
MD_PRIME
M117 Printing...
[gcode_macro MD_PRINTDONE]
gcode:
#M117 Done printing :)
# move z up
G91
G1 E-3 Z30 F3000
G90 ; use absolute positioning for the XYZ axes
G1 X115 Y212 F5000 ; move bed forward and center x (MD)
Unload_Filament
M104 S0 ; turn off temperature
M140 S0 ; turn off temperature of bed (MD)
M106 S0 ; turn off cooling fan
M84 ; disable motors
BED_MESH_CLEAR
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BASE_BED_MESH_CALIBRATE
gcode:
BED_MESH_CLEAR
G28.1
G1 X66 Y29 Z40 F30000
BASE_BED_MESH_CALIBRATE
BED_MESH_OUTPUT
G1 X110 Y230 Z40 F30000
# load filament
[gcode_macro M701]
gcode:
SAVE_GCODE_STATE NAME=loading_filament
Load_Filament
RESTORE_GCODE_STATE NAME=loading_filament
# unload filament
[gcode_macro M702]
gcode:
SAVE_GCODE_STATE NAME=unloading_filament
Unload_Filament
RESTORE_GCODE_STATE NAME=unloading_filament
# Park toolhead
[gcode_macro M125]
gcode:
SAVE_GCODE_STATE NAME=parking
#M117 Parking toolhead
G91
G1 Z20 F600 # move up 20 mm
G90
G1 X125 Y0 F4000 # move to park position
RESTORE_GCODE_STATE NAME=parking
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.008750, 0.056000, 0.109000, 0.116250, 0.100500, 0.091500, 0.084000, 0.060750, 0.067250, 0.066500, 0.051500, 0.068750
#*# 0.116000, 0.112000, 0.115250, 0.116250, 0.118250, 0.104000, 0.093750, 0.080750, 0.085750, 0.082750, 0.065000, 0.074000
#*# 0.122000, 0.131500, 0.122500, 0.128250, 0.113250, 0.111750, 0.105250, 0.081500, 0.092500, 0.088500, 0.075750, 0.099500
#*# 0.130000, 0.127000, 0.141500, 0.131750, 0.124750, 0.129750, 0.119500, 0.109500, 0.117750, 0.109000, 0.094250, 0.104250
#*# 0.107000, 0.127000, 0.136000, 0.111000, 0.119000, 0.119250, 0.111500, 0.101000, 0.110250, 0.117500, 0.111500, 0.116000
#*# 0.110000, 0.117000, 0.112750, 0.127750, 0.123750, 0.121750, 0.113750, 0.103000, 0.121250, 0.137500, 0.127750, 0.119750
#*# 0.120000, 0.125250, 0.116750, 0.114250, 0.121500, 0.128750, 0.119000, 0.114000, 0.125750, 0.137250, 0.127750, 0.139000
#*# 0.110750, 0.109000, 0.100500, 0.106250, 0.114500, 0.122750, 0.109750, 0.104250, 0.128000, 0.134500, 0.128000, 0.137250
#*# 0.107250, 0.094000, 0.101750, 0.099000, 0.103250, 0.111750, 0.099000, 0.103250, 0.104500, 0.114750, 0.099250, 0.114750
#*# 0.098750, 0.086000, 0.100250, 0.094000, 0.103500, 0.101500, 0.090000, 0.070500, 0.075250, 0.093750, 0.080500, 0.082250
#*# 0.093500, 0.095750, 0.094250, 0.085000, 0.072750, 0.073250, 0.063000, 0.042250, 0.055250, 0.061000, 0.039500, 0.033500
#*# 0.137750, 0.118750, 0.110000, 0.095750, 0.072250, 0.063750, 0.029000, 0.006250, 0.009250, 0.014750, 0.022750, 0.028500
#*# tension = 0.3
#*# min_x = 10.0
#*# algo = bicubic
#*# y_count = 12
#*# mesh_y_pps = 3
#*# min_y = 10.0
#*# x_count = 12
#*# max_y = 219.99
#*# mesh_x_pps = 3
#*# max_x = 189.95999999999998
#*#
#*# [bltouch]
#*# z_offset = 2.514
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 21.579
#*# pid_ki = 0.979
#*# pid_kd = 118.952