-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer.cfg
392 lines (342 loc) · 9.63 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
# Refrence https://www.klipper3d.org/Config_Reference.html
## Voron Design VORON1.8 250/300mm SKR 1.4 TMC2209 UART config
##========================== Pin Definitions ========================
## Source: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4PIN.pdf
## X_STEP_PIN 2.2
## X_DIR_PIN 2.6
## X_ENABLE_PIN 2.1
## X_STOP_PIN 1.29
## E0_DET_PIN 1.26
## X_UART_PIN 1.10
## Y_STEP_PIN 0.19
## Y_DIR_PIN 0.20
## Y_ENABLE_PIN 2.8
## Y_STOP_PIN 1.28
## E1_DET_PIN 1.26
## Y_UART_RX 1.9
## Z_STEP_PIN 0.22
## Z_DIR_PIN 2.11
## Z_ENABLE_PIN 0.21
## Z_STOP_PIN 1.27
## PWR_DET_PIN 1.0
## Z_UART 1.8
## E0_STEP_PIN 2.13
## E0_DIR_PIN 0.11
## E0_ENABLE_PIN 2.12
## E0_UART 1.4
## E1_STEP_PIN 1.15
## E1_DIR_PIN 1.14
## E1_ENABLE_PIN 1.16
## E1_UART_RX 1.1
## HE1 2.4
## HE0 2.7
## BED 2.5
## TH1 (H1 Temp) 0.23
## TH0 (H0 Temp) 0.24
## TB (Bed Temp) 0.25
## FAN 2.3
## SERVO 2.0
## PROBE 0.10
##===================================================================
#
# [include client.cfg]
[mcu]
serial: /dev/ttyAMA0
restart_method: command
# Virtual SD Card
[virtual_sdcard]
path: ~/gcode_files
# Pause/Resume Functionality
[pause_resume]
[display_status]
[printer]
kinematics: corexy
max_velocity: 250
max_accel: 4500
max_z_velocity: 25
max_z_accel: 100
#square_corner_velocity: 5.0
[stepper_x]
step_pin: P2.2
dir_pin: !P2.6
enable_pin: !P2.1
microsteps: 16
rotation_distance: 40
endstop_pin: !P1.29
position_endstop:0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: P0.19
dir_pin: !P0.20
enable_pin: !P2.8
microsteps: 16
rotation_distance: 40
endstop_pin: !P1.28
position_endstop: 220
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: P0.22
dir_pin: P2.11
enable_pin: !P0.21
microsteps: 16
rotation_distance: 2
# position_endstop: 0.5
position_min: -2
position_max: 230
#endstop_pin: !P1.27
endstop_pin:probe:z_virtual_endstop
[extruder]
step_pin: P2.13
dir_pin: !P0.11
enable_pin: !P2.12
microsteps: 16
rotation_distance: 6.720
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: 15.36
#pid_Ki: 1.13
#pid_Kd: 52.03
min_temp: 0
max_temp: 260
#[extruder1]
#step_pin: P1.15
#dir_pin: P1.14
#enable_pin: !P1.16
#heater_pin: P2.4
#sensor_pin: P0.23
#...
[heater_bed]
heater_pin: P2.5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.25
control: pid
pid_Kp: 45.99
pid_Ki: 8.69
pid_Kd: 60.84
min_temp: 0
max_temp: 110
[fan]
pin: P2.3
########################################
# TMC2208 configuration
########################################
[tmc2208 stepper_x]
uart_pin: P1.10
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
[tmc2208 stepper_y]
uart_pin: P1.9
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
# Stealthchop disabled on extruder.
[tmc2208 extruder]
uart_pin: P1.4
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 0
########################################
# EXP1 / EXP2 (display) pins
########################################
[board_pins]
aliases:
# EXP1 header
EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
# EXP2 header
EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
# Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "ssp0"
# See the sample-lcd.cfg file for definitions of common LCD displays.
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_X: 230 # edit to your preferred park position
default_parameter_Y: 230 # edit to your preferred park position
default_parameter_Z: 10 # edit to your preferred park position
default_parameter_E: 1 # edit to your preferred retract length
gcode:
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{Z}
G90
G1 X{X} Y{Y} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1 # edit to your preferred retract length
gcode:
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
######################################################################
# Filament Change
######################################################################
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.
[pause_resume]
[gcode_macro M600]
default_parameter_X: 50
default_parameter_Y: 0
default_parameter_Z: 10
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
#https://www.klipper3d.org/BLTouch.html
[bltouch]
# bl touch on board switch this pin needs to be inverted as it is Open (NO) by default
# bltouch in the retracted position (PIN UP) should be Closed(NC)
sensor_pin: ^P0.10
#sensor_pin: P1.27 z axis limit switch
control_pin: P2.0
## Some BLTouch V3 and many clones
pin_up_reports_not_triggered:False
#pin_up_touch_mode_reports_triggered: False
probe_with_touch_mode: True
pin_move_time: 0.4
speed: 20
x_offset: -0
y_offset: 41
#https://github.com/KevinOConnor/klipper/blob/master/docs/Probe_Calibrate.md
[safe_z_home]
home_xy_position: 117.5,117.5 # Change coordinates to the center of your print bed
speed: 500
z_hop: 10 # Move up 10mm
z_hop_speed: 25
[bed_mesh]
speed: 250
horizontal_move_z: 5
mesh_min: 20,86
mesh_max: 205,261
probe_count: 3,3
[neopixel temp_leds]
pin: P1.24
# The pin connected to the neopixel. This parameter must be
# provided.
chain_count:8
# The number of Neopixel chips that are "daisy chained" to the
# provided pin. The default is 1 (which indicates only a single
# Neopixel is connected to the pin).
color_order: GRB
# Set the pixel order required by the LED hardware. Options are GRB,
# RGB, GRBW, or RGBW. The default is GRB.
initial_RED: 0.5
initial_GREEN: 0.5
initial_BLUE: 0.5
# Sets the initial LED color of the Neopixel. Each value should be
# between 0.0 and 1.0. The WHITE option is only available on RGBW
# LEDs. The default for each color is 0.
[gcode_macro M105]
rename_existing: M105.1
gcode:
M105.1
#if the extruder is off
{% if printer.extruder.target == 0 %}
#Set the LED to red if the extruder is off but is still hot, otherwise
# set the color to green
{% if printer.extruder.temperature > 60.0 %}
SET_LED LED=temp_leds RED=1 GREEN=0 BLUE=0 INDEX=1 TRANSMIT=1
{% else %}
SET_LED LED=temp_leds RED=0 GREEN=1 BLUE=0 INDEX=1 TRANSMIT=1
{% endif %}
{% else %}
#if the extruder temp is at target temperature
{% if printer.extruder.temperature >= printer.extruder.target - 4.0 %}
SET_LED LED=temp_leds RED=1 GREEN=0 BLUE=0 INDEX=1 TRANSMIT=1
#if the extruder is still heating
{% else %}
{% set scaler = printer.extruder.temperature|float / printer.extruder.target|float %}
SET_LED LED=temp_leds RED={ scaler|float * 1 } GREEN=0 BLUE=0 INDEX=1 TRANSMIT=1
{% endif %}
{% endif %}
# Multi MCU setup
#https://github.com/KevinOConnor/klipper/blob/master/config/sample-raspberry-pi.cfg
# The rpi microcontroller is used as secondary.
# Typically, both the X and Y axes
# are connected to the main micro-controller. The rpi microcontroller is used
# on non time-critical functions such as enclosure sensors, additional fan or
# light sources
[mcu host]
serial: /tmp/klipper_host_mcu
# Example1: A led strip controlled by the GPIO20 on the RPi
[output_pin caselight]
pin: host:gpio20
# You can also write the pin in extended form by specifying
# the reference gpiochip.
#pin: host:gpiochip0/gpio20
[gcode_macro TOGGLE_CASELIGHT]
gcode:
SET_PIN PIN=caselight VALUE={(not printer['output_pin caselight'].value)|int}
# Example2: Using the i2c bus of the RPi to read a sensor
#[temperature_sensor enclosure_temp]
#sensor_type: HTU21D
#i2c_mcu: host
#i2c_bus: i2c.1
#htu21d_hold_master: False
#[gcode_macro QUERY_ENCLOSURE]
#default_parameter_SENSOR: htu21d enclosure_temp
#gcode:
#{action_respond_info(
# "Temperature: %.2f C\n"
# "Humidity: %.2f%%" % (
# printer[SENSOR].temperature,
# printer[SENSOR].humidity))}
# Example 3:Using a pin on another gpiochip connected to the RPi
# (in this case on an MCP23017)
#[fan]
#pin: host:gpiochip2/gpio7
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bltouch]
#*# z_offset = 0.850
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 18.775
#*# pid_ki = 0.857
#*# pid_kd = 102.792
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.390000, 0.108750, -0.260625
#*# 0.393750, 0.118125, -0.295625
#*# 0.239375, 0.145625, -0.036875
#*# tension = 0.2
#*# min_x = 20.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 86.0
#*# x_count = 3
#*# max_y = 261.0
#*# mesh_x_pps = 2
#*# max_x = 205.0