top of page

A probing yet touching question

I see a lot of questions about probing. There seems to be a belief that it requires special software support in the G code sender. The reality is that for a touch probe, all you need is to be able to send GCode to the controller. And, if your favorite GCoide sender has macro capabilities, then you can put it all in a macro called "probe".

What the heck is probing, anyway?

In the simplest terms, it is a way to find top of a workpiece on your CNC machine. Most Grbl controller breakout boards have an input pin called Probe. This is basically a normally open switch. The simplest probe is called a Touch Probe. It is a metal plate and one half of the switch. The other half is something metal and conductive in the spindle/router chuck - like a router bit. The plate is connected to the probe input pin and the router bit is connect to ground. Touching the bit to the plate closes the circuit and Grbl sees the connection. So, another way to answer the question, probing is just flipping a switch.

How does Grbl use the probe input?

Grbl implements the GCode Straight Probe function, G38. This function uses the Probe input pin and looks for a connection (or disconnection). There are several sub functions of G38 - G38.2 through G38.5. They differ in the direction they move and whether they signal an error. For our purposes, we will only look at G38.2.

G38.2 Z-20 F50 

This causes the Z axis to move down at the rate of 50mm per minute until one of two things happens.

  1. The probe input signal occurs (ie, the Probe input pin is connected to ground).

  2. Z has moved 20mm and no probe signal happened. An error is raised.

In either case, the Z axis movement stops. In first case, the value of Z represents the top of the probe plate. If we know the thickness of the plate, we can set Z to that value. This means that Z=0 is at what ever the probe plate was sitting on. Lets say the plate thickness was 6mm. Then we would want to set Z to 6mm. This can be done via the G92 function, Coordinate System Offset.

Note that the distance Z is allowed to travel and the Feed Rate are your choice. You should experiment with different values to see what works for you. You will want to keep the Feed Rate fairly low to avoid stress on the bit and bearings of the router/spindle.

G92 Z6.0

If you remove the probe plate and jog Z lower by 6mm, the bit will be touching what ever the plate was sitting on.

Now, if you don't want to remember all that, you can make a simple macro. Name it ProbeZ and add the two above lines. Be sure to measure the thickness of your probe plate and use that in place of 6.0.

G38.2 Z-20 F50
G92 Z6.0
G0 Z20

The third line raises the Z axis so you can easily remove the probe plate.

One word of caution, always test your probe to make sure it is working before running your macro. You can lift the plate and touch the router bit. Some GCode Senders show the state of the probe pin and some fancier probes have built in LEDs that help you see if it is working.

So, How do I use this?

Probing is a simple process.

  1. Put a metal bit in the spindle and connect it to ground.

  2. Mount your workpiece and position the probe plate on it and make sure it is connected to the probe input pin.

  3. Position the bit less than 20mm above the probe plate.

  4. Run the macro (or type in the two commands).

  5. Remove the probe plate.

Your Z is properly zeroed.

What about other axes?

G38.2 works with any axes. For example, you can probe X and Y to find a corner. You will need to take into account the radius of your bit. This can get fairly complex so you might want to use a GCode Sender that has probing support. Interestingly, every GCode Sender that supports probing, use G38.

Other kinds of probes

There are a lot of different probe devices out there. One is called a Tool Setter (or Tool Height Setter or Tool Length Setter). This allows the machine to determine the offset distance for each tool that a job uses and adapt Z to always have to bit's tip at the correct height. This is another case where you will want a GCode Sender with probe support.

Another type is the 3D probe. This it constructed differently from a touch probe in that it contains the switch and works in 3 dimensions. A common use of a 3D probe is to create height map of a workpiece for adapting GCode to an uneven surface. It is also useful for corner and center finding.

Make your own Touch Probe

A touch probe is very easy to make. It consists of a metal plate with a known/measured thickness and a way to attach a wire. The wire is connected to the probe input pin on the controller. In addition, a second wire that connects to the router bit in the spindle and the ground on the controller. If you have grounded your router's frame, your bit may already be connected to ground. You can test this with a multimeter. If you don't have ground, you can use an alligator clip on the bit and connect it to a ground pin on the controller. I have used double sided PCB material (AKA Copper Clad FR4) for the plate but any flat uniform piece of metal will work.

If you don't have a caliper gauge (AKA Digital Micrometer), you can still measure the thickness of the plate with your machine using the paper method.

  1. Chuck a bit in your spindle.

  2. Place the paper under the bit and lower Z using the smallest step size until the you can't move the paper.

  3. Set Z to 0.

  4. Raise Z enough to slide the probe plate under it.

  5. Place the paper on top of the probe plate.

  6. Lower Z using the smallest increment until you can't move the paper.

The Z value is the height of you probe plate.

About Me.

I'm Phil Barrett, a long time CNC enthusiast. I run a small company, Brookwood Design, that makes several breakout boards for grblHAL and love to help people get the most out of their CNC machines.


Joseph Farrugia
Joseph Farrugia
Dec 05, 2023

Thank you for your speedy reply.

Let us assume one needs to cut to the left of the following lines using a 6mm bit with the following Gcode:

G1 X00 Y00

G1 X10 Y05

G1 X05 Y07

It is pretty easy to get to the initial point. But how do you determine where to stop as you cut up along the line to ensure that you don't overcut into the second line? The only thing that comes to mind is to simulate the situation in Autocad by drawing the 2 lines, then draw a 6mm circle which touches the 2 lines tangentially and then pick up the centre point.

Phil Barrett
Phil Barrett
Dec 05, 2023
Replying to

Yes, as long as you specify the tool correctly. Diameter/radius is an obviously important one but the angle of a Vbit is on that is over looked. You can make (or get) a set of test vectors to determine the actual angle of a Vbit. F360 has a very good tool path creation section (Manufacturing). For a lot of stuff, it is overkill. Modern CAMs go to a lot of effort get exact cutting - a complex GCode operation like VCarving is quite precise since any errors become glaringly obvious.


Joseph Farrugia
Joseph Farrugia
Dec 04, 2023


Sorry for using this post to place a query on an unrelated topic. But I could not find a way to ask for advice directly. I am new to CNC and an slowly learning the techniques using Iosender and grblHAL installed on a STM32 board.

My question concerns cutter radius compensation. Currently grblHAL does not interpret G41 and G42 commands. Yet taking into consideration the cutter diameter is extremely important. It seems fairly complex to handle manually for anything except very simple cuts.

It seems that a post processor is necessary to alter the code to take this into consideration.

I am surprised that this topic is hardly ever discussed and there seems to be no real solutions currently.

Phil Barrett
Phil Barrett
Dec 04, 2023
Replying to

Cutter compensation is for production line stuff - where the machine operator is separate from the gcode designer. This allows the operator to take into account smaller/worn tools on the fly rather than stopping the production line and going back to have the designer make changes to the gcode. So, when you make your GCode (via CAM software), make sure that you have the right diameter/radius for your bits and all will be fine. For what it is worth, in the hobby world, cutter compensation is pretty much unused.

Featured Posts
Recent Posts
Search By Tags
No tags yet.
Follow Us
  • Facebook Classic
  • Twitter Classic
  • Google Classic
bottom of page