Skip to content

Instantly share code, notes, and snippets.

@rquackenbush
Last active December 27, 2023 05:15
Show Gist options
  • Save rquackenbush/7c804ca8f89397ebd83df9d2a2bb534e to your computer and use it in GitHub Desktop.
Save rquackenbush/7c804ca8f89397ebd83df9d2a2bb534e to your computer and use it in GitHub Desktop.
Klipper config for Creality Ender 3 - v4.2.7 with BLTouch wired to the 5 pin connector
[include moonraker_obico_macros.cfg]
# This file contains pin mappings for the Creality "v4.2.7" board. 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.
[stepper_x]
step_pin: PB9
dir_pin: PC2
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PB7
dir_pin: PB8
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: PB5
dir_pin: !PB6
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
# position_endstop: 0.0 # disable to use BLTouch
# endstop_pin: ^PA7 # disable to use BLTouch
endstop_pin: probe:z_virtual_endstop # enable to use BLTouch
position_min: -5 # enable to use BLTouch
position_max: 250
[safe_z_home] # enable for BLTouch
home_xy_position: 157.5,120.5
speed: 100
z_hop: 10
z_hop_speed: 5
[bltouch] # enable for BLTouch - fast-mode
# sensor_pin: ^PB1
# control_pin: PB0
# according to schematic
sensor_pin: PA7
control_pin: PB0
pin_up_touch_mode_reports_triggered: True
probe_with_touch_mode: True
x_offset: -44 # modify as needed for bltouch location
y_offset: -6 # modify as needed for bltouch location
#z_offset: 0.0 # modify as needed for bltouch or run PROBE_CALIBRATE
speed: 10
samples: 3
sample_retract_dist: 5.0 # Can be set lower, example 2.5 depending on height of bltouch from bed
lift_speed: 40
samples_tolerance_retries: 3
speed: 10
samples: 2
[bed_mesh]
speed: 80
horizontal_move_z: 5
mesh_min: 18,18
mesh_max: 175,202
probe_count: 5,5
algorithm: bicubic
# # manual Bed adjustment via BED_SCREWS_ADJUST
# [bed_screws]
# screw1: 72.5, 41.5
# screw1_name: front left screw
# screw2: 198.5,35.5
# screw2_name: front right screw
# screw3: 198.5,205.5
# screw3_name: rear right screw
# screw4: 28.5,205.5
# screw4_name: rear left screw
# horizontal_move_z: 10
# speed: 50
[screws_tilt_adjust]
screw1: 72.5, 41.5
screw1_name: front left screw
screw2: 198.5,41.5
screw2_name: front right screw
screw3: 198.5,212.5
screw3_name: rear right screw
screw4: 72.5,212.5
screw4_name: rear left screw
horizontal_move_z: 10
speed: 50
screw_thread: CW-M4
[input_shaper]
shaper_freq_x: 100
shaper_freq_y: 100
shaper_type: mzv
[gcode_macro G29]
gcode:
G28
BED_MESH_CALIBRATE
G0 X0 Y0 Z10 F6000
BED_MESH_PROFILE save=default
SAVE_CONFIG
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB3
dir_pin: PB4
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
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_accel_to_decel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[board_pins]
aliases:
EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
[exclude_object]
[include mainsail.cfg]
[include timelapse.cfg]
[gcode_macro do_the_mesh]
gcode:
BED_MESH_PROFILE LOAD="default"
description: Either load the default mesh or perform a mesh load operation.
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bltouch]
#*# z_offset = 1.289
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.132500, -0.125000, -0.071250, -0.088750, -0.013750
#*# -0.046250, -0.047500, 0.017500, -0.000000, 0.035000
#*# -0.050000, -0.047500, 0.001250, -0.007500, 0.023750
#*# -0.086250, -0.076250, 0.006250, -0.001250, 0.053750
#*# -0.097500, -0.106250, -0.056250, -0.057500, 0.005000
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 18.0
#*# max_x = 175.0
#*# min_y = 18.0
#*# max_y = 202.0
[include moonraker_obico_macros.cfg]
# This file contains pin mappings for the Creality "v4.2.7" board. 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.
[stepper_x]
step_pin: PB9
dir_pin: PC2
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PB7
dir_pin: PB8
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: PB5
dir_pin: !PB6
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
# position_endstop: 0.0 # disable to use BLTouch
# endstop_pin: ^PA7 # disable to use BLTouch
endstop_pin: probe:z_virtual_endstop # enable to use BLTouch
position_min: -5 # enable to use BLTouch
position_max: 250
[safe_z_home] # enable for BLTouch
home_xy_position: 157.5,120.5
speed: 100
z_hop: 10
z_hop_speed: 5
[bltouch] # enable for BLTouch - fast-mode
sensor_pin: PA7
control_pin: PB0
pin_up_touch_mode_reports_triggered: True
probe_with_touch_mode: True
x_offset: -44 # modify as needed for bltouch location
y_offset: -6 # modify as needed for bltouch location
#z_offset: 0.0 # modify as needed for bltouch or run PROBE_CALIBRATE
speed: 10
sample_retract_dist: 5.0 # Can be set lower, example 2.5 depending on height of bltouch from bed
lift_speed: 40
samples_tolerance_retries: 3
speed: 10
samples: 1
[bed_mesh]
speed: 80
horizontal_move_z: 5
mesh_min: 18,18
mesh_max: 175,202
probe_count: 5,5
algorithm: bicubic
# manual Bed adjustment via BED_SCREWS_ADJUST
[bed_screws]
screw1: 72.5, 41.5
screw1_name: front left screw
screw2: 198.5,35.5
screw2_name: front right screw
screw3: 198.5,205.5
screw3_name: rear right screw
screw4: 28.5,205.5
screw4_name: rear left screw
horizontal_move_z: 10
speed: 50
[screws_tilt_adjust]
screw1: 72.5, 41.5
screw1_name: front left screw
screw2: 220,41.5
screw2_name: front right screw
screw3: 220,212.5
screw3_name: rear right screw
screw4: 72.5,212.5
screw4_name: rear left screw
horizontal_move_z: 10
speed: 50
screw_thread: CW-M4
[input_shaper]
shaper_freq_x: 100
shaper_freq_y: 100
shaper_type: mzv
[gcode_macro G29]
gcode:
G28
BED_MESH_CALIBRATE
G0 X0 Y0 Z10 F6000
BED_MESH_PROFILE save=default
SAVE_CONFIG
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB3
dir_pin: PB4
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
#[fan]
#pin: PA0
[heater_fan heatbreak_cooling_fan]
pin: PA0
heater_temp: 40
fan_speed: 1.0
heater: extruder
[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_accel_to_decel: 3000
max_z_velocity: 5
max_z_accel: 100
[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
[gcode_macro G29]
gcode:
G28
G1 Z10 F600
BED_MESH_CLEAR
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE=default
SAVE_CONFIG
[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
[board_pins]
aliases:
EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
[exclude_object]
[include mainsail.cfg]
[include timelapse.cfg]
[gcode_macro do_the_mesh]
gcode:
BED_MESH_PROFILE LOAD="default"
description: Either load the default mesh or perform a mesh load operation.
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bltouch]
#*# z_offset = 1.950
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.087500, -0.032500, -0.060000, 0.102500, 0.127500
#*# -0.195000, -0.250000, -0.260000, -0.107500, 0.142500
#*# -0.252500, -0.170000, -0.182500, -0.025000, 0.010000
#*# -0.190000, -0.210000, -0.275000, -0.142500, 0.015000
#*# -0.220000, -0.037500, -0.102500, 0.047500, 0.060000
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 18.0
#*# max_x = 175.0
#*# min_y = 18.0
#*# max_y = 202.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment