Calculation of stop distance

Plc_User

Member
Join Date
Dec 2005
Location
Belgium
Posts
317
In a motion application I want to stop my motion at a certain point. For that point I want to know the distance it wil take to stop. The motion is at a fixed known speed and wil deccelerate with a knwon constant decceleration, but the tricky thing is that the decceleration has a jerk starting the decceleration and a jerk ending the decceleration. Except this jerk at the begin and end of decceleration the decceleration is constant. The jerk is also known.
If there would be no jerk it is easy :
s = a * t²
a = v / t
s = v² / 2*a
When testing my motion it is correct when I deccelerate without jerk and use the formula above.
However with jerk, the and the same formula the deviation is too large.
So my question is : does someone know and easy formala that gives a good estimation (exact result is not necessary) of the extra distance of the stop movement when jerk is added to a constant decceleration.
Known parameters are the start speed, the value of the constant decceleration and the value of the jerk.
 
I should need this stopping time because at the moment I am stopping my axis with the jerked deccelertion, material is advancing at constant speed towards my axis, and I want to know the distance between material and axis when the axis is stopped.
 
The stop time is:

t = V/a + a/j

But Peter brings up a good point. The equations listed will only work if the velocity is high enough that you at least touch the constant acceleration phase. Expressed mathematically that is V > a2/j. If V < a2/j then a different equation is needed.

Keith
 
Originally posted by Plc_User:

I should need this stopping time because at the moment I am stopping my axis with the jerked deccelertion, material is advancing at constant speed towards my axis, and I want to know the distance between material and axis when the axis is stopped.

The first equation will give you distance ASSUMING V > a2/j.

Just make sure all your units and time bases make sense when you run the calculation.

Keith
 
Just getting a chance to jump in here I started from the beginning. Not positive my take on the problem is correct but here's my thoughts.

I took the problem statement to say that for this move, there is constant jerk motion which gave me;

j(t) = J

Integrating w.r.t. time gave me:

a(t) = J*t + A0 (Where A0 is the constant from integration and is initial acceleration)

Integrating again w.r.t. time gave me:

v(t) = (J/2)*t^2 + A0*t + V0 (Where V0 is the constant from this integration and is the initial velocity).

When I'm stopped, the velocity has to be zero so I have to solve this quadratic for its roots.

a little simplifying gave:

t= { (-A0) +/- SQRT[ A0^2 - (2*J*V0)] } / J

The case where we get imaginary numbers, I think, means we aren't going to get to zero speed with the chosen initial conditions and Jerk value so they get thrown out.

I'm not sure what the "two" solutions Peter is referring to are but I do notice starting with initial acceleration the same sign as initial velocity it takes longer to stop than if the signs are opposite. You really don't need to change the initial conditions and re-run the equations to see this. When you get non-imaginary + and - answers, one time (the magnitude of the longer time) is for when initial acc and vel are the same sign and the other time (the magnitude of the shorter time) is for when initial acc and vel are opposite signs. With a very large initial acceleration and small Jerk, you can get two positive times but this means you got to 0 speed at the shorter time and then reversed direction for a while and then slowed down to zero speed again at the longer time.

Integrate the above one more time to get the position function which is:

s(t)= (J/6)*t^3 + (A0/2)*t^2 + V0*t + S0

Once you figure the time, plug it in here to get the position where motion will be stopped. As usual, watch your signs and units.

touch the constant acceleration phase
I'm confused, if there is constant Jerk, can there also be constant acceleration? Then again, maybe I'm missing something here.
 
Originally posted by ndzied1:

I'm confused, if there is constant Jerk, can there also be constant acceleration? Then again, maybe I'm missing something here.

There are two ways to approach the move. You can say that the whole move will be in jerk, in which case you back-calculate the value of jerk required to reach the velocity you want in the time allowed. Or you can define a constant jerk and apply an acceleration limit. So the acceleration rate will change linearly until the acceleration rate reaches the acceleration limit, after which it remains constant until the acceleration rate needs to move toward zero to stop accelerating. Most ramps I am involved with are the latter. This results in a trapaziodal acceleration profile.


Originally posted by ndzied1:

I'm not sure what the "two" solutions Peter is referring to are but...

If you use the second move type, where the have a constant acceleration phase, you will still have cases where the velocity change isn't great enough to reach the acceleration limit. In that case the equation set to determine the position is different than the case where you reach constant acceleration.

Keith
 
I just re-read the old posts. I see it all now, I fell back to the baby steps...

Maybe Peter will grace us with a Friday Night problem (that I won't get to look at until Saturday...)

I love this stuff but don't get the time for messing with it much any more.
 
Maybe Peter will grace us with a Friday Night problem (that I won't get to look at until Saturday...)


Quaranteed if he does it will involve math lol
 
I solve these problems using wxMaxima or Mathcad

This is not a good Friday night problem because maybe only two or three people would be able to solve these kinds of problems. Obviously I must have these all done because I write motion control programs. Here is my simplified solution using wxMaxima. I first wrote 11 equations, eq0 - eq10 to describe the motion for the three motion segments. I am assuming this is deceleration limited. I then can solve for 10 parameters all at once. My general solution has 7 segments to it because I assume the motion is starting from v0=0 and moves to a stop at v7=0
x4 is the position where the ramp starts
v4 is the velocity when starting to ramp down
a4 is assumed to be 0 in this case. The equations get MUCH messier if not.
x45 is the distance traveled while the jerk is negative
x56 is the distance traveled while the jerk is 0 and deceleration is constant
x67 is the distance traveled while the jerk is positive.
x47 is the ramp distance
t47 is the ramp time.
Code:
/* [wxMaxima: comment start ]
SEG567 Dist
Calculate the positions, velocities times ramping up assuming the ramp is acceleration limited
x4, v4 and a4=0 are the initial conditions
d is the requested deceleration
v7 is the requested velocity
   [wxMaxima: comment end   ] */
/* [wxMaxima: input   start ] */
remvalue(all)$
eq0: v4*t45+(a4/2)*t45^2-(j/6)*t45^3=x45$
eq1: v4+a4*t45-(j/2)*t45^2=v5$
eq2: a4-j*t45=a5$

eq3: v5*t56+(a5/2)*t56^2=x56$
eq4: v5+a5*t56=v6$
eq5: t56=(v6-v5)/a6$

eq6: v6*t67+(a6/2)*t67^2+(j/6)*t67^3=x67$
eq7: v6+a6*t67+(j/2)*t67^2=v7$
eq8: a6+j*t67=0$

eq9: t47=t45+t56+t67$
eq10: x47=x45+x56+x67$
/* [wxMaxima: input   end   ] */
/* [wxMaxima: comment start ]
v7=0 a4=0
   [wxMaxima: comment end   ] */
/* [wxMaxima: input   start ] */
[eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10]$
subst([v4=v,a4=0,a5=-d,a6=-d,v7=0],%)$
solve(%,[t45,x45,v5,t56,x56,v6,t67,x67,t47,x47])$
grind(%[1]);
/* [wxMaxima: input   end   ] */
The solution is:
t45 = d/j,
x45 = (6*d*j*v-d^3)/(6*j^2),
v5 = (2*j*v-d^2)/(2*j),
t56 = (j*v-d^2)/(d*j),
x56 = (j*v^2-d^2*v)/(2*d*j),
v6 = d^2/(2*j),t67 = d/j,
x67 = d^3/(6*j^2),
t47 = (j*v+d^2)/(d*j),
x47 = (j*v^2+d^2*v)/(2*d*j)

If I do the calculations for the whole move from ramp up to ramp down there are 7 segments and about 19 equations are solved simultaneously.
These equations are good for a 3rd order motion profile generator which is what most motion controllers use. There are 8 basic states
State 0 v=0 a=0 j=0
State 1 v>0 a>0 j>0
State 2 v>0 a>0 J=0 constant acceleration
State 3 v>0 a>0 J<0
State 4 v>0 a=0 j=0 constant velocity
State 5 v>0 a<0 j<0
State 6 v>0 a<0 j=0 constant deceleration
State 7 v>0 a<0 j>0
State 0 v=0 a=0 j=0

I use the state machine techniques discussed in recent threads to move between the states.

This is an easy case. There are much more difficult cases like what happens when the initial acceleration is not 0 or when moving small distances and going slow speed where neither the command speed, acceleration or deceleration will be reached before have to ramp down to a stop.

Each of these problems usually must be solved in two ways. When must the deceleration occur or will the ramp distance be shorter than the distance to the stop point and then a recalculation must be done using the distance to the stop point where the jerk or decel rate is adjusted so the target stops exactly where it should.

This is why I find it amusing when people say they want to write motion code in a PLC.

I will let some one else struggle with the ramp to a stop when the constant deceleration segment is not reached.
 
Originally posted by Plc_User:

Can you explain this a little more?

This is an extension of V=a2j but you know V and you specify time. By solving the time equation I posted for the V < a2j case for j you will define the jerk rate that will result in a full jerk move from the given velocity to zero given the time allowwed.

I personally don't like this method since the acceleration rate isn't bounded. The user needs to make sure in aseparate step that the maximum permissable acceleration rate isn't exceeded.

Keith
 

Similar Topics

Hello everybody, I believe that I will find experts here who have already solved a similar topic. I need to calculate the length of the...
Replies
7
Views
349
Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
119
Hi!! I'm looking for Temperature rise calculation software from Rockwell, I just download "Product selection toolbox 2022" but this software is...
Replies
1
Views
226
I have a bunch of tags in Historian/VantagePoint that off by one decimal point. I looked into the HMI displaying the same number, and the HMI is...
Replies
2
Views
120
I might be overthinking my problem, but I need some help. I am trying to write a formula in my plc to calculate the footage of paper being...
Replies
6
Views
631
Back
Top Bottom