MC_StepBlockDetection_BkPlcMc
The function block is used for referencing via a limit switch. The function block outputs the position of the cam to the outside via RecordedPosition. No position is set.
Inputs
VAR_INPUT
Execute: BOOL;
Direction: MC_Direction_BkPlcMc;
Velocity: LREAL;
Acceleration: LREAL;
Deceleration: LREAL;
Jerk: LREAL;
SetPosition: LREAL;
DetectionVelocityLimit: LREAL;
DetectionVelocityTime: LREAL;
TorqueLimit: LREAL;
TorqueTolerance: LREAL;
TimeLimit: TIME;
DistanceLimit: LREAL;
BufferMode: MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The homing is initiated by a rising edge at this input. |
Direction | MC_Direction_BkPlcMc | A direction preset coded according to MC_Direction_BkPlcMc. |
Velocity | LREAL | [mm/s] The required motion velocity in actual value units of the axis per second. |
Acceleration | LREAL | [mm/s2] The required acceleration in actual value units of the axis per square second. If this parameter is 0.0, it is replaced by a default value from the axis parameters. |
Deceleration | LREAL | [mm/s2] The required deceleration in actual value units of the axis per square second. If this parameter is 0.0, it is replaced by a default value from the axis parameters. |
Jerk | LREAL | [mm/s3] The required jerk in actual value units of the axis per square second. If this parameter is 0.0, it is replaced by a default value from the axis parameters. |
SetPosition | LREAL | Required position on the referencing cam. |
DetectionVelocityLimit | LREAL | [mm/s] Velocity limit to reliably detect a stop |
DetectionVelocityTime | LREAL | [s] Time in which the actual velocity must be below the DetectionVelocityLimit in order to reliably detect the fixed stop. |
TorqueLimit | LREAL | [Bar] Limitation for the pressure |
TorqueTolerance | LREAL | [Bar] Tolerance for the pressure |
TimeLimit | TIME | After this time, the referencing is canceled with error. At zero, time monitoring is disabled. |
DistanceLimit | LREAL | After this distance, the referencing will be aborted with an error. At zero, the distance monitoring is disabled. |
BufferMode | MC_BufferMode_BkPlcMc |
|
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
Done: BOOL;
Busy: BOOL;
Active: BOOL;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
RecordedPosition: LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | Successful processing is indicated here |
Busy | BOOL | Indicates that a command is being processed. |
Active | BOOL | Readiness for operation is indicated here. |
CommandAborted | BOOL | Here an abort of the command is indicated. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded error message is provided here. |
RecordedPosition | LREAL | [mm] Determined position of the referencing cam. |
Behavior of the function block
On a rising edge at Execute the function block checks the transferred axis interface. A number of problems can be detected and reported during this process:
- At Direction, MC_Positive_Direction_BkPlcMc, MC_Negative_Direction_BkPlcMc, is accepted
- The DistanceLimit must have a value greater than the increment resolution.
The parameters Velocity, Acceleration, Deceleration and Jerk are transferred to MC_MoveVelocity_BkPlcMc. After the cam has been detected, the position is communicated via RecordedPosition and a MC_Halt_BkPlcMc stops the movement.
A hard stop is detected when the actual velocity for the time DetectionVelocityTime is below DetectionVelocityLimit or the current pressure is greater than TorqueLimit minus TorqueTolerance. If no fixed stop is detected within DistanceLimit or TimeLimit, referencing is aborted with an error.
During processing, the function block reports Busy and Active. After successful processing Done is reported back. If a subordinate function block reports an error, this is reported via Error and ErrorID.