GreatLight CNC Machining Factory logo
CNC Machining
Rapid Prototyping
Materials
Industries
News
About GL

Get Instant Quote

CNC setup fundamentals

How Does a CNC Machine Know Z 0?

A CNC machine has no eyes. It only knows where Z 0 is because someone, a probe, or a fixture told it. This guide breaks down the five setup methods we use daily, the errors each one hides, and how to pick the right one for your part.

Touch probe setup±0.005 mm tolerance127 CNC machinesISO 9001:2015
how does a cnc machine know z 0
Quick answers

Key takeaways

Z 0 is a stored numberThe controller holds a work offset value; it never measures the part by itself.
Touch probe wins on repeatabilityProbing the same face twice typically repeats within a few microns.
A 0.01 mm Z error is realOn a 50 mm deep pocket, that shifts the floor by 0.02% of the cut depth.
G54 is not permanentEvery tool change, fixture swap, or thermal drift can move the effective zero.
How the controller thinks

How a CNC machine know Z 0 from numbers, not vision

A CNC controller is blind. It tracks axis position with a servo encoder or glass scale, and it trusts a single work offset number stored in the control. That number is what defines where Z 0 sits in machine coordinates. When a program calls G54 and then G0 Z0, the machine rapids to that stored value. It does not check whether the part is actually there.

So the real question behind a cnc machine know z 0 is not mechanical. It is a measuring problem. Something must establish the distance between the machine's reference point and the physical surface you call zero. That something is either a human with a tool, a probe on the spindle, or a fixture that was measured once and repeated.

GreatLight runs 127 high-precision CNC machines across three plants, including 16 simultaneous 5-axis machining centers. Every one of them depends on the same principle: the offset is only as good as the measurement that created it. If the measurement is sloppy, the machine will cut exactly where you told it, which is exactly wrong.

This matters most on closed-tolerance work. Our standard machining window is ±0.005 mm, and parts for aerospace, medical, and automotive customers often run tighter than that on critical features. At that scale, Z zero setup is not a warm-up task. It is the first quality gate of the run.

Where Z 0 can live

Choosing the right Z 0 reference for your part

There is no rule that says Z 0 must be the top face of the stock. The correct reference is the surface that matters most to the part's function, or the surface that your fixture can hold repeatably. Those two are not always the same, and picking wrong costs you setup time on every run.

For a plate with a critical top face, zero on the top face. For a part that sits in a vise on its base, zero on the vise bed or a gauge block, then record the stock height as a known offset. For a second-op part with a machined datum, zero on the datum, not the raw casting skin. Raw castings vary by 0.3 to 1.0 mm, and zeroing on them pushes that variation straight into your depth.

In 5-axis work the reference gets more abstract. The rotary table has its own center point, and Z 0 is usually tied to the table surface or a known gauge height rather than the part itself. If the part is mounted off-center, the CAM programmer needs that offset in the model, not just in the machine.

Whichever reference you choose, write it on the setup sheet. The next operator who loads the job should not have to guess. A one-line note like 'Z0 = top of stock, gauge block 50.00 mm' has saved more setups than any probe.

  • 1
    Top of stockSimple, but the top face must be clean and flat before you touch off.
  • 2
    Machined datumBest for second ops and castings where raw surfaces vary.
  • 3
    Vise bed or gauge blockRepeatable across parts, needs a recorded stock height.
  • 4
    Rotary table centerStandard for 5-axis, requires accurate workholding position.
Failure modes

When Z 0 goes wrong: symptoms and fixes

The most common symptom is a consistent depth error across every feature on the part. If a 10 mm pocket comes out 10.15 mm deep on all four corners, the zero is off, not the tool. Re-probe the reference face and check the offset value against the setup sheet before touching the program.

A second symptom is a depth error that changes from part to part. That usually points to workholding, not the offset. Chips under the part, uneven clamp torque, or a soft jaw that has worn can all shift the effective zero by 0.05 mm or more between cycles. Clean the nest, re-torque to spec, and measure the first three parts.

A third symptom is a crash on the first rapid move. This almost always means the offset was entered with the wrong sign or in the wrong unit. A Z value of -50.00 instead of 50.00 sends the tool straight into the stock. Always dry-run the first approach and keep the rapid plane at least 10 mm above the highest feature until you trust the setup.

Thermal drift is the quiet one. A spindle that has been running for two hours grows, and a machine in a warm shop can move its effective zero by 0.01-0.03 mm over a shift. On long runs, re-probe once mid-shift and log the value. If it has moved, you have a real reason to adjust, not a guess.

In our shop

How we keep Z 0 consistent across 127 machines

We standardize the setup sheet, not the operator. Every job carries a written Z 0 reference, the gauge or probe method used, and the expected offset value. An operator moving from a 3-axis mill to one of our 16 simultaneous 5-axis centers reads the same sheet format. That alone removes most cross-machine variation.

For tight-tolerance work we default to spindle-mounted touch probes and verify with a second touch. For long runs we probe a fixture datum once per shift and record the number. We also track scrap and rework by setup error, so a method that looks fine on paper but produces rework gets reviewed.

Our quality system is ISO 9001:2015, IATF 16949:2016, ISO 13485:2016, and ISO 27001:2022. Setup verification is part of the in-process monitoring step, alongside raw material checks and final inspection. Every shipment gets 100% inspection, and inspection reports are available on request.

Setup procedure

How to set Z 0: five methods step by step

  • 1
    1. Touch off with a gauge blockLoad the tool, jog down in 0.01 mm increments until the block drags, then subtract the block height from the machine Z reading and enter it in G54. Use a 50.00 mm block for rough work and a 100.00 mm block when you need clearance. Wipe the block and the part first; a chip under either one is a 0.05 mm error waiting to happen.
  • 2
    2. Touch off with a dial indicatorZero the indicator on a known surface, then sweep the part face. This catches a tilted or bowed face that a single-point touch misses. Keep sweep speed under 200 mm/min and watch the needle, not the screen. A 0.02 mm TIR across the face means you should re-clamp before cutting.
  • 3
    3. Use a spindle-mounted touch probeCall the probe cycle, touch the face three times, and let the control average the result. Typical repeatability on a clean machined face is 2-5 μm. Probe the face, not a burr or a chamfer, and stay at least 5 mm in from any edge. This is the method we use by default for parts with ±0.005 mm tolerance.
  • 4
    4. Use a tool setter or presetterMeasure each tool's length offline on a presetter, then load the values into the tool offset table. This removes operator-to-operator variation and is worth the setup time on runs above 50 parts. Verify the first tool with a probe or indicator before trusting the whole table.
  • 5
    5. Use a hard stop or fixture datumFor high-volume runs, machine a datum shoulder into the fixture and probe that shoulder once per shift, not once per part. The part seats against the same stop every cycle, so Z 0 stays put. This is how we hold consistency across long production runs without re-probing every piece.
  • 6
    6. Verify before you cut metalAfter any method, run the program in air with a 5-10 mm Z offset, or dry-run the first tool path above the stock. Watch the distance-to-go readout. If the first approach looks wrong, it is wrong. Fixing it now costs a minute; fixing it after the first plunge costs a tool and a part.
Method comparison

Z 0 setup methods compared

Repeatability figures reflect clean, machined surfaces and normal shop conditions.

MethodTypical repeatabilityBest forMain risk
Gauge block touch-off±0.02–0.05 mmOne-off parts, rough setupsChip or burr under the block
Dial indicator sweep±0.01 mmChecking face flatnessOperator feel and needle reading
Touch probe±0.002–0.005 mmTight-tolerance productionContaminated or angled face
Tool setter / presetter±0.005 mmRuns above 50 partsWrong tool loaded into wrong offset
Fixture datum stop±0.005 mmHigh-volume repeat runsFixture wear over time
FAQs

Frequently asked questions

Can Z 0 be set automatically for every part?

Not every part, but most machined faces can be probed automatically. The exceptions are raw castings, rough saw-cut stock, and parts with no clean reference surface. Those still need a manual touch or a fixture datum.

If the face is machined and clean, a probe cycle will typically repeat within 2-5 μm, which is tighter than most manual methods.

How often should Z 0 be re-checked during a production run?

For short runs under 50 parts, once at setup is usually enough if the fixture is rigid. For longer runs, probe a fixture datum once per shift and log the value.

If the spindle has been running for hours, or the shop temperature swings, check mid-shift as well. A 0.01-0.03 mm drift over a shift is normal and worth catching early.

What happens if Z 0 is set incorrectly?

A small error shifts every depth on the part by the same amount. A 0.05 mm error on a 10 mm pocket is usually caught by inspection, but it may still fail a tolerance callout on a critical face.

A large error, or one with the wrong sign, causes a crash. The tool drives into the stock or the fixture, which can break the tool, damage the holder, and scrap the part.

Does Z 0 apply to 3D printing and other processes?

The idea is the same, but the mechanics differ. A 3D printer zeroes its build plate with a sensor or a manual shim, and the first layer height is the equivalent of Z 0.

For CNC machining, vacuum casting, and die casting, the reference is tied to the mold or fixture. The common thread is that the process needs a known surface to start from.

Can Z 0 be set to a surface other than the top of the part?

Yes, and often it should be. Second-op parts are usually zeroed on a machined datum, and 5-axis work is often zeroed on the rotary table surface.

What matters is that the chosen surface is repeatable and that the setup sheet records it. Zeroing on a raw casting skin pushes the casting variation into your depth of cut.

How do you handle Z 0 for parts up to 4,000 mm long?

Long parts need a reference that does not move with the stock. We machine a datum into the fixture, probe it at the start of the run, and keep the rapid plane clear of the whole part.

On a 4,000 mm part, a small angular tilt in the stock can create a large apparent Z error at the far end. Leveling the stock before clamping matters as much as the probe itself.

Send us your part and we will set it up right

Upload a drawing and get a quotation with free DFM analysis within 12 hours. No minimum order quantity, from one prototype to 10,000+ part runs.

12-hour quote100% inspectionNDA on request±0.005 mm tolerance

Follow our work

More from the shop floor

We publish setup notes, tooling trials and inspection data from the factory floor.

FacebookTikTokYouTubeLinkedInInstagramThreadsPinterest

Trusted by engineers and manufacturers worldwide

Tesla Ford Motor Company BYD Auto Denso Magna International Boeing Airbus Medtronic KUKA FANUC