# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v1.2. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader" and USB communication. Also,
# select "Enable extra low-level configuration options" and configure
# "GPIO pins to set at micro-controller startup" to "!PC13".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
# See docs/Config_Reference.md for a description of parameters.
# Note: This board has a design flaw in its thermistor circuits that
# cause inaccurate temperatures (most noticeable at low temperatures).
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 39.96
endstop_pin: ^PC0
position_endstop: -20
position_min: -20
position_max: 215
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PB15
run_current: 0.5
stealthchop_threshold: 999999
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 16
rotation_distance: 39.94
endstop_pin: ^PC1
position_endstop: -35
position_min: -35
position_max: 200
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC6
run_current: 0.5
stealthchop_threshold: 999999
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
microsteps: 16
rotation_distance: 8
endstop_pin: ^PC2
position_endstop: 0.7
position_max: 240
[tmc2209 stepper_z]
uart_pin: PC10
run_current: 0.5
stealthchop_threshold: 999999
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD2
gear_ratio: 50:10 #BMG Gear Ratio CW2
microsteps: 32
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
rotation_distance: 22.6789511
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
#control: pid
#pid_Kp=22.843
#pid_Ki=1.096
#pid_Kd=119.069
##pid_Kp: 21.527
##pid_Ki: 1.063
##pid_Kd: 108.982
min_temp:10
max_temp: 350
max_power: 1.0
min_extrude_temp: 10
max_extrude_only_distance: 100
## Try to keep pressure_advance below 1.0
pressure_advance: 0.045
## Default is 0.040, leave stock
pressure_advance_smooth_time: 0.040
[tmc2209 extruder]
uart_pin: PC11
run_current: 0.3
stealthchop_threshold: 999999
[heater_bed]
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC3
control: pid
pid_Kp=70.159
pid_Ki=1.017
pid_Kd=1210.239
##pid_Kp: 54.027
##pid_Ki: 0.770
##pid_Kd: 948.182
min_temp: 0
max_temp: 130
[fan]
pin: PA8
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_34FFD7055055323909761643-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[bltouch]
sensor_pin: ^PC14
control_pin: PA1
X_OFFSET: -10
Y_OFFSET: 22.2
#z_offset: 3.099
pin_move_time: 1
samples: 3
[safe_z_home]
home_xy_position: 50, 50
speed: 50
z_hop: 15 # Move up 15mm
z_hop_speed: 5
[skew_correction]
[static_digital_output usb_pullup_enable]
pins: !PC13
[display]
lcd_type: st7920
cs_pin: EXP1_7
sclk_pin: EXP1_6
sid_pin: EXP1_8
encoder_pins: ^EXP1_5, ^EXP1_3
click_pin: ^!EXP1_2
[output_pin beeper]
pin: EXP1_1
[virtual_sdcard]
path: ~/gcode_files
[pause_resume]
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PB6, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB7, EXP1_10=<5V>
[bed_screws]
screw1: 35, 35
screw2: 35, 205
screw3: 205, 35
screw4: 205, 205
[bed_mesh]
speed: 50
horizontal_move_z: 10
mesh_min: 0, 25
mesh_max: 205, 205
probe_count: 7, 7
mesh_pps: 2, 2
algorithm: bicubic
bicubic_tension: 0.2
[firmware_retraction]
retract_length: 0.8
retract_speed: 40
unretract_extra_length: 0
unretract_speed: 40
## Macros
##Pause Macro
##
##
[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 %}
##Resume Macro
##
##
[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}
##Cancel Print
##
##
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
##Start Print
##
##
#[gcode_macro START_PRINT]
#gcode:
#{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
#{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
## Start bed heating
#M140 S{BED_TEMP}
## Use absolute coordinates
#G90
## Reset the G-Code Z offset (adjust Z offset if needed)
#SET_GCODE_OFFSET Z=0.0
## Home the printer
#G28
## Move the nozzle away from the bed
#G1 Z20 F3000
# # Wait for bed to reach temperature
#M190 S{BED_TEMP}
## Set and wait for nozzle to reach temperature
#M109 S{EXTRUDER_TEMP}
## Home for Mesh Level
#G28
# Start Bed Mesh Level
#BED_MESH_CALIBRATE
# Home for Prime Lines
#G28
# Prime Lines
#PRIME_NOZZLE
[gcode_macro START_PRINT]
# Use START_PRINT for the slicer starting script - please customise for your slicer of choice
gcode:
G28 ; home all axes
G90 ; absolute positioning
G1 Z20 F3000 ; move nozzle away from bed
SKEW_PROFILE LOAD=my_skew_profile
##End Print
##
##
[gcode_macro END_PRINT]
gcode:
# safe anti-stringing move coords
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G92 E0 ; zero the extruder
G1 E-5 F1800
G90 ; absolute positioning
G0 X{x_safe} Y{y_safe} Z{z_safe} F2000 ; move nozzle to remove stringing
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F1600 ; park nozzle at rear
# Disable steppers
M84
SET_SKEW CLEAR=1
#RESTORE_GCODE_STATE NAME=STATE_PRINT_END
## M204 Error beheben Macro
##
##
[gcode_macro M204]
rename_existing: M204.1
gcode:
{% set f = params.F|default(0.5)|float %}
{% if 'S' in params %}
{% set s = params.S|float %}
SET_VELOCITY_LIMIT ACCEL={s} ACCEL_TO_DECEL={ s * f }
{% else %}
{% if 'P' in params %}
{% set p = params.P|float %}
{% if 'T' in params %}
{% set t = params.T|float %}
{% if p < t %}
SET_VELOCITY_LIMIT ACCEL={p} ACCEL_TO_DECEL={ p * f }
{% else %}
SET_VELOCITY_LIMIT ACCEL={t} ACCEL_TO_DECEL={ t * f }
{% endif %}
{% else %}
SET_VELOCITY_LIMIT ACCEL={p} ACCEL_TO_DECEL={ p * f }
{% endif %}
{% elif 'T' in params %}
{% set t = params.T|float %}
SET_VELOCITY_LIMIT ACCEL={t} ACCEL_TO_DECEL={ t * f }
{% endif %}
{% endif %}
[gcode_macro PRIME_NOZZLE]
gcode:
SAVE_GCODE_STATE NAME=PRIME_NOZZLE_STATE
G90 ; Absolute coordinates.
M83 ; Relative extruder mode.
G92 E0
; Move to start of line.
G1 Z10 F900
G1 Y3 X3 F18000
G1 Z0.2 F900
; Print the line.
G91 ; Relative coordinates.
G1 Y100 E20 F1000 ; Extrude filament 20mm (how much it retracted in PRINT_END).
G1 X-2 F1000
G1 Y-60 E9 F1000 ; Print second part of the line.
G1 E-0.5 F3000 ; Retract to avoid stringing.
G1 Y0.5 E0 F1000 ; Wipe back to break string.
G1 Y-5.5 E0 F1000 ; Wipe forward to break string.
RESTORE_GCODE_STATE NAME=PRIME_NOZZLE_STATE
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.176500, 0.372333, 0.570667, 0.746500, 0.932333
#*# 0.266500, 0.483167, 0.700667, 0.919833, 1.121500
#*# 0.405667, 0.644000, 0.878167, 1.097333, 1.319000
#*# 0.561500, 0.798167, 1.038167, 1.278167, 1.501500
#*# 0.648167, 0.925667, 1.204833, 1.459000, 1.712333
#*# tension = 0.2
#*# min_x = 25.0
#*# algo = bicubic
#*# y_count = 5
#*# mesh_y_pps = 2
#*# min_y = 25.0
#*# x_count = 5
#*# max_y = 205.0
#*# mesh_x_pps = 2
#*# max_x = 185.0
#*#
#*# [bltouch]
#*# z_offset = 3.340
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 26.283
#*# pid_ki = 1.391
#*# pid_kd = 124.188
#*#
#*# [skew_correction my_skew_profile]
#*# xy_skew = -0.00100110146555
#*# xz_skew = 0.0
#*# yz_skew = 0.0