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

Get Instant Quote

Setup guide

How Does a CNC Machine Know Z0?

The control does not sense the part. It stores a number you give it, then counts down from that number for every depth of cut. This guide explains how a cnc machine know z0 is established on a mill, how to verify it before the first cut, and which mistakes scrap parts.

±0.005 mm16 five-axis centers12-hour quote3-5 day shipping
how does a cnc machine know z0
Quick answer

Key takeaways

Z0 is a stored numberThe control keeps a work offset, usually G54, that tells it where the part top sits in machine coordinates.
Three ways to find itManual touch-off, offline tool setting on a presetter, or an in-machine probe routine. Each has a different error budget.
The tool length is separateWork offset locates the part. Tool length offset locates the tip. Mixing them up is the classic crash.
Verify before cuttingRun the first Z move in single block at 5-10% rapid with the spindle stopped and watch the distance-to-go.
The basic idea

What the control actually stores when you set Z0

A CNC machine has no idea where your part is. Its axes run on encoder counts measured from a home switch, so machine coordinate Z0 sits at the reference return position, often the top of the column travel. When you touch a tool to the top of a block and press zero, you are not teaching the machine anything about geometry. You are writing one number into a work offset register, typically G54 through G59.

That number is the distance from machine Z0 down to the surface you touched. From then on, every Z word in the program is measured from it. A command of Z-2.0 means 2 mm below whatever surface you stored. If the stored number is off by 0.2 mm, every pocket in the job is off by 0.2 mm, and no amount of cutter compensation will fix it.

This is why how a cnc machine know z0 is really a question about your setup discipline, not about the control. The controller is exact to the encoder count. The uncertainty lives in the moment of contact between a spinning or stationary tool tip and a real surface that may be saw-cut, scaly, or not flat.

Keep the two offsets clearly separated in your head. The work offset answers where is the part. The tool length offset answers how long is this tool. Both must be correct before the first Z move, and each has its own measuring method.

  • 1
    Work offset (G54)Locates the part surface in machine coordinates.
  • 2
    Tool length offset (H)Locates the tip of each tool relative to the gauge line.
  • 3
    Wear offsetSmall correction after the first part is measured.
Method 1

Manual touch-off with a feeler gauge or paper

The oldest method still works. Load the tool, jog it down in 0.01 mm steps until a 0.05 mm feeler gauge or a sheet of paper just drags between the tip and the part. Then subtract the thickness. With paper, that is roughly 0.08-0.10 mm depending on the stock, so you must measure your paper with a micrometer once and write the number on the machine.

For a 0.05 mm feeler, the drag point is repeatable to about ±0.02 mm in steady hands. That is fine for a roughing setup on a 6061 bracket with a ±0.05 mm tolerance. It is not fine for a mold insert held to ±0.005 mm, where 0.02 mm of setup error eats most of your budget.

The common error here is touching off on a surface that is not the machining datum. Saw-cut bar has a burr on one edge. Castings have draft and parting-line flash. If the drawing dimensions from the finished face, touch off on a machined face, or face the top first and re-zero on the clean surface.

Do not spin the tool during a manual touch-off. A running cutter will grab the feeler or the paper, and on aluminium it will pull the tool down into the part. Bring the tip down with the spindle stopped, set the offset, then start the spindle only for the verify move.

  • 1
    Feeler gauge0.05 mm leaf, repeatable to about ±0.02 mm.
  • 2
    PaperMeasure your stock once; typically 0.08-0.10 mm.
  • 3
    Surface choiceTouch the machined face that the drawing dimensions call out.
Method 2

Tool setters and probe routines that remove operator feel

An offline tool presetter measures each tool on a bench gauge and prints a length. The operator keys that length into the tool offset table and never touches the tool to the part. The spindle then only needs one Z reference, taken once with a probe or a gauge block. This splits the error into two smaller pieces instead of stacking feel, tool length, and part surface into one hand motion.

An in-machine tool setter works the same way but on the table. The tool feeds down at 50-100 mm/min onto a contact pad, the skip signal latches the position, and the control writes the offset. Repeatability is typically a few microns, which is why production shops use it on every tool in the turret or carousel.

A spindle probe goes further. It touches the part surface at several points and can set the work offset in Z, X, and Y from one routine. On a rough casting with 0.5 mm of surface variation, probing four corners and using the highest point as Z0 keeps the first pass from cutting air on one side and overloading on the other.

On our 16 simultaneous 5-axis machining centers, probe-based Z setting is standard for the first operation. The probe also writes the part rotation into the offset, which matters when a 4,000 mm frame is clamped on a fixture that is not perfectly level.

  • 1
    PresetterBench measurement, no contact with the part.
  • 2
    Tool setterContact pad on the table, few-micron repeatability.
  • 3
    Spindle probeSets Z plus X, Y, and rotation in one routine.
Choosing a method

Which Z0 method fits the job

Match the method to the tolerance, not to habit. A ±0.1 mm welded frame needs a tape measure and a sharpie as much as it needs a probe. A ±0.005 mm medical housing needs a probe and a warm-up cycle, because the ballscrew and the part both grow as the machine heats through the first hour.

Part quantity shifts the math too. On a one-off prototype, ten minutes of probing is cheap insurance. On a 10,000-part run, the probe routine runs once and the offset is locked; from there the tool wear offset carries the drift, checked against a measured first article.

Material matters at the contact point. On soft aluminium, a probe tip can leave a small witness mark, so probe on a sacrificial face or off the part edge. On hardened steel above 45 HRC, a touch-off with a carbide tool will chip the edge, so use a gauge block or a probe instead of dragging the cutter.

When we quote a job, the Z0 method is part of the process plan. No minimum order quantity means a single prototype and a 10,000-part run may use completely different setups, and the quote notes which one applies.

  • 1
    Loose toleranceManual touch-off is fast and adequate.
  • 2
    Tight toleranceProbe plus warm-up cycle, verified with a gauge block.
  • 3
    Hard materialNever drag the cutter; use a probe or gauge block.
Mistakes

The mistakes that scrap parts after a correct Z0

Wrong gauge subtraction tops the list. An operator touches off with a 0.05 mm feeler and forgets to subtract it. The part comes out 0.05 mm shallow everywhere, which is invisible on a roughing pass and fatal on a finishing pass with a 0.02 mm allowance.

A stale tool length is second. Someone changes an insert or re-clamps a drill chuck and does not update the H offset. The work offset is perfect, so the first move looks right, and the tool buries itself 0.3 mm deep in the fixture plate.

Thermal drift is third, and it is the one people argue about. A machine that has been sitting cold all night grows in Z as the spindle and ballscrew warm up. On a tight job, run a 30-60 minute warm-up cycle and re-check the offset before the finishing pass. This is standard on our 5-axis work, where a 4,000 mm part can see measurable growth over a long cycle.

Fixture movement is fourth. A part clamped with light pressure on a vise can lift a few hundredths when the first heavy cut pulls it. Re-probe after the roughing pass on any part with thin walls or unsupported overhangs. If the offset moved, the answer is more support, not more offset.

  • 1
    Forgot the gaugeEvery Z feature is shallow by the gauge thickness.
  • 2
    Stale tool lengthCorrect part, wrong tip position. Crash risk.
  • 3
    Cold machineWarm up and re-check before finishing.
Procedure

Step by step: setting and verifying Z0 on a mill

Written for a vertical mill with a Fanuc-style control. The order matters more than the numbers.

  • 1
    Clean the datum surfaceStone off burrs and wipe the face. A chip under the tool tip reads as 0.05-0.2 mm of false depth. Blow out the T-slots as well, since a chip under the fixture moves the whole part.
  • 2
    Load the first tool and its length offsetBring the tool to the spindle, call the correct H number, and confirm the offset table shows a plausible length. On a 50-taper machine, a missing H value means the control thinks the tip is at the gauge line.
  • 3
    Jog down in decreasing stepsRapid to 50 mm above the part, then 10 mm, then 1 mm, then 0.01 mm. Switch to 0.01 mm or 0.001 mm increment before contact so you can feel the drag point without overshooting.
  • 4
    Touch off and subtract the gaugeFor a 0.05 mm feeler, stop at first drag and subtract 0.05. For paper, subtract your measured thickness, typically 0.08-0.10 mm. Write the Z value into G54.
  • 5
    Verify with a gauge blockJog the tool down onto a 50.00 mm gauge block and read the position display. It should read 50.00 mm, within 0.01 mm. If it reads 49.85, your offset is 0.15 mm low.
  • 6
    Air-cut the first Z moveRaise the part or the tool by 20 mm, run the first Z move at 5-10% rapid in single block, and watch distance-to-go. Stop if the number does not match the planned clearance.
  • 7
    Cut the first feature and measureTake a 0.5 mm facing pass or a shallow pocket, measure it, and correct the work offset. Do not chase the error with cutter compensation.
  • 8
    Record the offset in the setup sheetNote the G54 Z value, the tool numbers, and the gauge used. The next run repeats in minutes instead of guessing again.
Method comparison

Z0 setting methods compared

Pick the row that matches your tolerance and part count.

MethodTypical repeatabilityBest forWatch out for
Feeler gauge touch-off±0.02 mmOne-off roughing, ±0.05 mm workBurrs and saw-cut faces
Paper touch-off±0.05 mmQuick setup on soft materialPaper thickness varies by stock
Offline presetter±0.005 mm on tool lengthProduction with many toolsStill needs one part-side reference
In-machine tool setter±0.003 mmEvery tool in the carouselContact pad must stay clean
Spindle probe±0.002 mmTight tolerance, castings, 5-axisWitness marks on soft aluminium
Gauge block and indicator±0.005 mmVerification of any method aboveBlock must be flat and burr-free

The takeaway

Z0 is a number you own, not something the machine discovers. Pick the method that matches your tolerance, subtract your gauge, verify with a block, and record the offset. That sequence removes almost every Z-axis scrap event.

FAQs

Z0 questions we get from engineers

Does the machine find Z0 by itself?

No. It finds machine home from the encoder and the home switch. Everything about the part, including Z0, is a number you or a probe routine supplies.

A probe automates the measurement, but the control still only stores a value. If the probe tip is bent or the stylus is loose, the stored value is wrong and the machine will trust it.

Where should Z0 be on the drawing?

Put it on a machined face that the critical dimensions reference. On a plate, that is usually the finished top. On a turned part, it is often the finished face or the centerline.

If the drawing does not call it out, ask before the first cut. Moving Z0 after roughing means re-cutting features that were already at depth.

Is a probe always more accurate than touch-off?

For repeatability, yes, typically ±0.002 mm versus ±0.02 mm. For absolute accuracy, only if the probe is calibrated against a known artifact and the stylus is clean.

A dirty or chipped stylus can read 0.05 mm off with no warning. Calibrate on a gauge ring or a certified block on a schedule.

How much does Z0 error affect the finished part?

Every Z feature shifts by the same amount. A 0.1 mm low Z0 makes every pocket 0.1 mm shallow, every step 0.1 mm short, and every drilled depth 0.1 mm off.

Features that are dimensioned from the top face stay in tolerance relative to each other. Features dimensioned from the bottom face move the other way.

Why does the offset change between the first and last part?

Thermal growth in the spindle, ballscrew, and part, plus tool wear and fixture settling. On a long run, these add up to hundredths of a millimeter.

Check the first article, then re-measure every 20-50 parts on tight work and adjust the wear offset rather than the work offset.

Can you hold ±0.005 mm on a production run?

Yes, on the right machine and material, with a controlled setup and 100% inspection. We hold ±0.005 mm on our 5-axis and mill-turn work, with Ra 0.8-1.6 μm as a typical machined finish.

It depends on the feature. A bored bore is easier than a thin-wall slot. Send the drawing and we will say which features can hold it.

Send the drawing, get a process plan back

Upload your part and we will return a quotation with a free DFM analysis within 12 hours. Tell us which features are critical and we will note how Z0 is set and verified for that job.

12-hour quote±0.005 mm100% inspectionNDA on request

Follow

More machining notes

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