Z home not working

I have some issues with Z-homing.

I have the dual endstop FW and XY homing is working fine.

My Z switch is also working fine hardware-wise, I can verify with M119 that z_min is either “open” or “TRIGGERED” depending on whether I short it or not. But when I execute G28 Z, the Z coordinate is immediately set to 0 and the axis moves up a little, regardless of whether the tool made contact or not. At first I thought it had something to do with Marlin not wanting to move in negative coordinates (if the Z was already at 0), but If I execute G28 XY, both axis move until the endstops are triggered regardless of if they are at 0,0 already or not.

Should I change something in the FW to get it working, or does it work out of the box for everyone else? Can it have something to do with the pullup/pulldown or endstop inverting settings in Marlin (since the Z switch is NO, while XY end stops are NC)?

Using my firmware that should work. Not shorted should say open. What you are describing is what it does when it thinks it is triggered. You can check the Z probe and home logic in the firmware.

I had (or still have) similar behaviour on the Z-axis.

M119 just works fine. Had even one instance where the Z-axis didn’t stop when triggered. I was pushing it to a bad connection. (Dupont are not the first choice for the board I’m using). I wait for better plugs and redu that part of wiring and test again

That was all in Repetier Host, did not yet test with another control software.

So I was tinkering a little bit today. The moving down was definitely a bad connection. I saw some guys on YouTube connected to the casing of the router, and I I was thinking that was smart.

Well it it work sometimes but most of the times not.

The problem from the original poster I encountered before I could not reproduce while using CNC.js.


Depending on the router/spindle there could be rubber bushings on the motor bearings. This would keep the circuit from being closed if you use the motor housing. Best to alligator clip, or magnet to the collet for the motor side of the probe.

I believe my problem is caused by signal noise from the moving Z motor. It works slightly better if I connect the ground cable to the collet alligator clip and signal to the touch plate, than if I reverse them. I was also able to reach better results by setting ENDSTOP_NOISE_THRESHOLD to 2 in Configuration.h.

Anyone have any good tips on how to build a better touch plate? Mine is simply a couple of cables with alligator clips. Would adding a capacitor across the terminals help to filter the noise?

My touch plate is the blanking plate for a pci slot off the back of a PC case, and an alligator clip. They’re wired to the ramps with a wire pair out of a cat5 patch cable. I didn’t have to add anything else to it. The wire is also just long enough to reach the X20 side of my machine, so not a super long wire length.