New Backup on boot - 04/08/25 - 04:12:30

This commit is contained in:
miguel 2025-08-04 04:13:13 +01:00
commit 7799be0fb3
33 changed files with 2648 additions and 0 deletions

9
.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
.env
secrets.conf
*.swp
*.tmp
printer-[0-9]*_[0-9]*.cfg
*.bak
*.bkp
*.csv
*.zip

4
README.md Normal file
View file

@ -0,0 +1,4 @@
# Klipper-Backup 💾
Klipper backup script for manual or automated GitHub backups
This backup is provided by [Klipper-Backup](https://github.com/Staubgeborener/klipper-backup).

View file

@ -0,0 +1,8 @@
[bed_mesh]
speed: 200
horizontal_move_z: 5
mesh_min: 50, 50
mesh_max: 300, 300
probe_count: 5, 5

View file

@ -0,0 +1,77 @@
################################################
###### STANDARD INPUT_SHAPER CALIBRATIONS ######
################################################
# Written by Frix_x#0161 #
# @version: 1.3
# CHANGELOG:
# v1.3: added possibility to override the default parameters
# v1.2: added EXCITATE_AXIS_AT_FREQ to hold a specific excitating frequency on an axis and diagnose mechanical problems
# v1.1: added M400 to validate that the files are correctly saved to disk
# v1.0: first version of the automatic input shaper workflow
# -------------------------------------------------------------------------------------------------------------------------
# If you want to use it into your own config, please install it as a standalone macro as described in the
# installation section of this file: docs > features > is_workflow.md
# -------------------------------------------------------------------------------------------------------------------------
### What is it ? ###
# This macro helps you to configure the input shaper algorithm of Klipper by running the tests sequencially and calling an automatic script
# that generate the graphs, manage the files and so on. It's basically a fully automatic input shaper calibration workflow.
# Results can be found in your config folder using FLuidd/Maisail file manager.
# The goal is to make it easy to set, share and use it.
# Usage:
# 1. Call the AXES_SHAPER_CALIBRATION macro, wait for it to end and compute the graphs. Then look for the results in the results folder.
# 2. Call the BELTS_SHAPER_CALIBRATION macro, wait for it to end and compute the graphs. Then look for the results in the results folder.
# 3. If you find out some strange noise, you can use the EXCITATE_AXIS_AT_FREQ macro to diagnose the origin
[gcode_macro AXES_SHAPER_CALIBRATION]
description: Run standard input shaper test for all axes
gcode:
{% set verbose = params.VERBOSE|default(true) %}
{% set min_freq = params.FREQ_START|default(5)|float %}
{% set max_freq = params.FREQ_END|default(133.3)|float %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=X FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=Y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=SHAPER
[gcode_macro BELTS_SHAPER_CALIBRATION]
description: Run custom demi-axe test to analyze belts on CoreXY printers
gcode:
{% set verbose = params.VERBOSE|default(true) %}
{% set min_freq = params.FREQ_START|default(5)|float %}
{% set max_freq = params.FREQ_END|default(133.33)|float %}
{% set hz_per_sec = params.HZ_PER_SEC|default(1)|float %}
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data NAME=b FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data NAME=a FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec}
M400
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=BELTS
[gcode_macro EXCITATE_AXIS_AT_FREQ]
description: Maintain a specified input shaper excitating frequency for some time to diagnose vibrations
gcode:
{% set FREQUENCY = params.FREQUENCY|default(25)|int %}
{% set TIME = params.TIME|default(10)|int %}
{% set AXIS = params.AXIS|default("x")|string|lower %}
TEST_RESONANCES OUTPUT=raw_data AXIS={AXIS} FREQ_START={FREQUENCY-1} FREQ_END={FREQUENCY+1} HZ_PER_SEC={1/(TIME/3)}
M400

View file

@ -0,0 +1,107 @@
# # # Klipper Adaptive Meshing # # #
# Heads up! If you have any other BED_MESH_CALIBRATE macros defined elsewhere in your config, you will need to comment out / remove them for this to work. (Klicky/Euclid Probe)
# You will also need to be sure that [exclude_object] is defined in printer.cfg, and your slicer is labeling objects.
# This macro will parse information from objects in your gcode to define a min and max mesh area to probe, creating an adaptive mesh!
# This macro will not increase probe_count values in your [bed_mesh] config. If you want richer meshes, be sure to increase probe_count. We recommend at least 5,5.
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: _BED_MESH_CALIBRATE
gcode:
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Gather all object points
{% 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 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
{% set x_min = all_points | map(attribute=0) | min | default(bed_mesh_min[0]) %} # Set x_min from smallest object x point
{% set y_min = all_points | map(attribute=1) | min | default(bed_mesh_min[1]) %} # Set y_min from smallest object y point
{% set x_max = all_points | map(attribute=0) | max | default(bed_mesh_max[0]) %} # Set x_max from largest object x point
{% 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 points_x = (((adapted_x_max - adapted_x_min) / max_probe_point_distance_x) | round(method='ceil') | int) + 1 %} # Define probe_count's x point count and round up
{% set points_y = (((adapted_y_max - adapted_y_min) / max_probe_point_distance_y) | round(method='ceil') | int) + 1 %} # Define probe_count's y point count and round up
{% if (([points_x, points_y]|max) > 6) %} #
{% set algorithm = "bicubic" %} #
{% set min_points = 4 %} #
{% else %} # Calculate if algorithm should be bicubic or lagrange
{% set algorithm = "lagrange" %} #
{% set min_points = 3 %} #
{% endif %} #
{% set points_x = [points_x, min_points]|max %} # Set probe_count's x points to fit the calculated algorithm
{% set points_y = [points_y, min_points]|max %} # Set probe_count's y points to fit the calculated algorithm
{% set points_x = [points_x, probe_count[0]]|min %}
{% set points_y = [points_y, probe_count[1]]|min %}
{% if verbose_enable == True %} # If verbose is enabled, print information about KAMP's calculations
{ action_respond_info( "Algorithm: {}.".format(
(algorithm),
)) }
{ 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("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 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("KAMP adjustments successful. Happy KAMPing!")}
{% endif %}
{% if probe_dock_enable == True %}
{attach_macro} # Attach/deploy a probe if the probe is stored somewhere outside of the print area
{% endif %}
_BED_MESH_CALIBRATE mesh_min={adapted_x_min},{adapted_y_min} mesh_max={adapted_x_max},{adapted_y_max} ALGORITHM={algorithm} PROBE_COUNT={points_x},{points_y}
{% if probe_dock_enable == True %}
{detach_macro} # Detach/stow a probe if the probe is stored somewhere outside of the print area
{% endif %} # End of verbose

View file

@ -0,0 +1,36 @@
# Below you can include specific configuration files depending on what you want KAMP to do:
# [include ./KAMP/Adaptive_Meshing.cfg] # Include to enable adaptive meshing configuration.
# [include ./KAMP/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
# [include ./KAMP/Voron_Purge.cfg] # Include to enable adaptive Voron logo purging configuration.
# [include ./KAMP/Smart_Park.cfg] # Include to enable the Smart Park function, which parks the printhead near the print area for final heating.
[gcode_macro _KAMP_Settings]
description: This macro contains all adjustable settings for KAMP
# The following variables are settings for KAMP as a whole.
variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging.
# The following variables are for adjusting adaptive mesh settings for KAMP.
variable_mesh_margin: 0 # Expands the mesh size in millimeters if desired. Leave at 0 to disable.
variable_fuzz_amount: 0 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable.
# The following variables are for those with a dockable probe like Klicky, Euclid, etc. # ---------------- Attach Macro | Detach Macro
variable_probe_dock_enable: False # Set to True to enable the usage of a dockable probe. # ---------------------------------------------
variable_attach_macro: 'Attach_Probe' # The macro that is used to attach the probe. # Klicky Probe: 'Attach_Probe' | 'Dock_Probe'
variable_detach_macro: 'Dock_Probe' # The macro that is used to store the probe. # Euclid Probe: 'Deploy_Probe' | 'Stow_Probe'
# Legacy Gcode: 'M401' | 'M402'
# The following variables are for adjusting adaptive purge settings for KAMP.
variable_purge_height: 0.8 # Z position of nozzle during purge, default is 0.8.
variable_tip_distance: 0 # Distance between tip of filament and nozzle before purge. Should be similar to PRINT_END final retract amount.
variable_purge_margin: 10 # Distance the purge will be in front of the print area, default is 10.
variable_purge_amount: 30 # Amount of filament to be purged prior to printing.
variable_flow_rate: 12 # Flow rate of purge in mm3/s. Default is 12.
# The following variables are for adjusting the Smart Park feature for KAMP, which will park the printhead near the print area at a specified height.
variable_smart_park_height: 10 # Z position for Smart Park, default is 10.
gcode: # Gcode section left intentionally blank. Do not disturb.
{action_respond_info(" Running the KAMP_Settings macro does nothing, it is only used for storing KAMP settings. ")}

View file

@ -0,0 +1,113 @@
[gcode_macro LINE_PURGE]
description: A purge macro that adapts to be near your actual printed objects
gcode:
# Get relevant printer params
{% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
{% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}
# Use firmware retraction if it is defined
{% if printer.firmware_retraction is defined %}
{% set RETRACT = G10 | string %}
{% set UNRETRACT = G11 | string %}
{% else %}
{% set RETRACT = 'G1 E-.5 F2100' | string %}
{% set UNRETRACT = 'G1 E.5 F2100' | string %}
{% 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 %}
# Calculate purge origins and centers from objects
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Get all object points
{% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} # Object x min
{% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} # Object x max
{% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} # Object y min
{% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} # Object y max
{% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} # Create center point of purge line relative to print on X axis
{% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} # Create center point of purge line relative to print on Y axis
{% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} # Add margin to x min, compare to 0, and choose the larger
{% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} # Add margin to y min, compare to 0, and choose the larger
# Calculate purge speed
{% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}
{% if cross_section < 5 %}
{action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")}
{% else %}
{% if verbose_enable == True %}
{action_respond_info("Moving filament tip {}mms".format(
(tip_distance),
)) }
{% endif %}
{% if printer.firmware_retraction is defined %}
{action_respond_info("KAMP purge is using firmware retraction.")}
{% else %}
{action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")}
{% endif %}
{% if purge_y_origin > 0 %}
{action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm/s3.".format(
(purge_x_center),
(purge_y_origin),
(purge_amount),
(flow_rate),
)) }
{% else %}
{action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm/s3.".format(
(purge_x_origin),
(purge_y_center),
(purge_amount),
(flow_rate),
)) }
{% endif %}
{% if purge_y_origin > 0 %} # If there's room on Y, purge along X axis in front of print area
G92 E0 # Reset extruder
G0 F{travel_speed} # Set travel speed
G90 # Absolute positioning
G0 X{purge_x_center} Y{purge_y_origin} # 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 filament tip
G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} # Purge line
{RETRACT} # Retract
G92 E0 # Reset extruder distance
M82 # Absolute extrusion mode
G0 Z{purge_height * 2} F{travel_speed} # Z hop
{% else %} # If there's room on X, purge along Y axis to the left of print area
G92 E0 # Reset extruder
G0 F{travel_speed} # Set travel speed
G90 # Absolute positioning
G0 X{purge_x_origin} Y{purge_y_center} # 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 filament tip
G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} # Purge line
{RETRACT} # Retract
G92 E0 # Reset extruder distance
M82 # Absolute extrusion mode
G0 Z{purge_height * 2} F{travel_speed} # Z hop
{% endif %}
{% endif %}

View file

@ -0,0 +1,14 @@
[gcode_macro Smart_Park]
description: Parks your printhead near the print area for pre-print hotend heating.
gcode:
{% set z_height = printer["gcode_macro _KAMP_Settings"].smart_park_height | float %} # Pull park height value from _KAMP_Settings
{% 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 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
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

@ -0,0 +1,86 @@
[gcode_macro VORON_PURGE]
description: A purge macro that adapts to be near your actual printed objects
gcode:
# Get relevant printer params
{% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %}
{% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}
# Use firmware retraction if it is defined
{% if printer.firmware_retraction is defined %}
{% set RETRACT = G10 | string %}
{% set UNRETRACT = G11 | string %}
{% else %}
{% set RETRACT = 'G1 E-.5 F2100' | string %}
{% set UNRETRACT = 'G1 E.5 F2100' | string %}
{% 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 size = 10 | float %}
# Calculate purge origins and centers from objects
{% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} # Get all object points
{% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} # Object x min
{% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} # Object x max
{% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} # Object y min
{% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} # Object y max
{% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} # Create center point of purge line relative to print on X axis
{% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} # Create center point of purge line relative to print on Y axis
{% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} # Add margin to x min, compare to 0, and choose the larger
{% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} # Add margin to y min, compare to 0, and choose the larger
# Calculate purge speed
{% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}
{% if cross_section < 5 %}
{action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")}
{% else %}
{% if verbose_enable == True %}
{action_respond_info("Moving filament tip {}mms".format(
(tip_distance),
)) }
{% endif %}
{% if printer.firmware_retraction is defined %}
{action_respond_info("KAMP purge is using firmware retraction.")}
{% else %}
{action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")}
{% endif %}
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}
{% endif %}

View file

@ -0,0 +1,36 @@
# Below you can include specific configuration files depending on what you want KAMP to do:
[include ./KAMP/Adaptive_Meshing.cfg] # Include to enable adaptive meshing configuration.
[include ./KAMP/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
# [include ./KAMP/Voron_Purge.cfg] # Include to enable adaptive Voron logo purging configuration.
#[include ./KAMP/Smart_Park.cfg] # Include to enable the Smart Park function, which parks the printhead near the print area for final heating.
[gcode_macro _KAMP_Settings]
description: This macro contains all adjustable settings for KAMP
# The following variables are settings for KAMP as a whole.
variable_verbose_enable: True # Set to True to enable KAMP information output when running. This is useful for debugging.
# The following variables are for adjusting adaptive mesh settings for KAMP.
variable_mesh_margin: 0 # Expands the mesh size in millimeters if desired. Leave at 0 to disable.
variable_fuzz_amount: 0.5 # Slightly randomizes mesh points to spread out wear from nozzle-based probes. Leave at 0 to disable.
# The following variables are for those with a dockable probe like Klicky, Euclid, etc. # ---------------- Attach Macro | Detach Macro
variable_probe_dock_enable: False # Set to True to enable the usage of a dockable probe. # ---------------------------------------------
variable_attach_macro: 'Attach_Probe' # The macro that is used to attach the probe. # Klicky Probe: 'Attach_Probe' | 'Dock_Probe'
variable_detach_macro: 'Dock_Probe' # The macro that is used to store the probe. # Euclid Probe: 'Deploy_Probe' | 'Stow_Probe'
# Legacy Gcode: 'M401' | 'M402'
# The following variables are for adjusting adaptive purge settings for KAMP.
variable_purge_height: 0.8 # Z position of nozzle during purge, default is 0.8.
variable_tip_distance: 0 # Distance between tip of filament and nozzle before purge. Should be similar to PRINT_END final retract amount.
variable_purge_margin: 20 # Distance the purge will be in front of the print area, default is 10.
variable_purge_amount: 30 # Amount of filament to be purged prior to printing.
variable_flow_rate: 15 # Flow rate of purge in mm3/s. Default is 12.
# The following variables are for adjusting the Smart Park feature for KAMP, which will park the printhead near the print area at a specified height.
variable_smart_park_height: 10 # Z position for Smart Park, default is 10.
gcode: # Gcode section left intentionally blank. Do not disturb.
{action_respond_info(" Running the KAMP_Settings macro does nothing, it is only used for storing KAMP settings. ")}

View file

@ -0,0 +1,7 @@
#~# --- Do not edit below this line. This section is auto generated --- #~#
#~#
#~# [main]
#~# 24htime = False
#~# print_sort_dir = date_desc
#~#

View file

@ -0,0 +1,9 @@
[neopixel chamber]
pin: PB6
chain_count: 56
color_order: GRB
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0

View file

@ -0,0 +1,85 @@
#### crowsnest.conf
#### This is a typical default config.
#### Also used as default in mainsail / MainsailOS
#### See:
#### https://github.com/mainsail-crew/crowsnest/blob/master/README.md
#### for details to configure to your needs.
#####################################################################
#### #####
#### Information about ports and according URL's #####
#### #####
#####################################################################
#### #####
#### Port 8080 equals /webcam/?action=[stream/snapshot] #####
#### Port 8081 equals /webcam2/?action=[stream/snapshot] #####
#### Port 8082 equals /webcam3/?action=[stream/snapshot] #####
#### Port 8083 equals /webcam4/?action=[stream/snapshot] #####
#### #####
#####################################################################
#### RTSP Stream URL: ( if enabled and supported ) #####
#### rtsp://<ip>:<rtsp_port>/stream.h264 #####
#####################################################################
[crowsnest]
log_path: ~/printer_data/logs/crowsnest.log
log_level: verbose # Valid Options are quiet/verbose/debug
delete_log: false # Deletes log on every restart, if set to true
no_proxy: false
[cam 1]
mode: ustreamer # ustreamer - Provides mjpg and snapshots. (All devices)
# camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)
enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server
rtsp_port: 8554 # Set different ports for each device!
port: 8080 # HTTP/MJPG Stream/Snapshot Port
device: /dev/video0 # See Log for available ...
resolution: 1920x1080 #2592x1944 #1920x1080 # widthxheight format
max_fps: 30 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
#custom_flags: # You can run the Stream Services with custom flags.
# Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.
v4l2ctl: brightness = -20 , contrast = 40 , saturation = 30 , hue = 0, white_balance_automatic = 1, gamma = 300 , white_balance_temperature = 4600 , sharpness = 70 , backlight_compensation = 0 , auto_exposure = 1 #, exposure_time_absolute = 312, focus_absolute = 0 , focus_automatic_continuous = 1
#[cam 2]
#mode: camera-streamer # ustreamer - Provides mjpg and snapshots. (All devices)
# camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)
#enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server
#rtsp_port: 8554 # Set different ports for each device!
#port: 8081 # HTTP/MJPG Stream/Snapshot Port
#device: /base/soc/i2c0mux/i2c@1/imx708@1a # See Log for available ...
#resolution: 1280x720 #1366x768 1920x1080 # widthxheight format
#max_fps: 30 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
##custom_flags: # You can run the Stream Services with custom flags.
## Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.
##v4l2ctl: brightness = 20 , contrast = 40 , saturation = 62 , hue = -86, white_balance_automatic = 1, gamma = 160 , gain = 30 , power_line_frequency = 2 , white_balance_temperature = 4600 , sharpness = 6 , backlight_compensation = 0 #, auto_exposure = 1 , exposure_time_absolute = 312, focus_absolute = 0 , focus_automatic_continuous = 1
#=============================================================================================================== User Controls
#brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
#contrast 0x00980901 (int) : min=0 max=64 step=1 default=34 value=34
#saturation 0x00980902 (int) : min=0 max=78 step=1 default=62 value=62
#hue 0x00980903 (int) : min=-2000 max=2000 step=1 default=-86 value=-86
#white_balance_automatic 0x0098090c (bool) : default=1 value=1
#gamma 0x00980910 (int) : min=100 max=300 step=1 default=150 value=150
#gain 0x00980913 (int) : min=0 max=130 step=1 default=32 value=35
#power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=2
#white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
#sharpness 0x0098091b (int) : min=1 max=7 step=1 default=4 value=4
#backlight_compensation 0x0098091c (int) : min=0 max=1 step=1 default=0 value=0
#Camera Controls
#auto_exposure 0x009a0901 (menu) : min=0 max=3 default=3 value=3
#1: Manual Mode
#3: Aperture Priority Mode
#exposure_time_absolute 0x009a0902 (int) : min=1 max=80000 step=1 default=312 value=2496 flags=inactive
#error 5 getting ext_ctrl Exposure, Dynamic Framerate
#focus_absolute 0x009a090a (int) : min=0 max=256 step=1 default=0 value=127 flags=inactive
#focus_automatic_continuous 0x009a090c (bool) : default=1 value=1

View file

@ -0,0 +1,105 @@
[gcode_macro HEAT_SOAK]
description: heats the bed for a while
variable_target_temp: 0
variable_stage: None ## heating -> soaking -> done -> None
## in seconds
variable_check_interval: 10
variable_soak_time_remaining: 0
variable_total_time_elapsed: 0
gcode:
{% set TARGET = params.TARGET | default(0) | float %}
{% set DURATION = (params.DURATION | default(5) | int) * 60 %} ## minutes to seconds
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=target_temp VALUE={ TARGET }
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=stage VALUE="'heating'"
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=soak_time_remaining VALUE={ DURATION }
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=total_time_elapsed VALUE=0
;; fire up the heater
SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={ TARGET }
;; run the fan to circulate air
_SET_FAN_SPEED PERCENT=50
SET_FAN_SPEED FAN=Nevermore SPEED=1
;; put the bed and nozzle where they're a safe distance apart
G28
##CENTER
M84 ;; turn off steppers
UPDATE_DELAYED_GCODE ID=heat_soaker DURATION={ check_interval }
[gcode_macro CANCEL_HEAT_SOAK]
description: cancels an in-progress HEAT_SOAK cycle
gcode:
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=stage VALUE="'cancel'"
UPDATE_DELAYED_GCODE ID=heat_soaker DURATION=1
[delayed_gcode heat_soaker]
; ## debug
; { action_respond_info( printer['gcode_macro HEAT_SOAK'] | tojson )}
gcode:
{% set heat_soak = printer['gcode_macro HEAT_SOAK'] %}
## update total time elapsed
{% set total_time_elapsed = heat_soak.total_time_elapsed + heat_soak.check_interval %}
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=total_time_elapsed VALUE={ total_time_elapsed }
{% set stage = heat_soak.stage %}
{% if stage == "heating" and printer.heater_bed.temperature >= heat_soak.target_temp %}
{% set stage = "soaking" %}
{% endif %}
{% if stage == "soaking" %}
## update soak countdown
{% set soak_time_remaining = [heat_soak.soak_time_remaining - heat_soak.check_interval, 0] | max %}
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=soak_time_remaining VALUE={ soak_time_remaining }
{% if soak_time_remaining == 0 %}
{% set stage = "done" %}
{% endif %}
{% endif %}
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=stage VALUE="'{ stage }'"
{% if stage in ("done", "cancel") %}
{% if stage == "cancel" %}
{% set stage = "done" %}
TURN_OFF_HEATERS
M107 ; turn off fan
M117 { "soak cancelled after ~%.1fm" | format(total_time_elapsed / 60.0) }
{% else %}
M117 { "soak complete after %.1fm" | format(total_time_elapsed / 60.0) }
{% endif %}
## reset all state vars, except stage, which may be queried via the api
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=target_temp VALUE=0
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=soak_time_remaining VALUE=0
SET_GCODE_VARIABLE MACRO=HEAT_SOAK VARIABLE=total_time_elapsed VALUE=0
{% else %}
{% if total_time_elapsed % 90 == 0 %}
## output status periodically
{% if stage == "heating" %}
M117 { "heating -- %.1fm elapsed" | format(total_time_elapsed / 60.0) }
{% elif stage == "soaking" %}
M117 { "soaking -- %.1fm remaining" | format(soak_time_remaining / 60.0) }
{% endif %}
{% endif %}
## trigger ourselves again
UPDATE_DELAYED_GCODE ID=heat_soaker DURATION={ heat_soak.check_interval }
## dwell for 1ms to prevent from going idle
G4 P1
{% endif %}
#[gcode_macro NEW_TIMELAPSE_TAKE_FRAME]

View file

@ -0,0 +1,230 @@
## Client klipper macro definitions
##
## Copyright (C) 2022 Alex Zellner <alexander.zellner@googlemail.com>
##
## This file may be distributed under the terms of the GNU GPLv3 license
##
## !!! This file is read-only. Maybe the used editor indicates that. !!!
##
## Customization:
## 1) copy the gcode_macro _CLIENT_VARIABLE (see below) to your printer.cfg
## 2) remove the comment mark (#) from all lines
## 3) change any value in there to your needs
##
## Use the PAUSE macro direct in your M600:
## e.g. with a different park position front left and a minimal height of 50
## [gcode_macro M600]
## description: Filament change
## gcode: PAUSE X=10 Y=10 Z_MIN=50
## Z_MIN will park the toolhead at a minimum of 50 mm above to bed to make it easier for you to swap filament.
##
## Client variable macro for your printer.cfg
#[gcode_macro _CLIENT_VARIABLE]
#variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False]
#variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X
#variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y
#variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position
#variable_retract : 1.0 ; the value to retract while PAUSE
#variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT
#variable_speed_retract : 35.0 ; retract speed in mm/s
#variable_unretract : 1.0 ; the value to unretract while RESUME
#variable_speed_unretract : 35.0 ; unretract speed in mm/s
#variable_speed_hop : 15.0 ; z move speed in mm/s
#variable_speed_move : 100.0 ; move speed in mm/s
#variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True/False]
#variable_park_at_cancel_x : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
#variable_park_at_cancel_y : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True
## !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!!
#variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False]
#variable_idle_timeout : 0 ; time in sec until idle_timeout kicks in. Value 0 means that no value will be set or restored
#gcode:
[virtual_sdcard]
path: ~/printer_data/gcodes
on_error_gcode: CANCEL_PRINT
[pause_resume]
[display_status]
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
##### get user parameters or use default #####
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
{% set retract = client.cancel_retract|default(5.0)|abs %}
##### define park position #####
{% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
else "X=" ~ client.park_at_cancel_x %}
{% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
else "Y=" ~ client.park_at_cancel_y %}
{% set custom_park = park_x|length > 0 or park_y|length > 0 %}
##### end of definitions #####
# restore idle_timeout time if needed
{% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
{% endif %}
{% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
_CLIENT_RETRACT LENGTH={retract}
TURN_OFF_HEATERS
M106 S0
# clear pause_next_layer and pause_at_layer as preparation for next print
SET_PAUSE_NEXT_LAYER ENABLE=0
SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
CANCEL_PRINT_BASE
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
variable_restore_idle_timeout: 0
gcode:
##### get user parameters or use default #####
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set idle_timeout = client.idle_timeout|default(0) %}
##### end of definitions #####
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE={printer[printer.toolhead.extruder].target}
# set a new idle_timeout value
{% if idle_timeout > 0 %}
SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
{% endif %}
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
variable_last_extruder_temp: 0
gcode:
##### get user parameters or use default #####
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set sp_move = client.speed_move|default(velocity) %}
##### end of definitions #####
# restore idle_timeout time if needed
{% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
{% endif %}
M109 S{last_extruder_temp}
_CLIENT_EXTRUDE
RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
# Usage: SET_PAUSE_NEXT_LAYER [ENABLE=[0|1]] [MACRO=<name>]
[gcode_macro SET_PAUSE_NEXT_LAYER]
description: Enable a pause if the next layer is reached
gcode:
{% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
{% set ENABLE = params.ENABLE|default(1)|int != 0 %}
{% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
# Usage: SET_PAUSE_AT_LAYER [ENABLE=[0|1]] [LAYER=<number>] [MACRO=<name>]
[gcode_macro SET_PAUSE_AT_LAYER]
description: Enable/disable a pause if a given layer number is reached
gcode:
{% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
{% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
else params.LAYER is defined %}
{% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
{% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
# Usage: SET_PRINT_STATS_INFO [TOTAL_LAYER=<total_layer_count>] [CURRENT_LAYER= <current_layer>]
[gcode_macro SET_PRINT_STATS_INFO]
rename_existing: SET_PRINT_STATS_INFO_BASE
description: Overwrite, to get pause_next_layer and pause_at_layer feature
variable_pause_next_layer: { 'enable': False, 'call': "PAUSE" }
variable_pause_at_layer : { 'enable': False, 'layer': 0, 'call': "PAUSE" }
gcode:
{% if pause_next_layer.enable %}
{action_respond_info("%s, forced by pause_next_layer" % pause_next_layer.call)}
{pause_next_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE
SET_PAUSE_NEXT_LAYER ENABLE=0
{% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
{action_respond_info("%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer))}
{pause_at_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE
SET_PAUSE_AT_LAYER ENABLE=0
{% endif %}
SET_PRINT_STATS_INFO_BASE {rawparams}
##### internal use #####
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode:
##### get user parameters or use default #####
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
{% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
{% set custom_park_x = client.custom_park_x|default(0.0) %}
{% set custom_park_y = client.custom_park_y|default(0.0) %}
{% set park_dz = client.custom_park_dz|default(2.0)|abs %}
{% set sp_hop = client.speed_hop|default(15) * 60 %}
{% set sp_move = client.speed_move|default(velocity) * 60 %}
##### get config and toolhead values #####
{% set origin = printer.gcode_move.homing_origin %}
{% set act = printer.gcode_move.gcode_position %}
{% set max = printer.toolhead.axis_maximum %}
{% set cone = printer.toolhead.cone_start_z|default(max.z) %} ; height as long the toolhead can reach max and min of an delta
{% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
else False %}
##### define park position #####
{% set z_min = params.Z_MIN|default(0)|float %}
{% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
{% set x_park = params.X if params.X is defined
else custom_park_x if use_custom
else 0.0 if round_bed
else (max.x - 5.0) %}
{% set y_park = params.Y if params.Y is defined
else custom_park_y if use_custom
else (max.y - 5.0) if round_bed and z_park < cone
else 0.0 if round_bed
else (max.y - 5.0) %}
##### end of definitions #####
_CLIENT_RETRACT
{% if "xyz" in printer.toolhead.homed_axes %}
G90
G1 Z{z_park} F{sp_hop}
G1 X{x_park} Y{y_park} F{sp_move}
{% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro _CLIENT_EXTRUDE]
description: Extrudes, if the extruder is hot enough
gcode:
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
{% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
{% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
{% set absolute_extrude = printer.gcode_move.absolute_extrude %}
{% if printer.extruder.can_extrude %}
{% if use_fw_retract %}
{% if length < 0 %}
G10
{% else %}
G11
{% endif %}
{% else %}
M83
G1 E{length} F{(speed|float|abs) * 60}
{% if absolute_extrude %}
M82
{% endif %}
{% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
[gcode_macro _CLIENT_RETRACT]
description: Retracts, if the extruder is hot enough
gcode:
{% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
{% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
{% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
_CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

View file

@ -0,0 +1,109 @@
[server]
host: 0.0.0.0
port: 7125
# The maximum size allowed for a file upload (in MiB). Default 1024 MiB
max_upload_size: 1024
# Path to klippy Unix Domain Socket
klippy_uds_address: ~/printer_data/comms/klippy.sock
[file_manager]
# post processing for object cancel. Not recommended for low resource SBCs such as a Pi Zero. Default False
enable_object_processing: True
[authorization]
cors_domains:
https://my.mainsail.xyz
http://my.mainsail.xyz
http://*.local
http://*.lan
trusted_clients:
10.0.0.0/8
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.168.0.0/16
FE80::/10
::1/128
100.0.0.0/8
# enables partial support of Octoprint API
[octoprint_compat]
# enables moonraker to track and store print history.
[history]
# this enables moonraker announcements for mainsail
[announcements]
subscriptions:
mainsail
# this enables moonraker's update manager
[update_manager]
refresh_interval: 168
enable_auto_refresh: True
[update_manager mainsail]
type: web
channel: stable
repo: mainsail-crew/mainsail
path: ~/mainsail
[update_manager mainsail-config]
type: git_repo
primary_branch: master
path: ~/mainsail-config
origin: https://github.com/mainsail-crew/mainsail-config.git
managed_services: klipper
### moonraker-timelapse
### Don't forget to include timelapse.cfg to your printer.cfg
### Uncomment to enable moonraker-timelapse
[update_manager timelapse]
type: git_repo
primary_branch: main
path: ~/moonraker-timelapse
origin: https://github.com/mainsail-crew/moonraker-timelapse.git
managed_services: klipper moonraker
[timelapse]
## Directory where the generated video will be saved
output_path: ~/printer_data/timelapse/
frame_path: /tmp/timelapse/printer
## Directory where ffmpeg is installed
ffmpeg_binary_path: /usr/bin/ffmpeg
# Crowsnest update_manager entry
[update_manager crowsnest]
type: git_repo
path: ~/crowsnest
origin: https://github.com/mainsail-crew/crowsnest.git
managed_services: crowsnest
install_script: tools/install.sh
#install_script: tools/pkglist.sh
# Sonar update_manager entry
[update_manager sonar]
type: git_repo
path: ~/sonar
origin: https://github.com/mainsail-crew/sonar.git
primary_branch: main
managed_services: sonar
install_script: tools/install.sh
[update_manager Klipper-Adaptive-Meshing-Purging]
type: git_repo
channel: dev
path: ~/Klipper-Adaptive-Meshing-Purging
origin: https://github.com/kyleisah/Klipper-Adaptive-Meshing-Purging.git
managed_services: klipper
primary_branch: main
[include octoeverywhere-system.cfg]
[update_manager klipper-backup]
type: git_repo
path: ~/klipper-backup
origin: https://github.com/Staubgeborener/klipper-backup.git
managed_services: moonraker
primary_branch: main

View file

@ -0,0 +1,46 @@
## This is a simple include for the Nevermore. To use it with your printer, edit
## the pin definition in line 16 so it matches your printer.
## What you get:
## - a generic fan "Nevermore" which is adjustable in GCODE and in Mainsail/Fluidd
## - Commands in your 12864-controller to turn the fan on/off or adjust in 10%-steps
## - a Macro to turn the fan off some time after the print.
##
## Slicer integration: Add "SET_FAN_SPEED FAN=Nevermore SPEED=1" in your start-macro
## (or less fan depending on your needs, like SPEED=0.8)
## in your end print code, add "UPDATE_DELAYED_GCODE ID=filter_off DURATION=180"
## this keeps your Nevermore running for 180s after the print finishes to clean the chamber a bit more.
[fan_generic Nevermore]
## Nevermore - FAN5 on Octopus
## Adjust if you use a different board or a different terminal.
pin: PD13
[menu __main __control __nevermoreonoff]
type: command
name: Nevermore {'ON' if printer['fan_generic Nevermore'].speed > 0 else 'OFF'}
enable: {'fan_generic Nevermore' in printer}
gcode:
TOGGLE_NEVERMORE
[menu __main __control __filterspeed]
type: input
enable: {'fan_generic Nevermore' in printer}
name: Filter %: {'%3d' % (menu.input*100)}%
input: {printer["fan_generic Nevermore"].speed}
input_min: 0
input_max: 1
input_step: 0.1
gcode:
SET_FAN_SPEED FAN=Nevermore SPEED={menu.input}
[delayed_gcode filter_off]
gcode:
SET_FAN_SPEED FAN=Nevermore SPEED=0
[gcode_macro TOGGLE_NEVERMORE]
gcode:
{% if printer['fan_generic Nevermore'].speed > 0 %}
SET_FAN_SPEED FAN=Nevermore SPEED=0
{% else %}
SET_FAN_SPEED FAN=Nevermore SPEED=1
{% endif %}

View file

@ -0,0 +1,20 @@
[update_manager octoeverywhere]
type: git_repo
# Using `channel: beta` makes moonraker only update to the lasted tagged commit on the branch. Which lets us control releases.
channel: beta
path: /home/miguel/octoeverywhere
origin: https://github.com/QuinnDamerell/OctoPrint-OctoEverywhere.git
# env is deprecated for virtualenv, but for now we can only use one and must use the older option for compat.
env: /home/miguel/octoeverywhere-env/bin/python
#virtualenv: /home/miguel/octoeverywhere-env
# requirements is deprecated for system_dependencies, but for now we can only use one and must use the older option for compat.
requirements: requirements.txt
# system_dependencies: moonraker-system-dependencies.json
install_script: install.sh
managed_services:
octoeverywhere
# This allows users of OctoEverywhere to get announcements from the system.
[announcements]
subscriptions:
octoeverywhere

View file

@ -0,0 +1,32 @@
[logging]
# The active logging level. Valid values include: DEBUG, INFO, WARNING, or ERROR.
log_level = INFO
max_file_size_mb = 5
max_file_count = 3
[server]
[relay]
# The port used for http relay. If your desired frontend runs on a different port, change this value. The OctoEverywhere plugin service needs to be restarted before changes will take effect.
frontend_port = 80
[webcam]
# This is the webcam name OctoEverywhere will use for Gadget AI, notifications, and such. This much match the camera 'Name' from your Mainsail of Fluidd webcam settings. The default value of 'Default' will pick whatever camera the system can find.
webcam_name_to_use_as_primary = Default
# Enables or disables auto webcam setting detection. If enabled, OctoEverywhere will find the webcam settings configured via the frontend (Fluidd, Mainsail, etc) and use them. Disable to manually set the values and have them not be overwritten.
auto_settings_detection = True
# Webcam streaming URL. This can be a local relative path (ex: /webcam/?action=stream) or absolute http URL (ex: http://10.0.0.1:8080/webcam/?action=stream or http://webcam.local/webcam/?action=stream)
stream_url = /webcam/?action=stream
# Webcam snapshot URL. This can be a local relative path (ex: /webcam/?action=snapshot) or absolute http URL (ex: http://10.0.0.1:8080/webcam/?action=snapshot or http://webcam.local/webcam/?action=snapshot)
snapshot_url = /webcam/?action=snapshot
# Flips the webcam image horizontally. Valid values are True or False
flip_horizontally = False
# Flips the webcam image vertically. Valid values are True or False
flip_vertically = True
# Rotates the webcam image. Valid values are 0, 90, 180, or 270
rotate = 0
[general]
# The temperature in Celsius that the bed must be under to be considered cooled down. This is used to fire the Bed Cooldown Complete notification.
bed_cooldown_threshold_temp_celsius = 40.0

View file

@ -0,0 +1,126 @@
#####################################################################
# print_start macro
#####################################################################
## *** THINGS TO UNCOMMENT: ***
## Bed mesh (2 lines at 2 locations)
## Z_TILT_ADJUST if your printer is a Trident
## Quad gantry level if your printer is a V2
## Nevermore - if you have one
[gcode_macro PRINT_START]
gcode:
# This part fetches data from your slicer. Such as bed temp, extruder temp, chamber temp and size of your printer.
{% set target_bed = params.BED|int %}
{% set target_extruder = params.EXTRUDER|int %}
##Uncomment bellow when you install chamber thermistor ----------------------------------------------------------------------------------------------------------------------
{% set target_chamber = params.CHAMBER|default("40")|int %}
{% set x_wait = printer.toolhead.axis_maximum.x|float / 2 %}
{% set y_wait = printer.toolhead.axis_maximum.y|float / 2 %}
# Homes the printer, sets absolute positioning and updates the Stealthburner leds.
STATUS_HOMING # Sets SB-leds to homing-mode
G28 # Full home (XYZ)
G90 # Absolut position
## Uncomment for bed mesh (1 of 2)
#BED_MESH_CLEAR # Clears old saved bed mesh (if any)
# Checks if the bed temp is higher than 90c - if so then trigger a heatsoak.
{% if params.BED|int > 90 %}
SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
M106 S255 # Turns on the PT-fan
# Uncomment if you have a Nevermore.
SET_FAN_SPEED FAN=Nevermore SPEED=1 # Turns on the nevermore
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M190 S{target_bed} # Sets the target temp for the bed
SET_DISPLAY_TEXT MSG="Heatsoak: {target_chamber}c" # Displays info
##Uncomment Bellow when chaimber thermistor is installed----------------------------------------------------------------------------------------------------------
#TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={target_chamber} # Waits for chamber to reach desired temp
# If the bed temp is not over 90c, then it skips the heatsoak and just heats up to set temp with a 5min soak
{% else %}
SET_DISPLAY_TEXT MSG="Bed: {target_bed}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M190 S{target_bed} # Sets the target temp for the bed
SET_DISPLAY_TEXT MSG="Soak for 5min" # Displays info
G4 P300000 # Waits 5 min for the bedtemp to stabilize
{% endif %}
# Heating nozzle to 150 degrees. This helps with getting a correct Z-home
SET_DISPLAY_TEXT MSG="Hotend: 150c" # Displays info
M109 S150 # Heats the nozzle to 150c
CLEAN_NOZZLE
SET_DISPLAY_TEXT MSG="Clean Boi"
# Uncomment for Trident (Z_TILT_ADJUST)
SET_DISPLAY_TEXT MSG="Z-tilt adjust" # Displays info
STATUS_LEVELING # Sets SB-leds to leveling-mode
Z_TILT_ADJUST # Levels the buildplate via z_tilt_adjust
G28 Z # Homes Z again after z_tilt_adjust
## Uncomment for V2 (Quad gantry level AKA QGL)
#SET_DISPLAY_TEXT MSG="QGL" # Displays info
#STATUS_LEVELING # Sets SB-leds to leveling-mode
#quad_gantry_level # Levels the buildplate via QGL
#G28 Z # Homes Z again after QGL
## Uncomment for Klicky auto-z
#CALIBRATE_Z # Calibrates Z-offset with klicky
#SET_DISPLAY_TEXT MSG="Z-offset" # Displays info
# Uncomment for bed mesh (2 of 2)
SET_DISPLAY_TEXT MSG="Bed mesh" # Displays info
STATUS_MESHING # Sets SB-leds to bed mesh-mode
bed_mesh_calibrate # Starts bed mesh
# Heats up the nozzle up to target via data from slicer
SET_DISPLAY_TEXT MSG="Hotend: {target_extruder}c" # Displays info
STATUS_HEATING # Sets SB-leds to heating-mode
G1 X{x_wait} Y{y_wait} Z15 F9000 # Goes to center of the bed
M107 # Turns off partcooling fan
M109 S{target_extruder} # Heats the nozzle to printing temp
# Gets ready to print by doing a purge line and updating the SB-leds
SET_DISPLAY_TEXT MSG="Printer goes brr" # Displays info
STATUS_PRINTING # Sets SB-leds to printing-mode
LINE_PURGE
#G0 X{x_wait - 50} Y4 F10000 # Moves to starting point
#G0 Z0.4 # Raises Z to 0.4
#G91 # Incremental positioning
#G1 X100 E20 F1000 # Purge line
#G90 # Absolut position
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
# safe anti-stringing move coords
{% set th = printer.toolhead %}
{% set x_safe = th.position.x + 20 * (1 if th.axis_maximum.x - th.position.x > 20 else -1) %}
{% set y_safe = th.position.y + 20 * (1 if th.axis_maximum.y - th.position.y > 20 else -1) %}
{% set z_safe = [th.position.z + 2, th.axis_maximum.z]|min %}
SAVE_GCODE_STATE NAME=STATE_PRINT_END
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-2.0 F3600 ; retract filament
TURN_OFF_HEATERS
G90 ; absolute positioning
G0 X{x_safe} Y{y_safe} Z{z_safe} F20000 ; move nozzle to remove stringing
G0 X{th.axis_maximum.x//2} Y{th.axis_maximum.y - 2} F3600 ; park nozzle at rear
M107 ; turn off fan
SET_FAN_SPEED FAN=Nevermore SPEED=0
BED_MESH_CLEAR
RESTORE_GCODE_STATE NAME=STATE_PRINT_END

View file

@ -0,0 +1,615 @@
# This file contains common pin mappings for the BigTreeTech Octopus V1.
# To use this config, the firmware should be compiled for the STM32F446 with a "32KiB bootloader"
# Enable "extra low-level configuration options" and select the "12MHz crystal" as clock reference
# after running "make", copy the generated "klipper/out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the OctoPus with that SD card.
# See docs/Config_Reference.md for a description of parameters.
## Voron Design Trident 250/300/350mm BigTreeTech OctoPus V1 TMC2209 UART config
## *** THINGS TO CHANGE/CHECK: ***
## MCU paths [mcu] section
## Thermistor types [extruder] and [heater_bed] sections - See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types
## Leadscrew Rotation Distance [stepper_z], [stepper_z1], [stepper_z2]
## Z Endstop Switch location [safe_z_home] section
## Z Endstop Switch offset for Z0 [stepper_z] section
## PID tune [extruder] and [heater_bed] sections
## e pin [probe] section
## Fine tune E steps [extruder] section
[mcu]
## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
##--------------------------------------------------------------------
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_41004C000A51313133353932-if00
#/dev/serial/by-id/usb-Klipper_stm32f446xx_41004C000A51313133353932-if00
restart_method: command
##--------------------------------------------------------------------
[include mainsail.cfg]
[include stealthburner_leds.cfg]
[include case_lights.cfg]
[include print_handling.cfg]
[include nevermore.cfg]
[include Bed_Mesh.cfg]
[include KAMP_Settings.cfg]
[include ./KAMP/Adaptive_Meshing.cfg] # Include to enable adaptive meshing configuration.
[include ./KAMP/Line_Purge.cfg] # Include to enable adaptive line purging configuration.
[include ./KAMP/Smart_Park.cfg] # Include to enable the Smart Park function, which parks the printhead near the print area for final heating.
[include custom_macros.cfg]
[include purge.cfg]
[include IS_shaper_calibrate.cfg]
[include timelapse.cfg]
[exclude_object]
[gcode_arcs]
resolution: 0.1
[printer]
kinematics: corexy
max_velocity: 300
max_accel: 6000 #Max 4000
max_z_velocity: 15 #Max 15 for 12V TMC Drivers, can increase for 24V
max_z_accel: 350
square_corner_velocity: 5.0
#####################################################################
# X/Y Stepper Settings
#####################################################################
## B Stepper - Left
## Connected to MOTOR_0
## Endstop connected to DIAG_0
[stepper_x]
step_pin: PF13
dir_pin: PF12
enable_pin: !PF14
rotation_distance: 40
microsteps: 32
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin: PG6
position_min: 0
##--------------------------------------------------------------------
## Uncomment below for 250mm build
#position_endstop: 250
#position_max: 250
## Uncomment for 300mm build
#position_endstop: 300
#position_max: 300
## Uncomment for 350mm build
position_endstop: 350
position_max: 350
##--------------------------------------------------------------------
homing_speed: 25 #Max 100
homing_retract_dist: 5
homing_positive_dir: true
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_x]
uart_pin: PC4
interpolate: False
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
## A Stepper - Right
## Connected to MOTOR_1
## Endstop connected to DIAG_1
[stepper_y]
step_pin: PG0
dir_pin: PG1
enable_pin: !PF15
rotation_distance: 40
microsteps: 32
full_steps_per_rotation:200 #set to 400 for 0.9 degree stepper
endstop_pin: PG9
position_min: 0
##--------------------------------------------------------------------
## Uncomment for 250mm build
#position_endstop: 250
#position_max: 250
## Uncomment for 300mm build
#position_endstop: 300
#position_max: 300
## Uncomment for 350mm build
position_endstop: 350
position_max: 350
##--------------------------------------------------------------------
homing_speed: 25 #Max 100
homing_retract_dist: 5
homing_positive_dir: true
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_y]
uart_pin: PD11
interpolate: False
run_current: 0.8
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Z Stepper Settings
#####################################################################
## Z0 Stepper - Front Left
## Connected to MOTOR_2
## Endstop connected to DIAG_2
[stepper_z]
step_pin: PF11
dir_pin: PG3
enable_pin: !PG5
# Rotation Distance for TR8x8 = 8, TR8x4 = 4, TR8x2 = 2
rotation_distance: 4
microsteps: 32
endstop_pin: probe:z_virtual_endstop
## Z-position of nozzle (in mm) to z-endstop trigger point relative to print surface (Z0)
## (+) value = endstop above Z0, (-) value = endstop below
## Increasing position_endstop brings nozzle closer to the bed
## After you run Z_ENDSTOP_CALIBRATE, position_endstop will be stored at the very end of your config
#position_endstop: -0.5
## All builds use same Max Z
position_max: 250
position_min: -3.5
homing_speed: 8.0 # Leadscrews are slower than 2.4, 10 is a recommended max.
second_homing_speed: 3
homing_retract_dist: 3
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z]
uart_pin: PC6
interpolate: False
run_current: 0.6
sense_resistor: 0.110
stealthchop_threshold: 0
## Z1 Stepper - Rear Center
## Connected to MOTOR_3
[stepper_z1]
step_pin: PG4
dir_pin: PC1
enable_pin: !PA0
# Rotation Distance for TR8x8 = 8, TR8x4 = 4, TR8x2 = 2
rotation_distance: 4
microsteps: 32
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z1]
uart_pin: PC7
interpolate: False
run_current: 0.6
sense_resistor: 0.110
stealthchop_threshold: 0
## Z2 Stepper - Front Right
## Connected to MOTOR_4
[stepper_z2]
step_pin: PF9
dir_pin: PF10
enable_pin: !PG2
# Rotation Distance for TR8x8 = 8, TR8x4 = 4, TR8x2 = 2
rotation_distance: 4
microsteps: 32
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 stepper_z2]
uart_pin: PF2
interpolate: False
run_current: 0.6
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Extruder
#####################################################################
# Connected to MOTOR_6
# Heater - HE0
# Thermistor - T0
[extruder]
step_pin: PE2
dir_pin: PE3
enable_pin: !PD4
## Update value below when you perform extruder calibration
## If you ask for 100mm of filament, but in reality it is 98mm:
## rotation_distance = <previous_rotation_distance> * <actual_extrude_distance> / 100
## 22.6789511 is a good starting point
rotation_distance: 21.9985825 #22.6789511 #Bondtech 5mm Drive Gears old: 13.056242
max_extrude_only_distance: 101
## Update Gear Ratio depending on your Extruder Type
## Use 50:10 for Stealthburner/Clockwork 2
## Use 50:17 for Afterburner/Clockwork (BMG Gear Ratio)
## Use 80:20 for M4, M3.1
gear_ratio: 50:10 #BMG Gear Ratio
microsteps: 32
full_steps_per_rotation: 200 #200 for 1.8 degree, 400 for 0.9 degree
nozzle_diameter: 0.400
filament_diameter: 1.75
heater_pin: PA2
## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
## Use "Generic 3950" for NTC 100k 3950 thermistors
sensor_type: ATC Semitec 104NT-4-R025H42G
sensor_pin: PF4
min_temp: 10
max_temp: 280
max_power: 1.0
min_extrude_temp: 170
max_extrude_cross_section: 5
#control = pid
#pid_kp = 26.213
#pid_ki = 1.304
#pid_kd = 131.721
# Try to keep pressure_advance below 1.0
pressure_advance: 0.0355
# Default is 0.040, leave stock
pressure_advance_smooth_time: 0.040
## E0 on MOTOR6
## Make sure to update below for your relevant driver (2208 or 2209)
[tmc2209 extruder]
uart_pin: PE1
interpolate: false
run_current: 0.5
sense_resistor: 0.110
stealthchop_threshold: 0
#####################################################################
# Bed Heater
#####################################################################
[heater_bed]
## SSR Pin - HE1
## Thermistor - TB
heater_pin: PA3
## Check what thermistor type you have. See https://www.klipper3d.org/Config_Reference.html#common-thermistors for common thermistor types.
## Use "Generic 3950" for Keenovo heaters
sensor_type: Generic 3950
sensor_pin: PF3
## Adjust Max Power so your heater doesn't warp your bed. Rule of thumb is 0.4 watts / cm^2 .
max_power: 0.9
min_temp: 0
max_temp: 130
#control: pid
#pid_kp: 58.437
#pid_ki: 2.347
#pid_kd: 363.769
#####################################################################
# Probe
#####################################################################
[probe]
## Inductive Probe
## This probe is not used for Z height, only Quad Gantry Leveling
# Select the probe port by type:
## For the PROBE port. Will not work with Diode. May need pull-up resistor from signal to 24V.
#pin: ~!PB7
## For the DIAG_7 port. NEEDS BAT85 DIODE! Change to !PG15 if probe is NO.
pin: PG15
## For Octopus Pro Probe port; NPN and PNP proximity switch types can be set by jumper
#pin: ~!PC5
activate_gcode:
{% set PROBE_TEMP = 150 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}
{% if TARGET_TEMP > PROBE_TEMP %}
{ action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
M109 S{ PROBE_TEMP }
{% else %}
# Temperature target is already low enough, but nozzle may still be too hot.
{% if ACTUAL_TEMP > MAX_TEMP %}
{ action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
{% endif %}
{% endif %}
#--------------------------------------------------------------------
x_offset: 0
y_offset: 0
#z_offset: 0
speed: 10.0
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.05
samples_tolerance_retries: 3
#####################################################################
# Fan Control
#####################################################################
[fan]
## Print Cooling Fan - FAN0
pin: PA8
kick_start_time: 0.5
## Depending on your fan, you may need to increase this value
## if your fan will not start. Can change cycle_time (increase)
## if your fan is not able to slow down effectively
off_below: 0.10
[heater_fan hotend_fan]
## Hotend Fan - FAN1
pin: PE5
max_power: 1.0
kick_start_time: 0.5
heater: extruder
heater_temp: 50.0
## If you are experiencing back flow, you can reduce fan_speed
#fan_speed: 1.0
[multi_pin my_enable_pin]
pins: PD15, PD14
[controller_fan controller_fan]
## Controller fan - FAN2
pin: multi_pin:my_enable_pin
kick_start_time: 0.5
heater: heater_bed
max_power: 0.5
shutdown_speed: 0
[temperature_sensor chamber]
sensor_type: Generic 3950
sensor_pin: PF5
min_temp: 0
max_temp: 100
gcode_id: C
[heater_fan exhaust_fan]
# Exhaust fan - FAN3
pin: PD12
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
heater: heater_bed
heater_temp: 60
off_below: 0.10
#[fan_generic test_fan]
## Exhaust fan - FAN3
#pin: PD12
#max_power: 1.0
#shutdown_speed: 0.0
#kick_start_time: 5.0
#off_below: 0.10
#####################################################################
# LED Control
#####################################################################
#[output_pin caselight]
# Chamber Lighting - HE2 Connector (Optional)
#pin: PB10
#pwm:true
#shutdown_value: 0
#value:1
#cycle_time: 0.01
#####################################################################
# Homing and Gantry Adjustment Routines
#####################################################################
[idle_timeout]
timeout: 1800
[safe_z_home]
## XY Location of the Z Endstop Switch
## Update -10,-10 to the XY coordinates of your endstop pin
## (such as 157,305) after going through Z Endstop Pin
## Location Definition step.
home_xy_position: 175,175
speed:100
z_hop:10
[z_tilt]
## Use Z_TILT_ADJUST to level the bed .
## z_positions: Location of toolhead
##--------------------------------------------------------------------
## Uncomment below for 250mm build
#z_positions:
# -50, 18
# 125, 298
# 300, 18
#points:
# 30, 5
# 125, 195
# 220, 5
## Uncomment below for 300mm build
#z_positions:
# -50, 18
# 150, 348
# 350, 18
#points:
# 30, 5
# 150, 245
# 270, 5
## Uncomment below for 350mm build
z_positions:
-50, 18
175, 398
400, 18
points:
30, 5
175, 295
320, 5
##--------------------------------------------------------------------
speed: 200
horizontal_move_z: 10
retries: 5
retry_tolerance: 0.0075
########################################
# EXP1 / EXP2 (display) pins
########################################
[board_pins]
aliases:
# EXP1 header
EXP1_1=PE8, EXP1_2=PE7,
EXP1_3=PE9, EXP1_4=PE10,
EXP1_5=PE12, EXP1_6=PE13, # Slot in the socket on this side
EXP1_7=PE14, EXP1_8=PE15,
EXP1_9=<GND>, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PA6, EXP2_2=PA5,
EXP2_3=PB1, EXP2_4=PA4,
EXP2_5=PB2, EXP2_6=PA7, # Slot in the socket on this side
EXP2_7=PC15, EXP2_8=<RST>,
EXP2_9=<GND>, EXP2_10=<5V>
#####################################################################
# Displays
#####################################################################
## Uncomment the display that you have
#--------------------------------------------------------------------
#[display]
## RepRapDiscount 128x64 Full Graphic Smart Controller
#lcd_type: st7920
#cs_pin: EXP1_4
#sclk_pin: EXP1_5
#sid_pin: EXP1_3
#menu_timeout: 40
#encoder_pins: ^EXP2_5, ^EXP2_3
#click_pin: ^!EXP1_2
#[output_pin beeper]
#pin: EXP1_1
#--------------------------------------------------------------------
[display]
# mini12864 LCD Display
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
rst_pin: EXP1_5
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
contrast: 63
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP2_6
spi_software_sclk_pin: EXP2_2
#[neopixel btt_mini12864]
## To control Neopixel RGB in mini12864 display
#pin: EXP1_6
#chain_count: 3
#initial_RED: 0.1
#initial_GREEN: 0.5
#initial_BLUE: 0.0
#color_order: RGB
## Set RGB values on boot up for each Neopixel.
## Index 1 = display, Index 2 and 3 = Knob
#[delayed_gcode setdisplayneopixel]
#initial_duration: 1
#gcode:
# SET_LED LED=btt_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
# SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
# SET_LED LED=btt_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3
#--------------------------------------------------------------------
[mcu rpi]
serial: /tmp/klipper_host_mcu
[adxl345]
cs_pin: rpi:None
[resonance_tester]
accel_chip: adxl345
probe_points:
175, 175, 20 # an example
[input_shaper]
shaper_freq_x: 52.8
shaper_type_x: mzv
shaper_freq_y: 48.2
shaper_type_y: mzv
[gcode_shell_command plot_graph]
command: bash /home/miguel/printer_data/config/scripts/plot_graphs.sh
timeout: 500.0
verbose: True
[firmware_retraction]
retract_length: 0.35
# The length of filament (in mm) to retract when G10 is activated,
# and to unretract when G11 is activated (but see
# unretract_extra_length below). The default is 0 mm.
retract_speed: 25
# The speed of retraction, in mm/s. The default is 20 mm/s.
unretract_extra_length: 0
# The length (in mm) of *additional* filament to add when
# unretracting.
unretract_speed: 25
# The speed of unretraction, in mm/s. The default is 10 mm/s.
#####################################################################
# Macros
#####################################################################
# in the print_handling.cfg
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [heater_bed]
#*# control = pid
#*# pid_kp = 53.742
#*# pid_ki = 2.437
#*# pid_kd = 296.252
#*#
#*# [probe]
#*# z_offset = -1.565
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 36.178
#*# pid_ki = 4.231
#*# pid_kd = 77.330
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.060000, -0.048125, -0.089375, -0.036250, 0.028750
#*# 0.026875, -0.020625, -0.086875, -0.027500, 0.046250
#*# 0.041250, 0.006250, -0.073750, -0.011250, 0.113125
#*# 0.008750, -0.004375, -0.015625, -0.038750, 0.081250
#*# 0.030625, 0.009375, -0.070000, -0.054375, 0.061250
#*# x_count = 5
#*# y_count = 5
#*# mesh_x_pps = 2
#*# mesh_y_pps = 2
#*# algo = lagrange
#*# tension = 0.2
#*# min_x = 57.34
#*# max_x = 292.58
#*# min_y = 57.5
#*# max_y = 292.46

View file

@ -0,0 +1,28 @@
[gcode_macro CLEAN_NOZZLE]
variable_start_x: 0
variable_start_y: 115
variable_start_z: 10
variable_wipe_dist: -50
variable_wipe_qty: 10
variable_wipe_spd: 200
variable_raise_distance: 20
gcode:
STATUS_CLEANING
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
G90 ; absolute positioning
## Move nozzle to start position
G1 X{start_x} Y{start_y} F6000
G1 Z{start_z} F1500
## Wipe nozzle
{% for wipes in range(1, (wipe_qty + 1)) %}
G1 Y{start_y + wipe_dist} F{wipe_spd * 60}
G1 Y{start_y} F{wipe_spd * 60}
{% endfor %}
## Raise nozzle
G1 Z{raise_distance}

View file

@ -0,0 +1,255 @@
#!/usr/bin/env python3
##################################################
###### SPEED AND VIBRATIONS PLOTTING SCRIPT ######
##################################################
# Written by Frix_x#0161 #
# @version: 1.2
# CHANGELOG:
# v1.2: fixed a bug that could happen when username is not "pi" (thanks @spikeygg)
# v1.1: better graph formatting
# v1.0: first version of the script
# Be sure to make this script executable using SSH: type 'chmod +x ./graph_vibrations.py' when in the folder !
#####################################################################
################ !!! DO NOT EDIT BELOW THIS LINE !!! ################
#####################################################################
import optparse, matplotlib, re, sys, importlib, os, operator
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot, matplotlib.dates, matplotlib.font_manager
import matplotlib.ticker
matplotlib.use('Agg')
######################################################################
# Computation
######################################################################
def calc_freq_response(data):
# Use Klipper standard input shaper objects to do the computation
helper = shaper_calibrate.ShaperCalibrate(printer=None)
return helper.process_accelerometer_data(data)
def calc_psd(datas, group, max_freq):
psd_list = []
first_freqs = None
signal_axes = ['x', 'y', 'z', 'all']
for i in range(0, len(datas), group):
# Round up to the nearest power of 2 for faster FFT
N = datas[i].shape[0]
T = datas[i][-1,0] - datas[i][0,0]
M = 1 << int((N/T) * 0.5 - 1).bit_length()
if N <= M:
# If there is not enough lines in the array to be able to round up to the
# nearest power of 2, we need to pad some zeros at the end of the array to
# avoid entering a blocking state from Klipper shaper_calibrate.py
datas[i] = np.pad(datas[i], [(0, (M-N)+1), (0, 0)], mode='constant', constant_values=0)
freqrsp = calc_freq_response(datas[i])
for n in range(group - 1):
data = datas[i + n + 1]
# Round up to the nearest power of 2 for faster FFT
N = data.shape[0]
T = data[-1,0] - data[0,0]
M = 1 << int((N/T) * 0.5 - 1).bit_length()
if N <= M:
# If there is not enough lines in the array to be able to round up to the
# nearest power of 2, we need to pad some zeros at the end of the array to
# avoid entering a blocking state from Klipper shaper_calibrate.py
data = np.pad(data, [(0, (M-N)+1), (0, 0)], mode='constant', constant_values=0)
freqrsp.add_data(calc_freq_response(data))
if not psd_list:
# First group, just put it in the result list
first_freqs = freqrsp.freq_bins
psd = freqrsp.psd_sum[first_freqs <= max_freq]
px = freqrsp.psd_x[first_freqs <= max_freq]
py = freqrsp.psd_y[first_freqs <= max_freq]
pz = freqrsp.psd_z[first_freqs <= max_freq]
psd_list.append([psd, px, py, pz])
else:
# Not the first group, we need to interpolate every new signals
# to the first one to equalize the frequency_bins between them
signal_normalized = dict()
freqs = freqrsp.freq_bins
for axe in signal_axes:
signal = freqrsp.get_psd(axe)
signal_normalized[axe] = np.interp(first_freqs, freqs, signal)
# Remove data above max_freq on all axes and add to the result list
psd = signal_normalized['all'][first_freqs <= max_freq]
px = signal_normalized['x'][first_freqs <= max_freq]
py = signal_normalized['y'][first_freqs <= max_freq]
pz = signal_normalized['z'][first_freqs <= max_freq]
psd_list.append([psd, px, py, pz])
return first_freqs[first_freqs <= max_freq], psd_list
def calc_powertot(psd_list, freqs):
pwrtot_sum = []
pwrtot_x = []
pwrtot_y = []
pwrtot_z = []
for psd in psd_list:
pwrtot_sum.append(np.trapz(psd[0], freqs))
pwrtot_x.append(np.trapz(psd[1], freqs))
pwrtot_y.append(np.trapz(psd[2], freqs))
pwrtot_z.append(np.trapz(psd[3], freqs))
return [pwrtot_sum, pwrtot_x, pwrtot_y, pwrtot_z]
######################################################################
# Graphing
######################################################################
def plot_total_power(ax, speeds, power_total):
ax.set_title('Vibrations decomposition')
ax.set_xlabel('Speed (mm/s)')
ax.set_ylabel('Energy')
ax.plot(speeds, power_total[0], label="X+Y+Z", alpha=0.6)
ax.plot(speeds, power_total[1], label="X", alpha=0.6)
ax.plot(speeds, power_total[2], label="Y", alpha=0.6)
ax.plot(speeds, power_total[3], label="Z", alpha=0.6)
ax.xaxis.set_minor_locator(matplotlib.ticker.AutoMinorLocator())
ax.yaxis.set_minor_locator(matplotlib.ticker.AutoMinorLocator())
ax.grid(which='major', color='grey')
ax.grid(which='minor', color='lightgrey')
fontP = matplotlib.font_manager.FontProperties()
fontP.set_size('medium')
ax.legend(loc='best', prop=fontP)
return
def plot_spectrogram(ax, speeds, freqs, power_spectral_densities, max_freq):
spectrum = np.empty([len(freqs), len(speeds)])
for i in range(len(speeds)):
for j in range(len(freqs)):
spectrum[j, i] = power_spectral_densities[i][0][j]
ax.set_title("Summed vibrations spectrogram")
ax.pcolormesh(speeds, freqs, spectrum, norm=matplotlib.colors.LogNorm(),
cmap='inferno', shading='gouraud')
ax.set_ylim([0., max_freq])
ax.set_ylabel('Frequency (hz)')
ax.set_xlabel('Speed (mm/s)')
return
######################################################################
# Startup and main routines
######################################################################
def parse_log(logname, opts):
with open(logname) as f:
for header in f:
if not header.startswith('#'):
break
if not header.startswith('freq,psd_x,psd_y,psd_z,psd_xyz'):
# Raw accelerometer data
return np.loadtxt(logname, comments='#', delimiter=',')
# Power spectral density data or shaper calibration data
opts.error("File %s does not contain raw accelerometer data and therefore "
"is not supported by graph_vibrations.py script. Please use "
"calibrate_shaper.py script to process it instead." % (logname,))
def extract_speed(logname, opts):
try:
speed = re.search('sp(.+?)n', os.path.basename(logname)).group(1)
except AttributeError:
opts.error("File %s does not contain speed in its name and therefore "
"is not supported by graph_vibrations.py script." % (logname,))
return int(speed)
def sort_and_slice(raw_speeds, raw_datas, remove):
# Sort to get the speeds and their datas aligned and in ascending order
raw_speeds, raw_datas = zip(*sorted(zip(raw_speeds, raw_datas), key=operator.itemgetter(0)))
# Remove beginning and end of the datas for each file to get only
# constant speed data and remove the start/stop phase of the movements
datas = []
for data in raw_datas:
sliced = round((len(data) * remove / 100) / 2)
datas.append(data[sliced:len(data)-sliced])
return raw_speeds, datas
def setup_klipper_import(kdir):
global shaper_calibrate
sys.path.append(os.path.join(kdir, 'klippy'))
shaper_calibrate = importlib.import_module('.shaper_calibrate', 'extras')
def main():
# Parse command-line arguments
usage = "%prog [options] <raw logs>"
opts = optparse.OptionParser(usage)
opts.add_option("-o", "--output", type="string", dest="output",
default=None, help="filename of output graph")
opts.add_option("-a", "--axis", type="string", dest="axisname",
default=None, help="axis name to be shown on the side of the graph")
opts.add_option("-f", "--max_freq", type="float", default=1000.,
help="maximum frequency to graph")
opts.add_option("-r", "--remove", type="int", default=0,
help="percentage of data removed at start/end of each files")
opts.add_option("-k", "--klipper_dir", type="string", dest="klipperdir",
default="/home/pi/klipper", help="main klipper directory")
options, args = opts.parse_args()
if len(args) < 1:
opts.error("No CSV file(s) to analyse")
if options.output is None:
opts.error("You must specify an output file.png to use the script (option -o)")
if options.remove > 50 or options.remove < 0:
opts.error("You must specify a correct percentage (option -r) in the 0-50 range")
setup_klipper_import(options.klipperdir)
# Parse the raw data and get them ready for analysis
raw_datas = [parse_log(filename, opts) for filename in args]
raw_speeds = [extract_speed(filename, opts) for filename in args]
speeds, datas = sort_and_slice(raw_speeds, raw_datas, options.remove)
# As we assume that we have the same number of file for each speeds. We can group
# the PSD results by this number (to combine vibrations at given speed on all movements)
group_by = speeds.count(speeds[0])
# Compute psd and total power of the signal
freqs, power_spectral_densities = calc_psd(datas, group_by, options.max_freq)
power_total = calc_powertot(power_spectral_densities, freqs)
fig, axs = matplotlib.pyplot.subplots(2, 1, sharex=True)
fig.suptitle("Machine vibrations - " + options.axisname + " moves", fontsize=16)
# Remove speeds duplicates and graph the processed datas
speeds = list(OrderedDict((x, True) for x in speeds).keys())
plot_total_power(axs[0], speeds, power_total)
plot_spectrogram(axs[1], speeds, freqs, power_spectral_densities, options.max_freq)
fig.set_size_inches(10, 10)
fig.tight_layout()
fig.subplots_adjust(top=0.92)
fig.savefig(options.output)
if __name__ == '__main__':
main()

View file

@ -0,0 +1,220 @@
#!/usr/bin/env bash
###################################
###### GRAPH PLOTTING SCRIPT ######
###################################
# Written by Frix_x#0161 #
# @version: 1.6
# CHANGELOG:
# v1.6: - updated the handling of shaper graph files to be able to optionnaly account for added positions in the filenames and remove them
# - fixed a bug in the belt graph on slow SD card or Pi clones (Klipper was still writing in the file while we were already reading it)
# v1.5: fixed klipper unnexpected fail at the end of the execution, even if graphs were correctly generated (unicode decode error fixed)
# v1.4: added the ~/klipper dir parameter to the call of graph_vibrations.py for a better user handling (in case user is not "pi")
# v1.3: some documentation improvement regarding the line endings that needs to be LF for this file
# v1.2: added the movement name to be transfered to the Python script in vibration calibration (to print it on the result graphs)
# v1.1: multiple fixes and tweaks (mainly to avoid having empty files read by the python scripts after the mv command)
# v1.0: first version of the script based on a Zellneralex script
# Installation:
# 1. Copy this file somewhere in your config folder and edit the parameters below if needed
# Note: If using Windows to do the copy/paste, be careful with the line endings for this file: LF (or \n) is mandatory !!! No \r should be
# present in the file as it could lead to some errors like "\r : unknown command" when running the script. If you're not confident
# regarding your text editor behavior, the best way is to directly download the file on the pi by using for example wget:
# type 'wget -P ~/printer_data/config/scripts https://raw.githubusercontent.com/Frix-x/klippain/main/scripts/plot_graphs.sh'
# 2. Make it executable using SSH: type 'chmod +x ~/printer_data/config/scripts/plot_graphs.sh' (adjust the path if needed).
# 3. Be sure to have the gcode_shell_command.py Klipper extension installed (easiest way to install it is to use KIAUH in the Advanced section)
# 4. Create a gcode_shell_command to be able to start it from a macro (see my shell_commands.cfg file)
# Usage:
# This script was designed to be used with gcode_shell_commands. Use it to call it.
# Parameters availables:
# SHAPER - To generate input shaper diagrams after calling the Klipper TEST_RESONANCES AXIS=X/Y
# BELTS - To generate belts diagrams after calling the Klipper TEST_RESONANCES AXIS=1,(-)1 OUTPUT=raw_data
# VIBRATIONS - To generate vibration diagram after calling the custom (Frix_x#0161) VIBRATIONS_CALIBRATION macro
#################################################################################################################
RESULTS_FOLDER=/home/miguel/printer_data/config/shaper_results # Path to the folder where storing the results files
SCRIPTS_FOLDER=~/printer_data/config/scripts # Path to the folder where the graph_vibrations.py is located
KLIPPER_FOLDER=~/klipper # Path of the klipper main folder
STORE_RESULTS=3 # Number of results to keep (older files are automatically cleaned). 0 to keep them indefinitely
#################################################################################################################
#####################################################################
################ !!! DO NOT EDIT BELOW THIS LINE !!! ################
#####################################################################
export LC_ALL=C
function is_fopen() {
filepath=$(realpath "$1")
for pid in $(ls /proc | grep -E '^[0-9]+$'); do
if [ -d "/proc/$pid/fd" ]; then
for fd in /proc/$pid/fd/*; do
if [ -L "$fd" ] && [ "$(readlink -f "$fd")" == "$filepath" ]; then
return 0
fi
done
fi
done
return 1
}
function plot_shaper_graph {
local generator filename newfilename date axis
generator="${KLIPPER_FOLDER}/scripts/calibrate_shaper.py"
# For each file
while read filename; do
# Wait for the file handler to be released by Klipper
while is_fopen "${filename}"; do
sleep 3
done
# We remove the /tmp in front of the filename
newfilename="$(echo ${filename} | sed -e "s/\\/tmp\///")"
# We check if there is the position added by Klipper and remove it
if [[ ${newfilename} =~ ^resonances_[[:alpha:]]_([0-9]*\.)+[0-9]*_ ]]; then
newfilename="$(echo ${newfilename} | sed -E 's/(^resonances_[[:alpha:]])_(([0-9]*\.)+[0-9]*_)+/\1_/')"
fi
# We extract the date and axis name from the filename
date="$(basename "${newfilename}" | cut -d '.' -f1 | awk -F'_' '{print $3"_"$4}')"
axis="$(basename "${newfilename}" | cut -d '_' -f2)"
# Then we move the file to the result folder
mv "${filename}" "${isf}"/inputshaper/"${newfilename}"
sync && sleep 2
# Finally we compute the shaper graphs
"${generator}" "${isf}"/inputshaper/"${newfilename}" -o "${isf}"/inputshaper/resonances_"${axis}"_"${date}".png
done <<< "$(find /tmp -type f -name "resonances_*.csv" 2>&1 | grep -v "Permission")"
}
function plot_belts_graph {
local date_ext generator filename belt
date_ext="$(date +%Y%m%d_%H%M%S)"
generator="${KLIPPER_FOLDER}/scripts/graph_accelerometer.py"
# For each file
while read filename; do
# Wait for the file handler to be released by Klipper
while is_fopen "${filename}"; do
sleep 3
done
# We extract the belt tested from the filename
belt="$(basename "${filename}" | cut -d '_' -f4 | cut -d '.' -f1 | sed -e 's/\(.*\)/\U\1/')"
# And we move it to the result folder while injecting the date and belt inside the filename
mv "${filename}" "${isf}"/belts/belt_"${date_ext}"_"${belt}".csv
done <<< "$(find /tmp -type f -name "raw_data_axis*.csv" 2>&1 | grep -v "Permission")"
sync && sleep 2
# Finally we compute the belts graph
"${generator}" -c "${isf}"/belts/belt_"${date_ext}"_*.csv -o "${isf}"/belts/belts_"${date_ext}".png
}
function plot_vibr_graph {
local date_ext generator filename newfilename
date_ext="$(date +%Y%m%d_%H%M%S)"
generator="${SCRIPTS_FOLDER}/graph_vibrations.py"
# For each file
while read filename; do
# Wait for the file handler to be released by Klipper
while is_fopen "${filename}"; do
sleep 3
done
# Cleanup of the filename and moving it in the result folder
newfilename="$(echo ${filename} | sed -e "s/\\/tmp\/adxl345/vibr_${date_ext}/")"
mv "${filename}" "${isf}"/vibrations/"${newfilename}"
done <<< "$(find /tmp -type f -name "adxl345-*.csv" 2>&1 | grep -v "Permission")"
sync && sleep 2
# We compute the vibration graphs using all the csv files
"${generator}" "${isf}"/vibrations/vibr_"${date_ext}"*.csv -o "${isf}"/vibrations/vibrations_"${date_ext}".png -a "$1" -k "${KLIPPER_FOLDER}"
# Finally we cleanup the folder by moving the csv files in an archive
tar cfz "${isf}"/vibrations/vibrations_"${date_ext}".tar.gz "${isf}"/vibrations/vibr_"${date_ext}"*.csv
rm "${isf}"/vibrations/vibr_"${date_ext}"*.csv
}
function clean_files {
local filename keep1 keep2 old csv date
keep1=$(( ${STORE_RESULTS} + 1 ))
keep2=$(( ${STORE_RESULTS} * 2 + 1))
while read filename; do
if [ ! -z "${filename}" ]; then
old+=("${filename}")
csv="$(basename "${filename}" | cut -d '.' -f1)"
old+=("${isf}"/inputshaper/"${csv}".csv)
fi
done <<< "$(find "${isf}"/inputshaper/ -type f -name '*.png' -printf '%T@ %p\n' | sort -k 1 -n -r | sed 's/^[^ ]* //' | tail -n +"${keep2}")"
while read filename; do
if [ ! -z "${filename}" ]; then
old+=("${filename}")
date="$(basename "${filename}" | cut -d '.' -f1 | awk -F'_' '{print $2"_"$3}')"
old+=("${isf}"/belts/belt_"${date}"_A.csv)
old+=("${isf}"/belts/belt_"${date}"_B.csv)
fi
done <<< "$(find "${isf}"/belts/ -type f -name '*.png' -printf '%T@ %p\n' | sort -k 1 -n -r | sed 's/^[^ ]* //' | tail -n +"${keep1}")"
while read filename; do
if [ ! -z "${filename}" ]; then
old+=("${filename}")
csv="$(basename "${filename}" | cut -d '.' -f1)"
old+=("${isf}"/vibrations/"${csv}".tar.gz)
fi
done <<< "$(find "${isf}"/vibrations/ -type f -name '*.png' -printf '%T@ %p\n' | sort -k 1 -n -r | sed 's/^[^ ]* //' | tail -n +"${keep1}")"
if [ "${#old[@]}" -ne 0 -a "${STORE_RESULTS}" -ne 0 ]; then
for rmv in "${old[@]}"; do
rm "${rmv}"
done
fi
}
#############################
### MAIN ####################
#############################
if [ ! -d "${RESULTS_FOLDER}/inputshaper" ]; then
mkdir -p "${RESULTS_FOLDER}/inputshaper"
fi
if [ ! -d "${RESULTS_FOLDER}/belts" ]; then
mkdir -p "${RESULTS_FOLDER}/belts"
fi
if [ ! -d "${RESULTS_FOLDER}/vibrations" ]; then
mkdir -p "${RESULTS_FOLDER}/vibrations"
fi
isf="${RESULTS_FOLDER//\~/${HOME}}"
case ${1} in
SHAPER|shaper)
plot_shaper_graph
;;
BELTS|belts)
plot_belts_graph
;;
VIBRATIONS|vibrations)
plot_vibr_graph ${2}
;;
*)
echo -e "\nUsage:"
echo -e "\t${0} SHAPER, BELTS or VIBRATIONS"
echo -e "\t\tSHAPER\tGenerate input shaper diagram"
echo -e "\t\tBELT\tGenerate belt tension diagram"
echo -e "\t\tVIBRATIONS axis-name\tGenerate vibration response diagram\n"
exit 1
esac
clean_files
echo "Graphs created. You will find the results in ${isf}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

View file

@ -0,0 +1,17 @@
#### Sonar - A WiFi Keepalive daemon
####
#### Written by Stephan Wendel aka KwadFan <me@stephanwe.de>
#### Copyright 2022
#### https://github.com/mainsail-crew/sonar
####
#### This File is distributed under GPLv3
####
[sonar]
enable: false # false to disable till next reboot (will stop again if not set to true)
debug_log: false # if set to true, sonar will log ever ping with triptime and date/time
persistant_log: false # If true logs in /var/log/sonar.log, false logs to systemd
target: auto # IP Address, URL or auto as ping target
count: 3 # How often should be pinged?
interval: 60 # Ping again after X seconds
restart_treshold: 10 # If failed, restart WiFi after X seconds

View file

@ -0,0 +1,254 @@
# Macros for setting the status leds on the Voron StealthBurner toolhead (or for any neopixel-type leds).
#
# You will need to configure a neopixel (or other addressable led, such as dotstar). See
# https://www.klipper3d.org/Config_Reference.html#neopixel for configuration details.
#####################################
# INSTRUCTIONS #
#####################################
# How to use all this stuff:
#
# 1. Copy this .cfg file into your Klipper config directory and then add [include stealthburner_leds.cfg]
# to the top of your printer.cfg in order to register the LEDs and macros with Klipper.
# 2. Define your LEDs by editing [neopixel sb_leds] below and entering the data pin from your control board
# as well as the color order.
#
# Note: RGB and RGBW are different and must be defined explicitly. RGB and RGBW are also not able to
# be mix-and-matched in the same chain. A separate data line would be needed for proper functioning.
#
# RGBW LEDs will have a visible yellow-ish phosphor section to the chip. If your LEDs do not have
# this yellow portion, you have RGB LEDs.
#
# 3. Save your config and restart Klipper.
#
# Note: We set RED and BLUE to 1.0 to make it easier for users and supporters to detect
# misconfigurations or miswiring. The default color format is for Neopixels with a dedicated
# white LED. On startup, all three SB LEDs should light up.
#
# If you get random colors across your LEDs, change the color_order to GRB and restart. Then
# omit the W for each suggested color_order in the next paragraph.
#
# If you get MAGENTA, your color order is correct. If you get CYAN, you need to use RGBW. If
# you get YELLOW, you need to use BRGW (note that BRG is only supported in the latest Klipper
# version).
#
# 4. Once you have confirmed that the LEDs are set up correctly, you must now decide where you want
# these macros called up...which means adding them to your existing gcode macros. NOTHING will happen
# unless you add the STATUS_????? macros to your existing gcode macros.
#
# Example: add STATUS_LEVELING to the beginning of your QGL gcode macro, and then add STATUS_READY
# to the end of it to set the logo LED and nozzle LEDs back to the `ready` state.
#
# Example: add STATUS_CLEANING to the beginning of your nozzle-cleaning macro, and then STATUS_READY
# to the end of it to return the LEDs back to `ready` state.
#
# 5. Feel free to change colors of each macro, create new ones if you have a need to. The macros provided below
# are just an example of what is possible. If you want to try some more complex animations, you will most
# likely have to use WLED with Moonraker and a small micro-controller
#
#####################################
# END INSTRUCTRUCTIONS #
#####################################
[neopixel sb_leds]
pin: PB0
# The pin connected to the neopixel. This parameter must be provided.
chain_count: 3
# The number of Neopixel chips that are "daisy chained" to the
# provided pin. The default is 1 (which indicates only a single
# Neopixel is connected to the pin).
color_order: GRB
# Set the pixel order required by the LED hardware. Options are GRB,
# RGB, GRBW, or RGBW. The default is GRB.
initial_RED: 1.0
initial_GREEN: 0.0
initial_BLUE: 1.0
initial_WHITE: 0.0
# Sets the initial LED color of the Neopixel. Each value should be
# between 0.0 and 1.0. The WHITE option is only available on RGBW
# LEDs. The default for each color is 0.#
# Most configuration for the macros can be done by modifying the variables in the _sb_vars macro
# at the start of this file.
##########
# MACROS #
##########
# The following status macros are available (these go inside of your macros):
#
# STATUS_READY
# STATUS_OFF
# STATUS_BUSY
# STATUS_HEATING
# STATUS_LEVELING
# STATUS_HOMING
# STATUS_CLEANING
# STATUS_MESHING
# STATUS_CALIBRATING_Z
#
# With additional macros for basic control:
#
# SET_NOZZLE_LEDS_ON
# SET_LOGO_LEDS_OFF
# SET_NOZZLE_LEDS_OFF
#
# Contributed by Voron discord users wile.e, Tetsunosuke, and etherwalker
[gcode_macro _sb_vars]
# User settings for the StealthBurner status leds. You can change the status colors and led
# configurations for the logo and nozzle here.
variable_colors: {
'logo': { # Colors for logo states
'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0},
'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0},
'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0},
'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0},
'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0},
'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0},
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1},
},
'nozzle': { # Colors for nozzle states
'heating': {'r': 0.8, 'g': 0.35, 'b': 0.0, 'w':0.0},
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0},
'standby': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0},
},
'thermal': {
'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0}
}
}
variable_logo_led_name: "sb_leds"
# The name of the addressable LED chain that contains the logo LED(s)
variable_logo_idx: "1"
# A comma-separated list of indexes LEDs in the logo
variable_nozzle_led_name: "sb_leds"
# The name of the addressable LED chain that contains the nozzle LED(s). This will
# typically be the same LED chain as the logo.
variable_nozzle_idx: "2,3"
# A comma-separated list of indexes of LEDs in the nozzle
gcode:
# This section is required. Do Not Delete.
[gcode_macro _set_sb_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = params.LED|string %}
{% set idx = (params.IDX|string).split(',') %}
{% set transmit_last = params.TRANSMIT|default(1) %}
{% for led_index in idx %}
{% set transmit=transmit_last if loop.last else 0 %}
set_led led={led} red={red} green={green} blue={blue} white={white} index={led_index} transmit={transmit}
{% endfor %}
[gcode_macro _set_sb_leds_by_name]
gcode:
{% set leds_name = params.LEDS %}
{% set color_name = params.COLOR %}
{% set color = printer["gcode_macro _sb_vars"].colors[leds_name][color_name] %}
{% set led = printer["gcode_macro _sb_vars"][leds_name + "_led_name"] %}
{% set idx = printer["gcode_macro _sb_vars"][leds_name + "_idx"] %}
{% set transmit = params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={color.r} green={color.g} blue={color.b} white={color.w} idx="{idx}" transmit={transmit}
[gcode_macro _set_logo_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer["gcode_macro _sb_vars"].logo_led_name %}
{% set idx = printer["gcode_macro _sb_vars"].logo_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
[gcode_macro _set_nozzle_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer["gcode_macro _sb_vars"].nozzle_led_name %}
{% set idx = printer["gcode_macro _sb_vars"].nozzle_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
[gcode_macro set_logo_leds_off]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_logo_leds red=0 blue=0 green=0 white=0 transmit={transmit}
[gcode_macro set_nozzle_leds_on]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds_by_name leds="nozzle" color="on" transmit={transmit}
[gcode_macro set_nozzle_leds_off]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_sb_leds_by_name leds="nozzle" color="off" transmit={transmit}
[gcode_macro status_off]
gcode:
set_logo_leds_off transmit=0
set_nozzle_leds_off
[gcode_macro status_ready]
gcode:
_set_sb_leds_by_name leds="logo" color="standby" transmit=0
_set_sb_leds_by_name leds="nozzle" color="standby" transmit=1
[gcode_macro status_busy]
gcode:
_set_sb_leds_by_name leds="logo" color="busy" transmit=0
set_nozzle_leds_on
[gcode_macro status_heating]
gcode:
_set_sb_leds_by_name leds="logo" color="heating" transmit=0
_set_sb_leds_by_name leds="nozzle" color="heating" transmit=1
[gcode_macro status_leveling]
gcode:
_set_sb_leds_by_name leds="logo" color="leveling" transmit=0
set_nozzle_leds_on
[gcode_macro status_homing]
gcode:
_set_sb_leds_by_name leds="logo" color="homing" transmit=0
set_nozzle_leds_on
[gcode_macro status_cleaning]
gcode:
_set_sb_leds_by_name leds="logo" color="cleaning" transmit=0
set_nozzle_leds_on
[gcode_macro status_meshing]
gcode:
_set_sb_leds_by_name leds="logo" color="meshing" transmit=0
set_nozzle_leds_on
[gcode_macro status_calibrating_z]
gcode:
_set_sb_leds_by_name leds="logo" color="calibrating_z" transmit=0
set_nozzle_leds_on
[gcode_macro status_printing]
gcode:
_set_sb_leds_by_name leds="logo" color="printing" transmit=0
set_nozzle_leds_on