Skip to content

Instantly share code, notes, and snippets.

@eropple
Last active February 11, 2023 18:28
Show Gist options
  • Save eropple/05deeed06ab0dcbf17439f256231744b to your computer and use it in GitHub Desktop.
Save eropple/05deeed06ab0dcbf17439f256231744b to your computer and use it in GitHub Desktop.
sv06-klipper-20230116
[mcu PIS_BED]
# Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0
[adxl345]
cs_pin: PIS_BED:gpio13
#spi_bus: spi1a
spi_software_sclk_pin: PIS_BED:gpio10
spi_software_mosi_pin: PIS_BED:gpio11
spi_software_miso_pin: PIS_BED:gpio12
axes_map: x,-z,y
[resonance_tester]
accel_chip: adxl345
probe_points:
30, 30, 20
110, 30, 20
190, 30, 20
30,110, 20
110,110, 20
190,110, 20
30,190, 20
110,190, 20
190,190, 20
[mcu PIS_HOTEND]
# Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0
[adxl345]
cs_pin: PIS_HOTEND:gpio13
#spi_bus: spi1a
spi_software_sclk_pin: PIS_HOTEND:gpio10
spi_software_mosi_pin: PIS_HOTEND:gpio11
spi_software_miso_pin: PIS_HOTEND:gpio12
axes_map: x,-z,y
[resonance_tester]
accel_chip: adxl345
probe_points:
30, 30, 20
110, 30, 20
190, 30, 20
30,110, 20
110,110, 20
190,110, 20
30,190, 20
110,190, 20
190,190, 20
# This file contains pin mappings for the stock Sovol SV06
# To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.
# Also, since it is using the GD32F103, please select Disable SWD at startup
# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The firmware
# filename must end in ".bin" and must not match the last filename
# that was flashed.
# See docs/Config_Reference.md for a description of parameters.
[include mainsail.cfg]
[include printer_macros.cfg]
[virtual_sdcard]
path: ~/sv06blue_data/gcodes
# uncomment one or the other when doing input shaping
[include pis_hotend.cfg]
# [include pis_bed.cfg]
[mcu]
serial: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2.1:1.0-port0
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[stepper_x]
step_pin: PC2
dir_pin: !PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 0
position_max: 225
homing_speed: 40
homing_retract_dist: 0
[tmc2209 stepper_x]
uart_pin: PC1
run_current: 0.860
stealthchop_threshold: 180
interpolate: False
sense_resistor: 0.150
uart_address: 3
driver_SGTHRS: 81
diag_pin: PA5
[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 0
position_max: 225
homing_speed: 40
homing_retract_dist: 0
[tmc2209 stepper_y]
uart_pin: PC0
run_current: 0.900
stealthchop_threshold: 180
interpolate: False
sense_resistor: 0.150
uart_address: 3
driver_SGTHRS: 82
diag_pin: PA6
[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 4
endstop_pin: probe:z_virtual_endstop
position_min: -4
position_max: 261
homing_speed: 4
[tmc2209 stepper_z]
uart_pin: PA15
run_current: 1.000
stealthchop_threshold: 40
interpolate: False
sense_resistor: 0.150
uart_address: 3
diag_pin: PA7
[thermistor sovol_thermistor]
temperature1: 25
resistance1: 94162
beta: 4160
[extruder]
max_extrude_only_distance: 100.0
step_pin: PB4
dir_pin: !PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 4.56
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: sovol_thermistor
sensor_pin: PC5
#control: pid
#pid_kd: 86.991
#pid_kp: 21.479
#pid_ki: 1.326
min_temp: 0
max_temp: 260
[tmc2209 extruder]
uart_pin: PC14
run_current: 0.550
stealthchop_threshold: 60
interpolate: False
sense_resistor: 0.150
uart_address: 3
[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_kp: 64.440
pid_ki: 0.773
pid_kd: 1343.571
min_temp: 0
max_temp: 130
[fan]
pin: PA0
[probe]
pin: ^PB1
x_offset: 28
y_offset: -20
#z_offset: 0
speed: 1
lift_speed: 5
samples: 3
samples_tolerance: 0.015
samples_tolerance_retries: 5
[safe_z_home]
home_xy_position: 85,135
#z_hop: 10
#z_hop_speed: 5
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 28, 20
mesh_max: 197, 205
probe_count: 7,7
algorithm: bicubic
fade_start: 1
fade_end: 10
fade_target: 0
[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [probe]
#*# z_offset = 2.400
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# 0.027500, -0.055000, -0.174167, -0.246250, -0.337500, -0.430833, -0.547083
#*# 0.122917, 0.051250, -0.070000, -0.140000, -0.231250, -0.323750, -0.438750
#*# 0.188750, 0.127917, 0.017500, -0.047083, -0.141250, -0.230417, -0.345000
#*# 0.225000, 0.170000, 0.060417, 0.035417, -0.078750, -0.161250, -0.277500
#*# 0.218333, 0.165417, 0.052917, -0.002500, -0.071250, -0.141250, -0.243333
#*# 0.215417, 0.165417, 0.058750, 0.005000, -0.058333, -0.128750, -0.230833
#*# 0.272083, 0.179583, 0.071250, 0.012500, -0.052917, -0.119583, -0.180833
#*# x_count = 7
#*# y_count = 7
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = bicubic
#*# tension = 0.2
#*# min_x = 28.0
#*# max_x = 196.96
#*# min_y = 20.0
#*# max_y = 204.97
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 18.793
#*# pid_ki = 1.109
#*# pid_kd = 79.637
# This file provides examples of Klipper G-Code macros. The snippets
# in this file may be copied into the main printer.cfg file and
# customized.
# See docs/Config_Reference.md for a description of parameters.
######################################################################
# Start Print and End Print
######################################################################
# Replace the slicer's custom start and end g-code scripts with
# START_PRINT and END_PRINT.
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Start extruder heating
M104 S{EXTRUDER_TEMP}
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0.0
BED_MESH_PROFILE LOAD=default
# 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
######################################################################
# 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]
gcode:
{% set X = params.X|default(50)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
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
######################################################################
# Override M117 command with rawparams
######################################################################
# The macro below will override the default M117 command to echo the message.
#
# It uses the rawparams pseudo-variable that contains the full unparsed
# parameters that was passed to the M117 command.
#
# As this can include comments, we are trimming the text when a `;` or `#` is
# found, and escaping any existing `"`
[gcode_macro M117]
rename_existing: M117.1
gcode:
{% if rawparams %}
{% set escaped_msg = rawparams.split(';', 1)[0].split('\x23', 1)[0]|replace('"', '\\"') %}
SET_DISPLAY_TEXT MSG="{escaped_msg}"
RESPOND TYPE=command MSG="{escaped_msg}"
{% else %}
SET_DISPLAY_TEXT
{% endif %}
# SDCard 'looping' (aka Marlin M808 commands) support
#
# Support SDCard looping
[sdcard_loop]
# Cancel object (aka Marlin/RRF M486 commands) support
#
# Enable object exclusion
[exclude_object]
[gcode_macro M486]
gcode:
# Parameters known to M486 are as follows:
# [C<flag>] Cancel the current object
# [P<index>] Cancel the object with the given index
# [S<index>] Set the index of the current object.
# If the object with the given index has been canceled, this will cause
# the firmware to skip to the next object. The value -1 is used to
# indicate something that isn’t an object and shouldn’t be skipped.
# [T<count>] Reset the state and set the number of objects
# [U<index>] Un-cancel the object with the given index. This command will be
# ignored if the object has already been skipped
{% if 'exclude_object' not in printer %}
{action_raise_error("[exclude_object] is not enabled")}
{% endif %}
{% if 'T' in params %}
EXCLUDE_OBJECT RESET=1
{% for i in range(params.T | int) %}
EXCLUDE_OBJECT_DEFINE NAME={i}
{% endfor %}
{% endif %}
{% if 'C' in params %}
EXCLUDE_OBJECT CURRENT=1
{% endif %}
{% if 'P' in params %}
EXCLUDE_OBJECT NAME={params.P}
{% endif %}
{% if 'S' in params %}
{% if params.S == '-1' %}
{% if printer.exclude_object.current_object %}
EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object}
{% endif %}
{% else %}
EXCLUDE_OBJECT_START NAME={params.S}
{% endif %}
{% endif %}
{% if 'U' in params %}
EXCLUDE_OBJECT RESET=1 NAME={params.U}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment