Skip to content

Instantly share code, notes, and snippets.

@alekc
Last active October 21, 2022 09:31
Show Gist options
  • Save alekc/8213f093f2294a79fb9eeaf45138aeeb to your computer and use it in GitHub Desktop.
Save alekc/8213f093f2294a79fb9eeaf45138aeeb to your computer and use it in GitHub Desktop.
Ender5 Pro klipper
[include mainsail.cfg]
# This file contains pin mappings for the stock 2020 Creality Ender 5
# Pro with the 32-bit Creality 4.2.2 board. To use this config, during
# "make menuconfig" select the STM32F103 with a "28KiB bootloader" and
# with "Use USB for communication" disabled.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select the
# USART3 serial port, 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 timelapse.cfg]
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40.12
endstop_pin: ^PA5
position_endstop: 220
position_max: 220
homing_speed: 50
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40.16
endstop_pin: ^PA6
position_endstop: 220
position_max: 220
homing_speed: 50
#https://www.klipper3d.org/Config_Reference.html
[bltouch]
sensor_pin: ^PB1
control_pin: PB0
x_offset: -35
y_offset: -5
z_offset: 0.547
speed: 3.0
sample_retract_dist: 3.0
samples: 2
samples_tolerance: 0.100
[stepper_z]
step_pin: PB6
dir_pin: PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 4
#endstop_pin: ^PA7
endstop_pin: probe:z_virtual_endstop
position_max: 300
#position_endstop: 0.0
position_min: -1
[safe_z_home]
home_xy_position: 140, 125
speed: 50
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
rotation_distance: 32.342
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
#control = pid
#pid_kp = 26.666
#pid_ki = 1.587
#pid_kd = 111.998
min_temp: 0
max_temp: 300
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control = pid
pid_kp = 71.873
pid_ki = 1.775
pid_kd = 727.716
min_temp: 0
max_temp: 135
[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
[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
[pause_resume]
#recover_velocity: 50.
# When capture/restore is enabled, the speed at which to return to
# the captured position (in mm/s). Default is 50.0 mm/s.
[bed_screws]
screw1: 20,30
screw2: 192,30
screw3: 20,195
screw4: 192,201
[screws_tilt_adjust]
horizontal_move_z: 5
screw1: 55,208
screw1_name: back left
screw2: 220,208
screw2_name: back right
screw3: 55,35
screw3_name: front left
screw4: 220,35
screw4_name: front right
[bed_mesh]
speed:120
horizontal_move_z: 5
mesh_min: 10,10
mesh_max: 185,200
probe_count: 9,9
#fade_start: 1.0
#fade_end: 10.0
#fade_target: 0.0
#mesh_pps: 2,2
algorithm: bicubic
[menu __main __bed_leveling]
type: list
enable: {not printer.idle_timeout.state == "Printing"}
name: Level Corners
[menu __main __bed_leveling __start]
type: command
name: Start
enable: {not printer.idle_timeout.state == "Printing"}
gcode:
G28
BED_SCREWS_ADJUST
[menu __main __bed_leveling __accept]
type: command
name: Accept
enable: {not printer.idle_timeout.state == "Printing"}
gcode: accept
[menu __main __bed_leveling __adjust]
type: command
name: Adjusted
enable: {not printer.idle_timeout.state == "Printing"}
gcode: adjusted
[menu __main __bed_leveling __abort_screws]
type: command
name: Abort
enable: {not printer.idle_timeout.state == "Printing"}
gcode: abort
[menu __main __meshBed]
type: list
enable: {not printer.idle_timeout.state == "Printing"}
name: Mesh Bed Level
#[menu __main __meshBed __zposition]
#type: input
#enable: {not printer.idle_timeout.state == "Printing"}
#name: Z Pos: {'0:05.3f'}
#input: toolhead.zpos
[menu __main __meshBed __start]
type: command
name: Start
gcode:
G28
BED_MESH_CALIBRATE
TESTZ Z=-5
[menu __main __meshBed __zNudgeDown]
type: command
name: Down
gcode: TESTZ Z=-0.02
[menu __main __meshBed __zNudgeUp]
type: command
name: Up
gcode: TESTZ Z=0.02
[menu __main __meshBed __next]
type: command
name: Next
gcode:
ACCEPT
TESTZ Z=-5
[menu __main __meshBed __save]
type: command
name: Save
gcode: SAVE_CONFIG
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.120000, -0.061875, -0.041875, -0.070000, -0.045000, -0.056875, -0.053750, -0.027500, -0.018125
#*# -0.121250, -0.076250, -0.063750, -0.074375, -0.066875, -0.088125, -0.091875, -0.060625, -0.068750
#*# -0.085625, -0.036250, -0.024375, -0.063125, -0.038125, -0.061875, -0.072500, -0.051250, -0.058750
#*# -0.053750, -0.013750, -0.003125, -0.036875, -0.014375, -0.039375, -0.050000, -0.033125, -0.041250
#*# -0.044375, 0.006250, 0.012500, -0.032500, -0.008750, -0.038750, -0.050625, -0.034375, -0.033125
#*# 0.019375, 0.056250, 0.059375, 0.017500, 0.035625, 0.009375, -0.006250, 0.013125, 0.007500
#*# 0.055625, 0.088125, 0.090000, 0.051875, 0.065625, 0.043125, 0.031875, 0.050625, 0.047500
#*# 0.078125, 0.103125, 0.105000, 0.063125, 0.075625, 0.049375, 0.035625, 0.055000, 0.050625
#*# 0.115000, 0.149375, 0.156250, 0.105000, 0.120000, 0.098750, 0.089375, 0.111250, 0.109375
#*# x_count = 9
#*# y_count = 9
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 10.0
#*# max_x = 184.96
#*# min_y = 10.0
#*# max_y = 200.01
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 19.959
#*# pid_ki = 1.008
#*# pid_kd = 98.798
#*#
#*# [bltouch]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment