SMC_Homing (FB)ΒΆ

FUNCTION_BLOCK SMC_Homing

This function block causes the execution of a homing sequence. If SMC_Homing is executed, the axis is moved at fVelocityFast in the direction specified by nDirection as long as the reference switch is open (bReferenceSwitch := TRUE).

Once the reference switch is closed (bReferenceSwitch := FALSE), the axis is decelerated and driven at fVelocitySlow (the direction depends on the homing mode). At the point at which the reference switch opens again (bReferenceSwitch := TRUE), the following actions are performed: the index pulse and index position are used (optionally), the reference position fHomePosition is set, the drive is stopped. (The order of these actions depends on the homing mode, see SMC_HOMING_MODE.)

InOut:

Scope

Name

Type

Initial

Comment

Inout

Axis

AXIS_REF_SM3

Input

bExecute

BOOL

Rising edge: Starts the execution of the function block.

fHomePosition

LREAL

Home position; set after homing (in technical unit [u])

fVelocitySlow

LREAL

Low velocity; used to drive out of the reference switch [u/s]

fVelocityFast

LREAL

High velocity; used until reference switch is found [u/s]

fAcceleration

LREAL

Value of the acceleration (increasing energy of the motor) [u/s^2]

fDeceleration

LREAL

Value of the deceleration (decreasing energy of the motor) [u/s^2]

fJerk

LREAL

Value of the Jerk [u/s^3]

nDirection

MC_Direction

negative

The direction for the fast movement searching the reference switch. (positive or negative)

bReferenceSwitch

BOOL

TRUE

TRUE: The switch is open (the drive is not in the switch) FALSE: The switch is closed (the drive is in the switch)

fSignalDelay

LREAL

Time [s] for bReferenceSwitch to be transmitted.

nHomingMode

SMC_HOMING_MODE

FAST_BSLOW_S_STOP

Homing mode

bReturnToZero

BOOL

TRUE: Moves to position zero after homing.

bIndexOccured

BOOL

TRUE: Index pulse has been detected, the index position is stored in input fIndexPosition.

fIndexPosition

LREAL

Position where index occured

bIgnoreHWLimit

BOOL

Disables the limit switch handling in the driver by setting bHWLimitEnable to FALSE during homing. Please note that for most servo drives, this is necessary but not sufficient to disable the limit switch handling in the drive. Often, the limit switch handling in the drive must be deactivated by other means before calling SMC_Homing, and reactivated when SMC_Homing is done. (For example by writing a drive-specific configuration object.)

Output

bDone

BOOL

TRUE: Homing has been done.

bBusy

BOOL

TRUE: FB is not idle.

bCommandAborted

BOOL

TRUE: Commanded motion has been interrupted by any motion FB acting on the same axis except MoveSuperImposed.

bError

BOOL

TRUE: Error has occured within function block.

nErrorID

SMC_ERROR

Error identification*

bStartLatchingIndex

BOOL

For some homing modes, the index pulse is evaluated. TRUE: Storing of the index pulse has been started and must be done by the application. The result is expected in the inputs bIndexOccured and fIndexPosition.