MC_BacklashCompensation
The MC_BacklashCompensation function block is used together with the axis parameter Position Correction to compensate backlash. It is possible to compensate negative as well as positive backlash.
Instructions for use and necessary settings in TwinCAT:
|
Inputs
VAR_INPUT
Enable : BOOL;
Backlash : LREAL;
CompensationInPositiveDirection : BOOL;
Ramp : LREAL;
DisableMode : E_DisableMode;
Options : ST_BacklashCompensationOptions;
END_VAR
Name | Type | Description |
---|---|---|
Enable | BOOL | The command is executed as long as Enable is active. Backlash compensation is hereby enabled. |
Backlash | LREAL | Compensation value with sign [mm]. If the default value is used, the internal NC backlash value is read via ADS and used in this function block. |
CompensationInPositiveDirection | BOOL | Compensation takes place in the selected working direction. FALSE (default): Backlash compensation must be executed when moving in negative direction. TRUE: Backlash compensation must be executed when moving in positive direction. |
Ramp | LREAL | Velocity limit for entered backlash compensation (constant velocity and linear position as subprofiles for backlash compensation [mm/s]). |
DisableMode | E_DisableMode | Disable mode: (0)=HOLD, (1)=RESET |
Options | ST_BacklashCompensationOptions | Optional parameters (not implemented) |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state. |
Outputs
VAR_OUTPUT
Enabled : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorId : UDINT;
CurrentBacklash : LREAL;
Limiting : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Enabled | BOOL | This output becomes TRUE, if the backlash compensation has been enabled without error. |
Busy | BOOL | This output becomes TRUE when the command is started with Enable and remains so as long as the function block executes the command. |
Error | BOOL | This output becomes TRUE if an error has occurred during command execution. |
ErrorId | UDINT | Contains the command-specific error code of the last executed command. Details of the error code can be found in the ADS error documentation or in the NC error documentation (error codes 0x4nnn and 0x8nnn). |
CurrentBacklash | LREAL | Current compensation value [mm]. |
Limiting | BOOL | This output becomes TRUE if the function block currently limits the backlash compensation. |
TYPE E_DisableMode:
(
DisableModeHold :=0, (* hold on the last output value (default) *)
DisableModeReset :=1 (* reset the output value to zero (jump to zero) *)
(*DisableModeRamp :=2 *) (* ramp down the output to zero (NOT NEEDED YET) *)
);
END_TYPE
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.0.0 | PC or CX (x86 or x64) | Tc2_MC2 |