Z-Mapping and Surface Probing for CNC Routing on Warped or Uneven Stock: Getting Consistent Carve Depth
This site's touch probe guide covers setting a single, accurate work-zero point before a job starts. That solves one problem — knowing exactly where Z=0 is at one location — but it doesn't solve a different one: what happens when your stock isn't actually flat across the whole cutting area. A slightly cupped board, a warped sheet of plywood that's been sitting in a humid garage, or a natural-edge slab with genuine thickness variation will all carve at inconsistent depth even with a perfectly accurate single-point zero, because the router only knows where the surface was at that one spot. Z-mapping — sometimes called surface probing or autoleveling, a term borrowed from the identical problem 3D printer bed meshing solves — measures the surface at many points across the job and adjusts the toolpath's Z height to follow it.
Why a single Z-zero isn't enough
A desktop router like the Wolfpawn 4040 Pro holds its Z axis rigid relative to the gantry, not relative to the actual surface of your stock. If you zero at the center of a board that's cupped upward at the edges by even half a millimeter, your carve will be half a millimeter too shallow at the edges — trivial for a rough cut, but immediately visible on a V-carve sign or a shallow relief where consistent depth is the entire point of the finish. The problem gets worse, not better, with wider stock and shallower carves, which is exactly the combination — signs, plaques, inlay work — that this site's Vectric Aspire and V-carve guides already spend a lot of time on.
How Z-mapping actually works
The concept mirrors 3D printer bed meshing directly: instead of trusting one Z-zero point for the entire job, a Z-probe (the same conductive touch probe or plate used for basic work-zero setting, sometimes a purpose-built continuity probe) measures surface height at a grid of points across the cutting area before the job starts. Software then builds a height map from those points and — this is the important part — adjusts the G-code's Z moves in real time as the toolpath runs, raising or lowering the bit slightly to follow the mapped surface instead of cutting to a single flat plane.
This is meaningfully different from just probing a few corners to set a tilted work plane. A true height map handles surfaces with irregular, non-planar warp — a board that's cupped in the middle but flat at the edges, for instance — not just simple tilt, which a corner-only probe correction can't capture.
Getting it working on a GRBL-based router
GRBL itself has no native height-mapping feature — this lives entirely in the sender/CAM software layer, which then streams Z-compensated G-code (or live-adjusts Z during streaming) to the controller. A few practical paths, depending on what's already in your workflow:
- bCNC and similar advanced senders include an autolevel/probe-grid feature: define a grid over your job area, run the probe sequence, and the sender applies the resulting height map to the G-code before sending it.
- Vectric's Aspire/VCarve supports importing a probed height map (via a supported probing add-on or exported grid) and can adjust toolpaths to follow it during post-processing, which fits directly into the V-carve and 3D relief workflows this site already covers for the Wolfpawn.
- Dedicated probing macros written for gSender or UGS can run a probe grid and apply a simple linear surface-tilt correction — less capable than a full height map, but enough to correct for stock that's tilted but still flat, which covers a lot of real-world warped-sheet situations without the complexity of full mesh compensation.
Whichever path you use, the probe hardware itself is the same continuity-based touch probe covered in this site's CNC touch probe guide — G38.2 probing moves, wired the same way, just run repeatedly across a grid instead of once at a single point.
Setting up a probe grid
- Choose grid density based on how much the surface actually varies — a gently cupped sheet might only need a 3×3 or 4×4 grid, while a natural-edge slab with real undulation benefits from a denser grid, at the cost of a longer probing cycle before the job even starts cutting.
- Probe at a safe, slow feed rate — surface probing doesn't need to be fast, and a slower probe feed reduces the risk of a false trigger from probe bounce or electrical noise.
- Verify the height map visually before committing to the job if your software shows one — a single bad probe point (from debris on the surface, a probe wiring issue, or the workpiece shifting mid-probe) will show up as an obvious spike or dip in the map, and running a toolpath compensated against a bad data point can cut a genuinely dangerous divot straight through your stock.
- Re-probe if you reposition the stock. A height map is only valid for the exact physical position the stock was probed in — this isn't a one-time calibration like squaring a gantry, it's per-job, per-workpiece data.
Where this matters and where it doesn't
Z-mapping earns its setup time for shallow relief carving, V-carve signs, and inlay work on real, imperfect wood stock — anything where consistent shallow depth is visually critical. It's mostly unnecessary for through-cuts (cutting all the way through the material doesn't care about small depth variation) and for machined, genuinely flat stock like MDF, acrylic, or aluminum plate, which don't warp the way solid wood and plywood do. The better first move for warped stock is often still mechanical: surfacing your spoilboard and properly flattening or shimming the stock itself, as covered in this site's spoilboard surfacing guide, before reaching for software compensation — Z-mapping corrects for warp you can't easily flatten out, not a substitute for basic setup.
Related Guides
- CNC Touch Probes for Desktop Routers: Wiring, Tool Length Offset, and Work Zero Setup
- Homing and Limit Switches for GRBL CNC Routers: Wiring, Configuration, and Safe Homing Cycles
- Build a Physical Jog Pendant for GRBL CNC Routers: Rotary Encoder, Feed Override, and Wireless Option
- gSender Complete Workflow: Connect, Zero, Run, and Recover
- Mounting a Diode Laser Module on Your CNC Router: Dual-Use Gantry Conversion
- Setting Up CNCjs on a Raspberry Pi for Web-Based CNC Control
- CNC Controller Firmware Compared: GRBL, grblHAL, Smoothieware, and Duet/RepRapFirmware
- Adding a 4th-Axis Rotary to the Wolfpawn 4040 Pro: Wiring and Your First Cut