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
[2.0.x, Question] S_CURVE_ACCELERATION and JUNCTION_DEVIATION seem to have no effect? #11672
Comments
I am reading up on motion control here and I am a bit confused. Here they talk about acceleration either being constant, or being jerk limited. I assume that when you enable S_CURVES, you are in fact doing what they call jerk-controlled motion, whereas the older versions of Marlin did what they call constant-acceleration. But in jerk-controlled motion, the "jerk" is right in the name and a limit must be specified. But yet, when you enable JUNCTION_DEVIATION, the jerk settings in Marlin go away. So, my question is: When both S_CURVES and JUNCTION_DEVIATION are enabled, where do you set the maximum value for the jerk? |
That was ... Pretty good explained, |
Now we know what Marlins jerk-speed is and why it can work. Marlins
|
@AnHardt: Your explanation makes perfect sense as it applies to the motor. But the X and Y carriages are a block of physical mass and you need to control the real jerk (m/s^3) it experiences accelerates so you can reduce the ringing artifacts on the print. It sounds like Marlin is lacking actual jerk-controlled motion as it relates to the hotend and print bed. It appears to me as if the new S-Curve based acceleration smooths out the acceleration curve in some way, but it does not seem to be tied to a physically based factor such as real jerk factor (m/s^3). If that is the case, the reference in the code to the TinyG page is misleading, as TinyG appears to implement true jerk-controlled motion, whereas Marlin does not. |
@marcio-ao |
@AnHardt: That somehow that seems backwards. If we are defining a maximum acceleration value in Marlin, we are defining the peak value for the acceleration curve, but there would need to be something that tells how the acceleration curve will look before and after that peak, i.e, how steep it is. That something is supposed to be the jerk. Reading through comments in the code I see that S_CURVE_ACCELERATION fits a Bezier curve to the acceleration profile. The mathematics is way beyond my understanding, but one thing that makes me a bit curious is that I've only heard of Bezier curves in the context of computer graphics, never within a the context of motion systems. I suspect what is being done is to apply a Bezier to the trapezoidal acceleration curve with the control points chosen to give the sides of the trapezoid an S shape. While this would most likely lead to smoother motion, I wonder whether this corresponds exactly to a jerk-limited scenario, or is just a clever approximation. Alas, like I said, the code is well above anything I could understand, so even if it is just an approximation, it's a darn clever one for sure. |
@AnHardt : I see you expanded your explanation above. My conclusion is that it seems like there are two things going on in a 3D printer. 1) vibration due to the stepping action of the motor and 2) vibration due to the momentum of physical parts of the printer, such as the print head X motion and bed Y motion. These two things need to dealt with separately. My questions concerning motion control were related to 2 -- it had not even occurred to me to think about 1, so it is helpful that you brought that up. |
S-curve acceleration is a way to control real (d^3s/dt^3) jerk, separately from how Marlin handles its jerk-as-instantaneous-velocity-change. In non-S-curve Marlin, the velocity profile is a trapezoid, which means the acceleration profile is a piecewise constant function (+acceleration on the rising slope of the trapezoid, 0 for the plateau of the trapezoid, -acceleration on the falling slope). Taking a second derivative, you find that real jerk is undefined at four points: the start and end of the move, and the start and end of the plateau (it's 0 everywhere else). The s-curve is different. The 8-bit code makes some approximations, but mathematically the curve should be one with a constant 6th derivative of position (aka an order 6 polynomial). This makes the jerk a cubic function, meaning it's continuous and smooth throughout the move. Obligatory marketing video: https://youtu.be/qYJpl7SNoww Traditional jerk (or junction deviation) is still needed to avoid accelerating to a stop between every move. But the S-curve should make the acceleration profile smoother within each move. Edit: here's a good description of TinyG's S-curve implementation. I found it helpful when trying to understand Marlin's version. |
Awesome explanation, thanks @AnHardt . |
Currently we do define, not the peak, but the maximum average of acceleration. We calculate the shape of the trapezoid with the configured acceleration and then replace the diagonals with S-shaped curves taking the same time. That means, peak acceleration, in the mid of the S is larger than the configured one. That does not really matter since all these values for accelerations, jerks, speeds are empiric - When you get skipped steps - lower them, or improve the other side of the equation - friction, mass, current, decay-mode, ... Yes - it's a approximation. No processing power for the real stuff. |
To come back to your first questions. As always there is a lot of rumor on the roads. Keep cool and make your own thoughts and tests. |
It's often very difficult to make a judgement of whether a particular feature makes a difference in real life. While it's tempting to think, if it is new, it has to be better, it's often hard to actually prove it :)
Will 32-bit boards be a turning point? |
@houseofbugs has been using |
@thinkyhead: I'm not denying that it does. It's just that nailing down the right set of circumstances under which it makes a difference seems challenging. Right now it seems like tuning 3D printers is more guesswork than a science. Maybe it's time to start sticking accelerometer chips on the toolhead and find a way to take some measurements! |
Certainly. Given the experience of @houseofbugs, I was hoping we could entice him to chat with us about his settings and what kinds of results he's getting in a variety of circumstances. |
short question, does S_CURVE_ACCELERATION require 32bit or no tmc or something else? |
|
There are no warnings and ther is space left after compiling, i dont have lcd and bedleveling so ther ahould be headroom. I will try with daily maybe something got corrupted. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello all,
I am a bit perplexed by something. I have been experimenting with S_CURVE_ACCELERATION and JUNCTION_DEVIATION with a Feedrate Percentage between 500% and 999% on SD prints and while my calibration cubes are coming out shockingly good for such high speeds, turning either of those two feature on or off does not seem to change much at all.
I am printing with the default acceleration set to 1600 mm/s^2, but the maximum acceleration for each axis is 9000 mm/s^2. The maximum feedrate capped at 300 mm/s.
I am curious as to whether anyone has any hints as to why I am not seeing any print quality differences with these new features? Could it have something to do with the fact I am using the Feedrate Percentage knob rather than increasing the speeds in the slicer?
Anyhow, I've heard great things about S_CURVE_ACCELERATION and JUNCTION_DEVIATION, so I'm a bit perplexed as to why they seem to be having no noticeable effect in my case.
-- Marcio
The text was updated successfully, but these errors were encountered: