💎

Sovol SV06 Klipper config

2024/05/26に公開

Sovol SV06 のファームウェアをKlipper化すると快適です。
拙宅SV06のconfigです。参考にどうぞ。

printer.cfg

;=======================================================================
; Config for Sovol SV06
;=======================================================================
[include mainsail.cfg]
#[include fluidd.cfg]
[include macro_pa_cal.cfg]
[include macros.cfg]
[include search_vars.cfg]

[mcu]
serial: /dev/serial/by-path/platform-70090000.xusb-usb-0:2.2:1.0-port0
restart_method: command

#[mcu rpi]
#serial: /tmp/klipper_host_mcu

#[adxl345]
#cs_pin: rpi:None
##axes_map: y,x,z

#[resonance_tester]
#accel_chip: adxl345
#probe_points: 110, 110, 20

[input_shaper]
shaper_freq_x: 58.0
shaper_type_x: mzv
shaper_freq_y: 50.0
shaper_type_y: mzv

[exclude_object]
[pause_resume]
[gcode_arcs]

[respond]
default_type: echo

[virtual_sdcard]
path: ~/printer_4_data/gcodes

[printer]
kinematics: cartesian
max_velocity: 500
max_accel: 4000
max_z_velocity: 20 #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: 226
homing_speed: 40
homing_retract_dist: 0

[tmc2209 stepper_x]
uart_pin: PC1
run_current: 0.860
stealthchop_threshold: 9999999 # 0
#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: 226
homing_speed: 40
homing_retract_dist: 0

[tmc2209 stepper_y]
uart_pin: PC0
run_current: 0.900
stealthchop_threshold: 9999999 # 0
#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: -3
position_max: 259
homing_speed: 20
second_homing_speed: 5

[tmc2209 stepper_z]
uart_pin: PA15
run_current: 1.000
stealthchop_threshold: 9999999 # 0
#interpolate: False
sense_resistor: 0.150
uart_address: 3
diag_pin: PA7

[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: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_kp: 26.758 # 21.479
pid_ki: 2.444 # 1.326
pid_kd: 73.249 # 86.991
min_temp: 0
max_temp: 300
pressure_advance: 0.035

[tmc2209 extruder]
uart_pin: PC14
run_current: 0.550
stealthchop_threshold: 0
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

#[temperature_sensor stm32f103]
#sensor_type: temperature_mcu 

[probe]
pin: PB1
x_offset: 27
y_offset: -20
z_offset: 2.00
samples: 2
samples_tolerance: 0.015
samples_tolerance_retries: 5

[safe_z_home]
home_xy_position: 85,135
z_hop: 10
z_hop_speed: 20

[bed_mesh]
speed: 250
horizontal_move_z: 5
mesh_min: 28, 20
mesh_max: 210, 205
probe_count: 7
algorithm: bicubic
#fade_start: 1
#fade_end: 10
#fade_target: 0
mesh_pps: 2, 2

[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2

[output_pin beeper]
pin: PC6

#-----------------------------------------------------------------------
# menu
#-----------------------------------------------------------------------
[menu __main __setup __calib __Bed_mesh]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Bed mesh
gcode:
    BED_MESH

[menu __main __octoprint]
type : disabled

macro_pa_cal.cfg

[gcode_macro PA_CAL]
description: Tune Pressure Advance

gcode:
    {% set BED_TEMP = params.BED_TEMP|default(80)|float %}
    {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(240)|float %}
    {% set PA_START = params.PA_START|default(0.0)|float %}
    {% set PA_STEP = params.PA_STEP|default(0.005)|float %}
    {% set SMOOTH_TIME = params.SMOOTH_TIME|default(0.04)|float %}
    {% set SMOOTH_STEP = params.SMOOTH_STEP|default(0.01)|float %}
    {% set WIDTH = params.LINE_WIDTH|default(0.4)|float %}
    {% set HEIGHT = params.LINE_HEIGHT|default(0.2)|float %}
    {% set SLOW_SPEED = params.LINE_SLOW_SPEED|default(5)|float %}
    {% set FAST_SPEED = params.LINE_FAST_SPEED|default(150)|float %}
    {% set FILAMENT = params.FILAMENT|default(1.75)|float %}
    {% set RETRACT = params.RETRACT_LENGTH|default(0.4)|float %}
    {% set ZHOP = params.RETRACT_ZHOP_LENGTH|default(0.4)|float %}
    {% set TYPE = params.TYPE|default('ADVANCE') %}

    #   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 offset_x = (max_x-80) / 2|float %}
    {% set offset_y = (max_y-110) / 2|float %}
    {% set extrusion_area = ((HEIGHT/2)**2)*3.14159+(WIDTH-HEIGHT)*HEIGHT|float %}
    {% set filament_area = ((FILAMENT/2)**2)*3.14159|float %}
    
    PRINT_START BED_TEMP={BED_TEMP} EXTRUDER_TEMP={EXTRUDER_TEMP}

    G21 ; Millimeter units
    G90 ; Absolute XYZ
    M83 ; Relative E
    G92 E0
    M106 S0 

    G1 X{offset_x+80} Y{offset_y} F30000
    G1 Z{HEIGHT} F300
    G1 Y{offset_y+115} E{(extrusion_area/filament_area)*115} F1500
    G1 E-{RETRACT} F1800
    G1 Z{HEIGHT+ZHOP} F3000
    G1 X{offset_x} F30000
    G1 Z{HEIGHT} F3000
    G1 E{RETRACT} F1800
    G1 Y{offset_y} E{(extrusion_area/filament_area)*115} F1500
    G1 E-{RETRACT} F1800
    G92 E0

    #G1 X{offset_x} Y{offset_y} F30000  ; move to start position
    G1 Z{HEIGHT} F3000                  ; move to layer height
    G1 E{RETRACT} F1800                 ; un-retract
    G1 X{offset_x+20} Y{offset_y} E{(extrusion_area/filament_area)*20} F{SLOW_SPEED*60}     ; print line part one
    G1 X{offset_x+60} Y{offset_y} E{(extrusion_area/filament_area)*40} F{FAST_SPEED*60}     ; print line part two
    G1 X{offset_x+80} Y{offset_y} E{(extrusion_area/filament_area)*20} F{SLOW_SPEED*60}     ; print line part three
    G1 E-{RETRACT} F1800                ; retract
    G1 Z{HEIGHT+ZHOP} F3000             ; Move above layer height

    {% for i in range(0, 20) %}
      {% if TYPE == 'SMOOTH_TIME' %}
        SET_PRESSURE_ADVANCE ADVANCE={PA_START} SMOOTH_TIME={SMOOTH_TIME + (i * SMOOTH_STEP)}
      {% else %}
        SET_PRESSURE_ADVANCE ADVANCE={PA_START + (i * PA_STEP)} SMOOTH_TIME={SMOOTH_TIME}
      {% endif %}
      M117 Testing Pressure Advance at: {PA_START + (i * PA_STEP)}
      G1 X{offset_x} Y{offset_y+15+(5*i)} F30000  ; move to start position
      G1 Z{HEIGHT} F3000                          ; move to layer height
      G1 E{RETRACT} F1800                         ; un-retract
      G1 X{offset_x+20} Y{offset_y+15+(5*i)} E{(extrusion_area/filament_area)*20} F{SLOW_SPEED*60}     ; print line part one
      G1 X{offset_x+60} Y{offset_y+15+(5*i)} E{(extrusion_area/filament_area)*40} F{FAST_SPEED*60}     ; print line part two
      G1 X{offset_x+80} Y{offset_y+15+(5*i)} E{(extrusion_area/filament_area)*20} F{SLOW_SPEED*60}     ; print line part three
      G1 E-{RETRACT} F1800                        ; retract
      G1 Z{HEIGHT+ZHOP} F3000                     ; Move above layer height  
    {% endfor %}

    PRINT_END

macros.cfg

#-----------------------------------------------------------------------
# macro
#-----------------------------------------------------------------------
;[gcode_macro pause]

;[gcode_macro resume]

;[gcode_macro cancel_print]

[gcode_macro G29]
gcode:
    BED_MESH_CLEAR
    {% if printer.toolhead.homed_axes != "xyz" %}
      G28
    {% endif %}
    BED_MESH_CALIBRATE
    #BED_MESH_PROFILE LOAD=temp-90-samles-5
    #BED_MESH_PROFILE LOAD=default-95-2
    G0 X0 Y0 Z15 F6000

[gcode_macro G90_]
gcode:
    G90

[gcode_macro HEATER_EXTRUDER]
gcode:
    {% set TEMP = params.TEMP|default(220)|float %}
    SET_HEATER_TEMPERATURE HEATER=extruder TARGET={TEMP}

[gcode_macro HEATER_BED]
gcode:
    {% set TEMP = params.TEMP|default(70)|float %}
    SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={TEMP}

[gcode_macro LEVEL_CHECK]
gcode:
    {% set x_max = printer.configfile.config.stepper_x.position_max|int %}
    {% set y_max = printer.configfile.config.stepper_y.position_max|int %}
    {% set x_center = x_max / 2|float %}
    {% set y_center = x_max / 2|float %}
    G90
    G1 X{x_center} Y{y_center} F3600
    G1 Z0.3 F300
    G1 Z0.0 F30

[gcode_macro PRINT_START]
gcode:
    {% set y_max = printer.configfile.config.stepper_y.position_max|int %}
    {% set BED_TEMP = params.BED_TEMP|default(60)|float %}
    {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}

    G21
    G90
    M82
    M140 S{BED_TEMP}
    G28
    M82
    M190 S{BED_TEMP}

    G28
    G29
    M104 S{EXTRUDER_TEMP}
    G1 Z10.0 F300
    G1 X0 Y0 F3600
    M109 S{EXTRUDER_TEMP}

    G92 E0
    #G1 Z0.5 F300
    #G1 Z0.2 F30
    #G1 Z2 F300
    G1 X0.1 Y20 F5000
    G1 Z0.5 F300
    G1 Z0.3 F30
    G1 Y{y_max-30} F1500.0 E15
    G1 X0.4 F5000.0
    G1 Y20 F1500 E30
    G92 E0
    G1 Z2.0 F3000
    G1 X5 Y20 Z0.3 F5000

[gcode_macro PRINT_END]
gcode:
    {% set x_max = printer.configfile.config.stepper_x.position_max|int %}
    {% set y_max = printer.configfile.config.stepper_y.position_max|int %}
    G91
    G1 E-2 F2700
    G1 E-2 Z0.2 F2400
    G1 X5 Y5 F3000
    G1 Z10 F3000
    G90
    M140 S0
    M104 S0
    M106 S0

    G1 X{x_max} Y{y_max} F3000
    M84

search_vars.cfg

[gcode_macro SEARCH_VARS]
gcode:
    {% set S = params.S|lower %}
    {% set ns = namespace() %}
    {% for item in printer  %}
        {% if ' ' in item %}
            {% set ns.path = ['printer', "['%s']" % (item), ''] %}
        {% else %}
            {% set ns.path = ['printer.', item, ''] %}   
        {% endif %} 

        {% if S in ns.path|lower %}
            { action_respond_info(ns.path|join) }
        {% endif %} 

        {% if printer[item].items() %}
            {% for childkey, child in printer[item].items() recursive %}
                {% set ns.path = ns.path[:loop.depth|int + 1] %}

                {% if ' ' in childkey %}
                    {% set null = ns.path.append("['%s']" % (childkey)) %}
                {% else %}
                    {% set null = ns.path.append(".%s" % (childkey)) %}
                {% endif %} 

                {% if child is mapping  %}
                    { loop(child.items()) }
                {% else %}
                    {% if S in ns.path|lower %}
                        { action_respond_info("%s : %s" % (ns.path|join, child)) }   
                    {% endif %} 
                {% endif %} 
                
            {% endfor %}
        {% endif %} 
    {% endfor %}

まとめ

ご参考まで。

GitHubで編集を提案

Discussion