MC_Home: Home axis, set home position V4...5 (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 V4...5

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

  • Absolute encoder adjustment relative (Mode = 6)

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

  • Absolute encoder adjustment absolute (Mode = 7)

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

Requirements

  • The positioning 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, 6, 7

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

-

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.0e12 ≤ Position ≤ 1.0e12

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.

6

Absolute encoder adjustment (relative)

The current axis position is offset by the value of parameter "Position". The calculated absolute value offset is stored retentively in the CPU. (<AxisName>.StatusSensor.AbsEncoderOffset)

7

Absolute encoder adjustment (absolute)

The current axis position is set to the value of parameter "Position". The calculated absolute value offset is stored retentively in the CPU. (<AxisName>.StatusSensor.AbsEncoderOffset)

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"

Resetting the "Homed" status

The "Homed" status of a technology object (<Axis name>.StatusBits.HomingDone) is reset under the following conditions:

  • Drive connection via PTO (Pulse Train Output) :

    • Start an "MC_Home" command for active homing

      (After successful completion of the homing operation, the "Homed" status is set again.)

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

    • Changeover between automatic mode and manual control

    • After POWER OFF -> POWER ON of the CPU

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

  • Technology objects with incremental actual values:

    • Start an "MC_Home" command for active homing

      (After successful completion of the homing operation, the "Homed" status is set again.)

    • Error in the encoder system, or encoder failure

    • Restart of the technology object

    • After POWER OFF → POWER ON of the CPU

    • Memory reset

    • Modification of the encoder configuration

  • Technology objects with absolute actual values:

    • Errors in the sensor system/encoder failure

    • Replacement of the CPU

    • Modification of the encoder configuration

    • Restoration of the CPU factory settings

    • Transfer of a different project to the controller

Homing an axis

To home the axis, follow these stops:

  1. Check the requirements indicated above.

  2. Provide 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.