Z Probing#

What is probing?#

Probing is the process of locating an object in space by moving the tool until contact is detected. Often the contact is detected by electrical connection between the tool and a metal probe. Some probes have sensors that are activated on physical contact.

The most common use case is to set the work Z zero to the correct height based on the top surface of the workpiece. This process has 4 steps:

  1. Place a Z probe (a metal plate) on the surface to be measured
  2. Slowly move the tool down until it touches the probe
  3. Subtract the thickness of the plate from the current position and set Z zero there
  4. Retract the tool up to free the probe

Probe thickness#

The Z probing process finds the height at the top surface of the probe plate. However the height that is being measured is at the bottom of the plate. The software needs to subtract the thickness from the detected value to compute the correct value.

Each software, be it a sender running on the PC, or an offline controller, has its own method for specifying the thickness of the probe. You need to look for it in the documentation. If you do not set this, your measurements will be consistently wrong by the same amount.

How does Z probing work? Example G-code#

Here’s an example of G-code that does that:

G21 G91
G38.2 Z-50 F100
G10 P0 L20 Z15.7
G0 Z5

G21 G91 sets the units to millimeters and the movement to relative for the rest of the commands.

G38.2 is the probing command. It will move in the specified direction until a contact is detected, or the target is reached.

Z-50 means to move 50 mm down. That’s 50 mm relative to the current position because of the G91 at the start.

F100 is the speed. Slower speed will produce more a accurate measurement.

G10 P0 L20 Z15.7 adjusts the work zero such that the provided coordinate is the current one. In our case it will make the current Z be 15.7 mm (the plate thickness), in other words the Z zero will be 15.7 mm below the current position.

Finally, a G0 Z5 command will move Z up 5 mm at top speed.

At the end, the current work Z will read 20.7 - the thickness of the plate (15.7 mm) plus the extra 5 mm because of the retraction.

Troubleshooting Z probing#

Nothing happens#

If nothing happens when you start probing, first check if the machine is at all responsive. Can it move each axis, especially Z? It is possible there is an active alarm or the machine is not in Idle state.

Another reason is if the probing distance exceeds the soft limits. The sender software should show a helpful error message. See Note on setting $132 for more details.

Tool crashes into the probe#

This means the contact was not detected. It could indicate a loose wire or another hardware issue.

Easiest way to troubleshoot is with sender software that shows the current probe state. Here’s how to see it in a few popular senders: Pin Testing

Manually create contact by touching the probe to the alligator clip or to the tool. See if the software detects the connection. If not, likely you have a hardware problem.

Tool stops before reaching the probe#

This usually means you have started probing from too far away. Each probing G38.2 command has a limit on how far it would move before giving up. The solution is to just move the spindle closer before probing. The actual distance depends on the software and could possibly be configurable.

A less likely reason is if the machine is in the wrong state. Maybe it is currently set to millimeters but the probing command assumes inches. Or maybe it is set to absolute coordinates, while the command assumes relative. See the next topic.

Tool moves up instead of down#

The most obvious reason is if the Z axis is configured to move in reverse.
Read more about it here: What if axis moves in the wrong direction

A more sneaky reason is if the software is issuing an incomplete probing command. Our G-code example above uses G91 to explicitly select relative movement. If the G91 part is not specified, and the machine is currently in “absolute coordinates” mode, the Z-50 part could be interpreted as -50 absolute height instead of -50 mm relative to the current position. Type the command G91 on the console and try probing again. If this fixes it, then it is likely a bug in the software.

Finally, reset the control box. This should clear all corrupted internal states.

Tool moves too fast going down#

Z probing is supposed to be slow to avoid damage to the probe and improve accuracy. If the spindle goes down too fast, it could be working in inches instead of millimeters - same as the previous case about absolute vs relative mode. Type the command G21 on the console and try again. Reset the control box if this doesn’t help.

Additionally, the sender software might have a configurable probing speed. Look for such a setting and decrease the number.

Discussion#

Comment Form is loading comments...

  © 2026 Ivo Beltchev cnc@ibeltchev.com