Skip to content

Instantly share code, notes, and snippets.

@dnnsmnstrr
Created March 29, 2025 17:56
Show Gist options
  • Save dnnsmnstrr/376469d4a6e6142c93381737c39d3971 to your computer and use it in GitHub Desktop.
Save dnnsmnstrr/376469d4a6e6142c93381737c39d3971 to your computer and use it in GitHub Desktop.
CR6-SE Klipper Config
# This file contains pin mappings for the stock 2020 Creality CR6-SE.
# To use this config, during "make menuconfig" select the STM32F103
# with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# 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: PB8
dir_pin: !PB7
enable_pin: !PC3
rotation_distance: 40
microsteps: 16
endstop_pin: PC4
position_min: -5
position_endstop: -5
position_max: 235
homing_speed: 50
[stepper_y]
step_pin: PB6
dir_pin: PB5
enable_pin: !PC3
rotation_distance: 40
microsteps: 16
endstop_pin: PC5
position_min: -2
position_endstop: -2
position_max: 235
homing_speed: 50
[stepper_z]
step_pin: PB4
dir_pin: !PB3
enable_pin: !PC3
rotation_distance: 8
microsteps: 16
endstop_pin: probe:z_virtual_endstop
position_min: -1.5
position_max: 250
homing_speed: 4
second_homing_speed: 1
homing_retract_dist: 2.0
[extruder]
max_extrude_only_distance: 1000.0
step_pin: PC2
dir_pin: !PB9
enable_pin: !PC3
rotation_distance: 30.4768
microsteps: 16
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB1
control: pid
# tuned for stock hardware with 200 degree Celsius target
pid_Kp: 14.32
pid_Ki: 0.81
pid_Kd: 63.12
min_temp: 0
max_temp: 275
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB0
control: pid
# tuned for stock hardware with 50 degree Celsius target
pid_Kp: 79.49
pid_Ki: 1.17
pid_Kd: 1349.52
min_temp: 0
max_temp: 120
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 10, 10
mesh_max: 225, 225
probe_count: 4
[fan]
pin: PA0
kick_start_time: 0.5
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command
# Before printing the PROBE_CALIBRATE command needs to be issued
# to run the probe calibration procedure, described at
# docs/Probe_Calibrate.md, to find the correct z_offset.
[probe]
pin: PA4
x_offset: 0.0
y_offset: 0.0
#z_offset: 0.0
speed: 2.0
samples: 5
[filament_switch_sensor filament_sensor]
pause_on_runout: true
switch_pin: ^!PA7
[output_pin LED_pin]
pin: PA6
[static_digital_output daughterboard_communication]
pins: !PA5
[printer]
kinematics: cartesian
max_velocity: 500
max_accel: 500
max_z_velocity: 5
max_z_accel: 100
# load default mesh before every print
[delayed_gcode bed_mesh_init]
initial_duration: .01
gcode:
BED_MESH_PROFILE LOAD=default
############################
# idle timeout
############################
# set to 10 minutes so the Heat_Soak macro doesn't timeout
[idle_timeout]
timeout: 600
[virtual_sdcard]
path: ~/printer_data/gcodes
[display_status]
[pause_resume]
############################
# MACROS
############################
# please delete the include of Mainsail macros if Mainsail is not used
[include mainsail_macros.cfg]
[include cr6_se_macros.cfg]
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-3.0 F3600 ; retract filament
TURN_OFF_HEATERS
G91 ; relative positioning
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe direction to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
G90 ; absolute positioning
G0 X60 Y{max_y} F3600 ; park nozzle at rear
M107 ; turn off fan
[include moonraker_obico_macros.cfg]
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = -0.250
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.475500, 0.074000, -0.323500, -0.756000
#*# 0.551500, 0.124000, -0.278500, -0.683000
#*# 0.694000, 0.265500, -0.147500, -0.583500
#*# 0.892000, 0.455500, 0.050000, -0.413000
#*# x_count = 4
#*# y_count = 4
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 10.0
#*# max_x = 224.97
#*# min_y = 10.0
#*# max_y = 224.97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment