MC_GearInMultiMaster
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 uncoupled 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 fewer than four masters are used, an empty data structure can be transferred for parameters Master2 to Master4 (the axis ID must be 0).
Inputs
VAR_INPUT
Enable : BOOL;
GearRatio1 : LREAL;
GearRatio2 : LREAL;
GearRatio3 : LREAL;
GearRatio4 : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : MC_BufferMode;
Options : ST_GearInMultiMasterOptions;
END_VAR
Enable |
Coupling is activated with a rising edge at input Enable. The gear ratio can be changed cyclically as long as Enable is TRUE. | |
GearRatio1 |
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 |
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 |
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 |
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 |
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 |
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 "Advanced Slave Dynamics". | |
Jerk |
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 "Advanced Slave Dynamics". | |
BufferMode |
Currently not implemented | |
Options. |
AdvancedSlaveDynamics |
Exchanges the internal algorithm of the function block. This makes it possible to synchronise to masters already in motion. 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. |
Outputs
VAR_OUTPUT
InGear : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
InGear |
Becomes TRUE, if the coupling was successful. |
Busy |
The Busy output becomes TRUE when the command is started with Enable and remains TRUE as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new job. At the same time one of the outputs InGear, CommandAborted or Error is set. |
Active |
Active indicates that the command is executed (currently Active=Busy, see BufferMode) |
CommandAborted |
Becomes TRUE, if the command could not be fully executed. The axis may have become decoupled during the coupling process (simultaneous command execution). |
Error |
Becomes TRUE if an error occurs. |
ErrorID |
If the error output is set, this parameter supplies the error number. |
Inputs/outputs
VAR_IN_OUT
Master1 : AXIS_REF;
Master2 : AXIS_REF;
Master3 : AXIS_REF;
Master4 : AXIS_REF;
Slave : AXIS_REF;
END_VAR
AXIS_REF AXIS_REF AXIS_REF AXIS_REF AXIS_REF
Master1 |
Axis data structure of the first master. |
Master2 |
Axis data structure of the second master. |
Master3 |
Axis data structure of the third master. |
Master4 |
Axis data structure of the fourth master. |
Slave |
Axis data structure of the Slave. |
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.