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.
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
ExecuteBOOLStarts the function block at rising edge
RatioNumeratorDINTGear ratio numerator, new value is updated only with rising edge of Execute input
RatioDenominatorDINTGear ratio denominator, new value is updated only with rising edge of Execute input
MasterValueSource- Decides to use the actual position or reference position of master axis.
mcSetValue - Synchronization on master set value.
mcActualValue - Synchronization on master actual value
MasterSyncPositionLREALThe position of the master where the slave is insync with the master
SlaveSyncPositionLREALSlave Position at which the axes are running in sync
SyncDirectionMoving direction for the slave to start the movement. Applicable: POSITIVE or NEGATIVE, use SHORTEST for any other value
SyncWindowLREAL- [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
VelocityLREAL- [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
AccelerationLREAL[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.
BufferModeNot supported, default mcABORTING used
Output
StartSyncBOOLSynchronization was started
InSyncBOOLCommanded gearing completed
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
MasterReference to master axis
SlaveReference to slave axis