← Back to Config Store
📄 printer.cfg
FILE: printer.cfg
•
LINES: 327
•
SIZE: 9.92 KB
•
SYNTAX: INI / Klipper G-Code
1 # This file contains pin mappings for the Creality "v4.2.7" board. To
2 # use this config, during "make menuconfig" select the STM32F103 with
3 # a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.
4
5 # If you prefer a direct serial connection, in "make menuconfig"
6 # select "Enable extra low-level configuration options" and select
7 # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
8 # cable used for the LCD module as follows:
9 # 3: Tx, 4: Rx, 9: GND, 10: VCC
10
11 # Flash this firmware by copying "out/klipper.bin" to a SD card and
12 # turning on the printer with the card inserted. The firmware
13 # filename must end in ".bin" and must not match the last filename
14 # that was flashed.
15
16 # See docs/Config_Reference.md for a description of parameters.
17
18
19 # General Tuning Process:
20 # 1) SCREWS_TILT_CALCULATE
21 # 2) PROBE_CALIBRATE
22 # 3) BED_MESH_CALIBRATE
23
24 [stepper_x]
25 step_pin: PB9
26 dir_pin: PC2
27 enable_pin: !PC3
28 microsteps: 16
29 rotation_distance: 40
30 endstop_pin: ^PA5
31 position_endstop: 0
32 position_max: 235
33 homing_speed: 50
34
35 [stepper_y]
36 step_pin: PB7
37 dir_pin: PB8
38 enable_pin: !PC3
39 microsteps: 16
40 rotation_distance: 40
41 endstop_pin: ^PA6
42 position_endstop: 0
43 position_max: 235
44 homing_speed: 50
45
46 [stepper_z]
47 step_pin: PB5
48 dir_pin: !PB6
49 enable_pin: !PC3
50 microsteps: 16
51 rotation_distance: 8
52 endstop_pin: probe:z_virtual_endstop
53 #position_endstop: 0.0 tuned by probe
54 position_max: 250
55 position_min: -1.3 # Useful when setting z-offset.
56
57 [extruder]
58 max_extrude_only_distance: 100.0
59 #max_extrude_only_distance: 101.0 # Extruder tuning
60 #min_extrude_temp: 0 #Cold Extruder tuning
61 step_pin: PB3
62 dir_pin: PB4
63 enable_pin: !PC3
64 microsteps: 16
65 rotation_distance: 32.136 #31.506 prior to tuning. (102mm extruded when sent 100mm at 1mm/s)
66 nozzle_diameter: 0.400
67 filament_diameter: 1.750
68 heater_pin: PA1
69 sensor_type: EPCOS 100K B57560G104F
70 sensor_pin: PC5
71 #control: pid
72 #pid_Kp: 21.527
73 #pid_Ki: 1.063
74 #pid_Kd: 108.982
75 min_temp: 0
76 max_temp: 250
77 pressure_advance: 0
78
79 [gcode_arcs]
80 resolution: 1.0
81 # An arc will be split into segments. Each segment's length will
82 # equal the resolution in mm set above. Lower values will produce a
83 # finer arc, but also more work for your machine. Arcs smaller than
84 # the configured value will become straight lines. The default is
85 # 1mm.
86 # Potential Benefits: Smoother Curves, Reduced File Size, Improved Print Speed
87
88 #Switch sensor, blue @PA4 + red VCC 3,3V
89 #[filament_switch_sensor btt_switch_sensor]
90 #switch_pin: ^PA4
91 #pause_on_runout: true
92 #runout_gcode:
93 # M117 Switch Runout!
94 # {action_respond_info("BTT: Switch Runout detected!")}
95 # PAUSE
96 #insert_gcode:
97 # M117 Filament inserted
98 # {action_respond_info("BTT: Filament inserted.")}
99
100 #Motion sensor, Green @PA7 +Black GND
101 #[filament_motion_sensor btt_motion_sensor]
102 #switch_pin: ^PA7 # Previous Z- on 4.2.7
103 #detection_length: 2.88 # accuracy of motion sensor 2.88mm
104 #extruder: extruder
105 #pause_on_runout: true
106 #runout_gcode:
107 # M117 Motion Runout
108 # {action_respond_info("BTT: Motion Sensor Runout detected!")}
109 # PAUSE
110 #insert_gcode:
111 # M117 Filament inserted
112 # {action_respond_info("BTT: Filament inserted.")}
113
114 #[delayed_gcode DISABLEFILAMENTSENSOR]
115 #initial_duration: 1
116 #gcode:
117 # M117 Motion FIL. SENSOR OFF.
118 # SET_FILAMENT_SENSOR SENSOR=btt_motion_sensor ENABLE=0
119 # SET_FILAMENT_SENSOR SENSOR=btt_switch_sensor ENABLE=0
120
121 [heater_bed]
122 heater_pin: PA2
123 sensor_type: EPCOS 100K B57560G104F
124 sensor_pin: PC4
125 #control: pid
126 #pid_Kp: 54.027
127 #pid_Ki: 0.770
128 #pid_Kd: 948.182
129 min_temp: 0
130 max_temp: 130
131
132 [fan]
133 pin: PA0
134
135 [mcu]
136 serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
137 restart_method: command
138
139 [printer]
140 kinematics: cartesian
141 max_velocity: 300
142 max_accel: 3000
143 max_z_velocity: 5
144 max_z_accel: 100
145
146 [board_pins]
147 aliases:
148 EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
149 EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
150 PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
151
152 # Pin mappings for BL_T port
153 [bltouch]
154 sensor_pin: ^PB1
155 control_pin: PB0
156 x_offset: -43
157 y_offset: -6
158 #z_offset: 0.145
159
160 [safe_z_home]
161 home_xy_position: 162, 117
162 speed: 50
163 z_hop: 10
164 z_hop_speed: 5
165
166 [screws_tilt_adjust]
167 screw1: 70, 45
168 screw1_name: front left screw
169 screw2: 235, 45
170 screw2_name: front right screw
171 screw3: 235, 215
172 screw3_name: rear right screw
173 screw4: 70, 215
174 screw4_name: rear left screw
175 horizontal_move_z: 10.
176 speed: 50.
177 screw_thread: CW-M4
178
179 [bed_mesh]
180 speed: 120
181 horizontal_move_z: 5
182 mesh_min: 31.6, 31.8 # Adjusted based on probe offsets and usable bed size
183 mesh_max: 188.6, 226.8 # Adjusted based on probe offsets and usable bed size
184 probe_count: 5, 3
185 mesh_pps: 2, 3
186 algorithm: bicubic
187 bicubic_tension: 0.2
188
189 [display]
190 lcd_type: st7920
191 cs_pin: PB12
192 sclk_pin: PB13
193 sid_pin: PB15
194 encoder_pins: ^PB14, ^PB10
195 click_pin: ^!PB2
196
197 [include mainsail.cfg]
198
199 #[gcode_macro _CLIENT_VARIABLE]
200 #variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False]
201 #variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X
202 #variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y
203 #variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
204 #variable_retract : 1.0 ; the value to retract while PAUSE
205 #variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT
206 #variable_speed_retract : 35.0 ; retract speed in mm/s
207 #variable_unretract : 1.0 ; the value to unretract while RESUME
208 #variable_speed_unretract : 35.0 ; unretract speed in mm/s
209 #variable_speed_hop : 15.0 ; z move speed in mm/s
210 #variable_speed_move : 100.0 ; move speed in mm/s
211 #variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True/False]
212 #variable_park_at_cancel_x : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
213 #variable_park_at_cancel_y : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
214 ## !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!!
215 #variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False]
216 #variable_idle_timeout : 0 ; time in sec until idle_timeout kicks in. Value 0 means that no value will be set or restored
217 #variable_runout_sensor : "" ; If a sensor is defined, it will be used to cancel the execution of RESUME in case no filament is detected.
218 ## Specify the config name of the runout sensor e.g "filament_switch_sensor runout". Hint use the same as in your printer.cfg
219 ## !!! Custom macros, please use with care and review the section of the corresponding macro.
220 ## These macros are for simple operations like setting a status LED. Please make sure your macro does not interfere with the basic macro functions.
221 ## Only single line commands are supported, please create a macro if you need more than one command.
222 #variable_user_pause_macro : "" ; Everything inside the "" will be executed after the klipper base pause (PAUSE_BASE) function
223 #variable_user_resume_macro: "" ; Everything inside the "" will be executed before the klipper base resume (RESUME_BASE) function
224 #variable_user_cancel_macro: "" ; Everything inside the "" will be executed before the klipper base cancel (CANCEL_PRINT_BASE) function
225
226 [gcode_macro START_PRINT]
227 gcode:
228 {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
229 {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
230
231 # Enable BTT SFS v2.0 Smart Sensor
232 #M117 # ENABLING the Smart Filament Sensor
233 #SET_FILAMENT_SENSOR SENSOR=btt_motion_sensor ENABLE=1
234 #SET_FILAMENT_SENSOR SENSOR=btt_switch_sensor ENABLE=1
235
236 # Start bed heating
237 M140 S{BED_TEMP}
238 M109 S{EXTRUDER_TEMP}
239
240 # Use absolute coordinates
241 G90
242 # Reset the G-Code Z offset (adjust Z offset if needed)
243 SET_GCODE_OFFSET Z=0.0
244 # Home the printer
245 G28
246
247 # Calibrate Bed Mesh
248 #BED_MESH_CALIBRATE PROFILE=default
249
250 # --- Prime Extruder ---
251 G1 X2.5 Y200 F1000 ; Move to back left corner
252 G1 Z0.2 F300 ; Lower nozzle
253 G92 E0 ; Reset extruder
254 G1 Y10 E10 F1000 ; Extrude 15mm along Y-axis (towards front)
255 G1 Y200 E10 F1000 ; Extrude 15mm along Y-axis (towards back)
256 G1 Z0.6 F300 ; Raise Z slightly
257 G92 E0 ; Reset extruder again
258 # --- End Prime ---
259
260
261 [gcode_macro CANCEL_PRINT]
262 description: Cancel the actual running print
263 rename_existing: CANCEL_PRINT_BASE
264 gcode:
265 TURN_OFF_HEATERS
266 CANCEL_PRINT_BASE
267 G92 E0
268 #M117 # MOTION FIL. SENSOR OFF.
269 #SET_FILAMENT_SENSOR SENSOR=btt_motion_sensor ENABLE=0
270 #SET_FILAMENT_SENSOR SENSOR=btt_switch_sensor ENABLE=0
271
272 [gcode_macro END_PRINT]
273 gcode:
274 # Turn off bed, extruder, and fan
275 M140 S0
276 M104 S0
277 M106 S0
278 # Move nozzle away from print while retracting
279 G91
280 G1 X-2 Y-2 E-3 F300
281 # Raise nozzle by 10mm
282 G1 Z10 F3000
283 G90
284 G1 X2.5 Y200 F1000 ; Move to back left corner
285 # Disable steppers
286 M84
287 # Disable BTT SFS v2.0
288 #M117 #MOTION FIL. SENSOR OFF.
289 G92 E0
290 #SET_FILAMENT_SENSOR SENSOR=btt_motion_sensor ENABLE=0
291 #SET_FILAMENT_SENSOR SENSOR=btt_switch_sensor ENABLE=0
292
293 #*# <---------------------- SAVE_CONFIG ---------------------->
294 #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
295 #*#
296 #*# [bltouch]
297 #*# z_offset = 1.050
298 #*#
299 #*# [extruder]
300 #*# control = pid
301 #*# pid_kp = 31.325
302 #*# pid_ki = 2.400
303 #*# pid_kd = 102.196
304 #*#
305 #*# [heater_bed]
306 #*# control = pid
307 #*# pid_kp = 72.727
308 #*# pid_ki = 1.336
309 #*# pid_kd = 989.993
310 #*#
311 #*# [bed_mesh default]
312 #*# version = 1
313 #*# points =
314 #*# -0.002500, 0.027500, 0.007500, 0.030000, 0.002500
315 #*# 0.005000, 0.025000, 0.027500, 0.037500, -0.017500
316 #*# 0.007500, 0.002500, 0.010000, 0.037500, -0.020000
317 #*# x_count = 5
318 #*# y_count = 3
319 #*# mesh_x_pps = 2
320 #*# mesh_y_pps = 3
321 #*# algo = bicubic
322 #*# tension = 0.2
323 #*# min_x = 31.599999999999994
324 #*# max_x = 188.6
325 #*# min_y = 31.8
326 #*# max_y = 226.8
327