MC_CalcDynamicsByRampTime
The MC_CalcDynamicsByRampTime function block is used to calculate the acceleration, deceleration and jerk dynamic parameters, which are required to achieve a specified velocity in a defined time.
The function block assumes that the specified velocity can actually be achieved. If the calculated dynamic parameters are used on a short travel distance, the achieved velocity and the associated acceleration time may be smaller. The function block calculates the acceleration ramp and outputs an identical value as deceleration.
The calculated acceleration, deceleration and jerk dynamic parameters can be used with all MC_Move... function blocks, as well as MC_Halt and MC_Stop.
Inputs
VAR_INPUT
Velocity : LREAL;
RampTime : LREAL;
Stiffness : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Velocity | LREAL | Velocity to be achieved |
RampTime | LREAL | Time required to achieve the velocity. |
Stiffness | LREAL | Stiffness of the acceleration profile [0..1]. A large value means higher jerk in the profile. |
Outputs
VAR_OUTPUT
Error : BOOL;
ErrorID : UDINT;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Error | BOOL | TRUE, if an error occurs. |
ErrorID | UDINT | If the error output is set, this parameter supplies the error number. |
Acceleration | LREAL | Calculated acceleration |
Deceleration | LREAL | Calculated deceleration (Deceleration=Acceleration) |
Jerk | LREAL | Calculated jerk |
Examples
t1: internal acceleration ramp time / jerk time
t2: internal constant acceleration time
t : acceleration ramp time, t = 2 t1 + t2
cs = 0% → t1 = ½ t t2 = 0
cs = 50% → t1 = t2 = 1/3 t
cs = 99% → t1 = 0 t2 = t
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4024.42 | PC or CX (x86 or x64) | Tc2_MC2 |