Skip to content

Instantly share code, notes, and snippets.

@frap129
Last active February 10, 2024 03:59
Show Gist options
  • Save frap129/2619e4bcd2abf509e85c5e54c0f63f86 to your computer and use it in GitHub Desktop.
Save frap129/2619e4bcd2abf509e85c5e54c0f63f86 to your computer and use it in GitHub Desktop.
Klipper config for Ender 2 with SKR Mini E3 v1.2, BLTouch, and Stock display/heaters
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
step_distance: .0125
endstop_pin: ^PC0
position_endstop: 0
position_max: 160
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PB15
microsteps: 16
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 250
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
step_distance: .0125
endstop_pin: ^PC1
position_endstop: 0
position_max: 160
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC6
microsteps: 16
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 250
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
step_distance: .0025
#endstop_pin: ^PC2
endstop_pin: probe:z_virtual_endstop # For bltouch
position_min: -5
position_max: 205
[tmc2209 stepper_z]
uart_pin: PC10
microsteps: 16
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 5
[safe_z_home]
home_xy_position: 135,95 # changes based on probe offsets
speed: 50
z_hop: 10
z_hop_speed: 5
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD2
step_distance: 0.0026218
pressure_advance: 0.0785
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
control = pid
pid_kp = 8.125
pid_ki = 0.401
pid_kd = 41.135
min_temp: 0
max_temp: 250
max_power: 0.5 # For stock 12v heater
[tmc2209 extruder]
uart_pin: PC11
microsteps: 16
run_current: 0.850 # For pancake motor, original 0.650
hold_current: 0.500
stealthchop_threshold: 5
[heater_bed]
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC3
control = pid
pid_kp = 29.943
pid_ki = 0.895
pid_kd = 250.402
min_temp: 0
max_temp: 130
max_power: 0.5 # for stock 12v heater
[fan]
pin: PA8
kick_start_time: 0.750
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_38FFD9055243363817740643-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[bltouch]
sensor_pin: ^PC2
control_pin: PA1
pin_up_touch_mode_reports_triggered: False
x_offset: -52
y_offset: -18
z_offset: 4.076
pin_move_time: 0.4
samples: 3
[bed_mesh]
speed: 80
horizontal_move_z: 10
mesh_min: 13, 13
mesh_max: 108, 134
probe_count: 3,3
fade_start: 1.0
mesh_pps: 2,2
[display]
lcd_type: uc1701
cs_pin: EXP1_7
a0_pin: EXP1_6
contrast: 40
encoder_pins: ^EXP1_3, ^EXP1_5
click_pin: ^!EXP1_2
spi_software_mosi_pin: EXP1_8
spi_software_miso_pin: PC12
spi_software_sclk_pin: EXP1_1
[firmware_retraction]
retract_speed: 40
retract_length: 1.5
[static_digital_output usb_pullup_enable]
pins: !PC13
[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>
[gcode_macro START_PRINT]
default_parameter_T_BED: 60
default_parameter_T_EXTRUDER: 205
gcode:
M117 Set temperatures
M140 S{T_BED}
M104 S{T_EXTRUDER}
M117 Homing
G90 ; use absolute coordinates
G28 ; home printer
LOAD_MESH_TEMP BED_TEMPERATURE={T_BED} ; use temperature mesh
G1 X15 Y20 Z5 F6000 ; get nozzle close to bed
M117 Waiting for temperatures
M109 S{T_EXTRUDER}
M190 S{T_BED}
PRIME_LINE
M117 Printing...
[gcode_macro PRIME_LINE]
gcode:
M117 Prime Line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up
G1 X0 Y10 Z0.28 F5000.0 ; Move to start position
G1 X0 Y140.0 Z0.28 F1500.0 E15 ; Draw the first line
G1 X2 Y10.0 Z0.28 F5000.0 ; Move to side a little
G1 X2 Y140 Z0.28 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up
[gcode_macro END_PRINT]
gcode:
G90 ; use absolute coordinates
M104 S0 ; turn off temperature
M140 S0 ; turn off temperature
G28 X0 ; home X axis
G1 Y150 F1500 ; move bed forward
M84 ; disable motors
M117 Done!
[gcode_macro LOAD_MESH_TEMP]
default_parameter_BED_TEMPERATURE: 0
default_parameter_FORCE: 0
gcode:
{action_respond_info("- AUTOMATED BED MESH GENERATOR -")}
{% if BED_TEMPERATURE|int < 30 %}
{action_respond_info("Your bed temp is to low, make sure it is at least 30 or higher")}
{% else %}
{% if printer.configfile.config["bed_mesh " + BED_TEMPERATURE] is defined and FORCE|int == 0 %}
BED_MESH_PROFILE LOAD={BED_TEMPERATURE}
{action_respond_info("Succesfully loaded bed_mesh "+ BED_TEMPERATURE)}
{% else %}
{% if printer.configfile.config["bed_mesh " + BED_TEMPERATURE] is defined and FORCE|int == 1 %}
BED_MESH_PROFILE REMOVE={BED_TEMPERATURE}
{% endif %}
{action_respond_info("bed_mesh not defined, your bed temperature will go up!")}
{action_respond_info("We will probe the bed and save the mesh as bed_mesh "+ BED_TEMPERATURE)}
ADD_BED_MESH TARGET_TEMP={BED_TEMPERATURE}
{% endif %}
{% endif %}
[gcode_macro ADD_BED_MESH]
default_parameter_TARGET_TEMP: 30
gcode:
M190 S{TARGET_TEMP} # Wait for the bed to hit TARGET_TEMP
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE={TARGET_TEMP}
[gcode_macro SET_RETRACTIONLENGTH]
gcode:
SET_RETRACTION RETRACT_LENGTH={params.LENGTH|float}
GET_RETRACTION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment