How to Set and Adjust CNC Work Offsets
A practical, control-aware guide to G54–G59 work coordinate systems: setting a datum with an edge finder, finding a centre between two edges, establishing Z zero, probing, writing offsets with G10, and verifying the setup safely before the first cut.
Quick answer
A CNC work offset defines the position of the workpiece zero relative to the machine coordinate system. Standard offsets G54 through G59 let an operator establish separate work zeros for individual parts, fixtures or machining stations. Work offsets can be set manually with an edge finder, dial indicator, tool setter or touch probe, or entered programmatically using G10 where the control supports it.
Published: · Updated:
01Key Terms at a Glance
Most work-offset mistakes are not calculation mistakes. They come from mixing up which coordinate system, register or command is actually being used. This table sets the boundaries used throughout the guide.
| Item | Meaning |
|---|---|
| Machine zero | Fixed machine reference position established by homing or reference return. It does not move with the part. |
| Work zero (program zero) | The datum selected on the workpiece or fixture that the program is written around. |
G54–G59 | Standard selectable work coordinate systems. Each one stores its own X/Y/Z (and additional axes where fitted) offset values. |
| Tool length offset | Compensates for tool length, typically activated with G43 and an H register. It does not locate the workpiece. |
| Cutter radius compensation | Compensates for cutter radius, typically G41/G42 with a D register. |
G52 | Local coordinate shift applied on top of the active work coordinate system, on controls that support it. |
G53 | Non-modal command that moves in machine coordinates for that block only. |
02What Is a CNC Work Offset?
Three coordinate systems are active on a typical machining centre at the same time. Keeping them separate in your head is the single most useful habit in setup work.
Machine coordinate system
Established by homing or reference return, this system is fixed to the machine structure. Its zero point is defined by the builder, and on many machining centres it sits at a corner of the travel envelope — which is why typical G54 values are negative. G53 commands motion directly in this system for a single block, which is why it is commonly used for safe retract moves such as G53 G00 Z0.
Work coordinate system
This is where you program. Selecting G54 tells the control to interpret subsequent axis positions relative to the datum stored in the G54 register. Change the stored value and the whole program shifts with it — which is exactly what you want when you reposition a fixture, and exactly what causes trouble when a value is wrong.
Local (temporary) coordinate system
Some controls support a local shift layered on top of the active work coordinate system, commonly through G52. It is convenient for repeated features at a known distance from the main datum, but it is also a frequent source of “the part is offset and I cannot see why” problems, because the shift stays active until it is cleared.
03G54–G59 Work Offsets Explained
Haas documents G54–G59 as six selectable user work coordinate systems, with further extended offsets available through G154 P1–P99 on those controls. FANUC-style controls provide the same six standard systems, plus additional work coordinate systems (commonly addressed as G54.1 P__) when the option is fitted.
| Code | Typical use |
|---|---|
G54 | First workpiece or primary fixture — the default choice for single-part setups |
G55 | Second workpiece or fixture station |
G56 | Third workpiece or station |
G57 | Fourth workpiece or station |
G58 | Fifth workpiece or station |
G59 | Sixth workpiece or station |
G54.1 P__ / G154 P__ | Extended work offsets for tombstones, pallets and high-station-count fixtures — availability and addressing are controller-dependent |
04Work Offset vs Tool Offset
| Offset type | Purpose | Typical codes / register |
|---|---|---|
| Work offset | Locates the workpiece datum inside the machine envelope | G54–G59, extended offsets |
| Tool length offset | Compensates for the length of each tool so Z depths are correct | G43 H__ (cancel with G49) |
| Cutter radius compensation | Offsets the tool centre from the programmed contour by the cutter radius | G41/G42 with D__ (cancel with G40) |
| Local coordinate shift | Temporarily shifts the datum within the active work coordinate system | G52 |
| Machine coordinate move | Commands a move in machine coordinates for one block only | G53 |
What G41 and G42 actually mean
A widespread shop-floor shortcut says “G41 is climb milling and G42 is conventional milling”. That is not what the codes define, and treating it as a rule will eventually produce a scrapped part.
Wear correction: work out the magnitude, then confirm the sign
Suppose a boss is programmed at ∅50.00 mm and measures ∅49.80 mm. A 0.20 mm diameter error corresponds to a 0.10 mm radial correction. Whether that 0.10 mm is entered as a positive or negative value in the wear register depends on whether the feature is internal or external, the active compensation side, and the offset convention used by your control — some controls expect diameter values, others radius values.
Tool length compensation and cutter compensation are large subjects in their own right. This guide keeps the boundary clear and stays focused on locating the workpiece.
05Before Setting a CNC Work Offset
Run through this before touching the offset page. Most datum errors are introduced before any measurement is taken.
- Complete machine homing or reference return
- Confirm metric or inch mode (
G21/G20) - Verify workholding rigidity and clamp positions
- Confirm the datum specified on the drawing
- Load the correct tool and its tool length offset
- Clean chips and burrs from all locating surfaces
- Confirm the active plane (
G17) and coordinate system - Raise Z to a safe clearance position
- Check probe or edge-finder calibration and runout
- Record the existing offset values before overwriting them
- Check that no local shift (
G52) is still active - Confirm which offset register the program actually calls
06Method 1 — Set G54 with an Edge Finder
A mechanical edge finder is still the most common way to locate an X or Y datum on a manual setup. The method is reliable, but only if the geometry behind it is understood rather than copied.
-
Locate the X datum
Install the edge finder in the spindle and run it at the speed recommended by its manufacturer (commonly in the region of 800–1200 rpm for a standard mechanical type). Feed the workpiece edge towards the tip in small increments until the offset tip snaps into alignment, then note the machine X position at that moment.
-
Compensate for the edge-finder radius
At the moment of contact, the spindle centreline is one edge-finder radius away from the surface. The workpiece edge position equals the machine contact position plus or minus the edge-finder radius, where the sign depends on the direction of approach and the axis direction of your machine.
-
Enter the value into the G54 X register
Enter the compensated machine coordinate into the X field of the work offset page. Many controls also provide a “measure” or “set” function that captures the current position and applies a typed radius value for you — if you use it, confirm what it writes before relying on it.
-
Repeat for Y
Retract to clearance, move to the Y face, and repeat the same procedure with the same edge finder and the same approach discipline.
-
Set Z independently
Do not use a standard mechanical edge finder to establish Z. Use one of the Z-specific methods in section 08.
Calculation example
07Method 2 — Find the Centre Between Two Edges
When the datum is the centre of a block, slot or bore, touching both sides and averaging is faster and less error-prone than a single-edge measurement, because the radius term cancels out.
Why the radius cancels — and when it does not
Approaching from the left, the recorded machine position is one radius short of the surface. Approaching from the right, it is one radius past it, in the opposite direction. Averaging the two readings cancels the two equal and opposite radius terms, so the result is the true centre without any radius arithmetic. That convenience only holds when all of the following are true:
- The same edge finder, with the same effective radius, is used on both sides.
- Both readings are machine coordinates, not positions displayed in a work coordinate system.
- The approach method, feel and trigger point are consistent on both sides.
- The two surfaces are parallel and both are clean and free of burrs.
- Backlash is not affecting the readings — approach each side in a consistent direction and take up lost motion before the final increment.
08Setting the Z Datum
Z is not simply “the same procedure again”. A standard mechanical edge finder is designed for X and Y edge location and should not be used to establish Z zero. Choose a method that suits the surface, the accuracy required and the equipment available.
Paper or feeler gauge
Quick and widely used. Lower the tool onto a slip of paper or a feeler gauge of known thickness, then subtract that thickness. Accuracy is limited by feel and gauge compression.
Tool setter / setting block
A block or gauge of certified height gives a consistent reference and removes most of the operator feel from the result. Subtract the block height from the recorded machine Z.
Electronic tool setter
A table-mounted setter with a signal output allows repeatable Z setting and, on many machines, automatic writing of tool length values.
3D edge finder / touch probe
Provides a triggered, repeatable contact in X, Y and Z, and allows probing of surfaces that are difficult to reach by feel.
Gauge block of known length
Useful where a fixture face rather than the part face is the intended Z reference, or where the part top is not machined.
Which surface is Z zero?
Part top face, finished floor, fixture face or vice jaw — the correct answer comes from the drawing datum, not from convenience. Write it into the setup sheet.
09Method 3 — Set the Work Offset with a Touch Probe
A spindle-mounted touch probe removes most of the operator feel from datum setting, shortens setup time and — importantly for production work — makes the datum repeatable between shifts and between operators.
Common probing routines
Single-surface probing for a face datum; bore or boss centre probing for cylindrical features; rectangular pocket or web probing for a centre between two pairs of faces; corner probing for an X/Y datum in one cycle. Most controls with a probing option can write the measured result straight into a chosen work offset register.
What determines the result
Probe calibration against a known ring or sphere, effective stylus radius, stylus length and stiffness, approach feed, trigger repeatability, and how square the feature is to the axes. A probe that has not been recalibrated after a stylus change will produce confident, repeatable, wrong numbers.
Safe practice
Use protected positioning moves so the probe stops on unexpected contact, keep rapid overrides reduced during the first run of a new routine, and confirm the clearance distances written into the cycle before starting it. Probe overtravel is expensive.
Where it pays off
Repeat orders, multi-station fixtures, second-operation setups and any job where the same datum has to be re-established many times. Probing also allows in-process verification that the datum has not shifted after roughing.
10Method 4 — Set Work Offsets Using G10
G10 allows qualified users to write offset values programmatically instead of typing them on the offset page. It is powerful for fixtures with known station spacing, family-of-parts programs and pallet work — and it is unforgiving, because a single wrong address rewrites a datum without asking for confirmation.
FANUC-style format
On common FANUC-style controls, standard work offsets G54–G59 are written with L2, where P1 corresponds to G54, P2 to G55, P3 to G56 and so on. Extended offsets typically use a different L value.
% O1001 G90 G17 G40 G49 G80 ( safe start state ) G10 L2 P1 X-250.000 Y-150.000 Z-320.000 ( write G54 ) G10 L2 P2 X-450.000 Y-150.000 Z-320.000 ( write G55 ) G54 M98 P2000 ( machining subprogram ) G55 M98 P2000 G53 G00 Z0. ( retract in machine coordinates ) M30 %
Haas and Siemens
Haas controls support G10 for programmable offset setting and also expose G54–G59 plus extended G154 P1–P99 work coordinate systems; check the operator’s manual for the exact address structure on your machine and software version. Siemens SINUMERIK controls describe the same concept as settable zero offsets, typically addressed through G54–G57 and extended offset frames, and written through the zero-offset data rather than a FANUC-style G10 L2 block. The concept transfers; the syntax does not.
11How to Use Multiple Work Offsets
Multi-station work offsets allow the same validated toolpath to be applied to multiple workpieces while maintaining an independent datum for each fixture position. The machining logic is proven once, then reused — which is why this approach underpins most efficient low-volume and repeat production.
G54 M98 P1000 ( station 1 ) G55 M98 P1000 ( station 2 — same subprogram ) G56 M98 P1000 ( station 3 )
Why it improves consistency
The cutting strategy, feeds, stepovers and tool list are identical at every station. Only the datum changes. Variation between parts is reduced to fixture and material variation instead of programming variation.
What to watch
Confirm that the subprogram contains no absolute machine-coordinate moves that would ignore the active offset, that tool changes return to a safe Z between stations, and that each station’s offset has been verified individually before running the full cycle.
G52 local shifts
Where a control supports G52, a local shift can be applied on top of the active work coordinate system — convenient for repeated features at a fixed distance from the main datum.
G52 X0 Y0 Z0 ( clear the local shift on many controls )
G52 X0 Y0 Z0 clears the local coordinate shift. G53 commands a move in the machine coordinate system for that block only and should not be described as a universal method for cancelling G52.12FANUC, Haas, Siemens and Heidenhain Differences
The underlying idea is the same on every control: store the distance from machine zero to the part datum. The terminology, the screen you edit it on and the way extended offsets are addressed are not.
| Control | Where offsets are edited | Notes |
|---|---|---|
| FANUC | OFFSET / SETTING → WORK | Standard G54–G59; extended work coordinate systems commonly addressed as G54.1 P__ where fitted. Screen names vary by model and series. |
| Haas (NGC) | OFFSET → Work | G54–G59 plus extended G154 P1–P99 work coordinate systems on supporting machines. |
| Siemens SINUMERIK | Zero offset / work offset data | Described as settable zero offsets; commonly G54–G57 plus extended offset frames. Terminology and handling differ from FANUC-style G10. |
| Mitsubishi | Coordinate / work offset page | Standard six work coordinate systems with extended sets on many series; menu layout varies by series. |
| Heidenhain | Preset table / datum table | Uses a preset-table workflow and different terminology; the mental model of “select a stored datum” still applies, but the operating sequence is distinctly different. |
13How to Verify a Work Offset Safely
Setting the offset is half the job. Proving it before the tool is in the cut is the half that protects the part, the fixture and the spindle.
Confirm the active work offset
Check on the position or program screen that the code the program actually calls — G54, G55 or another — is the register you just set.
Confirm absolute or incremental mode
G90versusG91. An incremental block left active where an absolute move is intended is a fast way to lose a fixture.Confirm units
G21metric orG20inch, matched between the program and the control state.Verify the tool length offset
Confirm the
Hregister matches the tool actually in the spindle, and thatG43is called before any Z move into the work.Move to a safe Z clearance height
Retract clear of the part and fixture before any test motion. Where supported, use
G53 G00 Z0.or the machine’s documented safe retract.Run graphics or simulation
Check the toolpath position relative to the stock boundary in the control’s graphics mode or in your CAM verification.
Run in single block
Step through the approach moves with a hand on the feed hold.
Reduce rapid and feed override
Bring rapid override down for the first approach so there is time to react.
Perform an air cut above the part
Offset Z upward by a safe amount and run the cycle clear of the material to confirm the XY position visually.
Take a light verification cut
Use a controlled verification cut of approximately 0.05–0.20 mm where appropriate. The correct depth depends on material, tool, stock allowance, machine rigidity and what you are trying to prove.
Measure the result
Measure from the actual datum features called on the drawing, not from a convenient edge.
Apply wear correction if required
Correct in the wear register, re-cut and re-measure. Do not chase a dimension by editing the work offset unless the datum itself is wrong.
14Common CNC Work Offset Errors
Most datum faults produce a characteristic symptom. Reading the symptom correctly usually points straight at the register that needs attention.
| Symptom | Likely cause | Corrective action |
|---|---|---|
| Tool moves to the wrong fixture or station | Wrong G54–G59 active | Check which code the program calls and which register holds the correct values |
| Every feature is shifted by the same amount | Incorrect work offset value | Recheck the datum measurement and the sign applied to the edge-finder or probe radius |
| Z depth is consistently wrong on all tools | Z work offset error | Re-establish Z from the intended datum surface and confirm the block or gauge height used |
| Depth error appears only after a tool change | Wrong H register or missing G43 | Match tool number to H register and confirm the length offset call in the program |
| Everything is out by a factor of about 25.4 | G20 / G21 mismatch | Confirm program units against the control state and the offset page units |
| Centre feature is off by a consistent small amount | Edge-finder or stylus radius error, or mismatched tools between the two contacts | Recalibrate, then recalculate the centre using two readings taken with the same instrument |
| Offset appears to change after a reset or restart | Local shift not cancelled, or macro variable still active | Clear G52, check macro variables and confirm the control’s power-on behaviour |
| Shift is mirrored — correct magnitude, wrong direction | Sign convention error | Verify machine axis directions and which way the radius should have been applied |
| First part is correct, later parts drift | Fixture movement, thermal growth or chip build-up on locators | Re-verify the datum, clean locating faces and review clamping and warm-up practice |
15Complete Worked Example
Setting G54 at the top-centre of an aluminium block, with every number carried through from contact to verification.
Setup conditions
- Block held in a precision vice on parallels, machined faces against the fixed jaw and parallels.
- Machine homed; metric mode confirmed;
G17active; existing G54 values recorded before any change. - Datum required by the drawing: X and Y at the centre of the block, Z on the top face.
|contact 2 − contact 1| − edge finder ∅ equals the measured part size. If it does not, one of the readings is wrong — stop and re-measure.Step 1 — X contacts
Step 2 — Y contacts
Step 3 — Z datum
Step 4 — Values written to G54
| Axis | Value entered | Derived from |
|---|---|---|
| X | −360.000 | Average of two X contacts, radius terms cancelled |
| Y | −193.000 | Average of two Y contacts, radius terms cancelled |
| Z | −320.000 | Contact position corrected by certified block height |
Step 5 — Verification actions
- Confirm G54 is the active offset and that the program calls it.
- Jog to X0 Y0 in the work coordinate system and confirm visually that the spindle is over the centre of the block.
- Jog to two known corner positions (X−60 Y−40 and X+60 Y+40) and confirm they land on the block corners.
- Run the cycle as an air cut at a raised Z.
- Take a 0.10 mm facing pass and confirm it cleans evenly across the top — an uneven witness indicates a Z or workholding problem, not an XY datum problem.
- Measure a machined feature back to the datum and record the result on the setup sheet.
16How Work Offset Control Affects Part Accuracy
Accurate work-offset management is essential in low-volume and repeat production. A machining program may be dimensionally correct, but an incorrect datum, fixture offset or tool-length register can shift every machined feature on the part. For precision components, the offset-setting process should be integrated with fixture qualification, first-article inspection, in-process probing and documented setup control — not left as an undocumented operator habit.
Datum & fixture qualification
Locating faces are qualified before production so the same datum is re-established every time a part is loaded, rather than re-measured differently by each operator.
Multi-station offsets
One validated toolpath applied across several fixture stations, each with an independent, verified datum — the basis of consistent batch output.
In-process probing
Datum verification after roughing catches fixture movement and thermal drift before finishing passes are cut.
First-article inspection
The first part is measured against the drawing datum scheme and documented, so the setup is proven before the batch runs.
Documented setup sheets
Datum definition, offset registers, tool list and inspection points are recorded, so a repeat order reproduces the same setup rather than reinventing it.
Multi-axis datum strategy
On 4- and 5-axis work, related features are held under one datum system wherever practical, so positional relationships do not depend on re-clamping accuracy.
Need Precision CNC Parts with Controlled Datums and Inspection?
Goldcattle has manufactured custom precision components in Xiamen, China for 26 years as a national high-tech enterprise, with in-house CNC machining, injection moulding, mould making, die casting, 3D printing and sheet metal — no outsourced production. Send a drawing or 3D model and our engineering team will review datum scheme, workholding, process route and inspection requirements before quoting.
Tolerances are evaluated according to part geometry, material, feature size and inspection requirements. Capability figures quoted for specific processes apply to suitable features under controlled conditions and are confirmed per part at quotation.
17CNC Work Offset FAQs
What is a CNC work offset?
A CNC work offset is the stored distance between machine zero and a datum chosen on the workpiece or fixture. It lets a program written in part coordinates run correctly wherever the part happens to be clamped in the machine envelope.
What is the difference between G54 and G55?
They are two independent work coordinate systems, each holding its own set of axis offsets. Typically G54 is used for the first part or fixture and G55 for a second workpiece or fixture station, so the same toolpath can be applied at a different datum simply by changing the active code.
Does G28 reset G54?
Normally no. G28 is used to return to a reference point; the values stored in the G54–G59 registers are held in the work offset table and are not cleared by a reference return. Reference return re-establishes the machine coordinate system. Behaviour depends on the control and machine configuration, so confirm in the manual for your machine.
How do I set G54 with an edge finder?
Touch the datum surface with the edge finder, note the machine coordinate at contact, apply the edge-finder radius in the direction of approach, enter the result into the corresponding axis field of the G54 register, then verify by jogging to known positions before cutting. Repeat for the second axis, and set Z with a method suited to Z rather than with a standard mechanical edge finder.
What is the difference between G52 and G53?
G52 applies a local coordinate shift on top of the active work coordinate system on controls that support it. G53 is a non-modal command that moves in machine coordinates for that block only. They are different functions, and G53 should not be described as a general way to cancel G52 — on many controls the local shift is cleared with G52 X0 Y0 Z0.
Can G10 overwrite work offsets?
Yes, on controls that support it. On common FANUC-style controls, G10 L2 P1 writes the G54 register, P2 writes G55, and so on. The exact L and P addressing, and whether extended offsets can be written the same way, vary by control — confirm in the machine or control manufacturer manual before running the program.
Why is my CNC part shifted after changing tools?
If the shift appears only after a tool change, the work offset is usually not the problem. Check that the H register matches the tool in the spindle, that the tool length offset is called correctly, that the tool was measured with the same convention as the others, and that the tool is fully seated in the holder.
How accurate is an edge finder?
It depends on the condition of the edge finder, spindle runout, approach speed and operator technique, surface finish and cleanliness of the datum face, machine repeatability and temperature conditions. Rather than relying on a single published accuracy figure, establish what your own setup repeats to, and verify the datum by measurement on the first part.
About this guide
The procedures in this guide reflect common machining-centre setup practices used in our own production. Actual menu paths, offset signs and G-code syntax vary by machine builder, control model, parameter configuration and shop standard. Nothing here replaces the operator, programming and safety manuals supplied with your machine.
