G38.2 issues

I compiled the latest from Ryan’s github along with the changes suggested elsewhere in the forum. I think just enabling G38 and #define Z_MIN_PROBE_PIN Z_MIN_PIN. It sort of works.

My goal is being able to home x/y from touching metal stock, metal brackets etc when I want. Use the endstops the rest of the time.

Machine Info: mostly stock, dual endstops, z probe is your typical metallic touch probe with an alligator clip on the bit, RAMBO board

I’m likely overlooking something dumb.


  • From a serial console if I send G38.2 X100, it'll try to move to X100 and if I touch my probe it stops. Great, that's what I expect. But the same commands from the sdcard/gcode files do nothing at all. Solved.
  • This made Home Z from the menu not work. It just keeps moving forever. Are G38.2 and G28 mutually exclusive for Z? homing x and y works normally (dual endstops)

K they do seem mutually exclusive. I commented out


To get G38.2 working. That definitely kills G28 Z for me. Enabled, it definitely kills g38.2. Did I overlook something that’d allow both to work or is that just the way it is?

I know I can do my own home with g38.2 (custom menu or just a gcode file), but that leaves the Home Z and Auto home menu items as risky clicks. Not a major deal, but I’d love to have both working.

I think the code has the concepts of probing and homing for Z somewhat confused because the notion of bed leveling for a 3D printer is sort of both probing and homing, both using the same device.

On my machine I had to disable the Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, even though I AM using the Z-min plug on the board, which was quite counter-intuitive for me. But leaving this option enabled really mixes the concepts of probing and homing. I’m guessing the primary use case is bed leveling which is why it’s not really noticed that G38.2 style probing is messed up.

I ended up using Z-max, adding an endstop and homing upward, and anyway there is always the workpiece to worry about so homing downward is not 100% safe even in ordinary use. I don’t know if it’s possible to use homing (G28) and probing (G38.2) on the same z-min pin. In principle it could be possible if you had a normally-open endstop in parallel with a touch plate operating on the same pin, but I don’t know if the software allows it.

If I followed you correctly and based on what I’m seeing, it does seem to be a software side issue. Unless I missed something. I have no idea if its intentional or a bug though. Or if I just missed a setting someplace.

If a normally open switch and the touch plate on the same circuit/pin would work, what I’m currently trying should work? (using the touch plate for both g28 and g38.x).

Setting up a zmax on a separate pin is a great idea. That’d make those clicks safe and I can do g38 in the custom menu/gcode when I need that specifically. If it doesn’t mess up g38. Testing soon!

“Should” in an abstract sense be possible. I think it is broken is the problem.

Or if you want to home z downward you can move the probe to another unused pin like x-max and then there is no conflict between G28 and G38.2 both using z-min.

Rebuilding both machines delayed me figuring this out, but you nailed it. Thanks again Jamie

The way I did it was enabling G38, and


Then I wire zmin and zmax together. So a normal g28 Z and g38.2 Z will both work on the same probe.

I’m still homing down, I just stole the zmax pin for g38 to make marlin happy.

Edge detection, here I come!