How to Set the Origin and Tool Length of the Workpiece Coordinate System on a Five-Axis Machining Center
This guide is for setup machinists and process engineers running simultaneous 5-axis work. It covers how the workpiece coordinate system is established, how tool length is measured, and the verification checks that keep rotary moves from driving a tool into the table. Read it before your next first-article run.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
Key takeaways
What the workpiece coordinate system actually defines
On a five-axis machining center, the workpiece coordinate system is the map that tells the control where the part sits relative to the machine's rotary axes. It is not a single number. It is a set of values: the work offset (G54 to G59), the tool length offset, and the rotary axis positions that the control uses to transform between part space and machine space.
If any one of those values is wrong, the error does not stay local. A 1 mm error in Z on a 3-axis mill cuts 1 mm too deep. The same 1 mm error on a trunnion machine, with the table tilted 45°, can move the tool several millimeters in a direction you did not intend. That is how tools break and spindles get damaged.
The goal of setup is simple: make the control's model of the part match the physical part. Every method in this guide serves that one goal. Probe, dial indicator, edge finder, or touch-off on a gauge block, the method matters less than the discipline of verifying the result before the first cut.
We run 16 simultaneous 5-axis machining centers at GreatLight, with travels from 500 × 500 × 450 mm up to 4,000 × 400 × 150 mm. The setup sequence below is the same one our machinists use on every first article.
- 1Work offsetWhere the part origin sits in machine coordinates.
- 2Tool length offsetThe distance from spindle gauge line to tool tip.
- 3Rotary centerThe pivot point the control rotates the part around.
Five-axis work offset: what changes versus 3-axis
A 3-axis setup is flat. You find X, Y, and Z on the part, load them into G54, and the control does the rest. A five-axis setup adds at least two rotary axes, and those axes move the part while the tool stays in one spot. The control has to know where the part is relative to the rotary center, not just relative to the spindle.
For a trunnion-style machine (A axis tilting, C axis rotating), the work offset is usually stored relative to the C-axis center of rotation. If your CAM post is set up correctly, it expects the part origin to be defined at the intersection of the A and C axes, or at a known offset from that point. Getting this wrong is the most common cause of five-axis crashes.
On a table-table machine where the part sits on the rotary table, the same rule applies but the geometry is different. The part origin may be anywhere on the table, but the control still needs the distance from that origin to the rotary center to compute the transformed position.
The practical check: after you set the work offset, command the machine to rotate A and C to a known position with the tool 50 mm above the part. The tool tip should stay at the same point in space. If it drifts, your offset is wrong or your rotary center is not calibrated.
- 1Trunnion machineWork offset is referenced to the A/C intersection point.
- 2Table-table machineOffset is referenced to the rotary table center.
- 3Check moveRotate both axes with the tool 50 mm clear and watch for drift.
Tool length measurement: the part most setups get wrong
Tool length offset is the distance from the spindle gauge line to the tool tip. On most controls, this is stored as a negative number in the tool offset table (H01, H02, and so on). If the number is wrong by 0.1 mm, every Z move is off by 0.1 mm. On a five-axis machine, that error compounds when the tool is tilted.
There are three common ways to measure tool length. The first is offline presetting on a tool presetter, which is fast and accurate for production runs. The second is on-machine touch-off using a tool setter or a gauge block. The third is manual touch-off against a paper shim, which is the least accurate and should only be used for roughing or when nothing else is available.
For five-axis work, we recommend on-machine measurement with a tool setter that has a repeatability of ±0.001 mm or better. This catches tool wear and pullout between jobs. It also lets you re-measure after a tool change without touching the part.
One more thing: tool length is not constant. Thermal growth in the spindle, toolholder runout, and pullout under high load all change the effective length. On long roughing cycles, re-measure the tool after the first pass and compare against the original value. If it moved more than 0.02 mm, stop and check the holder.
- 1Tool presetterBest for repeat production; measure offline.
- 2On-machine setterBest for five-axis; repeatability ±0.001 mm.
- 3Paper shimRough work only; error can exceed 0.05 mm.
Rotary center calibration and why it comes before the offset
On a simultaneous 5-axis machine, the rotary center is the point the control rotates the part around. If that point is wrong, no work offset will fix it. The error shows up as a part that machines correctly at A0 but drifts as the table tilts.
Most machine builders provide a calibration routine. On a trunnion machine, you indicate a test bar or a precision sphere at several A and C positions and let the control solve for the center. This should be done after any crash, after a spindle replacement, and at least once a year.
If you do not have a calibration routine, you can find the C-axis center by sweeping a dial indicator around a known cylindrical feature on the table. The A-axis center is harder; it is usually found by indicating a test bar mounted parallel to the table and rotating A through 90°.
Once the rotary center is known, store it in the machine parameters. Do not try to compensate for a bad rotary center by adjusting the work offset. That only works at one tilt angle and fails everywhere else.
- 1When to calibrateAfter a crash, spindle change, or annually.
- 2C-axis centerSweep a dial indicator around a known cylinder.
- 3A-axis centerIndicate a test bar and rotate A through 90°.
Verification: the checks that catch errors before the cut
After you set the work offset and tool length, do not press cycle start. Run a verification sequence first. The sequence takes five minutes and has saved more spindles than any other habit in the shop.
Start with a dry run at 25% rapid override and the feed hold button under your finger. Watch the distance-to-go display on the first approach move. If the Z value looks wrong, stop. Then single-block through the first tool change and the first rotary move. The tool should stay clear of the part and the fixture at every step.
Next, check the actual position against the commanded position. On most controls, you can display both the workpiece coordinate and the machine coordinate. At the start of the program, the difference between them should equal your work offset. If it does not, the offset is not active.
Finally, cut air. Run the entire program with the tool 20 mm above the part. This catches programming errors, wrong tool numbers, and rotary moves that would have crashed. Only after a clean air run do you cut material.
- 1Dry run25% rapid override, finger on feed hold.
- 2Single blockStep through the first tool change and rotary move.
- 3Air cutRun the full program 20 mm above the part.
Step-by-step setup sequence for a five-axis first article
Follow this order. Skipping a step is how crashes happen.
- 11. Warm up the spindle and axesRun a 20-minute warm-up cycle at 2,000–6,000 rpm and exercise A and C through their full range. Cold machines drift; a warm machine repeats. Do not skip this on a Monday morning.
- 22. Verify rotary center calibrationCheck the machine parameters against the last calibration record. If the machine has been crashed or the spindle replaced, recalibrate before touching the part. Store the result.
- 33. Mount and indicate the fixtureIndicate the fixture or vise to within 0.01 mm over its full length. On a rotary table, indicate the fixture relative to the C-axis center, not just to the table edge.
- 44. Establish the work offsetUse a spindle probe to touch off X, Y, and Z on the datum surfaces. Store in G54. For five-axis work, verify that the offset is referenced to the rotary center, not to a corner of the stock.
- 55. Measure every toolMeasure each tool on the tool setter. Store the length in the correct H offset. Check that the tool number in the program matches the offset number. A mismatch here is a classic crash cause.
- 66. Run the dry-run and air-cut sequenceSingle-block the first approach at 25% rapid. Then air-cut the full program 20 mm above the part. Watch for rotary moves that bring the tool or holder close to the fixture.
- 77. Cut the first part and inspectCut with reduced feed (50% of programmed) and inspect the first feature. Compare against the drawing before running the rest of the batch. Adjust the work offset only if the error is consistent across features.
Choosing a setup method by part and machine
Pick the method that matches your accuracy need and machine type.
| Method | Typical accuracy | Best for | Avoid when |
|---|---|---|---|
| Spindle probe | ±0.005 mm | Five-axis first articles, complex datums | Probe stylus cannot reach the surface |
| Dial indicator | ±0.01 mm | Rotary center checks, fixture alignment | Part has no accessible cylindrical feature |
| Edge finder | ±0.02 mm | Simple 3-axis work, rough positioning | Five-axis work with tilted cutting |
| Tool presetter | ±0.001 mm | Production runs, repeat tool changes | One-off jobs with a single tool |
| Paper shim touch-off | ±0.05 mm | Roughing only, no probe available | Any finishing pass or five-axis move |
Common questions about five-axis setup
Do I need a probe to set the workpiece coordinate system on a five-axis machine?
No, but a probe makes the job faster and more repeatable. A spindle probe typically holds ±0.005 mm, which is enough for most five-axis work. Without a probe, you can use a dial indicator on the fixture and a tool setter for tool length.
The trade-off is time and hand-feel error. A skilled machinist with a dial indicator can match probe accuracy on a simple part, but the probe wins on complex datums and on repeat setups.
How often should the rotary center be recalibrated?
Recalibrate after any crash, after a spindle replacement, and at least once a year. On a machine that runs heavy roughing, check it every six months. A rotary center that drifts by 0.05 mm will show up as taper or position error on tilted cuts.
If your machine has a built-in calibration routine, run it and record the result. If not, use a test bar and a dial indicator to find the A and C centers manually.
Why does my part machine correctly at A0 but drift when the table tilts?
The most likely cause is a wrong rotary center or a work offset that is not referenced to the rotary center. At A0, the error is hidden. As the table tilts, the control rotates the part around the wrong point and the tool path moves off the part.
Check the rotary center first. If it is correct, check that your CAM post and the machine control agree on where the work offset origin is defined. A mismatch of even 0.5 mm causes visible drift at 45° tilt.
Can I use the same work offset for a 3-axis and a 5-axis job on the same machine?
You can store the values in the same G54 slot, but the meaning is different. A 3-axis offset is typically set to a corner or a datum on the part. A five-axis offset is usually referenced to the rotary center. If you switch jobs, re-verify the offset against the CAM setup sheet.
A safer practice is to use separate work offset slots for 3-axis and 5-axis jobs. G54 for one, G55 for the other. Label them clearly in the setup sheet.
What tolerance should I hold on the work offset for five-axis finishing?
For finishing work with a ±0.005 mm part tolerance, aim to hold the work offset within 0.005 mm of the true datum. That leaves margin for tool deflection and thermal effects. If the offset error is larger than the part tolerance, no amount of cutter compensation will save the part.
For roughing, 0.02 mm is usually acceptable. The finishing pass will clean up the difference.
Need five-axis parts set up right the first time?
Send us your drawings and we will review the setup before we quote. DFM feedback and quotation within 12 hours.
12-hour quote16 five-axis centers±0.005 mm tolerance100% inspection