FUNCTION_BLOCK SMC_BacklashCompensation
This function block can be used to compensate the backlash which arises for example at a belt drive or in a gear-box.
For this purpose a (usually virtual) master axis gets mirrored on the real slave axis, whose backlash should be compensated. The function block works similar to a phasing function block, the phase depends on the direction of the master axis. If the master axis starts in a certain direction, the slave axis does the same plus an additional movement (distance: fBacklash) in this direction; if the master axis inverts, the slave axis also turns around and additionally covers the double distance fBacklash in this new direction.
Take care that the master axis and the slave axis are at the same position when the module starts working, because otherwise the slave axis would be positioned on the master axis.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Inout |
Master |
Reference to master axis |
||
Slave |
Reference to slave axis |
|||
Input |
bExecute |
BOOL |
Rising edge: Starts the execution of the function block. It stays active until the slave axis gets interrupted by another movement, or if an error occurs. |
|
fBacklash |
LREAL |
Distance/Backlash to be compensated. |
||
fCompensationVel |
LREAL |
Additional velocity, which should be used for the compensation. |
||
fCompensationAcc |
LREAL |
Additional acceleration, which should be used for the compensation. |
||
fCompensationDec |
LREAL |
Additional deceleration, which should be used for the compensation. |
||
fCompensationJerk |
LREAL |
Additional jerk, which should be used for the compensation. |
||
eBacklashMode |
SMC_BL_AUTO |
The mode of backlash compensation. SMC_BL_AUTO : Direction in which the master axis moves; determines the compensation direction. SMC_BL_POSITIVE : Compensation in positive direction, independent on the movement of the master axis. SMC_BL_NEGATIVE : Compensation in negative direction, independent on the movement of the master axis. SMC_BL_OFF : No compensation |
||
eBacklashStartState |
SMC_BL_START_NONE |
The start condition of the axis. SMC_BL_START_NEGATIVE : The slave axis is under traction in negative direction, that is: a movement in negative direction needs no compensation; in case of a movement in positive direction the double fBacklash-distance will be made up. SMC_BL_START_POSITIVE : The slave axis is under traction in positive direction, that is: a movement in positive direction needs no compensation; in case of a movement in negative direction the double fBacklash-distance will be made up. SMC_BL_START_NONE : The slave axis is not under traction; a movement in positive or negative direction will cause a corresponding compensating movement of distance fBacklash. |
||
Output |
bBusy |
BOOL |
TRUE: Execution of the function block is not finished yet. |
|
bCommandAborted |
BOOL |
TRUE: Command has been aborted by another command. |
||
bError |
BOOL |
TRUE: Error has occured within the function block. |
||
iErrorID |
SMC_ERROR |
Error identification |
||
bCompensating |
BOOL |
TRUE: While compensating a backlash. |