Skip to main content

Sensorless Homing

Sensorless Homing uses the DIAG signal from TMC drivers to detect motor stall, replacing physical endstop switches.

Prerequisites

The following conditions must all be met:

  1. The motherboard supports the DIAG function.
  2. The driver supports DIAG signal output.
  3. No device should be connected to the corresponding endstop port.
  4. The machine structure is suitable for sensorless homing, and moving parts will not be damaged when hitting the endpoints.

Motherboard Compatibility Check

TypeSupportRepresentative ModelsOperation Requirements
Class ADirectly connected by defaultSuper / Gemini / CDY / E3 seriesUse the corresponding endstop interface directly
Class BRequires jumper to enableD / C / Pro-X10 / Micro seriesMust install the DIAG jumper cap
Class CNot supportedFly-F407ZGCannot use sensorless homing

Confirmation method:

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

Class A motherboards: No DIAG jumper, directly connected to the corresponding endstop port by default.

Loading...

Class B motherboards: Requires using the DIAG jumper.

Loading...

Driver Compatibility Check

Tip

TMC5160, TMC2240, and TMC2130 typically 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 pinsSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2240SupportedDual pinsSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2130SupportedDual pinsSelect diag0_pin or diag1_pin-64-63, -64 most sensitive, 63 least sensitive
TMC2208Not supported-Cannot use sensorless homing-
TMC2660Not supported-Cannot use sensorless homing-
LV8729Not supported-Cannot use sensorless homing-

Configuration Notes

  • Configuration must 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, it needs to be changed to stepper_y.
  • On some machines, retracting during sensorless homing can cause homing failure. Set homing_retract_dist to 0.

Reference Configuration

Notes:

  • The pins below are for reference only. Modify them according to your actual motherboard.
  • diag_pin usually requires adding ^, otherwise it may cause homing failure.
  • driver_SGTHRS needs to be tested empirically. 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

Testing Safety

When testing sensorless homing, always move the print head to the center of the machine and be ready to execute an M112 emergency stop. Do not test at high speeds 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, immediately execute:

M112

In this case, check the corresponding DIAG pin wiring, jumper caps, and configuration.

Step 3: Gradually Reduce 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 at which the carriage moves smoothly to the endpoint and stops.

Step 4: Write Back to Configuration

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

If there is still significant impact noise, clicking sounds, or unreliable triggering even 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 that specific axis is not suitable for sensorless homing.

Loading...