-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Smooth_linear_advance WITH s_curve_acceleration [experimental] #27827
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
Smooth_linear_advance WITH s_curve_acceleration [experimental] #27827
Conversation
32148c4
to
0b0a29e
Compare
Strange. I have s curves enabled in configuration.h, AND smooth linear enabled in configuration_adv.h, yet I have never gotten a compile error or warning. And yes, the error line is there in the sanity check. It is just never invoked. I also have all three axes enabled in input shaping, with the frequencies determined by an IPhone accelerometer app. |
@rq3 maybe you had an older version. @thinkyhead added that sanity check at some point. |
Nope. I get no compiler errors or warnings whether or not that line is in sanity check. Weird. Oh well, I'm off to install the latest compiled firmware.bin with your s-curve mods. |
Is this intended to be used alongside Input Shaping, or as an alternative? Additionally, does it matter if class jerk or JD is used? |
Yes, it's different functions with different purposes.
Doesn't matter.
Do you have line |
@grizzleeadam you may have to recalibrate input shaping and the idea is to combine all together (smooth linear advance + input shaping + s curve) Please do post your results |
It looks like PR27818 was just merged. Could you possibly rebase to the latest bugfix? |
0b0a29e
to
e37cd31
Compare
@grizzleeadam Done, I couldn't test it yet, but the changes are rebased and conflicts resolved |
e37cd31
to
0365f43
Compare
Just gave it a test. It works. |
@thinkyhead, I took a quick and dirty approach in this PR to avoid interfering with motion. Do you have any ideas how to do this a bit more cleanly? |
It seems you're getting a bit more corner over-extrusion with S-curve enabled. I haven't had a chance to try this out yet - have you tried tweaking any other parameters to clean up the corners more? Does look like a significant reduction in ringing. |
Yes, just increased k from 0.04 to 0.05 and it's fine. I think it's just that the head stays a bit longer bear the corner and the low k just depressurized there |
I just remembered I had lowered jerk a lot because i was calibrating input shaping and the Klipper docs say so. |
here’s my sample. Top is without S-Curve, bottom is with it enabled. Quality changes with height as I was calibrating JD. It seems the detail inside the triangle is much smoother with S-Curve! Speed is 100mm/s, 3000 acceleration, 0.4K with Bowden. It seems we may need to have a branch with S-Curve and your other e-sync fix combined together - as of now I’m unable to test re-calibrating IS with S-Curve together. |
Top is without S-Curve, bottom is with it enabled
But top looks much better, doesn't it?
|
Top was printed with 2 perimeters and bottom was in vase mode, which may
have contributed to the difference in surface quality on the flat parts.
The details in the notch are what I consider to be the biggest difference.
…On Sat, May 17, 2025 at 7:26 PM Vovodroid ***@***.***> wrote:
*vovodroid* left a comment (MarlinFirmware/Marlin#27827)
<#27827 (comment)>
>Top is without S-Curve, bottom is with it enabled<br> But top looks
much better, doesn't it?
—
Reply to this email directly, view it on GitHub
<#27827 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6SRTTQUJ6LP4CIQWQFSBCD267VTZAVCNFSM6AAAAAB4GPP7TOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOBYG4YTSNJRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Could you print with the same settings? Otherwise it's hard to compare.It's strange that vase produces much more ringing.
|
As for me top-left looks much better.
|
They're no the same layer height, are they?
Ill rebase this one on top of the fixes today and ping you |
0365f43
to
4864f04
Compare
@grizzleeadam This draft pr now includes the fixes from #27862 |
Same as @robherc, I don't really know for sure. You may be right that the duration of each phase is not the exact same as the trapezoidal profile. In this PR I just piggy back on the existing calculations to compute the appropriate advance for each instant where the smooth linear advance ISR runs. |
Actually, you are right! my prints are taking a less than what the slicer says. And I get less ringing. |
I've tried this PR (before conflicts appeared) and got X axis layer shift. Does S-CURVE in this PR also applied to non-printing moves, or it's just coincident? |
Yes, all moves. It could be the case that it is related. S curve reaches I think twice the acceleration in its steepest point, so if you were too close to your max accel it would be best to reduce slightly. Btw, did you combine it with input shaping? I'm getting very clean prints with everything combined. The cleanest I've ever had |
I again took a look on print - actually layer shift could happen by short (about 5 millimeters) move (whether printing or travel).
In this PR or always? I didn't have layer shift with S-CURVE before.
Yes.
It's difficult to say on this model, also material I used (PETG) is not the best quality. |
Always. This pr only changes extrusion, motion is untouched. Congrats on the non linear extrusion PR merge btw. The layer shift must be a coincidence, smooth linear advance does not change anything motion related, only extrusion |
Ok, I'll try again |
Could you resolve conflicts to test on latest version? |
f9b787e
to
c6bc380
Compare
resolved |
I was sure that it reduces vibration and frame load by gradually increasing acceleration, but not exceeds defined limit anyway. |
You bet I thought it was! |
I printed with this PR - looks good, though I don't have the same object printed before to compare. |
The code is crappy, need to rebase and reorganize it a bit, but functionally it is done. I need a better way to make it coexist with the normal usage of the s curve coefficients |
c6bc380
to
002a7bf
Compare
3791e7d
to
6ea4a16
Compare
@thinkyhead any advice on how to reuse the bezier code without backing up variables and whatnot? |
These are written in hand-coded assembler for performance, particularly vital on AVR. These routines use the hardcoded RAM addresses of the variables to bypass stack passing. If the functions were re-built around the function calling ABI with a structure pointer and member offsets that would allow them to work on more than just the one set of values. It wouldn't necessarily be faster due to the added stack manipulation. We'd have to get a profiler on that. |
Ok, sounds like it wouldn't make much more sense since smooth LA most likely only works on 32 bit machines. |
Description
Adds s-curve support to the lookahead function.
Note that smooth linear advance can actually track the acceleration profile, this is different than classic/rough advance, which always managed nozzle pressure as if the profile was trapezoidal.
NOTE: this PR is based upon the not-yet-merged PR #27818(merged)NOTE: this PR is based upon the not-yet-merged PR #27862, so all of those changes are included. The actual changes of this PR are inside the "Experimental s-curve" commit only.(merged)Requirements
Benefits
Configurations
Related Issues