top of page

Height mapping with grblHAL

  • 7 days ago
  • 4 min read

One of the challenges of using a CNC router is V Carving on an uneven surface. Often, the solution is to surface the workpiece first, but there are many cases where it is not possible. For example, carving a pattern on a handle, putting a name on a barrel stave, etching a PCB (see the end of the article for some details), or engraving on a warped or non-flat workpiece. We are V Carving some large signs on 9 mm Baltic Birch, which is not perfectly flat, and getting them to be perfectly flat on the router bed was basically impossible. But, using height mapping, it was easy to get perfect results.


Height mapping is where one uses a 3D touch probe on a workpiece to find the Z positions at a set of X, Y grid points and creates a Z height map. The height map is then used to warp the Z values of a GCode program so that the Z axis tracks the workpiece surface. Lots of CNC software supports this, but we will use ioSender and grblHAL to demonstrate it.


How do we do this? Basically, you need a 3D touch probe that you can attach to the Z Axis. There are a lot of probes for sale with prices ranging from $30 from Chinese vendors to several thousand for high-quality devices. For woodworking, the inexpensive probes will be fine. An accuracy of 0.1 mm is sufficient, and even the cheapest ones are much better than that, usually 0.01 to 0.05 mm with repeatability in a similar range. In addition, you need GCode Sender software that will run a 3D probing grid. We are using ioSender, but there are a number that you can use.


The process is as follows:

  1. Place you workpiece on the CNC router's bed.

  2. Mount your 3D probe in the spindle chuck/collet.

  3. Connect your probe wires to the CNC controller probe input and configure for your specific probe.

  4. Open the height map probing section of your GCoide sender. Set up the probing grid so it covers the area you want to engrave/etch/cut.

  5. Run the probing process. This will generate a height map file. Save the file.

  6. Apply the height map to the GCode program. This changes the Z values so that the program follows the surface of the workpiece as defined by the height map.

  7. Replace your 3D Probe with the router bit of your choice and run the modified GCode program.


The probing process is fairly simple. Once your probe is mounted, you load the GCode program and open the Height map panel in the probing section. Set the area to probe from your program, pick a grid size that reasonably covers your workpiece without being overly dense (slow), and hit start. When it completes, you will see something like the screenshot below. Save the height map; it may be useful later. Then press the Apply button. You are ready to install your router bit and start your program. Note that if you run multiple GCode files on the workpiece, each of them will need to have the height map applied. The height map is not held in the grblHAL controller, so if you exit ioSender, you will need to load the GCode program, load the height map, and apply it.


Note: Test your 3D probe before running the mapping scan. The machine will happily destroy your probe by driving into the workpiece if it doesn't see a probe signal. The ioSender probe indicator "LED" is very helpful here.



We ran several simple VCarve tests on 160 mm by 120 mm workpieces of 9 mm Baltic Birch. Here is a view of the test program.


In the first test, we mounted the workpiece and placed a 2 mm strip under the rear edge of the workpiece. I ran the height map probe process, applied the map to the test program, and ran the GCode program. Here is a photo of the results. As you can see, the long narrow boxes have uniform width, and the text looks correct.


Next, we switched out the 2 mm strip for an 8.5 mm one, reran the probing, applied the height map to the GCode program, and ran it. As you can clearly see, even though the height difference from front to back is nearly the thickness of the workpiece, the results are again correct.


For the wedding signs, the height variation was about 3 mm across a 36" width and height mapping handled it with ease. The bride and groom were super happy with results.


If you are height mapping a conductive workpiece like copper-clad FR4 for a PCB, you can use a simple conductive touch probe process. Mount the router bit you will use for etching. Using an alligator clip, connect it to the ground on your CNC controller. Then connect your workpiece surface to the probe input of your controller. When the bit touches the surface, the probe input will short to ground and the controller will see it as a touch. You can then run the height mapping process. Verify the probe connection before running the probing process since it is how the controller stops the probing operation.



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.


 
 
 

Comments


Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Facebook Classic
  • Twitter Classic
  • Google Classic
  • Wix Facebook page
  • Twitter Classic
  • Google Classic
bottom of page