-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer-20230305_142039.cfg
407 lines (349 loc) · 11.1 KB
/
printer-20230305_142039.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
[include shell_command.cfg]
[include mainsail.cfg]
[include calibrate.cfg]
[include config_backup.cfg]
[include V0Display.cfg]
[mcu]
#serial: /dev/serial/by-id/usb-Klipper_rp2040_45503571290F7FE8-if00
serial: /dev/ttyAMA0
restart_method: command
[respond]
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl345]
cs_pin: rpi:None
[resonance_tester]
accel_chip: adxl345
probe_points:
60, 60, 20
[force_move]
enable_force_move: True
[gcode_arcs]
resolution: 0.1
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[printer]
kinematics: corexy
max_velocity: 200
max_accel: 4000
max_z_velocity: 15
max_z_accel: 45
square_corner_velocity: 6.0
[input_shaper]
shaper_freq_x: 82.0
shaper_type_x: mzv
shaper_freq_y: 67.2
shaper_type_y: mzv
#####################################################################
# X/Y Stepper Settings
#####################################################################
[stepper_x]
step_pin: gpio11
dir_pin: gpio10
enable_pin: !gpio12
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 20
homing_retract_dist: 0
homing_positive_dir: true
[tmc2209 stepper_x]
uart_pin: gpio9
tx_pin: gpio8
uart_address: 0
interpolate: False
run_current: 0.5
sense_resistor: 0.110
stealthchop_threshold: 999999
diag_pin: ^gpio4
driver_SGTHRS: 80
[stepper_y]
step_pin: gpio6
dir_pin: gpio5
enable_pin: !gpio7
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 20
homing_retract_dist: 0
homing_positive_dir: true
[tmc2209 stepper_y]
uart_pin: gpio9
tx_pin: gpio8
uart_address: 2
interpolate: False
run_current: 0.5
sense_resistor: 0.110
stealthchop_threshold: 999999
diag_pin: ^gpio3
driver_SGTHRS: 70
#####################################################################
# Z Stepper Settings
#####################################################################
[stepper_z]
step_pin: gpio19
dir_pin: !gpio28
enable_pin: !gpio2
rotation_distance: 8
microsteps: 32
endstop_pin: ^gpio25
position_endstop: 120
position_max: 120
position_min: -1.5
homing_speed: 20
second_homing_speed: 3.0
homing_retract_dist: 0.0
[tmc2209 stepper_z]
uart_pin: gpio9
tx_pin: gpio8
uart_address: 1
interpolate: False
run_current: 0.3
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Extruder
#####################################################################
[extruder]
step_pin: gpio14
dir_pin: gpio13
enable_pin: !gpio15
full_steps_per_rotation: 200
rotation_distance: 22.23
gear_ratio: 50:10
microsteps: 32
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: gpio23
sensor_type: Generic 3950
sensor_pin: gpio27
#control: pid
#pid_Kp: 28.182
#pid_Ki: 1.978
#pid_Kd: 100.397
min_temp: 0
max_temp: 270
min_extrude_temp: 170
max_extrude_only_distance: 150
max_extrude_cross_section: 0.8
pressure_advance: 0.04
pressure_advance_smooth_time: 0.040
[tmc2209 extruder]
uart_pin: gpio9
tx_pin: gpio8
uart_address: 3
interpolate: False
run_current: 0.3
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Bed Heater
#####################################################################
[heater_bed]
heater_pin: gpio21
sensor_type: Generic 3950
sensor_pin: gpio26
smooth_time: 3.0
#max_power: 0.6 # Only needed for 100w pads
min_temp: 0
max_temp: 120
#control: pid
#pid_kp: 68.453
#pid_ki: 2.749
#pid_kd: 426.122
#####################################################################
# Fan Control
#####################################################################
[heater_fan hotend_fan]
pin: gpio18
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
#fan_speed: 1.0
[fan]
pin: gpio17
max_power: 1.0
kick_start_time: 0.5
off_below: 0.13
cycle_time: 0.010
[controller_fan MCU_fan]
pin: gpio20
max_power: 1.0
kick_start_time: 0.5
heater: extruder
#fan_speed: 1.0
#####################################################################
# Homing and Gantry Adjustment Routines
#####################################################################
[idle_timeout]
timeout: 1800
[safe_z_home]
home_xy_position: 120,120
speed: 50.0
z_hop: 5
[bed_screws]
screw1: 60,5
screw1_name: front screw
screw2: 5,115
screw2_name: back left
screw3: 115,115
screw3_name: back right
#####################################################################
# Neopixel
#####################################################################
#[neopixel board_rgb]
#pin: gpio24
#chain_count: 1
#color_order: GRB
#initial_RED: 0.0
#initial_GREEN: 0.1
#initial_BLUE: 0.0
#####################################################################
# V0 Display
#####################################################################
#[mcu display]
#serial:/dev/serial/by-id/usb-Klipper_stm32f042x6_350013000443303848373220-if00
#restart_method: command
#[display]
#lcd_type: sh1106
# i2c_mcu: display
# i2c_bus: i2c1a
# # Set the direction of the encoder wheel
# # Standard: Right (clockwise) scrolls down or increases values. Left (counter-clockwise scrolls up or decreases values.
#encoder_pins: ^display:PA3, ^display:PA4
# # Reversed: Right (clockwise) scrolls up or decreases values. Left (counter-clockwise scrolls down or increases values.
# #encoder_pins: ^display:PA4, ^display:PA3
# click_pin: ^!display:PA1
#kill_pin: ^!display:PA5
# #x_offset: 2
# # Use X offset to shift the display towards the right. Value can be 0 to 3
# #vcomh: 0
# # Set the Vcomh value on SSD1306/SH1106 displays. This value is
# # associated with a "smearing" effect on some OLED displays. The
# # value may range from 0 to 63. Default is 0.
# # Adjust this value if you get some vertical stripes on your display. (31 seems to be a good value)
#[neopixel displayStatus]
#pin: display:PA0
#chain_count: 1
#color_order: GRB
#initial_RED: 0.2
#initial_GREEN: 0.05
#initial_BLUE: 0
#####################################################################
# Macros
#####################################################################
[gcode_macro PRINT_START]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(0)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(0)|float %}
M104 S{EXTRUDER_TEMP}
M140 S{BED_TEMP}
M109 S{EXTRUDER_TEMP}
M190 S{BED_TEMP}
G28 ; home all axes
G90 ; absolute positioning
G1 Z20 F3000 ; move nozzle away from bed
[gcode_macro PRINT_END]
gcode:
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract filament
G91 ; relative positioning
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe direction to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
TURN_OFF_HEATERS
M84 ; turn off steppers
M107 ; turn off fan
G90 ; absolute positioning
G0 X60 Y{max_y-10} F3600 ; park nozzle at rear
[gcode_macro LOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E30 F300 ; load
G1 E15 F150 ; prime nozzle with filament
M82 ; set extruder to absolute
[gcode_macro UNLOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E10 F300 ; extrude a little to soften tip
G1 E-40 F1800 ; retract some, but not too much or it will jam
M82 ; set extruder to absolute
[gcode_macro SENSORLESS_HOME_X]
gcode:
{% set HOME_CUR = 0.800 %}
{% 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}
# Pause to ensure driver stall flag is clear
G4 P2000
# Home
G28 X0
# Move away
G90
G1 X5 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
[gcode_macro SENSORLESS_HOME_y]
gcode:
{% set HOME_CUR = 0.800 %}
{% 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}
# Pause to ensure driver stall flag is clear
G4 P2000
# Home
G28 X0
# Move away
G90
G1 X5 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 32.182
#*# pid_ki = 2.063
#*# pid_kd = 125.510
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 53.991
#*# pid_ki = 2.400
#*# pid_kd = 303.700