New zero slowdown linear advance algorithm #27352
Draft
+194
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Linear advance reduces the max acceleration so that the la_advance_rate is kept below e_jerk. The existing implementation also suffers from some degree of quality loss due to it not accounting for the discontinuities in pressure due to both movement jerk and changes in line width (i.e the ratio of e_steps to step_count).
This WIP PR removes that restriction by handling linear advance acceleration in its own isr, and allowing it to not be perfectly in synch with movement. This should theoretically reduce quality, but in practice it doesn't seem to be a problem. In fact, since this algorithm does account for movement jerk and line width changes, the resulting quality is improved beyond the original existing algorithm, and that at higher printing speeds.
The algorithm is as follows:
current_rate * k
This is work in progress.
Optimisation so it can run in slower machines is pending (and ideas very welcome)
Requirements
Definitely a 32 bit board. For now, maybe even one with a floating point unit
Benefits
Better quality, faster prints
Configurations
#define LA_ZERO_SLOWDOWN
Related Issues
#27259