├── Macros.cfg ├── README.md └── printer.cfg /Macros.cfg: -------------------------------------------------------------------------------- 1 | # Helper script to park the carriage (called from T0 and T1 macros) 2 | [gcode_macro PARK_extruder] 3 | gcode: 4 | SAVE_GCODE_STATE NAME=park0 5 | G90 6 | G1 X-62 F20000 7 | RESTORE_GCODE_STATE NAME=park0 8 | 9 | 10 | # Activate the primary extruder 11 | [gcode_macro T0] 12 | gcode: 13 | PARK_{printer.toolhead.extruder} 14 | ACTIVATE_EXTRUDER EXTRUDER=extruder 15 | SET_DUAL_CARRIAGE CARRIAGE=0 16 | SET_GCODE_OFFSET X=0 17 | SET_GCODE_OFFSET Y=0 18 | SET_FILAMENT_SENSOR SENSOR=Right ENABLE=0 19 | SET_FILAMENT_SENSOR SENSOR=Left ENABLE=1 20 | 21 | 22 | 23 | [gcode_macro PARK_extruder1] 24 | gcode: 25 | SAVE_GCODE_STATE NAME=park1 26 | G90 27 | G1 X362 F20000 28 | RESTORE_GCODE_STATE NAME=park1 29 | 30 | [gcode_macro T1] 31 | gcode: 32 | PARK_{printer.toolhead.extruder} 33 | ACTIVATE_EXTRUDER EXTRUDER=extruder1 34 | SET_DUAL_CARRIAGE CARRIAGE=1 35 | SET_GCODE_OFFSET X=-2.75 36 | SET_GCODE_OFFSET Y=0.9 37 | SET_FILAMENT_SENSOR SENSOR=Right ENABLE=1 38 | SET_FILAMENT_SENSOR SENSOR=Left ENABLE=0 39 | 40 | [gcode_macro M106] 41 | gcode: 42 | {% if params.P is defined %} 43 | {% if params.S is defined %} 44 | SET_PIN PIN=fan{params.P|int} VALUE={params.S|int} 45 | {% else %} 46 | SET_PIN PIN=fan{params.P|int} VALUE=255 47 | {% endif %} 48 | {% else %} 49 | {% if params.S is defined %} 50 | SET_PIN PIN=fan0 VALUE={params.S|int} 51 | {% else %} 52 | SET_PIN PIN=fan0 VALUE=255 53 | {% endif %} 54 | {% endif %} 55 | 56 | [gcode_macro M107] 57 | gcode: 58 | {% if params.P is defined %} 59 | SET_PIN PIN=fan{params.P|int} VALUE=0 60 | {% else %} 61 | SET_PIN PIN=fan0 VALUE=0 62 | SET_PIN PIN=fan1 VALUE=0 63 | {% endif %} 64 | 65 | 66 | 67 | # Filament Change 68 | ###################################################################### 69 | 70 | # M600: Filament Change. This macro will pause the printer, move the 71 | # tool to the change position, and retract the filament 50mm. Adjust 72 | # the retraction settings for your own extruder. After filament has 73 | # been changed, the print can be resumed from its previous position 74 | # with the "RESUME" gcode. 75 | 76 | [pause_resume] 77 | 78 | [gcode_macro M600] 79 | gcode: 80 | {% set X = params.X|default(0)|float %} 81 | {% set Y = params.Y|default(0)|float %} 82 | {% set Z = params.Z|default(10)|float %} 83 | SAVE_GCODE_STATE NAME=M600_state 84 | PAUSE_BASE 85 | G91 86 | G1 E-0.5 F2700 87 | G1 Z{Z} 88 | G90 89 | G1 X{X} Y{Y} F3000 90 | G91 91 | G1 E-50 F1000 92 | M117 Reload filament 93 | 94 | 95 | RESTORE_GCODE_STATE NAME=M600_state 96 | 97 | [gcode_macro PAUSE] 98 | description: Pause the actual running print 99 | rename_existing: PAUSE_BASE 100 | # change this if you need more or less extrusion 101 | variable_extrude: 1.0 102 | gcode: 103 | ##### read E from pause macro ##### 104 | {% set E = printer["gcode_macro PAUSE"].extrude|float %} 105 | ##### set park positon for x and y ##### 106 | # default is your max posion from your printer.cfg 107 | {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} 108 | {% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %} 109 | ##### calculate save lift position ##### 110 | {% set max_z = printer.toolhead.axis_maximum.z|float %} 111 | {% set act_z = printer.toolhead.position.z|float %} 112 | {% if act_z < (max_z - 2.0) %} 113 | {% set z_safe = 2.0 %} 114 | {% else %} 115 | {% set z_safe = max_z - act_z %} 116 | {% endif %} 117 | ##### end of definitions ##### 118 | PAUSE_BASE 119 | G91 120 | {% if printer.extruder.can_extrude|lower == 'true' %} 121 | G1 E-{E} F2100 122 | {% else %} 123 | {action_respond_info("Extruder not hot enough")} 124 | {% endif %} 125 | {% if "xyz" in printer.toolhead.homed_axes %} 126 | G1 Z{z_safe} F900 127 | G90 128 | G1 X{x_park} Y{y_park} F6000 129 | {% else %} 130 | {action_respond_info("Printer not homed")} 131 | {% endif %} 132 | 133 | [gcode_macro RESUME] 134 | description: Resume the actual running print 135 | rename_existing: RESUME_BASE 136 | gcode: 137 | ##### read E from pause macro ##### 138 | {% set E = printer["gcode_macro PAUSE"].extrude|float %} 139 | #### get VELOCITY parameter if specified #### 140 | {% if 'VELOCITY' in params|upper %} 141 | {% set get_params = ('VELOCITY=' + params.VELOCITY) %} 142 | {%else %} 143 | {% set get_params = "" %} 144 | {% endif %} 145 | ##### end of definitions ##### 146 | {% if printer.extruder.can_extrude|lower == 'true' %} 147 | G91 148 | G1 E{E} F2100 149 | {% else %} 150 | {action_respond_info("Extruder not hot enough")} 151 | {% endif %} 152 | RESUME_BASE {get_params} 153 | 154 | [gcode_macro CANCEL_PRINT] 155 | description: Cancel the actual running print 156 | rename_existing: CANCEL_PRINT_BASE 157 | gcode: 158 | G28 X 159 | M107 160 | G1 Y296 F1000 161 | TURN_OFF_HEATERS 162 | CANCEL_PRINT_BASE 163 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sovol-SV04-Klipper-config 2 | 3 | It was hard to find any information on how to set up klipper for Sovlo SV04 but after some time i was able to came up with this config. 4 | Everything seems to be working allright except for mirror and duplication modes (im still trying to figure it out, i know it's possible) 5 | -------------------------------------------------------------------------------- /printer.cfg: -------------------------------------------------------------------------------- 1 | # This file contains pin mappings for the Creality "v5.2.1" board. To 2 | # use this config, during "make menuconfig" select the STM32F103 with 3 | # a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication. 4 | 5 | # Flash this firmware by copying "out/klipper.bin" to a SD card and 6 | # turning on the printer with the card inserted. The firmware 7 | # filename must end in ".bin" and must not match the last filename 8 | # that was flashed. 9 | 10 | [include Macros.cfg] 11 | [virtual_sdcard] 12 | path: ~/gcode_files 13 | [display_status] 14 | #[pause_resume] 15 | 16 | [stepper_x] 17 | step_pin: PD15 18 | dir_pin: !PD14 19 | enable_pin: !PC7 20 | microsteps: 16 21 | rotation_distance: 50 22 | endstop_pin: !PD10 23 | position_endstop: -62 24 | position_min: -62 25 | position_max: 302 26 | homing_speed: 150 27 | second_homing_speed: 25 28 | 29 | [dual_carriage] 30 | axis: x 31 | step_pin: PE9 32 | dir_pin: !PE8 33 | enable_pin: !PE11 34 | microsteps: 16 35 | rotation_distance: 50 36 | endstop_pin: !PE15 37 | position_endstop: 362 38 | position_min: -2 39 | position_max: 362 40 | homing_speed: 150 41 | second_homing_speed: 25 42 | 43 | [stepper_y] 44 | step_pin: PB7 45 | dir_pin: PB6 46 | enable_pin: !PB9 47 | microsteps: 16 48 | rotation_distance: 40 49 | endstop_pin: !PE0 50 | position_endstop: 0 51 | position_max: 305 52 | homing_speed: 100 53 | second_homing_speed: 25 54 | 55 | [stepper_z] 56 | step_pin: PB3 57 | dir_pin: !PD7 58 | enable_pin: !PB5 59 | microsteps: 16 60 | rotation_distance: 8 61 | endstop_pin: !PE1 62 | position_min: -2 63 | position_max: 400 64 | endstop_pin: probe:z_virtual_endstop 65 | 66 | [stepper_z1] 67 | step_pin: PA7 68 | dir_pin: !PA6 69 | enable_pin: !PC5 70 | microsteps: 16 71 | rotation_distance: 8 72 | endstop_pin: !PE1 73 | endstop_pin: probe:z_virtual_endstop 74 | 75 | [z_tilt] 76 | z_positions: 10, 150 77 | 290, 150 78 | points: 10, 150 79 | 290, 150 80 | speed: 100 81 | horizontal_move_z: 5 82 | retries: 5 83 | retry_tolerance: 0.05 84 | 85 | [bltouch] 86 | control_pin: PD13 87 | sensor_pin: ^PD12 88 | x_offset: 0 89 | y_offset: 25 90 | #z_offset: 0.1 91 | 92 | [bed_mesh] 93 | speed: 100 94 | horizontal_move_z: 5 95 | mesh_min: 15, 40 96 | mesh_max: 285, 280 97 | probe_count: 7 98 | fade_start: 1.0 99 | fade_end: 10 100 | algorithm: bicubic 101 | bicubic_tension: .2 102 | 103 | [safe_z_home] 104 | home_xy_position: 150, 150 105 | speed: 150 106 | z_hop: 10 107 | z_hop_speed: 5 108 | 109 | [extruder] 110 | step_pin: PD1 111 | dir_pin: !PD0 112 | enable_pin: !PD4 113 | microsteps: 16 114 | rotation_distance: 24.09 115 | nozzle_diameter: 0.600 116 | filament_diameter: 1.750 117 | heater_pin: PA1 118 | sensor_type: EPCOS 100K B57560G104F 119 | sensor_pin: PA4 120 | #control: pid 121 | #pid_Kp: 21.527 122 | #pid_Ki: 1.063 123 | #pid_Kd: 108.982 124 | min_temp: 0 125 | max_temp: 250 126 | gear_ratio: 3:1 127 | max_extrude_only_distance: 500.0 128 | 129 | [extruder1] 130 | step_pin: PB1 131 | dir_pin: !PB0 132 | enable_pin: !PE7 133 | microsteps: 16 134 | rotation_distance: 24.09 135 | nozzle_diameter: 0.600 136 | filament_diameter: 1.750 137 | heater_pin: PA0 138 | sensor_type: EPCOS 100K B57560G104F 139 | sensor_pin: PA5 140 | #control: pid 141 | #pid_Kp: 22.2 142 | #pid_Ki: 1.08 143 | #pid_Kd: 114 144 | min_temp: 0 145 | max_temp: 250 146 | gear_ratio: 3:1 147 | max_extrude_only_distance: 500.0 148 | 149 | [filament_switch_sensor Left] 150 | pause_on_runout: False 151 | runout_gcode: M600 152 | switch_pin: PE5 153 | 154 | [filament_switch_sensor Right] 155 | pause_on_runout: False 156 | runout_gcode: M600 157 | switch_pin: PE6 158 | 159 | [output_pin fan0] 160 | pin:PB14 161 | pwm: True 162 | cycle_time: 0.0100 163 | hardware_pwm: false 164 | value: 0.05 165 | scale: 255 166 | shutdown_value: 0.0 167 | 168 | [output_pin fan1] 169 | pin: PB12 170 | pwm: True 171 | cycle_time: 0.0100 172 | hardware_pwm: false 173 | value: 0.05 174 | scale: 255 175 | shutdown_value: 0.0 176 | 177 | [heater_bed] 178 | heater_pin: PA2 179 | sensor_type: EPCOS 100K B57560G104F 180 | sensor_pin: PA3 181 | #control: pid 182 | #pid_Kp: 54.027 183 | #pid_Ki: 0.770 184 | #pid_Kd: 948.182 185 | min_temp: 0 186 | max_temp: 100 187 | 188 | [mcu] 189 | serial: /dev/serial/by-id/usb_serial_1 190 | restart_method: command 191 | 192 | [printer] 193 | kinematics: cartesian 194 | max_velocity: 200 195 | max_accel: 3000 196 | max_z_velocity: 20 197 | max_z_accel: 500 198 | square_corner_velocity: 5.0 199 | 200 | [temperature_sensor mcu_temp] 201 | sensor_type: temperature_mcu 202 | min_temp: 0 203 | max_temp: 100 204 | 205 | 206 | 207 | #*# <---------------------- SAVE_CONFIG ----------------------> 208 | #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. 209 | #*# 210 | #*# [bltouch] 211 | #*# z_offset = 1.660 212 | #*# 213 | #*# [bed_mesh default] 214 | #*# version = 1 215 | #*# points = 216 | #*# 0.197500, 0.222500, 0.212500, 0.187500, 0.185000, 0.212500, 0.215000 217 | #*# 0.150000, 0.175000, 0.142500, 0.145000, 0.162500, 0.157500, 0.142500 218 | #*# 0.012500, 0.097500, 0.097500, 0.100000, 0.127500, 0.127500, 0.127500 219 | #*# 0.047500, 0.072500, 0.047500, 0.027500, 0.085000, 0.075000, 0.072500 220 | #*# 0.115000, 0.097500, 0.082500, 0.042500, 0.092500, 0.055000, 0.092500 221 | #*# 0.190000, 0.150000, 0.065000, 0.092500, 0.052500, 0.112500, 0.122500 222 | #*# 0.370000, 0.235000, 0.152500, 0.115000, 0.105000, 0.137500, 0.287500 223 | #*# tension = 0.2 224 | #*# min_x = 15.0 225 | #*# algo = bicubic 226 | #*# y_count = 7 227 | #*# mesh_y_pps = 2 228 | #*# min_y = 40.0 229 | #*# x_count = 7 230 | #*# max_y = 280.0 231 | #*# mesh_x_pps = 2 232 | #*# max_x = 285.0 233 | #*# 234 | #*# [extruder] 235 | #*# control = pid 236 | #*# pid_kp = 25.693 237 | #*# pid_ki = 1.586 238 | #*# pid_kd = 104.056 239 | #*# 240 | #*# [extruder1] 241 | #*# control = pid 242 | #*# pid_kp = 22.947 243 | #*# pid_ki = 1.093 244 | #*# pid_kd = 120.472 245 | #*# 246 | #*# [heater_bed] 247 | #*# control = pid 248 | #*# pid_kp = 70.300 249 | #*# pid_ki = 1.065 250 | #*# pid_kd = 1159.958 251 | --------------------------------------------------------------------------------