SMC_MoveContinuousRelative (FB)¶
FUNCTION_BLOCK SMC_MoveContinuousRelative
This function block executes a relative movement with a given end-velocity.
In contrast to MC_MoveRelative, it will not reach the target position with
zero velocity, but with the specified EndVelocity.
It is designed for generating via movements. Once the target position has
been reached, the function block sets the InEndVelocity output and
keeps this velocity until interrupted by another movement.
Note
Take care when using MC_SetOverride while this function block is
active.
If AdaptEndVelToAvoidOvershoot is set to FALSE, reducing the
acceleration or jerk override or changing the velocity override
can lead to a position overshoot or reversal. This happens if
the (potentially overridden) EndVelocity cannot be reached from
the current state using the overridden Acceleration,
Deceleration, and Jerk limits.
- InOut:
Scope
Name
Type
Initial
Comment
Inout
AxisReference to axis
Input
ExecuteBOOLRising edge: Starts the execution of the function block.
DistanceLREALRelative (signed) distance to travel (in technical units [u])
VelocityLREALValue of maximum velocity (not necessarily reached) [u/s]
EndVelocityLREALUnsigned (!) value of end velocity in [u/s]. This end velocity may also be higher than Velocity.
EndVelocityDirectioncurrent
Determines the direction of end velocity. Permissible values: positive, negative, current. current will use the direction of the
Axiswhen a rising edge for theExecuteinput is detected (velocity < 0 = negative, velocity >= 0 = positive). Not applicable: shortest, fastest.AccelerationLREALValue of acceleration (increasing energy of the motor) [u/s²]
DecelerationLREALValue of deceleration (decreasing energy of the motor) [u/s²]
JerkLREALValue of the Jerk [u/s³]
AdaptEndVelToAvoidOvershootBOOLIn some cases, a given
EndVelocitymay lead to a position overshoot. For example, if the remaining distance is too short to reach the end velocity from the current velocity and acceleration, then the axis may turn in opposite direction, leading to an overshoot. Another case is an end velocity that has opposite direction to the distance to be travelled. To arrive at the target position with this velocity, the axis will first exceed the distance, reverse and accelerate to the end velocity, again causing an overshoot.If the input
AdaptEndVelToAvoidOvershootis TRUE, then the effective end velocity will be adapted in order to avoid an overshoot.These are the two situatons where an overshoot will be avoided:
First, if the remaining distance is too short to reach the desired EndVelocity. In this case, the effective end velocity is reduced (if the current velocity is lower) or increased (if the current velocity is higher) to the closest velocity that can be reached in the given distance.
Second, if the direction of the end velocity is opposite to the direction of the movement. In this case, the effective end velocity will be set to zero. Note that the direction of the movement is not determined by the current velocity and acceleration, but by the sign of the distacne to the target position.
Note that the output
InEndVelocityis set only after the programmed end velocity has been reached. Once the given distance has been travelled the outputDistanceTravelledis set and the axis is accelerated or decelerated to the given (programmed) EndVelocity.Output
InEndVelocityBOOLTRUE: Commanded distance has been travelled and the programmedEndVelocityhas been reached. IfAdaptEndVelToAvoidOvershootis FALSE, this output rises to TRUE in the same cycle asDistanceTravelled. Otherwise, it may rise to TRUE later.DistanceTravelledBOOLTRUE: Commanded distance has been travelled. Axis runs with commanded velocity``EndVelocity`` (or possibly slower ifAdaptEndVelToAvoidOvershoothas been set).BusyBOOLTRUE: Execution of function block has not been finished yet.CommandAbortedBOOLTRUE: Command has been aborted by another command.ErrorBOOLTRUE: Error has occurred within the function block.ErrorIDSMC_ERRORError identification