MCA_MoveRelativeOpti (FB)
FUNCTION_BLOCK MCA_MoveRelativeOpti
This function block commands a controlled motion of a specified distance relative to the actual position at the time of the execution.
This function block is designed to allow an easier setup for positioning movement. The input MoveTime holds the allowed time to move the given distance. The other inputs: Velocity, Acceleration, Deceleration and Jerk can be left “0”, then the movement will use the system limits and perform as “soft” as possible positioning.
It will always use a Jerk (when possible).
To switch off the usage of Jerk, use Jerk = -1 as input parameter.
Use the smallest possible acceleration/deceleration.
Use the smallest possible velocity.
If it is not required to create a movement with limited Jerk, the input Jerk = -1 should be used. The acceleration and deceleration will be applied with a step but a smaller maximum value is required.
If parameters like Velocity, Acceleration and Deceleration are set, these will be considered to be the upper limits during the movement. If it is not possible to execute the movement in the given time, an error(3 - PARAMETER_EXCEEDS_LIMIT) will be shown. The function block also gives a suggestion which values could be used to execute the movement within the time limitations.
Note
If parameters are given which are not possible to use, e.g. velocity is too small to reach the target in the given time, the function block´s internal variables usedJerk, usedVelocity, usedAcceleration and usedDeceleration will show a possible solution.
If the velocity was too small, the internal variable usedVelocity will hold the smallest possible value to execute the movement in the given time. This would mean execute it without any ramps. Internal variables usedAcceleration and usedDeceleration will be “0” in this case.
If the velocity was ok, but acceleration and deceleration are too small, usedVelocity will show the value from input Velocity and variables usedAcceleration and usedDeceleration will hold the necessary values to execute the movement in the given time.
Note
With “MoveTime = 0”, the behavior for the function block is identical with MC_MoveRelative. It is possible to use just Distance and MoveTime as input parameters. In this case, the function block will take the axis configuration parameters as limitations for the movement and always create the smoothest possible interpolation.
- InOut:
Scope
Name
Type
Comment
Input
ExecuteBOOLStarts the function block at rising edge
DistanceLREAL[u] = Technical unit, Relative distance for the motion. Range: Maximum range is 16#7FFFFFFF in increments, if configured in units, range will be limited to equivalent of 16#7FFFFFFF increments
VelocityLREAL[u/s] Value of the maximum velocity (not necessarily reached). Range: >0
AccelerationLREAL[u/s°°2] Value of the acceleration (increasing energy of the motor). Range: >0. If value = 0, Acceleration will be equal to parameter paraMaxAccelerationAppl.If value > 0 and <= 1,Acceleration will be limited to 1.
DecelerationLREAL[u/s°°2] Value of the deceleration (decreasing energy of the motor). Range: >0. If value = 0, Deceleration will be equal to parameter paraMaxDecelerationAppl.If value > 0 and <= 1,Deceleration will be limited to 1.
JerkLREAL[u/s°°3] Value of the jerk. Range: >=0. To switch off the usage of Jerk, use Jerk = -1
MoveTimeLREAL[s] Allowed time to complete the movement. Range: >=0
BufferModeNot supported, default mcABORTING used
Output
DoneBOOLShows the status of the function block. Done = TRUE if the execution is finished
BusyBOOLThe function block is not finished
ActiveBOOLIndicates that the function block has control on the axis
CommandAbortedBOOLCommand is aborted by another command from other PLCopen function block
ErrorBOOLSignals that error has occurred within function block
ErrorIDError identification. For error details refer to Enumeration ERROR_ID
Inout
AxisReference to axis