You can have the best program in the world and still wreck the part, the tool or the vice on the first block. Almost every time that happens, the culprit is the same: a badly set work offset. Referencing the part is the bridge between the drawing and the machine, and it is one of the skills that separates the operator who loads programs from the machinist who commands their CNC lathe or mill. In this guide you will see exactly what the work offset is, what methods exist for setting it, how accurate each one is, and the complete step-by-step procedure on a mill and on a lathe.
What the work offset is and why you need it
A CNC program does not talk about "the corner of the part": it talks about coordinates. When the program says G01 X50 Y20, the machine needs to know where those 50 and 20 millimetres are measured from. That starting point is the work offset (also called the work zero or program origin): the point on the part or on the fixture that you decide is X0 Y0 Z0 for that particular job.
Setting the work offset means telling the control where that point sits inside the working volume. The control stores it as a distance from machine zero and uses it to translate the program's dimensions into real movements. An offset out by 2 mm shifts the whole job by 2 mm in the best case; in the worst, the tool rapids down into the vice.
Machine zero, work offset and tool offset: do not mix them up
Before the step by step, it pays to separate three concepts beginners constantly confuse:
- Machine zero (home): a fixed point defined by the manufacturer, normally at one end of the travels. The machine finds it when the axes are referenced, and it is where they go with
G28. It cannot be moved. - Work offset: the origin you choose for the program. It is stored in the control as the distance between machine zero and that point, in an offset table (G54 onwards).
- Tool offset: the length and radius of each tool. It compensates for the fact that a long drill and a short end mill reach the part from different spindle positions. It is independent of the work offset, but the two are added on every move.
The sum the control makes on every block is always the same: final position = machine zero + work offset + programmed dimension + tool compensation. If any of the first three terms is wrong, the fourth cannot put it right. These terms and many more are explained in the machining glossary.
G54 to G59: where the work offset lives
Fanuc-type, Haas and ISO-compatible controls hold the work offsets in six standard memories, selectable from the program:
| Code | Usual use |
|---|---|
G54 | The default offset. The usual one for single set-up jobs. |
G55–G57 | Second, third and fourth set-up on the same table: several vices, double set-up of the same part and so on. |
G58–G59 | Extra set-ups or permanent fixtures you do not want to disturb between jobs. |
G54.1 P1… | Extended offsets (up to 48 or more depending on the control) for tables holding many parts. |
On Siemens and Heidenhain the naming changes, but the logic is identical: a table of X, Y and Z distances from machine zero to each origin. If you came here from the guide to essential G-codes, the work offset is exactly what you activate when the program starts with G54 in the header.
Methods for setting the offset: accuracy and cost
Choosing a method depends on the tolerance of the job and on what is in your cupboard. This table summarises the ones most used on the shop floor with their typical accuracy:
| Method | Indicative accuracy | Approximate cost | What it is for |
|---|---|---|---|
| Sheet of paper (~0.10 mm) | ±0.05 mm | 0 € | Z on the mill and roughing without tight tolerances. |
| Feeler gauge | ±0.02 mm | 10–20 € | Same as paper, with a calibrated, repeatable thickness. |
| Mechanical edge finder | ±0.01 mm | 20–50 € | X and Y on the mill, turning at 400–600 rpm. |
| Analogue 3D probe | ±0.01 mm | 150–400 € | X, Y and Z without turning the spindle; also centres holes. |
| Z setting gauge (50 mm) | ±0.01 mm | 60–150 € | Fast, repeatable Z with any tool. |
| Electronic spindle probe | ±0.005 mm | 2,000 € or more | Automatic probing cycles; the standard in production. |
The practical reading: to get started you need spend nothing. The move to a 3D probe pays when you work tolerances of ±0.05 mm or tighter, and the electronic one when set-up time is worth more than its price.
Step by step: the work offset on a mill
Take the most common case: a prismatic part held in a vice, origin at the top left corner, with a 10 mm diameter edge finder for X and Y and a sheet of paper for Z.
1. Prepare the machine and the part
- Reference the axes if the control asks for it (home search).
- Clamp the part, clean the chips off it and check by hand that the reference face is seated properly in the vice.
- Fit the edge finder in the spindle and run it at about 500 rpm.
2. Touch off in X
- Bring the edge finder up to the left-hand face in manual mode, first at a high feed and the last millimetres on the handwheel in 0.01 mm steps.
- When the eccentric tip of the finder lines up and suddenly "kicks" sideways, you are touching the face.
- At that point the spindle centre is one radius from the face: 5 mm with a 10 mm finder. Load the position into G54 using the control's function (for example, entering X = -5 in the measurement, depending which side you touched from).
3. Touch off in Y and Z
- Repeat the operation on the front face for the Y axis, again compensating for the finder radius.
- For Z, stop the spindle, fit the tool or a reference arbor and put the sheet of paper on the top face.
- Come down in 0.01 mm steps while moving the paper: when the paper drags and no longer slides freely, you are one paper thickness off the face. Record Z adding that thickness (about 0.10 mm for 80 g/m² paper).
4. Verify before cutting
Open the offset table and check G54 holds sensible values (a working Z is usually a large negative number relative to home; an X or Y in mid-table, an intermediate value). Then send the machine to G54 X0 Y0 with Z high and see whether the spindle physically sits over the corner you chose. That ten-second check prevents most set-up collisions.
Step by step: the work offset on a CNC lathe
On the lathe the approach changes because the geometry hands you one of the origins: the X axis is always referred to the axis of rotation, so the X zero is not "touched off" on the part, it is set tool by tool. The usual procedure:
- Z on the face: face the end of the part with the turning tool and, without retracting in Z, record that position as Z0 of the work offset (or of the tool geometry offset, depending on the shop's method). The faced end is the natural origin because it is flat, clean and square to the axis.
- X by measured diameter: take a light pass 2 or 3 mm long, retract the tool in Z only, stop the spindle and measure the resulting diameter with a micrometer. Enter that measured diameter in the tool offset: the control now knows where its tip is relative to the axis of rotation.
- The rest of the tools: repeat the touch in Z (against the face) and in X (a turned pass and a measurement, or a touch against a known diameter) for every tool in the turret, or use the measuring arm if the machine has one.
Measuring that diameter accurately is critical: a reading error of 0.1 mm carries straight through to every part. If the micrometer is not yet comfortable territory, go over the guide to metrology with caliper and micrometer. And watch out for confusing radii with diameters when programming: it is on the podium of the most common mistakes on the lathe.
The five mistakes that ruin the most offsets
- Forgetting the edge finder radius. You touch the face, load the position as it stands, and the whole part comes out 5 mm off. Always compensate for the radius, and in the right direction for the side you touched.
- Setting Z with chips or burrs underneath. A 0.2 mm chip under the paper falsifies the Z by exactly 0.2 mm. Clean the face and run a hand over it before touching off.
- Loading the offset into the wrong memory. You touch off perfectly, store it in G55 and the program calls G54. The control runs with an old origin. Check on screen which offset is active before you press cycle start.
- Confusing the work offset with the tool offset. Correct a Z error in the tool offset and that correction applies only to that tool while the rest stay wrong. Each correction in its own table.
- Not re-validating after moving the set-up. Changing the jaws, turning the vice or knocking the part invalidates the offset even though the control still shows the same numbers. When in doubt, touch off again: two minutes against a part in the scrap bin.
Final check: the safe first pass
With the offset loaded, the set-up is finished off with a fixed routine: single-block mode, rapid override at 25% or less, a hand over the feed hold and your eyes on the distance-to-go readout. If 250 mm remain to travel and the tool is 40 mm from the part, something is wrong: stop and check. Some controls also let you run the first part with Z shifted +50 mm to draw the program in the air.
Setting the offset methodically is one of those skills that does not shine on a CV but shows on your first day at work. You learn it at the machine: if you are weighing up this career, the guide on how to become a machinist has the full training route.