aboutsummaryrefslogtreecommitdiffstats
path: root/config/printer-biqu-bx-2021.cfg
blob: 01225fb8726b5de52f2bc08a43419e9e2abc19bc (plain)
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
# This file contains common pin mappings for the BigTreeTech SKR SE BX.
# To use this config, the firmware should be compiled for the
# STM32H743 with a "128KiB bootloader". Additionally, GPIO pins PB5
# and PE5 need to be set at microcontroller startup.

######################################################################
# NOTE: In order enable the TFT70-BX display when the printer first
# starts, add PB5 and PE5 to the `GPIO pins to set at micro-controller
# startup` section when running "make menuconfig"
######################################################################

# The "make flash" command does not work on the SKR SE BX. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR SE BX
# with that SD card. After klipper has been flashed once to the board,
# you can update klipper by leaving a microSD inserted and running the
# scripts/flash-sd.sh script.

# See docs/Config_Reference.md for a description of parameters.

########################################
# Steppers
########################################

[stepper_x]
step_pin: PG13
dir_pin: !PG12
enable_pin: !PG14
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 400
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: -13
position_min: -13
position_max: 250
homing_speed: 30
homing_retract_dist: 0

[stepper_y]
step_pin: PB3
dir_pin: !PD3
enable_pin: !PB4
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 400
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: -7
position_min: -7
position_max: 250
homing_speed: 30
homing_retract_dist: 0

[stepper_z]
step_pin: PD7
dir_pin: PD6
enable_pin: !PG9
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 400
endstop_pin: probe:z_virtual_endstop
position_min: -2
position_max: 250

[stepper_z1]
step_pin: PA8
dir_pin: PC9
enable_pin: !PD2
microsteps: 16
rotation_distance: 8
full_steps_per_rotation: 400

[extruder]
step_pin: PC14
dir_pin: !PC13
enable_pin: !PC15
microsteps: 16
rotation_distance: 24.031
gear_ratio: 7:1
full_steps_per_rotation: 200
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PH4
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 350

[safe_z_home]
home_xy_position: 125,125
speed: 200
z_hop: 10
z_hop_speed: 25

########################################
# TMC2209 configuration
########################################

[tmc2209 stepper_x]
uart_pin: PG10
diag_pin: ^PB11
run_current: 0.800
sense_resistor: 0.150
driver_SGTHRS: 127
stealthchop_threshold: 999999

[tmc2209 stepper_y]
uart_pin: PD4
diag_pin: ^PB12
run_current: 0.800
sense_resistor: 0.150
driver_SGTHRS: 137
stealthchop_threshold: 999999

[tmc2209 stepper_z]
uart_pin: PD5
run_current: 1.000
sense_resistor: 0.150
stealthchop_threshold: 999999

[tmc2209 stepper_z1]
uart_pin: PC8
run_current: 1.000
sense_resistor: 0.150
stealthchop_threshold: 999999

[tmc2209 extruder]
uart_pin: PI8
run_current: 0.800
sense_resistor: 0.150
stealthchop_threshold: 0

########################################
# PRINTER
########################################

[mcu]
serial: /dev/ttyAMA0
restart_method: command

[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 1000
max_z_velocity: 10
max_z_accel: 1000

[fan]
pin: PA5

[heater_fan extruder_fan]
pin: PA6
heater: extruder

[controller_fan controller_fan]
pin: PA7
idle_timeout: 300 # 5 minute timeout

[output_pin motor_power]
pin: PI11
value: 1

[idle_timeout]
gcode:
    TURN_OFF_HEATERS
    M84
    SET_PIN PIN=screen VALUE=0
    SET_LED LED=led BLUE=0.0 RED=0.0 GREEN=0.0

[pause_resume]

########################################
# DISPLAY
########################################

[output_pin screen]
pin: PB5
value: 1

[display_status]

[gcode_button lcd_button]
pin: PH8
press_gcode:
    SET_PIN PIN=screen VALUE=1
    SET_LED LED=led BLUE=1.0 RED=1.0 GREEN=1.0

[output_pin beeper]
pin: PA14
pwm: True
cycle_time: 0.001

########################################
# LEDS
########################################

[neopixel led]
pin: PH3
chain_count: 15

[neopixel knob]
pin: PB1
chain_count: 2

[delayed_gcode welcome]
initial_duration: 0.1
gcode:
    SET_LED LED=knob RED=0.0 BLUE=1.0 GREEN=0.0
    SET_LED LED=led RED=0.0 BLUE=1.0 GREEN=0.0
    G4 P1000
    SET_LED LED=led RED=1.0 BLUE=0.0 GREEN=0.0
    G4 P1000
    SET_LED LED=led RED=0.0 BLUE=0.0 GREEN=1.0
    G4 P1000
    SET_LED LED=led RED=1.0 BLUE=1.0 GREEN=1.0

########################################
# BED
########################################

[heater_bed]
heater_pin: PA4
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PH5
control: watermark
min_temp: 0
max_temp: 250

[probe]
pin: PH2
x_offset: -30.1
y_offset: 26.78
z_offset: 0
speed: 5
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.006
samples_tolerance_retries: 5

[bed_mesh]
speed: 120
mesh_min: 10,19.78
mesh_max: 219.9,230
probe_count: 4,4

[screws_tilt_adjust]
screw1: 58,-7
screw1_name: front left
screw2: 245,-7
screw2_name: front right
screw3: 245,179
screw3_name: rear right
screw4: 58,179
screw4_name: rear left
speed: 100
screw_thread: CCW-M3

########################################
## MACROS
########################################

# Slicer setup: "print_start NOZZLE=<temp> BED=<temp>
# This macro does a preheat on the probe for better accuracy and needs
# the temps passed in. examples:
# Cura: PRINT_START BED={material_bed_temperature_layer_0} NOZZLE={material_print_temperature_layer_0}
# PrusaSlicer: PRINT_START NOZZLE=[first_layer_temperature] BED=[bed_temperature]
#   Use PRINT_END for the slicer ending script
[gcode_macro PRINT_START]
gcode:
    # Turn on screen if it's not on
    SET_PIN PIN=screen VALUE=1
    G28
    G0 Z1
    # Warm up nozzle, not to full temps yet
    M104 S150
    # Set LED to Purple for bed heating
    SET_LED LED=led BLUE=0.94 RED=0.63 GREEN=0.13
    M117 Heating Bed

    # Allow probe to warm up, then re-home Z
    M190 S60
    M105
    G4 P90000
    G28 Z

    M190 S{params.BED}
    M105
    G90 # Ensure we are in absolute mode
    G21
    M83 # Set the extruder to relative mode
    G92 E0

    # Set LED to Red for nozzle heating
    SET_LED LED=led BLUE=0.0 RED=1.0 GREEN=0.0
    M117 Heating Nozzle
    G0 X2 Y0 F6000
    G0 Z0.4
    M109 S{params.NOZZLE}
    M105
    # Set LED to white for printing
    SET_LED LED=led BLUE=1.0 RED=1.0 GREEN=1.0
    M117 Printing

    # Purge Line
    G1 X120 E30 F1200
    G1 Y1
    G1 X2 E30 F1200
    G92 E0

    G1 Z1.0 F600
    G92 E0
    G0 F9000
    G90 # Set back to Absolute mode