MC_Home: Home axis, set home position V1...3 (S7-1200) - Motion Control

S7-1200 Motion Control (S7-1200)

ft:publication_title
S7-1200 Motion Control (S7-1200)
Product
Motion Control
Version
V20
Publication date
11/2024
Language
en-US
MC_Home: Home axis, set home position V1...3

Description

Motion Control instruction "MC_Home" is used to match the axis coordinates to the real, physical drive position. Homing is required for absolute positioning of the axis. The following types of homing can be executed:

  • Active homing (Mode = 3)

    The homing procedure is executed automatically.

  • Passive homing (Mode = 2)

    During passive homing, the "MC_Home" Motion Control instruction does not carry out any homing motion. The traversing motion required for this must be implemented by the user via other Motion Control instructions. When the homing switch is detected, the axis is homed.

  • Direct homing absolute (Mode = 0)

    The current axis position is set to the value of parameter "Position".

  • Direct homing relative (Mode = 1)

    The current axis position is offset by the value of parameter "Position".

Requirements

  • The axis technology object has been configured correctly.

  • The axis is enabled.

  • No MC_CommandTable command may be active upon start with Mode = 0, 1, or 2.

Override response

The override response depends on the selected mode:

Mode  = 0, 1

The MC_Home command cannot be aborted by any other Motion Control command.

The MC_Home command does not abort any active Motion Control commands. Position-related motion commands are resumed after homing according to the new homing position (value at input parameter: "Position").

Mode  = 2

The MC_Home command can be aborted by the following Motion Control commands:

  • MC_Home command Mode = 2, 3

The new MC_Home command aborts the following active Motion Control command:

  • MC_Home command Mode = 2

Position-related motion commands are resumed after homing according to the new homing position (value at input parameter: "Position").

Mode  = 3

The MC_Home command can be aborted by the following Motion Control commands:

  • MC_Home command Mode = 3

  • MC_Halt command

  • MC_MoveAbsolute command

  • MC_MoveRelative command

  • MC_MoveVelocity command

  • MC_MoveJog command

  • MC_CommandTable command

The new MC_Home command aborts the following active Motion Control commands:

  • MC_Home command Mode = 2, 3

  • MC_Halt command

  • MC_MoveAbsolute command

  • MC_MoveRelative command

  • MC_MoveVelocity command

  • MC_MoveJog command

  • MC_CommandTable command

Parameters

Parameter

Declaration

Data type

Default value

Description

Axis

INPUT

TO_Axis_1

-

Axis technology object

Execute

INPUT

BOOL

FALSE

Start of the command with a positive edge

Position

INPUT

REAL

0.0

  • Mode = 0, 2, and 3

    Absolute position of axis after completion of the homing operation

  • Mode = 1

    Correction value for the current axis position

Limit values:

-1.0E+12 ≤ Position ≤ 1.0E+12

Mode

INPUT

INT

0

Homing mode

0

Direct homing absolute

New axis position is the position value of parameter "Position".

1

Direct homing relative

New axis position is the current axis position + position value of parameter "Position".

2

Passive homing

Homing according to the axis configuration. Following homing, the value of parameter "Position" is set as the new axis position.

3

Active homing

Homing procedure in accordance with the axis configuration. Following homing, the value of parameter "Position" is set as the new axis position.

Done

OUTPUT

BOOL

FALSE

TRUE

Command completed

Busy

OUTPUT

BOOL

FALSE

TRUE

The command is being executed

CommandAborted

OUTPUT

BOOL

FALSE

TRUE

During execution, the command was aborted by another command.

Error

OUTPUT

BOOL

FALSE

TRUE

An error occurred during execution of the command. The cause of the error can be found in parameters "ErrorID" and "ErrorInfo".

ErrorID

OUTPUT

WORD

16#0000

Error ID for parameter "Error"

ErrorInfo

OUTPUT

WORD

16#0000

Error info ID for parameter "ErrorID"

Note

Axis homing is lost under the following conditions:

  • Disabling of axis by the "MC_Power" Motion Control instruction

  • Changeover between automatic mode and manual control

  • Upon start of active homing. After successful completion of the homing operation, axis homing is again available.

  • After POWER OFF -> POWER ON of the CPU

  • After CPU restart (RUN-STOP -> STOP-RUN)

Homing an axis

To home the axis, follow these stops:

  1. Check the requirements indicated above.

  2. Initialize the necessary input parameters with values, and start the homing operation with a rising edge at input parameter "Execute"

  3. If output parameter "Done" and technology object tag <Axis name>.StatusBits.HomingDone indicate the value TRUE, homing is complete.