-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[shaper_calibrate] Reworked multi-file shaper calibration and small shaper selection improvements #7103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dmitry Butyugin <[email protected]>
* Do not recommend ZV shaper by default if possible * Try to find more optimal shaper out of more aggressive ones Signed-off-by: Dmitry Butyugin <[email protected]>
Signed-off-by: Dmitry Butyugin <[email protected]>
|
Thanks. In general it seems interesting and useful to me. One question I have - would it be reasonable to convert from the current Otherwise, I did not review the math in this PR, but I'll defer to your expertise. It sounds like a useful addition. Cheers, |
|
Thanks for the feedback, Kevin.
This kind of change is orthogonal to my changes in this PR though. I do agree that this could be beneficial, but I think we should consider doing that separately. And there's one more challenge though, specifically for multi-point input shaper testing: it would require some redesign of the GCodes, because unlike bed meshing, which just needs to be done over an area of a bed, you need to be able to run fairly custom sequences of tests to calibrate the input shaper. For example, on my IDEX, I defined the following macro: And then calibrate the input shaper by running for T0 X, T1 X, and Y, so the calibration procedure is fairly elaborate in terms of which points in which order are being tested and also which results are being used for what. One could redefine the API to something like and/or we could also export the results for just simple cases for now, but again, I think that goes beyond the scope of what this PR tries to do.
Notably, the format of the files produced by the main Klipper facilities does not change, e.g. for
Right, so with all that being said, I think it is fine to commit the PR as-is, it does not affect most of the people who do single-point input shaper calibrations, and for those who do multi-point calibration, it should already be beneficial in my opinion. |
Well, FWIW, you could do the same thing - instead of
Ah, okay - I missed that. It does look like it is new files with new file layouts though. (Potentially more columns in the csv file.)
Okay. I'll give a few more days to see if there are other comments. I'll also try to put together some example code of how this could be moved to the webhooks api, but I'm unlikely to get to it in the next few days. Cheers, |
So, as I said, I am not against the idea of exposing the resonances data via webhooks API. I will consider that, but I think it should be discussed and implemented separately. FWIW, at least just exporting the resonance test data via webhooks would be an easy change (so that web frontends could display it already).
Right, as I mentioned, only rather specific very rare cases of file outputs are affected. The majority of the practical uses are not affected. But since it is theoretically possible to produce these files, the reading in the scripts was adapted to handle those cases too.
Sure, thanks. |
This PR substantially reworks how the automatic shaper selection processes multiple resonance data files. Some printers can have different resonances at different points of the build volume (e.g. bed slingers at different Y positions, some CoreXY printers when gantry or Y rods have insufficient stiffness, delta printers across build volume in general, etc.), so in order to do a proper input shaper selection, one may need to run resonance testing at different points, and somehow combine the results. The current Klipper script just combines the resonances data from different files and averages the measurements for the same frequencies. This has a downside that individual resonance peaks at specific points may be smoothened out by data at other points, sometimes leading to poor input shaper selection. The new reworked algorithm instead estimates remaining vibrations (as a percentage) for each shaper for each resonance measurement individually, and then selects the input shapers that minimizes the vibrations across all measurements. In addition, this PR brings a couple of other minor changes to the shaper selection algorithm:
Here's a comparison for a few cases of the current and the new algorithm for multi-point automatic input shaper selection:
And while you can see that the input shaper recommendations are not always different, sometimes it is more accidental, and the new algorithm still better accounts for individually measured resonances.