MC_GearInMultiMaster

MC_GearInMultiMaster 1:

The function block MC_GearInMultiMaster is used to activate linear master/slave coupling (gear coupling) for up to four different master axes. The gear ratio can be adjusted dynamically during each PLC cycle. The slave movement is determined by the superimposed master movements. The "Acceleration" parameter has a limiting effect in situations with large gear ratio variations.

The slave axis can be decoupled with the function block MC_GearOut. If the slave is decoupled while it is moving, then it retains its velocity and can be halted using MC_Stop.

If less than four masters are used, an empty data structure can be transferred for each of the parameters "Master2" to "Master4" (the axis ID must be 0).

MC_GearInMultiMaster 2: Inputs

VAR_INPUT
    Master1      : Reference To AXIS_REF;
    Master2      : Reference To AXIS_REF;
    Master3      : Reference To AXIS_REF;
    Master4      : Reference To AXIS_REF;
    Enable       : BOOL;
    GearRatio1   : LREAL;
    GearRatio2   : LREAL;
    GearRatio3   : LREAL;
    GearRatio4   : LREAL;
    Acceleration : LREAL;
    Deceleration : LREAL;
    Jerk         : LREAL;
    BufferMode   : MC_BufferMode;
    Options      : ST_GearInMultiMasterOptions;
END_VAR

Name

Type

Description

Master1

Reference To AXIS_REF

Axis data structure of the first master

Master2

Reference To AXIS_REF

Axis data structure of the second master

Master3

Reference To AXIS_REF

Axis data structure of the third master

Master4

Reference To AXIS_REF

Axis data structure of the fourth master

Enable

BOOL

If "Enable" is TRUE, the function block establishes a coupling.

If an MC_GearOut is executed while the MC_GearInMultiMaster continues to be called with "Enable" TRUE, it is only decoupled briefly and then immediately attempts to re-establish the coupling.

As long as "Enable" is TRUE, the gear factors can be changed cyclically. If "Enable" becomes FALSE after coupling, the command is terminated. The gear factors are frozen at their last values, but the slave is not decoupled.

GearRatio1

LREAL

Gear ratio as floating point value for the first master axis. The gear ratio can be changed cyclically as long as "Enable" is TRUE. If "Enable" is FALSE, the gear ratio remains unchanged.

GearRatio2

LREAL

Gear ratio as floating point value for the second master axis. The gear ratio can be changed cyclically as long as "Enable" is TRUE. If "Enable" is FALSE, the gear ratio remains unchanged.

GearRatio3

LREAL

Gear ratio as floating point value for the third master axis. The gear ratio can be changed cyclically as long as "Enable" is TRUE. If "Enable" is FALSE, the gear ratio remains unchanged.

GearRatio4

LREAL

Gear ratio as floating point value for the fourth master axis. The gear ratio can be changed cyclically as long as "Enable" is TRUE. If "Enable" is FALSE, the gear ratio remains unchanged.

Acceleration

LREAL

Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used. The parameter limits the acceleration of the slave in situations with large gear ratio variations.

Deceleration

LREAL

Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used. The parameter limits the deceleration of the slave in situations with large gear ratio variations. Used only for the option "AdvancedSlaveDynamics".

Jerk

LREAL

Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used. The parameter limits the jerk of the slave in situations with large gear ratio variations. Used only for the option "AdvancedSlaveDynamics".

BufferMode

MC_BufferMode

Currently not implemented

Options

ST_GearInMultiMasterOptions

  • AdvancedSlaveDynamics: swaps the internal algorithm of the function block. This makes it possible to synchronize to masters already in motion. In this case, "Acceleration" and "Deceleration" should only be parameterized symmetrically. If jerk presets are too large, this is reduced to the extent that a change from zero to the parameterized acceleration / deceleration can take place in one NC cycle. The resolution of the acceleration / deceleration thus depends directly on the suitable parameterization of the jerk value.
  • SyncMode (available from TC3.1.4024.11): the SyncMode specifies how the axis coupling behaves if the movement of the slave axis is limited in the AdvancedSlaveDynamics mode (limitation of velocity, acceleration and jerk). The following parameters can be set:
    • VELOSYNC:
      The slave axis and the master axes move with a synchronized velocity. In the case of a dynamic limitation, the slave establishes a position difference that is not caught up again.
    • POSSYNC1:
      The slave axis moves to the master axes with synchronized velocity and position. In the case of a dynamic limitation, the slave establishes a position difference that is then caught up at a later time. Changes in the gear ratios during the journey are executed taking into account the dynamics. The position difference between master and slave resulting from this is not caught up.
    • POSSYNC2:
      The slave axis moves to the master axes with synchronized velocity and position. In the case of a dynamic limitation, the slave establishes a position difference that is then caught up at a later time. Changes in the gear ratios during the journey are immediately calculated internally and the slave continuously synchronizes itself to the new position.


Overview: Which user command results in a permanent position difference or catches it up depending on the SyncMode?MC_GearInMultiMaster 3:

MC_GearInMultiMaster 4:

If coupling takes place with a constant gear ratio with the axes at a standstill (and the gear ratio no longer changes during the course of coupling), then the two SyncModes POSSYNC1 and POSSYNC2 behave identically.

MC_GearInMultiMaster 5: Inputs/outputs

VAR_IN_OUT
    Slave   : AXIS_REF;
END_VAR

Name

Type

Description

Slave

AXIS_REF

Axis data structure of the slave

The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters it contains the current axis status, including position, velocity or error state.

MC_GearInMultiMaster 6: Outputs

VAR_OUTPUT
    InGear         : BOOL;
    Busy           : BOOL; 
    Active         : BOOL; 
    CommandAborted : BOOL;
    Error          : BOOL;
    ErrorID        : UDINT;
END_VAR

Name

Type

Description

InGear

BOOL

TRUE if the coupling was successful.

Busy

BOOL

TRUE as soon as the command is started with "Enable" and as long as the command is processed. If "Busy" is FALSE, the function block is ready for a new order. At the same time, one of the outputs "InGear", "CommandAborted" or "Error" is set.

Active

BOOL

Indicates that the command is executed. (Currently Active = Busy)

CommandAborted

BOOL

TRUE if the command could not be executed completely. The axis may have become decoupled during the coupling process (simultaneous command execution).

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86 or x64)

Tc2_MC2