FB_HomeLimitSwitch - General Information

Overview

Type:

Function block

Available as of:

V1.0.3.0

Inherits from:

-

Implements:

-

Versions:

Current version

Task

Homing an axis to a hardware limit switch.

Description

An axis i_ifDrive is moved to the reference position. The reference position is recognized by means of the hardware limit switches that are connected to the inputs i_xHwLimitPos and i_xHwLimitNeg.

Four modes (input i_etMode) are supported for the homing:

o....PosEdge...: i_xHwLimit... = TRUE equates the condition "Sensor assigned" (normally open contact)

o....NegEdge...: i_xHwLimit... = FALSE equates the condition "Limit switch assigned" (normally closed contact)

When starting the reference travel, the following cases are distinguished:

oCase 1: The two inputs i_xHwLimitPos and i_xHwLimitNeg report the condition "Limit switch not assigned" when starting the reference travel.

oStep 1: The axis moves with the velocity i_lrVel in the defined direction until the respective input i_xHwLimitPos or i_xHwLimitNeg reports the condition "Limit switch assigned". The input i_etMode defines the direction and the desired limit switch.

oStep 2: Then the axis is moved in the opposite direction until the desired limit switch i_xHwLimitPos or i_xHwLimitNeg reports the condition "Limit switch not assigned". If thereby the hardware limit switch, in which direction the axis is moving at the time reports the condition "Limit switch moved", then an error is triggered.

oStep 3: The axis is moved in direction again that was defined by the input i_etMode, but now with the velocity i_lrLowVel until the desired limit switch i_xHwLimitPos or i_xHwLimitNeg (reference signal) reports the condition "Limit switch assigned". Afterwards the axis stops at the following position: "Position when the reference signal is given" + i_lrOffset.

oCase 2: The hardware limit switch in the axis' direction of motion (defined by the input i_etMode) is enabled.

In this case, the process is started with step 2 of case 1.

oCase 3: The two inputs i_xHwLimitPos and i_xHwLimitNeg are enabled during the start

An error is triggered.

Interface

Input

Data type

Description

i_xEnable

BOOL

A rising edge FALSE -> TRUE activates the POU, a falling edge TRUE -> FALSE deactivates the POU.

A deactivated POU does not execute any actions.

i_ifDrive

IF_Drive

Input for the axis that shall be controlled.

i_etMode

ET_HomeLimitSwitchMode

Reference mode

i_lrOffset

LREAL

Offset between sensor signal and reference point.

An offset is always added to the position that was held when the sensor signal occurred.

i_lrMaxTravel

LREAL

Maximum distance for referencing:

The movements into the direction of motion are defined by the input i_etMode until the hardware limit switch is enabled.

The maximum distance will not be considered because the following movement in the opposite direction will be allowed for the maximum defined distance. For a graphical explanation of i_lrMaxTravel.

i_lrHomePosition

LREAL

Reference position at the end of the referencing.

i_lrVel

LREAL

Velocity (change of position) in units/s.

i_lrLowVel

LREAL

Velocity (change of position) in units/s at which the edge of the hardware limit switch is to be detected.

i_lrAcc

LREAL

Acceleration (change of velocity) in units/s2.

i_lrDec

LREAL

Deceleration (change of velocity) in units/s2.

i_lrJerk

LREAL

Jerk (change of acceleration/deceleration) in units/s3.

i_xHwLimitNeg

BOOL

Negative hardware limit switch (digital input of the PacDrive system)

Make contact (normally open).

i_xHwLimitPos

BOOL

Positive hardware limit switch input (digital input of the PacDrive system).

Make contact (normally open).

i_xStart

BOOL

Starts referencing.

Output

Data type

Description

q_xActive

BOOL

TRUE: The POU is active and has to be executed further.

FALSE: The POU is inactive.

q_xReady

BOOL

TRUE: The POU is ready to operate and can accept user commands.

FALSE: The POU is not ready to accept user commands.

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_sMsg

STRING[80]

Event-triggered message which gives more detailed information on the diagnostic state.

q_xMotionInstructionActive

BOOL

TRUE: The axis is processing a motion command. The output is also set if the motion command defines that the axis is at stand still, e.g. due to a standing master.

q_lrPosition

BOOL

Position of the axis.

q_xHomeOk

BOOL

Axis stops at the reference position.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Disabled

9

The POU is disabled.

OK

HomingDone

222

Homing has been performed.

OK

Initializing

4

The POU is being initialized.

OK

WaitForLimitSwitchLowVel

224

Waiting for signal from LimitSwitch during travel at LowVel velocity.

OK

WaitForLimitSwitchVel

223

Waiting for signal from LimitSwitch during travel at Vel velocity.

OK

WaitForStart

5

Waiting for starting command.

OK

WaitUntilDisabled

8

Waiting until the POU is deactivated.

OK

WaitUntilLimitSwitchFree

217

Waiting until limit switch is free.

OK

WaitUntilOffsetReached

225

Waiting until the offset position has been reached.

DriveConditionInvalid

DriveNotReady

10

The drive is not ready for motion commands.

HomingFailed

SensorNotFound

220

No sensor signal was found.

InputParameterInvalid

AccRange

12

Acc is outside the valid range.

InputParameterInvalid

DecRange

13

Dec is outside the valid range.

InputParameterInvalid

DriveInvalid

3

The connected drive is invalid.

InputParameterInvalid

JerkRange

14

Jerk is outside the valid range.

InputParameterInvalid

LowVelRange

226

LowVel is outside the valid range.

InputParameterInvalid

MaxTravelRange

215

MaxTravel is outside the valid range.

InputParameterInvalid

UnknownMode

111

The Mode is indeterminable.

InputParameterInvalid

VelRange

11

Vel is outside the valid range.

LimitReached

HwLimitNegReached

219

Negative limit switch has been reached.

LimitReached

HwLimitPosReached

221

Positive limit switch has been reached.

UnexpectedProgramBehavior

UnexpectedFeedback

1

An unintended detected error occurred during execution.

UnexpectedProgramBehavior

UnknownState

2

The POU is in an undefined state.

AccRange

Enumeration name:

AccRange

Enumeration value:

12

Description:

Acc is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrAcc, an invalid value has been transferred.

The following must hold: 0 < i_lrAcc < drive parameter MaxAcc

For the valid value range for i_lrAcc, see output q_sMsg

DecRange

Enumeration name:

DecRange

Enumeration value:

13

Description:

Dec is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrDec, an invalid value has been transferred.

The following must hold: 0 < i_lrDec < drive parameter MaxAcc

For the valid value range for i_lrDec, see output q_sMsg

Disabled

Enumeration name:

Disabled

Enumeration value:

9

Description:

The POU is disabled.

The function block is disabled and executes no actions whatsoever. i_xEnable and q_xActive are set to FALSE

DriveInvalid

Enumeration name:

DriveInvalid

Enumeration value:

3

Description:

The connected drive is invalid.

Issue

Cause

Solution

-

At the input i_ifDrive, no drive was applied.

At the input i_ifDrive, a valid drive must be transferred.

-

The connected drive does not support all required functionalities.

Establish which functionalities are not supported by the drive by means of output q_sMsg.

Use a drive which supports all required functionalities.

DriveNotReady

Enumeration name:

DriveNotReady

Enumeration value:

10

Description:

The drive is not ready for motion commands.

Issue

Cause

Solution

-

The axis is not in position control.

Verify the state of the axis.

-

The parameter State of the SERCOS bus is not 4.

Set the SERCOS bus parameter PhaseSet to 4.

Verify the SERCOS bus for errors.

HomingDone

Enumeration name:

HomingDone

Enumeration value:

222

Description:

Homing has been performed.

The homing sequence has been completed successfully.

HwLimitNegReached

Enumeration name:

HwLimitNegReached

Enumeration value:

219

Description:

Negative limit switch has been reached.

Issue

Cause

Solution

-

While moving away from the positive limit switch, the negative limit switch was triggered.

Verify the sensors.

Verify the signals at the inputs i_xHwLimitNeg and i_xHwLimitPos.

-

Both limit switches are active at the same time.

Verify the sensors.

Verify the signals at the inputs i_xHwLimitNeg and i_xHwLimitPos.

HwLimitPosReached

Enumeration name:

HwLimitPosReached

Enumeration value:

221

Description:

Positive limit switch has been reached.

Issue

Cause

Solution

-

While moving away from the negative limit switch, the positive limit switch was triggered.

Verify the sensors.

Verify the signals at the inputs i_xHwLimitNeg and i_xHwLimitPos.

-

Both limit switches are active at the same time.

Verify the sensors.

Verify the signals at the inputs i_xHwLimitNeg and i_xHwLimitPos.

Initializing

Enumeration name:

Initializing

Enumeration value:

4

Description:

The POU is being initialized.

The function block is being initialized and thus is not yet ready to receive commands at its inputs.

The function block will signalize that it is ready for operation with the signal q_xReady = TRUE.

JerkRange

Enumeration name:

JerkRange

Enumeration value:

14

Description:

Jerk is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrJerk, an invalid value has been applied.

At the input i_lrJerk, a value greater than 0 and smaller than or equal to Gc_lrMaxJerk must be transferred.

LowVelRange

Enumeration name:

LowVelRange

Enumeration value:

226

Description:

LowVel is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrLowVel, an invalid value has been applied.

At the input i_lrLowVel, a value greater than 0 and smaller than the axis parameter MaxVel must be transferred.

MaxTravelRange

Enumeration name:

MaxTravelRange

Enumeration value:

215

Description:

MaxTravel is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrMaxTravel, an invalid value has been applied.

At the input i_lrMaxTravel, a value greater than 0 must be transferred.

SensorNotFound

Enumeration name:

SensorNotFound

Enumeration value:

220

Description:

No sensor signal was found.

Issue

Cause

Solution

-

The sensor signal is not transmitted to the function block.

Verify the signals of the limit switch at the function block inputs i_xHwLimitNeg and i_xHwLimitPos.

-

The sensor does not transmit a signal.

Verify the power supply of the sensor.

Ensure that the sensor is not covered.

Ensure that the sensor can be triggered by the mechanical system.

Verify the electrical connection of the sensor and the Touchprobe input.

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

1

Description:

An unintended detected error occurred during execution.

Issue

Cause

Solution

-

An error occurred in the internal execution.

Please inform the support team about this error.

UnknownMode

Enumeration name:

UnknownMode

Enumeration value:

111

Description:

The Mode is indeterminable.

Issue

Cause

Solution

-

At the input i_etMode, an invalid value has been applied.

At the input i_etMode, an element of the enumeration ET_HomeLimitSwitchMode must be applied.

UnknownState

Enumeration name:

UnknownState

Enumeration value:

2

Description:

The POU is in an undefined state.

Issue

Cause

Solution

-

An error occurred in the internal execution.

Please inform the support team about this error.

VelRange

Enumeration name:

VelRange

Enumeration value:

11

Description:

Vel is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrVel, an invalid value has been applied.

Apply a value greater than 0 and smaller than the axis parameter MaxVel to i_lrVel.

WaitForLimitSwitchLowVel

Enumeration name:

WaitForLimitSwitchLowVel

Enumeration value:

224

Description:

Waiting for signal from LimitSwitch during travel at LowVel velocity.

The axis is moved towards the sensor at the velocity i_lrLowVel in order to obtain a more exact position.

WaitForLimitSwitchVel

Enumeration name:

WaitForLimitSwitchVel

Enumeration value:

223

Description:

Waiting for signal from LimitSwitch during travel at Vel velocity.

The axis is moved at the speed i_lrVel until it reaches the sensor.

WaitForStart

Enumeration name:

WaitForStart

Enumeration value:

5

Description:

Waiting for starting command.

The function block has completed its initialization and is waiting for a positive edge at the input i_xStart before continuing the processing.

WaitUntilDisabled

Enumeration name:

WaitUntilDisabled

Enumeration value:

8

Description:

Waiting until the POU is deactivated.

The function block is disabled. All internal states are reset and connected resources (e.g. axes) are transferred to a safe state. The function block has to be called up continuously until it reports q_xActive = FALSE.

WaitUntilLimitSwitchFree

Enumeration name:

WaitUntilLimitSwitchFree

Enumeration value:

217

Description:

Waiting until limit switch is free.

The axis is moved away from the limit switch and back into its processing range.

WaitUntilOffsetReached

Enumeration name:

WaitUntilOffsetReached

Enumeration value:

225

Description:

Waiting until the offset position has been reached.

The reference signal was detected. The axis is moved by the offset value.

Methods

Name

Description

RegisterLoggerPoint

Registering the logger points of the POU in the Application Logger