From a82fe339efe7e15a6fb26790dcc94e50bc677719 Mon Sep 17 00:00:00 2001 From: Felix Breidenstein Date: Sat, 26 Oct 2024 00:00:06 +0200 Subject: [PATCH 1/3] Better folder detection in helper.sh This way the user could symlink the helper.sh script to something like /usr/bin/ and have it in the path which allows to just call "helper.sh" everywhere in the shell. --- helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper.sh b/helper.sh index fac48fa..4062877 100755 --- a/helper.sh +++ b/helper.sh @@ -3,7 +3,7 @@ set -e clear -HELPER_SCRIPT_FOLDER="$( cd "$( dirname "${0}" )" && pwd )" +HELPER_SCRIPT_FOLDER="$(dirname "$(readlink -f "$0")")" for script in "${HELPER_SCRIPT_FOLDER}/scripts/"*.sh; do . "${script}"; done for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/"*.sh; do . "${script}"; done for script in "${HELPER_SCRIPT_FOLDER}/scripts/menu/K1/"*.sh; do . "${script}"; done From 2dc6f53aa588c3c916a344eb48be8a5ffa5b03b6 Mon Sep 17 00:00:00 2001 From: probielodan Date: Mon, 4 Nov 2024 00:51:32 -0600 Subject: [PATCH 2/3] Fix incorrect fan speed scaling --- files/macros/fans-control.cfg | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/files/macros/fans-control.cfg b/files/macros/fans-control.cfg index 1b3d508..a9f8cae 100644 --- a/files/macros/fans-control.cfg +++ b/files/macros/fans-control.cfg @@ -99,44 +99,41 @@ gcode: {% if tmp > 0 %} {% if fan == 0 %} {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan0_min) / 255 * tmp %} - {% set f0min = printer["gcode_macro PRINTER_PARAM"].fan0_min %} {% if printer['gcode_macro Qmode'].flag | int == 1 %} - SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={([f0min,value]|max)} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan0_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan0_min + value} {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan0_min) / 2 %} {% else %} - {% set value = ([f0min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} {% endif %} {% else %} - {% set value = ([f0min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan0_min + value %} {% endif %} {% endif %} {% if fan == 1 %} {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan1_min) / 255 * tmp %} - {% set f1min = printer["gcode_macro PRINTER_PARAM"].fan1_min %} {% if printer['gcode_macro Qmode'].flag | int == 1 %} - SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={([f1min,value]|max)} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan1_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan1_min + value} {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan1_min) / 2 %} {% else %} - {% set value = ([f1min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} {% endif %} {% else %} - {% set value = ([f1min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan1_min + value %} {% endif %} {% endif %} {% if fan == 2 %} {% set value = (255 - printer["gcode_macro PRINTER_PARAM"].fan2_min) / 255 * tmp %} - {% set f2min = printer["gcode_macro PRINTER_PARAM"].fan2_min %} {% if printer['gcode_macro Qmode'].flag | int == 1 %} - SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={([f2min,value]|max)} + SET_GCODE_VARIABLE MACRO=Qmode VARIABLE=fan2_value VALUE={printer["gcode_macro PRINTER_PARAM"].fan2_min + value} {% if value > (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + (255 - printer['gcode_macro PRINTER_PARAM'].fan2_min) / 2 %} {% else %} - {% set value = ([f2min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} {% endif %} {% else %} - {% set value = ([f2min,tmp]|max) %} + {% set value = printer["gcode_macro PRINTER_PARAM"].fan2_min + value %} {% endif %} {% endif %} {% endif %} From c41d170cdbd741f420ac8cab61f2a692abb19a7e Mon Sep 17 00:00:00 2001 From: Cyril Date: Wed, 13 Nov 2024 13:16:10 +0100 Subject: [PATCH 3/3] Update improved-shapers.cfg --- files/improved-shapers/improved-shapers.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/improved-shapers/improved-shapers.cfg b/files/improved-shapers/improved-shapers.cfg index db570ec..d810b9f 100644 --- a/files/improved-shapers/improved-shapers.cfg +++ b/files/improved-shapers/improved-shapers.cfg @@ -70,13 +70,13 @@ gcode: M400 RESPOND TYPE=command MSG="Generating X Graph... This may take some time." RUN_SHELL_COMMAND CMD=resonance_graph PARAMS="/tmp/resonances_x_x.csv -o {x_png}" - RESPOND TYPE=command MSG="X Graph (resonances_x.png) is now available in /Helper-Script/improved-shapers folder." + RESPOND TYPE=command MSG="X Graph is now available at {x_png}." RESPOND TYPE=command MSG="Testing Y Resonances..." TEST_RESONANCES AXIS=Y NAME=y M400 RESPOND TYPE=command MSG="Generating Y Graph... This may take some time." RUN_SHELL_COMMAND CMD=resonance_graph PARAMS="/tmp/resonances_y_y.csv -o {y_png}" - RESPOND TYPE=command MSG="Y Graph (resonances_y.png) is now available in /Helper-Script/improved-shapers folder." + RESPOND TYPE=command MSG="Y Graph is now available at {y_png}." {% if printer["configfile"].config["temperature_fan soc_fan"] %} SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45 {% endif %} @@ -107,7 +107,7 @@ gcode: M400 RESPOND TYPE=command MSG="Generating Belts Frequency Profiles Graph... This may take some time." RUN_SHELL_COMMAND CMD=belts_graph PARAMS="-w {png_width} -l {png_height} -n -o {png_out_path} -k /usr/share/klipper /tmp/raw_data_axis=1.000,-1.000_a.csv /tmp/raw_data_axis=1.000,1.000_b.csv" - RESPOND TYPE=command MSG="Graph (belts_calibration.png) is now available in /Helper-Script/improved-shapers folder." + RESPOND TYPE=command MSG="Belts Graph is now available at {png_out_path}." {% if printer["configfile"].config["temperature_fan soc_fan"] %} SET_TEMPERATURE_FAN_TARGET TEMPERATURE_FAN=soc_fan TARGET=45 {% endif %}