From 3a9cb57f310b2978d78ece4cfaf5c94a089e9c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Boisselier?= Date: Wed, 29 Nov 2023 12:04:59 +0100 Subject: [PATCH] splitted cfg files to allow a selection of only some of the macros --- K-ShakeTune/IS_shaper_calibrate.cfg | 112 ------------------ K-ShakeTune/K-SH_axis.cfg | 47 ++++++++ K-ShakeTune/K-SH_belts.cfg | 24 ++++ K-ShakeTune/K-SH_static_freq.cfg | 24 ++++ ...s_measurements.cfg => K-SH_vibrations.cfg} | 8 -- ...{IS_workflow_cmd.cfg => shaketune_cmd.cfg} | 0 6 files changed, 95 insertions(+), 120 deletions(-) delete mode 100644 K-ShakeTune/IS_shaper_calibrate.cfg create mode 100644 K-ShakeTune/K-SH_axis.cfg create mode 100644 K-ShakeTune/K-SH_belts.cfg create mode 100644 K-ShakeTune/K-SH_static_freq.cfg rename K-ShakeTune/{IS_vibrations_measurements.cfg => K-SH_vibrations.cfg} (95%) rename K-ShakeTune/{IS_workflow_cmd.cfg => shaketune_cmd.cfg} (100%) diff --git a/K-ShakeTune/IS_shaper_calibrate.cfg b/K-ShakeTune/IS_shaper_calibrate.cfg deleted file mode 100644 index baf2bae..0000000 --- a/K-ShakeTune/IS_shaper_calibrate.cfg +++ /dev/null @@ -1,112 +0,0 @@ -################################################ -###### STANDARD INPUT_SHAPER CALIBRATIONS ###### -################################################ -# Written by Frix_x#0161 # -# @version: 1.5 - -# CHANGELOG: -# v1.5: modified EXCITATE_AXIS_AT_FREQ to allow A or B belt testing -# v1.4: added possibility to only run one axis at a time for the axes shaper calibration -# 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 - - -### 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: Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter -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 %} - {% set axis = params.AXIS|default("all")|string|lower %} - - {% set X, Y = False, False %} - - {% if axis == "all" %} - {% set X, Y = True, True %} - {% elif axis == "x" %} - {% set X = True %} - {% elif axis == "y" %} - {% set Y = True %} - {% else %} - { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } - {% endif %} - - {% if X %} - TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} - M400 - - {% if verbose %} - RESPOND MSG="X axis frequency profile generation..." - RESPOND MSG="This may take some time (1-3min)" - {% endif %} - RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER - {% endif %} - - {% if Y %} - TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} - M400 - - {% if verbose %} - RESPOND MSG="Y axis frequency profile generation..." - RESPOND MSG="This may take some time (1-3min)" - {% endif %} - RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER - {% endif %} - - -[gcode_macro BELTS_SHAPER_CALIBRATION] -description: Perform a custom half-axis test to analyze and compare the frequency profiles of individual 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="Belts comparative frequency profile generation..." - RESPOND MSG="This may take some time (3-5min)" - {% endif %} - RUN_SHELL_COMMAND CMD=shaketune PARAMS=BELTS - - -[gcode_macro EXCITATE_AXIS_AT_FREQ] -description: Maintain a specified input shaper excitation frequency for a period of time to diagnose and locate a source of vibration -gcode: - {% set frequency = params.FREQUENCY|default(25)|int %} - {% set time = params.TIME|default(10)|int %} - {% set axis = params.AXIS|default("x")|string|lower %} - - {% if axis not in ["x", "y", "a", "b"] %} - { action_raise_error("AXIS selection invalid. Should be either x, y, a or b!") } - {% endif %} - - {% if axis == "a" %} - {% set axis = "1,-1" %} - {% elif axis == "b" %} - {% set axis = "1,1" %} - {% endif %} - - TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} - M400 diff --git a/K-ShakeTune/K-SH_axis.cfg b/K-ShakeTune/K-SH_axis.cfg new file mode 100644 index 0000000..69da343 --- /dev/null +++ b/K-ShakeTune/K-SH_axis.cfg @@ -0,0 +1,47 @@ +################################################ +###### STANDARD INPUT_SHAPER CALIBRATIONS ###### +################################################ +# Written by Frix_x#0161 # + +[gcode_macro AXES_SHAPER_CALIBRATION] +description: Perform standard axis input shaper tests on one or both XY axes to select the best input shaper filter +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 %} + {% set axis = params.AXIS|default("all")|string|lower %} + + {% set X, Y = False, False %} + + {% if axis == "all" %} + {% set X, Y = True, True %} + {% elif axis == "x" %} + {% set X = True %} + {% elif axis == "y" %} + {% set Y = True %} + {% else %} + { action_raise_error("AXIS selection invalid. Should be either all, x or y!") } + {% endif %} + + {% if X %} + TEST_RESONANCES AXIS=X OUTPUT=raw_data NAME=x FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} + M400 + + {% if verbose %} + RESPOND MSG="X axis frequency profile generation..." + RESPOND MSG="This may take some time (1-3min)" + {% endif %} + RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER + {% endif %} + + {% if Y %} + TEST_RESONANCES AXIS=Y OUTPUT=raw_data NAME=y FREQ_START={min_freq} FREQ_END={max_freq} HZ_PER_SEC={hz_per_sec} + M400 + + {% if verbose %} + RESPOND MSG="Y axis frequency profile generation..." + RESPOND MSG="This may take some time (1-3min)" + {% endif %} + RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER + {% endif %} diff --git a/K-ShakeTune/K-SH_belts.cfg b/K-ShakeTune/K-SH_belts.cfg new file mode 100644 index 0000000..4ee8e88 --- /dev/null +++ b/K-ShakeTune/K-SH_belts.cfg @@ -0,0 +1,24 @@ +################################################ +###### STANDARD INPUT_SHAPER CALIBRATIONS ###### +################################################ +# Written by Frix_x#0161 # + +[gcode_macro BELTS_SHAPER_CALIBRATION] +description: Perform a custom half-axis test to analyze and compare the frequency profiles of individual 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="Belts comparative frequency profile generation..." + RESPOND MSG="This may take some time (3-5min)" + {% endif %} + RUN_SHELL_COMMAND CMD=shaketune PARAMS=BELTS diff --git a/K-ShakeTune/K-SH_static_freq.cfg b/K-ShakeTune/K-SH_static_freq.cfg new file mode 100644 index 0000000..fb410d8 --- /dev/null +++ b/K-ShakeTune/K-SH_static_freq.cfg @@ -0,0 +1,24 @@ +################################################ +###### STANDARD INPUT_SHAPER CALIBRATIONS ###### +################################################ +# Written by Frix_x#0161 # + +[gcode_macro EXCITATE_AXIS_AT_FREQ] +description: Maintain a specified excitation frequency for a period of time to diagnose and locate a source of vibration +gcode: + {% set frequency = params.FREQUENCY|default(25)|int %} + {% set time = params.TIME|default(10)|int %} + {% set axis = params.AXIS|default("x")|string|lower %} + + {% if axis not in ["x", "y", "a", "b"] %} + { action_raise_error("AXIS selection invalid. Should be either x, y, a or b!") } + {% endif %} + + {% if axis == "a" %} + {% set axis = "1,-1" %} + {% elif axis == "b" %} + {% set axis = "1,1" %} + {% endif %} + + TEST_RESONANCES OUTPUT=raw_data AXIS={axis} FREQ_START={frequency-1} FREQ_END={frequency+1} HZ_PER_SEC={1/(time/3)} + M400 diff --git a/K-ShakeTune/IS_vibrations_measurements.cfg b/K-ShakeTune/K-SH_vibrations.cfg similarity index 95% rename from K-ShakeTune/IS_vibrations_measurements.cfg rename to K-ShakeTune/K-SH_vibrations.cfg index 186c4d7..76e3452 100644 --- a/K-ShakeTune/IS_vibrations_measurements.cfg +++ b/K-ShakeTune/K-SH_vibrations.cfg @@ -2,14 +2,6 @@ ###### VIBRATIONS AND SPEED OPTIMIZATIONS ###### ################################################ # Written by Frix_x#0161 # -# @version: 2.2 - -# CHANGELOG: -# v2.2: allow custom accel values and set sane defaults (3k) to avoid using very high accels that produce bad results -# v2.1: allow decimal entries for speed and increment and added the E axis as an option to be neasured -# v2.0: added the possibility to measure mutliple axis -# v1.0: first speed and vibrations optimization macro - [gcode_macro VIBRATIONS_CALIBRATION] gcode: diff --git a/K-ShakeTune/IS_workflow_cmd.cfg b/K-ShakeTune/shaketune_cmd.cfg similarity index 100% rename from K-ShakeTune/IS_workflow_cmd.cfg rename to K-ShakeTune/shaketune_cmd.cfg