MC_GearInPos (FB)

 

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 Command­Aborted 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

GearInPos1.png

Different examples of gearing

GearInPos2.png

InOut:

Scope

Name

Type

Initial

Comment

Inout

Master

AXIS_REF_SM3

Reference to master axis

Slave

AXIS_REF_SM3

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 accept­able.

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:

  • If the slave axis is a modulo axis and the master velocity (times the sign of the gear ratio) is not opposite

    to the slave velocity, then MC_GearInPos tries to avoid a reversal of the slave.

    It tries to "stretch" the slave movement by increasing the distance the slave travels by up to 5 slave periods.

    If this "stretching" is not successful, an error is reported.

  • If the slave velocity is opposite to the master velocity (times the sign of the gear ratio),

    an error is reported.

  • If the slave axis is not a modulo axis, an error is reported on the rising edge of the Execute input.

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