Skip to main content

Sensorless Homing

Sensorless homing uses the TMC driver's DIAG signal to detect motor stall, replacing physical limit switches.

Prerequisites

All of the following conditions must be met:

  1. The motherboard supports the DIAG function.
  2. The driver supports DIAG signal output.
  3. The corresponding limit switch port must not have any device connected.
  4. The machine structure is suitable for sensorless homing, and moving parts will not be damaged when hitting the end stops.

Motherboard Compatibility Check

TypeSupport StatusRepresentative ModelsOperation Requirements
Class ADefault Direct ConnectionSuper / Gemini / CDY / E3 SeriesUse the corresponding limit switch interface directly
Class BRequires Jumper to EnableD / C / Pro-X10 / Micro SeriesMust install DIAG jumper cap
Class CNot SupportedFly-F407ZGCannot use sensorless homing function

Confirmation Method:

  1. Check if the motherboard has a jumper socket labeled DIAG.
  2. Refer to the schematic to confirm if the DIAG signal from the driver interface is connected to the limit switch port.
  3. For most motherboards, Drive0 corresponds to io0, Drive1 corresponds to io1, and so on.

Class A Motherboards: No DIAG jumper, default direct connection to the corresponding limit switch port.

Loading...

Class B Motherboards: DIAG jumper required.

Loading...

Driver Compatibility Check

Tip

TMC5160, TMC2240, and TMC2130 usually have two DIAG pins. Please refer to the corresponding product documentation or consult customer service to confirm which pin to use.

Driver ModelCompatibilityDIAG PinConfiguration RequirementSensitivity Range
TMC2209SupportedSingle PinUse diag_pin directly0-255, 255 most sensitive, 0 least sensitive
TMC5160SupportedDual PinSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2240SupportedDual PinSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2130SupportedDual PinSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2208Not Supported-Cannot use sensorless homing function-
TMC2660Not Supported-Cannot use sensorless homing function-
LV8729Not Supported-Cannot use sensorless homing function-

Configuration Instructions

  • Configuration needs to be modified according to the actual driver model and axis name.
  • tmc2209 in tmc2209_stepper_x needs to be changed to the corresponding driver model.
  • x in stepper_x represents the X axis. If configuring the Y axis, change it to stepper_y.
  • On some machines, retraction during sensorless homing may cause homing to fail. Set homing_retract_dist to 0.

Reference Configuration

Notes:

  • The pins below are for reference only; modify according to your actual motherboard.
  • diag_pin usually requires adding ^, otherwise, homing may fail.
  • driver_SGTHRS needs to be tested in practice; 255 is most sensitive, 0 is least sensitive.
printer.cfg
[stepper_x]
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 0
homing_retract_dist: 0

[tmc2209 stepper_x]
diag_pin: ^PD9
driver_SGTHRS: 100

Testing Sensitivity

Test Safety

When testing sensorless homing, the print head must be moved to the center of the machine, and be prepared to execute M112 emergency stop at any time. Do not test at high speed or unattended.

Step 1: Set Maximum Sensitivity

TMC2209:

SET_TMC_FIELD STEPPER=stepper_x FIELD=SGTHRS VALUE=255

TMC5160 / TMC2240 / TMC2130:

SET_TMC_FIELD STEPPER=stepper_x FIELD=sgt VALUE=-64

Step 2: Perform Single Axis Homing

G28 X

If the axis does not start moving, moves abnormally, or cannot stop, execute immediately:

M112

At this point, check the corresponding DIAG pin wiring, jumper cap, and configuration.

Step 3: Gradually Decrease Sensitivity

  • TMC2209: Gradually decrease SGTHRS.
  • TMC5160 / TMC2240 / TMC2130: Gradually increase sgt.
  • After each adjustment, re-execute SET_TMC_FIELD and the single-axis homing test.

The goal is to find the highest reliable sensitivity that allows the carriage to move steadily to the end stop and stop.

Step 4: Write Back Configuration

After finding the appropriate value through testing, write it back to the corresponding driver configuration in printer.cfg.

If there is still a noticeable impact sound, clicking sound, or unstable triggering at maximum sensitivity, it usually indicates that the homing speed is too low, the driver current is too low, there is abnormal mechanical resistance, or the axis is unsuitable for sensorless homing.

Loading...