Thank you for opening my question.
My printer has 4 end stop switches on the Z axis.
The Z axis end stop switches are X STOP, YSTOP, ZSTOP and also E2_STOP (exp.e2stop) on the EXPANSION pin. (X axis Y axis uses E0, E1 Stop pin)
X STOP, YSTOP and ZSTOP are working properly, but E2_STOP pin is not stable. (It turns ON or OFF even when the switch is not pressed.)
If anyone knows the solution, please let me know.
The board I'm using is Duet2wifi and I'm using firmware 3.1.1.
I have added the following Gcode
M584 X5 Y6 Z8:9:10:11 E7
M574 Z1 S1 P"!ystop+!zstop+!xstop+!exp.e2stop"
The end-stop switch utilises a simple normally-open contact switch.
(Changing to a normally-closed switch and modifying parts of the Gcode did not solve the problem. (!exp.e2stop -> exp.e2stop))
There is a tiny voltage (1.4v) coming from exp.e2stop, which we think is the cause of the malfunction. However, I do not know any means to cut off the minute voltage.