Skip to content

Instantly share code, notes, and snippets.

@besser
Last active July 30, 2024 13:36
Show Gist options
  • Save besser/30140a30312d5c7adceabf8a493472c3 to your computer and use it in GitHub Desktop.
Save besser/30140a30312d5c7adceabf8a493472c3 to your computer and use it in GitHub Desktop.
Klipper configuration file and Cura Start/End gcode
SET_GCODE_VARIABLE MACRO=END_PRINT VARIABLE=machine_depth VALUE={machine_depth}
END_PRINT
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=bed_temp VALUE={material_bed_temperature_layer_0}
SET_GCODE_VARIABLE MACRO=START_PRINT VARIABLE=extruder_temp VALUE={material_print_temperature_layer_0}
START_PRINT
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader". 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 the example.cfg file for a description of available parameters.
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
step_distance: .0125
endstop_pin: ^PC0
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
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: 235
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
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
position_endstop: 0.0
position_max: 250
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
microsteps: 16
run_current: 0.580
hold_current: 0.500
stealthchop_threshold: 5
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD2
#step_distance: 0.010526
step_distance: 0.002439
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: 275
[tmc2209 extruder]
uart_pin: PC11
tx_pin: PC10
uart_address: 3
microsteps: 16
run_current: 0.650
hold_current: 0.500
stealthchop_threshold: 5
[heater_bed]
heater_pin: PC9
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC3
#control: pid
#pid_Kp: 54.027
#pid_Ki: 0.770
#pid_Kd: 948.182
min_temp: 0
max_temp: 125
[fan]
pin: PA8
[mcu]
serial: /dev/ttyAMA0
baud: 250000
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[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>
# See the sample-lcd.cfg file for definitions of common LCD displays.
######################################################################
# 128x64 Full Graphic Creality CR10 / ENDER 3 stockdisplay
######################################################################
[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
######################################################################
# MACROS
######################################################################
# ----------------------------- Beeper -------------------------------
# M300 : Play tone. Beeper support, as commonly found on usual LCD
# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount
# 12864 Full Graphic). This defines a custom I/O pin and a custom
# GCODE macro. Usage:
# M300 [P<ms>] [S<Hz>]
# P is the tone duration, S the tone frequency.
# The frequency won't be pitch perfect.
[gcode_macro M300]
# Use a default 1kHz tone if S is omitted.
default_parameter_S: 1
# Use a 10ms duration is P is omitted.
default_parameter_P: 100
gcode:
SET_PIN PIN=beeper VALUE={S}
G4 P{P}
SET_PIN PIN=beeper VALUE=0
# --------------------------------------------------------------------
# ------------------------- Filament Change --------------------------
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.
[pause_resume]
[gcode_macro M600]
default_parameter_X: 50
default_parameter_Y: 0
default_parameter_Z: 10
gcode:
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
# --------------------------------------------------------------------
# --------------------------- Start Print ----------------------------
[gcode_macro START_PRINT]
variable_bed_temp: 60
variable_extruder_temp: 185
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=0.0
# 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}
# Reset Extruder
G92 E0
# Move Z Axis up
G1 Z2.0 F3000
# Move to start position
G1 X2.1 Y20 Z0.28 F5000.0
# Draw the first line
G1 X2.1 Y200.0 Z0.28 F1500.0 E15
# Move to side a little
G1 X2.4 Y200.0 Z0.28 F5000.0
# Draw the second line
G1 X2.4 Y20 Z0.28 F1500.0 E30
# Reset Extruder
G92 E0
# Move Z Axis up
G1 Z2.0 F3000
# Print message on LCD
M117 By your command!
# --------------------------------------------------------------------
# ---------------------------- End Print -----------------------------
[gcode_macro END_PRINT]
variable_machine_depth: 235
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Relative positionning
G91
# Retract and raise Z
G1 Z0.2 E-2 F2400
# Wipe out
G1 X5 Y5 F3000
# Raise Z more
G1 Z10
# Absolute positionning
G90
# Present print
G1 X0 Y{machine_depth}
# Disable steppers
M84
# Print message on LCD
M117 That's All Folks
# --------------------------------------------------------------------
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 27.446
#*# pid_ki = 1.663
#*# pid_kd = 113.214
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 61.301
#*# pid_ki = 1.362
#*# pid_kd = 689.640
@gaizkitapowers
Copy link

default_parameter was deprecated a while back and removed recently

@besser
Copy link
Author

besser commented Apr 12, 2023

I will update this gist, thanks!

@alexonpeace
Copy link

so ah no updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment