Skip to content

Instantly share code, notes, and snippets.

@jedld
Created June 5, 2023 02:59
Show Gist options
  • Save jedld/74145b518297eec2555867978fa97d21 to your computer and use it in GitHub Desktop.
Save jedld/74145b518297eec2555867978fa97d21 to your computer and use it in GitHub Desktop.
Klipper printer.cfg for my Ender 3 Pro running on an SKR 1.3 with BLtouch, Sensorless homing, E3D revo Hemera, TMC 2209 drivers, X,Y,Z and LV8729 for the Extruder
[include mainsail.cfg]
# This file contains common pin mappings for the BIGTREETECH SKR v1.3 board.
# To use this config, during "make menuconfig" select the
# "LPC176x (Smoothieboard, SBase, SKR, etc.)" micro-controller option.
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3900
max_z_velocity: 20
max_z_accel: 100
[stepper_x]
step_pin: P2.2
dir_pin: !P2.6
rotation_distance: 40
homing_retract_dist: 6
microsteps: 32
enable_pin: !P2.1
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_min: -2
position_endstop: -2
position_max: 220
homing_speed: 40
[tmc2209 stepper_x]
uart_pin: P1.17
diag_pin: ^P1.29
run_current: 0.8
hold_current: 0.7
driver_SGTHRS: 60
[stepper_y]
step_pin: P0.19
dir_pin: !P0.20
rotation_distance: 40
homing_retract_dist: 5
microsteps: 32
enable_pin: !P2.8
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_min: -27
position_endstop: -27
position_max: 215
homing_speed: 40
[tmc2209 stepper_y]
uart_pin: P1.15
diag_pin: ^P1.27
run_current: 0.8
hold_current: 0.7
driver_SGTHRS: 60
[stepper_z]
step_pin: P0.22
dir_pin: P2.11
enable_pin: !P0.21
microsteps: 16
rotation_distance: 8
endstop_pin: probe:z_virtual_endstop
position_max: 250
homing_speed: 4
position_min: -3
[tmc2209 stepper_z]
uart_pin: P1.10
run_current: 0.600
hold_current: 0.450
[stepper_z1]
step_pin: P0.1
dir_pin: P0.0
microsteps: 16
enable_pin: !P0.10
rotation_distance: 8
[tmc2209 stepper_z1]
uart_pin: P1.1
run_current: 0.600
hold_current: 0.450
[homing_override]
set_position_z: 20
axes: z
gcode:
G90
G1 Z20 F600
G28 X0 Y0 F3000
G1 X46 Y119 F3000
G28 Z0
G1 Z20 F500
[bed_mesh]
speed: 100
horizontal_move_z: 10
mesh_min: 40,30
mesh_max: 210,210
probe_count: 3,3
split_delta_z: 0.025
move_check_distance: 10.0
mesh_pps: 2,2
algorithm: lagrange
[bltouch]
sensor_pin: P1.25
control_pin: P2.0
#z_offset: 0 # adjust to your measured offset
speed: 5.0
x_offset: 64.75 # adjust to your BLTouch mount offset
y_offset: -2 # adjust to your BLTouch mount offset
#z_offset: 0
# pin_up_reports_not_triggered: True
# pin_up_touch_mode_reports_triggered: False
[bed_mesh]
speed: 100
horizontal_move_z: 10
mesh_min: 65,10 # adjust so BLTouch avoids screws
mesh_max: 210,210 # adjust to size of print bed minus any areas you want to avoid
probe_count: 3,3 # can be increased for better bed leveling accuracy
[virtual_sdcard]
path: /home/pi/printer_data/gcodes
[extruder]
max_extrude_only_distance: 100.0
step_pin: P2.13
dir_pin: P0.11
enable_pin: !P2.12
microsteps: 64
rotation_distance: 7.823960880195599
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: ATC Semitec 104GT-2
sensor_pin: P0.24
# pressure_advance: 0.05
pressure_advance: 0.075 # for 0.25mm nozzle
#control: pid
# tuned for stock hardware with 200 degree Celsius target
#pid_Kp: 22.2
#pid_Ki: 1.08
#pid_Kd: 114
min_temp: 0
max_temp: 325
[fan]
pin: P2.3
[heater_fan hotend_fan]
pin: P2.4
heater: extruder
heater_temp: 50.0
fan_speed: 1.0
[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_07FF13130A104D53C56A144E060000F5-if00
[board_pins]
aliases:
# EXP1 header
EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
# EXP2 header
EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
# Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "ssp0"
# See the sample-lcd.cfg file for definitions of common LCD displays.
[display]
lcd_type: emulated_st7920
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2
[output_pin beeper]
pin: EXP1_1
[force_move]
enable_force_move: True
[z_tilt]
horizontal_move_z: 10
z_positions:
0,119
220,119
points:
0,119
150,119
retries: 5
retry_tolerance: 0.1
[heater_bed]
heater_pin: P2.5
sensor_type: ATC Semitec 104GT-2
sensor_pin: P0.23
#control: pid
#pid_Kp: 54.027
#pid_Ki: 0.770
#pid_Kd: 948.182
min_temp: 0
max_temp: 80
[input_shaper]
#shaper_freq_x: 38.6
#shaper_type_x: zv
#shaper_freq_y: 32.0
#shaper_type_y: mzv
[gcode_macro UNSAFE_LOWER_BED]
description: Lower the bed 25mm without homing
gcode:
G90
SET_KINEMATIC_POSITION Z=0
G0 Z25 F600
M84
[delayed_gcode Z_PROBE_OFFSET]
initial_duration: 1
gcode:
ACCELEROMETER_QUERY CHIP=hotend
ACCELEROMETER_QUERY CHIP=bed
[gcode_macro HOME_XY_DISABLE_STEPPERS]
gcode:
G28 X Y # Home X and Y
M84 # Disable all steppers
[gcode_macro G29]
gcode:
{% set t = params.T|default(0)|float %}
{% if printer.idle_timeout.state == "Printing" %}
{action_respond_info("This command cannot be used while printing")}
{% elif printer.toolhead.homed_axes != "xyz" %}
{action_respond_info("Please home XYZ first")}
{% else %}
SAVE_GCODE_STATE NAME=G29_state
G90
G1 Z10 F240
{% if t > 30.0 %}
M190 S{t}
{% endif %}
BED_MESH_CALIBRATE
{% if 'S' in params %}
M140 S{params.S}
{% endif %}
G90
G1 Z10 F240
G1 X150 Y155 F6000
RESTORE_GCODE_STATE NAME=G29_state MOVE=0
{% endif %}
# hotend
[mcu adxl]
serial: /dev/serial/by-id/usb-Klipper_rp2040_E66164084333922A-if00
# bed
[mcu adxl2]
serial: /dev/serial/by-id/usb-Klipper_rp2040_E660C0D1C73B2236-if00
[adxl345 hotend]
cs_pin: adxl:gpio1
spi_bus: spi0a
axes_map: x,z,y
[adxl345 bed]
cs_pin: adxl2:gpio1
spi_bus: spi0a
axes_map: x,z,y
[resonance_tester]
accel_chip_x: adxl345 hotend
accel_chip_y: adxl345 bed
probe_points:
# Somewhere slightly above the middle of your print bed
110,110,20
[output_pin power_mode] # Improve power stability
pin: adxl:gpio23
[gcode_macro LOAD_FILAMENT]
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
SAVE_GCODE_STATE NAME=load_state
M300 # beep
G91
G92 E0
G1 E100 F{max_velocity} # fast-load
G1 E25 F{speed} # purge
M300
M300
RESTORE_GCODE_STATE NAME=load_state
[gcode_macro UNLOAD_FILAMENT]
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
SAVE_GCODE_STATE NAME=unload_state
G91
M300 # beep
G92 E0
G1 E25 F{speed} # purge
G1 E-100 F{max_velocity} # fast-unload
M300
M300
RESTORE_GCODE_STATE NAME=unload_state
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.545000, -0.490000, -0.540000
#*# -0.460000, -0.450000, -0.455000
#*# -0.430000, -0.412500, -0.365000
#*# x_count = 3
#*# y_count = 3
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 65.0
#*# max_x = 210.0
#*# min_y = 10.0
#*# max_y = 210.0
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 26.843
#*# pid_ki = 2.485
#*# pid_kd = 72.477
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 72.134
#*# pid_ki = 1.340
#*# pid_kd = 971.105
#*#
#*# [input_shaper]
#*# shaper_type_x = mzv
#*# shaper_freq_x = 36.8
#*# shaper_type_y = mzv
#*# shaper_freq_y = 32.2
#*#
#*# [bltouch]
#*# z_offset = 0.200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment