---
tag: m0422
title: Set Z Motor XY
brief: Set a Z motor position for G34 Auto-Alignment
author: shitcreek
contrib: thinkyhead

requires: Z_STEPPER_AUTO_ALIGN
since: 2.0.4
experimental: true
group: calibration

codes: [ M422 ]
related: [ G34 ]

notes:
  - See [`G34`](/docs/gcode/G034-zsaa.html) for further details about Z-Stepper automatic alignment.
  - Requires `Z_STEPPER_AUTO_ALIGN`.
  - '`M422 W` requires `Z_STEPPER_ALIGN_STEPPER_XY`.'

parameters:
  -
    tag: R
    optional: true
    description: Reset alignment and known points to the defaults. This will also be done by [`M502`](/docs/gcode/M502.html).
    values:
      -
        type: flag
  -
    tag: S
    optional: true
    description: One-based index of a Z-Stepper whose probing-point will be set.
    values:
      -
        tag: index
        type: int
  -
    tag: W
    optional: true
    requires: Z_STEPPER_ALIGN_STEPPER_XY
    description: One-based index of a Z-Stepper whose known position will be set.
    values:
      -
        tag: index
        type: int
  -
    tag: X
    optional: true
    description: X position
    values:
      -
        tag: linear
        type: float
  -
    tag: Y
    optional: true
    description: Y position
    values:
      -
        tag: linear
        type: float

videos:
  - 6UgT9YqY3UA

examples:
  -
    pre: Set a probe position for aligning the first Z stepper
    code:
      - M422 S1 X10 Y10
  -
    pre: Set a known position for the second Z stepper
    code:
      - M422 W2 X10 Y10
---

Set an XY probe or known position for a given Z Stepper. Either the `S` or `W` parameter must be given, along with `X` and `Y` positions. The `W` parameter exists only when `Z_STEPPER_ALIGN_STEPPER_XY` is defined, providing known stepper positions.
