Lesson 2: Coordinate Systems and Work Offsets

Updated

In short

Machine zero is a fixed reference point set by the machine builder, while work zero (G54–G59) is a point on the part chosen by the programmer, whose machine coordinates are stored in the offset table. In G90 coordinates are measured from the work zero, in G91 from the current position; G53 moves in machine coordinates and G91 G28 Z0 returns Z to the reference point.

In this lesson you will learn:

  • the difference between machine zero and work zero;
  • how G54–G59 work and how G54 is set;
  • how to write the same move in absolute (G90) and incremental (G91) coordinates;
  • when to use G53 and G28.

Machine zero and work zero

Machine zero (the reference point) is a fixed point set by the machine builder. At power-on the axes are homed to it or, with absolute encoders, the position is known immediately. On most vertical machining centres machine zero is at the positive end of travel, so machine coordinates in the working area are usually negative. The screen shows them as MACHINE.

Work zero is a point on the part chosen by the programmer, from which all program coordinates are measured. In this course the G54 zero is the front left corner of the plate seen from above (X0 Y0), and Z0 is the top surface. X increases to the right, Y away from the operator and Z upwards (more in CNC machine axes and coordinates).

PointX, mmY, mmZ, mm
Front left corner (zero)000
Front right corner10000
Back right corner100600
Back left corner0600
Plate centre50300
Plate bottom––−20

G54–G59: work coordinate systems

The control's offset table (WORK OFFSET) holds six standard work offsets G54–G59; with an option, G54.1 P1–P48 are added. Each line stores the machine coordinates of the work zero. The relation is simple: work coordinate = machine coordinate − offset.

Example: G54 X = −412.350, Y = −215.800. With the tool at machine position X −362.350, Y −185.800, the work coordinate display shows X50.0 Y30.0 – the plate centre. Several parts on the table can each have their own zero (G54, G55…), and the same machining code runs by changing only the G code. G54 is modal; many controls select it at power-on, but it is good practice to program it explicitly.

How G54 is set

  1. Clamp the part (see workholding).
  2. Load a Ø10 mm edge finder and run it at the speed its maker specifies. Touch the left side of the plate approaching from −X. At that moment the edge finder centre is 5 mm left of the edge, i.e. at work X−5. If machine X = −417.350, then G54 X = −417.350 + 5 = −412.350.
  3. Touch the front side from −Y in the same way: G54 Y = machine Y + 5.
  4. Z0 is set by touching the top surface with a reference tool, a probe or a tool setter. How Z is split between G54 Z and the tool length offset H depends on the shop's method.

A 3D probe does the same automatically with measuring cycles, but the principle is unchanged.

G90 and G91: the same move written two ways

Suppose the tool is at X10 Y10 and must travel round an 80 × 40 mm rectangle to X90 Y10, X90 Y50, X10 Y50 and back. In absolute coordinates (G90) each block gives the target point measured from the zero:

G90 G01 X90.0 Y10.0 F1200
Y50.0
X10.0
Y10.0

In incremental coordinates (G91) each block gives the distance and direction from the current position:

G91 G01 X80.0 F1200
Y40.0
X-80.0
Y-40.0
G90

PropertyG90 absoluteG91 incremental
ReferenceWork zero (G54…)Current tool position
Error in one blockAffects only that pointCarries over to all following points
Typical useMain programRepeated features, subprograms, G28

G53: moving in machine coordinates

G53 is non-modal: in that block coordinates are machine coordinates, regardless of G54. For example, G53 G00 Z0 lifts the spindle directly to machine Z zero (the top position on most machines), with no intermediate point. G53 is used in G90 mode with cutter radius compensation cancelled.

G28: reference point return

G28 sends the programmed axes to the reference point via an intermediate point. The safe habit is G91 G28 Z0: in G91 the intermediate point is 0 mm from the current position, so Z goes straight up. A dangerous mistake is G90 G28 Z0: the intermediate point is then work Z0 – the plate surface – and the tool first moves down to it. Similarly, G91 G28 X0 Y0 brings the table to the reference position for unloading. Always restore G90 after G28.

Exercise

The tool is at X20 Y15 (G90). Rewrite this path in incremental coordinates (G91):

G90 G01 X80.0 Y15.0 F1200
X80.0 Y45.0
X50.0 Y45.0
X20.0 Y15.0

Tip: for each block, subtract the previous point's coordinates from the new one. For a closed contour the X and Y increments must each add up to zero. The answer is in the FAQ.

Next lesson: Lesson 3: Rapid and linear moves G00 and G01.

Frequently asked questions

What is the difference between machine zero and work zero?

Machine zero is a fixed reference point set by the machine builder. Work zero is a point on the part chosen by the programmer, whose machine coordinates are stored in the G54–G59 offsets.

Why write G91 G28 Z0 rather than G28 Z0?

G28 moves via an intermediate point. With G91 the intermediate point is the current position, so Z goes straight up; with G90 it would be work Z0, i.e. the part surface.

When should I use G53 and when G28?

G53 G00 Z0 moves straight to a machine coordinate with no intermediate point; G28 returns to the reference point via an intermediate point. Both are non-modal, but exact behaviour depends on the control.

Can one program use several work offsets?

Yes. For example, two parts in two vices can use G54 and G55, and the same machining section is run for each zero.

Exercise answer

G91 G01 X60.0 F1200; Y30.0; X-30.0; X-30.0 Y-30.0; then G90. Check: the X increments add up to 60 − 30 − 30 = 0 and the Y increments to 30 − 30 = 0, so the tool returns to X20 Y15.

Looking for someone to do this job? Find a manufacturer on the marketplace or post a request.

Services offered I need a service