Skip to content

Releases: Frix-x/klippain-shaketune

v3.0.0

29 Apr 08:46
47770e2
Compare
Choose a tag to compare

Shake&Tune v3.0.0

This new version introduces a small breaking change with the macro names, which have changed to better reflect their usage. They are now COMPARE_BELTS_RESPONSES, AXES_SHAPER_CALIBRATION, and CREATE_VIBRATIONS_PROFILE.

New Features

  • Significantly improved the vibration measurement tool to increase its accuracy and make it really useful. It's a long work that has been going on for several months now with the community! Thanks to everyone who helped! I'm quite happy with the results, because now it's able to measure at the same speed range, but also extrapolate how the motors will behave at all angles! So the recommended speed ranges for your slicer will take this into account. Documentation is available here
  • Due to a major change in Klipper in February, S&T v2.6 was released to accommodate the change. It also provided a way to use SCV and the real damping ratio in the filter recommendations, but it also broke compatibility with older Klipper versions... Now with Shake&Tune v3.0.0 you have a "compatibility mode" that uses the old mechanism to calculate the filter recommendations if an older Klipper version is detected. This also has the side effect of making Shake&Tune compatible with the DangerKlipper bleeding edge branch again!
  • Macro names have been changed to better reflect their use, as noted in the first line of this changelog. They are now COMPARE_BELTS_RESPONSES, AXES_SHAPER_CALIBRATION and CREATE_VIBRATIONS_PROFILE.

Fixes

  • Updated the way the damping ratio is calculated to fix a potential crash when the signal is not perfect to calculate it (main spike near 0Hz). Now, if the damping ratio is not computable, the script will not crash and will take this into account when generating graphs.
  • Numerous fixes for permission errors, parameter handling bugs, etc.
  • Fixed a bug related to CSV format expectations that could happen in some edge cases.

Code Quality and Maintenance

  • Changed repository architecture to decouple Python and Klipper macros. A lot of refactoring and code cleaning was done at the same time to use proper OOP code with Python modules. This is a first step towards a real Klipper plugin in the future.
  • Added a pyproject.toml and set up linting and formatting rules using the Ruff formatter. Numerous refactoring and linting passes were done, targeting Python >=3.9 to avoid compatibility issues and have a cleaner and more consistent code.
  • Complete move to pathlib for better path management throughout the project. This should provide a more robust implementation of all file handling parts of Shake&Tune.
  • Improved error handling throughout the system to provide easier to understand errors in most cases.

v2.6.1

15 Mar 18:25
82b91c1
Compare
Choose a tag to compare

What's Changed

  • Following the recent Klipper breaking change about the way accels are managed, max_accel_to_decel was replaced with minimum_cruise_ratio in order to account for it. This means that you will need to use a newer Klipper version to be able to update to S&T v2.6.1
  • Fixed a typo from v2.6.0 (it was already fixed from a long time ago but now it's officially "in" a tagged release)
  • Some documentation improvements, especially about the problematic LIS2DW chip

New Contributors

Full Changelog: v2.6.0...v2.6.1

v2.6.0

19 Feb 22:15
Compare
Choose a tag to compare

Prerequisite

Klipper introduced some changes in the way resonance testing work that broke S&T. I had to make modifications to S&T in order to fix and support this, but this also means that you need to update Klipper : Please update Klipper to a version after Feb 17, 2024.

What's Changed

  • More accurate damping ratio calculation by using the half-quadratic gain method, which should be more accurate than the half-power method used in previous S&T versions for higher damping ratio values (above 0.05).
  • Fixed the bug introduced in the latest Klipper commits.
  • The last point now also allows S&T to use the current machine square corner velocity value (or define your own) and the calculated damping ratio to further improve and personalize the results. You will probably notice some changes, but now the results should be more accurate to what will actually happen in your machine. For instance, using a higher SCV will cause more smoothing and result in lower acceleration values (this was not taken into account before). Moreover, the shaper recommendations are now calculated by taking into account your real damping ratio, and not the default value of 0.1 that was used before.
  • Finally, you will now be able to define a maximum smoothing value that you want to allow for the shaper recommendations.

Documentation Changes

  • Added a bunch of details about the LIS2DW chip to the documentation, since it's known to produce a lot of aliasing and can be a bit problematic.
  • Changed and improved several parts of the documentation...

New Contributors

v2.5.0

09 Jan 14:44
84c406b
Compare
Choose a tag to compare

This release is primarily a major rework of Shake&Tune. Around 75-80% of the code was modified after some tracing and analysis in order to optimize it and lower the memory requirements. This leads to improvements in memory usage and speed. For example, on my testing rig, I was able to lower the RAM requirement by 75% and speed up the belt graph generation by 10x. Moreover, the updated code is confirmed to be functional on devices with limited resources, like the PiZero2W and Rpi2, using a total of around 100MB of RAM!

Breaking change

As I discovered that moonraker is not calling the install script automatically, the new dependencies are not added correctly. So after the update, please replace your moonraker update section by the new one (to fix it for the next updates):

[update_manager Klippain-ShakeTune]
type: git_repo
origin: https://github.com/Frix-x/klippain-shaketune.git
path: ~/klippain_shaketune
virtualenv: ~/klippain_shaketune-env
requirements: requirements.txt
system_dependencies: system-dependencies.json
primary_branch: main
managed_services: klipper

And for this time, run over SSH:

cd ~/klippain_shaketune && git pull
./install.sh

Other changes and new features

  • Motor shaft resonance analysis added to the vibration measurements. While currently, it doesn't offer immediate practical applications, it enables the measurement of the motor shaft's main resonance in your machine. It's important to note that this data represents a physical parameter of the motor and serves primarily as informational for now. However, exciting future plans are in the works on this topic – stay tuned!

  • Alongside the code optimizations, a major refactoring of the code was done in order to avoid code duplication and keep it easier to maintain and understand. I hope this will make it easier for the community to create PRs on Shake&Tune :)

  • Shake&Tune entrypoint script parameters handling was improved in order to be more flexible and robust. This update allows users to adjust settings like the number of results to retain in the folder, and whether to keep CSV files alongside the PNG result graphs directly from the Klipper macros! These improvements aim to make Shake&Tune more user-friendly and adaptable to various needs.

  • The last point also allowed to also use the accelerometer chip name as a parameter as well. This means that Shake&Tune now supports a wider range of accelerometer chips beyond the ADXL345, including the LIS2DW that start to become more common, but also all the others compatible accelerometer with Klipper.

  • Added a small watermark in the top right corner to indicate the Shake&Tune version used. This allows easier debugging and understanding of the data for every graph shared on the internet.

  • Improved some parts of the documentation and especially added some bits about the new motor frequency profile of the vibration measurement graphs.

Full Changelog: v2.0.0...v2.5.0

v2.0.0

11 Dec 15:02
c7e39da
Compare
Choose a tag to compare

Breaking change

This release may introduce a small breaking change on some older Debian installs as it need 2 system packages that are not installed by default. If you get an error after the update about Numpy complaining some libopenblas missing, you can fix it by manually running:

rm -R ~/klippain_shaketune*
sudo apt update && sudo apt install libopenblas-dev libatlas-base-dev -y
wget -O - https://raw.githubusercontent.com/Frix-x/klippain-shaketune/main/install.sh | bash

What's Changed

  • Updated documentation for clarity, incorporating subtle enhancements throughout for a more intuitive user experience.
  • Transitioned to a dedicated Python Virtual Environment for K-Shake&Tune installation, ensuring isolation from system Python packages to minimize conflicts and outdated library issues. The environement should be created automatically with the install script upon update for everyone.
  • Adopted Scipy for more robust and efficient spectrogram generation, replacing the older matplotlib.mlab.specgram function. This significant upgrade also addresses the notorious bug #7, happening randomly on 32-bit systems.
  • Introduced the AXES_MAP_CALIBRATION macro, an experimental feature for automatic accelerometer orientation measurement to facilitate the correct "axes_map" configuration in your Klipper config (do not hesitate to tell me if this macro gives wrong results).
  • Upgraded the belt differential spectrogram with a new color-coded system to easily identify and diagnose belt-specific issues. The expected visual remains a white rectangle featuring a diagonal line, now represented in a mix of purple and orange to distinguish each belt impact.
  • Segregated the different macros definition in multiple files, allowing for selective inclusion based on printer type. This modular approach allow users to only load macros relevant to their setup, such as for example, omitting belt graphs macros for Cartesian printers. This is just a convenient way to include the macros but using *.cfg is still working correctly if you want all of them :)
  • A lot of code cleanup and optimization were done in order to speed up the graphs generation or consume less RAM. These changes allowed to reduce by half the belt graphs generation time on my Pi3 for example. So it should definitely help you get a better user experience, especially on lower end SBC like the BTT CB1 or PiZero2W.

Full Changelog: v1.2...v2.0.0

v1.2.0

27 Nov 22:48
a1e9269
Compare
Choose a tag to compare

What's Changed

  • Fixed a bug that occasionally produced irrelevant graphs. This issue was caused by asynchronous file operations on low-performing filesystems, which sometimes led to corrupted CSV files. Now, the system ensures that file operations are completed before using the CSV files for graph generation.
  • Enhanced documentation user experience by introducing clickable image links. These links provide quick navigation to the corresponding sections of the documentation.
  • Introduced an ACCEL parameter for vibration measurements with a proper default value. This allows users to set a specific acceleration value if needed (but most of the time this doesn't need to be changed). Be careful: using printer maximum acceleration on very dynamic printers may result in irrelevant readings due to toolhead oscillations at corners and you should use a low value instead. Note: the acceleration is restored to the previous setting at the end of the test.
  • Improved the axis selection functionality in the EXCITATE_AXIS_AT_FREQ macro. It now allows for more straightforward selection of X, Y axes or A, B belts.

New Contributors

Full Changelog: v1.1.2...v1.2

v1.1.2

06 Nov 21:38
6e88452
Compare
Choose a tag to compare

This release changes a mechanism inside the belt graph script to allow older versions of matplotlib to be used.

In fact, on some operating systems, the included matplotlib is quite old and using TwoSlopNorm will cause the program to crash because it doesn't exist. So I replaced it with a custom defined norm in K-Shake&Tune to avoid this.

v1.1.1

01 Nov 19:13
83f5177
Compare
Choose a tag to compare

This release have two things in it:

  • There is a fix for an edge case bug where a low vibration shaper could be recommended with a pretty high level of vibration on a machine that have a global bad behavior. This is now solved and this suggestion is removed in the favor of the original "best" shaper selection to avoid confusion
  • The low vibration shaper (if available) resulting signal is now also plotted in lime green alongside the performance shaper that is in cyan

v1.1.0

31 Oct 21:37
5366ad0
Compare
Choose a tag to compare

This release fix issue #1 but also change the mechanism used to provide the shapers recommendations.

Here is a copy/paste of the documentation that explain the new mechanism:

  • The "performance" shaper is Klipper's original suggestion that is good for high acceleration while also sometimes allowing a little bit of remaining vibrations. Use it if your goal is speed printing and you don't care much about some remaining ringing.
  • The "low vibration" shaper aims for the lowest level of remaining vibration to ensure the best print quality with minimal ringing. This should be the best bet for most users.
  • Sometimes, only a single recommendation called "best" shaper is presented. This means that either no suitable "low vibration" shaper was found (due to a high level of vibration or with too much smoothing) or because the "performance" shaper is also the one with the lowest vibration level.

v1.0.3

28 Oct 12:19
358773d
Compare
Choose a tag to compare

This is mainly a new bugfixes release:

  • Safety measures were introduced to improve the detection and handling of CSV files prior to graph generation. The system now selects only the two most recent files for the belt graph and the single latest file for the axis graphs. As a result, there's no longer a need to manually clean the /tmp folder after executing EXCITATE_AXIS_AT_FREQ. This update ensures smooth functionality even if there are manual macro runs or lingering old CSV files.

  • A fix has been implemented to address localization issues and to sanitize the script outputs. It's worth noting that Klipper does not support certain special characters and this could lead to errors when displaying results in its WebUI console. With this update, such inconsistencies should have been resolved.