Klipper Firmware

Firmware for SKR 1.3 on Klipper

# This file contains common pin mappings for the BIGTREETECH SKR V1.3
# board. To use this config, the firmware should be compiled for the
# LPC1768.

# See docs/Config_Reference.md for a description of parameters.

[stepper_x]
step_pin: P2.2
dir_pin: !P2.6
enable_pin: !P2.1
microsteps: 16
rotation_distance: 40
endstop_pin: P1.29  # P1.28 for X-max
position_endstop: 220
position_max: 220
homing_speed: 50 #50
homing_positive_dir: true

[stepper_y]
step_pin: P0.19
dir_pin: !P0.20
enable_pin: !P2.8
microsteps: 16
rotation_distance: 40
endstop_pin: P1.27  # P1.26 for Y-max
position_endstop: 220
position_max: 220
homing_speed: 50 #50
homing_positive_dir: true

[stepper_z]
step_pin: P0.22
dir_pin: !P2.11
enable_pin: !P0.21
microsteps: 16
rotation_distance: 8
endstop_pin: P1.25  # P1.24 for Z-max
position_endstop: 0.5
position_max: 400

[extruder]
step_pin: P2.13
dir_pin: !P0.11
enable_pin: !P2.12
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.24
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 260

#[extruder1]
#step_pin: P0.1
#dir_pin: P0.0
#enable_pin: !P0.10
#heater_pin: P2.4
#sensor_pin: P0.25
#...

[heater_bed]
heater_pin: P2.5
sensor_type: ATC Semitec 104GT-2
sensor_pin: P0.23
control: watermark
min_temp: 0
max_temp: 100

# [fan]
# pin: P2.4

[heater_fan my_nozzle_fan]
pin: P2.4
max_power: 1.0
kick_start_time: 0.100
heater: extruder
heater_temp: 50.0
fan_speed: 1.0


[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_0B10000129811DAFE891F359C72000F5-if00

[printer]
kinematics: corexy
max_velocity: 180
max_accel: 1000
max_z_velocity: 15
max_z_accel: 200
square_corner_velocity: 5.0

# max_velocity: 200
# max_accel: 2000
# max_z_velocity: 25
# max_z_accel: 100


########################################
# TMC2208 configuration
########################################

# For TMC2208 UART
#   1) Remove all of the jumpers below the stepper drivers
#   2) Place jumpers on the red pin headers labeled XUART (XUART, YUART etc.)

[tmc2208 stepper_x]
uart_pin: P1.17
run_current: 0.800
stealthchop_threshold: 999999

[tmc2208 stepper_y]
uart_pin: P1.15
run_current: 0.800
stealthchop_threshold: 999999

[tmc2208 stepper_z]
uart_pin: P1.10
run_current: 0.650
stealthchop_threshold: 999999

[tmc2208 extruder]
uart_pin: P1.8
run_current: 0.800
stealthchop_threshold: 999999

# [tmc2208 extruder1]
# uart_pin: P1.1
# run_current: 0.800
# stealthchop_threshold: 999999


########################################
# TMC2130 configuration
########################################

# For TMC SPI
#   1) Place jumpers on all the red pin headers under the stepper drivers
#   2) Remove jumpers from the red pin headers labeled XUART (XUART, YUART etc.)

#[tmc2130 stepper_x]
#cs_pin: P1.17
#spi_software_miso_pin: P0.5
#spi_software_mosi_pin: P4.28
#spi_software_sclk_pin: P0.4
##diag1_pin: P1.29
#run_current: 0.800
#stealthchop_threshold: 999999

#[tmc2130 stepper_y]
#cs_pin: P1.15
#spi_software_miso_pin: P0.5
#spi_software_mosi_pin: P4.28
#spi_software_sclk_pin: P0.4
##diag1_pin: P1.27
#run_current: 0.800
#stealthchop_threshold: 999999

#[tmc2130 stepper_z]
#cs_pin: P1.10
#spi_software_miso_pin: P0.5
#spi_software_mosi_pin: P4.28
#spi_software_sclk_pin: P0.4
##diag1_pin: P1.25
#run_current: 0.650
#stealthchop_threshold: 999999

#[tmc2130 extruder]
#cs_pin: P1.8
#spi_software_miso_pin: P0.5
#spi_software_mosi_pin: P4.28
#spi_software_sclk_pin: P0.4
##diag1_pin: P1.28
#run_current: 0.800
#stealthchop_threshold: 999999

#[tmc2130 extruder1]
#cs_pin: P1.1
#spi_software_miso_pin: P0.5
#spi_software_mosi_pin: P4.28
#spi_software_sclk_pin: P0.4
##diag1_pin: P1.26
#run_current: 0.800
#stealthchop_threshold: 999999


########################################
# EXP1 / EXP2 (display) pins
########################################

[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"

[display]
#    mini12864 LCD Display
lcd_type: uc1701
cs_pin: P1.18
a0_pin: P1.19
rst_pin: P1.20
encoder_pins: ^P3.26,^P3.25
click_pin: ^!P0.28
contrast: 63
spi_software_sclk_pin: P0.15
spi_software_mosi_pin: P0.18
spi_software_miso_pin: P0.17

# [display]
# lcd_type: uc1701
# cs_pin: EXP1_3
# a0_pin: EXP1_5
# rst_pin: EXP1_4
# contrast: 63
# encoder_pins: ^EXP2_5, ^EXP2_3
# click_pin: ^!EXP1_2
# ## Some micro-controller boards may require an spi bus to be specified:
# #spi_bus: spi1
# ## Alternatively, some micro-controller boards may work with software spi:
# spi_software_miso_pin: EXP2_1
# spi_software_mosi_pin: EXP2_6
# spi_software_sclk_pin: EXP2_2
 
[output_pin beeper]
pin: EXP1_1
 
[neopixel btt_mini12864]
pin: EXP1_6
chain_count: 3
color_order: RGB
initial_RED: 0.1
initial_GREEN: 0.1
initial_BLUE: 0.1

##  Set RGB values on boot up for each Neopixel. 
##  Index 1 = display, Index 2 and 3 = Knob
[delayed_gcode setdisplayneopixel]
initial_duration: 1
gcode:
        SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
        # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
        # SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3 

[gcode_macro manual_level]
gcode: 
  G28
  G90
  G1 F5000
  G0 Z0 X200 Y200 
  G4 P10000
  G0 Z0 X200 Y20
  G4 P10000
  G0 Z0 X20 Y20
  G4 P10000
  G0 Z0 X20 Y200 
  G4 P10000
  G0 Z0 X200 Y200 

# See the sample-lcd.cfg file for definitions of common LCD displays.

[include mainsail.cfg]