MCA_GearInDirect (FB)

FUNCTION_BLOCK MCA_GearInDirect

This function block commands a gear ratio between the position of the slave and master axes from the synchronization point onwards.

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

The function block behaves as follows:

  • Synchronization starts right away, no matter if the master moves or is in standstill.

  • The synchronization is limited by the given velocity and acceleration, achieved as fast as possible, so it can happen that:

  • The 2 axes are synchronized earlier than the two given positions

  • The 2 axes are synchronized later than the two given positions

  • Following formula is used:

    • SlavePosition = (masterPosition - MasterSyncPosition) * RatioNumerator/RatioDenumerator + SlaveSyncPosition

  • In a modulo-axis, it is possible to reach the synchronization point in different directions.

The input parameter SyncDirection with its possible values: POSITIVE, NEGATIVE or SHORTEST can be used to set this direction. Inside the SyncWindow, automatically the direction SHORTEST will be used. It is important to set a SyncWindow > 0 for a modulo axis. Otherwise, slightest deviations could result in moving a complete modulo distance.

  • Inside SyncWindow, the slave axis will move SHORTEST to reach the SlaveSyncPosition

  • Outside SyncWIndow, it will move the given SyncDirection, which can be POSITIVE or NEGATIVE

  • If a direction POSITIVE or NEGATIVE is used in a linear axis, the slave will wait until the master reaches a position which allows the slave to move the required direction.

InOut:

Scope

Name

Type

Comment

Input

Execute

BOOL

Starts the function block at rising edge

RatioNumerator

DINT

Gear ratio numerator, new value is updated only with rising edge of Execute input

RatioDenominator

DINT

Gear ratio denominator, new value is updated only with rising edge of Execute input

MasterValueSource

MC_Source

Decides to use the actual position or reference position of master axis.
  • mcSetValue - Synchronization on master set value.

  • mcActualValue - Synchronization on master actual value

MasterSyncPosition

LREAL

The position of the master where the slave is insync with the master

SlaveSyncPosition

LREAL

Slave Position at which the axes are running in sync

SyncDirection

MC_Direction

Moving direction for the slave to start the movement. Applicable: POSITIVE or NEGATIVE, use SHORTEST for any other value

SyncWindow

LREAL

[u], Used to determine the moving direction, combined with SyncDirection
  • When the slave is outside the SyncWindow, it will move the direction which is given in SyncDirection

  • When the slave is inside the SyncWindow, it will move SHORTEST to meet the SlaveSyncPosition

Velocity

LREAL

[u/s], Velocity which limits the synchronization movement.

The slave has to be able to move faster than the master axis, otherwise it is possible the SlaveSyncPosition is never reached when the master starts to move. Range: >0

Acceleration

LREAL

[u/s°°2], Acceleration which limits the synchronization movement. Range: >0,If value = 0, Acceleration will be equal to parameter paraMaxVelocityAppl.If value > 0 and <= 1,Acceleration will be limited to 1.

BufferMode

MC_BufferMode

Not supported, default mcABORTING used

Output

StartSync

BOOL

Synchronization was started

InSync

BOOL

Commanded gearing completed

Busy

BOOL

The function block is not finished

Active

BOOL

Indicates that the function block has control on the axis

CommandAborted

BOOL

Command is aborted by another command from other PLCopen function block

Error

BOOL

Signals that error has occurred within function block

ErrorID

ERROR_ID

Error identification. For error details refer to Enumeration ERROR_ID

Inout

Master

Axis_Ref

Reference to master axis

Slave

Axis_Ref

Reference to slave axis