← All guides
G54-G59 work offsets guide - CNC machine setup with coordinate system display showing work offset programming - CNC Dance tutorial

G54-G59 Work Offsets: Setting Up CNC Coordinate Systems

Tutorials

Work offsets tell your CNC machine where the part is located on the table. Without them the coordinates in your G-code program would have nowhere to reference. Setting a work offset is the bridge between the program coordinates and the physical position of the part on the machine.

If you write G00 X1 Y1 without a work offset the machine moves to the machine home position plus one inch in X and Y. But your part is not at machine home. It is clamped somewhere on the table in a vise or fixture. Work offsets shift the entire coordinate system so that G00 X1 Y1 moves the tool to a position one inch from your part zero.

G54 through G59 are six standard work offset registers available on most CNC controls. They let you set up multiple parts or multiple setups on the same table and switch between them with a single G-code command. This guide covers how to set them, how they work mathematically, and the common mistakes to avoid.

How Work Offsets

Category Example Purpose
Type A Example 1 Purpose 1
Type B Example 2 Purpose 2
Type C Example 3 Purpose 3

Work

Every CNC control has an internal coordinate system called machine coordinates. This is the absolute position of the machine axes based on the home switch locations. Machine coordinates never change unless you re-home the machine. They are the fixed reference point for everything the machine does.

Work offsets create a shift from machine coordinates to part coordinates. When you set G54 X0 Y0 at the corner of your part you are telling the control that when the program calls for X0 the tool should be at this specific machine position. The math is simple: machine position minus work offset equals program position. If the machine is at X10.000 and your work offset is set to X5.000 then when the program calls G00 X0 the machine moves to the position where machine X equals 5.000. When the program calls G00 X10 the machine moves to machine X equals 15.000.

This relationship is consistent across all axes. You set X, Y, and Z work offsets independently and the control applies all of them simultaneously. This is why you can set X and Y using an edge finder and Z using a different method without any conflict.

Setting a Work Offset Step by Step

The first step is locating the corner or edge of your part using an edge finder. A mechanical edge finder has a 0.200 inch diameter tip that is spring-loaded. Spin it at about 1,000 RPM and bring it close to the part edge. Slowly jog it toward the edge until the tip kicks off center. When it kicks off you have found the edge.

Now you need to calculate the true edge position. Subtract half the edge finder diameter from the machine position reading. If the machine reads X10.500 when the edge finder kicks off and you used a 0.200 inch edge finder the true edge of the part is at X10.400. This is your X zero position. Move the tool to this calculated position and enter it into the G54 X offset on your control.

Repeat the same process for the Y axis. For Z zero the standard method uses a piece of paper. Place a sheet of paper between the tool and the top surface of the part. Jog the tool down in small increments until the paper drags when you pull it. The tool is now at Z zero plus the paper thickness. Subtract the paper thickness typically 0.003 to 0.005 inches to get the true Z zero position.

On a Haas control you access the work offset screen by pressing OFFSET then F2 for work offsets. Type the X, Y, and Z values you calculated and press F1 to enter them. On a Fanuc control you navigate to the work offset page and enter the values directly. The exact button sequence varies by control but the principle is the same: you are telling the control where part zero is.

G54 vs G55 vs G56

Each work offset register stores a separate coordinate shift. G54 is the primary work offset used for most single-part setups. G55 through G59 let you machine multiple parts on the same table without rewriting the program.

A common production setup uses multiple vises on the table. G54 stores the offset for vise one, G55 for vise two, and G56 for vise three. The same program runs for each vise by changing the G-code at the start of the operation. This is how production machine shops machine multiple parts in one cycle without operator intervention between parts.

To use multiple offsets in a program simply call the appropriate G-code at the start of each section. The program calls G54, machines the first part, then calls G55, machines the second part, and so on. The control automatically applies the correct coordinate shift for each part.

G53 Machine Coordinate System

G53 is different from G54 through G59. G53 calls the machine coordinate system directly ignoring any work offset that is currently active. G53 G00 Z0 sends the tool to the machine Z home position regardless of where G54 or any other work offset is set.

Use G53 for tool changes and safe retracts at the end of programs. Many programmers put G53 G00 Z0 at the end of every program to retract the tool to a safe height before the program ends. You can also use G53 for moving to a tool change position. The format G53 G00 X0 Y0 Z0 sends all three axes to machine home which is useful for clearing the work area.

Work Offset vs Tool Length Offset

Work offsets shift the entire coordinate system for all axes. Tool length offsets affect only the Z axis to compensate for different tool lengths. Both are needed for accurate machining and they work independently of each other.

A typical workflow is to set the work offset using a reference tool then set tool length offsets for each tool relative to that reference. This way changing tools does not affect the work offset. The tool length offset tells the control how much longer or shorter each tool is compared to the reference tool. When you call G43 H1 the control applies the length offset for tool 1 on top of whatever work offset is active.

Common Mistakes

The most common mistake is setting the wrong offset register. If the program calls G54 but you entered your values in the G55 register the machine moves to the wrong position. This can crash the tool into the part or cause the program to cut air. Always verify which offset register the program uses before you start setting values.

Another common mistake is forgetting to set Z zero after changing tools. Each tool has a different length. If you set Z zero with a 2-inch long tool and then run a program that uses a 3-inch long tool the extra inch of length causes the tool to crash into the part. This is why tool length offsets exist and why you must use them correctly.

The third mistake is using the wrong edge finder diameter in your calculation. A 0.200 inch edge finder requires subtracting 0.100 inch for half the diameter. Using the full diameter of 0.200 instead of half shifts your zero by a full diameter. This error is enough to crash a tool into the edge of the part or miss the part entirely.

Worked Example: Setting Up a Two-Vise Job

Let me walk through a real-world example of setting up two vises with separate work offsets. You have a 6-inch vise on the left side of the table and a 6-inch vise on the right side. You want to machine the same part in both vises without reprogramming.

First install both vises on the table and indicate them square to the X-axis. For the left vise jog the edge finder to the left edge of a test part in the vise. Let us say the machine reads X8.500 when the edge finder kicks off. With a 0.200 inch edge finder the true edge is at X8.400. Enter this as the G54 X offset. Repeat for Y and Z.

For the right vise move the edge finder to the right vise part. The machine reads X22.500 at the edge. The true edge is at X22.400. Enter this as the G55 X offset. Repeat Y and Z.

Now your program can start with G54 to machine the left part then call G55 to machine the right part. The same G-code runs for both parts because the work offset shift handles the position difference. This technique doubles your throughput on production runs with minimal setup time.

Using G53 for Safe Positioning

G53 is essential for safe machine operation. Unlike G54 through G59 which shift the coordinate system to the part G53 uses the raw machine coordinates. This makes it predictable regardless of where your work offsets are set.

A common programming pattern at the end of a program is:

G53 G00 Z0 (send Z to machine home) G53 G00 X0 Y0 (send X and Y to machine home) M30 (end program)

This retracts the tool to the machine Z home position then moves the table to the machine X Y home position. The tool is completely clear of the work area and the operator can safely load the next part. Without G53 the machine would try to move to part zero which might not be a safe position.

You can also use G53 for intermediate positioning. For example you might use G53 G00 Z0 before a tool change to ensure the tool retracts fully regardless of the work offset. This is especially important in programs that use multiple work offsets because the Z zero position varies between offsets.

Work Offsets on Different Controls

The process for setting work offsets varies slightly between control manufacturers. On Haas controls the work offset page is accessed through the OFFSET button. The display shows G54 through G59 with X, Y, Z, A, B, and C columns. You type the value and press the corresponding soft key to enter it.

On Fanuc controls you press the OFFSET SETTING button then the WORK soft key. The display shows the external work offset and the G54 through G59 registers. You move the cursor to the desired register and axis then type the machine position and press INPUT.

On Siemens controls the work offset is called a work piece zero offset or G54 frame. The process is similar but the terminology differs. Regardless of the control brand the underlying concept is the same: you are telling the control where your part zero is located in machine coordinates.

For more programming guides see our [G-Code for Beginners](

G90 G54 G00 X0 Y0
G01 Z-0.1 F10
G01 X1.0 F20
M30

/posts/g-code-for-beginners/) and our CNC Workholding Guide.

Tags:#g-code#setup#beginner#mill#reference