-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer.cfg
374 lines (324 loc) · 8.35 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
# Ender 3 Pro with SKR1.4 configuration
########################################
# MCU
########################################
[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_0A800018A1086EAF4C63DC5EC32000F5-if00
restart_method: command
[mcu host]
serial: /tmp/klipper_host_mcu
########################################
# fluidd
########################################
[virtual_sdcard]
path: /home/printer/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[display_status]
[pause_resume]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
########################################
# Mechanical
########################################
[printer]
kinematics: cartesian
max_velocity: 400
max_accel: 500
max_z_velocity: 10
max_z_accel: 100
########################################
# X-Axis
########################################
[stepper_x]
step_pin: P2.2
dir_pin: !P2.6
enable_pin: !P2.1
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: -10
position_min: -10
position_max: 250
homing_speed: 30
homing_retract_dist: 0
[tmc2209 stepper_x]
uart_pin: P1.10
diag_pin: P1.29
run_current: 0.750
driver_SGTHRS: 92
stealthchop_threshold: 999999
[gcode_macro SENSORLESS_HOME_X]
gcode:
{% set HOME_CUR = 0.200 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
G0 X5 F1200
# Wait short time
G4 P2000
# Home
G28 X0
# Move away
G0 X5 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
########################################
# Y-Axis
########################################
[stepper_y]
step_pin: P0.19
dir_pin: !P0.20
enable_pin: !P2.8
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: -15
position_min: -15
position_max: 230
homing_speed: 30
homing_retract_dist: 0
[tmc2209 stepper_y]
uart_pin: P1.9
diag_pin: P1.28
run_current: 0.750
driver_SGTHRS: 84
stealthchop_threshold: 999999
[gcode_macro SENSORLESS_HOME_Y]
gcode:
{% set HOME_CUR = 0.200 %}
{% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %}
{% set RUN_CUR = driver_config.run_current %}
# Set current for sensorless homing
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
G0 Y5 F1200
# Wait short time
G4 P2000
# Home
G28 Y0
# Move away
G0 Y5 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
########################################
# Z-Axis
########################################
[stepper_z]
step_pin: P0.22
dir_pin: P2.11
enable_pin: !P0.21
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_min: -2
position_max: 230
[tmc2209 stepper_z]
uart_pin: P1.8
run_current: 0.500
stealthchop_threshold: 999999
[gcode_macro HOME_Z_PROBE]
gcode:
G92 Z0
G0 X150 Y110 F12000
G28 Z
G0 Z5 F1200
########################################
# Homing
########################################
[homing_override]
gcode:
G0 Z5 F1200
SENSORLESS_HOME_X
SENSORLESS_HOME_Y
HOME_Z_PROBE
set_position_x: 0
set_position_y: 0
set_position_z: 0
########################################
# Bed leveling
########################################
[bltouch]
sensor_pin: ^P0.10
control_pin: P2.0
#stow_on_each_sample: False
x_offset: -35
y_offset: 5
#z_offset: 0
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 30,30
mesh_max: 190, 190
probe_count: 4,4
fade_start: 1.0
fade_end: 10.0
[screws_tilt_adjust]
screw1: 60,30
screw1_name: front left screw
screw2: 235,30
screw2_name: front right screw
screw3: 235,205
screw3_name: rear right screw
screw4: 60,205
screw4_name: rear left screw
horizontal_move_z: 10.
speed: 50.
screw_thread: CW-M4
########################################
# Extruder
########################################
[extruder]
step_pin: P2.13
dir_pin: !P0.11
enable_pin: !P2.12
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.24
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 280
[tmc2209 extruder]
uart_pin: P1.4
run_current: 0.800
stealthchop_threshold: 999999
#To-Do: Connect extruder cooling fan to HE1 (P2.4), open drain !
#Part cooling fan
[fan]
pin: P2.3
########################################
# Bed heater configuration
########################################
[heater_bed]
heater_pin: P2.5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.25
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
########################################
# Display configuration
########################################
[display]
lcd_type: st7920
encoder_pins: ^P1.20, ^P1.18
click_pin: ^!P0.28
cs_pin: P1.22
sid_pin: P1.23
sclk_pin: P1.21
########################################
# Custom G-Codes
########################################
[gcode_macro START_PRINT]
description: Ender 3 Custom Start G-code
gcode:
{% set bed_temp = params.BED|default(40)|float %}
{% set nozzle_temp = params.NOZZLE|default(190)|float %}
M104 S150 # set temporary nozzle temp to prevent oozing during homing and auto bed leveling
M140 S{bed_temp}
M190 S{bed_temp} # wait for bed temp to stabilize
G92 E0 # Reset Extruder
G28 # Home all axes
BED_MESH_CALIBRATE
#BED_MESH_PROFILE LOAD=FR4_1.5 # Load saved mesh
G1 X-5 Y-15 F5000 # move to front left to heat up nozzle
M104 S{nozzle_temp} # set final nozzle temp
M109 S{nozzle_temp} # wait for nozzle temp to stabilize
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.5 F5000.0 # Move to start position
G1 X0.1 Y200.0 Z0.5 F1500.0 E12 # Draw the first line
G1 X0.4 Y200.0 Z0.5 F5000.0 # Move to side a little
G1 X0.4 Y20 Z0.5 F1500.0 E24 # Draw the second line
G92 E0 # Reset Extruder
G1 Z2.0 F3000 # Move Z Axis up little to prevent scratching of Heat Bed
G1 X5 Y20 Z0.4 F5000.0 # Move over to prevent blob squish
[gcode_macro END_PRINT]
description: Ender 3 Custom End G-code
gcode:
G91 # Set axes to relative positioning
G1 Z2 F600 # Move print head up
G90 # Set axes to absolute positioning
G1 X5 Y{printer.toolhead.axis_maximum.y*0.8} F5000.0 # Present print
M140 S0 # Turn off heatbed
M104 S0 # Turn off temperature
M107 # Turn off fan
M84 X Y E # Disable motors
########################################
# Shutdown printer
########################################
[gcode_macro SHUTDOWN_MACHINE]
gcode:
{action_respond_info("Shutdown requested")}
{% if printer.idle_timeout.state != "Printing" %}
M117 Shutdown
{action_respond_info("Shutdown initiated")}
G4 S1
{action_call_remote_method('shutdown_machine')}
{% else %}
{action_respond_info("Cannot shutdown during printing")}
{% endif %}
#initial_duration: 0.0
[menu __main __poweroff]
type: command
enable: {printer.idle_timeout.state != "Printing"}
name: Turn off Pi
gcode:
{ menu.exit() }
SHUTDOWN_MACHINE
[gcode_button shutdown_button]
pin: ^!P1.0
press_gcode:
SHUTDOWN_MACHINE
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bltouch]
#*# z_offset = 1.950
#*#
#*# [bed_mesh FR4_1.5]
#*# version = 1
#*# points =
#*# 0.077500, 0.137500, 0.082500
#*# 0.015000, -0.020000, -0.047500
#*# 0.032500, -0.032500, 0.057500
#*# tension = 0.2
#*# min_x = 30.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 30.0
#*# x_count = 3
#*# max_y = 205.0
#*# mesh_x_pps = 2
#*# max_x = 205.0
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.362500, 0.217500, 0.112500, 0.075000
#*# 0.295000, 0.115000, 0.020000, -0.072500
#*# 0.240000, 0.037500, -0.080000, -0.155000
#*# 0.265000, 0.087500, -0.045000, -0.105000
#*# x_count = 4
#*# y_count = 4
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 30.0
#*# max_x = 204.99
#*# min_y = 30.0
#*# max_y = 204.99