How to Set Work Offsets on a CNC Machine: G54-G59 Guide
A work offset tells the CNC machine where your part is located on the table. Without it the machine has no way of knowing where your part zero is. Setting the work offset is the most important step between loading material and running a program.
The concept is simple: you jog the tool to the position you want to call X0 Y0 Z0, press a button to record that position, and the machine remembers it. Every coordinate in your program then references that point.
This guide covers the four methods for setting work offsets — manual jog-and-set, G10 programmable setting, edge finding, and touch probing — plus the things that can go wrong and how to fix them. By the end you will be able to set up any CNC machine for a new job in under five minutes.
Understanding Work Offsets vs Machine Position
Every CNC machine has a fixed machine home position built into the controller. This is the absolute reference point for everything. When you set a work offset you are essentially saying: “The machine home is at position A, but my part zero is at position B. Here is the difference between them.”
Machine home (fixed) Part zero (you choose this)
X=0, Y=0, Z=0 X=0, Y=0, Z=0
│ │
│ Distance stored in G54 │
└────────────────────────────────► │
──────────────────────────────────► │
The controller remembers
this difference automatically
When you activate G54 in your program the controller automatically adds the stored offset to every coordinate:
G54 G01 X50 Y25 ; Controller adds G54 offset → machine moves to
; (machine home + G54 offset) + X50
You never need to know the actual machine home position values. The controller handles that math for you.
The Six Standard Work Offsets
CNC controls provide six standard offsets:
| Code | Offset Number | Typical Use |
|---|---|---|
| G54 | 1 | Primary part position |
| G55 | 2 | Second part or second operation |
| G56 | 3 | Third setup |
| G57 | 4 | Fourth setup |
| G58 | 5 | Fifth setup |
| G59 | 6 | Sixth setup |
Having six offsets means you can set up six different part positions and switch between them in your program using a single G-code. This is essential for machining multiple parts in one cycle.
The Work Offset Setting Workflow
Setting a work offset follows the same basic sequence regardless of which method you choose:
Home machine → Select offset → Position tool at part zero → Record position → Verify
Each method differs only in how you position the tool and record the position. The verification step is always the same.
Method 1: Manual Jog-and-Set (Most Common)
This is the method you will use most often as a beginner. It requires nothing more than the machine’s jog controls and the offset page on the controller.
Step 1: Home the Machine
Before setting any offsets the machine must know where its home position is. Press the home button and let each axis complete its reference sequence.
Step 2: Select the Work Offset on the Controller
Navigate to the offset page on your control panel. You will see fields for G54 through G59 (and sometimes beyond). Select G54 for your primary setup.
Step 3: Jog the Tool to Your Part Zero
Using the jog wheel or handwheel move the tool so it is exactly at the position you want to be X0 Y0 Z0.
For the X and Y axes the most common approach is to touch the side of the workpiece:
- Jog the tool close to the left side of the part
- Switch to slow feed and move until the tool just touches the work
- Press Zero X on the offset page — this records the current machine position as X=0 for G54
- Repeat for Y and Z
For the Z axis the most common approach is to touch the top of the workpiece:
- Jog the tool above the part
- Place a piece of paper (about 0.1mm thick) between the tool and the part
- Lower the tool until the paper drags when you pull it
- Press Zero Z on the offset page
Step 4: Verify the Offset
Switch back to G54 in MDI mode. Type G00 X0 Y0 Z0 and press Cycle Start. The machine should move to exactly the position you just set. If it does not you need to recheck your values.
A common reason for verification failure is selecting the wrong offset number. If you set G54 but then verify in G55 the machine moves to the G55 zero which is probably somewhere different. Always verify using the same offset you just set.
Another reason is moving the workpiece after setting the offset. If you clamp the part set the offset and then bump the part while loading a tool the offset is now wrong. Make offset setting the last step before running the program.
Step 5: Lock In the Values
The values are stored automatically when you press the Zero buttons and remain in memory even after the machine is powered off. You do not need to save or write them down. The values remain in the controller memory for as long as the machine has power or battery backup.
Method 2: Setting Offsets with G10 (Programmable)
The G10 command lets you set work offsets directly from your G-code program. This is useful when you use the same fixture repeatedly and know the exact offset values.
Setting a complete offset with G10:
G10 L2 P1 X2.345 Y4.567 Z-3.450
| Parameter | Meaning | Example |
|---|---|---|
| L2 | Sets work offset (not tool offset) | Always L2 for this purpose |
| P1 | Offset number: 1=G54, 2=G55, 3=G56… | P1 = G54 |
| X/Y/Z | The offset value from machine home | Measure these once and reuse |
Setting the current position as zero with G10:
G10 L20 P1 X0 Y0 Z0
This tells the controller: “The current tool position is now X0 Y0 Z0 for G54.” It is the programmable equivalent of pressing the Zero buttons.
Why use G10 instead of manual setting:
- You can include it at the top of your program
- The offsets are set automatically when the program runs
- No risk of operator error when entering values
- Works the same way on every machine that supports G10
- Useful for production runs where the same fixture is used repeatedly — store the G10 values in the program header and the offsets are set correctly every time with no manual steps required
Method 3: Using an Edge Finder
An edge finder gives more accurate X and Y positioning than touching by eye:
- Insert the edge finder into the spindle
- Spin it at about 1000 RPM
- Jog it close to the edge of the part
- Move in slow increments until the edge finder kicks off-center
- Press Zero X (or Zero Y depending on the axis)
- Repeat for the other axes
There are two common types of edge finders. The mechanical ball-type edge finder has a spring-loaded tip that kicks sideways when it contacts the work. The electronic edge finder uses an electrical circuit that closes when the tool touches the part — this gives a more consistent signal and does not require the spindle to be running. Both types achieve about 0.01mm accuracy which is sufficient for most work. An edge finder is accurate to about 0.01mm which is sufficient for most work. For tighter tolerances use a dial test indicator or a touch probe. The right choice depends on your budget and the accuracy your job requires. For prototype work an edge finder is sufficient. For production work a probe saves time and prevents errors.
Method 4: Using a Touch Probe (Advanced)
Touch probes automate the entire offset setting process:
G65 P9832 ; Enable probe
G65 P9810 Z-10 F100 ; Move probe to safe position
G65 P9811 X0 Y0 ; Probe X and Y surfaces
G65 P9812 Z0 ; Probe Z surface
The probe touches each surface automatically and updates the work offset values in the controller memory. This is the fastest and most accurate method but requires a probe system which is an expensive add-on for most hobby machines.
Common Mistakes and How to Avoid Them
Mistake 1: Confusing G54 with G92
This is the most common work offset mistake and it can crash your tool.
; Using the Zero button on some controllers sets G92, not G54
; G92 is a TEMPORARY offset applied on top of G54
; If you hit Reset, G92 disappears and your zero moves
How to tell the difference: G54 values are stored in the offset page and survive a power cycle. G92 is set in the program itself and is lost when you reset or power off. Always check which offset type your controller’s Zero button actually sets.
Mistake 2: Forgetting to Select the Correct Offset
; Previous program ended with G59 active
; Your new program starts without selecting an offset
; G59 is still active — your coordinates reference the wrong zero
Fix: Make it a habit to always include the work offset in your safety block at the top of every program:
G90 G94 G17 G54 ; Explicitly select G54 — never assume
Mistake 3: Zeroing the Wrong Axis
When setting offsets it is easy to press the wrong Zero button — setting X when you meant to set Y, or updating the wrong offset number.
Fix: Double-check the offset page before pressing Zero. Confirm that the active offset number and the axis you are setting are both highlighted correctly.
Mistake 4: Not Verifying Before Cutting
Setting an offset and immediately running a program without verification is how crashes happen.
Fix: After setting an offset always run this verification sequence:
G90 G54 G00 X0 Y0 Z10 ; Rapid to zero position at Z10
The tool should position itself exactly at your part zero, 10mm above the surface. If it does not the offset is wrong. Fix it before cutting.
My Offsets Keep Changing Between Jobs
If your offsets seem to drift between sessions the most likely cause is the machine losing its home position. Some hobby-level machines do not have absolute encoders and need to be re-homed every time they are powered on. If you set an offset and then home the machine afterwards the offset values are now wrong because the home reference moved.
Solution: Home the machine first. Set offsets second. Never home after setting offsets. If your machine does not have battery-backed home encoders add a note on the machine itself: HOME FIRST then SET OFFSETS.
My Machine Moves to the Wrong Position
If your machine moves to a position that is clearly wrong when you run a program check these three things in order:
-
Is the correct work offset selected? Look for G54 through G59 in the program header. If none is specified the machine may be using whatever offset was active when the previous program ended.
-
Is there an active G92? Check by looking at the offset page or running the program
G92.1to clear any temporary offset. If the position suddenly corrects itself G92 was the problem. -
Is the program in absolute mode? A missing G90 at the start means the machine could still be in G91 incremental mode from a previous program. Every coordinate would then mean something different from what you intended.
My Zero Button Set All Six Offsets at Once
On some controllers pressing the Zero button applies the new zero to ALL offsets, not just the one you have selected. This is dangerous because your G55 through G59 values are now corrupted.
Solution: Test the behavior on your specific controller by noting the values in all six offsets, zeroing one, and checking whether only that one changed. If all six changed you need to use the G10 method instead of the Zero button. Check your controller manual to confirm which behavior applies to your machine.
Controller-Specific Notes
The exact steps for setting work offsets vary slightly by controller brand:
| Controller | Where to Set Offsets | Zero Button Behavior |
|---|---|---|
| Fanuc | Offset page → Work section | Sets the selected G54-G59 directly |
| Haas | Offset page → Work offsets | Sets the selected offset |
| GRBL | Not supported — no G54 memory | Use G10 L20 P1 X0 in your program |
| LinuxCNC | Offset page or G10 in MDI | Sets the selected offset |
| Tormach PathPilot | Work offset tab | Individual Zero X/Y/Z buttons |
| Buildbotics | Use G10 L20 — UI buttons set G92 | Warning: buttons set G92 not G54 |
Important: On GRBL-based controllers work offsets are not stored permanently. You must set them at the start of every program using G10 L20. This is a limitation of the GRBL firmware and one of the main reasons users upgrade to LinuxCNC or a dedicated CNC controller. If you use GRBL plan to add your offset setting commands to every program header so you never forget. To do this create a template file that includes the G10 commands at the top and start every new program from that template.
Quick Reference
Manual set workflow:
1. Home the machine
2. Select G54 on the offset page
3. Jog tool to part zero position
4. Press Zero X, Zero Y, Zero Z
5. Verify with G00 X0 Y0 Z5
G10 programmable set workflow:
G10 L20 P1 X0 Y0 Z0 ; Set G54 from current position
G10 L2 P1 X2.345 Y4.567 Z-3.450 ; Set G54 from known values
Safety block (always use):
G90 G94 G17 G54 ; Absolute mode, XY plane, offset 1
Verification:
G90 G54 G00 X0 Y0 Z10 ; Confirm tool goes to correct zero
What’s Next?
Now that your work offset is set you are ready to start cutting. The concept of coordinate systems continues into every aspect of CNC programming. Understanding offsets is the foundation that makes everything else possible:
- Without a correct work offset your G00 and G01 moves go to the wrong place.
- Without understanding G54 vs G92 you risk crashes when switching between programs.
- With multiple offsets (G55-G59) you can machine multiple parts in a single cycle.
From here dive deeper into:

CNC Machine Setup: Complete Guide from Power-On to First CutJune 26, 2026 · Guides
CNC Workholding Options: Choosing the Right MethodJune 25, 2026 · Guides
How to Tram a CNC Spindle: A Beginner's Guide to Perfect Head AlignmentJune 27, 2026 · Guides