FB_HomeTorque - 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 limit stop.

Description

An axis i_ifDrive is moved to the reference position. The axis is moved across the distance i_lrMaxTravel. At the same time, the applied torque is monitored. If the applied torque exceeds a value of i_lrMaxTorque Nm for a period of i_diTorqueTime ms, the axis is moved back by i_lrOffset, stopped and set to the position i_lrHomePosition. Two modes (input i_etMode) are supported for homing.

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_lrMaxTorque

LREAL

The torque (in Nm) of the motor shaft of the drive is limited using MaxTorque.

i_diTorqueTime

DINT

Required torque time (in msec)

i_lrLowLimit

LREAL

Lower limit of the position relative to the start position, at which the torque signal is valid.

i_lrHighLimit

LREAL

Upper limit of the position relative to the start position, at which the torque signal is valid.

i_etMode

ET_HomeTorqueMode

Reference mode

oPosDirectionMaxTorque = Positive direction, until MaxTorque is reached

oNegDirectionMaxTorque = Negative direction, until MaxTorque is reached

i_lrOffset

LREAL

Offset between hitting the stop and the reference point.

The offset should be preset in the opposite direction to “Moving to Stop”.

i_lrMaxTravel

LREAL

Maximum distance for searching for the stop.

i_lrHomePosition

LREAL

Reference position at the end of the referencing.

i_lrVel

LREAL

Velocity (change of position) in units/s.

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_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_lrPosition

LREAL

Axis reference position.

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_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

WaitForStart

5

Waiting for starting command.

OK

WaitUntilDisabled

8

Waiting until the POU is deactivated.

OK

WaitUntilMaxTorqueReached

227

Waiting until the maximum torque has been reached.

ControllerConditionInvalid

ControllerInvalid

100

The controller is not supported.

DriveConditionInvalid

DriveNotReady

10

The drive is not ready for motion commands.

ExecutionAborted

AsyncInitNotFinished

290

Init has not been completed yet.

ExecutionAborted

ColdResetOfControllerNecessary

297

A cold start of the controller is required

ExecutionAborted

NoAsyncTasksCreated

289

No asynchronous task has been generated.

HomingFailed

MaxTorqueNotFound

228

MaxTorque has not been reached.

InputParameterInvalid

AccRange

12

Acc is outside the valid range.

InputParameterInvalid

AsyncInvalid

288

The value of IF_Async is invalid.

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

MaxTorqueRange

229

MaxTorque 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.

SercosConditionInvalid

SercosNotInPhaseFour

19

The Sercos bus is not in phase 4.

UnexpectedProgramBehavior

AsyncAddWasNotSuccessful

284

It was not possible to transfer an asynchronous job to a task.

UnexpectedProgramBehavior

InterfaceCastFailed

285

The prompt for the interface was unsuccessful.

UnexpectedProgramBehavior

SemaphoreMeCreateFailed

287

The creating of a Semaphore failed

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

AsyncAddWasNotSuccessful

Enumeration name:

AsyncAddWasNotSuccessful

Enumeration value:

284

Description:

It was not possible to transfer an asynchronous job to a task.

Issue

Cause

Solution

-

An error has been detected and occurred in the internal execution.

Please inform the support team about this detected error.

AsyncInitNotFinished

Enumeration name:

AsyncInitNotFinished

Enumeration value:

290

Description:

Init has not been completed yet.

Issue

Cause

Solution

-

Init() method has not yet been completed.

Call up the Init() before you call up Start() for the first time.

After you have called up the Init, wait until Init has been executed successfully. (Init.q_xDone = TRUE)

AsyncInvalid

Enumeration name:

AsyncInvalid

Enumeration value:

288

Description:

The value of IF_Async is invalid.

Issue

Cause

Solution

-

No valid value has been transferred at the i_ifAsync input.

Verify the value at the i_ifAsync input for <> 0.

ColdResetOfControllerNecessary

Enumeration name:

ColdResetOfControllerNecessary

Enumeration value:

297

Description:

A cold start of the controller is required

Issue

Cause

Solution

-

Gc_udiNumOfAsyncTasks has been changed.

A cold start of the controller and a call up of Init() is required.

ControllerInvalid

Enumeration name:

ControllerInvalid

Enumeration value:

100

Description:

The controller is not supported.

Issue

Cause

Solution

-

The controller does not provide the required conditions.

For more details, 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.

HomingDone

Enumeration name:

HomingDone

Enumeration value:

222

Description:

Homing has been performed.

The homing sequence has been completed successfully.

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.

InterfaceCastFailed

Enumeration name:

InterfaceCastFailed

Enumeration value:

285

Description:

The prompt for the interface was unsuccessful.

Issue

Cause

Solution

-

An error has been detected and occurred in the internal execution.

Please inform the support team about this detected error.

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.

MaxTorqueNotFound

Enumeration name:

MaxTorqueNotFound

Enumeration value:

228

Description:

MaxTorque has not been reached.

Issue

Cause

Solution

-

The stop was not found.

Verify the state of the stop.

Verify the input i_lrMaxTorque

Verify the input i_lrMaxTravel

Verify the state of the axis.

MaxTorqueRange

Enumeration name:

MaxTorqueRange

Enumeration value:

229

Description:

MaxTorque is outside the valid range.

Issue

Cause

Solution

-

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

At the input i_lrMaxTorque, a value must be transferred which fulfills the following formula:

0.0 < (i_lrMaxTorque / lrTorqueConstant * 10000000.0 / lrMaxDrivePeakCurrent / lrLimCurrent) < 100.0

with lrLimCurrent := lrUserDrivePeakCurrent * 100.0 / lrMaxDrivePeakCurrent

where lrTorqueConstant, lrMaxDrivePeakCurrent and lrUserDrivePeakCurrent are parameters of the axis.

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.

NoAsyncTasksCreated

Enumeration name:

NoAsyncTasksCreated

Enumeration value:

289

Description:

No asynchronous task has been generated.

Issue

Cause

Solution

-

Gc_udiNumOfAsyncTasks = 0

Allocate Gc_udiNumOfAsyncTasks with a value > 0 and <= 10.

SemaphoreMeCreateFailed

Enumeration name:

SemaphoreMeCreateFailed

Enumeration value:

287

Description:

The creating of a Semaphore failed

Issue

Cause

Solution

-

An error has been detected and occurred in the internal execution.

Please inform the support team about this detected error.

SercosNotInPhaseFour

Enumeration name:

SercosNotInPhaseFour

Enumeration value:

19

Description:

The Sercos bus is not in phase 4.

Issue

Cause

Solution

-

The parameter State of the SERCOS bus is not 4.

Set the SERCOS bus parameter PhaseSet to 4.

Verify the SERCOS bus for errors.

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_HomeTorqueMode 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.

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.

WaitUntilMaxTorqueReached

Enumeration name:

WaitUntilMaxTorqueReached

Enumeration value:

227

Description:

Waiting until the maximum torque has been reached.

The axis is moved towards the stop until the set torque is exceeded or the maximum distance has been covered.

Methods

Name

Description

RegisterLoggerPoint

Registering the logger points of the POU in the Application Logger