Trouble with Z Probe and Touch Plate

Hey All,

I have run wires for ZProbe (Signal pin to plate, negative to tool) and am using a self-built touch plate with some alligator clips for the connection to a little scrap steel and the bit.

I have verified with M119 I am in the “not triggered” state natively, and when I touch my plate to my bit with all the clamps attached and run M119 I am in the “triggered” state.

If I try any combination of G28 (G28 Z or all three axis) I get weird behavior. It seems to start moving Z for a split second and then stops.

I have tried this as part of the .gcode output from Estlcam (after modifying the start and tool change areas) - I have also tried running the same .gcode from my removable media and have even tried G28 from Repetier-host and I get the same results.

This is probably unrelated, but even though I can move the Z Axis up and down just fine with the LCD and any normal .gcode on removable media, Repetier-host will only let me move Z up (+), not down (-).

It almost seems like there is some kind of hidden “Z probing cannot move Z below what it currently thinks is 0” or something else strange.

As an example, here is the excerpt GCode I was using - this results in the X and Y homing just fine using dual end stops, then Z begins to lower and stops almost instantly having traveling no where near to the full depth required to encounter the touch plate:

G91 ; Relative positioning, just in case
G92 X0 Y0 Z0 ; Set Current position to 0, all axes
G00 Z5.0000 F500 ; Raise Z 5mm at 8.3mm/s to clear clamps and screws
G28 X Y Z ; Home in order, w/zprobe

My first thought is that this is an electric noise problem. If it is a noise problem, I’ve seen it solved using hardware…typically adding a pullup resistor to the signal pin, though one person used a capacitor as mentioned below. There is also a firmware fix using ENDSTOP_NOISE_THRESHOLD. This setting is in configuration.h.

/**
 * Endstop Noise Threshold
 *
 * Enable if your probe or endstops falsely trigger due to noise.
 *
 * - Higher values may affect repeatability or accuracy of some bed probes.
 * - To fix noise install a 100nF ceramic capacitor in parallel with the switch.
 * - This feature is not required for common micro-switches mounted on PCBs
 *   based on the Makerbot design, which already have the 100nF capacitor.
 *
 * :[2,3,4,5,6,7]
 */
//#define ENDSTOP_NOISE_THRESHOLD 2

It is also possible your router is intermittently grounded, and you’ve attached the signal line to the router. Make sure the signal line goes to the plate, not the router.

Finally, we’ve seen some strangeness associated with the SKR Pro board. If you have this board, and your issue is this problem, it can be solved by either cutting the power to the LED that comes on when an endstop is triggered, or by adding a pullup resistor to the signal ine.

1 Like

I am using the RAMBo board - but a few follow-up questions:

  1. Would the noise you are referencing only be experienced if the router was plugged in? I am seeing this behavior even when the router is not plugged in - I am normally connecting the router (Dewalt) to a variable speed controller and then to the wall. During these recent tests, the router was not plugged into anything.

  2. I retested and cannot get M119 to EVER show anything other than open, but I might just not be able to catch it in the act. I have also noticed that “G28 Z” from Repetier-host actually just raises the Z axis slightly (~1mm) and then stops. I have also noticed that in Repetier-host I can manually move up several times (with any increment) but can only move down a single time, the next several Z-commands are just ignored. Is that behavior even related or just confusing things?

I should also clarify I am not holding or touching anything during these tests (some folks had issues if they were holding their touch plate or touching the bit to their skin).

The maddening thing is how reliably I can get M119 to show open vs. triggered exactly as expected when testing manually - just bonkers behavior when using G28.

There have been a few forum post where homing (router not running) have resulted in a failure like yours, but it is rare, and it doesn’t mean it is your problem.

I have also noticed that “G28 Z” from Repetier-host actually just raises the Z axis slightly (~1mm) and then stops.

This is the behavior if Marlin thinks the touch plate is triggered. The 1mm movement is the retest sequence. If you unplugged both endstop switches from any axis, you’d see the exact same 1mm “wrong” movement if you tried to home that axis.

I am using the RAMPS board

Are you using the V1 firmware? If not, you need to make sure you have this line set correctly in configuration.h:

#define Z_MIN_ENDSTOP_INVERTING true 

I retested and cannot get M119 to EVER show anything other than open,

If you connect the clip directly to the plate, and you are not seeing triggered, then you need to start there. It should report triggered every time you send an M119. It is not checking for the transition, it is checking the current state as read by Marlin.


Check the voltage between the touch plate and the clip. It should be near 5V, though, with a consistent reading of 3V or above, the logic should still work.

Repetier-host

I don’t know why you would be getting the wierd behavior from Repetier-Host but I no idea how it might be related to your homing issue. You should be able to solve the homing issue without Repetier-Host and then address additional issues.

1 Like

I may be onto something, you tell me:

  1. Thanks for the note about the 1mm Z-UP being the retest sequence. Thank makes a lot of sense.

  2. Yes, I am using the V1 Firmware with no modifications (I read it was ready for Touch Probe OOTB).

  3. I should clarify that I CAN get the M119 to show triggered when I am intentionally touching the bit to the plate - what I meant was that I can’t ever get it to show anything other than open when nothing is touching and I am just re-testing over and over and over again looking for a false positive as I see when I send the G28. (cannot reproduce the trigger except when using G28)

  4. I checked the voltage and with my meter I get 4.91V after powering on and testing between touch plate and bit. After I begin to move Z (up or down) the voltage drops to 4.65V and stays there until I disable steppers which raises it back to 4.91V. This seems to match my experience where the M119 gives me the expected results, but it is also not being tested while Z is in motion. I did verify that M119 behaves as I expect with both 4.91V and 4.65V (before and after moving Z). I also verified that M119 gives me the expected results even if i swap the plate and clip from the SPin and a NegativePin. I also verified that in all of these scenarios the G28 still does not work as expected (almost immediate trigger and vertical travel).

Is there any good way to test for noise? On the ENDSTOP_NOISE_THRESHOLD are you suggesting I compile my own custom version of the firmware with that one additional setting?

The hardware test seems like an easy one, but I am only a little EE-savy - a 100nf ceramic capacitor is easy enough to get my hands on - not sure about the pullup resistor (specs?). If I attempted the resistor or capacitor, could you help me understand exactly where to add it in-line? Just anywhere in the path between the board SPin and the touch plate?

I checked the voltage and with my meter I get 4.91V

Marlin cares about the pin being HIGH or LOW. The transition is around 2.5V. All your voltage readings are way above 2.5V, so there is no problem with the internal pullup resistor on the Mega board.

what I meant was that I can’t ever get it to show anything other than open when nothing is touching

I’m guessing that most voltmeters do a small amount of averaging with their readings, making it unlikely that you could ever see a transient problem.

Is there any good way to test for noise?

I’m just a hobbyist with electronics, but I suspect someone with more knowledge would use an oscilloscope and look at the wave form. I know that’s not helpful in your situation.

are you suggesting I compile my own custom version of the firmware with that one additional setting?

Yes. It is a bit of work, but Ryan does a good job of documenting the process using PlatformIO.

could you help me understand exactly where to add it in-line?

The capacitor would bridge between the signal pin and ground pin. The resistor would bridge between the + and the signal pins. Any resistor in the range of 1K to 10K could be used. Neither goes “in-line.” Given your voltage readings, to me, the resistor is less likely to address your problem. You want to be careful installing either solution. The Ramps boards don’t have any protection on these pins, so if you manage to short the + pin to ground, it is likely you will take out the voltage regulator or blow a fuse on the Mega board.

When I first read your question, I assumed from your description that you were getting some downward movement before it stops. If all you are seeing is the wrong-way-retest movement, then noise is less likely. Are you sure you are connected to the minZ endstop pin? If you are not connected to the router and touch the clip to the plate by hand, do you still have the problem? Typically, with noise, there is inconsistent results where it will move/descend different distances before stopping. If all you are seeing is an immediate stop with a retest movement, then we should look deeper before tackling any noise solutions.

Well Robert - you have been a huge help.

After your last reply I realized I was not truly sure I wasn’t occasionally seeing some downward traveling before the retest sequence - so I felt like noise could still be an issue.

I also didn’t like what I was hearing RE: the pullup resister or capacitor installation relative to the firmware configuration change for ENDSTOP_NOISE_THRESHOLD.

I went ahead and made the edit to firmware and flashed and now I have 100% success with the homing operation.

Part of me wants to either know why this was required (something I could have done differently with cable routing etc) or know why this config change isn’t part of the default firmware we are all encouraged to flash - seems like it would do more good than harm (several other forum posts who went through the same process) - there are enough things that can go wrong with the touch probe setup that it would be nice if noise could be tossed out from the beginning.

Thanks again!

This setting makes Z homing a bit less accurate. The higher the setting, the more inaccurate it becomes. And based on my following this forum, noise issues are extremely uncommon. Usually, problems like yours are traces to wiring issues.

Part of me wants to either know why this was required

I would want to know also. Someone with some formal EE training and the right tools could probably spot the root cause quickly, but someone with that training would not have come to the forum for help in the first place, so we would not see a post explaining what he found. There are topics that discuss shielding. Also, if you really wanted to spend some time exploring an issue, wire up a second touch plate and run that wire on a different path to see if you have the same problem.

A quick way to test wiring interference without an scope etc… disconnect the probe wires and use a jumper to trigger the Rambo z probe pin directly. For stock mpcnc, pin to 5v is not triggered, pin to ground is triggered. Be ready so it doesn’t crash. If it works like that, you are likely dealing with bad endstop wiring. If not, it’s likely firmware.

If it’s firmware, I’d guess soft limits may be at play.