G Code and Z touch plate error

I tried this code from an old discusion.
I have added the code for the same rambo board it was written for.
I seems to work until shortly after it makes contact with the plate for the Z location.
Right after the Z moves up i get and error and the printing stops.

Not sure what is causing it. It seems to work for others in the old discusion.
I have my 2 wires connected on the rambo board just like in the diagram.
I do have the auto End stops working for the X and Y.
Like i said earlier. It touches the Plate used to set the Z value and raised up the correct distance. But then errors out.

Any ideas?

1 Like

Have you checked the value of M119? Try to test in various scenarios, like before you touch the plate, during and right after.

Does your Marlin firmware have a pullup on the Z min pin?

Ok so when I check the Z connection using M119 it shows OPEN or Triggered.
If Im just checking it with no program running it doesn’t error out.
But If I try to Home the Z and trigger the connection. It as always appears to work. M119 shows that it triggered. And the Z axis moves accordingly. But then it errors out.

M119 should show triggered when it’s touching the plate, but never when it isn’t.

The homing sequence should go down, touch the plate, stop. disconnect from the plate ( and sense open ) and then go back in and get triggered again when it touches the plate.

If it’s still sensing triggered after it lifts, then it would have a homing error.

Do you have the commentary in parentheses in the gcode? If so, remove the parentheses and everything inside and try again.

Turns out one of my Drivers was going bad. I failed while running all the test for M119 and doing my auto squaring. I replaced the bad one and everything is working now.

Thanks.

I was a work around but it must of been causing other issues with the code performance.