- Posts: 105
- Thank you received: 93
LinuxCNC S-Curve Accelerations
- automata
- Offline
- Premium Member
-
Less
More
3 years 9 months ago #263224
by automata
Replied by automata on topic LinuxCNC S-Curve Accelerations
Hi Grotius,
Good progress.
I have suggested something similar earlier in this thread.
forum.linuxcnc.org/38-general-linuxcnc-q...ons?start=240#216601
Every motion can be broken into 3 parts and represented by polynomials.
During execution, we can compute the current value of the polynomial by advancing the time.
For immediate feed override action, we can speed up or slow down the time increment for popping the values from the polynomial.
Polynomials can be one of 3 types: accl, decel, constant vel.
For S curve implementation, each accel or decel polynomial can be broken into 2 or 3 parts which are represented with a higher order polynomial. See the method of jerk-percentage I have alluded to earlier in these threads :
forum.linuxcnc.org/10-advanced-configura...tics?start=90#124855
forum.linuxcnc.org/38-general-linuxcnc-q...file?start=20#183298
please share your thoughts on these 2 extrapolations i.e., feed override and jerk limitation.
-automata
Good progress.
I have suggested something similar earlier in this thread.
forum.linuxcnc.org/38-general-linuxcnc-q...ons?start=240#216601
Every motion can be broken into 3 parts and represented by polynomials.
During execution, we can compute the current value of the polynomial by advancing the time.
For immediate feed override action, we can speed up or slow down the time increment for popping the values from the polynomial.
Polynomials can be one of 3 types: accl, decel, constant vel.
For S curve implementation, each accel or decel polynomial can be broken into 2 or 3 parts which are represented with a higher order polynomial. See the method of jerk-percentage I have alluded to earlier in these threads :
forum.linuxcnc.org/10-advanced-configura...tics?start=90#124855
forum.linuxcnc.org/38-general-linuxcnc-q...file?start=20#183298
please share your thoughts on these 2 extrapolations i.e., feed override and jerk limitation.
-automata
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 9 months ago #263233
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Automata,
For immediate feed override action, we can speed up or slow down the time increment for popping the values from the polynomial.
This would certainly work. But the solution for this made in the SMP is slightly different :
In general for every servo cycle step a new motion is generated on forehand. This is needed to finish exactly where we want to.
For immediate feed overide, a change in "vm" will calculate a new motion.
In simple words, the algoritme looks wich periods are needed to create the motion to respect "vo", "vm", "ve", "s, "a".
There are multiple scenario's possible. More then you can count on one hand.
If the feed overide is changed during live motion execution, you will see the motion is accelerating to the new max vm value.
This is really nice to see it happen.
github.com/grotius-cnc/motion_tryout/blob/main/smp.h line 211 is the function to determine how the motion will look
like.
It calculates the motion periods : t1,t2,t3. including types : acc,dcc,steady.
please share your thoughts on these 2 extrapolations i.e., feed override and jerk limitation.
For the s-curve you need a few things. The t1,t2,t3, the vo, vm, ve, a, s.
With above info the "jerk max" and finally the scurve can be calculated. The jerk max is one of the most
important values to define the power of the scurve.
The difficulty i see in performing the scurve in live mode is when changing the feed override, how to deal with it?
I need to write some functions for this. Functions that can calculate vm changes for scurve.
This is nasty code to write. But i can ask the ai to help a little.
For immediate feed override action, we can speed up or slow down the time increment for popping the values from the polynomial.
This would certainly work. But the solution for this made in the SMP is slightly different :
In general for every servo cycle step a new motion is generated on forehand. This is needed to finish exactly where we want to.
For immediate feed overide, a change in "vm" will calculate a new motion.
In simple words, the algoritme looks wich periods are needed to create the motion to respect "vo", "vm", "ve", "s, "a".
There are multiple scenario's possible. More then you can count on one hand.
If the feed overide is changed during live motion execution, you will see the motion is accelerating to the new max vm value.
This is really nice to see it happen.
github.com/grotius-cnc/motion_tryout/blob/main/smp.h line 211 is the function to determine how the motion will look
like.
It calculates the motion periods : t1,t2,t3. including types : acc,dcc,steady.
please share your thoughts on these 2 extrapolations i.e., feed override and jerk limitation.
For the s-curve you need a few things. The t1,t2,t3, the vo, vm, ve, a, s.
With above info the "jerk max" and finally the scurve can be calculated. The jerk max is one of the most
important values to define the power of the scurve.
The difficulty i see in performing the scurve in live mode is when changing the feed override, how to deal with it?
I need to write some functions for this. Functions that can calculate vm changes for scurve.
This is nasty code to write. But i can ask the ai to help a little.
Please Log in or Create an account to join the conversation.
- automata
- Offline
- Premium Member
-
Less
More
- Posts: 105
- Thank you received: 93
3 years 9 months ago #263248
by automata
Replied by automata on topic LinuxCNC S-Curve Accelerations
Hi Grotius,
look at this link:
github.com/parhansson/KMotionX/blob/mast...oryPlanner.cpp#L2181
Given a "segment" with "s", "vo", "vm", "ve", "a", it will calculate 3 polynomials and their execution times. If the execution time is 0, that polynomial is not executed.
-automata
look at this link:
github.com/parhansson/KMotionX/blob/mast...oryPlanner.cpp#L2181
Given a "segment" with "s", "vo", "vm", "ve", "a", it will calculate 3 polynomials and their execution times. If the execution time is 0, that polynomial is not executed.
-automata
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 9 months ago #263260
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,
That's correct, if vm=0, it will do nothing. Also if a=0 (acc) or d=0 (dcc), it will do nothing.
The code over there does not include stages like, what to do if vm can not be reached during the move?
Do we need to sample? What to do if ve can not be reached given a displacement?
The comments also confirm this :The above sequence is performed for long moves where maximum(and constant) velocity is achieved.
For the scurve creation i use formula's from papers like : github.com/grotius-cnc/scurve-pro/blob/main/science_paper_0.pdf
That's correct, if vm=0, it will do nothing. Also if a=0 (acc) or d=0 (dcc), it will do nothing.
The code over there does not include stages like, what to do if vm can not be reached during the move?
Do we need to sample? What to do if ve can not be reached given a displacement?
The comments also confirm this :The above sequence is performed for long moves where maximum(and constant) velocity is achieved.
For the scurve creation i use formula's from papers like : github.com/grotius-cnc/scurve-pro/blob/main/science_paper_0.pdf
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
3 years 9 months ago #263323
by andypugh
Replied by andypugh on topic LinuxCNC S-Curve Accelerations
LInuxCNC supports pluggable Trajectory Planners.
Is your module usable for this?
(See [TRAJ]TPMOD : linuxcnc.org/docs/devel/html/config/ini-...tml#sub:ini:sec:traj and also linuxcnc.org/docs/devel/html/man/man9/tpcomp.9.html and github.com/LinuxCNC/linuxcnc/blob/master/src/emc/tp/tpmod.c )
Is your module usable for this?
(See [TRAJ]TPMOD : linuxcnc.org/docs/devel/html/config/ini-...tml#sub:ini:sec:traj and also linuxcnc.org/docs/devel/html/man/man9/tpcomp.9.html and github.com/LinuxCNC/linuxcnc/blob/master/src/emc/tp/tpmod.c )
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 9 months ago #263387
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Andy, did you mean the smp motion planner? Or is question related to other motion planners?
Please Log in or Create an account to join the conversation.
Time to create page: 4.758 seconds