SCurve/ sinusoidal , Jerk +acceleration

correct me if im wrong but the other thread asked for different acceleration values based on speed
not a whole different acceleration profile to make for more efficient movement overall and less ringing..
is Ian discrediting lars's findings with less ringing artifacts and higher print speeds?Perhaps im just too stupid to understand? haha.
i think this is a whole new topic?
Ringing is caused (generally) by flex in the belt and oscillation thereafter. the new acceleration profile not only myself but others theorize will reduce oscillation frequencies that trigger belts to act erratically therefore better surface finish.
is this an incorrect assumption stemming from the video evidence presented?
why would Trinamic invest R&D if its not a useful feature?
why would Lars invest time and effort to implementing this also, Is his findings inaccurate?please educate me
a quote from Lars's findings
I'm currently up to about 550mm/s travel, 425mm/s infill printing (extruder permitting) and 100150 mm/s perimeters (depending on quality & planner speed โ and if sharp corners are needed  extruder response limits crisp corners at high speed). Even at lower speeds, the scurve profile gives better print quality  for example, less oscillation / waves after hard corners .
we can theories till the cows come home but it seems from the evidence that Sin wave acceleration profiling as the future of high quality fdm movement? once again i am open minded to be crushed  if you can give me evidence to prove its not effective please present it here.

What the OP is arguing for is to make the second derivative of position
(commonly called 'jerk' by mechanical engineers, although that term has a different meaning in 3D printing)continuous, instead of discontinuous as it is with trapezoidal velocity profiles.Unfortunately, in 3D printing we have a much worse problem, which is that curves are approximated by straight lines. This unfortunately forces us into making the first derivative of position discontinuous, to avoid dropping the speed to zero at every boundary between line segments in a curve. As long as we are forced to do this, there is very little point in worrying about the discontinuity of the second derivative.
If we ever reach the situation where the model files we slice represent curves properly, and the slicers that generate gcode from them generate Bezier curves, cubic splines or some other representation of curves, then implementing smooth changes in acceleration may be worth looking into.

nonpoliginal vector STL files? in a perfect world
i mean surely it can be implemented without that
seems lars figured it out. maybe with some sort of approximation technique?im hoping he publicizes his documentation maybe you can take a look at it?

I haven't yet seen any videos or other hard evidence that Scurve acceleration improves 3D printing  except for those in the habit of putting beer glasses on top of the hot end!
From a theoretical perspective, Scurve acceleration should reduce the higher frequency components of the forces applied, and so would reduce the tendency to excite high frequency resonances.

The notion that the ripples and oscillation in the water would correlate to the ripples and oscillation in the belt is compelling.
I hope Lars uploads his firmware and i will do some test prints and compare.
Lars has claimed it reduces ringing not quite hard evidence i agree perhaps not enough for you to invest time and effort i respect that.
thanks for considering it at the very least.
I hope this is revisited. if only for the purpose of learning. 
@dc42: second derivative of position called acceleration not jerk IIRC. So the OP suggest make acceleration smooth. IMO it is worth of considiration not sure about implementation cost.

You are quite right of course, jerk is the third derivative of position. I started writing one thing and ended up writing another, without editing what I had already written.
I remain of the opinion that implementing smoothlyvarying acceleration is of dubious value unless we first deal with the elephant in the room i.e. discontinuous commanded velocity changes, aka jerk in the 3D printing sense.

@mak:
nonpoliginal vector STL files? in a perfect world
i mean surely it can be implemented without that
seems lars figured it out. maybe with some sort of approximation technique?im hoping he publicizes his documentation maybe you can take a look at it?
STEP files.

does duet firmware not handle jerk aswell as marlin?

don't get Ian started
Thank you Tony for bringing this into (at least) my focus!
Very interesting thread!
I learned to not make things more complex then they need to be! 
@mak:
does duet firmware not handle jerk aswell as marlin?
Very old versions if RRF (about 2.5 years old) didn't handle jerk very well. I don't think Marlin handled jerk properly at that time either.

Alden Hart
4 years ago
Acceleration is performed using a piecewise linear representation of a constantjerk equation. This is the 3rd derivative of position instead of the 2nd derivative (constant acceleration) that is commonly used. The pulse rate is computed for each of the Scurve segments. Each axis is run as a "minor axis" of the 50 Khz clock rate. This minimizes jitter and aliasing  at the expense of running a fast clock rate all the time. The code is on github under tinyg if you want to take a look.perhaps look here.
Id donate for you to take a serious look at this but something about your intellect tells me you're good for money dc42
source:

Yes I know there is code out there to do Scurve acceleration. What I am saying is that it's pointless using it in 3D printing unless we do something about the requirement to command instantaneous velocity changes in 3D printing, which is necessitated by the approximation of curves by straight line segments together with the need to avoid stop/start motion for each line segment.
Commanding instantaneous velocity changes is likely to be far worse than commanding instantaneous acceleration changes, because it's asking for infinite acceleration. I could implement Scurve acceleration, but unless you set maximum jerk to a very low value, you would still excite vibrations when printing curves. And if you did set jerk to zero, it would print the curves very slowly and jerkily.
Scurve acceleration may make more sense for CNC machines for two reasons. The G2 and G3 commands are more commonly used to print arcs, rather than approximating curves using line segments. Speeds are much lower, so jerk can be set very low, perhaps even to zero.
I'm not saying that I won't implement Scurve acceleration in the future, I am saying that it has limited value in the context of 3D printing. OK for printing straight lines, useless for printing curves. If it was easy to do it properly, I would probably have done it already. But doing it properly requires the solution of cubic equations to calculate the step pulse times (currently RRF solves quadratic equations to calculate them).
So I would rather focus on a solution to jerk first, probably by deliberately deviating the tool path from the commanded path a little. When that's sorted, I can look at Scurve acceleration.
It would be interesting to calculate the forces generated in a typical 3D print due to to jerk and step changes in acceleration, then take the Fourier transform and see what the various contributions are in the most important frequency bands.

I wonder if you can put an accelerometer onto tool head and input on the duet, to record the feedback,
you perhaps could use that dataโฆ and the real time data to create a PID tuning system to dampen out the oscillation realtime.. perfect printing. also you could use that accelerometer to judge if there have been skipped steps or nozzle crashes..
?
...imagine having that setup then somebody mounts their accelerometers off axis and the whole printer goes haywire correcting wrong values lol
alright Thanks for hearing me out Dc42 I hear youโre doing exciting things with duet. Keep up the good work best wishes.
the struggles to get rid of belt wobble are real. 
So a few weeks late to the party butโฆ
So I would rather focus on a solution to jerk first, probably by deliberately deviating the tool path from the commanded path a little. When that's sorted, I can look at Scurve acceleration.
I think this is the best solution and could greatly help out. Machine tools that use Fanuc controllers have an option to use a technique called Smoothing/Nano smoothing that does exactly what you are proposing. Many modern day CAM packages approximate complex curves as straight lines, same as our slicers do with STL files. There are some high performance machine tools that can approach 3d printing speeds while machining. Fanuc's answer was to allow deviations in the tool path by using lookahead and building a NURBS curve. It is even intelligent enough to automatically turn off when the movement vector exceeds a specified angle.
https://www.fanucamerica.com/home/productsservices/cnc/cnctechnology/highprecisionmachining

Both AMF and OBJ file formats support curve approximation in different ways. It seems that Microsoft's 3MF does too. Doesn't mean any common CAD software actually properly exports that feature of the file formats. I understand that there aren't any slicers which would properly handle this yet either.
Looks like Cosine Additive has some G2/G3 stuff figured out. I know this is already implemented in Firmware. It's beyond my capabilities but maybe a post processor could bridge the gap between current slicer capabilities and what the firmware is capable of?
https://www.cosineadditive.com/blog/2015/7/1/g2g3vectorbasedprinting 
Curve approximation as straight segments would really be fine if there was hardware accurate/precise enough to create artifacts in FDM prints just from the "error" of microstepping, right? Polyjet machines are amazing because they show stl roughness. We still don't have proper pressure regulation within hotends. Nor do we have common methods for modeling kinematics (which may follow with the dissemination of higher order movement planning in desktop printing platforms). Perhaps a feature like scurve movements will drive better hardware. It should lift the acceleration/payload and velocity ceilings a bit. I'd like to know if scurves even match to "advance" behavior in a standard hotend like a titan aero.

@mak said in SCurve/ sinusoidal , Jerk +acceleration:
Bottom is a square wave, not a trapezoid. You'd see 4 sploshing events if it were a trapezoid.

I have ready 3D printing scurve velocity profile. And continuing velocity to next move in tangential directiin. Support corner shape to move without stop to next directiin and start from 0. Now i rewrite code to custom moderboard with pic32mz 200mhz. On pic24hj128gp202 calculate next move is abow 4us. . Now i must write communication protokol to support g code. In this moment i have G0 G1 G2 G3 and G4. Hi this pass for testing.

While I was on vacation I did a Fourier analysis of the effects of trapezoidal and Scurve acceleration on exciting ringing. My conclusion was that whether Scurve acceleration helps or not depends on the relationship between the time spent accelerating or decelerating and the frequency of the ringing that you are trying to avoid.
Here is the summary. Let T be the time spent accelerating or decelerating, and let F be the frequency of ringing that you want to avoid.
 If F << 1/T then constant acceleration and Scurve acceleration are equally bad.
 Otherwise, if F < 1.3/T then constant acceleration is better than Scurve (triangular profile) acceleration. In particular, when F = 1/T then constant acceleration will hardly excite the ringing at all; whereas Scurve acceleration will excite it greatly.
 When F > 1.3T, Scurve acceleration wins at most frequencies. The higher F is, the better Scurve acceleration is  although the tendency to excite ringing when using constant acceleration also falls with rising F.
Here is a chart to compare how the two acceleration profiles excite ringing at different frequencies.
Based on this analysis, I discussed how to adjust the acceleration time to reduce ringing in this thread https://forum.duet3d.com/topic/5951/periodicityofringing/39 and received reports that it worked. Today I found time to do my own beersloshing tests (see the video I posted to that thread), and they too have confirmed the theory for constant acceleration (trapezoidal) motion.
So before you decide that you must have Scurve acceleration, you really need to know the frequency of the ringing that you are trying to eliminate. If the ringing frequencies are high enough, then Scurve acceleration will help. But if they are low, then it will probably be better to use trapezoidal motion, and cancel out the lowest ringing frequency by choosing the acceleration carefully.
I'll write up the maths in a blog post when I find time.

Hi, it is not too surprising that there is a certain time between the acceleration changes, which causes to increase or reduce ringing.
Every time the acting force (acceleration) changes the system gets bumped and stars to oscillate. So every acceleration change introduces one oscillation and all oscillations together get superpositioned, meaning the waves can amplify or cancel each other. If the big bumps (ramp start and end) are spaced in time in a way the big waves overlap, the ringing will be maximized and vice versa. This effect will appear at multiple acceleration times (it is periodic).
But it is surprising, that a more gentle change of acceleration will increase the problem anywhere. More gentle means less dominant waves and less chance of amplifying these dominant waves. Maybe it is just bad luck or a bad coincidence. At least in theory it seems hard to find a not too academic explanation for that behavior.
Which scurve profile did you use ? How big was the maximum acceleration using scurve compared to the constant ramp acceleration ? How much was it higher ? Was the max speed or speed at the end the same ?
What also should help to avoid amplifying interference is to use different acceleration changing shapes at start and end of a ramp. E.g. start with d(acceleration)/dt <> 0 and end with d(acceleration)/dt == 0.

The Scurve profile I used was triangular, i.e. ramp up the acceleration linearly to its peak value, then immediately ramp it down towards zero again. The peak acceleration in the Scurve case has to be twice the steady acceleration of the trapezoidal case in order to keep the total acceleration time the same.
Scurve profiles that are in between the two (i.e. including a steady acceleration part) will give excitation factors in between the two curves plotted above. I'll plot some specific examples when I have time.

@dc42: i cannot see any chart what do i do wrong ?
below
Here is a chart to compare how the two acceleration profiles excite ringing at different frequencies.
is nothing (at least for me)

@vp said in SCurve/ sinusoidal , Jerk +acceleration:
@dc42: i cannot see any chart what do i do wrong ?
below
Here is a chart to compare how the two acceleration profiles excite ringing at different frequencies.
is nothing (at least for me)
Try refreshing the page?

i can see the chart on my tablet, but not on my PC, something seems to block the url/domain on my PC. Thanks.
Some well working theory/basics:
Given a spring mass system with mass m and spring stiffness c and force excitation it follows:
If the acceleration (force) is changed stepwise by amount k1, the amplitude a1 of the oscillation caused by this step is directly proportional to the step size k1.

If the acceleration is changed like a ramp with ramp rate k2, the amplitude a2 of the oscillation caused by the ramp start is directly proportional to the ramp rate k2.
It follows that a2 / a1 == k2 * sqrt(m / c) * k1. [EDIT: typo correction > m/c corrected to sqrt(m/c)]
So depending on the ramp rate (or step size) and also on m/c, the generated oscillation has a bigger or smaller amplitude for a step wise change or a ramp  it depends on the system (m & c) and tuning settings (k1 & k2).
I didnยดt include damping because with damping the results are by far not as obvious and beautiful  but in principle it is exactly the same. A real fdm printer is also a combination of mass/spring/damper systems, but one frequency will dominate (ringing) and the above is also still valid.The frequency (sqrt(stiffness/mass)) is naturally the same for ramp and step.
So in case one big wave is generated (ramp start) compared to a lot of smaller waves (scurve), it must be bad timing if the ringing is worse with scurve OR it might come from a2 / a1 = k2 * sqrt(m / c) * k1.
E.g. if one big wave is generated at acceleration start and the next bump/wave start follows at acceleration end with an unlucky phase shift, it will superposition and amplify (triangular scurve). It is easy to add one big wave to another big wave, so that they amplify each other. But it is much harder to superposition many smaller amplitude varying waves (real scurve) in a way that they amplify each other  which doesnยดt mean it is not possible in principle.In the end the triangular acceleration profile might be an unlucky profile to compare scurve with the step wise acceleration change !
So depending on the above the ringing test results may vary. In general, many fdm printers will have comparable m/c and k2/k1 (k1 and k2 can be set anyhow). I didnยดt check if this can be a game changer for some fdm printers. But there are very stiff and light (m/c is very small) as well as heavy and soft printers (m/c very high) out there....
