LinuxCNC S-Curve Accelerations
15 Jun 2021 11:14 #212112
by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
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!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?
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!It's quite hard to imagine when the velocity curve looks ok and the acceleration curve looks ok.
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.There could be a kink in the displacement curve in some "exotic" cases.
Indeed. I'm glad you see the problem now.[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.
Well, that's the whole idea, right? To create a jerk-limited planner?Is it a idea to avoid this "kink" with a algoritme?
What example are you talking about? But no, I have my hands full with trying to get my own code working.Are you able to implement your example in the qt code?
Please Log in or Create an account to join the conversation.
15 Jun 2021 12:11 - 15 Jun 2021 12:12 #212116
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
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 !
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.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
17 Jun 2021 18:56 #212287
by TheRoslyak
Replied by TheRoslyak on topic LinuxCNC S-Curve Accelerations
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)
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)
Please Log in or Create an account to join the conversation.
17 Jun 2021 23:49 #212304
by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
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.
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.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
18 Jun 2021 08:04 #212316
by TheRoslyak
Replied by TheRoslyak on topic LinuxCNC S-Curve Accelerations
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.
18 Jun 2021 20:22 - 18 Jun 2021 21:00 #212355
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
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
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
Last edit: 18 Jun 2021 21:00 by Grotius.
Please Log in or Create an account to join the conversation.
19 Jun 2021 12:28 #212396
by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
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.
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.
19 Jun 2021 18:38 - 19 Jun 2021 20:49 #212434
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
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)
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.
19 Jun 2021 20:52 - 19 Jun 2021 20:52 #212440
by arvidb
There are bugs in your AccStart & AccEnd implementation. Please do more thorough testing of your code. Hint: double-check the actual displacement.
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
No, neither AccEnd nor VelEnd are useful for LinuxCNC. Both AccStart and VelStart are required though.A second question then would be, is it usefull to add a AccEnd value to the program?
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.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.
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.
19 Jun 2021 21:06 - 19 Jun 2021 21:09 #212441
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
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
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