-
Notifications
You must be signed in to change notification settings - Fork 0
/
printer.cfg
281 lines (240 loc) · 6.77 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
# This file contains pin mappings for the stock 2020 Creality Ender 3
# V2. To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The firmware
# filename must end in ".bin" and must not match the last filename
# that was flashed.
# See docs/Config_Reference.md for a description of parameters.
[include mainsail.cfg]
[include macros/macros.cfg]
[gcode_macro START_PRINT]
gcode:
SAVE_GCODE_STATE NAME=start_print_state
{% set BED_TEMP = params.BED_TEMP|default(0)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(210)|float %}
# These are duplicates of what is happening in the gcodes generated by Prusaslicer,
# so they are pretty useless unless I switch to a different slicer.
M140 S{BED_TEMP} # Start heating the bed
M104 S{EXTRUDER_TEMP} # Start heating the extruder
G28 # Home printer
BED_MESH_CALIBRATE ; Do new default bed mesh and apply
M190 S{BED_TEMP} # Wait for bed temp
M109 S{EXTRUDER_TEMP} # Wait for extruder temp
NOZZLE_PRIME_LINE
RESTORE_GCODE_STATE NAME=start_print_state
# We do not want this to be restored. Need this to be set for the print!
SET_GCODE_OFFSET Z=-0.075 # Set Z-Offset
[gcode_macro END_PRINT]
gcode:
SAVE_GCODE_STATE NAME=end_print_state
# Move nozzle away from print while retracting
G91 # Use incremental positioning
# The important thing is for the extruder retraction here.
G1 X-2 E-3 F300
G90 # Use absolute coordinates
# Setting Z we will move to if there is room.
{% set current_z_plus_some = printer.toolhead.position.z + 10 %}
{% set new_z = current_z_plus_some %}
{% if printer.toolhead.axis_maximum.z < current_z_plus_some %}
{% set new_z = printer.toolhead.axis_maximum.z %}
{% endif %}
G1 Z{new_z} F240
# I think that the best Y position for showing the print would be at least such that the extruder is a few milimeters
# behind the furthest Y axis position that we print on.
# Barring that, what we should do is not go backwards if the Y is already further than our presentation preset.
{% set good_y_presentation_value = printer.toolhead.axis_maximum.y * 0.85 %}
{% set new_y = good_y_presentation_value %}
{% if printer.toolhead.position.y > good_y_presentation_value %}
{% set new_y = printer.toolhead.position.y %}
{% endif %}
G1 X5 Y{new_y} F2000 # present print
M140 S0 # Turn off bed
M104 S0 # Turn off extruder
M106 S0 # Turn off fan
M84 # Disable stepper motors
RESTORE_GCODE_STATE NAME=end_print_state
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 5
max_temp: 100
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 237
homing_speed: 50
[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
#endstop_pin: ^PA7
endstop_pin: probe:z_virtual_endstop
#position_endstop: 0.0
position_max: 250
position_min: -3
[bltouch]
sensor_pin: ^PB1
control_pin: PB0
x_offset: -32
y_offset: -38
#z_offset: 0
[safe_z_home]
home_xy_position: 117.5,117.5
z_hop: 10
z_hop_speed: 5
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
gear_ratio: 42:12
rotation_distance: 26.359
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
min_temp: 0
max_temp: 300
pressure_advance = 0.0375
[bed_mesh]
speed: 150
horizontal_move_z: 5
mesh_min: 15,15
mesh_max: 190,190
probe_count: 5,5
algorithm: bicubic
[screws_tilt_adjust]
# The sprite pro's offset is -36.5,-40.
# Calcualted offset: -4.5,2
# Calculated bl touch offset: -32,-38
# Screw positions based on my own eyeballing:
#screw1: 27,29
#screw2: 197,29
#screw3: 27,199
#screw4: 197,199
screw1: 59,71
screw1_name: front left screw
screw2: 229,71
screw2_name: front right screw
screw3: 59,237
screw3_name: back left screw
screw4: 229,237
screw4_name: back right screw
horizontal_move_z: 10
speed: 150
screw_thread: CW-M4
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
# tuned for stock hardware with 50 degree Celsius target
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[fan]
pin: PA0
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh Glass]
#*# version = 1
#*# points =
#*# -0.187500, -0.047500, -0.102500, -0.147500, -0.180000
#*# -0.122500, 0.042500, -0.017500, -0.052500, -0.075000
#*# -0.115000, 0.065000, 0.005000, -0.020000, -0.042500
#*# -0.100000, 0.077500, -0.017500, -0.080000, -0.100000
#*# -0.130000, 0.047500, -0.017500, -0.052500, -0.087500
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 15.0
#*# max_x = 188.0
#*# min_y = 15.0
#*# max_y = 191.0
#*#
#*# [bltouch]
#*# z_offset = 2.840
#*#
#*# [bed_mesh PEI]
#*# version = 1
#*# points =
#*# -0.207500, -0.082500, -0.072500, -0.070000, -0.105000
#*# -0.145000, -0.025000, 0.022500, -0.010000, -0.060000
#*# -0.057500, 0.045000, 0.050000, 0.010000, -0.062500
#*# 0.012500, 0.090000, 0.065000, -0.022500, -0.142500
#*# 0.057500, 0.120000, 0.075000, -0.037500, -0.165000
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 15.0
#*# max_x = 188.0
#*# min_y = 15.0
#*# max_y = 191.0
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.065000, -0.017500, -0.095000, -0.130000, -0.222500
#*# -0.075000, 0.032500, -0.020000, -0.047500, -0.132500
#*# -0.112500, 0.012500, -0.012500, -0.012500, -0.065000
#*# -0.130000, 0.020000, -0.007500, -0.002500, -0.072500
#*# -0.202500, -0.047500, -0.052500, -0.027500, -0.062500
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 15.0
#*# max_x = 190.0
#*# min_y = 15.0
#*# max_y = 190.0
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 19.764
#*# pid_ki = 1.046
#*# pid_kd = 93.385