3D printer homing failed? Find the cause: endstop, sensorless or Z homing
By Sina Esfahani, OmniTechs · Published 27 November 2026
Homing tells the printer where it is. Each axis drives towards a reference until a sensor fires: a switch, an optical gate, a motor stall sensed by the driver, a bed probe, or the nozzle touching the bed. A homing error means that sensor did not fire when it should have, or fired too early.
Watch one attempt before you change anything. An axis that runs into the frame or the wrong way points to a sensor that never triggered or a motor turning backwards. An axis that stops short points to a sensor that already reads triggered, or to electrical noise. A Z axis that stops halfway or dives points to the probe or the nozzle sensor. Then test the sensor by hand: that one check settles most cases.
Fix it in this order:
Watch which axis fails and how: it runs into the frame, moves away from its switch, stops short, or Z stops halfway or dives.
Clear the path: no print left on the plate, the plate seated the right way round, nothing on the rails, belts or Z rods.
Test the sensor: send M119 (Marlin) or QUERY_ENDSTOPS (Klipper); a switch reads open when free and TRIGGERED while you hold it.
If a reading is inverted or never changes, fix the setting or the wiring; switch the printer off and unplug it before you touch a connector.
If the axis moves away from its switch, invert the motor direction (INVERT_X_DIR in Marlin, ! on dir_pin in Klipper), not the home direction.
On sensorless axes, retune the stall sensitivity with homing_retract_dist: 0 (Klipper) or a bump distance of 0 (Marlin).
On a Bambu Lab printer, let the nozzle cool, clean its tip, check the hotend screws and the Z path, then follow the HMS code.
Read the failure first
Homing failures, what they mean and what to do
| What you see | What it means | What to do |
|---|---|---|
| The axis grinds against the frame; Marlin: Homing Failed, PRINTER HALTED; Klipper: No trigger on x after full movement | No trigger during the whole move | Test the switch; check connector, pin and home direction |
| The axis moves away from the switch, then halts | The motor turns the wrong way | Invert the motor direction |
| The axis moves a few millimetres and stops as if homed; Klipper: Endstop x still triggered after retract | The switch already reads triggered: inverted setting, broken wire or stuck switch | Fix the setting or wiring until the free switch reads open |
| The axis stops short or at a different place each time | Electrical noise, or sensorless sensitivity too high | Reroute the endstop cable; lower the sensitivity |
| The nozzle dives into the bed when Z homes | The probe did not trigger, is past the bed edge or has the wrong offset sign | Test the probe by hand; use safe Z homing |
| Bambu Lab: Homing Z axis failed (0300-4000) | The nozzle did not sense the bed, or the bed could not rise to it | See the Bambu Lab section |
| Prusa: Homing error Z or X (for example #31301) | Loadcell, a stuck axis, belt or pulley | See the Prusa section |
Marlin's halt is deliberate: VALIDATE_HOMING_ENDSTOPS, on by default, stops the printer to protect the frame when an endstop is unplugged. M999 does not clear it; reset or power-cycle.
Test the endstop by hand before you home again
Move every axis by hand so that no switch is pressed; send M84 first if the motors hold.
Send M119 on Marlin or QUERY_ENDSTOPS on Klipper. Every line should read open.
Hold one switch closed, or block an optical gate, and send it again. That line, and only that line, should read TRIGGERED. For a BLTouch push its pin up; for an inductive probe hold steel under it.
Repeat for each axis.
What the result means (Marlin, Klipper):
Reversed (TRIGGERED when free, open when pressed): on Marlin, flip X_MIN_ENDSTOP_HIT_STATE (X_MIN_ENDSTOP_INVERTING before Marlin 2.1.3) for that switch and reflash; on Klipper, add or remove the ! in endstop_pin, for example ^!PA2.
Never changes: the switch is on the wrong connector, unplugged or broken. On Klipper the pin may also need the ^ pull-up that most printers use.
Sensorless axes and a BLTouch send only a short pulse, so M119 cannot test them; a BLTouch that reads TRIGGERED is in its error state.
Before you reseat a connector, switch the printer off and unplug it: Prusa's handbook says never to disconnect electrical parts while the printer is on. Marlin recommends normally closed switches because a broken cable then reads as triggered and the axis stops instead of crashing. The flip side is the "stops as if homed" row above.
Wrong direction, a crash, or a home that stops short
In Marlin, X_HOME_DIR says where the switch is (-1 for the low end, 1 for the high end); INVERT_X_DIR says which way the motor turns. Jog with G91 and then G1 X10: a positive move must go away from a switch at the low end. If it goes towards it, change INVERT_X_DIR, not X_HOME_DIR. In Klipper, STEPPER_BUZZ STEPPER=stepper_x moves the axis 1 mm positive and back, ten times; if it goes the wrong way, add or remove the ! on dir_pin.
Keep a hand on the power switch for the first home after any change to endstops, drivers, motor wiring or home direction (Marlin); Klipper says to remove power if the printer does not home properly. A motor that does not turn at all is covered in motor not moving or turning the wrong way.
A switch that fires too early is usually noise from heaters, motors and their cables. Marlin's fixes, in order: route the endstop cable away from motor and heater cables, shielded or twisted; fit a 100 nF ceramic capacitor across a bare mechanical switch (boards on the common Makerbot design have one); only then try ENDSTOP_NOISE_THRESHOLD (2 to 7), which can cost repeatability.
If the switch tests fine and homing still wanders, look at the mechanics. On the 3D Printing Stack Exchange, an Ender 3 V2 owner whose printer seemed to ignore its Z switch found the lead screw slipping in a loose motor coupler. Check couplers, grub screws and belt tension before you blame the electronics.
A typical endstop switch varies by about 0.1 mm from one home to the next, enough to show in a first layer (Klipper). Klipper's [endstop_phase] option reads the motor phase from a TMC driver to tighten that.
Sensorless homing: tune it once, properly
On TMC drivers with StallGuard (TMC2209, TMC2130, TMC5160 and others), the driver senses the motor stall when the carriage hits the end and signals it on its DIAG pin. That needs UART or SPI wiring and the DIAG pin connected; it works best at medium motor speed and varies with load, current and motor temperature. For Z it is generally not accurate enough for a consistent first layer (Klipper).
The Klipper procedure, for a TMC2209 on X:
Set homing_speed to about rotation_distance divided by two, so the motor turns once every two seconds: 20 mm/s for a rotation_distance of 40.
Set homing_retract_dist: 0 and remove any hold_current from the driver section.
With the carriage in the middle, send SET_TMC_FIELD STEPPER=stepper_x FIELD=SGTHRS VALUE=255 (most sensitive), then G28 X0. The axis should barely move; if it keeps going, send M112 and check the DIAG wiring and pin.
Lower VALUE step by step, carriage back in the middle each time, until it travels to the end and stops: your maximum sensitivity.
Keep lowering until it still homes with a single touch, without banging: your minimum sensitivity.
Set driver_SGTHRS to the minimum plus a third of the difference, rounded, and wait 2 seconds between attempts so the stall flag clears.
Worked example. The carriage first homes cleanly at 120 and still homes with one touch at 75. The setting becomes 75 + (120 - 75) / 3 = 90. Klipper warns that a gap below about 5 makes homing unstable; a faster homing speed can widen it. Tune again after changing driver current, homing speed or hardware.
On Marlin, enable SENSORLESS_HOMING, set X_STALL_SENSITIVITY, tune with M914 and save with M500: 0 to 255 on a TMC2209 (255 most sensitive), -64 to +63 on a TMC2130 (-64 most sensitive), bump distance 0. On CoreXY, home one axis, move it off the end and wait 2 seconds before homing the other (Klipper).
Chris Riley sets up sensorless homing on a CoreXY Klipper printer; the link starts at his calibration chapter.
Z homing with a probe
A probe only triggers over the bed. Marlin's Z_SAFE_HOMING moves the probe, not the nozzle, to a safe point (the bed centre by default) before Z homes, and reports Z Probe Past Bed if it cannot get there. In Klipper you set endstop_pin: probe:z_virtual_endstop, leave out position_endstop, and give [safe_z_home] a home_xy_position.
If the nozzle dives, the probe did not trigger: trigger it by hand and watch z_probe in M119. On Marlin, M851 Z must be negative for a probe that triggers below the nozzle. With a plain Z switch, Klipper's example configs set position_endstop to 0.5 so the nozzle stops just above the bed. BLTouch and CR Touch faults have their own guide: BLTouch and CR Touch offsets and failures.
Bambu Lab: "Homing Z axis failed"
X1 and P1 series. Z homes by sensing the force when the nozzle touches the plate, so it needs a clean nozzle tip and a rigid plate. Bambu Lab's HMS pages list the causes: a bulge on the plate or filament on the nozzle tip; something under the Z sliders or on the Z belt pulleys, or a Z bearing pushed out of place; the bed touching the excess chute at the back (keep at least 2 mm of gap); a tight heatbed cable, a wrong screw in the AMS hub, or an unsteady table.
Let the nozzle cool to room temperature, pick filament off the tip with tweezers, check the two hotend screws, then tap Home again; the error clears after a successful home. On Bambu Lab's forum, the most-liked replies about this error on a P1S were simpler still: a plate seated backwards, a print left on the plate, or purged filament on a Z rod.
PlasmaDave shows how he tracked down and fixed a Z homing failure on a P1S that appeared after filament purging.
A1 and A1 mini. An eddy current sensor above the hotend detects the nozzle touching the bed, and Z homing waits until the nozzle is at 140 °C or below. Bambu Lab's A1 guide matches behaviour to cause:
Descends a little and stops (HMS_0300-1800-0001-0004): no sensor signal; check its cable on the TH board.
Low sensitivity or no hotend (0300-1800-0001-0002 or -0001): reseat the hotend; its top cooling fin must not be bent down.
Drops fast, then rises (0300-1800-0001-0005): the Z motor is stuck; remove leftover prints, clean and lubricate the lead screw rails.
Dozens of touches on one spot: dirty nozzle, loose hotend (tighten it once cold) or a shaky table.
Touches in mid-air: firmware 1.03 or later, and no sharp bends in the PTFE tubes on the filament hub.
Do not remove the black tape over the sensor coil; Bambu Lab warns the coil can break. Power off and unplug the printer before you open covers or reseat cables: Bambu Lab warns that work on powered electronics can cause a short circuit.
Prusa MK4, MK4S and CORE One
Z (#31301 on the CORE One, #26301 on the MK4S, "Failed to home the extruder in Z-axis"): make sure the extruder is not pulling filament or a PTFE tube down; unwind the spool a little to test. On the CORE One, lower the bed, open the trapezoid nuts and check they run freely, and lubricate the Z lead screws. If that fails, Prusa's loadcell troubleshooting is next.
X (#26304 on the MK4S): look for filament around the belt or a rod, check the belt tension, and make sure one pulley set screw sits on the flat of the motor shaft. Prusa also asks you to check that the motor connectors in the xBuddy box are tight and not swapped; switch off and unplug first.
When to stop and replace a part
A switch or cable that still reads wrong after the settings and connectors are right: replace it.
On Bambu Lab printers, a faulty sensor, a broken screw on the TH board or a visibly bent lead screw: Bambu Lab asks you to contact support, with a video of the homing.
A Prusa loadcell that fails its test: follow Prusa's loadcell article or contact support.
Never switch off the checks to silence the error. VALIDATE_HOMING_ENDSTOPS protects the frame when an endstop is unplugged, and software endstops keep later moves inside the axis limits (Marlin).
Next step and related guides
Once the printer homes, check where X0 Y0 really lands with print not centred and home offsets. A wrong first layer after a good home is a Z offset matter: set the Z offset. Lost steps in the middle of a print are a different fault: layer shifting causes and fixes.

