Skip to content

Instantly share code, notes, and snippets.

@GManzato
Last active February 26, 2021 05:20
Show Gist options
  • Save GManzato/f72d73c5be6281497946a79e5cf94201 to your computer and use it in GitHub Desktop.
Save GManzato/f72d73c5be6281497946a79e5cf94201 to your computer and use it in GitHub Desktop.
Anet ET5-X with SKR 1.4 / TMC2209 / Sensorless homing for X and Z / BL Touch / Matrix Extruder
# Anet ET5-X with BIGTREETECH SKR V1.4
# TMC2209 with Sensorless homing
# BL Touch
# TriangleLab Matrix Extruder
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
[lumix]
cam_ip: 192.168.3.50
[neopixel my_neopixel]
pin: P1.24
# The pin connected to the neopixel. This parameter must be
# provided.
chain_count: 20
# The number of Neopixel chips that are "daisy chained" to the
# provided pin. The default is 1 (which indicates only a single
# Neopixel is connected to the pin).
color_order: GRB
# Set the pixel order required by the LED hardware. Options are GRB,
# RGB, GRBW, or RGBW. The default is GRB.
initial_RED: 1
initial_GREEN: 1
initial_BLUE: 0.8
# Sets the initial LED color of the Neopixel. Each value should be
# between 0.0 and 1.0. The WHITE option is only available on RGBW
# LEDs. The default for each color is 0.
[stepper_x]
step_pin: P2.2
dir_pin: P2.6
enable_pin: !P2.1
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 0
position_min: 0
position_max: 340
homing_speed: 60
homing_retract_dist: 0
[stepper_y]
step_pin: P0.19
dir_pin: P0.20
enable_pin: !P2.8
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: -30
position_min: -30
position_max: 290
homing_speed: 60
homing_retract_dist: 0
[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_min: 0
position_max: 300
[stepper_z1]
step_pin: P1.15
dir_pin: !P1.14
enable_pin: !P1.16
microsteps: 16
rotation_distance: 8
[extruder]
step_pin: P2.13
dir_pin: P0.11
enable_pin: !P2.12
microsteps: 16
rotation_distance: 9.3492
nozzle_diameter: 0.800
pressure_advance: 0.0263
filament_diameter: 1.750
heater_pin: P2.7
sensor_type: ATC Semitec 104GT-2
sensor_pin: P0.23
#control: pid
#pid_Kp: 22.2
#pid_Ki: 1.08
#pid_Kd: 114
min_temp: 0
max_temp: 260
min_extrude_temp: 170
[heater_fan my_nozzle_fan]
pin: P2.4
[heater_bed]
heater_pin: P2.5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: P0.25
#control: pid
#pid_Kp: 54.027
#pid_Ki: 0.770
#pid_Kd: 948.182
min_temp: 0
max_temp: 130
[fan]
pin: P2.3
[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_140D1717D2084D53DBEB094E030000F5-if00
[printer]
kinematics: cartesian
max_velocity: 800
max_accel: 1000
max_z_velocity: 20
max_z_accel: 100
[input_shaper]
shaper_freq_x: 23.66 # frequency for the X mark of the test model
shaper_freq_y: 45.84 # frequency for the Y mark of the test model
shaper_type: mzv
########################################
# TMC2209 configuration
########################################
[tmc2209 stepper_x]
uart_pin: P1.10
diag_pin: ^P1.29
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
driver_SGTHRS: 105
[tmc2209 stepper_y]
uart_pin: P1.9
diag_pin: ^P1.28
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
driver_SGTHRS: 80
[tmc2209 stepper_z]
uart_pin: P1.8
run_current: 0.650
hold_current: 0.450
stealthchop_threshold: 30
[tmc2209 stepper_z1]
uart_pin: P1.1
run_current: 0.650
hold_current: 0.450
stealthchop_threshold: 30
[tmc2209 extruder]
uart_pin: P1.4
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 5
###############################################
## Probing/Mesh
###############################################
[safe_z_home]
home_xy_position: 150,150 # Change coordinates to the center of your print bed
speed: 50
z_hop: 10 # Move up 10mm
z_hop_speed: 5
[bltouch]
sensor_pin: ^P0.10 # Pull-up (^ symbol) needed in open drain mode
control_pin: P2.0
x_offset: -45
y_offset: 1
#z_offset: 9
pin_move_time: 1
[z_tilt]
z_positions:
355,150
-35,150
points:
50,150
330,150
horizontal_move_z: 10
[bed_mesh]
horizontal_move_z: 10
speed: 120
mesh_min: 30,30
mesh_max: 270,280
probe_count: 6,6
[bed_screws]
screw1: 14, 50
screw1_name: front_left
screw2: 275, 50
screw2_name: front_right
screw3: 14, 260
screw3_name: back_left
screw4: 275, 260
screw4_name: back_right
horizontal_move_z: 10.
speed: 50.
[screws_tilt_adjust]
screw1: 59, 51
screw1_name: front_left
screw2: 320, 51
screw2_name: front_right
screw3: 59, 261
screw3_name: back_left
screw4: 320, 261
screw4_name: back_right
horizontal_move_z: 10.
speed: 50.
screw_thread: CW-M5
########################################
# EXP1 / EXP2 (display) pins
########################################
[display]
lcd_type: st7920
cs_pin: EXP1_4
sclk_pin: EXP1_5
sid_pin: EXP1_3
encoder_pins: ^EXP2_3, ^EXP2_5
click_pin: ^!EXP1_2
#kill_pin: ^!EXP2_8
[output_pin beeper]
pin: EXP1_1
[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"
[gcode_macro BED_SCREW_LEVEL]
gcode:
G28 Y0 X0 Z0
SCREWS_TILT_CALCULATE
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - PLEASE CUSTOMISE THE SCRIPT
gcode:
SET_LED LED=my_neopixel RED=1 GREEN=1 BLUE=1
M117 Homing... ; display message
G28 Y0 X0 Z0
#Z_TILT_ADJUST
#BED_MESH_CALIBRATE
#G28 Y0 X0 Z0
#Purge Line Gcode
G92 E0;
G90
G0 X5 Y20 F6000
G0 Z0.4
G91
G1 X120 E30 F1200;
G1 Y1
G1 X-120 E30 F1200;
G92 E0;
G90
G1 Z15.0 F600 ;move the platform down 15mm
G1 X150 Y150 F3000
G92 E0 ;zero the extruded length again
M117 Printing...
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script
gcode:
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe directions to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
# Commence PRINT_END
SET_LED LED=my_neopixel RED=0 GREEN=1 BLUE=0
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract
G91 ; relative positioning
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
M104 S0 ; turn off hotend
M140 S0 ; turn off bed
M106 S0 ; turn off fan
G90 ; absolute positioning
G0 X{max_x / 2} Y{max_y} F3600 ; park nozzle at rear
M117 Finished!
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
# Get Boundaries
{% set max_x = printer.configfile.config["stepper_x"]["position_max"]|float %}
{% set max_y = printer.configfile.config["stepper_y"]["position_max"]|float %}
{% set max_z = printer.configfile.config["stepper_z"]["position_max"]|float %}
# Check end position to determine safe directions to move
{% if printer.toolhead.position.x < (max_x - 20) %}
{% set x_safe = 20.0 %}
{% else %}
{% set x_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.y < (max_y - 20) %}
{% set y_safe = 20.0 %}
{% else %}
{% set y_safe = -20.0 %}
{% endif %}
{% if printer.toolhead.position.z < (max_z - 2) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - printer.toolhead.position.z %}
{% endif %}
SET_LED LED=my_neopixel RED=1 GREEN=0 BLUE=0
# Commence CANCEL_PRINT
G92 E0 ; zero the extruder
G1 E-4.0 F3600 ; retract
G91 ; relative positioning
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
M104 S0 ; turn off hotend
M106 S0 ; turn off fan
G90 ; absolute positioning
G0 X{max_x / 2} Y{max_y} F3600 ; park nozzle at rear
M117 Finished!
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_Z: 10 #edit to your park position
default_parameter_E: 1 #edit to your retract length
gcode:
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{Z}
G90
G1 X140 Y0 F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1 #edit to your retract length
gcode:
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 28.746
#*# pid_ki = 1.278
#*# pid_kd = 161.694
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 66.320
#*# pid_ki = 0.811
#*# pid_kd = 1355.425
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.067500, 0.037500, -0.055000, -0.030000, 0.077500, -0.012500
#*# -0.030000, 0.055000, -0.035000, -0.012500, 0.085000, -0.020000
#*# 0.002500, 0.082500, -0.025000, -0.007500, 0.085000, -0.010000
#*# 0.055000, 0.117500, 0.002500, -0.002500, 0.067500, -0.057500
#*# 0.067500, 0.137500, 0.015000, 0.007500, 0.062500, -0.067500
#*# 0.055000, 0.142500, 0.037500, 0.042500, 0.097500, -0.037500
#*# tension = 0.2
#*# min_x = 30.0
#*# algo = lagrange
#*# y_count = 6
#*# mesh_y_pps = 2
#*# min_y = 30.0
#*# x_count = 6
#*# max_y = 280.0
#*# mesh_x_pps = 2
#*# max_x = 270.0
#*#
#*# [bltouch]
#*# z_offset = 2.525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment