-
Notifications
You must be signed in to change notification settings - Fork 1
/
printer.cfg
518 lines (466 loc) · 10.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
# Full pinout located here: https://github.com/Duet3D/Duet3-Mainboard-6HC/blob/master/Duet3_Mainboard_v1.01/Duet3_MB_Schematic_v1.01.pdf
[include mainsail.cfg]
[include timelapse.cfg]
[mcu]
serial: /dev/serial/by-id/usb-Klipper_same70q20b_00313853314B51353234303132303333-if00
[printer]
kinematics: corexy
max_velocity: 600
max_accel: 3600
max_z_velocity: 16
max_z_accel: 200
[adc_scaled vref_scaled]
vref_pin: PC0
vssa_pin: PC13
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
## Drivers
[stepper_x]
#driver 0
step_pin: PC18
dir_pin: !PB5
enable_pin: !PA9
microsteps: 16
rotation_distance: 32
full_steps_per_rotation: 200
endstop_pin: ^PD15 #io1
position_endstop: -12
position_min: -12
position_max: 295
homing_speed: 60.0
second_homing_speed: 10.0
[tmc5160 stepper_x]
cs_pin: PD17
spi_bus: usart1
chain_position: 1
chain_length: 6
interpolate: False
# 2250ma / sqrt(2)
run_current: 1.6
sense_resistor: 0.05
stealthchop_threshold: 999999
[stepper_y]
#driver 1
step_pin: PC16
dir_pin: PD10
enable_pin: !PA9
microsteps: 16
rotation_distance: 32
full_steps_per_rotation: 200
endstop_pin: ^PD28 #io2
position_endstop: 0
position_min: 0
position_max: 305
homing_speed: 60.0
second_homing_speed: 10.0
[tmc5160 stepper_y]
cs_pin: PD17
chain_position: 2
chain_length: 6
interpolate: False
# 2250ma / sqrt(2)
run_current: 1.6
sense_resistor: 0.05
stealthchop_threshold: 999999
[stepper_z]
#driver2
step_pin: PC28
dir_pin: PA4
enable_pin: !PA9
microsteps: 16
rotation_distance: 4
full_steps_per_rotation: 400
endstop_pin: probe:z_virtual_endstop
position_min: 0
position_max: 338
homing_speed: 4.0
[tmc5160 stepper_z]
cs_pin: PD17
chain_position: 3
chain_length: 6
interpolate: False
# 1600ma /sqrt(2)
run_current: 1.10
sense_resistor: 0.05
stealthchop_threshold: 999999
[stepper_z1]
#driver3
step_pin: PC1
dir_pin: PA22
enable_pin: !PA9
microsteps: 16
rotation_distance: 4
full_steps_per_rotation: 400
[tmc5160 stepper_z1]
cs_pin: PD17
chain_position: 4
chain_length: 6
interpolate: False
# 1600ma /sqrt(2)
run_current: 1.10
sense_resistor: 0.05
stealthchop_threshold: 999999
[stepper_z2]
#driver4
step_pin: PC4
dir_pin: PC3
enable_pin: !PA9
microsteps: 16
rotation_distance: 4
full_steps_per_rotation: 400
[tmc5160 stepper_z2]
cs_pin: PD17
chain_position: 5
chain_length: 6
interpolate: False
# 1600ma /sqrt(2)
run_current: 1.10
sense_resistor: 0.05
stealthchop_threshold: 999999
## Hotend
[extruder]
#driver5
step_pin: PC9
dir_pin: PD14
enable_pin: !PA9
rotation_distance: 7.7108433728
microsteps: 16
full_steps_per_rotation: 400
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA24 #out1
sensor_type: ATC Semitec 104GT-2
pullup_resistor: 2200 # The board uses a 2.2k ohm pullup to work with a PT1000
sensor_pin: vref_scaled:PC29 #temp1
min_temp: 0
max_temp: 320
max_extrude_only_distance: 250.0
control: pid
pid_kp: 24.277
pid_ki: 1.208
pid_kd: 121.993
[tmc5160 extruder]
cs_pin: PD17
chain_position: 6
chain_length: 6
interpolate: False
run_current: .6
sense_resistor: 0.05
[heater_fan heatbreak_fan]
pin: PC5
heater: extruder
heater_temp: 50.0
[fan]
pin: PA15
## Filters
[fan_generic filter_1]
pin: PA12
[fan_generic filter_2]
pin: PC8
## Bed
[heater_bed]
heater_pin: PA7
sensor_type: Generic 3950
sensor_pin: vref_scaled:PC15
pullup_resistor: 2200
min_temp: 0
max_temp: 120
control: pid
pid_kp: 36.385
pid_ki: 0.215
pid_kd: 1537.711
[verify_heater heater_bed]
check_gain_time: 120
[temperature_sensor keenovo_temp]
sensor_type: Generic 3950
sensor_pin: PC30
gcode_id: K
max_temp: 150
min_temp: 0
[bed_mesh]
algorithm: bicubic
mesh_min: 10,36
mesh_max: 290,294
#mesh_max: 296,296
#mesh_min: 4,36
#probe_count: 9,9
speed: 100
horizontal_move_z: 10
[z_tilt]
# position of bed pivot points, measured at retaining bolts
z_positions:
#-9,17
#-9,277
#342,151
-8.7257, 17.7063
-9.1512, 277.2458
343.5263, 150.8999
points:
75,75
75,225
225,180
#points:
# 75,75
# 75,225
# 225,225
# 225,75
horizontal_move_z: 10
retries: 4
retry_tolerance: 0.008
;retry_tolerance: 0.05
;retry_tolerance: 0.001
speed: 100
[auto_z_positions]
points:
75,75
75,225
225,180
horizontal_move_z: 10
speed: 60
## Homing
# [homing_override]
# set_position_z: 0
# gcode:
# {% set axes = params.keys() | map("list") | sum(start=[]) %}
# {% set home_all = 'X' not in axes and 'Y' not in axes and 'Z' not in axes %}
# # Enable motors and wait for 150ms for trinamic tuning
# # TODO(ibash) maybe remove
# # SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1
# # SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1
# # G4 P150
#
# # x-axis endstop is beyond the bed enough so that the 5015 fan hits the magnum
# # pulley when homing y, so scoot to the right
# {% if home_all or 'X' in axes %}
# G28 X
# G1 X20 F3600
# {% endif %}
#
# {% if home_all or 'Y' in axes %}
# G28 Y
# {% endif %}
#
# # safe_z_home already ensures that the nozzle won't crash into the bed, x/y is
# # homed, and makes z homing probe in the center
# {% if home_all or 'Z' in axes %}
# M401 ; deploy probe
# G28 Z ; home Z
# M402 ; retract Euclid Probe
# {% endif %}
[safe_z_home]
home_xy_position: 150,150
speed: 100
z_hop: 15
z_hop_speed: 8
after_x:
# move z a little to prevent crashing into a magnum pulley
G1 X20 F3600
before_z:
M401
after_z:
M402
## Probe
[force_move]
enable_force_move: True
[respond]
default_type: echo
default_prefix: echo:
[probe]
pin: ^PE3
x_offset: 3
y_offset: 35
z_offset: 6.35
# TODO(ibash) Run PROBE_CALIBRATE to calibrate Z offset
# previously I had an offset of 6.35
speed: 1.5
#lift_speed: 4
#lift_speed: 1.5
samples: 3
samples_result: average
sample_retract_dist: 5.0
samples_tolerance: 0.050
samples_tolerance_retries: 3
[gcode_macro M401]
description: deploy euclid probe
gcode:
G90
error_if_probe_deployed ; check to make sure that the probe is not already attached
_M401
[gcode_macro error_if_probe_deployed]
gcode:
QUERY_PROBE ; check probe status
do_error_if_probe_deployed ; logic check to verify probe is not already deployed
[gcode_macro do_error_if_probe_deployed]
gcode:
{% if not printer.probe.last_query %}
{action_raise_error("Euclid Probe is already deployed. Remove and return it to the dock.")}
{% endif %}
# Macro to Deploy Bed Probe
[gcode_macro _M401]
description: deploy euclid probe (internal)
gcode:
G90
{% if printer.probe.last_query %}
G0 X50 Y150 F6000 ; move the carraige to safe position to move from. this is the pre-flight position
G0 X0 Y280 F6000 ; move to the side of the dock. this is the dock side position
G4 P250 ; wait 1/4 second
G0 X0 Y300 F6000 ; move sideways over the dock to pick up probe. this is the dock position
M400 ; wait for moves to finish
G4 P250 ; pause 1/4 sec for detection
G0 X60 Y300 F6000 ; move out of the dock in a straight line to the dock exit poistion
G0 X150 Y150 F6000 ; move probe to center of bed in ready position
{% endif %}
error_if_probe_not_deployed
[gcode_macro error_if_probe_not_deployed]
gcode:
QUERY_PROBE
do_error_if_probe_not_deployed
[gcode_macro do_error_if_probe_not_deployed]
gcode:
{% if printer.probe.last_query %}
{action_raise_error("Euclid Probe failed to deploy!")}
{% endif %}
[gcode_macro M402]
description: retract euclid probe
gcode:
G90
error_if_probe_not_deployed
_M402
[gcode_macro _M402]
description: retract euclid probe (internal)
gcode:
G90
{% if not printer.probe.last_query %} ; the logic on this needs function check
G0 X150 Y150 F6000 ; start movements at center of the bed
G0 X60 Y300 F6000 ; move to the re-entry staging position
G0 X0 Y300 F6000 ; slowly move into dock
M400 ; wait for moves to finish
G4 P250 ; forced pause here so motion is definite 90 travel to swipe
G0 X0 Y280 F6000 ; quick swipe off
G0 X150 Y150 ; move to front center of bed
{% endif %}
error_if_probe_deployed ; verify that the probe is detached. is corrected error
# uncomment one of the following macros if necessary for your printer:
# Z_TILT_ADJUST is for [z_tilt] config
# QUAD_GANTRY_LEVEL is for [quad_gantry_level] config
# whitespace matters in the macros, klipper is python based
# watch your indents and spaces
[gcode_macro PROBE]
rename_existing: PROBE_ORIGINAL
gcode:
M401
G1 X150 Y150 F4000
PROBE_ORIGINAL
G1 Z8
M402
[gcode_macro PROBE_ACCURACY]
rename_existing: PROBE_ACCURACY_ORIGINAL
gcode:
M401
G1 X150 Y150 F4000
PROBE_ACCURACY_ORIGINAL
G1 Z8
M402
[gcode_macro PROBE_CALIBRATE]
rename_existing: PROBE_CALIBRATE_ORIGINAL
gcode:
M401
G1 X150 Y150 F4000
PROBE_CALIBRATE_ORIGINAL
G1 Z8
M402
[gcode_macro Z_TILT_ADJUST]
rename_existing: Z_TILT_ADJUST_ORIGINAL
gcode:
M401
Z_TILT_ADJUST_ORIGINAL
M402
[gcode_macro G32]
gcode:
Z_TILT_ADJUST
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BED_MESH_CALIBRATE_ORIGINAL
gcode:
M401
BED_MESH_CALIBRATE_ORIGINAL
M402
[gcode_macro G29]
gcode:
BED_MESH_CALIBRATE
## Print Macros
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(210)|float %}
# Start bed heating
M140 S{BED_TEMP}
# 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
# ensure the probe retracted
error_if_probe_deployed
# Enable filters
SET_FAN_SPEED FAN=filter_1 SPEED=1
SET_FAN_SPEED FAN=filter_2 SPEED=1
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Tram the bed
G32
# Load default bed mesh
# BED_MESH_PROFILE LOAD=default
# Move bed down 10
G1 Z10 F600
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
# prepare to prime
G1 X0.2 Y0.2 Z1.0 F2000.0
# reset extrusion distance
G92 E0
G1 Z0.2 F600
# prime in two steps
G1 X60.0 E9.0 F1000.0
G1 X125.0 E12.5 F1000.0
G1 Z0.5 F600
# reset extrusion distance
G92 E0
# Activate skew correction
# SKEW_PROFILE LOAD=my_skew_profile
[gcode_macro END_PRINT]
gcode:
# Wait for buffer to clear
M400
# De-activate skew correction
# SET_SKEW CLEAR=1
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z10 F300
# absolute moves
G90
# Move Y-carriage for part removal
G1 X10 Y280 F3000
# Lower bed 50 unless bed is too close to bottom of printer, then lower 5
{% if printer.toolhead.axis_maximum.z - printer.toolhead.position.z > 50 %}
G1 Z{printer.toolhead.position.z + 50} F300
{% else %}
G1 Z{printer.toolhead.axis_maximum.z - 5} F300
{% endif %}
# Disable steppers
M84
# Disable filters
SET_FAN_SPEED FAN=filter_1 SPEED=0
SET_FAN_SPEED FAN=filter_2 SPEED=0