Limit Switches
Microswitch Limit
Important Notes for Three-Wire Microswitch Limit
Information
- FLY motherboard users please note: Three-wire microswitch limit switches cannot be directly connected to the FLY motherboard, as the limit switch interface on the motherboard already provides a 5V power supply. Direct connection will cause a 5V short circuit, potentially damaging the motherboard, host computer, and drivers!
- Solution
- Cut the 5V wire: Cut the 5V wire (usually red, but verify by actual color) in the
XH2.54connector of the three-wire limit switch and insulate it with electrical tape to prevent short circuits.
- Cut the 5V wire: Cut the 5V wire (usually red, but verify by actual color) in the
Wiring Method for Microswitch Limit
Note
- Highly recommended: Use the normally closed (NC) contact (to prevent collisions in case of a broken wire)
- Wiring requirements:
| Motherboard Terminal | Function | Connection Requirement |
|---|---|---|
5V | Power | 🔌 Not connected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |
- Testing steps:
-
Set the multimeter to continuity test mode (beeper icon)
-
Test the microswitch:
- Not pressed: Continuity between NC and common terminal (beeper sounds)
- Pressed: No continuity between NC and common terminal (no sound)
-
If the result is reversed:
- Check if the normally open (NO) contact was mistakenly used
- Check for poor contact

Configuration Instructions
-
Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor; the
^symbol must be added before the pin
- Most printers require enabling the pull-up resistor; the
-
Normally closed (NC) limit configuration:
- When using a NC limit switch, the
!symbol must be added
- When using a NC limit switch, the
-
Below is a sample configuration
[stepper_x]
endstop_pin: ^!PD9
TAP
Wiring Instructions
Information
- This tutorial uses the
BL-Touchinterface ofSHT36-V2for demonstration - Some
TAPdevices support12Vor24V, but using5Vis recommended (for safety) - The middle signal pin of the
BL-Touchcannot be used as a limit switch input!!!
| Motherboard Terminal | Function | Connection Requirement |
|---|---|---|
5V | Power | ✅ Must be connected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |

Sample Configuration
- Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor; the
^symbol must be added 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 lift speed
samples: 3 # Number of samples
samples_result: median # Value selection method (default: median)
sample_retract_dist: 3.0 # Retraction distance during leveling
samples_tolerance: 0.075 # Sampling tolerance (note: too small a value may increase sampling attempts)
samples_tolerance_retries: 3 # Number of retries when exceeding tolerance
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 Limit Switch
Information
- This tutorial uses
5Vto power the optical limit switch - For voltages exceeding
5V, use12Vor24V; refer to the proximity switch tutorial below
Wiring Instructions
| Motherboard Terminal | Function | Connection Requirement |
|---|---|---|
5V | Power | ✅ Must be connected |
GND | Ground | ✅ Must be connected |
S | Signal | ✅ Must be connected |
Configuration Instructions
-
Pull-up resistor requirement:
-
Most printers require enabling the pull-up resistor; the
^symbol must be added before the pin -
Below is a sample configuration
[stepper_x]
endstop_pin: ^PD9
Proximity Switch
Important Information
- Using Omron proximity switch
TL-Q5MC2-Zas an example, please note before operating: - Sensor type: PNP Normally Closed Switch
- Required component: You must purchase a
BAT85diode
Wiring Steps
- Diode Installation
- Connect the black end of the diode (cathode) to the sensor signal wire
- Connect the other end (anode) to the motherboard signal interface
- Insulation
- It is highly recommended to cover exposed wire ends with heat shrink tubing or electrical tape to prevent short circuits with other devices

Sample Configuration
- Pull-up resistor requirement:
- Most printers require enabling the pull-up resistor; the
^symbol must be added before the pin - Below is a sample configuration
[probe]
pin: ^PC0
x_offset: 0
y_offset: 25.0
z_offset: 0
klicky
- Updating in progress
Sensorless Homing
Prerequisites
- All of the following must be satisfied:
- The motherboard supports
DIAGfunctionality - The driver supports
DIAGsignal output - No device must be connected to the corresponding limit switch port!
Motherboard Compatibility Check
Classification of Fly Motherboards:
| Type | Support Status | Representative Models | Operation Requirements |
|---|---|---|---|
| A | Directly supported by default | Super/Gemini/CDY/E3 Series | ✅ Use the limit switch interface directly |
| B | Requires jumper to enable | D/C/Pro-X10/Micro Series | ⚡ Must install DIAG jumper |
| C | Not supported at all | Fly-F407ZG | ❌ Cannot use sensorless homing |
How to confirm:
- Check motherboard markings: Look for a jumper labeled
DIAG- Review the schematic: Confirm the
DIAGsignal connection on the driver interface- On most motherboards, sensorless homing uses
Drive0forio0,Drive1forio1, and so on
|
|
Driver Compatibility Check
Tip
TMC5160,TMC2240, andTMC2130have twoDIAGpins- Refer to the product documentation or contact customer service to confirm the correct pin
| Driver Model | Compatibility | DIAG Pins | Configuration Requirements | Sensitivity Range |
|---|---|---|---|---|
| TMC2209 | ✅ Supported | Single pin | Directly usable | 0-255 # 255 is the most sensitive, 0 is the least |
| TMC5160 | ✅ Supported | Dual pins | Must select the diag pin | -64-255 # -64 is the most sensitive, 63 is the least |
| TMC2240 | ✅ Supported | Dual pins | Must select the diag pin | -64-255 # -64 is the most sensitive, 63 is the least |
| TMC2130 | ✅ Supported | Dual pins | Must select the diag pin | -64-255 # -64 is the most sensitive, 63 is the least |
| TMC2208 | ❌ Not supported | - | Sensorless homing not available | Sensorless homing not available |
| TMC2660 | ❌ Not supported | - | Sensorless homing not available | Sensorless homing not available |
| LV8729 | ❌ Not supported | - | Sensorless homing not available | Sensorless homing not available |
Identification Tips:
- Dual-pin drivers must refer to the manual to confirm the function of each pin
- Some drivers support
DIAGbut may not be usable if the corresponding pin header is not soldered
Configuration Instructions
- The corresponding driver model and axis must be modified
- Some machines may fail to home when retracting during sensorless homing; set
homing_retract_dist:to0
Sample Configurations
- The
TMC2209intmc2209_stepper_xmust be changed to the actual driver model - The
xinstepper_xindicates this is thexaxis; for theyaxis, change tostepper_y
- TMC2209 Sample Configuration
- TMC5160 Sample Configuration
- TMC2130 Sample Configuration
- TMC2240 Sample Configuration
- Note: The pins in the configuration below are examples only; use actual pins
diag_pin:must include^, or homing will fail- The value in
driver_SGTHRS:must be tested and set manually; 255 is the most sensitive, 0 is the least[stepper_x]
endstop_pin: tmc2209_stepper_x:virtual_endstop
position_endstop: 0
[tmc2209 stepper_x]
diag_pin: ^PD9
driver_SGTHRS: 100
- Note: The pins in the configuration below are examples only; use actual pins
- Refer to the product manual to determine whether to use
diag0_pin:ordiag1_pin: diag1_pin:must include^!, or homing will fail- The value in
driver_SGT:must be tested and set manually; -64 is the most sensitive, 63 is the least[stepper_y]
endstop_pin: tmc5160_stepper_y:virtual_endstop
position_endstop: 0
[tmc5160 stepper_y]
diag1_pin: ^!PD9
driver_SGT: 1
- Note: The pins in the configuration below are examples only; use actual pins
- Refer to the product manual to determine whether to use
diag0_pin:ordiag1_pin: diag1_pin:must include^!, or homing will fail- The value in
driver_SGT:must be tested and set manually; -64 is the most sensitive, 63 is the least[stepper_y]
endstop_pin: tmc2130_stepper_y:virtual_endstop
position_endstop: 0
[tmc2130 stepper_y]
diag1_pin: ^!PD9
driver_SGT: 1
- Note: The pins in the configuration below are examples only; use actual pins
- Refer to the product manual to determine whether to use
diag0_pin:ordiag1_pin: diag1_pin:must include^!, or homing will fail- The value in
driver_SGT:must be tested and set manually; -64 is the most sensitive, 63 is the least[stepper_x]
endstop_pin: tmc2240_stepper_x:virtual_endstop
position_endstop: 0
[tmc2240 stepper_x]
diag1_pin: ^!PD9
driver_SGT: 1
Testing 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_FIELDcommand to set the sensitivity -
For
TMC2209, use the command below and change the axis being testedSET_TMC_FIELD STEPPER=stepper_x FIELD=SGTHRS VALUE=255 -
For
TMC5160,TMC2240, andTMC2130, use the command below and change the axis being testedSET_TMC_FIELD STEPPER=stepper_x FIELD=sgt VALUE=-64
-
-
Step 2
- Enter the following command in the web console
G28 X - Ensure the X-axis does not move at all or stops moving immediately.
- If no movement is detected, immediately issue the following command
M112 - Check the wiring or configuration of the corresponding
DIAG PINas there may be an error; correct it before proceeding.
- Enter the following command in the web console
-
Step 3
- Next, gradually decrease the
VALUEsensitivity setting and run theSET_TMC_FIELDandG28 X0commands again - Find the highest sensitivity at which the carriage successfully moves all the way to the end and stops
- For TMC2209 drivers, decrease SGTHRS; for other drivers, increase sgt
- Next, gradually decrease the
-
Step 4
- Once a suitable value is found, remember the value when the carriage stops immediately after homing
- If there is impact or clicking sound at maximum sensitivity, the homing speed might be too low, the driver current might be too low, or the axis may not be suitable for sensorless homing.
- Open
printer.cfgand update the sensitivity setting accordingly
Limit Switch Status Check
- Updating in progress
Loading...
