# LinuxCNC S-Curve Accelerations

19 May 2018 16:29 - 19 May 2018 17:57 #110889 by rmu
Replied by rmu on topic LinuxCNC S-Curve Accelerations
I was actually replying to the message from automata, but I'm not very used to forum software, seems the quote was lost.

If you use the planner as is with something as an effective average acceleration and substitute the s-curve in the execution phase it could in theory happen that you don't leave the "S" on beginning/end, so the assumption that the planner will keep up with this "average" acceleration does not hold for short segments IMHO.

While at it, did anybody have a look at the synthetos g2core 6th order bezier smooth motion planner?
Last edit: 19 May 2018 17:57 by rmu. Reason: replaced tinyG with synthethos g2core

21 May 2018 09:15 #110953 by automata
Hi rmu,
The jerk percentage method will not guarantee any limits on the max jerk. It only takes the current acceleration phase and divides it into 3 parts based on the percentage.
For a trapezoidal velocity planner, you will have either 1, 2 or 3 phases based on your starting velocity, ending velocity, and max velocity for the segment.
If you have a segment that is accelerating or decelerating, you divide that segment into 3 parts on the time axis (NOTE that parts are not made on the distance axis).
Alternately like Fanuc, you can limit jerk from 0 upto 128 msec (based on a user editable parameter). That way your segment has to longer than 128*2 msec for execution.
In both cases you will always reach the max acceleration since the jerk limitation phase was allocated after the trapezoidal velocity planner has finished the planning of the complete time of the trajectory.
hope the explanation helps.
-automata

21 May 2018 09:51 #110954 by rmu
Replied by rmu on topic LinuxCNC S-Curve Accelerations

If you have a segment that is accelerating or decelerating, you divide that segment into 3 parts on the time axis (NOTE that parts are not made on the distance axis).

Yes, I understood that you divide a segment with constant acceleration a (coming from the trapezoidal planner) into a segment with acceleration < a and some sufficiently smooth form, then a "cruise" with acceleration slightly larger than a to make up for the slower smooth start/end segments, and then a smooth "deceleration" phase to get to the commanded exit velocity.

My question was regarding this smooth transition at the beginning/end of the segment, if the segment is too short (for a given jerk limit), you can't make up for lost time with larger acceleration.

If you don't guarantee a maximum jerk, that explains it. Short segments will then be executed violating the jerk limit.

I noticed that the linuxcnc trajectory planner has a cubic interpolator switched between the trajectory planner and command outputs, this seems to be a remnant from times when TRAJ_PERIOD usually was n times SERVO_PERIOD, n>1. If I understand correctly, this interpolator limits jerk somewhat. A step is spread out over 3 periods.

05 Jul 2018 02:25 #113452 by Methier
Hi, what happened to this topic? any news on this? i find it interesting even necessary and i have machines available for testing.

Meth

05 Jul 2018 08:21 #113460 by rmu
Replied by rmu on topic LinuxCNC S-Curve Accelerations
have a look here

forum.linuxcnc.org/38-general-linuxcnc-q...oth-velocity-profile and here github.com/rmu75/linuxcnc/tree/rs_6otp

Don't have much time at the moment, but I'm working on it (slowly).

26 Mar 2019 12:32 - 26 Mar 2019 12:48 #129674 by TiEr
Replied by TiEr on topic LinuxCNC S-Curve Accelerations
Hey,

i have looked for an implementation of S-Curve on LinuxCNC and stumbled on this thread: emc-developers.narkive.com/jxJvsPLF/jerk...ted-trajectory#post4

It seems that someone made an s-curve trajectorian planer in the year 2012! Have a look at his git: github.com/araisrobo/linuxcnc/blob/maste.../emc/kinematics/tp.c

Moreover it seems to work:

Is there a way to commit this implementation to the current version of LinuxCNC? Sadly i have not the abbilitys to realize this.

Timo

EDIT: i have found another post where they linked to his repo with newer code: github.com/araisrobo/machinekit/tree/rpi2-spi/src/emc/tp
Last edit: 26 Mar 2019 12:48 by TiEr.

27 Mar 2019 00:22 #129742 by cmorley
At the time of the branch started, (IIRC) it was jerk limited but only one block look ahead and didn't do spindle sync quite properly.

I believe it would be difficult to incorporate it without being an expert on the current multi-block look ahead planner.

Chris M

14 Mar 2020 05:34 - 14 Mar 2020 05:34 #160134
Any news on this?
Last edit: 14 Mar 2020 05:34 by grandixximo.

17 Mar 2020 12:56 #160550 by andypugh

Any news on this?

No. As far as I know nobody is looking at finite-jerk with the current multi-block lookahead TP.