MCA_SetOperatingMode (FB)

FUNCTION_BLOCK MCA_SetOperatingMode

This function block changes the axis mode from positioning to velocity mode and vice versa.

../../../../../../_images/plcopen.png

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

Enable

BOOL

Enables 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

VelocityMode

BOOL

VelocityMode = TRUE/PositioningMode = FALSE: Switch axis to velocity mode

PositioningMode

BOOL

VelocityMode = FALSE/PositioningMode = TRUE: Switch axis to positioning mode

TimeOut

UINT

Timeout in milliseconds; range: 1 to 65,535. If Timeout is set to 0, Timeout will be disabled.

Output

InVelocityMode

BOOL

Shows the axis state is in Velocity Mode

InPositioningMode

BOOL

Shows the axis state is in Positioning Mode

Active

BOOL

Indicates that the selected mode is being activated

Error

BOOL

Signals that an error has occurred within the function block

ErrorID

ERROR_ID

Error identification

Inout

Axis

Axis_Ref

Reference to axis