- Posts: 459
- Thank you received: 158
LinuxCNC S-Curve Accelerations
- arvidb
- Offline
- Platinum Member
-
Less
More
5 years 4 months ago - 5 years 4 months ago #212034
by arvidb
Also plots 2, 3, and 4 all have discontinuities in the slope of the position plots ("kinks"), which means there is a step change in velocity, corresponding to infinite acceleration at those points. The position plot should be completely smooth even with acceleration-limited motion.
I have run into similar issues while developing my code, and in my testing I now double-check for such issues by differentiating the position output in several stages to get approximate velocity, acceleration and jerk values derived directly from the successive position outputs. I then check that these derived values doesn't deviate too much from the calculated ones at each time step. This automated test has been very useful to find bugs, and I can really recommend it!
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
I can't see any problem with the velocity plots at your github, however the position plots are not consistent with the velocity plots. All your position plots start and end horizontally (slope = 0), which they shouldn't if there is initial (or end) velocity, since velocity is equivalent to slope of the position curve.Grotius wrote: The plotted graph's at github show everything is printed ok when using vo and ve parameters.
Also plots 2, 3, and 4 all have discontinuities in the slope of the position plots ("kinks"), which means there is a step change in velocity, corresponding to infinite acceleration at those points. The position plot should be completely smooth even with acceleration-limited motion.
I have run into similar issues while developing my code, and in my testing I now double-check for such issues by differentiating the position output in several stages to get approximate velocity, acceleration and jerk values derived directly from the successive position outputs. I then check that these derived values doesn't deviate too much from the calculated ones at each time step. This automated test has been very useful to find bugs, and I can really recommend it!
Last edit: 5 years 4 months ago by arvidb.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
5 years 4 months ago #212039
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Arvidb,
Also plots 2, 3, and 4 all have discontinuities in the slope of the position plots ("kinks"),
This are no position plots ! ( Grey lines ).
It are scurve rendement curves.
A horizontal grey curve is no progress or travel, no rendement in travel.
With a max slope (steep curve) the rendement of the scurve implementation is at is best.
A kink in the plot show's a transition to a different scurve rendement. This is nothing special or to worry about.
The grey line is scaled at y axis : scale=0.15 to fit the plot.
curveup (// Be aware graphicsview is inverted on y-axis.)
concave period : ellipse = scene->addEllipse(T, scale*(Sa*-1), 0.1, 0.1, GreyPen);
convex period : ellipse = scene->addEllipse(T, scale*((Sa+Sb)*-1), 0.1, 0.1, GreyPen);
curvesteady
ellipse = scene->addEllipse(T, scale*(S*-1), 0.1, 0.1, GreyPen);
curvedown
convec period : ellipse = scene->addEllipse(T, scale*(Sb*-1), 0.1, 0.1, GreyPen);
concave period: ellipse = scene->addEllipse(T, scale*((Sb+Sa)*-1), 0.1, 0.1, GreyPen);
Also plots 2, 3, and 4 all have discontinuities in the slope of the position plots ("kinks"),
This are no position plots ! ( Grey lines ).
It are scurve rendement curves.
A horizontal grey curve is no progress or travel, no rendement in travel.
With a max slope (steep curve) the rendement of the scurve implementation is at is best.
A kink in the plot show's a transition to a different scurve rendement. This is nothing special or to worry about.
The grey line is scaled at y axis : scale=0.15 to fit the plot.
curveup (// Be aware graphicsview is inverted on y-axis.)
concave period : ellipse = scene->addEllipse(T, scale*(Sa*-1), 0.1, 0.1, GreyPen);
convex period : ellipse = scene->addEllipse(T, scale*((Sa+Sb)*-1), 0.1, 0.1, GreyPen);
curvesteady
ellipse = scene->addEllipse(T, scale*(S*-1), 0.1, 0.1, GreyPen);
curvedown
convec period : ellipse = scene->addEllipse(T, scale*(Sb*-1), 0.1, 0.1, GreyPen);
concave period: ellipse = scene->addEllipse(T, scale*((Sb+Sa)*-1), 0.1, 0.1, GreyPen);
Please Log in or Create an account to join the conversation.
- arvidb
- Offline
- Platinum Member
-
Less
More
- Posts: 459
- Thank you received: 158
5 years 4 months ago #212041
by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
Rendement? I don't know what that means. (Is it french? "Yield" or "Output"? I still don't know what that means in this context.)
You write on your github page: "Grey = Travelled in time". And you write in an earlier post in this thread that "Grey is S (distance) versus T (time)." I would call this (relative) position?
If you have a "kink" in "distance travelled versus time", that means you have a discontinuity in velocity and thus infinite acceleration at that point. And "distance travelled versus time" should always have a slope equal (or proportional, with scaling) to the velocity, or something is wrong with the calculation of either velocity or (relative) position.
If I'm misunderstanding what the grey curve is, can you add a plot of (relative & scaled) position to your graphs? That is the most important output from a motion planner after all.
You write on your github page: "Grey = Travelled in time". And you write in an earlier post in this thread that "Grey is S (distance) versus T (time)." I would call this (relative) position?
If you have a "kink" in "distance travelled versus time", that means you have a discontinuity in velocity and thus infinite acceleration at that point. And "distance travelled versus time" should always have a slope equal (or proportional, with scaling) to the velocity, or something is wrong with the calculation of either velocity or (relative) position.
If I'm misunderstanding what the grey curve is, can you add a plot of (relative & scaled) position to your graphs? That is the most important output from a motion planner after all.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
5 years 4 months ago - 5 years 4 months ago #212052
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Arvidb,
Rendement is like "the effectiveness".
I made a short video about the scurve graph.
user-images.githubusercontent.com/448801...7d6-c7dcf68d7db7.mp4
The grey line is now showing time versus displacement for point in x direction, to simplify it.
Point x is from x0 to ~x100mm in the video.
(ellipse = scene->addEllipse(T, p.x*-1*scale, 0.1, 0.1, GreyPen);
scale=0.15;
This is how it should look like :
In a normal situation we see a displacement as in above graph.
When doing exotic's we can end up with so called "kink" in the displacement curve.
Arvidb, In your point of view this "kink" is a bad thing? I don't have something like it's a bad thing.
Rendement is like "the effectiveness".
I made a short video about the scurve graph.
user-images.githubusercontent.com/448801...7d6-c7dcf68d7db7.mp4
The grey line is now showing time versus displacement for point in x direction, to simplify it.
Point x is from x0 to ~x100mm in the video.
(ellipse = scene->addEllipse(T, p.x*-1*scale, 0.1, 0.1, GreyPen);
scale=0.15;
This is how it should look like :
In a normal situation we see a displacement as in above graph.
When doing exotic's we can end up with so called "kink" in the displacement curve.
Arvidb, In your point of view this "kink" is a bad thing? I don't have something like it's a bad thing.
Last edit: 5 years 4 months ago by Grotius.
Please Log in or Create an account to join the conversation.
- arvidb
- Offline
- Platinum Member
-
Less
More
- Posts: 459
- Thank you received: 158
5 years 4 months ago - 5 years 4 months ago #212059
by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations
Yes, Grotius, in my view the kink is a bad thing. To the left of the kink you are moving at one velocity, to the right of the kink you are moving at another velocity == step change in velocity == infinite acceleration == possible damage to CNC machine (and a very surprised operator) == bad thing. 
Velocity is change in displacement over time, right? That is, v = Δs/Δt = the derivate of displacement.
You can approximate the true velocity of something moving along your grey displacement curve by differentiation:
Add a plot of true_vel to your graphs and you'll see what I mean.
Velocity is change in displacement over time, right? That is, v = Δs/Δt = the derivate of displacement.
You can approximate the true velocity of something moving along your grey displacement curve by differentiation:
Code:
true_vel = (S - S_prev)/timeresolution;
S_prev = S;
Add a plot of true_vel to your graphs and you'll see what I mean.
Last edit: 5 years 4 months ago by arvidb.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
5 years 4 months ago - 5 years 4 months ago #212061
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
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?
It's quite hard to imagine when the velocity curve looks ok and the acceleration curve looks ok.
There could be a kink in the displacement curve in some "exotic" cases.
[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:
Is it a idea to avoid this "kink" with a algoritme?
Are you able to implement your example in the qt code?
Do you have an idea how the lecture dealing with this "kink" in the curve, you would expect researchers have dealed with this
before?
It's quite hard to imagine when the velocity curve looks ok and the acceleration curve looks ok.
There could be a kink in the displacement curve in some "exotic" cases.
[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:
Is it a idea to avoid this "kink" with a algoritme?
Are you able to implement your example in the qt code?
Last edit: 5 years 4 months ago by Grotius.
Please Log in or Create an account to join the conversation.
Time to create page: 4.686 seconds