Skip to content

Instantly share code, notes, and snippets.

@frap129
Last active February 13, 2022 22:20
Show Gist options
  • Save frap129/85ffb62d7f763be5bbdca22e29648758 to your computer and use it in GitHub Desktop.
Save frap129/85ffb62d7f763be5bbdca22e29648758 to your computer and use it in GitHub Desktop.
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 64
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 162
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.650
stealthchop_threshold: 250
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 64
rotation_distance: 40
endstop_pin: ^PC1
position_endstop: 0
position_max: 164
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
run_current: 0.650
stealthchop_threshold: 250
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
microsteps: 64
rotation_distance: 8
#endstop_pin: ^PC2
endstop_pin: probe:z_virtual_endstop # For bltouch
position_min: -5
position_max: 205
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
run_current: 0.580
stealthchop_threshold: 5
[safe_z_home]
home_xy_position: 105,95
speed: 50
z_hop: 10
z_hop_speed: 5
[extruder]
step_pin: PB3
dir_pin: PB4
enable_pin: !PD2
#step_distance: 0.0026218
rotation_distance: 8.38976
microsteps: 16
pressure_advance: 0.105
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
tx_pin: PC10
uart_address: 3
run_current: 0.750 # For pancake motor, original 0.650
stealthchop_threshold: 0
[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: PC6
kick_start_time: 1.5
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_32FFDA055646363327771243-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: -46
y_offset: +2
#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
[screws_tilt_adjust]
screw1: 137,140
screw1_name: back right screw
screw2: 65,68
screw2_name: mid left screw
screw3: 157,41
screw3_name: front right screw
horizontal_move_z: 10
speed: 50
screw_thread: CW-M3
[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: 80
retract_length: 1.2
unretract_speed: 60
[static_digital_output usb_pullup_enable]
pins: !PA14
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PB15, EXP1_10=<5V>
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
#[mcu rpi]
#serial: /tmp/klipper_host_mcu
#[adxl345]
#cs_pin: rpi:None
#[resonance_tester]
#accel_chip: adxl345
#probe_points:
# 110,90,20
[input_shaper]
shaper_freq_x: 48.4
shaper_type_x: ei
shaper_freq_y: 49.4
shaper_type_y: ei
[gcode_macro STOW_RETRACT]
gcode:
{% set STOW_DIST = params.STOW_DIST|default(5)|float %}
G91
G1 E-{STOW_DIST} F4000
G90
[gcode_macro STOW_UNRETRACT]
gcode:
{% set STOW_DIST = params.STOW_DIST|default(5)|float %}
G91
G1 E{STOW_DIST} F4000
G90
[gcode_macro PARK]
gcode:
{% set X = params.X|default(0)|float %}
{% set Y = params.Y|default(145)|float %}
{% set Z = params.Z|default(10)|float %}
STOW_RETRACT
G91
G1 Z{Z}
G90
G1 X{X} Y{Y} F6000
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
M117 Pausing
M106 S255
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
PARK
M117 Paused
M107
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
M117 Resuming
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
M117 Printing
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
M117 Cancelling
M106 S255
STOW_RETRACT
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
PARK
M107
M117 Done!
[gcode_macro START_PRINT]
gcode:
{% set T_BED = params.T_BED|default(60)|float %}
{% set T_EXTRUDER = params.T_EXTRUDER|default(205)|float %}
M140 S{T_BED}
{% if printer.configfile.config["bed_mesh %.0f" % T_BED] is defined %}
M104 S{T_EXTRUDER}
M106 S255
{% endif %}
M117 Homing
G90 ; use absolute coordinates
G28 ; home printer
LOAD_MESH_TEMP BED_TEMPERATURE={T_BED} ; use temperature mesh
M104 S{T_EXTRUDER}
M106 S255
G1 X0 Y20 Z5 F6000 ; get nozzle close to bed
M117 Heating
M109 S{T_EXTRUDER}
M190 S{T_BED}
STOW_UNRETRACT
M107
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 Z1 F3000 ; Lift Z before travel
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:
M106 S255
TURN_OFF_HEATERS
PARK
M84 ; disable motors
M107
M117 Done!
[gcode_macro LOAD_MESH_TEMP]
gcode:
{% set BED_TEMPERATURE = params.BED_TEMPERATURE|default(0)|float %}
{% set FORCE = params.FORCE|default(1)|int %}
{% if printer.configfile.config["bed_mesh %.0f" % BED_TEMPERATURE] is defined and FORCE|int == 0 %}
BED_MESH_PROFILE LOAD={BED_TEMPERATURE}
{action_respond_info("Loaded %.0f C bed mesh" % BED_TEMPERATURE)}
{% else %}
{% if printer.configfile.config["bed_mesh %.0f" % BED_TEMPERATURE] is defined and FORCE|int == 1 %}
BED_MESH_PROFILE REMOVE={BED_TEMPERATURE}
{% else %}
{action_respond_info("No bed mesh for %.0f C" % BED_TEMPERATURE)}
{% endif %}
{action_respond_info("Creating new bed mesh for %.0f C" % BED_TEMPERATURE)}
ADD_BED_MESH TARGET_TEMP={BED_TEMPERATURE}
{% endif %}
[gcode_macro ADD_BED_MESH]
gcode:
{% set BED_TEMPERATURE = params.BED_TEMPERATURE|default(0)|float %}
M190 S{BED_TEMPERATURE} # Wait for the bed to hit TARGET_TEMP
BED_MESH_CALIBRATE
BED_MESH_PROFILE SAVE={BED_TEMPERATURE}
[gcode_macro SET_MODE_QUALITY]
gcode:
SET_VELOCITY_LIMIT ACCEL=1500
SET_VELOCITY_LIMIT ACCEL_TO_DECEL=1000
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=4
[gcode_macro SET_MODE_SPEED]
gcode:
SET_VELOCITY_LIMIT ACCEL={printer.configfile.settings.printer.max_accel}
SET_VELOCITY_LIMIT ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={printer.configfile.settings.printer.square_corner_velocity}
[gcode_macro SET_RETRACT_DEFAULT]
gcode:
SET_RETRACTION RETRACT_LENGTH={printer.configfile.settings.firmware_retraction.retract_length}
SET_RETRACTION RETRACT_SPEED={printer.configfile.settings.firmware_retraction.retract_speed}
SET_RETRACTION UNRETRACT_SPEED={printer.configfile.settings.firmware_retraction.unretract_speed}
[gcode_macro SET_RETRACT_TPU]
gcode:
{% set TPU_RETRACT_LENGTH = params.TPU_RETRACT_LENGTH|default(0.8)|float %}
{% set TPU_RETRACT_SPEED = params.TPU_RETRACT_SPEED|default(40)|int %}
{% set TPU_UNRETRACT_SPEED = params.TPU_UNRETRACT_SPEED|default(30)|int %}
SET_RETRACTION RETRACT_LENGTH={TPU_RETRACT_LENGTH} RETRACT_SPEED={TPU_RETRACT_SPEED} UNRETRACT_SPEED={TPU_UNRETRACT_SPEED}
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bltouch]
#*# z_offset = 2.120
#*#
#*# [bed_mesh 50]
#*# version = 1
#*# points =
#*# -0.050833, 0.062708, 0.155417
#*# -0.067292, 0.028333, 0.103542
#*# -0.140417, -0.055417, 0.027708
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
#*#
#*# [bed_mesh 70]
#*# version = 1
#*# points =
#*# -0.078125, -0.035625, -0.007500
#*# -0.034167, 0.020208, 0.024583
#*# -0.016458, 0.007500, 0.023125
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
#*#
#*# [bed_mesh 30]
#*# version = 1
#*# points =
#*# -0.000000, 0.102500, 0.158333
#*# -0.040000, 0.058958, 0.093333
#*# -0.127708, -0.036667, 0.007708
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
#*#
#*# [bed_mesh 90]
#*# version = 1
#*# points =
#*# 0.107083, 0.150417, 0.237083
#*# 0.018750, 0.068750, 0.121667
#*# -0.056667, -0.010417, 0.062292
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.064792, 0.016250, 0.013125
#*# 0.086250, 0.009792, -0.016250
#*# 0.111250, 0.040000, -0.005000
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
#*#
#*# [bed_mesh 60]
#*# version = 1
#*# points =
#*# 0.064792, 0.016250, 0.013125
#*# 0.086250, 0.009792, -0.016250
#*# 0.111250, 0.040000, -0.005000
#*# tension = 0.2
#*# min_x = 13.0
#*# algo = lagrange
#*# y_count = 3
#*# mesh_y_pps = 2
#*# min_y = 13.0
#*# x_count = 3
#*# max_y = 134.0
#*# mesh_x_pps = 2
#*# max_x = 108.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment