MC_GearInDyn
The function block MC_GearInDyn activates a linear master-slave coupling (gear coupling). The gear ratio can be adjusted dynamically during each PLC cycle. Hence a controlled master/slave coupling can be build up. 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 or MC_Halt.
Alternatively, the function block MC_GearIn with fixed gear ratio is available.
Inputs
VAR_INPUT
Enable : BOOL;
GearRatio : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : MC_BufferMode;
Options : ST_GearInDynOptions;
END_VAR
Name | Type | Description |
---|---|---|
Enable | BOOL | If "Enable" is TRUE, the function block establishes a coupling. If an MC_GearOut is executed while the MC_GearInDyn continues to be called with "Enable" TRUE, it is only decoupled for a short time and then immediately attempts to re-establish the coupling. As long as "Enable" is TRUE, the gear factor can be changed cyclically. If "Enable" becomes FALSE after coupling, the command is terminated. The gear factor is frozen at its last value, but the slave is not decoupled. |
GearRatio | LREAL | Gear ratio as floating point value. 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. The maximum acceleration is only reached at the maximum master velocity. Otherwise the slave acceleration is below this value when the gear ratio changes significantly. |
Deceleration | LREAL | Deceleration (≥0). (Not implemented) |
Jerk | LREAL | Jerk (≥0). (Not implemented) |
BufferMode | MC_BufferMode | Currently not implemented |
Options | ST_GearInDynOptions | Currently not implemented |
Inputs/outputs
VAR_IN_OUT
Master : AXIS_REF;
Slave : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Master | AXIS_REF | Axis data structure of the master |
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.
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 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 |