Giter Club home page Giter Club logo

klippain-shaketune's Introduction

Klipper Shake&Tune Module

This "Shake&Tune" repository is a standalone module from the Klippain ecosystem, designed to automate and calibrate the input shaper system on your Klipper 3D printer with a streamlined workflow and insightful vizualisations. This can be installed on any Klipper machine. It is not limited to those using Klippain.

logo banner

It operates in two steps:

  1. Utilizing specially tailored Klipper macros, it initiates tests on either the belts or the printer X/Y axis to measure the machine axes behavior. This is basically an automated call to the Klipper TEST_RESONANCES macro with custom parameters.
  2. Then a custom Python script is called to:
    1. Generate insightful and improved graphs, aiding in parameter tuning for the Klipper [input_shaper] system (including best shaper choice, resonant frequency and damping ratio) or diagnosing and rectifying mechanical issues (like belt tension, defective bearings, etc..)
    2. Relocates the graphs and associated CSV files to your Klipper config folder for easy access via Mainsail/Fluidd to eliminate the need for SSH.
    3. Manages the folder by retaining only the most recent results (default setting of keeping the latest three sets).

Check out the detailed documentation of the Shake&Tune module here. You can also look at the documentation for each type of graph by directly clicking on them below to better understand your results and tune your machine!

Belts graph Axis input shaper graphs Vibrations graph

Note:

Be aware that Shake&Tune uses the Gcode shell command plugin under the hood to call the Python scripts that generate the graphs. While my scripts should be safe, the Gcode shell command plugin also has great potential for abuse if not used carefully for other purposes, since it opens shell access from Klipper.

Installation

Follow these steps to install the Shake&Tune module in your printer:

  1. Be sure to have a working accelerometer on your machine and a [resonance_tester] section defined. You can follow the official Measuring Resonances Klipper documentation to configure it.
  2. Install the Shake&Tune package by running over SSH on your printer:
    wget -O - https://raw.githubusercontent.com/Frix-x/klippain-shaketune/main/install.sh | bash
  3. Then, append the following to your printer.cfg file and restart Klipper (if prefered, you can include only the needed macros: using *.cfg is a convenient way to include them all at once):
    [include K-ShakeTune/*.cfg]
    

Usage

Ensure your machine is homed, then invoke one of the following macros as needed:

  • AXES_MAP_CALIBRATION to automatically find Klipper's axes_map parameter for your accelerometer orientation (be careful, this is experimental for now and known to give bad results).
  • COMPARE_BELTS_RESPONSES for a differential belt resonance graph, useful for checking relative belt tensions and belt path behaviors on a CoreXY printer.
  • AXES_SHAPER_CALIBRATION for standard input shaper graphs, used to mitigate ringing/ghosting by tuning Klipper's input shaper filters.
  • CREATE_VIBRATIONS_PROFILE for vibrations graphs as a function of toolhead direction and speed, used to find problematic ranges where the printer could be exposed to more VFAs and optimize your slicer speed profiles and TMC driver parameters.
  • EXCITATE_AXIS_AT_FREQ to maintain a specific excitation frequency, useful to inspect and find out what is resonating.

For further insights on the usage of these macros and the generated graphs, refer to the K-Shake&Tune module documentation.

klippain-shaketune's People

Contributors

fog-yamato avatar fragmon avatar frix-x avatar shinanca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

klippain-shaketune's Issues

Can't install to K1C

K-Shake&Tune module branch

  • I confirm using the main branch

Version

1.3.3.5

Describe the bug and expected behavior

image

Additional information and klippy.log

No response

Install Error - Python & matplot version

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0

Describe the bug and expected behavior

I got this Error: ERROR: Ignored the following versions that require a different python version: 3.6.0 Requires-Python >=3.8; 3.6.0rc1 Requires-Python >=3.8; 3.6.0rc2 Requires-Python >=3.8; 3.6.1 Requires-Python >=3.8; 3.6.2 Requires-Python >=3.8; 3.6.3 Requires-Python >=3.8; 3.7.0 Requires-Python >=3.8; 3.7.0rc1 Requires-Python >=3.8; 3.7.1 Requires-Python >=3.8; 3.7.2 Requires-Python >=3.8; 3.7.3 Requires-Python >=3.8; 3.7.4 Requires-Python >=3.8; 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement matplotlib==3.8.2 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4.0rc1, 3.4.0rc2, 3.4.0rc3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.0b1, 3.5.0rc1, 3.5.0, 3.5.1, 3.5.2, 3.5.3)
ERROR: No matching distribution found for matplotlib==3.8.2

Current Version:
pi@mainsailos:~ $ python3.8 --version
Python 3.8.10

pi@mainsailos:~ $ python3 -m pip show matplotlib
Name: matplotlib
Version: 3.3.4

thx Domluu

Additional information and klippy.log

No response

Idea: put default amount of keep_results into a variables file

Describe the feature or hardware support you'd like

I think it would be nice, to be able to alter the default amount of keep_results without having to specify it in the command every time.
Solution would be rather easy, have one variable file, that gets copied instead of symlinked and the install script checks whether it already exists (if not, it gets copied, if it exists, it wont)
(I can do a pr for it, just wanted to check whether you would even consider it first)

Additional context or information

No response

No CSV files found in the /tmp folder to create the vibration graphs!

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-0-g84c406b4

Describe the bug and expected behavior

After running Vibrations Calibrations or Axes Map Calibration I received the No CSV files found in the /tmp folder to create the vibration graphs! in the cli windows. I have checked the /tmp file and the files are indeed present

Additional information and klippy.log

No response

Installation issue "Someone may have tampered with them"

K-Shake&Tune module branch

  • I confirm using the main branch

Version

V2.5.0

Describe the bug and expected behavior

when running the install script, the installation fails with the following error:

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
scipy==1.11.4 from https://www.piwheels.org/simple/scipy/scipy-1.11.4-cp39-cp39-linux_armv7l.whl#sha256=f719eaac73021b7ae4848de9ab76160b264c8a2726a5141090c178d0db131739 (from -r /home/pi/klippain_shaketune/requirements.txt (line 4)):
Expected sha256 f719eaac73021b7ae4848de9ab76160b264c8a2726a5141090c178d0db131739
Got 92b2e6ce020a771b5ed2517d0521b2b1cf60f4c22e1ce6d0a5b6ec57d3217ca9

Additional information and klippy.log

No response

need to add dependancy "Matplotlib"

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-2-g2a627a1f

Describe the bug and expected behavior

After running the Axes shaper calibration I was getting the following error. as found that the matplotlib and lumpy was not installed suggest adding them to the dependance check list.

Traceback (most recent call last):
File "/home/pi/printer_data/config/scripts/is_workflow/is_workflow.py", line 43, in
from graph_belts import belts_calibration
File "/home/pi/klippain_config/scripts/is_workflow/graph_belts.py", line 21, in
import optparse, matplotlib, sys, importlib, os
ModuleNotFoundError: No module named 'matplotlib'

Additional information and klippy.log

No response

Axes shaper calibration graph plot fails with: "TypeError: unsupported operand type(s) for ** or pow(): 'function' and 'int'"

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.6.0-1-gf4e700a1

Describe the bug and expected behavior

When running axes shaper calibration the raw accelerometer csv files are generated correctly, but the graph plot script fails with attached error.

Additional information and klippy.log

File "/home/ppacheco/klipper/klippy/extras/shaper_calibrate.py", line 330, in find_best_shaper
shaper = self.background_process_exec(self.fit_shaper, (
File "/home/ppacheco/klipper/klippy/extras/shaper_calibrate.py", line 74, in background_process_exec
return method(*args)
File "/home/ppacheco/klipper/klippy/extras/shaper_calibrate.py", line 260, in fit_shaper
shaper = shaper_cfg.init_func(test_freq, damping_ratio)
File "/home/ppacheco/klipper/klippy/extras/shaper_defs.py", line 18, in get_zv_shaper
df = math.sqrt(1. - damping_ratio**2)
TypeError: unsupported operand type(s) for ** or pow(): 'function' and 'int'

Allow other measuring devices than ADXL345

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v 1.1.2 6e88452

Describe the bug and expected behavior

get_vibrations_graph in is_workflow.py uses hardcoded accelerometer name:
globbed_files = glob.glob('/tmp/adxl345-*.csv')

I do not have adxl345, instead USB lis2dw (biqu). Passing chip name as "hotend" it looks into lis2dw.cfg (I have two probes, one on hotend, one on bed) :

lis2dw.cfg

[mcu lis2dwHotend]
serial: /dev/serial/by-path/platform-5200000.usb-usb-0:1.3:1.0

[mcu lis2dwBed]
serial: /dev/serial/by-path/platform-5200000.usb-usb-0:1.4:1.0

[lis2dw hotend]
cs_pin: lis2dwHotend:gpio9
#spi_bus: spi1a
spi_software_sclk_pin: lis2dwHotend:gpio10
spi_software_mosi_pin: lis2dwHotend:gpio11
spi_software_miso_pin: lis2dwHotend:gpio8
axes_map: -x,y,z

[lis2dw bed]
cs_pin: lis2dwBed:gpio9
#spi_bus: spi1a
spi_software_sclk_pin: lis2dwBed:gpio10
spi_software_mosi_pin: lis2dwBed:gpio11
spi_software_miso_pin: lis2dwBed:gpio8
axes_map: -y,x,z

Macro VIBRATIONS_CALIBRATION generates csv file names based on chip, so graph generation failed on line
globbed_files = glob.glob('/tmp/adxl345-*.csv')

Additional information and klippy.log

No response

Problem installing

K-Shake&Tune module branch

  • I confirm using the main branch

Version

V 2.0.0

Describe the bug and expected behavior

1rt time installing... and tried from the installation I had and with a clean installation.
I always get the same error

If you could help me I would appreciate it very much.

Additional information and klippy.log

Building wheels for collected packages: ninja
Building wheel for ninja (pyproject.toml): started
Building wheel for ninja (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

    × Building wheel for ninja (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [13 lines of output]
        /tmp/pip-build-env-k2ikoigz/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output
          warnings.warn("git archive did not support describe output")
        /tmp/pip-build-env-k2ikoigz/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
          warnings.warn("unprocessed git archival found (no export subst applied)")
        Traceback (most recent call last):
          File "/tmp/pip-build-env-k2ikoigz/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 645, in setup
            cmkr = cmaker.CMaker(cmake_executable)
          File "/tmp/pip-build-env-k2ikoigz/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 148, in __init__
            self.cmake_version = get_cmake_version(self.cmake_executable)
          File "/tmp/pip-build-env-k2ikoigz/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 105, in get_cmake_version
            raise SKBuildError(msg) from err

        Problem with the CMake installation, aborting build. CMake executable is cmake
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for ninja
  Failed to build ninja
  ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

ValueError: array is too big

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-7-gb42e377a

Describe the bug and expected behavior

I saw that this was an issue before, but after installing Shake&Tune a couple of days ago, I'm getting the "ValueError: array is too big; arr.size * arr.dtype.itemsize is larger than the maximum possible size." issue.

I'd appreciate any help someone could provide.

Additional information and klippy.log

klippy.log

ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.1.1, 83f5177

Describe the bug and expected behavior

I am consistently hitting an error deep in the Python guts when trying to run klippain-shaketune on my set up.
It repros 100%, on both X and Y axes. I am attaching one file to repro, but I have more if needed.

Here's the repro steps and full stack trace:

pi@fluiddpi:~/printer_data/config $ ./K-ShakeTune/scripts/graph_shaper.py K-ShakeTune_results/inputshaper/resonances_20231106_220647_X.csv -o test.png
/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py:54: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
  locale.setlocale(locale.LC_TIME, locale.getdefaultlocale())
Fitted shaper 'zv' frequency = 54.4 Hz (vibrations = 10.8%, smoothing ~= 0.058)
To avoid too much smoothing with 'zv', suggested max_accel <= 11500 mm/sec^2
Fitted shaper 'mzv' frequency = 36.0 Hz (vibrations = 2.3%, smoothing ~= 0.157)
To avoid too much smoothing with 'mzv', suggested max_accel <= 3800 mm/sec^2
Fitted shaper 'ei' frequency = 50.4 Hz (vibrations = 0.0%, smoothing ~= 0.127)
To avoid too much smoothing with 'ei', suggested max_accel <= 4700 mm/sec^2
Fitted shaper '2hump_ei' frequency = 54.4 Hz (vibrations = 0.0%, smoothing ~= 0.182)
To avoid too much smoothing with '2hump_ei', suggested max_accel <= 3300 mm/sec^2
Fitted shaper '3hump_ei' frequency = 93.8 Hz (vibrations = 0.0%, smoothing ~= 0.093)
To avoid too much smoothing with '3hump_ei', suggested max_accel <= 6400 mm/sec^2
Recommended shaper is 3hump_ei @ 93.8 Hz
Axis has a main resonant frequency at 55.8Hz with an estimated damping ratio of 0.098
Peaks detected on the graph: 2 @ 55.8, 130.8 Hz (2 above effect threshold)
Traceback (most recent call last):
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 395, in <module>
    main()
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 390, in main
    fig = shaper_calibration(args, options.klipperdir, options.max_smoothing, options.max_freq)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 356, in shaper_calibration
    plot_spectrogram(ax2, datas[0], peaks, max_freq)
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 276, in plot_spectrogram
    pdata, bins, t = compute_spectrogram(data)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 124, in compute_spectrogram
    pdata, bins, t = _specgram(d['x'])
                     ^^^^^^^^^^^^^^^^^
  File "/home/pi/printer_data/config/./K-ShakeTune/scripts/graph_shaper.py", line 119, in _specgram
    return matplotlib.mlab.specgram(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/matplotlib/mlab.py", line 780, in specgram
    spec, freqs, t = _spectral_helper(x=x, y=None, NFFT=NFFT, Fs=Fs,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/matplotlib/mlab.py", line 382, in _spectral_helper
    result = _stride_windows(x, NFFT, noverlap)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/matplotlib/mlab.py", line 258, in _stride_windows
    return np.lib.stride_tricks.sliding_window_view(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<__array_function__ internals>", line 200, in sliding_window_view
  File "/usr/lib/python3/dist-packages/numpy/lib/stride_tricks.py", line 336, in sliding_window_view
    return as_strided(x, strides=out_strides, shape=out_shape,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/numpy/lib/stride_tricks.py", line 105, in as_strided
    array = np.asarray(DummyArray(interface, base=x))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
pi@fluiddpi:~/printer_data/config $ cd K-ShakeTune
pi@fluiddpi:~/printer_data/config/K-ShakeTune $ git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	scripts/__pycache__/

nothing added to commit but untracked files present (use "git add" to track)
pi@fluiddpi:~/printer_data/config/K-ShakeTune $ git show HEAD
commit 83f517758a7690692c1f35c21acf8c448c719771 (HEAD -> main, tag: v1.1.1, origin/main, origin/HEAD)
Merge: 5366ad0 c156459
Author: Félix Boisselier <[email protected]>
Date:   Wed Nov 1 20:09:50 2023 +0100

    Merge pull request #4 from Frix-x/develop
    
    v1.1.1

pi@fluiddpi:~/printer_data/config/K-ShakeTune $ 

Additional information and klippy.log

klippy.log
resonances_20231106_220647_X.zip

Unable to produce graph for v0.2 y-axis - AttributeError: 'NoneType' object has no attribute 'upper'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.0.2-0-gc102d414

Describe the bug and expected behavior

resonances_20231027_213851_Y.csv
Hi,

Printer: Voron v0.2

Thanks for the awesome calibration tools! I have encountered this error a few times with your test branch and have been able to reproduce it with the new release. While I know I have a few issues to work through on Y I wanted to make sure I captured and reported this before continuing to tune the printer and have managed to get Y plotted previously when belt tensions were different. belts works fine for X&Y and IS graphs for X only. IS graphs for Y fails and returns the following exception.

21:38:48
// Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
21:38:48
Y axis shaper graphs generation...
21:38:48
// Running Command {plot_graph}...:
21:39:51
// Fitted shaper 'zv' frequency = 75.8 Hz (vibrations = 17.5%, smoothing ~= 0.033)
// To avoid too much smoothing with 'zv', suggested max_accel <= 22400 mm/sec^2
// Fitted shaper 'mzv' frequency = 46.8 Hz (vibrations = 2.8%, smoothing ~= 0.093)
// To avoid too much smoothing with 'mzv', suggested max_accel <= 6500 mm/sec^2
// Fitted shaper 'ei' frequency = 64.8 Hz (vibrations = 3.4%, smoothing ~= 0.077)
// To avoid too much smoothing with 'ei', suggested max_accel <= 7800 mm/sec^2
// Fitted shaper '2hump_ei' frequency = 62.6 Hz (vibrations = 0.5%, smoothing ~= 0.138)
// To avoid too much smoothing with '2hump_ei', suggested max_accel <= 4400 mm/sec^2
// Fitted shaper '3hump_ei' frequency = 58.8 Hz (vibrations = 0.3%, smoothing ~= 0.237)
// To avoid too much smoothing with '3hump_ei', suggested max_accel <= 2500 mm/sec^2
// Recommended shaper is ei @ 64.8 Hz
// Axis has a resonant frequency ω0=72.5Hz with an estimated damping ratio ζ=0.056
// Peaks detected on the graph: 6 @ 6.2, 47.9, 72.5, 94.2, 131.2, 146.6 Hz (3 above effect threshold)
// Traceback (most recent call last):
// File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 214, in
21:39:51
// main()
// File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 200, in main
21:39:51
// fig, png_filename = get_shaper_graph()
// File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 107, in get_shaper_graph
// fig = shaper_calibration([new_file], KLIPPER_FOLDER)
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 326, in shaper_calibration
21:39:51
// peaks = plot_freq_response_with_damping(ax1, calibration_data, shapers, selected_shaper, fr, zeta, max_freq)
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 233, in plot_freq_response_with_damping
21:39:51
// ax2.plot([], [], ' ', label="Recommended low vibrations shaper: %s @ %.1f Hz" % (no_vibr_shaper.upper(), no_vibr_shaper_freq))
// AttributeError: 'NoneType' object has no attribute 'upper'
resonances_20231027_213851_Y.csv

Additional information and klippy.log

No response

ModuleNotFoundError: No module named 'git'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-0-g84c406b4

Describe the bug and expected behavior

I installed shaketune and included the .cfg in my pritner.cfg. I can run shaketune, but there is no final outcome.
I just installed the shaketune, not the klippain feature.

those are some of the files found in the directory
8 -rwxr-xr-x 1 tom tom 5985 10. Jan 20:55 analyze_axesmap.py
8 -rw-r--r-- 1 tom tom 5075 10. Jan 20:55 common_func.py
24 -rwxr-xr-x 1 tom tom 23446 10. Jan 20:55 graph_belts.py

I use :
Klippain-ShakeTune
v2.5.0-0-g84c406b4
Computer:
Intel(R) Celeron(R) J4105 CPU @ 1.50GHz
7.5 GB
64bit x86_64 with 4 cores
Debian GNU/Linux 11 (bullseye)

Additional information and klippy.log

Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
Running Command {shaketune}...:
ADXL345 finished 'adxl345' measurements
Stats 17379.8: gcodein=0 mcu: mcu_awake=0.284 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=3864725 bytes_read=1026706 bytes_retransmit=0 bytes_invalid=0 send_seq=82677 receive_seq=82677 retransmit_seq=0 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=180001868 sht36: mcu_awake=1.122 mcu_task_avg=0.000048 mcu_task_stddev=0.000028 bytes_write=149210 bytes_read=5439105 bytes_retransmit=0 bytes_invalid=0 send_seq=10139 receive_seq=10139 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000279 adj=47999626 CPU_SHT36: temp=40.9 heater_bed: target=55 temp=55.2 pwm=0.095 Octopus_MCU: temp=38.7 sysload=0.50 cputime=375.847 memavail=6819652 print_time=1805.114 buffer_time=0.000 print_stall=14 extruder: target=200 temp=200.2 pwm=0.372
Stats 17380.8: gcodein=0 mcu: mcu_awake=0.217 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=3864899 bytes_read=1027117 bytes_retransmit=0 bytes_invalid=0 send_seq=82690 receive_seq=82690 retransmit_seq=0 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=180001806 sht36: mcu_awake=0.918 mcu_task_avg=0.000048 mcu_task_stddev=0.000028 bytes_write=149244 bytes_read=5439272 bytes_retransmit=0 bytes_invalid=0 send_seq=10142 receive_seq=10142 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000275 adj=47999827 CPU_SHT36: temp=40.8 heater_bed: target=55 temp=55.1 pwm=0.095 Octopus_MCU: temp=38.8 sysload=0.50 cputime=375.875 memavail=6761740 print_time=1805.114 buffer_time=0.000 print_stall=14 extruder: target=200 temp=200.2 pwm=0.372
Traceback (most recent call last):
File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 26, in

from graph_belts import belts_calibration

File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 25, in
from common_func import compute_spectrogram, detect_peaks, get_git_version, parse_log, setup_klipper_import
File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/common_func.py", line 12, in
from git import GitCommandError, Repo
ModuleNotFoundError: No module named 'git'

Command {shaketune} finished

Running Command {shaketune}...:
Stats 17381.8: gcodein=0 mcu: mcu_awake=0.217 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=3865089 bytes_read=1027501 bytes_retransmit=0 bytes_invalid=0 send_seq=82704 receive_seq=82704 retransmit_seq=0 srtt=0.000 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=180001749 sht36: mcu_awake=0.918 mcu_task_avg=0.000048 mcu_task_stddev=0.000028 bytes_write=149278 bytes_read=5439450 bytes_retransmit=0 bytes_invalid=0 send_seq=10145 receive_seq=10145 retransmit_seq=0 srtt=0.001 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=48000272 adj=48000016 CPU_SHT36: temp=40.8 heater_bed: target=55 temp=55.1 pwm=0.101 Octopus_MCU: temp=38.9 sysload=0.50 cputime=375.931 memavail=6921480 print_time=1805.114 buffer_time=0.000 print_stall=14 extruder: target=200 temp=200.2 pwm=0.372
Traceback (most recent call last):
File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 26, in

from graph_belts import belts_calibration

File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 25, in
from common_func import compute_spectrogram, detect_peaks, get_git_version, parse_log, setup_klipper_import
File "/home/tom/klippain_shaketune/K-ShakeTune/scripts/common_func.py", line 12, in
from git import GitCommandError, Repo
ModuleNotFoundError: No module named 'git'

Unknown command:"ACCELEROMETER_MEASURE"

K-Shake&Tune module branch

  • I confirm using the main branch

Version

V 2.0.0

Describe the bug and expected behavior

20:21:15
Command {shaketune} finished
20:21:14
No CSV files found in the /tmp folder to create the input shaper graphs!
20:21:06
Running Command {shaketune}...:
20:21:06
This may take some time (1-3min)
20:21:06
Y axis frequency profile generation...
20:21:06
Unknown command:"TEST_RESONANCES"
20:21:06
Command {shaketune} finished
20:21:05
No CSV files found in the /tmp folder to create the input shaper graphs!
20:20:57
Running Command {shaketune}...:
20:20:57
This may take some time (1-3min)
20:20:57
X axis frequency profile generation...
20:20:57
Unknown command:"TEST_RESONANCES"
20:20:57
AXES_SHAPER_CALIBRATION
20:20:19
G28
20:19:56
Klipper state: Disconnect
20:19:55
FIRMWARE_RESTART

20:24:40
Command {shaketune} finished
20:24:39
No CSV files found in the /tmp folder to create the belt graphs!
20:24:31
Running Command {shaketune}...:
20:24:31
This may take some time (3-5min)
20:24:31
Belts comparative frequency profile generation...
20:24:31
Unknown command:"TEST_RESONANCES"
20:24:31
Unknown command:"TEST_RESONANCES"
20:24:31
BELTS_SHAPER_CALIBRATION


Unknown command:"ACCELEROMETER_MEASURE"

klippy.log

Additional information and klippy.log

same problem with all commands

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-1-gac96cb2e

Describe the bug and expected behavior

I get this issue when I run the

calibration_data = self.background_process_exec(
File "/home/pi/klipper/klippy/extras/shaper_calibrate.py", line 74, in background_process_exec
return method(*args)
File "/home/pi/klipper/klippy/extras/shaper_calibrate.py", line 161, in calc_freq_response
T = data[-1,0] - data[0,0]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Additional information and klippy.log

No response

Python dependencies compilation issues on a low powered BananaPi M2 Zero

K-Shake&Tune module branch

  • I confirm using the main branch

Version

N/A

Describe the bug and expected behavior

This is during a new install - subprocess-exited-with-error.

pip subprocess to install build dependencies did not run successfully. Initially similar to this #30 so followed those steps.

MCU is a 2040 (Banana Pi M2 Zero)
Version: v0.12.0-65-g96ab9069-dirty
OS: Armbian 21.08.1 Bullseye

Of note during the install:

FAILED: numpy/core/libloops_comparison.dispatch.h_NEON.a.p/meson-generated_loops_comparison.dispatch.c.o
cc -Inumpy/core/libloops_comparison.dispatch.h_NEON.a.p -Inumpy/core -I../numpy/core -Inumpy/core/include -I../numpy/core/include -I../numpy/core/src/common -I../numpy/core/src/multiarray -I../numpy/core/src/npymath -I../numpy/core/src/umath -I/usr/include/python3.9 -I/usr/include/arm-linux-gnueabihf/python3.9 -I/tmp/pip-install-vzvep7e0/numpy_3ebe65d4b8454c02b5383b87282a2384/.mesonpy-a_sg6v9t/meson_cpu -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c99 -O3 -fno-strict-aliasing -fPIC -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -O3 -DNPY_HAVE_NEON -mfpu=neon -DNPY_MTARGETS_CURRENT=NEON -MD -MQ numpy/core/libloops_comparison.dispatch.h_NEON.a.p/meson-generated_loops_comparison.dispatch.c.o -MF numpy/core/libloops_comparison.dispatch.h_NEON.a.p/meson-generated_loops_comparison.dispatch.c.o.d -o numpy/core/libloops_comparison.dispatch.h_NEON.a.p/meson-generated_loops_comparison.dispatch.c.o -c numpy/core/libloops_comparison.dispatch.h_NEON.a.p/loops_comparison.dispatch.c
cc: fatal error: Killed signal terminated program cc1
compilation terminated.

install_info.txt

Additional information and klippy.log

Text file attached

Last Klipper update break S&T

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-7-gb42e377a

Describe the bug and expected behavior

image

Additional information and klippy.log

No response

After Running AXES_MAP_CALIBRATION i do not get the graphs

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.6.0-2-g312a9c9f

Describe the bug and expected behavior

when i call AXES_MAP_CALIBRATION. the test begins to completion i get no errors. then when it comes time to get the results and the pngs all i get is the cvs.
this is what i get when the printer is done moving:

  • ` 10:13:24 // Command {shaketune} finished
  • 10:13:23 // performance_shaper, shapers, calibration_data, fr, zeta = calibrate_shaper(datas[0], max_smoothing, scv, max_freq)
  • // File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 54, in calibrate_shaper
  • // shaper, all_shapers = helper.find_best_shaper(
  • // TypeError: find_best_shaper() got an unexpected keyword argument 'shapers'
  • 10:13:23 // axis = create_shaper_graph(keep_csv=options.keep_csv, max_smoothing=options.max_smoothing, scv=options.scv)
  • // File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 123, in create_shaper_graph
  • // fig = shaper_calibration([new_file], KLIPPER_FOLDER, max_smoothing=max_smoothing, scv=scv)
  • // File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 217, in shaper_calibration
  • 10:13:23 // main()
  • // File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 289, in main
  • 10:13:23 // Traceback (most recent call last):
  • // File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 303, in
  • 10:13:14 // Running Command {shaketune}...:
  • 10:13:14 echo: This may take some time (1-3min)
  • 10:13:14 echo: Y axis frequency profile generation...
  • 10:13:14 // Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
  • 10:13:11 // Re-enabled [input_shaper]`

Additional information and klippy.log

klippy.log

Configure results directory

Describe the feature or hardware support you'd like

I'd like to configure a destination for results other than ShakeTune_results/. As a user of klipper_auto_speed, I would like to consolidate the outputs from both plugins into a common directory to simplify navigation and backup.

Additional context or information

No response

Beacon RevH include

Describe the feature or hardware support you'd like

Hey, maybe just a skill issue of myself.

Got a beacon REV H with "
[resonance_tester]
accel_chip: beacon
"

And its blaming me that its not an adxl345

Is there any option that you could include that the beacon is also working

Thank you :)

Additional context or information

No response

ERROR: No matching distribution found for matplotlib==3.8.2

K-Shake&Tune module branch

  • I confirm using the main branch

Version

2.5.0

Describe the bug and expected behavior

Hello,

When I attempt to install the Shake&Tune package via SSH I get the following errors:

ERROR: Ignored the following versions that require a different python version: 3.6.0 Requires-Python >=3.8; 3.6.0rc1 Requires-Python >=3.8; 3.6.0rc2 Requires-Python >=3.8; 3.6.1 Requires-Python >=3.8; 3.6.2 Requires-Python >=3.8; 3.6.3 Requires-Python >=3.8; 3.7.0 Requires-Python >=3.8; 3.7.0rc1 Requires-Python >=3.8; 3.7.1 Requires-Python >=3.8; 3.7.2 Requires-Python >=3.8; 3.7.3 Requires-Python >=3.8; 3.7.4 Requires-Python >=3.8; 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement matplotlib==3.8.2 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4.0rc1, 3.4.0rc2, 3.4.0rc3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.0b1, 3.5.0rc1, 3.5.0, 3.5.1, 3.5.2, 3.5.3)
ERROR: No matching distribution found for matplotlib==3.8.2

Screenshot 2024-01-13 at 11 35 40 AM

I completed all updates in Mainsail and attempted the install again - I get the same error.

Additional information and klippy.log

No response

Very different results compared to klipper built in tools?

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.1.2

Describe the bug and expected behavior

I get extremely different recommendations from running "AXES_SHAPER_CALIBRATION" compared to "SHAPER_CALIBRATE" but only on the X axis.
on the X axis with AXES_SHAPER_CALIBRATION the recommendations are:

"// Writing raw accelerometer data to /tmp/raw_data_x_x.csv file
16:54:06 
echo: X axis shaper graphs generation...
16:54:06 
// Running Command {plot_graph}...:
16:54:19 
// Fitted shaper 'zv' frequency = 53.8 Hz (vibrations = 17.0%, smoothing ~= 0.060)
// To avoid too much smoothing with 'zv', suggested max_accel <= 11300 mm/sec^2
// Fitted shaper 'mzv' frequency = 34.0 Hz (vibrations = 2.6%, smoothing ~= 0.176)
// To avoid too much smoothing with 'mzv', suggested max_accel <= 3400 mm/sec^2
// Fitted shaper 'ei' frequency = 49.6 Hz (vibrations = 2.5%, smoothing ~= 0.131)
// To avoid too much smoothing with 'ei', suggested max_accel <= 4600 mm/sec^2
// Fitted shaper '2hump_ei' frequency = 41.4 Hz (vibrations = 0.0%, smoothing ~= 0.315)
// To avoid too much smoothing with '2hump_ei', suggested max_accel <= 1800 mm/sec^2
// Fitted shaper '3hump_ei' frequency = 57.4 Hz (vibrations = 0.0%, smoothing ~= 0.249)
// To avoid too much smoothing with '3hump_ei', suggested max_accel <= 2300 mm/sec^2
// Recommended shaper is ei @ 49.6 Hz
// Axis has a main resonant frequency at 55.7Hz with an estimated damping ratio of 0.049
// Peaks detected on the graph: 3 @ 43.6, 55.7, 85.4 Hz (2 above effect threshold)
// Graphs created. You will find the results in /home/pi/printer_data/config/K-ShakeTune_results"

while on INPUT_SHAPER I get:

// Re-enabled [input_shaper]
16:50:55 
// Calculating the best input shaper parameters for x axis
16:50:56 
// Fitted shaper 'zv' frequency = 81.6 Hz (vibrations = 1.6%, smoothing ~= 0.030)
16:50:56 
// To avoid too much smoothing with 'zv', suggested max_accel <= 25900 mm/sec^2
16:50:58 
// Fitted shaper 'mzv' frequency = 77.6 Hz (vibrations = 0.0%, smoothing ~= 0.036)
16:50:58 
// To avoid too much smoothing with 'mzv', suggested max_accel <= 17700 mm/sec^2
16:50:59 
// Fitted shaper 'ei' frequency = 93.6 Hz (vibrations = 0.0%, smoothing ~= 0.038)
16:50:59 
// To avoid too much smoothing with 'ei', suggested max_accel <= 16300 mm/sec^2
16:51:00 
// Fitted shaper '2hump_ei' frequency = 118.8 Hz (vibrations = 0.0%, smoothing ~= 0.041)
16:51:00 
// To avoid too much smoothing with '2hump_ei', suggested max_accel <= 15700 mm/sec^2
16:51:02 
// Fitted shaper '3hump_ei' frequency = 145.8 Hz (vibrations = 0.0%, smoothing ~= 0.042)
16:51:02 
// To avoid too much smoothing with '3hump_ei', suggested max_accel <= 15600 mm/sec^2
16:51:02 
// Recommended shaper_type_x = mzv, shaper_freq_x = 77.6 Hz

but they are 1:1 on the Y axis.

Also, the graphs from BELTS_SHAPER_CALIBRATION compared to
TEST_RESONANCES AXIS=1,1 OUTPUT=raw_data
TEST_RESONANCES AXIS=1,-1 OUTPUT=raw_data

are also quite different:
resonances
belts_20231120_163734

I don't know if it matters but by accelerometer doesn't match X,Y,Z, it's actually mounted as X,Z,Y but as far as I know this doesn't matter on Klipper.
Let me know if there's anything else useful I can attach

Additional information and klippy.log

No response

axes-map wrong

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-5-g9fa07a12

Describe the bug and expected behavior

axes-map wrong

Additional information and klippy.log

How can I force the use of axes-map from printer.cfg?

Support for multi-klipper or custom installations

Describe the feature or hardware support you'd like

In some cases new Klipper machines, yes brands like to be creative :), uses other paths for Klipper binaries and config like QIDI or K1.
Should be interesting to had a global variable to adjust those paths used by all your great python scripts.

Additional context or information

As an example for QIDI:
Klipper config -> /home/mks/klipper_config/
Klipper binaries -> /home/mks/klipper/
For Creality K1:
Klkipper config -> /usr/data/printer_data/
Klipper binaries ->

Running VIBRATIONS_CALIBRATION after AXIS_MAP_CALIBRATION cause error

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-3-geab10ce5

Describe the bug and expected behavior

The script took *-axemap.csv as a vibration test output. It should be ignored.

Additional information and klippy.log

raise ValueError("File %s does not contain speed in its name and therefore "
ValueError: File /home/biqu/printer_data/config/K-ShakeTune_results/vibrations/vibr_20240129_155151-axemap.csv does not contain speed in its name and therefore is not supported by this script.
15:52:07
raw_speeds = [extract_speed(filename) for filename in lognames]
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 327, in extract_speed
15:52:07
create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 165, in create_vibrations_graph
fig = vibrations_calibration(lognames, KLIPPER_FOLDER, axis_name, accel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 353, in vibrations_calibration
raw_speeds = [extract_speed(filename) for filename in lognames]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 353, in
15:52:07
speed = re.search('sp(.+?)n', os.path.basename(logname)).group(1).replace('_','.')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 299, in
main()
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 288, in main

error after updating

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-0-gc7e39da5

Describe the bug and expected behavior

10:22:12 AM
Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
10:22:12 AM
echo: Y axis frequency profile generation...
10:22:12 AM
echo: This may take some time (1-3min)
10:22:12 AM
Running Command {shaketune}...:
10:22:12 AM
/home/pi/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 3: /home/pi/klippain_shaketune-env/bin/activate: No such file or directory
10:22:13 AM
Traceback (most recent call last):
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 30, in
10:22:13 AM
from graph_belts import belts_calibration
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 17, in
import scipy
ModuleNotFoundError: No module named 'scipy'
10:22:13 AM
/home/pi/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 5: deactivate: command not found
10:22:13 AM
Command {shaketune} finished
klippy.log

Additional information and klippy.log

No response

Error loading template 'gcode_macro AXES_SHAPER_CALIBRATION

K-Shake&Tune module branch

  • I confirm using the main branch

Version

Newest

Describe the bug and expected behavior

Klipper reports: ERROR

Error loading template 'gcode_macro AXES_SHAPER_CALIBRATION:gcode': jinja2.exceptions.TemplateAssertionError: no test named 'None'

Additional information and klippy.log

No response

sometimes it works, sometimes i get an error in plot_graph

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.1.2-2-g7c76be50

Describe the bug and expected behavior

04:10:03 PM
Re-enabled [input_shaper]
04:10:05 PM
Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
04:10:05 PM
echo: Y axis shaper graphs generation...
04:10:05 PM
Running Command {plot_graph}...:
04:10:08 PM
Traceback (most recent call last):
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 232, in
04:10:08 PM
main()
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 218, in main
04:10:08 PM
fig, png_filename = get_shaper_graph()
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 117, in get_shaper_graph
fig = shaper_calibration([new_file], KLIPPER_FOLDER)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 332, in shaper_calibration
04:10:08 PM
datas = [parse_log(fn) for fn in lognames]
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 332, in
04:10:08 PM
datas = [parse_log(fn) for fn in lognames]
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 312, in parse_log
if not header.startswith('freq,psd_x,psd_y,psd_z,psd_xyz'):
UnboundLocalError: local variable 'header' referenced before assignment
04:10:08 PM
Command {plot_graph} finished

Additional information and klippy.log

klippy.log

Memory Issue(?) Process was terminated while running the script

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-2-g2a627a1f

Describe the bug and expected behavior

I was running the gcode BELTS_SHAPER_CALIBRATION, and sometimes it would pop out something shown below:

// Writing raw accelerometer data to /tmp/raw_data_axis=1.000,-1.000_a.csv file
echo: Belts comparative frequency profile generation...
echo: This may take some time (3-5min)
// Running Command {shaketune}...:
// /home/klipper/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 4: 120654 Killed python ~/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py "$@"
// Command {shaketune} finished

And sometimes the klipper would restart without any warning.

The other commands can be run flawlessly.
I am using orangepi zero3 with 1gb of ram.

Additional information and klippy.log

No response

Cannot write to '/home/pi/klipper/klippy/extras/gcode_shell_command.py'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-3-geab10ce5

Describe the bug and expected behavior

when I installed the newest version i keep getting this error on the installation screen
"Cannot write to '/home/pi/klipper/klippy/extras/gcode_shell_command.py' (No such file or directory)."

also which might be related as soon I append the cfg file I get an error on Mainsail saying
"Section 'gcode_shell_command shaketune' is not a valid config section"
klippy (18).log

Additional information and klippy.log

No response

GitPython module missing

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-0-g84c406b4

Describe the bug and expected behavior

When trying to do the belt graphing, I was presented with this error:
from git import GitCommandError, Repo ModuleNotFoundError: No module named 'git'
Fix was easy enough, just install GitPython to the virtual env but I thought I'd give you a heads up

Additional information and klippy.log

No response

Installation Fails, No Matching contourpy?

K-Shake&Tune module branch

  • I confirm using the main branch

Version

Current

Describe the bug and expected behavior

I tried installing like given in the manual, sadly the install fails.
Any tips?

image

Additional information and klippy.log

image

Belt shaper py errors out

K-Shake&Tune module branch

  • I confirm using the main branch

Version

9ce3677

Describe the bug and expected behavior

9:21 PM
Command {plot_graph} finished
9:21 PM
f12 = source_data[y_indices, x_indices + 1]
IndexError: index 365 is out of bounds for axis 1 with size 365
9:21 PM
combined_data, bins, t = combined_spectrogram(data1, data2)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 308, in combined_spectrogram
pdata2_interpolated = interpolate_2d(t1, bins1, t1, bins1, pdata2_aligned)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 237, in interpolate_2d
9:21 PM
main()
File "/home/biqu/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 230, in main
fig, png_filename = get_belts_graph()
File "/home/biqu/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 98, in get_belts_graph
fig = belts_calibration(lognames, KLIPPER_FOLDER)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 603, in belts_calibration
plot_difference_spectrogram(ax2, datas[0], datas[1], signal1, signal2, similarity_factor, max_freq)
File "/home/biqu/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 467, in plot_difference_spectrogram
9:21 PM
Belts estimated similarity: 85.5%
Traceback (most recent call last):
File "/home/biqu/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 246, in

The python seems to error out and not produce an image for me.

Running on a CB1 on m5p

Expected behavior:
Results in image as per readme
Experienced results:
error and no image

Additional information and klippy.log

Uploading klippy (31).log…

Vibration graph creation - IndexError: index -1 is out of bounds for axis 0 with size 0

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-7-gb42e377a

Describe the bug and expected behavior

When running vibration analysis the printer is measuring correctly, but the scripts that make a graph .png file fail with attached error. This happens on my Ender5Pro. On the Ender3v2 all is working as expected.

Could this be related to the fact that the Ender5Pro homes against the max values of the axis (corner right/back) instead of the the Ender3v2 which homes in corner front left (0,0).

Additional information and klippy.log

main()
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 288, in main
create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 165, in create_vibrations_graph
fig = vibrations_calibration(lognames, KLIPPER_FOLDER, axis_name, accel)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 382, in vibrations_calibration
motor_fr, motor_zeta, motor_max_power_index = compute_mechanical_parameters(motor_vibration_power, freqs)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/common_func.py", line 81, in compute_mechanical_parameters
idx_below = np.where(psd[:max_power_index] <= half_power)[0][-1]
IndexError: index -1 is out of bounds for axis 0 with size 0

PermissionError: [Errno 13] Permission denied: '/proc/1630/fd/0'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.1.2-0-g6e884528

Describe the bug and expected behavior

When I run any of the calibrations, at the time of plot creation, I get the following messages. They vary based on the type of calibration, but the common thread is the permission denied error.

Command {plot_graph} finished
File "/home/doc/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 231, in
main()
File "/home/doc/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 217, in main
fig, png_filename = get_shaper_graph()
File "/home/doc/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 107, in get_shaper_graph
while is_file_open(filename):
File "/home/doc/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 55, in is_file_open
if os.path.samefile(fd, filepath):
File "/usr/lib/python3.10/genericpath.py", line 100, in samefile
s1 = os.stat(f1)
PermissionError: [Errno 13] Permission denied: '/proc/1630/fd/0'
Traceback (most recent call last):
Running Command {plot_graph}...:
X axis shaper graphs generation...
Writing raw accelerometer data to /tmp/raw_data_x_x.csv file

Additional information and klippy.log

klippy (11).log

How to install on a sonic pad?

Describe the feature or hardware support you'd like

I'm using a sonic pad and log in putty with root account. And when I try to install it, I get an error message that I can't install with root account

Additional context or information

No response

Vibration Graph Exception: could not convert string to float: 'freq'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-3-geab10ce5

Describe the bug and expected behavior

Hello, Shaketune won´t create a vibrations graph for me. This is the console output.

ValueError: could not convert string to float: 'freq'

The above exception was the direct cause of the following exception:


Traceback (most recent call last):
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 299, in

main()
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 288, in main
create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 165, in create_vibrations_graph
fig = vibrations_calibration(lognames, KLIPPER_FOLDER, axis_name, accel)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 352, in vibrations_calibration
raw_datas = [parse_log(filename) for filename in lognames]
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_vibrations.py", line 352, in
raw_datas = [parse_log(filename) for filename in lognames]
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/common_func.py", line 22, in parse_log
return np.loadtxt(logname, comments='#', delimiter=',')
File "/home/pi/klippain_shaketune-env/lib/python3.9/site-packages/numpy/lib/npyio.py", line 1373, in loadtxt

arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
File "/home/pi/klippain_shaketune-env/lib/python3.9/site-packages/numpy/lib/npyio.py", line 1016, in _read

arr = _load_from_filelike(
ValueError: could not convert string 'freq' to float64 at row 0, column 1.


I am using beacon´s built in Accelerometer

Thanks & Regards

Additional information and klippy.log

No response

Add recommendation to results

Describe the feature or hardware support you'd like

Hi,

first of all: GREAT Job!!! Love it!

I think it would be super nice (if possible) to add some kind of recommendation like "you should tighten your B belt" or "you should loosen your B Belt"

And as I am stupid and always forget which belt is A or B ... maybe a little hint like "Your left belt (B) should be thightend"

Is that possible based on the date you get from the accelerometer?

Cheers & THX
Tino

Additional context or information

No response

Multi-instance installation support

Describe the feature or hardware support you'd like

Cannot install in a multi-instance configuration.
[ERROR] Klipper service not found, please install Klipper first!
In my case, printer1_data printer2_data.... I have many printers in the following format
The install script only supports single instant, so it seems to need to be modified in some way.

Additional context or information

No response

green zone confusion

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-0-gc7e39da5

Describe the bug and expected behavior

So both graphs have been taken on the same machine, with no other changes than these 3 things:

  1. the steppers direction have been inverted by reversing the wires
  2. the pin rotation in Klipper marked with a ! to correct the reverse wiring
  3. the numbers for mzv shaper have been changed in the config before running vibrations management.

The first graph is with reverse wiring. The second with the default wiring.

When we look at the green zones on each, one might think the second graph is better but I doubt that is the case (hence I am opening the report).

The green zone on the second graph goes up to 0.4 on a 1e8 scale. 40,000,000 to be exact. This is equivalent to 4.0 on a 1e7 scale, the end of 400mm/s. Basically, the entire first graph should be green zone.

Unless I misunderstand something, please clarify then if its not too much to ask 😸.

image

image

Thanks for your time!

Additional information and klippy.log

No response

No module named 'pip'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

i didn't install yet

Describe the bug and expected behavior

Ihave python version 3.12 and the latest pip update but i get this error:

=============================================

  • Klippain Shake&Tune module install script -
    =============================================

[PRE-CHECK] Klipper service found! Continuing...

python3-venv is already installed
libopenblas-dev is already installed
libatlas-base-dev is already installed
[DOWNLOAD] Klippain Shake&Tune module repository already found locally. Continuing...

[SETUP] Virtual environment already exists. Continuing...
[SETUP] Installing/Updating K-Shake&Tune dependencies...
Traceback (most recent call last):
File "/home/pi/klippain_shaketune-env/bin/pip", line 6, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'

is there any solution?

Additional information and klippy.log

No response

TypeError: find_best_shaper() got an unexpected keyword argument 'shapers'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.6.0-1-gf4e700a1

Describe the bug and expected behavior

no PNG output

Additional information and klippy.log

11:47:29 AM
// Testing frequency 97 Hz
11:47:30 AM
// Testing frequency 98 Hz
11:47:31 AM
// Testing frequency 99 Hz
11:47:32 AM
// Testing frequency 100 Hz
11:47:33 AM
// Testing frequency 101 Hz
11:47:34 AM
// Testing frequency 102 Hz
11:47:35 AM
// Testing frequency 103 Hz
11:47:36 AM
// Testing frequency 104 Hz
11:47:37 AM
// Testing frequency 105 Hz
11:47:38 AM
// Testing frequency 106 Hz
11:47:39 AM
// Testing frequency 107 Hz
11:47:40 AM
// Testing frequency 108 Hz
11:47:41 AM
// Testing frequency 109 Hz
11:47:42 AM
// Testing frequency 110 Hz
11:47:43 AM
// Testing frequency 111 Hz
11:47:44 AM
// Testing frequency 112 Hz
11:47:45 AM
// Testing frequency 113 Hz
11:47:46 AM
// Testing frequency 114 Hz
11:47:47 AM
// Testing frequency 115 Hz
11:47:48 AM
// Testing frequency 116 Hz
11:47:49 AM
// Testing frequency 117 Hz
11:47:50 AM
// Testing frequency 118 Hz
11:47:51 AM
// Testing frequency 119 Hz
11:47:52 AM
// Testing frequency 120 Hz
11:47:53 AM
// Testing frequency 121 Hz
11:47:54 AM
// Testing frequency 122 Hz
11:47:55 AM
// Testing frequency 123 Hz
11:47:56 AM
// Testing frequency 124 Hz
11:47:57 AM
// Testing frequency 125 Hz
11:47:58 AM
// Testing frequency 126 Hz
11:47:59 AM
// Testing frequency 127 Hz
11:48:00 AM
// Testing frequency 128 Hz
11:48:01 AM
// Testing frequency 129 Hz
11:48:02 AM
// Testing frequency 130 Hz
11:48:03 AM
// Testing frequency 131 Hz
11:48:04 AM
// Testing frequency 132 Hz
11:48:05 AM
// Testing frequency 133 Hz
11:48:06 AM
// Re-enabled [input_shaper]
11:48:08 AM
// Writing raw accelerometer data to /tmp/raw_data_y_y.csv file
11:48:08 AM
echo: Y axis frequency profile generation...
11:48:08 AM
echo: This may take some time (1-3min)
11:48:08 AM
// Running Command {shaketune}...:
11:48:12 AM
// Traceback (most recent call last):
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 303, in
11:48:12 AM
// main()
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 289, in main
11:48:12 AM
// axis = create_shaper_graph(keep_csv=options.keep_csv, max_smoothing=options.max_smoothing, scv=options.scv)
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 123, in create_shaper_graph
11:48:12 AM
// fig = shaper_calibration([new_file], KLIPPER_FOLDER, max_smoothing=max_smoothing, scv=scv)
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 217, in shaper_calibration
11:48:12 AM
// performance_shaper, shapers, calibration_data, fr, zeta = calibrate_shaper(datas[0], max_smoothing, scv, max_freq)
// File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_shaper.py", line 54, in calibrate_shaper
11:48:13 AM
// shaper, all_shapers = helper.find_best_shaper(
// TypeError: find_best_shaper() got an unexpected keyword argument 'shapers'
11:48:13 AM
// Command {shaketune} finished
11:48:13 AM
// Running Command {shaketune}...:
11:48:15 AM
// Cleaning output folder to keep only the last 3 results...
11:48:16 AM
// Command {shaketune} finished

Calibration fails

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-2-g2a627a1f

Describe the bug and expected behavior

When using BELTS_SHAPER_CALIBRATION it fails on generating the graphs with this message in the console:
/home/mks/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 4: 20715 Killed python ~/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py "$@"
image

I tried it multiple times with different debian releases and the csv files being stored here but no images of the plottet graphs:
image

I used these parameters for the belt calibration:
image

AXES_SHAPER_CALIBRATION works with no issues.

What can I do to check where it fails and improve this great extension?

Additional information and klippy.log

No response

ModuleNotFoundError: No module named 'scipy'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-0-gc7e39da5

Describe the bug and expected behavior

I am not sure which version I was running (I installed recently in the past couple of weeks).
I am on RatOS 2, fully updated, and installed Klippain following the instructions a couple of weeks ago. Its been working flawlessly.

After the update today I get:

16:43 Command {shaketune} finished
16:43 /home/pi/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 5: deactivate: command not found
16:43 import scipy
ModuleNotFoundError: No module named 'scipy'
16:43 from graph_belts import belts_calibration
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 17, in
16:43 Traceback (most recent call last):
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py", line 30, in
16:43 /home/pi/printer_data/config/K-ShakeTune/scripts/shaketune.sh: line 3: /home/pi/klippain_shaketune-env/bin/activate: No such file or directory
16:43 Running Command {shaketune}...:

Additional information and klippy.log

I assume its missing a python module scipy.

$ pi@vcore-3 ~ $ apt search scipy
python3-scipy/oldstable 1.6.0-2 arm64
  scientific tools for Python 3

But since you also switched to a venv I'm going to hold off trying to fix it myself and wait for your reply.

Klippy attached. If you need more info just ask.
klippy.log

Error running command {shaketune}

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0

Describe the bug and expected behavior

Everything starts up fine
csv files are created and written
but then it says: Error running command {shaketune}

Additional information and klippy.log

No response

Module 'matplotlib.colors' has no attribute 'TwoSlopeNorm'

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v1.1.1-0-g83f51775

Describe the bug and expected behavior

After running the 'BELTS_SHAPER_CALIBRATION' no graph is generated and the following error is displayed:

Traceback (most recent call last):
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 231, in
main()
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 215, in main
fig, png_filename = get_belts_graph()
File "/home/pi/printer_data/config/K-ShakeTune/scripts/is_workflow.py", line 89, in get_belts_graph
fig = belts_calibration(lognames, KLIPPER_FOLDER)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 598, in belts_calibration
plot_difference_spectrogram(ax2, datas[0], datas[1], signal1, signal2, similarity_factor, max_freq)
File "/home/pi/klippain_shaketune/K-ShakeTune/scripts/graph_belts.py", line 477, in plot_difference_spectrogram
norm = matplotlib.colors.TwoSlopeNorm(vcenter=np.min(combined_data), vmax=np.max(combined_data))
AttributeError: module 'matplotlib.colors' has no attribute 'TwoSlopeNorm'

Additional information and klippy.log

No response

Using [adxl345 my_custom_name] doesn't work for vibrations graphs

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.5.0-2-g0696a60b

Describe the bug and expected behavior

I've a printer with RatOS installed,
When i run VIBRATIONS_CALIBRATION command i recieve the error "Invalid adxl345 id (got ff vs e5).

If i run VIBRATIONS_CALIBRATION ACCEL_CHIP="toolboard" or VIBRATIONS_CALIBRATION ACCEL_CHIP=toolboard
the commad start correctly and execute the data log but after:
"Machine and motors vibration graph generation..."
"This may take some time (3-5min)
I recieve the message "No CSV files found in the /tmp folder to create the vibration graphs!"

In the /tmp directory there are the .csv files with this name:
"adxl345-toolboard-sp20_00n1.csv" ecc.

What's i'm doing wrong?

Additional information and klippy.log

klippy.log

Vibrations Calibration only working with adxl345 as default name

K-Shake&Tune module branch

  • I confirm using the main branch

Version

v2.0.0-0-gc7e39da5

Describe the bug and expected behavior

When not using the default name adxl345 for measurements the scripts will generate cvs files but not use them due to searching for '/tmp/adxl345-.csv'.
Unfortunately the script will name these files after the set accel chip name. For example if lis2dw is used the files generated will be named lis2dw-
.csv instead and won't be found by the is_workflow.py script despite being generated due to the fixed search for adxl345.
Either a generic name should be used or the corresponding wildcard search should use the defined name as well.

axes_map seems to have the same behaviour. Shaper calibration and belt graphs don't exhibit the same behaviour due to using a generic name like raw_data*.csv.

Lines in question:
Line 134
Line 172

Additional information and klippy.log

Edit: There seem to be additional files not liking the different name than just is_workflow,py haven't found them yet though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.