> ## Documentation Index
> Fetch the complete documentation index at: https://docs.almond.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# motor.set-zero-pos

> Set a motor's zero-position reference to its current mechanical position.

Sets the motor's zero-position reference to its current mechanical position (persisted to flash). Damiao motors require a power cycle afterward.

<Warning>
  Each motor's encoder zero is calibrated at one of the joint's mechanical **end stops**, **not** at the robot's rest position. In `--guided` mode the CLI drives every joint to its closer end stop and zeroes there; in single-`--id` mode you are responsible for holding the joint at the intended end stop before zeroing. `AxolArm` carries a per-joint offset so the public API stays in joint frame (`0` = rest).
</Warning>

| Flag                         | Description                                                              |
| ---------------------------- | ------------------------------------------------------------------------ |
| `--l` / `--r`                | Select the left or right arm (mutually exclusive, required)              |
| `--id ID`                    | CAN ID of the motor to zero, hex or decimal (required unless `--guided`) |
| `--type {myactuator,damiao}` | Motor type (inferred from `--id` if omitted)                             |
| `--guided`                   | Walk through every arm joint, zeroing each at its closer end stop        |

In `--guided` mode the CLI first asks you to hold **every** joint somewhere inside its operating range (away from the end stops) and press Enter **once** — it captures each joint's in-range start reference concurrently. It then walks the 7 arm joints one at a time (the gripper is auto-calibrated at runtime): for each, move it to the prompted end stop and press Enter. If the motion is in the expected direction the zero is committed immediately. If you moved the wrong way, the CLI keeps your starting reference and asks you to travel to the *other* end stop instead; pressing Enter there sets the zero. Press Ctrl-C to skip a joint.

```bash theme={null}
axol motor.set-zero-pos --l --id 0x01      # single motor
axol motor.set-zero-pos --l --guided       # all left-arm joints
```

<Note>
  After `--guided` calibration each motor's encoder zero coincides with its calibration end stop. `AxolArm` carries a per-joint offset internally so the public API (`positions`, `motion_control`, etc.) stays in joint frame (`0` = rest position). Damiao motors (`WRIST_2`, `WRIST_3`) need a power cycle for the new zero to take effect.
</Note>
