-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer.cfg
335 lines (295 loc) · 6.57 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
# MCU config
[stepper_x]
step_pin: P2.2
dir_pin: P2.6
enable_pin: !P2.1
rotation_distance: 40
microsteps: 16
full_steps_per_rotation: 400
endstop_pin: tmc2209_stepper_x:virtual_endstop
homing_retract_dist: 0
position_endstop: 283
position_max: 283
homing_speed: 40
[stepper_y]
step_pin: P0.19
dir_pin: P0.20
enable_pin: !P2.8
rotation_distance: 40
microsteps: 16
full_steps_per_rotation: 400
endstop_pin: tmc2209_stepper_y:virtual_endstop
homing_retract_dist: 0
position_endstop: -10
position_min: -10
position_max: 280
homing_speed: 40
[stepper_z]
step_pin: P0.22
dir_pin: P2.11
enable_pin: !P0.21
rotation_distance: 7.89
microsteps: 16
full_steps_per_rotation: 400
endstop_pin: probe:z_virtual_endstop
position_min: -0.2
position_max: 270
homing_speed: 4
[stepper_z1]
step_pin: P0.1
dir_pin: P0.0
enable_pin: !P0.10
rotation_distance: 7.89
microsteps: 16
full_steps_per_rotation: 400
[extruder]
step_pin: P2.13
dir_pin: P0.11
enable_pin: !P2.12
rotation_distance: 22.29
microsteps: 16
full_steps_per_rotation: 400
gear_ratio: 50:17
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: ATC Semitec 104GT-2
sensor_pin: P0.24
control: pid
pid_Kp: 18.541
pid_Ki: 0.702
pid_Kd: 122.372
min_temp: 0
max_temp: 260
max_extrude_only_velocity: 1200
max_extrude_only_distance: 650
max_extrude_cross_section: 20 # Makes this security feature less annoying
[heater_bed]
heater_pin: P2.5
sensor_type: NTC 100K MGB18-104F39050L32
sensor_pin: P0.23
control: pid
pid_Kp: 54.993
pid_Ki: 1.540
pid_Kd: 490.814
min_temp: 0
max_temp: 120
[tmc2209 stepper_x]
uart_pin: P1.17
interpolate: True
run_current: 0.950
sense_resistor: 0.110
stealthchop_threshold: 999999
diag_pin: ^P1.29
driver_SGTHRS: 148
[tmc2209 stepper_y]
uart_pin: P1.15
interpolate: True
run_current: 0.950
sense_resistor: 0.110
stealthchop_threshold: 999999
diag_pin: ^P1.27
driver_SGTHRS: 140
[tmc2209 stepper_z]
uart_pin: P1.10
interpolate: True
run_current: 0.600
sense_resistor: 0.110
stealthchop_threshold: 999999
[tmc2209 stepper_z1]
uart_pin: P1.1
interpolate: True
run_current: 0.600
sense_resistor: 0.110
stealthchop_threshold: 999999
[tmc2209 extruder]
uart_pin: P1.8
interpolate: True
run_current: 0.900
sense_resistor: 0.110
stealthchop_threshold: 999999
[homing_override]
axes: xyz
gcode:
{% set config = printer['configfile'].config %}
{% set homing_move_speed = 200 * 60 %}
{% set homing_move_speed_z = (config.bltouch.speed | int) * 60 %}
{% set backoff_dist = 5 %}
{% set backoff_dist_z = 5 %}
{% set x_max = (config.stepper_x.position_max | int) %}
{% set y_max = (config.stepper_y.position_max | int) %}
#sniff gcode parameters for
#which axes have been requested for homing
{% if not 'X' in params
and not 'Y' in params
and not 'Z' in params %}
{% set X, Y, Z = True, True, True %}
{% else %}
{% if 'X' in params %}
{% set X = True %}
{% endif %}
{% if 'Y' in params %}
{% set Y = True %}
{% endif %}
{% if 'Z' in params %}
{% set Z = True %}
{% endif %}
{% endif %}
{ action_respond_info("Homing - X:" + (X | default(False) | string) + " Y:" + (Y | default(False) | string) + " Z:" + (Z | default(False) | string)) }
{% if X %}
G28 X0
G1 X{x_max - backoff_dist} F{homing_move_speed}
M400
{% endif %}
{% if Y %}
{% if X %}
{ action_respond_info("Endstops before Y home") }
QUERY_ENDSTOPS # Forces an endstop reset
{% endif %}
G28 Y0
G1 Y{backoff_dist} F{homing_move_speed}
M400
{% endif %}
{% if Z %}
G1 X{x_max / 2} Y{y_max / 2} F{homing_move_speed}
G28 Z0
G1 Z{backoff_dist_z} F{homing_move_speed_z}
M400
{% endif %}
[bltouch]
sensor_pin: ^P1.25
control_pin: P2.0
x_offset: 26.5
y_offset: -3
z_offset: 1.259
speed: 4
lift_speed: 3
samples: 2
sample_retract_dist: 3
samples_tolerance: 0.01
samples_tolerance_retries: 3
[bed_screws]
screw1: 10,10
screw2: 280,10
screw3: 280,280
screw4: 10,280
speed: 200
horizontal_move_z: 10
[bed_mesh]
speed: 200
horizontal_move_z: 5
# This boundary is relative to the probe, not to the nozzle
mesh_min: 25, 10
mesh_max: 285, 275
probe_count: 4, 4
algorithm: bicubic
fade_start: 1.0
fade_end: 10.0
[z_tilt]
z_positions:
0,174
280,174
points:
0,174
260,174
speed: 200
retries: 4
retry_tolerance: 0.1
[heater_fan extruder_fan]
pin: P2.4
max_power: 1
heater: extruder
[fan]
pin: P2.3
max_power: 0.9
off_below: 0.15
[temperature_sensor Raspberry_Pi]
sensor_type: temperature_host
[output_pin _BEEPER_Pin]
pin: P1.30
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.001
[gcode_macro M300]
gcode:
{% set S = params.S|default(1000)|int %} ; S sets the tone frequency
{% set P = params.P|default(100)|int %} ; P sets the tone duration
{% set L = 0.5 %} ; L varies the PWM on time, close to 0 or 1 the tone gets a bit quieter. 0.5 is a symmetric waveform
{% if S <= 0 %} ; dont divide through zero
{% set F = 1 %}
{% elif S >= 10000 %} ;max frequency set to 10kHz
{% set F = 0 %}
{% else %}
{% set F = 1/S %} ;convert frequency to seconds
{% endif %}
{% if S > 0 %}
SET_PIN PIN=_BEEPER_Pin VALUE={L} CYCLE_TIME={F} ;Play tone
{% else %}
G4 P{F}
{% endif %}
G4 P{P} ;tone duration
SET_PIN PIN=_BEEPER_Pin VALUE=0
G4 P{P} ;Fix timing
[mcu]
serial: /dev/ttyAMA0
restart_method: command
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 4000
max_z_velocity: 4
max_z_accel: 30
[gcode_arcs]
resolution: 1.0
[exclude_object]
[sdcard_loop]
[firmware_retraction]
retract_length: 4
retract_speed: 50
unretract_speed: 50
[filament_switch_sensor filament_sensor]
switch_pin: ^!P1.24
pause_on_runout: True
runout_gcode:
{% if printer.idle_timeout.state == "Printing" %}
{ action_respond_info("Filament runout detected!") }
{ action_respond_info("Waiting for Filament switch") }
M300 S400
M300 S500
M300 S600
M300 S700
M300 S800
M300 S700
M300 S600
M300 S500
M300 S400
UNLOAD_FILAMENT
LED_ERROR
{% endif %}
insert_gcode:
M300 S400
M300 S400
G4 P7000 # Wait 7 seconds to insert the filament into the extruder
{ action_respond_info("Filament loading...") }
LOAD_FILAMENT
LED_PRINTING
[input_shaper]
shaper_type_x = ei
shaper_freq_x = 52.2
shaper_type_y = ei
shaper_freq_y = 51.0
# RPI Config
# [mcu rpi]
# serial: /tmp/klipper_host_mcu
# External config
[include ./mainsail.cfg]
[include ./timelapse.cfg]
[include ./KlipperScreen-macros.cfg]
[include ./macros.cfg]
[include ./music.cfg]
[include ./spoolman-macros.cfg]
[include ./KAMP-Settings.cfg]
[include ./leds.cfg]
# Include this line if the KUSBA PCB is connected for resonance measurements
#[include ./KUSBA.cfg]