Skip to content

Instantly share code, notes, and snippets.

@flyernb
Forked from gretel/printer.cfg
Created March 3, 2023 10:00
Show Gist options
  • Select an option

  • Save flyernb/f1133d4c75a4ad86516cc909637a7d52 to your computer and use it in GitHub Desktop.

Select an option

Save flyernb/f1133d4c75a4ad86516cc909637a7d52 to your computer and use it in GitHub Desktop.
get klippered on multec m420+, skr v1.3, bigtreetech tmc2209
[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: 0
position_max: 320
homing_speed: 50
[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: 0
position_max: 300
homing_speed: 50
[probe]
pin: P1.25
z_offset: 2.345
[stepper_z]
step_pin: P0.22
dir_pin: P2.11
enable_pin: !P0.21
microsteps: 16
gear_ratio: 5.18:1
rotation_distance: 8
#endstop_pin: P1.25 # P1.24 for Z-max
endstop_pin: probe:z_virtual_endstop
#position_endstop: 0.5
position_max: 400
homing_speed: 8
second_homing_speed: 1
# distance to backoff (in mm) before homing a second time during
homing_retract_dist: 2
# The safe_z_home section modifies the default G28 behavior
[safe_z_home]
home_xy_position: 100,100
speed: 50
z_hop: 15
z_hop_speed: 5
[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: 235
#[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.3
kick_start_time: 0.5
[mcu]
serial: /dev/serial/by-id/usb-Klipper_lpc1768_20500008610039AF06EAF45BC22000F5-if00
[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 2000
max_z_velocity: 25
max_z_accel: 100
########################################
# 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]
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]
pin: EXP1_1
[idle_timeout]
timeout: 360
[pause_resume]
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[endstop_phase stepper_z]
trigger_phase: 25/64
[tmc2209 stepper_x]
uart_pin: P1.17
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
[tmc2209 stepper_y]
uart_pin: P1.15
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 250
[tmc2209 stepper_z]
uart_pin: P1.10
run_current: 0.650
hold_current: 0.450
stealthchop_threshold: 30
[tmc2209 extruder]
uart_pin: P1.8
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 5
# [tmc2209 extruder1]
# uart_pin: P1.1
# run_current: 0.800
# hold_current: 0.500
# stealthchop_threshold: 5
[bed_mesh]
speed: 80
# The speed (in mm/s) of non-probing moves during the calibration.
# The default is 50.
horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
mesh_min: 20,40
# Defines the minimum x,y coordinate of the mesh for rectangular
# beds. This coordinate is relative to the probe's location. This
# will be the first point probed, nearest to the origin. This
# parameter must be provided for rectangular beds.
mesh_max: 200,400
# Defines the maximum x,y coordinate of the mesh for rectangular
# beds. Adheres to the same principle as mesh_min, however this will
# be the furthest point probed from the bed's origin. This parameter
# must be provided for rectangular beds.
probe_count: 3,5
# For rectangular beds, this is a comma separate pair of integer
# values (X,Y) defining the number of points to probe along each
# axis. A single value is also valid, in which case that value will
# be applied to both axes. Default is 3,3.
[gcode_macro G29]
gcode:
BED_MESH_CALIBRATE
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_X: 230 #edit to your park position
default_parameter_Y: 230 #edit to your park position
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 X{X} Y{Y} 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
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro START_PRINT]
default_parameter_BED_TEMP: 60
default_parameter_EXTRUDER_TEMP: 210
default_parameter_GCODE_OFFSET_Z: 0.0
gcode:
# 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={GCODE_OFFSET_Z}
# Home the printer
G28
# Move the nozzle near the bed
G1 Z5 F3000
# Move the nozzle very close to the bed
G1 Z0.15 F300
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Move nozzle away from print while retracting
G91
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z10 F3000
G90
# Disable steppers
M84
# Empty command to stop errors from Cura gcode.
[gcode_macro M205]
gcode:
[gcode_macro M300]
default_parameter_S: 1000
# Use a default 1kHz tone if S is omitted.
default_parameter_P: 100
# Use a 10ms duration is P is omitted.
gcode:
SET_PIN PIN=BEEPER_pin VALUE={S}
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment