MC_AxCtrlStepperDeStall_BkPlcMc
The function block monitors the motion of a stepper motor axis, which is operated with an encoder.
It is essential to use a real encoder (not an encoder emulation based on pulse counting of an output terminal) in order to ensure correct function of this function block. |
The application of such a function block can result in stalling (torque discontinuity). It therefore cannot be assumed that the velocity is constant. |
Inputs
VAR_INPUT
EnableAcc: BOOL:=FALSE;
EnableDec: BOOL:=FALSE;
Reset: BOOL:=FALSE;
UseKL2531State: BOOL:=FALSE;
ResetRefOnError: BOOL:=FALSE;
FirstAuxParamIdx:INT:=0;
VeloLimit: LREAL:=0.0;
LimitFilter: LREAL:=0.0;
UpdateFilter: LREAL:=0.0;
END_VAR
Name | Type | Description |
---|---|---|
EnableAcc | BOOL | These inputs determine whether the monitoring may intervene during the acceleration and braking phases. |
EnableDec | BOOL | |
Reset | BOOL | This input controls the activity of the controller. |
UseKL2531State | BOOL | If TRUE is transferred here, the function block evaluates ST_TcPlcDeviceInput.bTerminalState. |
ResetRefOnError | BOOL | If TRUE is transferred here, the function block clears the reference flag of the axis. |
FirstAuxParamIdx | INT | Here a range in the Axis_Ref_BkPlcMc.ST_TcHydAxParam.fCustomerData can be activated as parameter interface. |
VeloLimit | LREAL | The threshold for the velocity deviation, from which the stall situation is detected. |
LimitFilter | LREAL | The time over which an excessive velocity deviation must be present continuously for the stall situation to be detected. |
UpdateFilter | LREAL | The time constant, with which the velocity control value in the function block is adjusted to the actual velocity. |
Inputs/outputs
VAR_INOUT
Axis: Axis_Ref_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Active: BOOL;
Activated: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Active | BOOL | Indicates that a stall situation was detected. |
Activated | BOOL | Indicates that a stall situation was detected since the last start of an active axis movement. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
Behaviour of the function block:
During each call the function block checks whether it has to change the state. It goes in the active state if the internal motion phase permits this under the rules of EnableAcc, EnableDec and the velocity error continuously exceeds the value of VeloLimit for at least LimitFilter. EnableAcc enables the function block to intervene during phases with constant phases or phases with rising magnitude. EnableDec enables the activity of the function block for phases with falling magnitude or constant velocity. Active and Activated are set during the transition to the active state.
The function block changes to inactive state if the velocity error was reduced to half the value of VeloLimit. Active is cancelled during the transition to the inactive state.
In active state the control value is adjusted to the actual velocity with the time constant UpdateFilter. If the time constant is set to 0.0, the actual velocity is applied directly.
In inactive state Activated is cancelled, if the axis leaves the idle state and starts an active motion.
Since the function block evaluates the difference between set and actual velocity, it is important to set the reference velocity correctly when this function block is used. Imprecise setting of this parameter can result in unnecessary intervention by the function block in the motion. |
The following Scope View shows a positioning, during which an obstacle was encountered twice. In each case the axis stopped completely.
Integration of the function block in the application
A function block of this type must be called after the actual value acquisition and control value generation. The function block superimposes its response with that of the control value generator and enters it in the ST_TcHydAxRtData. The MC_AxRtFinish_BkPlcMc function block to be positioned after the controller function block then considers the response automatically.
A value greater than 0 in FirstAuxParamIdx can be used to instruct the function block to use three consecutive values in the fCustomerData of the parameter structure as VeloLimit, LimitFilter and UpdateFilter. If the address of a suitable ARRAY[..] OF STRING() is entered in Axis.pStAxAuxLabels, the parameters are automatically assigned a name. |