├── .gitattributes ├── klipper-010292.bin ├── base.cfg ├── bed_mesh.cfg ├── print_start-end.cfg ├── printer.cfg ├── macros.cfg └── mainsail.cfg /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /klipper-010292.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clmnsr/Klipper-for-Sovol-SV01-Pro/HEAD/klipper-010292.bin -------------------------------------------------------------------------------- /base.cfg: -------------------------------------------------------------------------------- 1 | #### Included base config files in printer.cfg 2 | [include /home/pi/SV01PRO_data/config/macros.cfg] 3 | [include /home/pi/SV01PRO_data/config/bed_mesh.cfg] 4 | [include /home/pi/SV01PRO_data/config/print_start-end.cfg] 5 | #[include /home/pi/SV01PRO_data/config/timelapse.cfg] 6 | -------------------------------------------------------------------------------- /bed_mesh.cfg: -------------------------------------------------------------------------------- 1 | #### Make and save a bed mesh at your requested bed temp 2 | [bed_mesh] 3 | algorithm: bicubic 4 | speed: 120 5 | horizontal_move_z: 5 6 | mesh_min: 35, 6 7 | mesh_max: 255, 198 8 | probe_count: 4, 4 9 | fade_start: 1 10 | fade_end: 10 11 | fade_target: 0 12 | 13 | [gcode_macro BED_MESH] 14 | gcode: 15 | G28 16 | M117 Heating bed... 17 | M190 S{params.BED_TEMP|default(70, true)} 18 | TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={params.BED_TEMP|default(70, true)} 19 | M117 Bed calibrate... 20 | G28 Z 21 | M117 Bed mesh... 22 | BED_MESH_CALIBRATE 23 | G0 X1 Y115 Z50 F10000 24 | BED_MESH_PROFILE save=SV01PRO_mesh 25 | SAVE_CONFIG -------------------------------------------------------------------------------- /print_start-end.cfg: -------------------------------------------------------------------------------- 1 | ###Use PRINT_START and PRINT_END for the slicer starting and ending script - please customize for your slicer of choice 2 | [gcode_macro START_PRINT] 3 | gcode: 4 | #Get pressure advance from Slicer GCODE 5 | SET_PRESSURE_ADVANCE ADVANCE={ params.PA|default(0.00) } 6 | SET_PRESSURE_ADVANCE SMOOTH_TIME={ params.PA|default(0.00) } 7 | #Get Bed and Extruder temperature from Slicer GCode 8 | {% set BED_TEMP = params.BED_TEMP|default(60)|float %} 9 | {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} 10 | #Reset Feed- and Flowrate 11 | M220 S100 12 | M221 S100 13 | #Preheat nozzle and bed 14 | M104 S{EXTRUDER_TEMP} T0 15 | M140 S{BED_TEMP} 16 | #Home 17 | G28 18 | #Load Bedmesh 19 | BED_MESH_PROFILE LOAD=default 20 | #Heat nozzle and bed 21 | M190 S{BED_TEMP} 22 | M109 S{EXTRUDER_TEMP} T0 23 | #Precondition extruder 24 | G92 E0 25 | G1 Z2.0 F3000 26 | G1 X15 Y20 Z0.28 F5000.0 27 | G1 X15 Y200.0 Z0.28 F1500.0 E15 28 | G1 X15 Y200.0 Z0.28 F5000.0 29 | G1 X15 Y20 Z0.28 F1500.0 E30 30 | G92 E0 31 | G1 Z2.0 F3000 32 | 33 | [gcode_macro END_PRINT] 34 | gcode: 35 | # Turn off bed, extruder, and fan 36 | M140 S0 37 | M104 S0 38 | M106 S0 39 | # Move nozzle away from print while retracting 40 | G91 41 | G1 X-2 Y-2 E-3 F300 42 | # Raise nozzle by 10mm 43 | G1 Z10 F3000 44 | G90 45 | # Disable steppers 46 | M84 -------------------------------------------------------------------------------- /printer.cfg: -------------------------------------------------------------------------------- 1 | # This file contains pin mappings for the stock 2020 Creality Ender 3 2 | # V2. To use this config, during "make menuconfig" select the 3 | # STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9) 4 | # communication. 5 | 6 | # If you prefer a direct serial connection, in "make menuconfig" 7 | # select "Enable extra low-level configuration options" and select 8 | # serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC 9 | # cable used for the LCD module as follows: 10 | # 3: Tx, 4: Rx, 9: GND, 10: VCC 11 | 12 | # Flash this firmware by copying "out/klipper.bin" to a SD card and 13 | # turning on the printer with the card inserted. The firmware 14 | # filename must end in ".bin" and must not match the last filename 15 | # that was flashed. 16 | 17 | # See docs/Config_Reference.md for a description of parameters. 18 | 19 | [include mainsail.cfg] 20 | [include base.cfg] 21 | 22 | [mcu] 23 | serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 24 | restart_method: command 25 | 26 | [printer] 27 | kinematics: cartesian 28 | max_accel: 1500 29 | max_accel_to_decel: 1500 30 | square_corner_velocity: 10.0 31 | max_velocity: 200 32 | max_z_velocity: 5 33 | max_z_accel: 150 34 | 35 | [stepper_x] 36 | step_pin: PC2 37 | dir_pin: PB9 38 | enable_pin: !PC3 39 | microsteps: 16 40 | rotation_distance: 40 41 | endstop_pin: ^PA5 42 | position_endstop: 0 43 | position_max: 280 44 | homing_speed: 50 45 | 46 | [stepper_y] 47 | step_pin: PB8 48 | dir_pin: PB7 49 | enable_pin: !PC3 50 | microsteps: 16 51 | rotation_distance: 40 52 | endstop_pin: ^PA6 53 | position_endstop: 0 54 | position_max: 240 55 | homing_speed: 50 56 | 57 | [stepper_z] 58 | step_pin: PB6 59 | dir_pin: !PB5 60 | enable_pin: !PC3 61 | microsteps: 16 62 | rotation_distance: 8 63 | endstop_pin: probe:z_virtual_endstop #^PA7 64 | #position_endstop: 0.0 65 | position_max: 300 66 | position_min: -3 67 | 68 | [extruder] 69 | max_extrude_only_distance: 50.0 70 | step_pin: PB4 71 | dir_pin: PB3 72 | enable_pin: !PC3 73 | microsteps: 16 74 | rotation_distance: 7.55 75 | nozzle_diameter: 0.400 76 | filament_diameter: 1.750 77 | heater_pin: PA1 78 | sensor_type: EPCOS 100K B57560G104F 79 | sensor_pin: PC5 80 | #control: pid 81 | #pid_kp = 27.092 82 | #pid_ki = 1.627 83 | #pid_kd = 112.768 84 | min_temp: 0 85 | max_temp: 260 86 | min_extrude_temp: 0 87 | 88 | [heater_bed] 89 | heater_pin: PA2 90 | sensor_type: EPCOS 100K B57560G104F 91 | sensor_pin: PC4 92 | #control: pid 93 | #pid_kp = 69.892 94 | #pid_ki = 1.335 95 | #pid_kd = 914.718 96 | min_temp: 0 97 | max_temp: 110 98 | 99 | [fan] 100 | pin: PA0 101 | 102 | [bltouch] 103 | sensor_pin: ^PB1 104 | control_pin: PB0 105 | x_offset: 27.5 106 | y_offset: -20 107 | #x_offset: -34.0 108 | #y_offset: -3.5 109 | #z_offset: 1.35 #1.40 110 | 111 | [safe_z_home] 112 | home_xy_position: 117.5,117.5 # Change coordinates to the center of your print bed 113 | speed: 50 114 | z_hop: 10 # Move up 10mm 115 | z_hop_speed: 5 116 | 117 | [bed_mesh] 118 | algorithm: bicubic 119 | speed: 120 120 | horizontal_move_z: 5 121 | mesh_min: 35, 6 122 | mesh_max: 255, 198 123 | probe_count: 4, 4 124 | 125 | [temperature_sensor Raspberry] 126 | sensor_type: temperature_host 127 | min_temp: 0 128 | max_temp: 80 129 | 130 | #*# <---------------------- SAVE_CONFIG ----------------------> 131 | #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. 132 | #*# 133 | #*# [extruder] 134 | #*# control = pid 135 | #*# pid_kp = 27.092 136 | #*# pid_ki = 1.627 137 | #*# pid_kd = 112.768 138 | #*# 139 | #*# [bltouch] 140 | #*# z_offset = 1.705 141 | #*# 142 | #*# [bed_mesh default] 143 | #*# version = 1 144 | #*# points = 145 | #*# 0.022500, 0.020000, 0.057500, 0.112500 146 | #*# -0.030000, -0.037500, -0.010000, 0.070000 147 | #*# -0.035000, -0.032500, 0.025000, 0.115000 148 | #*# 0.017500, -0.002500, 0.027500, 0.070000 149 | #*# tension = 0.2 150 | #*# min_x = 35.0 151 | #*# algo = bicubic 152 | #*# y_count = 4 153 | #*# mesh_y_pps = 2 154 | #*# min_y = 6.0 155 | #*# x_count = 4 156 | #*# max_y = 198.0 157 | #*# mesh_x_pps = 2 158 | #*# max_x = 254.99 159 | #*# 160 | #*# [heater_bed] 161 | #*# control = pid 162 | #*# pid_kp = 69.892 163 | #*# pid_ki = 1.335 164 | #*# pid_kd = 914.718 165 | #*# 166 | #*# [bed_mesh SV01PRO_mesh] 167 | #*# version = 1 168 | #*# points = 169 | #*# 0.055000, 0.000000, 0.025000, 0.065000 170 | #*# -0.005000, -0.047500, -0.027500, 0.042500 171 | #*# -0.002500, -0.042500, 0.005000, 0.085000 172 | #*# 0.047500, -0.010000, 0.005000, 0.035000 173 | #*# x_count = 4 174 | #*# y_count = 4 175 | #*# mesh_x_pps = 2 176 | #*# mesh_y_pps = 2 177 | #*# algo = bicubic 178 | #*# tension = 0.2 179 | #*# min_x = 35.0 180 | #*# max_x = 254.99 181 | #*# min_y = 6.0 182 | #*# max_y = 198.0 183 | -------------------------------------------------------------------------------- /macros.cfg: -------------------------------------------------------------------------------- 1 | ### CURA SLICER SETTINGS 2 | 3 | [gcode_macro M204] 4 | rename_existing: M204.1 5 | gcode: 6 | {% set f = params.F|default(0.5)|float %} 7 | 8 | {% if 'S' in params %} 9 | {% set s = params.S|float %} 10 | SET_VELOCITY_LIMIT ACCEL={s} ACCEL_TO_DECEL={ s * f } 11 | {% else %} 12 | {% if 'P' in params %} 13 | {% set p = params.P|float %} 14 | {% if 'T' in params %} 15 | {% set t = params.T|float %} 16 | {% if p < t %} 17 | SET_VELOCITY_LIMIT ACCEL={p} ACCEL_TO_DECEL={ p * f } 18 | {% else %} 19 | SET_VELOCITY_LIMIT ACCEL={t} ACCEL_TO_DECEL={ t * f } 20 | {% endif %} 21 | {% else %} 22 | SET_VELOCITY_LIMIT ACCEL={p} ACCEL_TO_DECEL={ p * f } 23 | {% endif %} 24 | {% elif 'T' in params %} 25 | {% set t = params.T|float %} 26 | SET_VELOCITY_LIMIT ACCEL={t} ACCEL_TO_DECEL={ t * f } 27 | {% endif %} 28 | {% endif %} 29 | 30 | [gcode_macro M205] 31 | description: Sets square corner velocity. 32 | Usage: M203 [X] [Y] 33 | gcode: 34 | {% if 'X' in params or 'Y' in params %} 35 | SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY="{ 36 | (params.X|default(0)|float, params.Y|default(0)|float)|min}" 37 | {% else %} 38 | SET_VELOCITY_LIMIT 39 | {% endif %} 40 | 41 | ### FILAMENT 42 | 43 | [gcode_macro LOAD_FILAMENT] 44 | gcode: 45 | SAVE_GCODE_STATE NAME=load_state 46 | G91 47 | {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} 48 | M117 Heating... 49 | M104 S{params.TEMP|default(220, true)} 50 | TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} 51 | {% endif %} 52 | M117 Loading filament... 53 | G0 E65 F400 54 | G4 P1000 55 | G0 E40 F100 56 | M400e 57 | M117 Filament loaded! 58 | RESTORE_GCODE_STATE NAME=load_state 59 | 60 | [gcode_macro UNLOAD_FILAMENT] 61 | gcode: 62 | SAVE_GCODE_STATE NAME=unload_state 63 | G91 64 | {% if params.TEMP is defined or printer.extruder.can_extrude|lower == 'false' %} 65 | M117 Heating... 66 | M104 S{params.TEMP|default(220, true)} 67 | TEMPERATURE_WAIT SENSOR=extruder MINIMUM={params.TEMP|default(220, true)} 68 | {% endif %} 69 | M117 Unloading filament... 70 | G0 E-5 F3000 71 | G4 P3000 72 | G0 E5 F3000 73 | G0 E-15 F3000 74 | G0 E-60 F300 75 | M117 Filament unloaded! 76 | RESTORE_GCODE_STATE NAME=unload_state 77 | 78 | [gcode_macro FILAMENT_CHANGE] 79 | gcode: 80 | {% set X = params.X|default(50)|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 85 | G91 86 | G1 E-.8 F2700 87 | G1 Z{Z} 88 | G90 89 | G1 X{X} Y{Y} F3000 90 | G91 91 | G1 E-50 F1000 92 | RESTORE_GCODE_STATE NAME=M600_state 93 | 94 | [gcode_macro SET_FILAMENT_PROFILE] 95 | gcode: 96 | {% if params.TYPE|default("PLA") == "PLA" %} 97 | PRINT MSG="Set filament profile : PLA" OUTPUT_TARGET=1 98 | # M221 S91 ; Tunned flow 99 | SET_PRESSURE_ADVANCE ADVANCE=0.05 100 | {% elif params.TYPE|default("PLA") == "PETG" %} 101 | PRINT MSG="Set filament profile : PETG" OUTPUT_TARGET=1 102 | # M221 S91 ; Tunned flow 103 | SET_PRESSURE_ADVANCE ADVANCE=0.08 104 | {% elif params.TYPE|default("PLA") == "ABS" %} 105 | PRINT MSG="Set filament profile : ABS" OUTPUT_TARGET=1 106 | # M221 S91 ; Tunned flow 107 | SET_PRESSURE_ADVANCE ADVANCE=0.04 108 | {% elif params.TYPE|default("PLA") == "PC" %} 109 | PRINT MSG="Set filament profile : PC" OUTPUT_TARGET=1 110 | # M221 S91 ; Tunned flow 111 | SET_PRESSURE_ADVANCE ADVANCE=0.07 112 | {% elif params.TYPE|default("PLA") == "CFPC" %} 113 | PRINT MSG="Set filament profile : CFPC" OUTPUT_TARGET=1 114 | # M221 S91 ; Tunned flow 115 | SET_PRESSURE_ADVANCE ADVANCE=0.05 116 | {% else %} 117 | PRINT MSG="Set filament profile : Defalut" OUTPUT_TARGET=1 118 | # M221 S91 ; Tunned flow 119 | SET_PRESSURE_ADVANCE ADVANCE=0.00 120 | {% endif %} 121 | 122 | ### CALIBRATION 123 | 124 | [gcode_macro SCREWS_TILT] 125 | gcode: 126 | SCREWS_TILT_CALCULATE 127 | 128 | [gcode_macro Z_Offset] 129 | gcode: 130 | M117 Heating bed & nozzle... 131 | M104 S{150} 132 | M190 S{params.BED_TEMP|default(60, true)} 133 | G28 134 | TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={params.BED_TEMP|default(60, true)} 135 | PROBE_CALIBRATE 136 | 137 | [gcode_macro G29] 138 | variable_parameter_AREA_START : 0,0 139 | variable_parameter_AREA_END : 0,0 140 | gcode: 141 | BED_MESH_CLEAR 142 | BED_MESH_CALIBRATE AREA_START={params.AREA_START} AREA_END={params.AREA_END} 143 | G0 X150 Y150 Z150 F6000 144 | 145 | [gcode_macro M900] 146 | gcode: 147 | SET_PRESSURE_ADVANCE ADVANCE={params.K|default(0)|float} 148 | 149 | ### PRINT-STATUS 150 | 151 | [gcode_macro RESUME] 152 | rename_existing: RESUME_OLD 153 | gcode: 154 | G91 155 | G92 E0 156 | G1 E0.5 F300 157 | G90 158 | RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 159 | PRINT MSG="{printer.print_stats.filename}" 160 | RESUME_OLD 161 | 162 | [gcode_macro PAUSE] 163 | rename_existing: PAUSE_OLD 164 | gcode: 165 | SAVE_GCODE_STATE NAME=PAUSE_state 166 | PAUSE_OLD 167 | G91 168 | G92 E0 169 | G1 E-2 F300 170 | M125 171 | PRINT MSG="Paused!" 172 | 173 | [gcode_macro CANCEL_PRINT] 174 | rename_existing: BASE_CANCEL_PRINT 175 | gcode: 176 | M220 S100 177 | M221 S100 178 | G91 179 | {% if printer.extruder.temperature >= 170 %} 180 | G1 F1800 E-1 181 | {% endif %} 182 | {% if printer.toolhead.homed_axes == "xyz" %} 183 | G1 F6000 Z10 184 | G90 185 | G1 X10 Y221 F1000 186 | {% endif %} 187 | M106 S0 188 | CLEAR_PAUSE 189 | BASE_CANCEL_PRINT 190 | 191 | [gcode_macro SAVE_AT_END] 192 | variable_save: 0 193 | gcode: 194 | SET_GCODE_VARIABLE MACRO=SAVE_AT_END VARIABLE=save VALUE=1 195 | 196 | [gcode_macro SAVE_IF_SET] 197 | gcode: 198 | {% if printer["gcode_macro SAVE_AT_END"].save == 1 %} 199 | {action_respond_info("Saving was requested - saving and restarting now")} 200 | SAVE_CONFIG 201 | {% endif %} 202 | 203 | [gcode_macro DISABLE_XY_MOTOR] 204 | gcode: 205 | SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=0 206 | SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=0 207 | 208 | 209 | -------------------------------------------------------------------------------- /mainsail.cfg: -------------------------------------------------------------------------------- 1 | ## Mainsail klipper macro definitions 2 | ## 3 | ## Copyright (C) 2022 Alex Zellner 4 | ## 5 | ## This file may be distributed under the terms of the GNU GPLv3 license 6 | 7 | ## Version 2.0 8 | 9 | ## add [include mainsail.cfg] to your printer.cfg 10 | 11 | ## Customization: 12 | ## copy the following macro to your printer.cfg (outside of mainsail.cfg) 13 | 14 | #[gcode_macro _CLIENT_VARIABLE] 15 | #variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False] 16 | #variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X 17 | #variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y 18 | #variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position 19 | #variable_retract : 1.0 ; the value to retract while PAUSE 20 | #variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT 21 | #variable_speed_retract : 35.0 ; retract speed in mm/s 22 | #variable_unretract : 1.0 ; the value to unretract while RESUME 23 | #variable_speed_unretract : 35.0 ; unretract speed in mm/s 24 | #variable_speed_hop : 15.0 ; z move speed in mm/s 25 | #variable_speed_move : 100.0 ; move speed in mm/s 26 | #variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True,False] 27 | ## !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!! 28 | #variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False] 29 | #gcode: 30 | 31 | ## After you uncomment it add your custom values 32 | 33 | ## You now can use your PAUSE macro direct in your M600 here a short example: 34 | 35 | #[gcode_macro M600] 36 | #description: Filament change 37 | #gcode: PAUSE X=10 Y=10 Z_MIN=50 38 | 39 | ## That will park your head front left with a minimum hight of 50mm above the bed. If your head 40 | ## is already above 50mm it will use only the z_hop specified with dz. 41 | 42 | [virtual_sdcard] 43 | path: ~/printer_data/gcodes 44 | #on_error_gcode: CANCEL_PRINT 45 | 46 | [pause_resume] 47 | 48 | [display_status] 49 | 50 | [gcode_macro CANCEL_PRINT] 51 | description: Cancel the actual running print 52 | rename_existing: CANCEL_PRINT_BASE 53 | gcode: 54 | ##### get user parameters or use default ##### 55 | {% set allow_park = False if printer['gcode_macro _CLIENT_VARIABLE'] is not defined 56 | else False if printer['gcode_macro _CLIENT_VARIABLE'].park_at_cancel is not defined 57 | else True if printer['gcode_macro _CLIENT_VARIABLE'].park_at_cancel|lower == 'true' 58 | else False %} 59 | {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} 60 | {% set sp_retract = 2100 if not macro_found else client.speed_retract|default(35) * 60 %} 61 | ##### end of definitions ##### 62 | {% if not printer.pause_resume.is_paused and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {% endif %} 63 | {% if printer.extruder.can_extrude %} 64 | M83 65 | G1 E-{retract} F{sp_retract} 66 | {% if printer.gcode_move.absolute_extrude %} M82 {% endif %} 67 | {% else %} 68 | {action_respond_info("Extruder not hot enough")} 69 | {% endif %} 70 | TURN_OFF_HEATERS 71 | M106 S0 72 | CANCEL_PRINT_BASE 73 | 74 | [gcode_macro PAUSE] 75 | description: Pause the actual running print 76 | rename_existing: PAUSE_BASE 77 | gcode: 78 | PAUSE_BASE 79 | _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} 80 | 81 | [gcode_macro RESUME] 82 | description: Resume the actual running print 83 | rename_existing: RESUME_BASE 84 | gcode: 85 | ##### get user parameters or use default ##### 86 | {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} 87 | {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} 88 | {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} 89 | {% set use_fw_retract = False if not macro_found 90 | else False if client.use_fw_retract is not defined 91 | else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined 92 | else False %} 93 | {% set unretract = 1.0 if not macro_found else client.unretract|default(1.0)|abs %} 94 | {% set sp_unretract = 2100 if not macro_found else client.speed_unretract|default(35) * 60 %} 95 | {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} 96 | ##### end of definitions ##### 97 | {% if printer.extruder.can_extrude %} 98 | {% if use_fw_retract %} 99 | G11 100 | {% else %} 101 | M83 102 | G1 E{unretract} F{sp_unretract} 103 | {% if printer.gcode_move.absolute_extrude %} M82 {% endif %} 104 | {% endif %} 105 | {% else %} 106 | {action_respond_info("Extruder not hot enough %s" % use_fw_retract)} 107 | {% endif %} 108 | RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} 109 | 110 | [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] 111 | description: Helper: park toolhead used in PAUSE and CANCEL_PRINT 112 | gcode: 113 | ##### get user parameters or use default ##### 114 | {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} 115 | {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} 116 | {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} 117 | {% set use_custom = False if not macro_found 118 | else False if client.use_custom_pos is not defined 119 | else True if client.use_custom_pos|lower == 'true' 120 | else False %} 121 | {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} 122 | {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} 123 | {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} 124 | {% set use_fw_retract = False if not macro_found 125 | else False if client.use_fw_retract is not defined 126 | else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined 127 | else False %} 128 | {% set retract = 1.0 if not macro_found else client.retract|default(1.0)|abs %} 129 | {% set sp_retract = 2100 if not macro_found else client.speed_retract|default(35) * 60 %} 130 | {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} 131 | {% set sp_move = velocity * 60 if not macro_found else client.speed_move|default(velocity) * 60 %} 132 | ##### get config and toolhead values ##### 133 | {% set act = printer.toolhead.position %} 134 | {% set max = printer.toolhead.axis_maximum %} 135 | {% set cone = printer.toolhead.cone_start_z|default(max.z) %} ; hight as long the toolhead can reach max and min of an delta 136 | {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] 137 | else False %} 138 | ##### define park position ##### 139 | {% set z_min = params.Z_MIN|default(0)|float %} 140 | {% set z_park = [[(act.z + park_dz), z_min]|max, max.z]|min %} 141 | {% set x_park = params.X if params.X is defined 142 | else custom_park_x if use_custom 143 | else 0.0 if round_bed 144 | else (max.x - 5.0) %} 145 | {% set y_park = params.Y if params.Y is defined 146 | else custom_park_y if use_custom 147 | else (max.y - 5.0) if round_bed and z_park < cone 148 | else 0.0 if round_bed 149 | else (max.y - 5.0) %} 150 | ##### end of definitions ##### 151 | {% if printer.extruder.can_extrude %} 152 | {% if use_fw_retract %} 153 | G10 154 | {% else %} 155 | M83 156 | G1 E-{retract} F{sp_retract} 157 | {% if printer.gcode_move.absolute_extrude %} M82 {% endif %} 158 | {% endif %} 159 | {% else %} 160 | {action_respond_info("Extruder not hot enough")} 161 | {% endif %} 162 | {% if "xyz" in printer.toolhead.homed_axes %} 163 | G90 164 | G1 Z{z_park} F{sp_hop} 165 | G1 X{x_park} Y{y_park} F{sp_move} 166 | {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} 167 | {% else %} 168 | {action_respond_info("Printer not homed")} 169 | {% endif %} --------------------------------------------------------------------------------