Merge branch 'master' into sv06-plus

This commit is contained in:
Bassam Husain
2023-11-19 21:15:28 -05:00
5 changed files with 117 additions and 91 deletions

View File

@@ -56,7 +56,7 @@ I am creating these files for my personal use and cannot be held responsible for
Watch for releases and updates.
<img src="./images/githubstar.gif" width="500" alt='githubstar'/>
<img src="./images/githubstar.gif" width="500" alt='github star'/>
## Preface
@@ -64,8 +64,8 @@ Although I've made switching over to Klipper as easy as is possible, it can stil
## Before You Begin
- On the SV06 Plus, your screen will not work if you install Klipper. You can get it working again via the instructions found [here](https://github.com/fryc88/klipper-sv06plus-screen).
- Read this documentation _fully!_
- This entire page is a **13 minute read**. Save yourself _hours of troubleshooting_ and read this documentation **fully!**
- On the SV06 Plus, your screen will not work if you install Klipper. You can get it _mostly_ working again via the instructions found [here](https://github.com/fryc88/klipper-sv06plus-screen).
- Make sure your printer is in good physical condition, because print and travel speeds will be _a lot faster_ than they were before. Beginner's would be wise to go through the steps mentioned [here](https://github.com/bassamanator/everything-sovol-sv06/blob/main/initialsteps.md). Consider yourself warned.
- Follow the steps in order.
- If an error was reported at a step, do no proceed to the next step.
@@ -133,14 +133,18 @@ You can choose _either_ of the 2 following methods.
### Adjust Configuration with MCU Path
1. Find what port the `mcu` (printer motherboard) is connected to via `ls -l /dev/serial/by-id/` or `ls -l /dev/serial/by-path/`.
1. Find what port the `mcu` (printer motherboard) is connected to via **one** of the following commands:
- `ls /dev/serial/by-id/*`
- `ls /dev/serial/by-path/*`
1. The output will be something along the lines of
`lrwxrwxrwx 13 root root 22 Apr 11:10 usb-1a86_USB2.0-Serial-if00-port0 -> ../../ttyUSB0`.
2. `usb-1a86_USB2.0-Serial-if00-port0` is the relevant part.
3. Therefore, the full path to your `mcu` is either `/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0` or `/dev/serial/by-path/usb-1a86_USB2.0-Serial-if00-port0`, depending on the command you used to find the `mcu`.
2. Adjust the `[mcu]` section in `printer.cfg` accordingly. 🗒️ This is just an **example**:
- `/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0`
2. Adjust the `[mcu]` section in `printer.cfg` accordingly.
```yaml
# 🗒️ This is just an example
[mcu]
serial: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
restart_method: command
@@ -156,9 +160,13 @@ If the Klipper flash that you did earlier was successful, and you've done everyt
❗☠️ **Power off if there is a collision/problem** ☠️❗
💡 The ${\small{\textcolor{red}{\texttt{EMERGENCY STOP}}}}$ button in your dashboard works faster than hitting the power switch.
💡 Do a practice emergency stop.
💡 I recommend no filament be loaded for any of these steps.
🗒️ Find explanations for gcode commands at [https://marlinfw.org/](https://marlinfw.org/) and [https://www.klipper3d.org/](https://www.klipper3d.org/G-Codes.html).
🗒️ Find explanations for gcode commands: [https://marlinfw.org/](https://marlinfw.org/), [https://www.klipper3d.org/](https://www.klipper3d.org/G-Codes.html).
You will be pasting/typing these commands into the Mainsail/Fluidd console.
@@ -193,9 +201,10 @@ But first, adjust your slicer.
You need to adjust the start and end gcode in your slicer. The relevant macros are `PRINT_START` and `PRINT_END`. Find instructions [here](https://ellis3dp.com/Print-Tuning-Guide/articles/passing_slicer_variables.html#slicer-start-g-code).
If you would like to print a purge line before your print starts, at the end of your start gcode, on a new line add `PURGE_LINE`. 🗒️ This is just an **example**:
If you would like to print a purge line before your print starts, at the end of your start gcode, on a new line add `PURGE_LINE`.
```
```yaml
# 🗒️ This is just an example
PRINT_START ...
PURGE_LINE
```

View File

@@ -13,12 +13,13 @@ gcode:
{% set bed_mesh_min = printer.configfile.settings.bed_mesh.mesh_min %} # Get bed mesh min from printer.cfg
{% set bed_mesh_max = printer.configfile.settings.bed_mesh.mesh_max %} # Get bed mesh max from printer.cfg
{% set probe_count = printer.configfile.settings.bed_mesh.probe_count %} # Get probe count from printer.cfg
{% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} # Pull verbose setting from _KAMP_Settings
{% set probe_dock_enable = printer["gcode_macro _KAMP_Settings"].probe_dock_enable | abs %} # Pull probe dockable probe settings from _KAMP_Settings
{% set attach_macro = printer["gcode_macro _KAMP_Settings"].attach_macro | string %} # Pull attach probe command from _KAMP_Settings
{% set detach_macro = printer["gcode_macro _KAMP_Settings"].detach_macro | string %} # Pull detach probe command from _KAMP_Settings
{% set mesh_margin = printer["gcode_macro _KAMP_Settings"].mesh_margin | float %} # Pull mesh margin setting from _KAMP_Settings
{% set fuzz_amount = printer["gcode_macro _KAMP_Settings"].fuzz_amount | float %} # Pull fuzz amount setting from _KAMP_Settings
{% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} # Pull variables from _KAMP_Settings
{% set verbose_enable = kamp_settings.verbose_enable | abs %} # Pull verbose setting from _KAMP_Settings
{% set probe_dock_enable = kamp_settings.probe_dock_enable | abs %} # Pull probe dockable probe settings from _KAMP_Settings
{% set attach_macro = kamp_settings.attach_macro | string %} # Pull attach probe command from _KAMP_Settings
{% set detach_macro = kamp_settings.detach_macro | string %} # Pull detach probe command from _KAMP_Settings
{% set mesh_margin = kamp_settings.mesh_margin | float %} # Pull mesh margin setting from _KAMP_Settings
{% set fuzz_amount = kamp_settings.fuzz_amount | float %} # Pull fuzz amount setting from _KAMP_Settings
{% set probe_count = probe_count if probe_count|length > 1 else probe_count * 2 %} # If probe count is only a single number, convert it to 2. E.g. probe_count:7 = 7,7
{% set max_probe_point_distance_x = ( bed_mesh_max[0] - bed_mesh_min[0] ) / (probe_count[0] - 1) %} # Determine max probe point distance
{% set max_probe_point_distance_y = ( bed_mesh_max[1] - bed_mesh_min[1] ) / (probe_count[1] - 1) %} # Determine max probe point distance
@@ -28,10 +29,10 @@ gcode:
{% set y_max = all_points | map(attribute=1) | max | default(bed_mesh_max[1]) %} # Set y_max from largest object y point
{% set fuzz_range = range((0) | int, (fuzz_amount * 100) | int + 1) %} # Set fuzz_range between 0 and fuzz_amount
{% set adapted_x_min = (bed_mesh_min[0] + fuzz_amount - mesh_margin, x_min) | max - (fuzz_range | random / 100.0) %} # Adapt x_min to margin and fuzz constraints
{% set adapted_y_min = (bed_mesh_min[1] + fuzz_amount - mesh_margin, y_min) | max - (fuzz_range | random / 100.0) %} # Adapt y_min to margin and fuzz constraints
{% set adapted_x_max = (bed_mesh_max[0] - fuzz_amount + mesh_margin, x_max) | min + (fuzz_range | random / 100.0) %} # Adapt x_max to margin and fuzz constraints
{% set adapted_y_max = (bed_mesh_max[1] - fuzz_amount + mesh_margin, y_max) | min + (fuzz_range | random / 100.0) %} # Adapt y_max to margin and fuzz constraints
{% set adapted_x_min = x_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt x_min to margin and fuzz constraints
{% set adapted_y_min = y_min - mesh_margin - (fuzz_range | random / 100.0) %} # Adapt y_min to margin and fuzz constraints
{% set adapted_x_max = x_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt x_max to margin and fuzz constraints
{% set adapted_y_max = y_max + mesh_margin + (fuzz_range | random / 100.0) %} # Adapt y_max to margin and fuzz constraints
{% set adapted_x_min = [adapted_x_min , bed_mesh_min[0]] | max %} # Compare adjustments to defaults and choose max
{% set adapted_y_min = [adapted_y_min , bed_mesh_min[1]] | max %} # Compare adjustments to defaults and choose max
@@ -55,49 +56,56 @@ gcode:
{% set points_y = [points_y , probe_count[1]]|min %}
{% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations
{% if printer.exclude_object.objects != [] %}
{ action_respond_info( "Algorithm: {}.".format(
(algorithm),
)) }
{ action_respond_info( "Algorithm: {}.".format(
(algorithm),
)) }
{ action_respond_info("Default probe count: {},{}.".format(
(probe_count[0]),
(probe_count[1]),
)) }
{ action_respond_info("Default probe count: {},{}.".format(
(probe_count[0]),
(probe_count[1]),
)) }
{ action_respond_info("Adapted probe count: {},{}.".format(
(points_x),
(points_y),
)) }
{ action_respond_info("Adapted probe count: {},{}.".format(
(points_x),
(points_y),
)) }
{action_respond_info("Default mesh bounds: {}, {}.".format(
(bed_mesh_min[0],bed_mesh_min[1]),
(bed_mesh_max[0],bed_mesh_max[1]),
)) }
{action_respond_info("Default mesh bounds: {}, {}.".format(
(bed_mesh_min[0],bed_mesh_min[1]),
(bed_mesh_max[0],bed_mesh_max[1]),
)) }
{% if mesh_margin > 0 %}
{action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format(
(mesh_margin),
(mesh_margin),
)) }
{% else %}
{action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{% if mesh_margin > 0 %}
{action_respond_info("Mesh margin is {}, mesh bounds extended by {}mm.".format(
(mesh_margin),
(mesh_margin),
)) }
{% else %}
{action_respond_info("Mesh margin is 0, margin not increased.")}
{% endif %}
{% if fuzz_amount > 0 %}
{action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format(
(fuzz_amount),
)) }
{% else %}
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")}
{% endif %}
{% if fuzz_amount > 0 %}
{action_respond_info("Mesh point fuzzing enabled, points fuzzed up to {}mm.".format(
(fuzz_amount),
)) }
{% else %}
{action_respond_info("Fuzz amount is 0, mesh points not fuzzed.")}
{% endif %}
{ action_respond_info("Adapted mesh bounds: {}, {}.".format(
(adapted_x_min, adapted_y_min),
(adapted_x_max, adapted_y_max),
)) }
{ action_respond_info("Adapted mesh bounds: {}, {}.".format(
(adapted_x_min, adapted_y_min),
(adapted_x_max, adapted_y_max),
)) }
{action_respond_info("KAMP adjustments successful. Happy KAMPing!")}
{action_respond_info("KAMP adjustments successful. Happy KAMPing!")}
{% else %}
{action_respond_info("No objects detected! Check your gcode and make sure that EXCLUDE_OBJECT_DEFINE is happening before BED_MESH_CALIBRATE is called. Defaulting to regular meshing.")}
G4 P5000 # Wait 5 seconds to make error more visible
{% endif %}
{% endif %}

View File

@@ -1,5 +1,6 @@
# Below you can include specific configuration files depending on what you want KAMP to do:
# NOTE bassamanator: uncomment the functionality that you want to use from KAMP
[include ./Adaptive_Meshing.cfg] # Include to enable adaptive meshing configuration.
# [include ./Line_Purge.cfg] # Include to enable adaptive line purging configuration.
# [include ./Voron_Purge.cfg] # Include to enable adaptive Voron logo purging configuration.

View File

@@ -1,4 +1,4 @@
[gcode_macro Smart_Park]
[gcode_macro SMART_PARK]
description: Parks your printhead near the print area for pre-print hotend heating.
gcode:
@@ -8,14 +8,18 @@ gcode:
{% set verbose_enable = kamp_settings.verbose_enable | abs %} # Set verbosity
{% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} # Create center point of x for fallback
{% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} # Create center point of y for fallback
{% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %}
{% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %}
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Gather all object points
{% set x_min = all_points | map(attribute=0) | min | default(center_x) %} # Set x_min from smallest object x point
{% set y_min = all_points | map(attribute=1) | min | default(center_y) %} # Set y_min from smallest object y point
{% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} # Set travel speed from config
{% if purge_margin > 0 and x_min != center_x and y_min != center_y %} # If objects are detected and purge margin
{% set x_min = [ x_min - purge_margin , x_min ] | max %} # value is greater than 0, move
{% set y_min = [ y_min - purge_margin , y_min ] | max %} # to purge location + margin
{% set x_min = [ x_min - purge_margin , x_min ] | min %} # value is greater than 0, move
{% set y_min = [ y_min - purge_margin , y_min ] | min %} # to purge location + margin
{% set x_min = [ x_min , axis_minimum_x ] | max %}
{% set y_min = [ y_min , axis_minimum_y ] | max %}
{% endif %}
{% if verbose_enable == True %} # Verbose park location
@@ -27,5 +31,8 @@ gcode:
{% endif %}
{% if printer.toolhead.position.z < z_height %}
G0 Z{z_height} # Move Z to park height if current Z position is lower than z_height
{% endif %}
G0 X{x_min} Y{y_min} F{travel_speed} # Move near object area
G0 Z{z_height} # Move Z to park height

View File

@@ -15,12 +15,13 @@ gcode:
{% endif %}
# Get purge settings from _Kamp_Settings
{% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %}
{% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %}
{% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %}
{% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %}
{% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %}
{% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %}
{% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %}
{% set verbose_enable = kamp_settings.verbose_enable | abs %}
{% set purge_height = kamp_settings.purge_height | float %}
{% set tip_distance = kamp_settings.tip_distance | float %}
{% set purge_margin = kamp_settings.purge_margin | float %}
{% set purge_amount = kamp_settings.purge_amount | float %}
{% set flow_rate = kamp_settings.flow_rate | float %}
{% set size = 10 | float %}
# Calculate purge origins and centers from objects
@@ -58,33 +59,33 @@ gcode:
{action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")}
{% endif %}
SAVE_GCODE_STATE NAME=Prepurge_State # Create gcode state
SAVE_GCODE_STATE NAME=Prepurge_State # Create gcode state
G92 E0 # Reset extruder
G0 F{travel_speed} # Set travel speed
G90 # Absolute positioning
G0 X{purge_x_origin} Y{purge_y_origin+size/2} # Move to purge position
G0 Z{purge_height} # Move to purge Z height
M83 # Relative extrusion mode
G1 E{tip_distance} F{purge_move_speed} # Move tip of filament to nozzle
G1 X{purge_x_origin+size*0.289} Y{purge_y_origin+size} E{purge_amount/4} F{purge_move_speed}# Purge first line of logo
G1 E-.5 F2100 # Retract
G0 Z{purge_height*2} # Z hop
G0 X{purge_x_origin+size*0.789} Y{purge_y_origin+size} # Move to second purge line origin
G0 Z{purge_height} # Move to purge Z height
G1 E.5 F2100 # Recover
G1 X{purge_x_origin+size*0.211} Y{purge_y_origin} E{purge_amount/2} F{purge_move_speed} # Purge second line of logo
G1 E-.5 F2100 # Retract
G0 Z{purge_height*2} # Z hop
G0 X{purge_x_origin+size*0.711} Y{purge_y_origin} # Move to third purge line origin
G0 Z{purge_height} # Move to purge Z height
G1 E.5 F2100 # Recover
G1 X{purge_x_origin+size} Y{purge_y_origin+size/2} E{purge_amount/4} F{purge_move_speed} # Purge third line of logo
G1 E-.5 F2100 # Retract
G92 E0 # Reset extruder distance
M82 # Absolute extrusion mode
G0 Z{purge_height*2} F{travel_speed} # Z hop
G92 E0 # Reset extruder
G0 F{travel_speed} # Set travel speed
G90 # Absolute positioning
G0 X{purge_x_origin} Y{purge_y_origin+size/2} # Move to purge position
G0 Z{purge_height} # Move to purge Z height
M83 # Relative extrusion mode
G1 E{tip_distance} F{purge_move_speed} # Move tip of filament to nozzle
G1 X{purge_x_origin+size*0.289} Y{purge_y_origin+size} E{purge_amount/4} F{purge_move_speed} # Purge first line of logo
{RETRACT} # Retract
G0 Z{purge_height*2} # Z hop
G0 X{purge_x_origin+size*0.789} Y{purge_y_origin+size} # Move to second purge line origin
G0 Z{purge_height} # Move to purge Z height
{UNRETRACT} # Recover
G1 X{purge_x_origin+size*0.211} Y{purge_y_origin} E{purge_amount/2} F{purge_move_speed} # Purge second line of logo
{RETRACT} # Retract
G0 Z{purge_height*2} # Z hop
G0 X{purge_x_origin+size*0.711} Y{purge_y_origin} # Move to third purge line origin
G0 Z{purge_height} # Move to purge Z height
{UNRETRACT} # Recover
G1 X{purge_x_origin+size} Y{purge_y_origin+size/2} E{purge_amount/4} F{purge_move_speed} # Purge third line of logo
{RETRACT} # Retract
G92 E0 # Reset extruder distance
M82 # Absolute extrusion mode
G0 Z{purge_height*2} F{travel_speed} # Z hop
RESTORE_GCODE_STATE NAME=Prepurge_State # Restore gcode state
RESTORE_GCODE_STATE NAME=Prepurge_State # Restore gcode state
{% endif %}