-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprinter.cfg
557 lines (478 loc) · 12.9 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
#To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
# See docs/Config_Reference.md for a description of parameters.
[mcu]
serial:/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[temperature_sensor MCU_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[virtual_pins]
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 8000
max_accel_to_decel:3000
max_z_velocity: 15
max_z_accel: 100
square_corner_velocity:3.0
[virtual_sdcard]
path:/home/pi/printer_data/gcodes
[pause_resume]
[display_status]
[exclude_object]
[gcode_arcs]
[idle_timeout]
gcode:
RESPOND TYPE=echo MSG="No operations in 10min!"
# A list of G-Code commands to execute on an idle timeout. See
# docs/Command_Templates.md for G-Code format. The default is to run
# "TURN_OFF_HEATERS" and "M84".
timeout: 600
[mcu rpi]
serial: /tmp/klipper_host_mcu
[temperature_sensor host]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[adxl345]
cs_pin: rpi:None
spi_bus: spidev0.0
[verify_heater extruder]
max_error: 60
check_gain_time:20
hysteresis: 5
heating_gain: 2
[verify_heater heater_bed]
max_error: 60
check_gain_time:40
hysteresis: 5
heating_gain: 2
[resonance_tester]
accel_chip: adxl345
probe_points:
115, 115, 20 # an example
accel_per_hz:50
min_freq:1
max_freq:100
max_smoothing:0.2
hz_per_sec:0.5
[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: "error!"
#default_prefix: echo:
# Directly sets the default prefix. If present, this value will
# override the "default_type".
#############################################################################################################
#GCODE_MACRO
#############################################################################################################
# [gcode_macro SHAPER_CALIBRATE]
# rename_existing: RESHAPER_CALIBRATE
# gcode:
# RESHAPER_CALIBRATE FREQ_START=50 FREQ_END=150
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
RESPOND TYPE=echo MSG="Cancel Print Success!"
G91 ;Relative positionning
G1 E-2 F500 ;Retract a bit
G1 E-2 Z0.2 F200 ;Retract and raise Z
G1 Z1 ;Raise Z more
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
G90 ;Absolute positionning
G1 X10 Y210 F6000
M84 X Y E ;Disable all steppers but Z
[gcode_macro START_PRINT]
gcode:
M84 E ; Disable E Motor for probe accuracy on direct drive systems
G90 ;Absolute positioning
G92 E0 ; Reset Extruder distance to 0
G1 E-1 ; Retracts filament to prevent blobs during probing
G92 E0 ; Reset Extruder distance to 0
G28 ; home all axes
BED_MESH_PROFILE LOAD=default ; Loads the mesh - now has to be done explicitly, not automatically loaded anymore
G92 E0 ; reset extruder
G1 Z1.0 F3000 ; move z up little to prevent scratching of surface
G1 X0.1 Y20 Z0.3 F5000.0 ; move to start-line position
G1 X0.1 Y100.0 Z0.3 F500.0 E15 ; draw 1st line
G1 X0.4 Y100.0 Z0.3 F5000.0 ; move to side a little
G1 X0.4 Y20 Z0.3 F500.0 E30 ; draw 2nd line
G92 E0 ; reset extruder
G1 Z1.0 F3000 ; move z up little to prevent scratching of surface
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
RESPOND TYPE=echo MSG="Pause Print!"
##### set defaults #####
{% set x = params.X|default(-15) %} #edit to your park position
{% set y = params.Y|default(220) %} #edit to your park position
{% set z = params.Z|default(10)|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} F500
{% 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:
RESPOND TYPE=echo MSG="RESUME Print!"
M117
##### set defaults #####
{% if True %} # detect if occur filament runout ,True : filament exists. False:filament runout
{% 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} F400
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
{% endif %}
[gcode_macro END_PRINT]
gcode:
G91 ;Relative positionning
G1 E-2 F500 ;Retract a bit
G1 E-2 Z0.2 F200 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z1 ;Raise Z more
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
G90 ;Absolute positionning
G1 X10 Y210 ;Present print
M84 X Y E ;Disable all steppers but Z
RESPOND TYPE=echo MSG="Finish Print!"
[gcode_macro LOAD_FILAMENT]
gcode:
G91
G1 E30 F300
G1 E10 F150
G90
[gcode_macro UNLOAD_FILAMENT]
gcode:
G91
G1 E-30 F300
G90
[gcode_macro LED_ON]
gcode:
SET_PIN PIN=extruder_led VALUE=1
[gcode_macro LED_OFF]
gcode:
SET_PIN PIN=extruder_led VALUE=0
[gcode_macro LED_TOGGLE]
gcode:
{% if printer["output_pin extruder_led"].value %}
LED_OFF
{% else %}
LED_ON
{% endif %}
[gcode_macro CURTAIN_FAN_TOGGLE]
gcode:
{% if printer.virtual_pins.pins.curtain_fan_enable.value %}
SET_PIN PIN=Curtain_Fan_Enable VALUE=0
{% else %}
SET_PIN PIN=Curtain_Fan_Enable VALUE=1
{% endif %}
# SET_PIN PIN=Curtain_Fan_Enable VALUE=0
[gcode_macro SET_PIN]
rename_existing: SET_PIN_BASE
gcode:
{% if params.PIN == "Curtain_Fan_Enable" %}
#SET_PIN_BASE { rawparams }
# SET_FAN_SPEED FAN=Curtain_Fan SPEED=0
{% if params.VALUE == "1" %}
SET_FAN_SPEED FAN=Curtain_Fan SPEED={ printer.fan.speed }
{% else %}
SET_FAN_SPEED FAN=Curtain_Fan SPEED=0
{% endif %}
{% endif %}
SET_PIN_BASE { rawparams }
[gcode_macro OUTPUT_VIRTUAL_PINS_STATE]
gcode:
M118 virtual_pins = { printer["output_pin extruder_led"].value }
[gcode_macro M106]
rename_existing: M106.1
gcode:
{% set S = params.S|default(0)|int %}
M106.1 S{ S }
{% if printer.virtual_pins.pins.curtain_fan_enable.value %}
{% set SPEED = S/255 %}
SET_FAN_SPEED FAN=Curtain_Fan SPEED={ SPEED }
{% endif %}
[gcode_macro M107]
rename_existing: M107.1
gcode:
M107.1
{% if printer.virtual_pins.pins.curtain_fan_enable.value %}
SET_FAN_SPEED FAN=Curtain_Fan SPEED=0
{% endif %}
[gcode_macro MR_NOTIFY]
description: Allows you to send a custom notification via Mobileraker without using the M117 command
gcode:
{% set msg = "MR_NOTIFY:" ~ (params.TITLE ~ "|" if 'TITLE' in params|upper else "") ~ params.MESSAGE %}
{% if 'MESSAGE' in params|upper %}
{ action_respond_info(msg) }
{% else %}
{ action_raise_error('Must provide MESSAGE parameter') }
{% endif %}
[gcode_macro M117]
rename_existing: M117.1
gcode:
M117.1 {rawparams}
{% if rawparams %}
{% set escaped_msg = rawparams.split(';', 1)[0].split('\x23', 1)[0]|replace('"', '\\"') %}
SET_DISPLAY_TEXT MSG="{escaped_msg}"
RESPOND TYPE=command MSG="{escaped_msg}"
MR_NOTIFY TITLE="M117" MESSAGE="{escaped_msg}"
{% else %}
SET_DISPLAY_TEXT
{% endif %}
#############################################################################################################
#stepper,TMC2209
#############################################################################################################
[stepper_x]
step_pin: PD15
dir_pin: PD14
enable_pin: !PC7
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_x: virtual_endstop
homing_retract_dist: 0
position_endstop: -16
position_min: -16
position_max: 225
homing_speed: 90
step_pulse_duration:0.000004
[tmc2209 stepper_x]
uart_pin:PE3
run_current:1.2
uart_address:3
interpolate: True
driver_sgthrs: 123
stealthchop_threshold: 999999
diag_pin: ^PD10
[stepper_y]
step_pin: PB7
dir_pin: PB6
enable_pin: !PB9
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y: virtual_endstop
homing_retract_dist: 0
position_endstop: -2
position_min: -2
position_max: 225
homing_speed: 60
step_pulse_duration:0.000004
[tmc2209 stepper_y]
uart_pin:PE4
run_current:1.2
uart_address:3
interpolate: True
driver_sgthrs: 110
stealthchop_threshold: 999999
diag_pin: ^PE0
[stepper_z]
step_pin: PB3
dir_pin: !PD7
enable_pin: !PB5
microsteps: 16
rotation_distance: 8
endstop_pin:probe:z_virtual_endstop
#position_endstop: 0.0
position_max: 253
position_min: -3
homing_speed:5
[stepper_z1]
step_pin: PA7
dir_pin: !PA6
enable_pin: !PC5
microsteps: 16
rotation_distance: 8
endstop_pin:probe:z_virtual_endstop
#position_endstop: 0.0
[extruder]
max_extrude_only_distance: 100.0
step_pin: PD1
dir_pin: !PD0
enable_pin: !PD4
microsteps: 16
rotation_distance: 4.59
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA4
control: pid
pressure_advance:0.02
pressure_advance_smooth_time:0.035
#max_extrude_cross_section:500
#instantaneous_corner_velocity:10
#max_extrude_only_distance: 100.0
#max_extrude_only_velocity:200
#max_extrude_only_accel:1000
#step_pulse_duration:0.000002
#max_extrude_cross_section:10
# tuned for stock hardware with 200 degree Celsius target
#pid_Kp: 21.527
#pid_Ki: 1.063
#pid_Kd: 108.982
pid_Kp=24.522
pid_Ki=1.397
pid_Kd=107.590
min_temp: 0
max_temp: 300
min_extrude_temp: 150
[tmc2209 extruder]
uart_pin: PE7
run_current: 0.6
uart_address:3
#hold_current: 0.5
interpolate: True
stealthchop_threshold: 400
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA3
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
[probe]
pin:PD13
x_offset:27
y_offset:-20
#z_offset:1.1
[filament_switch_sensor Filament_Sensor]
#pause_on_runout: True
# runout_gcode:
# RESPOND TYPE=error MSG="Filament Runout! Please change filament!"
#event_delay: 3.0
#pause_delay: 0.5
switch_pin:PD11
[safe_z_home]
home_xy_position: 83,130
speed: 100
z_hop: 5 # Move up 5mm
z_hop_speed: 5
#################################################
#Z stepper tilt adjustment
#################################################
[z_tilt]
# z_positions: -16, 135
# 188, 135
z_positions: -35, 135
260, 135
points: -16, 135
180, 135
speed: 200
horizontal_move_z: 5
retries: 20
# retry_tolerance: .005
retry_tolerance: .01
#################################################
#bed mesh calibrate
#################################################
[bed_mesh]
speed:150
horizontal_move_z:5
mesh_min:11,12
mesh_max:210,205
probe_count:10,10
algorithm: bicubic
bicubic_tension: 0.3
#fade_start: 0.2
#fade_end: 10
mesh_pps:4,4
move_check_distance: 3
#split_delta_z: .025
#################################################
#adjust bed screws tilt
#################################################
[screws_tilt_adjust]
screw1: -1, 45
screw1_name: front left screw
screw2: 168, 45
screw2_name: front right screw
screw3: 168, 215
screw3_name: rear right screw
screw4: -1, 215
screw4_name: rear left screw
horizontal_move_z: 5.
speed: 200.
screw_thread: CW-M4
[heater_fan hotend_fan]
pin: PE11
[fan]
pin: PE9
[fan_generic Curtain_Fan]
pin:PE13
[output_pin Curtain_Fan_Enable]
pin: virtual_pin:curtain_fan_enable
value: 1
[controller_fan Board_Fan]
pin:PD3
fan_speed: 1.0
idle_timeout: 120
heater: heater_bed, extruder
stepper: stepper_x, stepper_y, stepper_z, stepper_z1
[output_pin extruder_led]
pin:PC4
# pwm: 1
# value:1
# cycle_time: 0.001
[input_shaper]
#shaper_freq_x: 68.4
#shaper_type_x: mzv
#shaper_freq_y: 45.6
#shaper_type_y: mzv
damping_ratio_x: 0.1
damping_ratio_y: 0.1