Skip to content

v5.0.0

Latest
Compare
Choose a tag to compare
@Frix-x Frix-x released this 30 Dec 08:57
· 2 commits to main since this release
74364d7

Shake&Tune v5.0.0 is a big release with many changes to the internal code, adding a dedicated .stdata format, a new sweep test (compatibility with the latest Klipper release). It also includes various improvements to mitigate "timer too close" errors on lower-end hardware, and a refactoring of the graph generation code for future extensibility, etc.

Likely a small breaking change

You will need to update the [shaketune] config section as some of the variables were a bit modified. Here is the last template:

[shaketune]
# result_folder: ~/printer_data/config/ShakeTune_results
#    Path where the processed results will be stored. If the folder doesn't exist,
#    it will be automatically created. You can change this if you'd like to store 
#    results in a different location.
# number_of_results_to_keep: 10
#    This setting defines how many results you want to keep in the result folder.
#    Once the specified number is exceeded, older results will be automatically deleted
#    to free up space on the SD card and avoid cluttering the results folder.
# keep_raw_data: False
#    If set to True, Shake&Tune will store both the processed graphs and the raw accelerometer
#    .stdata files in the results folder. This can be useful for debugging or archiving purposes.
#    Please always attach them when reporting any issues on GitHub or Discord.
# show_macros_in_webui: True
#    Mainsail and Fluidd doesn't create buttons for system commands (macros that are not part
#    of the printer.cfg file). This option allow Shake&Tune to inject them into the webui at runtime.
#    If set to False, the macros will be hidden but still accessible from the console by typing
#    their names manually, which can be useful if you prefer to encapsulate them into your own macros.
# timeout: 600
#    This defines the maximum processing time (in seconds) to allows to Shake&Tune for generating 
#    graphs from a .stdata file. 10 minutes should be more than enough in most cases, but if you have
#    slower hardware (e.g., older SD cards or low-performance devices), increase it to prevent timeouts.
# measurements_chunk_size: 2
#    Each Shake&Tune command uses the accelerometer to take multiple measurements. By default,
#    Shake&Tune will write a chunk of data to disk every two measurements, and at the end of the
#    command will merge these chunks into the final .stdata file for processing. "2" is a very
#    conservative setting to avoid Klipper Timer Too Close errors on lower end devices with little
#    RAM, and should work for everyone. However, if you are using a powerful computer, you may
#    wish to increase this value to keep more measurements in memory (e.g., 15-20) before writing
#    the chunk and avoid stressing the filesystem too much.
# max_freq: 200
#    This setting defines the maximum frequency at which the calculation of the power spectral density
#    is cutoff. The default value should be fine for most machines and accelerometer combinations and
#    avoid touching it unless you know what you're doing.
# dpi: 300
#    Controls the resolution of the generated graphs. The default value of 300 dpi was optimized
#    and strikes a balance between performance and readability, ensuring that graphs are clear
#    without using too much RAM to generate them. Usually, you shouldn't need to change this value.

Changes

  • Measurements are now stored in a new custom .stdata format, giving more control over what is saved to disk and how it is saved. This is easily extensible to store more things in the future. This new approach to data handling also reduces the chance of "timer too close" errors, reducing problems on less powerful hosts (e.g. CB1). But it's still not perfect, so if you still encounter problems, try stopping Crowsnest, Neopixels, etc. before running a test...
  • Fixes the bug introduced with the latest Klipper version (#172). Now Shake&Tune is compatible with the new sweep test, allowing pulse-only (original test) with or without additional motion sweeps to get better graphs, especially on less rigid machines. Please refer to the relevant part of the documentation to choose which test to use and when. In the same vein, the graph headers have also been updated to show what type of test was used and the associated parameters.
  • Introduced a proper command line interface (CLI) for generating graphs from stored data, with support for the new compressed .stdata file format, but also compatible with traditional .csv files. This is super useful for me to debug new features offline, but you can also use it to manually (re)generate some graphs from the CSV you saved.
  • The plotting code has been completely rewritten and refactored. The plotting functions are now separated from the data calculations, making it easier to add new tests or switch to a different plotting backend in the future (and yes, I do have plans for that... Stay tuned!).
  • I've also added some draft code for a future Acceleration vs. Vibration vs. Smoothing trade-off plot. But the current plotting backend doesn't allow all the things I want to make it easy to read, so the code is there but disabled in this release until I find a proper way to present the data.
  • Added compatibility with the "limited" kinematics of Danger-Klipper / Kalico.
  • An optional MAX_SCALE= parameter has been added to the macros to force the energy scale on the belts and input shaper graphs to certain values. This makes it easier to compare several consecutive runs by viewing the graphs side by side with the same scale.

Miscellaneous fixes

  • Improve the startup logic to fail fast during Klipper initialization if a configuration problem is detected. This did not work properly in the past and led to problems where e.g. the [resonance_tester] section was missing but remained undetected and led to a crash when running a test.
  • Updated CI smoke tests to run against better Klipper mockups using a fake board and kinematics instead of the previously used kinematics: none and also by trying against multiple Python and Klipper versions.
  • Fixed incorrect marker colors in the cross-belt plots (purple/orange points were inverted on this plot).
  • Increased the default timeout to 10 minutes, as the vibrations graph can take a long time to run, and some people were experiencing frequent failures due to this.
  • Since the .stdata file format is added, I now have full control over how and when the files are written to disk. So now Shake&Tune will also wait for the file writing to be finished before starting a new accelerometer measurement. This helps with timer too close errors, but also fixes a rare bug where the vibrations graph would not completely record all the data for one of the motors.
  • Added support for alternative Klippy venv in case you don't have a standard installation

New Contributors

Full Changelog: v4.1.0...v5.0.0