# Question: algorithm for Z probe

**URL:** <https://forum.sienci.com/t/question-algorithm-for-z-probe/3318>\
**Category:** ❓ Question\
**Created:** [July 24, 2021, 7:09am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318 "2021-07-24T07:09:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jelanier](https://forum.sienci.com/user_avatar/forum.sienci.com/jelanier/32/1873_2.png) [@jelanier](https://forum.sienci.com/u/jelanier)\
**Post date:** [July 24, 2021, 7:09am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/1 "2021-07-24T07:09:23Z")

</div>

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?

Jim

---

<div class="post-metadata">

**Author:** ![NeilFerreri](https://forum.sienci.com/user_avatar/forum.sienci.com/neilferreri/32/1959_2.png) [@NeilFerreri](https://forum.sienci.com/u/NeilFerreri)\
**Post date:** [July 26, 2021, 2:38am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/2 "2021-07-26T02:38:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jelanier](https://forum.sienci.com/user_avatar/forum.sienci.com/jelanier/32/1873_2.png) [@jelanier](https://forum.sienci.com/u/jelanier)\
**Post date:** [July 26, 2021, 6:47am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/3 "2021-07-26T06:47:48Z")

</div>

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.

Thanks,

Jim

---

<div class="post-metadata">

**Author:** ![jelanier](https://forum.sienci.com/user_avatar/forum.sienci.com/jelanier/32/1873_2.png) [@jelanier](https://forum.sienci.com/u/jelanier)\
**Post date:** [July 26, 2021, 11:01am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/4 "2021-07-26T11:01:44Z")

</div>

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)

Jim

---

<div class="post-metadata">

**Author:** ![NeilFerreri](https://forum.sienci.com/user_avatar/forum.sienci.com/neilferreri/32/1959_2.png) [@NeilFerreri](https://forum.sienci.com/u/NeilFerreri)\
**Post date:** [July 26, 2021, 11:49am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/5 "2021-07-26T11:49:27Z")

</div>

> [@jelanier](#):
>
> I don’t think you understood my question.

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

---

<div class="post-metadata">

**Author:** ![chrismakesstuff](https://forum.sienci.com/user_avatar/forum.sienci.com/chrismakesstuff/32/10759_2.png) [@chrismakesstuff](https://forum.sienci.com/u/chrismakesstuff)\
**Post date:** [September 11, 2021, 7:47am UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/6 "2021-09-11T07:47:18Z")

</div>

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 👍

---

<div class="post-metadata">

**Author:** ![chrismakesstuff](https://forum.sienci.com/user_avatar/forum.sienci.com/chrismakesstuff/32/10759_2.png) [@chrismakesstuff](https://forum.sienci.com/u/chrismakesstuff)\
**Post date:** [June 23, 2022, 6:20pm UTC](https://forum.sienci.com/t/question-algorithm-for-z-probe/3318/7 "2022-06-23T18:20:08Z")

</div>


