Skip to content

Instantly share code, notes, and snippets.

@pandolfipedro
Last active October 18, 2022 12:22
Show Gist options
  • Save pandolfipedro/bac30fae527aa3fc8bbc7ddc135075d4 to your computer and use it in GitHub Desktop.
Save pandolfipedro/bac30fae527aa3fc8bbc7ddc135075d4 to your computer and use it in GitHub Desktop.
Klipper, Ender 3, Skr mini e3 v3 - Printer config.
[mcu]
serial: /dev/ttyS5
restart_method: command
#overlays=uart5
#Display
#[display]
#lcd_type: emulated_st7920
#spi_software_miso_pin: PD8 # status led, Virtual MISO
#spi_software_mosi_pin: PD6
#spi_software_sclk_pin: PB9
#en_pin: PB8
#encoder_pins: ^PA10, ^PA9
#click_pin: ^!PA15
#[output_pin beeper]
#pin: PB5
#FLUIDD
[input_shaper]
shaper_freq_x: 28.2
shaper_type_x: ei
shaper_freq_y: 30.9
shaper_type_y: ei
[safe_z_home]
home_xy_position: 0,0
speed: 80
z_hop: 10 # Move up 10mm
z_hop_speed: 20
[bed_screws]
screw1: 27,32
screw2: 203,32
screw3: 27,208
screw4: 203,208
#SKR
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 235
homing_speed: 60
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 999999
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC1
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
run_current: 0.580
hold_current: 0.500
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.0
# endstop_pin: probe:z_virtual_endstop
position_max: 250
position_min: -2
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 999999
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD1
microsteps: 16
rotation_distance: 31.644
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
max_extrude_only_distance: 100.0
pressure_advance: 0.08
[tmc2209 extruder]
uart_pin: PC11
tx_pin: PC10
uart_address: 3
run_current: 0.650
hold_current: 0.500
stealthchop_threshold: 999999
[heater_bed]
heater_pin: PC9
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[heater_fan controller_fan]
pin: PB15
heater: extruder
heater_temp: 50.0
[heater_fan nozzle_cooling_fan]
pin: PC7
[fan]
pin: PC6
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
# MACROS
[virtual_sdcard]
path: /home/orangepi/gcode_files
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
[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 %}
[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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment