Does Klipper homing happen in the Firmware or the Host?

Unlike Marlin and most traditional printer firmwares, homing in Klipper is orchestrated by the host, not by the microcontroller firmware. This follows Klipper’s general architecture: the Python host code (klippy/) handles kinematics, motion planning and all G-code-level behavior, while the MCU firmware only executes precisely-timed step commands it has been instructed to generate.

How it works

The relevant code lives in the host-side klippy package:

  • klippy/extras/homing.py implements homing_move(), which drives the actual homing sequence: it moves the toolhead toward the endstop, handles retract and second-probe speeds, and settles on the final position.
  • klippy/extras/endstop.py provides the MCU_endstop object, which registers the endstop pin with the MCU and subscribes to a trsync trigger. When the pin fires, the MCU reports the exact step clock time at which it triggered, and the host converts that back into a real axis position.
  • On the MCU side, src/stepper.c and the trsync mechanism only do one thing: watch the pin and timestamp the event. All sequencing decisions — move direction, speeds, retries, multi-endstop squaring (e.g. dual Z) — are made in Python on the host.
  • G28 itself is just a host-side G-code command/macro (see klippy/extras/homing_override.py for the classic homing_override / G28 override mechanism), so even the entry point to homing never touches firmware-specific code.

Consequences

Because homing is a host-driven sequence of moves, it depends on live host↔MCU communication:

  • A communication hiccup during a homing move aborts the move — this is why you see Communication timeout during homing errors when the USB/UART link to the MCU is flaky.
  • Homing features that would require firmware changes in other ecosystems — sensorless homing thresholds, homing_positive_dir, homing_retract_dist, multi-MCU endstop synchronization — are all just config options parsed on the host. No firmware reflash needed.
  • The MCU gains no real autonomy: if the host goes away mid-print or mid-home, the MCU simply stops receiving step commands and eventually shuts down.

In short: the MCU detects the endstop event with tight timing, but homing is a host algorithm. Klipper’s firmware is deliberately a dumb, deterministic step executor.

See the Klipper homing configuration reference for the available homing_* parameters.


Check out similar posts by category: 3D Printing Klipper