LinuxCNC S-Curve Accelerations

More
15 Jun 2021 11:14 #212112 by arvidb

Hi Arvidb,

Do you have an idea how the lecture dealing with this "kink" in the curve, you would expect researchers have dealed with this
before?

I haven't been able to find an existing, published solution for this problem, no. As I've said before, jerk-limited planning with inital velocity and acceleration state is a surprisingly difficult problem to solve!

It's quite hard to imagine when the velocity curve looks ok and the acceleration curve looks ok.

Since you calculate the displacement incorrectly, your nice velocity and acceleration curves don't match the true velocity and acceleration of the displacement curve. You are getting fooled by your own diagrams!

There could be a kink in the displacement curve in some "exotic" cases.

No. Since a kink in the displacement curve means infinite acceleration, a jerk- (or acceleration-)limited planner will never have any such kinks, no matter how "exotic" the case is. By definition.

[edit] After some experimenting it occur's when intitial and or end velocity is not zero.

And that this "kink" is in fact a infinite acceleration stage. When using a 20Kw servo it could result in a machine shock. :pinch:

Indeed. I'm glad you see the problem now.

Is it a idea to avoid this "kink" with a algoritme?

Well, that's the whole idea, right? To create a jerk-limited planner?

Are you able to implement your example in the qt code?

What example are you talking about? But no, I have my hands full with trying to get my own code working. :)

Please Log in or Create an account to join the conversation.

More
15 Jun 2021 12:11 - 15 Jun 2021 12:12 #212116 by Grotius
Hi Arvidb,

As a result of our conversation i will plan a date to review my code.

You are getting fooled by your own diagrams!
After the review i will report my conclusion.

In the mean time my current scurve implemenation works nice with my robot program development.
On top of the scurve, the program has a stepgen backend.
This stepgen backend is the insurance there will be no machine shock.
If there is a "kink" in the curve, the displacement shock will be absorbed by the stepgen component.
Maybe that's the reason i never mentioned this.

So far so good. I wish you a happy coding !
Last edit: 15 Jun 2021 12:12 by Grotius.

Please Log in or Create an account to join the conversation.

More
17 Jun 2021 18:56 #212287 by TheRoslyak
Hi everyone
If you have a question: Which algorithm to choose?
I can search in source codes of the Balt-System of this function.
At the bottom, I have attached a description of this function for a regular user. (but only in Russian) If it will speed up the development, I can look for implementations in the source codes.
All the mathematics, formulas and methods have already been tested over the years)
Attachments:

Please Log in or Create an account to join the conversation.

More
17 Jun 2021 23:49 #212304 by arvidb
Unfortunately I cannot read russian, but looking at the diagrams in the pdf they only display "symmetric" curves, i.e. point-to-point moves with zero initial velocity and acceleration. Such moves aren't very difficult to handle, it's the nonzero initial conditions of jogging that makes things so difficult.

Also, LinuxCNC is GPL licensed so unless Balt-System's source code is open source we cannot use it. Of course, if you can read the code and learn from their algorithms and explain them here, without posting any code, then that would be interesting.

Please Log in or Create an account to join the conversation.

More
18 Jun 2021 08:04 #212316 by TheRoslyak
Of course I wasn't going to give all the source code. Only needed part.

Please Log in or Create an account to join the conversation.

More
18 Jun 2021 20:22 - 18 Jun 2021 21:00 #212355 by Grotius
Hi,

Today i made new, fresh code based again on this paper : github.com/grotius-cnc/S-curve-motion-pl...ng/blob/main/Ch5.pdf
The result now looks promising.

The displacement curve (purple) has no "kinks" when using initial and or end velocity commands.



And a video : user-images.githubusercontent.com/448801...3e4-92524c2a02c2.mp4
Qt project in development stage, but functional : github.com/grotius-cnc/S-curve-motion-pl...g/releases/tag/1.0.2
Attachments:
Last edit: 18 Jun 2021 21:00 by Grotius.
The following user(s) said Thank You: tommylight, robins, Shu, roland

Please Log in or Create an account to join the conversation.

More
19 Jun 2021 12:28 #212396 by arvidb
Nice paper you found there!

Your diagrams look much better now, I cannot see any obvious problems. Thumbs up!

Do you think you can make it work with initial acceleration as well? Another thing to try is a very short displacement and large initial velocity, so that displacement overshoot, and the velocity has to change sign to get back to the requested displacement.

Please Log in or Create an account to join the conversation.

More
19 Jun 2021 18:38 - 19 Jun 2021 20:49 #212434 by Grotius
Hi,

Do you think you can make it work with initial acceleration as well?
Yes.

Current implementation:
trajectcalculator(double velmax, double accmax, double dccmax, double accbegin, double accend, double vbegin, double vend, double lenght){

[edit]
- Using start acceleration value
- Using end acceleration value
- Using max-acceleration (acc stage)
- Using max-deacceleration (dcc stage)
Attachments:
Last edit: 19 Jun 2021 20:49 by Grotius.

Please Log in or Create an account to join the conversation.

More
19 Jun 2021 20:52 - 19 Jun 2021 20:52 #212440 by arvidb

A second question then would be, is it usefull to add a AccEnd value to the program?

No, neither AccEnd nor VelEnd are useful for LinuxCNC. Both AccStart and VelStart are required though.

Another thing to try is a very short displacement and large initial velocity, so that displacement overshoot,
Something like attached picture? But there is no overshoot.

No, use a short length and a large Velocity start, so that there is no time to slow down before the displacement has passed the requested length.


There are bugs in your AccStart & AccEnd implementation. Please do more thorough testing of your code. Hint: double-check the actual displacement.
Last edit: 19 Jun 2021 20:52 by arvidb.

Please Log in or Create an account to join the conversation.

More
19 Jun 2021 21:06 - 19 Jun 2021 21:09 #212441 by Grotius
Hi,

In attached code the displacement output is more checked. I expanded this today.
I know the displacement inaccuracy (i have seen value's out of position : 1~4mm).
I have to investegate the cause of this. I think we will find the problem.
My first idea was, it could be a formula imperfection of the used paper.

github.com/grotius-cnc/S-curve-motion-pl...g/releases/tag/1.0.3
Last edit: 19 Jun 2021 21:09 by Grotius.

Please Log in or Create an account to join the conversation.

Time to create page: 0.143 seconds
Powered by Kunena Forum