FUNCTION_BLOCK MC_GearInPos
MC_GearInPos couples the slave axis to the master axis taking into account a specific positional relationship.
Important
In certain cases, it may be impossible to avoid a reversal of the slave. (Even if the slave velocity is not opposite to the master.) One example is a slave with a small positive velocity and a large negative acceleration. It may not be possible to ramp down the acceleration fast enough to prevent the velocity from becoming negative.
Timing diagram
Any previous motion is continued until the master crosses the position MasterSyncPosition – MasterStartDistance in the correct direction. At that point in time the output StartSync is set. When a stop command is executed on the slave axis before the synchronization has happened, it will inhibit the synchronization and the function block issues CommandAborted is TRUE.
If the MasterStartDistance is not specified, the system itself calculates the setting point for StartSync based on the other relevant inputs.
Timing Diagram of MC_GearInPos
Different examples of gearing
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Inout |
Master |
Reference to master axis |
||
Slave |
Reference to slave axis |
|||
Input |
Execute |
BOOL |
Rising edge: Starts the execution of the function block. |
|
RatioNumerator |
DINT |
1 |
Gear ratio numerator |
|
RatioDenominator |
DINT |
1 |
Gear ratio denominator |
|
MasterSyncPosition |
LREAL |
Master position where the axes run in sync. |
||
SlaveSyncPosition |
LREAL |
Slave position where the axes run in sync. |
||
MasterStartDistance |
LREAL |
Master distance for the gear in procedure (where the slave axis will be started for getting into synchronization). In other words, the slave is brought into sync with the master during this distance, i.e. from MasterSyncPosition - MasterStartDistance until MasterSyncPosition. If MasterStartDistance is 0 (or negative), then the slave movement is started immediately. |
||
AvoidReversal |
BOOL |
FALSE: Signals that the reversal of the slave is physically possible and acceptable. TRUE: Signals that the reversal of the module slave is physically impossible or might lead to damage. It works only with modulo slave axes. If a reversal cannot be avoided, the axis is stopped with an error. Behavior:
|
||
Output |
StartSync |
BOOL |
TRUE: Commanded gearing has been started. |
|
InSync |
BOOL |
TRUE: Cmmanded gearing has been completed. |
||
Busy |
BOOL |
TRUE: Execution of the function block has not been finished. |
||
CommandAborted |
BOOL |
TRUE: Command has been aborted by another command. |
||
Error |
BOOL |
TRUE: Error has occurred within the function block. |
||
ErrorID |
SMC_ERROR |
Error identification |