Skip to content

Instantly share code, notes, and snippets.

@clee
Created February 13, 2022 04:58
Show Gist options
  • Save clee/dae03d0967867b07b745a032985efff5 to your computer and use it in GitHub Desktop.
Save clee/dae03d0967867b07b745a032985efff5 to your computer and use it in GitHub Desktop.
V0.755 klipper config
[idle_timeout]
timeout: 3600
[firmware_retraction]
retract_length: 0.40
retract_speed: 35
unretract_speed: 25
#unretract_extra_length: 0.05
# Tool to help adjust bed leveling screws. One may define a
# [bed_screws] config section to enable a BED_SCREWS_ADJUST g-code
# command.
[bed_screws]
screw1: 61,5
screw1_name: front screw
screw2: 3,110
screw2_name: back left
screw3: 110,115
screw3_name: back right
#[input_shaper]
#shaper_type_x: mzv
#shaper_freq_x: 105.6
#shaper_type_y: mzv
#shaper_freq_y: 93.4
[adc_temperature Mellow450]
temperature1: 25
resistance1: 4721000.00
temperature2: 100
resistance2: 147700.00
temperature3: 110
resistance3: 104200.00
temperature4: 120
resistance4: 74560.00
temperature5: 130
resistance5: 54130.00
temperature6: 140
resistance6: 39810.00
temperature7: 150
resistance7: 29650.00
temperature8: 160
resistance8: 22340.00
temperature9: 170
resistance9: 17020.00
temperature10: 180
resistance10: 13100.00
temperature11: 190
resistance11: 10190.00
temperature12: 200
resistance12: 8000.00
temperature13: 210
resistance13: 6337.00
temperature14: 220
resistance14: 5062.00
temperature15: 230
resistance15: 4077.00
temperature16: 240
resistance16: 3309.00
temperature17: 250
resistance17: 2705.00
temperature18: 260
resistance18: 2228.00
temperature19: 270
resistance19: 1846.00
temperature20: 280
resistance20: 1540.00
temperature21: 290
resistance21: 1293.00
temperature22: 300
resistance22: 1092.00
temperature23: 310
resistance23: 929.80
temperature24: 320
resistance24: 795.80
temperature25: 330
resistance25: 684.20
temperature26: 340
resistance26: 590.80
temperature27: 350
resistance27: 512.20
temperature28: 360
resistance28: 445.80
temperature29: 370
resistance29: 389.40
temperature30: 380
resistance30: 341.20
temperature31: 390
resistance31: 300.00
temperature32: 400
resistance32: 264.60
temperature33: 410
resistance33: 234.00
temperature34: 420
resistance34: 207.50
temperature35: 430
resistance35: 184.50
temperature36: 440
resistance36: 164.50
temperature37: 450
resistance37: 146.90
temperature38: 460
resistance38: 131.60
temperature39: 470
resistance39: 118.10
temperature40: 480
resistance40: 106.10
temperature41: 490
resistance41: 95.60
temperature42: 500
resistance42: 86.30
[adc_temperature clee104GT]
temperature1: 20
resistance1: 126800.00
temperature2: 100
resistance2: 5556.0
temperature3: 110
resistance3: 4082.0
temperature4: 120
resistance4: 3043.0
temperature5: 130
resistance5: 2298.0
temperature6: 140
resistance6: 1758.0
temperature7: 150
resistance7: 1360.0
temperature8: 160
resistance8: 1064.0
temperature9: 170
resistance9: 841.4
temperature10: 180
resistance10: 671.4
temperature11: 190
resistance11: 540.8
temperature12: 200
resistance12: 439.3
temperature13: 210
resistance13: 359.7
temperature14: 220
resistance14: 296.9
temperature15: 230
resistance15: 246.8
temperature16: 240
resistance16: 206.5
temperature17: 250
resistance17: 174.0
temperature18: 260
resistance18: 147.5
temperature19: 270
resistance19: 125.8
temperature20: 280
resistance20: 107.9
temperature21: 290
resistance21: 93.05
temperature22: 300
resistance22: 80.65
[thermistor Better 3950]
temperature1: 25.0
resistance1: 103180.0
temperature2: 150.0
resistance2: 1366.2
temperature3: 250.0
resistance3: 168.6
# This file contains common pin mappings for the Fysetc S6 V2.1
# To use this config, the firmware should be compiled for the STM32F446 with
# USB communication.
[mcu]
#####################################################################
# Obtain definition by "ls -l /dev/serial/by-id/"
#####################################################################
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_11000D000C50563046363120-if00
restart_method: command
[printer]
kinematics: corexy
max_velocity: 500
max_accel: 20000
max_z_velocity: 15
max_z_accel: 45
square_corner_velocity: 6.0
#####################################################################
# X/Y Stepper Settings
#####################################################################
[stepper_x]
step_pin: PE11
## Refer to https://docs.vorondesign.com/build/startup/#v0
dir_pin: !PE10
enable_pin: !PE9
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200 # Set to 400 for 0.9° degree stepper motor, 200 is for 1.8° stepper motors
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 20 # Can be increased after initial setup, Max 100
homing_positive_dir: true
homing_retract_dist: 0
[tmc2209 stepper_x]
uart_pin: PE8
diag_pin: ^PB14
interpolate: False
run_current: 0.9
sense_resistor: 0.110
stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
driver_SGTHRS: 65
[stepper_y]
step_pin: PD8
dir_pin: !PB12
enable_pin: !PD9
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200 # Set to 400 for 0.9° degree stepper motor, 200 is for 1.8° stepper motors
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 20 # Can be increased after initial setup, Max 100
homing_positive_dir: true
homing_retract_dist: 0
[tmc2209 stepper_y]
uart_pin: PC4
diag_pin: ^PB13
interpolate: False
run_current: 0.9
sense_resistor: 0.110
stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
driver_SGTHRS: 65
#####################################################################
# Z Stepper Settings
#####################################################################
[stepper_z]
step_pin: PD14
dir_pin: PD13
enable_pin: !PD15
rotation_distance: 8 # For T8x8 integrated lead screw
microsteps: 16
endstop_pin: ^PA0
position_endstop: -0.10
position_max: 120
position_min: -1.5
homing_speed: 15
second_homing_speed: 3.0
homing_retract_dist: 3.0
[tmc2209 stepper_z]
uart_pin: PD12
interpolate: False
## For OMC (StepperOnline) 17LS13-0404E-200G 0.4A
#run_current: 0.2
## For LDO-42STH25-1004CL200E 1.0A
run_current: 0.6
sense_resistor: 0.110
stealthchop_threshold: 0 # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
#####################################################################
# Extruder
#####################################################################
[extruder]
step_pin: PD5
dir_pin: !PD6 # Add ! if moving opposite direction
enable_pin: !PD4
full_steps_per_rotation: 200 # Set to 200 for LDO 1.8° stepper motor, and set to 400 for OMC(StepperOnline) 0.9° stepper motor
rotation_distance: 22.67895 # See calibrating rotation_distance on extruders doc
gear_ratio: 50:10 # For Mini Afterburner
microsteps: 128
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB3
sensor_pin: PC0
sensor_type: ATC Semitec 104NT-4-R025H42G
control: pid # Do PID calibration after initial checks
pid_Kp=28.091
pid_Ki=1.149
pid_Kd=171.709
min_temp: 0
max_temp: 300
min_extrude_temp: 170
max_extrude_only_distance: 150
max_extrude_cross_section: 0.8
pressure_advance: 0.04 # See tuning pressure advance doc
pressure_advance_smooth_time: 0.050
[tmc2209 extruder]
uart_pin: PA15
interpolate: False
#run_current: 0.5 # For Moons CSE14HRA1L410A 1.8°
run_current: 0.5 # for OMC 14HR07-1004VRN rated at 1A
sense_resistor: 0.110
stealthchop_threshold: 0 # Set to 0 for spreadcycle, avoid using stealthchop on extruder
#[extruder1]
#step_pin: PE6
#dir_pin: !PC13
#enable_pin: !PE5
#heater_pin: PB4
#sensor_pin: PC1
#[tmc2209 extruder1]
#uart_pin: PC5
#run_current: 0.8
#stealthchop_threshold: 0
#[extruder2]
#step_pin: PE2
#dir_pin: !PE4
#enable_pin: !PE3
#heater_pin: PB15
#sensor_pin: PC2
#[tmc2209 extruder2]
#uart_pin: PE0
#run_current: 0.8
#stealthchop_threshold: 0
#####################################################################
# Bed Heater
#####################################################################
[heater_bed]
heater_pin: PC8
sensor_type: NTC 100K MGB18-104F39050L32 # For Keenovo, verify yours
sensor_pin: PC3
smooth_time: 3.0
#max_power: 0.6 # Only needed for 100w pads
min_temp: 0
max_temp: 120
control: pid # Do PID calibration after initial checks
pid_Kp=55.749
pid_Ki=2.161
pid_Kd=359.579
#####################################################################
# Fan Control
#####################################################################
[heater_fan hotend_fan]
## Hotend cooling fan: FAN0
pin: PB0
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
#fan_speed: 1.0 # You can't PWM the delta fan unless using blue wire
[fan]
## Part cooling fans: FAN1
pin: PB1
max_power: 1.0
kick_start_time: 0.5 # Depending on your fan, you may need to increase this value if your fan will not start
off_below: 0.10
#cycle_time: 0.010
#[fan_generic nevermore]
## Nevermore Micro V4: FAN2
#pin: PB2
#max_power: 1.0
#kick_start_time: 0.5
##off_below: 0.20
#cycle_time: 0.010
[temperature_sensor Pi]
sensor_type: temperature_host
[temperature_sensor S6]
sensor_type: temperature_mcu
[gcode_arcs]
resolution: 1.0
[gcode_macro PRINT_START]
gcode:
##### set defaults #####
{% set BED = params.BED|default(60)|int %}
{% set EXTRUDER = params.EXTRUDER|default(160)|int %}
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={BED}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={BED}
SET_HEATER_TEMPERATURE HEATER=extruder TARGET={EXTRUDER}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={EXTRUDER}
### only run G28 if we're not already homed
{% if "xyz" not in printer.toolhead.homed_axes %}
G28 ; home all axes
{% endif %}
PURGE_LINE
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
##### set defaults #####
{% set x = params.X|default(60) %} #edit to your park position
{% set y = params.Y|default(10) %} #edit to your park position
{% set z = params.Z|default(5)|float %} #edit to your park position
{% set e = params.E|default(10) %} #edit to your retract length
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=VPAUSE
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
M83 ; set extruder to relative
G1 E-{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough to retract")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro CANCEL_PRINT]
description: Cancel the currently-running print
rename_existing: CANCEL_PRINT_BASE
gcode:
##### set defaults #####
{% set x = params.X|default(60) %}
{% set y = params.Y|default(10) %}
{% set z = params.Z|default(5)|float %}
{% set e = params.E|default(10)|float %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% set lift_z = z|abs %}
{% if act_z < (max_z - lift_z) %}
{% set z_safe = lift_z %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=VCANCEL
{% if printer.extruder.can_extrude|lower == 'true' %}
M83 ; set extruder to relative
G1 E-{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough to retract")}
{% endif %}
G91
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe}
G90
G1 X{x} Y{y} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
;TURN_OFF_HEATERS
RESTORE_GCODE_STATE NAME=VCANCEL MOVE=0
CANCEL_PRINT_BASE
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### set defaults #####
{% set e = params.E|default(10) %} #edit to your retract length
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
RESTORE_GCODE_STATE NAME=VPAUSE MOVE=1 MOVE_SPEED=50
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
M83 ; set extruder to relative
G1 E{e} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customize for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G91 ; relative positioning
# 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 direction 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 %}
G0 Z{z_safe} F3600 ; move nozzle up
G0 X{x_safe} Y{y_safe} F20000 ; move nozzle to remove stringing
M83 ; set extruder to relative
G1 E-10.0 F3600 ; retract filament
M82 ; set extruder to absolute
G92 E0.0 ; reset extruder
TURN_OFF_HEATERS
M107 ; turn off fan
G90 ; absolute positioning
G0 X60 Y{max_y - 20} F3600 ; park nozzle at rear
[gcode_macro LOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E30.0 F300 ; load
G1 E10.0 F150 ; prime nozzle with filament
M82 ; set extruder to absolute
G92 E0.0 ; reset extruder
[gcode_macro UNLOAD_FILAMENT]
gcode:
M83 ; set extruder to relative
G1 E10.0 F300 ; extrude a little to soften tip
G1 E-40.0 F600 ; retract all the way
M82 ; set extruder to absolute
G92 E0.0 ; reset extruder
[gcode_macro PURGE_LINE]
gcode:
G90 ; absolute positioning
G1 X20 Y4.0 F3000 ; go to tongue of print bed
G1 Z0.2 F500 ; move nozzle to bed
M83 ; set extruder to relative
G1 E8 F900 ; pre-purge prime LENGTH
G1 X100 E15.0 F800 ; intro line 1
G1 Y4.4 F800 ; move in a little
G1 X20 E15.0 F800 ; second line
G10 ; retract
M82 ; set extruder to absolute
G92 E0.0 ; reset extruder
G1 X8.0 Y4.0 Z0.5 F9000 ; move nozzle to prevent scratch
[virtual_sdcard]
path: /home/pi/sdcard
[pause_resume]
[display_status]
[include definitions.cfg]
[include macros.cfg]
[include fysetc-s6_v2.1.cfg]
[include calibration.cfg]
[include sensorless.cfg]
[include moonraker.cfg]
[gcode_macro SENSORLESS_HOME_X]
gcode:
# Set current for sensorless homing
{% set driver_config = printer.configfile.settings['tmc2209 stepper_x'] %}
{% set RUN_CUR = driver_config.run_current|float %}
{% set HOME_CUR = 0.7 %}
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={HOME_CUR}
# Home
G28 X0
# Move away
G91
G1 X-10 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_x CURRENT={RUN_CUR}
[gcode_macro SENSORLESS_HOME_Y]
gcode:
# Set current for sensorless homing
{% set driver_config = printer.configfile.settings['tmc2209 stepper_y'] %}
{% set RUN_CUR = driver_config.run_current|float %}
{% set HOME_CUR = 0.7 %}
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={HOME_CUR}
# Home
G28 Y0
# Move away
G91
G1 Y-10 F1200
# Set current during print
SET_TMC_CURRENT STEPPER=stepper_y CURRENT={RUN_CUR}
[homing_override]
gcode:
{% if not 'X' in params
and not 'Y' in params
and not 'Z' in params %}
{% set home_x, home_y, home_z = True, True, True %}
{% else %}
{% if 'X' in params %}
{% set home_x = True %}
{% endif %}
{% if 'Y' in params %}
{% set home_y = True %}
{% endif %}
{% if 'Z' in params %}
{% set home_z = True %}
{% endif %}
{% endif %}
{% if home_x %}
{% if verbose %}
{ action_respond_info("Homing X") }
{% endif %}
SENSORLESS_HOME_X
{% endif %}
G4 P500
{% if home_y %}
{% if verbose %}
{ action_respond_info("Homing Y") }
{% endif %}
SENSORLESS_HOME_Y
{% endif %}
{% if home_z %}
{% if verbose %}
{ action_respond_info("Homing Z") }
{% endif %}
G28 Z0
G1 Z10
{% endif %}
axes: xyz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment