S-Ramp Distance Calculation

Dig C

Member
Join Date
Jul 2013
Location
Hamilton
Posts
2
Hi guys, first time post so don't be too angry.
I am basically a stupid person so I could use some help.
I have created a FB that will output a velocity with a S-Ramp based on current velocity, jerk percent, final velocity. (had lots of help) what I'm trying to do is calculate the distance it will take to reach zero velocity from any given point. Knowing current velocity (units/s) decal rate (units/s/s) jerk percent (0.2) i.e. moving 60000 unit/sec, decal rate of 20000 unit/s/s = 3 sec, 20% jerk on first part of ramp, 20% jerk on last part of ramp. What is distance in units traveled. This is where I wish I had stayed in school.
Thanks for any and all.
 
Hi guys, first time post so don't be too angry.
I am basically a stupid person so I could use some help.
I have created a FB that will output a velocity with a S-Ramp based on current velocity, jerk percent, final velocity.
percent of what jerk?
What order polynomial are you using? if you want the jerk to be 0 at the beginning and end of the ramp the order will need to be 7th order.

(had lots of help) what I'm trying to do is calculate the distance it will take to reach zero velocity from any given point.
Easy, integrate the velocity over time to get distance.

Knowing current velocity (units/s) decal rate (units/s/s) jerk percent (0.2) i.e. moving 60000 unit/sec, decal rate of 20000 unit/s/s = 3 sec,
If you are using a S curve then the decel rate should not be constant.

20% jerk on first part of ramp, 20% jerk on last part of ramp.
I would like to see what you mean. My first guess is to assume that you are applying a positive jerk of 60000 for the first 20% of the ramp up and a negative jerk for the last 20% of the ramp up. You can see that the ramp will take longer because the acceleration is not a constant 20,000 units/s^2.

What is distance in units traveled. This is where I wish I had stayed in school.
Thanks for any and all.
http://deltamotion.com/peter/Maxima/Seg1234567.html
 
Welcome to the Forum !

Don't be self-deprecating: there will be plenty of deprecation if it's warranted. :whistle:

What controller platform are you using ? You called it an 'FB' so it sounds like a Siemens S7, but it might be important to know.

I think you have to integrate the S-curve to know the distance. It's been a while since basic calculus for me, too.

The first thing to do is figure out if you'll ever reach the maximum deceleration rate during the move. That tells you whether you'll have two back-to-back S-curves, or have a segment of constant deceleration in the middle, making it a 3-segment solutoin.

If Peter Nachtwey reads this, get ready to drink from a firehose: he's really good with motion math in microprocessors and enjoys explaining it.

[Edit... told you he was good !]
 
I am using B&R,, basically a industrial computer, real time, 8 axis servo. generating a velocity set point for all axis to follow, but trying to calculate the stop distance at any given velocity point. running the calculations in a 1.6ms task time. have the jerk time figured to 20% of calculated accel or decal time
 
I am using B&R,, basically a industrial computer, real time, 8 axis servo. generating a velocity set point for all axis to follow,
It should generate a target position, velocity and acceleration.

but trying to calculate the stop distance at any given velocity point.
Most motion controllers will do this for you.

running the calculations in a 1.6ms task time.
That is an odd interval time and not very fast.

have the jerk time figured to 20% of calculated accel or decal time
OK, so my assumption is correct.
 
Don't forget to factor in the fact that the axis might still be accelerating so stop time and distance travelled needs to take in to account the remaining acceleration ramps too!

You can make an iterative loop that steps through each time slice of your ramp routine calculating the average velocity over the time period and therefore the distance travelled. Accumulate the distance travelled. One problem with this method is that it suffers from rounding errors and the limitations of floating point arithmatic. A former colleague used an alternative method using Fibonacci numbers but I never really understood it (maybe someone could elucidate).

One trick employed to overcome errors in the predicted stopping distance is to set a target stop distance when the stop request is received and then monitor your progress as the machine decelerates. If you are under/overshooting your target, modify the ramp rate to bring it back on track.

I still remeber the look of amazement on the faces of staff at a paper mill when the winder I upgraded stopped at the set length from 1000M/min.

Good luck, you have chosen a non-trivial challenge.

Nick
 
Last edited:
Don't forget to factor in the fact that the axis might still be accelerating so stop time and distance travelled needs to take in to account the remaining acceleration ramps too!
Sometimes it is best to handle this case as a separate case.

You can make an iterative loop that steps through each time slice of your ramp routine calculating the average velocity over the time period and therefore the distance travelled. Accumulate the distance travelled. One problem with this method is that it suffers from rounding errors and the limitations of floating point arithmatic.
That isn't the way to do it. I showed above the way to do it except that I know the jerk value. It is not a percentage of the ramp up times but in a way using the percent jerk makes calculations easier.

A former colleague used an alternative method using Fibonacci numbers but I never really understood it (maybe someone could elucidate).
I don't see how that would work.

One trick employed to overcome errors in the predicted stopping distance is to set a target stop distance when the stop request is received and then monitor your progress as the machine decelerates. If you are under/overshooting your target, modify the ramp rate to bring it back on track.
The method works if you don't have to synchronize 2 or more axes.

I showed above in the link how to do it. One must use a system of simultaneous equations. There will be 8 in the OP's case. He will solve for 3 positions at the end of each of the segments while ramping down, two intermediate velocities and the time for each of the motion segments while ramping down. The OP then has the position at the end of the last segment when the motion is stopped and he knows his current position so it is easy to calculate the difference between the two.

In my example in the link I solve 17 equations and 17 unknowns for a complete motion profile with ramping up, constant velocity and ramping down. My starting velocity and acceleration don't need to be 0. The resulting calculations are very precise.
 
Last edited:
Distance=112500 units
Jerk=26666.6666 units/sec^3
Time=3.75 sec
It is easy to calculate the time and distance IF the initial acceleration is 0.
First compute the average deceleration
0.2*10000+0.6*20000+0.2*10000=16000. The average deceleration during the jerk up and jerk down segments is 1/2 of the max decel which is 10000.
Divide the velocity by the average decel and get 3.75 seconds. The average speed during the ramp is 1/2 of 60000 which is 30000. The distance traveled is the average speed times the ramp time or 30000 x 3.75 = 112500.

The formula is Velocity^2/(2*DecelRate*(1-p))
where p is 0.2 or the jerk ratio.

I worked it out for the general case where the initial acceleration does't need to be 0 and the final velocity can be non-zero. The equation is very messy. It stretches across the page.
 

Similar Topics

Hello! Hope you are great. I need to make a change in a PLC with ladder logic. I will mount a analog valve and I need to control it in ramp up...
Replies
7
Views
317
Hi hoping someone can assist me with current issue I am experiencing with an ABB drive. Problem I’m experiencing is a ABB drive supply a large...
Replies
4
Views
207
Hello, I'm quite new with using FactoryTalk View Studio. I am currently using FactoryTalk View Studio 13.00 and creating a runtime file for an...
Replies
4
Views
963
Hello PLCS Nation, I am hoping you can help a newbie find calculations on how to determine Line Ramp Up & Ramp down Speed. We have a machine...
Replies
5
Views
1,188
Hi, i hope somebody here could assist with this problem? we're looking to provide another piece of equipment with steadly increasing voltage from...
Replies
13
Views
2,938
Back
Top Bottom