MCA_SetOperatingMode (FB)
FUNCTION_BLOCK MCA_SetOperatingMode
This function block changes the axis mode from positioning to velocity mode and vice versa.
By default, an axis is always a positioning axis which has to follow either the drives or the PLCs position control loop. In some applications, the movement is limited (e.g. by torque restrictions) so the position can´t be reached. A position controlled axis would first speed up and then create a following error, both caused by the increasing position lag. The function block MCA_SetOperatingMode can be used to prevent this behavior and will switch between velocity and position controlled behavior “on the fly”.
- In velocity mode
The Speed_Reference is created by feed-forward, in an open loop. (It is not required to set FF_Percentage parameter)
Reference_Position will follow the Drive_Actual_Position
Position following error is not supervised.
It will be immediately effective in axis state: STANDSTILL or ERRORSTOP
In any other mode, it will be effective with the next “Execute” rising edge on a function block which activates a movement. It can be called while the axis is moving and will create a bumpless transition between the velocity- and position controlled mode
If the mode is not set within the transition time, a timeout error will occur.
Note
To use the function block MCA_SetOperatingMode, the drive has to be used in CSV (ContinuousSyncronuousVelocity), or an analog drive has to be used, which means it has to move controlled by Speed_Reference (Kernel).
- Precondition
The axis has to be used with position loop controlled by the PLC, otherwise a velocity mode is not possible
No mode change will occur if both inputs are FALSE; axis actual status will be updated to the outputs.
No mode change will occur if both inputs are TRUE; axis actual status will be updated to the outputs.
- InOut:
Scope
Name
Type
Comment
Input
EnableBOOLEnables the function block to switch the operating mode. A rising edge is not required, the block will be activated if Enable = TRUE and will react to the VeloctiyMode/PositioningMode inputs
VelocityModeBOOLVelocityMode = TRUE/PositioningMode = FALSE: Switch axis to velocity mode
PositioningModeBOOLVelocityMode = FALSE/PositioningMode = TRUE: Switch axis to positioning mode
TimeOutUINTTimeout in milliseconds; range: 1 to 65,535. If Timeout is set to 0, Timeout will be disabled.
Output
InVelocityModeBOOLShows the axis state is in Velocity Mode
InPositioningModeBOOLShows the axis state is in Positioning Mode
ActiveBOOLIndicates that the selected mode is being activated
ErrorBOOLSignals that an error has occurred within the function block
ErrorIDError identification
Inout
AxisReference to axis