Endstop Related
Microswitch Endstop
Three-wire Microswitch Endstop Notes
Note
- FLY motherboard users please note: Three-wire microswitch endstop cannot be directly connected to the FLY motherboard, because the endstop interface on the motherboard already provides 5V power. Direct connection will cause a 5V short circuit, burning out the motherboard, host computer, and driver devices!
- Solution
- Cut the 5V wire: Cut the 5V wire (usually red wire, subject to actual color) in the
XH2.54
terminal of the three-wire endstop switch and wrap it with insulating tape to prevent short circuits.
- Cut the 5V wire: Cut the 5V wire (usually red wire, subject to actual color) in the
Microswitch Endstop Wiring Method
Notes
- Strongly recommended: Use the normally closed (NC) contact (to prevent collision accidents caused by broken wires)
- Wiring requirements:
Motherboard Terminal | Function | Connection Requirements |
---|---|---|
5V | Power | 🔌 Left unconnected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |
- Testing steps:
-
Set multimeter to continuity test mode (with buzzer icon)
-
Test the microswitch:
- Not pressed: Continuity between NC and common terminal should exist (buzzer sounds)
- Pressed: Continuity between NC and common terminal should be interrupted (no sound)
-
If results are reversed:
- Check if normally open (NO) contact was mistakenly used
- Check for poor contact
Configuration Notes
-
Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor,
^
symbol must be added before the pin
- Most printers require enabling the pull-up resistor,
-
Normally closed (NC) endstop configuration:
- When using NC endstop,
!
symbol must be added
- When using NC endstop,
-
Below is a reference configuration
[stepper_x]
ndstop_pin: ^!PD9
TAP
Wiring Instructions
Note
- This tutorial uses the
BL-Touch
interface ofSHT36-V2
for demonstration - Some
TAP
devices support12V
or24V
, but5V
is recommended for safety - The middle signal pin of
BL-Touch
cannot be used as an endstop pin!!!
::|
Motherboard Terminal | Function | Connection Requirements |
---|---|---|
5V | Power | ✅ Must be connected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |

Reference Configuration
- Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor, must add
^
symbol before the pin
[stepper_z]
endstop_pin: probe:z_virtual_endstop
# endstop_pin: ^sht36:PA1
# position_endstop: -0.5
[probe]
pin: ^sht36:PC15 # Signal interface
x_offset: 0 # X-axis - sensor offset relative to nozzle
y_offset: 0 # Y-axis - sensor offset relative to nozzle
#z_offset: 0 # Z-axis - sensor offset relative to nozzle
speed: 3.0 # Leveling speed
lift_speed: 5 # Probe lifting speed
samples: 3 # Sampling count
samples_result: median # Value selection method (default median)
sample_retract_dist: 3.0 # Leveling retraction distance
samples_tolerance: 0.075 # Sampling tolerance (note that too small a value may increase sampling count)
samples_tolerance_retries: 3 # Over-tolerance retry count
activate_gcode:
{% set PROBE_TEMP = 150 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}
{% if TARGET_TEMP > PROBE_TEMP %}
{ action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
M106 S255
M109 S{ PROBE_TEMP }
M106 S26
{% else %}
# Temperature target is already low enough, but nozzle may still be too hot.
{% if ACTUAL_TEMP > MAX_TEMP %}
{ action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
{% endif %}
{% endif %}
Optical Endstop
Note
- This tutorial uses
5V
to power the optical endstop - For voltages exceeding
5V
, use12V
or24V
, refer to the proximity switch tutorial below
Wiring Instructions
Motherboard Terminal | Function | Connection Requirements |
---|---|---|
5V | Power | ✅ Must be connected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |
Configuration Notes
-
Pull-up resistor requirement:
-
Most printers require enabling the pull-up resistor, must add
^
symbol before the pin -
Below is a reference configuration
[stepper_x]
ndstop_pin: ^PD9
Proximity Switch
Important Note
- Taking Omron proximity switch
TL-Q5MC2-Z
as example, please note before operation: - Sensor type: PNP normally closed switch
- Required component: Must purchase
BAT85
diode separately
Wiring Steps
- Diode Installation
- Connect the black end (cathode) of the diode to the sensor signal wire
- Connect the other end (anode) to the motherboard signal interface
- Insulation Treatment
- Strongly recommend using heat shrink tubing or electrical tape to wrap exposed wire ends to prevent short circuits caused by contact with other devices
Reference Configuration
- Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor, must add
^
symbol before the pin - Below is a reference configuration
[probe]
pin: ^PC0
x_offset: 0
y_offset: 25.0
z_offset: 0
klicky
- Updating
Sensorless Endstop Setup
Prerequisites
- All of the following conditions must be met:
- The motherboard supports the
DIAG
function - The driver supports
DIAG
signal output - The corresponding endstop port must not be connected to any device!
Motherboard Compatibility Check
Fly Motherboard Support Classification:
Type | Support Status | Representative Models | Operation Requirements |
---|---|---|---|
A-type | Direct connection by default | Super/Gemini/CDY/E3 series | ✅ Use endstop interface directly |
B-type | Requires jumper to enable | D/C/Pro-X10/Micro series | ⚡ Must install DIAG jumper cap |
C-type | Not supported at all | Fly-F407ZG | ❌ Cannot use sensorless endstop function |
Identification method:
- Check motherboard markings: Look for a
DIAG
jumper seat- Refer to the schematic: Confirm
DIAG
signal connection of the driver interface- On most motherboards, sensorless endstop corresponds drive0 to io0, drive1 to io1, and so on
|
|
Driver Compatibility Check
Tip
TMC5160
,TMC2240
andTMC2130
have twoDIAG
pins- Product documentation or customer service must be consulted to confirm
Driver Model | Compatibility | DIAG Pin | Configuration Requirements | Sensitivity Requirements |
---|---|---|---|---|
TMC2209 | ✅ Supported | Single pin | Direct use | 0-255 # 255 is the most sensitive value, 0 is the least sensitive |
TMC5160 | ✅ Supported | Dual pins | Need to select diag pin | -64 -255 # -64 is the most sensitive value, 63 is the least sensitive |
TMC2240 | ✅ Supported | Dual pins | Need to select diag pin | -64 -255 # -64 is the most sensitive value, 63 is the least sensitive |
TMC2130 | ✅ Supported | Dual pins | Need to select diag pin | -64 -255 # -64 is the most sensitive value, 63 is the least sensitive |
TMC2208 | ❌ Not supported | - | Cannot use sensorless endstop function | Cannot use sensorless endstop function |
TMC2660 | ❌ Not supported | - | Cannot use sensorless endstop function | Cannot use sensorless endstop function |
LV8729 | ❌ Not supported | - | Cannot use sensorless endstop function | Cannot use sensorless endstop function |
Identification Points:
- Dual-pin drivers must consult the corresponding manual to confirm function pins
- Some drivers themselves support the
DIAG
function, but cannot be used if the corresponding pin header is not soldered
Configuration Notes
- The corresponding driver model and axis need to be modified
- Some machines using sensorless homing may fail to home due to retraction, set
homing_retract_dist:
to0
Reference Configuration
- In
tmc2209_stepper_x
,TMC2209
needs to be changed to the corresponding driver model - In
stepper_x
, thex
indicates this is thex
axis. If it's they
axis, change tostepper_y
- TMC2209 Reference Configuration
- TMC5160 Reference Configuration
- TMC2130 Reference Configuration
- TMC2240 Reference Configuration
- Note that the pins in the configuration below are only for reference, actual usage may vary
diag_pin:
must include^
, otherwise homing will fail- The value in
driver_SGTHRS:
needs to be tested and set, 255 is the most sensitive value, 0 is the least sensitive[stepper_x]
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 0
[tmc2209 stepper_x]
diag_pin: ^PD9
driver_SGTHRS: 100
- Note that the pins in the configuration below are only for reference, actual usage may vary
- Consult the corresponding product manual to determine whether to use
diag0_pin:
ordiag1_pin:
diag1_pin:
must include^!
, otherwise homing will fail- The value in
driver_SGT:
needs to be tested and set, -64 is the most sensitive value, 63 is the least sensitive[stepper_y]
endstop_pin: tmc5160_stepper_y:virtual_endstop
position_endstop: 0
[tmc5160 stepper_y]
diag1_pin: ^!PD9
driver_SGT: 1
- Note that the pins in the configuration below are only for reference, actual usage may vary
- Consult the corresponding product manual to determine whether to use
diag0_pin:
ordiag1_pin:
diag1_pin:
must include^!
, otherwise homing will fail- The value in
driver_SGT:
needs to be tested and set, -64 is the most sensitive value, 63 is the least sensitive[stepper_y]
endstop_pin: tmc2130_stepper_y:virtual_endstop
position_endstop: 0
[tmc2130 stepper_y]
diag1_pin: ^!PD9
driver_SGT: 1
- Note that the pins in the configuration below are only for reference, actual usage may vary
- Consult the corresponding product manual to determine whether to use
diag0_pin:
ordiag1_pin:
diag1_pin:
must include^!
, otherwise homing will fail- The value in
driver_SGT:
needs to be tested and set, -64 is the most sensitive value, 63 is the least sensitive[stepper_x]
endstop_pin: tmc2240_stepper_x:virtual_endstop
position_endstop: 0
[tmc2240 stepper_x]
diag1_pin: ^!PD9
driver_SGT: 1
Test Sensitivity
-
Step 1
-
Enter the following command in the web console
-
Slowly move the print head to the center of the machine. Use the
SET_TMC_FIELD
command to set sensitivity -
For
TMC2209
, use the command below, modify the axis you are testingSET_TMC_FIELD STEPPER=stepper_x FIELD=SGTHRS VALUE=255
-
For
TMC5160
,TMC2240
andTMC2130
, use the command below, modify the axis you are testingSET_TMC_FIELD STEPPER=stepper_x FIELD=sgt VALUE=-64
-
-
Step 2
- Enter the following command in the web console
G28 X
- Confirm that the X-axis does not move at all or stops moving quickly.
- If no movement notification is received, immediately issue the following command
M112
- Check that the wiring or configuration of the corresponding
DIAG PIN
pin may be incorrect and must be corrected before proceeding.
- Enter the following command in the web console
-
Step 3
- Next, continuously reduce the sensitivity setting of
VALUE
and rerun theSET_TMC_FIELD
andG28 X0
commands - Find the highest sensitivity value that allows the carriage to successfully move all the way to the end point and stop
- For TMC2209 drivers, the adjustment is to reduce SGTHRS, for other drivers, the adjustment is to increase sgt
- Next, continuously reduce the sensitivity setting of
-
Step 4
- After testing to the appropriate value, remember the current value when it stops immediately after homing
- If there is a collision or clicking sound at maximum sensitivity, the homing speed may be too low, the driver current may be too low, or the axis may not be suitable for sensorless homing.
- Open
printer.cfg
and update the corresponding sensitivity configuration
Endstop Status Check
- Updating
Loading...