Calculate motion profile duration

jklein

Member
Join Date
Aug 2016
Location
New York
Posts
8
Hi,
I have a application where I need to calculate the time to complate a servo position move, the values I have is: acceleration which is consistent, and position which is dynamic, and velocity which is also set by the user,

I am trying to get the time value before I start the move command,

Any help is appreciated.
 
Assuming that the motion always starts and ends at zero speed AND there is at least some amount of time at constant speed the total move time is:
Ttot = 2*Tacc+Tcs

Tacc, or time during an acceleration event is simply Target Velocity / Accel Rate

Tcs, or time of constant speed, is Constant Speed Distance / Target Velocity

Constant Speed Distance is Total Distance – 2*Accel Dsitance
Accel Distance is Target Velocity^2 / (2 * Accel Rate)
That simplifies down to:

Ttot = Target Velocity/Accel Rate + Total Distance/Target Velocity

This all falls apart if Target Velocity^2/Accel Rate < Total Distance but we will cross that bridge when we get there.

Keith
 
Thank you Keith.

So, if i have it right, a target velocity of 200mm/s and Acc of 500mm/s2, and a distance of 200mm, will take 1.4 sec to complete?

Now how about the same of above with a distance of 50mm?
 
You are correct with the 200mm move.

With a 50mm move the move velocity will not reach the target velocity. You will need to calculate the velocity the move will reach and then figure out the time from there.

The move will result in a triangular velocity profile with half the move distance in accel and half in decel.

The basis is 1/2D = V^2/(2*a)
where D is the total move distance, V is the peak velocity reached and a is the accel rate. Solving this for V you get:
V = sqrt(D*a)

Move time will be:
Ttot = 2*V/a
or 2*sqrt(D*a)/a

So a 50mm move should take 0.63 seconds.

Again, this is only valid if Target Velocity^2/Accel Rate < Total Move Distance.

I think this is probably the point where I should interject that triggering a position action based on a time might not be the way you want to go. But only you know your process.

Keith
 
Well, maybe there is a better way, thet was the first solution that came to me.

I have a machine that will seal and cut envelopes to a given size, the customer wants to have the ability to enter the speed in envelopes per minute, but when he adjusts the seal delay or length of envelope the plc should automatically adjust down speed to the max possible.

Its an S profile, but i don't think my calculation needs that accuracy.
 
Originally posted by jklein:

Its an S profile, but i don't think my calculation needs that accuracy.

Peter is right. You may not want to be quite so dismissive of the jerk. It kind of depends on what the jerk rate is relative to the accel rate. You indicated your accel rate is 200mm/sec^2. I'm pulling this out of my vent but I would say if your jerk rate is 1000 mm/sec^3 or higher you probably don't need to worry about it so much for what you are doing. If it is 100 mm/sec^3 you will have much more to worry about.

I understand what you are trying to do and you are approaching it from the right direction I think.

Keith
 
Who let the worms out?

Acceleration is 500mm/s2,
jerk is 1500mm/s3 i think.
That adds significant time to a move.
Now there are significant variations.

Keith has pointed out that the 200mm/s velocity will not be achieved on short moves. So there are two formulas, one for reaching the desired velocity and one for when the desired velocity is not reached.

The 500mm/s^2 acceleration and deceleration may not be achieved on short moves. Now there are four cases. Actually more if the deceleration is different from the acceleration.

I think I will give someone else a chance to be a hero for now and make some pop corn.

jklein, what you are asking for is not easy. Even those that may be able to solve the problem will say it is too much work.
 
Been some time,

Keith's math worked great, thanks everyone.

Accel/decel ended up at 9500 mm/s2
Jerk at 28600 mm/s3
The loop has around 1 mm error which is fine.

the calculations are not perfect due to the above reasons but acceptable.

And here the code:

//copy set values
TargetVelocity := ServoSpeedMM;
AccRate := AccSet;
TotalDistace := EnvalopeLangthMM;

//Calculate servo move time
TimeTotal := (TargetVelocity/AccRate) + (TotalDistace/TargetVelocity) ;

IF TargetVelocity*Targetvelocity/AccRate > TotalDistace THEN
TimeTotal := (2*SQRT(TotalDistace*AccRate)/AccRate);
END_IF

//combine additional static timers and some estimate for jerk in the total move time
TimeTotal := TimeTotal + 0.25 + (WORD_TO_LREAL(KeyPad_Time)/1000.00);
EnvalopesPerMinute := 60/TimeTotal;
 
I have no experience with motion control, but I wanted to ask these questions in regards to the accel/decel and jerk.
in regards to the system itself, have you considered the following.
1. size of the system components.
2. stress on the slide, bearings, torque at the joints
3. metal fatigue?
as I said, I have no experience with motion, but at the speeds you indicated, I just have to ask these questions.
james
 
No, I would have to call someone in for that and the customer chose not to spend the money.

I agree this is basically a square wave, but the machine this is built on is imported, was paid for itself 10 or more times at time of system upgrade, the customer wanted to speed the thing up as much as physically possible and when it breaks it will go to the scrap yard.
this new motion system is working almost 2 years now, mostly 24 Hrs, and while they keep replacing air actuators and heating elements, the motion components are holding up well.
 
Last edited:

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
741
Good morning, I have a question. I don't know much about ST yet I would like to calculate the average number of products per hour. how do I do...
Replies
22
Views
2,871
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,020
I want to calculate the energy consumed from instantaneous power. Can this be done using the TOT block with timebase set to Hour?
Replies
2
Views
655
Hi everyone, I have to calculate the length in millimeters of a glass that enters a transport (I don't know the speed yet) through a barrier...
Replies
15
Views
3,436
Back
Top Bottom