Table of Contents

Program Zero Alignment

Program zero is the point an NC program treats as X0 Y0 Z0. The machine finds it by adding a work offset — G54, G55 and the rest — to machine zero, so a simulation only cuts where the real machine cuts if the program zero on the model and the work offset in the controller agree. Making them agree is this task, and it runs in one of two directions depending on why the simulation is being built.

Which direction to align

You are Align Because
Planning a job from an NC file, before the part is set up on the machine the work offset onto program zero The workpiece and fixture can sit wherever is convenient; the offset has probably not been measured yet, and the model does not have to match a real table
Reproducing a cut from a controller log, a machine-coordinate feed, or a job already running program zero onto the work offset The recorded data is in absolute machine coordinates, so the part has to sit where it really sits, or collisions, overcut and engagement will not match what happened

Both directions need the workpiece already placed on the fixture and the fixture on the table — that is Anchor, and it comes first.

Where program zero sits on the workpiece

Geom To Program Zero (/general-setup?tree=equipment/workpiece/anchor/geom-to-program-zero) holds the offset from the workpiece geometry to program zero. Set it to whatever point the NC program was written around: for most milling programs that is a corner or the centre of the stock's top face. Nothing else on this page makes sense until that point is where the programmer put it.

Planning: write the offset from where the workpiece is

The Controller branch's Work Coordinates leaf (/general-setup?tree=equipment/controller/program-data/work-coordinates) holds the table the run resolves G54 against, one row per coordinate id.

  1. Place the workpiece and fixture wherever the scene is convenient to work in.
  2. Select the Work Coordinates leaf and find the row the program uses — G54 for most programs.
  3. Press P0 in that row. It writes the machine coordinate the workpiece's program-zero anchor is currently sitting at into the row, which is exactly the number the machine's operator would key in after touching off. M0 beside it writes machine zero instead, which is how a row is returned to no offset at all.

The leaf on a demo project, at /general-setup?tree=equipment/controller/program-data/work-coordinates. The grey line above the table names where this brand keeps the offsets — on Fanuc, its own parameter table — and the rows below it are the coordinate ids that brand holds, with only G54 carrying a value here. The panel is narrow, so the row actions sit off the right edge; the same three are shown in full on the Legacy Controller screen below.

The Work Coordinates leaf of the Control Tree selected on the General Setup page, its panel showing a caption reading that the offsets are stored in the Fanuc parameter table and a table of G54 through G57 rows with X, Y and Z fields, G54 holding values and the rest zero

P0 has something to write only once the scene is assembled. It works out where the program-zero anchor is by walking the machine chain to it, so a project with no machine tool attached, or a workpiece that has not been placed, gives it nothing to compute and it reports that it could not get the machine position at program zero rather than writing a wrong number.

The row's values can also be typed in directly when the offset is already known from the machine. Clicking anywhere in a row marks that coordinate on the canvas, so the offset can be seen rather than only read.

Reproducing a real cut: move the workpiece onto the offset

Going the other way — leaving the offset alone and moving the part to meet it — is Align P0, and it is on the Legacy Controller screen's Coordinate Table tab (/controller/coordinate-table), not on the Controller branch. It moves the workpiece and fixture together, by changing where the fixture sits on the machine table, until program zero lands on the offset the row holds. The toast reports the translation it assigned.

The tab on a demo project. Each row carries P0 and M0 — the same two writes the branch's leaf offers — and ALIGN P0 beside them, which is the one control that moves the part instead of writing a number. Undo Align and Redo Align in the header step back and forth through the alignments this screen has recorded; Show on Display turns the coordinate marker in the viewer on and off, and the checkbox at the left of each row picks which coordinate it marks.

The Legacy Controller screen's Coordinate Table tab: an ISO Coordinate Table with Undo Align, Redo Align and Show on Display in its header, and rows G54 through G59.5 each carrying X, Y and Z fields and an Actions column with P0, M0 and ALIGN P0

Align P0 needs a workpiece, a fixture and a machine tool on the project; without all three it writes nothing and says so. Driving the screen itself — the tab strip, the alignment history and what it does and does not survive — is Legacy Controller.

Warning

Align P0 reads a different table from the one the run uses. The offsets on the Legacy Controller screen and the offsets on the Controller branch's Work Coordinates leaf are two separate stores: typing a value into one does not change the other, and nothing keeps them in step. A run resolves its work offsets through the branch's table, while Align P0 takes its target from the legacy screen's. So before aligning, check that the row you are about to press ALIGN P0 on holds the same offset as the branch's row of the same name — otherwise the part is moved onto a number the program will never use. A project built with both tables filled in agrees only because it was written that way.

Checking that it worked

A wrong alignment — a wrong offset, or a workpiece at the wrong height — shows up as overcut, collision or nocut, and it shows up early: usually within the first hundred or so NC lines. Check it cheaply before committing to a full run.

  1. Set a coarse Initial Resolution on the workpiece's Mesh item — around an eighth of the cutter diameter is enough to see gross errors, and it runs quickly. That is Workpiece.
  2. Run, and watch the opening Z plunge. This is where a wrong offset shows first.
Tip

If the tool plunges far deeper than the programmed depth and the holder gouges the stock, the work offset's Z is almost certainly wrong — the workpiece is modelled higher or lower than it really sits.

One false positive is worth knowing: a roughing cut with a spiral entrance into tough material can legitimately exceed the modelled cutting conditions while the setup is perfectly correct. It is uncommon, and early overcut, collision or nocut usually does mean the alignment is wrong.

When the planned offset is not the real one

In the reproducing direction, the offset aligned to must be the offset the machine was actually using, not the one the job was planned with. Operators re-zero between setups — after a manual tool change, after re-cutting stock — so a planned G54 and the real one can differ by an amount that cannot be assumed in advance.

When the data comes from a controller log, derive the offset from the log's own machine coordinates rather than trusting the plan: an invariant that survives an operator's edits — a known cutting depth, the span of a feature — mapped onto the recorded coordinates recovers the real offset on those axes. Axes the operator may have shifted with nothing to key on are not recoverable this way. A wrong Z is the one that bites hardest, because it places the workpiece away from its true height and the tool over- or under-plunges from the first block.

A placement convention that makes this easier

The three transforms that hold the assembly together can be put anywhere, but a block-on-plate setup is easiest to reason about when each sits at the middle of the face it meets:

Transform A good default
Fixture's Geom To Workpiece The top centre of the fixture geometry
Workpiece's Geom To Fixture The bottom centre of the workpiece geometry
Workpiece's Geom To Program Zero The top centre of the workpiece geometry, or whichever top point the program was written around

Align P0 does not depend on this convention — it works out the fixture's placement from the assembly as it stands, whatever the transforms hold — but a scene built this way is far easier to check by eye.

See Also

  • Anchor — placing the workpiece, fixture and tool relative to the machine, which comes before this
  • Assembly Anchors — the named buckle anchors this alignment resolves against
  • Workpiece — the branch carrying the Geom To Program Zero transform this task sets, and the Mesh resolution the check above uses
  • Fixture — the transform Align P0 rewrites when it moves the part onto an offset
  • Controller — the branch whose work-offset table a run resolves against
  • Legacy Controller — the screen Align P0 lives on, and its alignment history
  • NC Dialects — how each brand's code names the work offset this alignment is expressed against
  • Project Data Checklist — the collection step this alignment closes
  • Workflow: Basic Machining Simulation — driving a simulation from an NC file or a controller log
  • Workflow: Milling Force Parameter Training — milling force training, which depends on a correct setup
  • Setup — the rest of the pre-simulation configuration