Question: algorithm for Z probe

Just curious, does anyone know the algorithym used for probe zeroing?
It is extremely likely that the actual zero is between stepper motor steps. So does the software/controller store the zero as the first step that contacts the surface, or that step minus 1?

Example: the probe is sitting .0025mm above the surface. the next step down would place it .0025mm below the surface (and would register as contact). Which step would be stored as zero?


The action of probing does not set zero. The assignment of zero happens after the probe command (commonly G38.2).
In your example, it would be at contact.
I have a macro that will do a precision z probe with zero set above contact rather than below of you’re interested.

I don’t think you understood my question. I found my answer. The 38.2 stops at contact. My question was whether the Gsender algorithm would offset the 38.2 with a minimum step up before setting the zero.

Thanks for the offer but I can write my own macro.



To follow up. Examination of the gSender console history indicates the zero is stored based on the contact step.

(I didn’t have access to my machine when I posed the question)


1 Like

I did. I thought I answered it. 🤷
The default Z probe sequence sends a G10L20 after the G38.2.

Just saw this thread and wanted to respond conclusively, gSender just like any other g-code sender I know of can only know when contact is made and no sooner. So if your only options are are 0.0025mm below or above, only the one below will be detected. There isn’t an algorithm I’m aware of that could determine the material is actually between steps since what information could it draw to know that? Instead, this is a reason why it’s important to have good mechanical resolution as well as microstepping, so that when combined the probing and positioning can be as accurate as possible :+1: