MC_PowerStepper
The enables for an axis are set with the function block MC_PowerStepper. An MC_Power block is used internally for this purpose. The MC_PowerStepper also detects the stall situations that occur in stepper motors if they are overloaded, and offers suitable counter measures. The status bits of a KL2531 or KL2541 terminal are monitored, and the errors indicated there are reported to the NC.
There is more detailed explanation in the Appendix.
Inputs
VAR_INPUT
Enable : BOOL;
Enable_Positive : BOOL;
Enable_Negative : BOOL;
Override : LREAL;
DestallParams : ST_PowerStepperStruct;
KL_Status : USINT;
KL_Status2 : UINT;
END_VAR
Enable |
NC controller enable for the axis. |
Enable_Positive |
NC advance movement enable in positive direction. |
Enable_Negative |
NC advance movement enable in negative direction. |
Override |
Override value in percent (e.g. 68.123%) |
DestallParams |
The functions of the block are enabled here, and their working rules are specified. |
KL_Status |
The status byte of a terminal of type KL2531 or KL2541. |
KL_Status2 |
The status word of a terminal of type KL2531 or KL2541. |
Outputs
VAR_OUTPUT
Status : BOOL;
Error : BOOL;
ErrorID : UDINT;
Stalled : BOOL;
StallError : BOOL;
END_VAR
Status |
Becomes TRUE once all enables were set successfully. |
Error |
Becomes TRUE if an error occurs. |
ErrorID |
If the error output is set, this parameter supplies the error number. |
Stalled |
no description |
StallError |
no description |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Axis |
Axis data structure |
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.