Documentation update request for Measuring Resonances:

Doing some input shaping calibrations on my printers and found (what I think may be) an outdated section in the Klipper documentation under the ‘Measuring Resonances’ section:

When trying to create the graphs for the shaper it seems the two data files in the /tmp/ folder are now called “calibration_data_” instead of “resonances_”, so the two lengths of code don’t find the correct files.

If the two lines of code were change from:

From:

~/klipper/scripts/calibrate_shaper.py /tmp/resonances_x_*.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/resonances_y_*.csv -o /tmp/shaper_calibrate_y.png

To:

~/klipper/scripts/calibrate_shaper.py /tmp/calibration_data_x_*.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/calibration_data_y_*.csv -o /tmp/shaper_calibrate_y.png

or perhaps have both lines mentioned as if the script throws a FileNotFoundError with the ‘resonances_’ commands then use the ‘calibration_data_’ commands.

Anyways, just wanted to point that out! Really appreciate the documentation work and coding all you folks have done!

calibration_data_* is output by the automatic calibration command SHAPER_CALIBRATE, which is documented elsewhere in this file. The examples given are not out of date, they are part of this specific process which does not use this command so cannot generate those output files. You can’t expect to arbitrarily jam parts of two different processes together with zero effort on your part.

I see the calibration_data_* mentioned further down under the SHAPER_CALIBRATE section, but no mention that it can be used with the script.

Does that mean it cannot be used to generate the graphs?

Also, I didn’t mean any offense, just thought I spotted something that might be helpful :confused:

I rechecked the documentation, and it is correct.

  • TEST_RESONANCES command → resonances_*.csv
  • TEST_RESONANCES OUTPUT=raw_data command → raw_data_axis*.csv
  • SHAPER_CALIBRATE command → calibration_data_*.csv

Each of these commands and the corresponding filenames is mentioned in the correct context in the documentation.

The SHAPER_CALIBRATE command is explicitly for autotuning from a web interface without the need to drop to the shell and perform manual work.

The need to mention that calibrate_shaper.py can be used with all three output formats is debatable, but would not hurt. Feel free to submit a PR to improve this section.

Thanks Sineos!

Would something like this make sense to be added? Any changes before submitting a PR?

Thanks for working on it!

My recommendation would be:
The SHAPER_CALIBRATE command is introduced here: Measuring Resonances - Klipper documentation

Right at the beginning, it is already mentioned:

Rephrase this section and move the information to the end of this chapter, something like:

The SHAPER_CALIBRATE command also generates csv output (/tmp/calibration_data_*.csv), which can be processed using the calibrate_shaper.py script, for example:

~/klipper/scripts/calibrate_shaper.py /tmp/calibration_data_x_*.csv -o /tmp/shaper_calibrate_x.png
~/klipper/scripts/calibrate_shaper.py /tmp/calibration_data_y_*.csv -o /tmp/shaper_calibrate_y.png

As stated before, I would think that all the needed information is already present, so duplicating it at various places might be debatable as it will blow up the chapter, which is already quite unwieldy. Maybe something like the following is already enough:

The SHAPER_CALIBRATE command also generates csv output, but with different filenames (/tmp/calibration_data_*.csv). These files can also be processed using the scripts as shown in the chapters above.

Or even shorter, leaving the whole structure as is:

This will run the full test for both axes and generate the csv output (/tmp/calibration_data_*.csv by default , which is also compatible with the analysis scripts above) for the frequency response and the suggested input shapers.

It definitely would keep things a bit more organized to have the commands down in the SHAPER_CALIBRATE section, so I can update the PR for that! I do think it’s worth having the command lines like in the rephrase you have as I’ve always found it handy to have the commands to transpose into SSH when working through the Klipper manual!

I guess my thinking with having it up under the ‘Measuring Resonances’ section is that is where I’d be reading on how to generate the graphs and with both TEST_RESONANCES and SHAPER_CALIBRATE being capable of producing the raw data for the scripts it made sense to have that information close together.

If you are following the reading flow, it makes sense to introduce the command SHAPER_CALIBRATE before mentioning “advanced” usage topics.

Moved the edit down to the end of the section and merged it with the existing reference to SHAPER_CALIBRATE. Only adds a line and the two commands, much more compact, but still near the section on generating the graphs! :slight_smile:

1 Like