7 G-code checks to run before you press Cycle Start

Most crashes don’t come from exotic G-code. They come from a handful of ordinary mistakes that are easy to miss when you’re reading a program top to bottom on a control screen. Before you run a new or edited program, walk through these seven checks.

1. Units and positioning mode

Look at the safety line near the top of the program. Is it G20 (inch) or G21 (metric), and does that match the drawing and the CAM post? Is the program in G90 (absolute) or G91 (incremental)?

A program written in inches and read as millimetres moves 25.4 times less than you expect — or the other way round. A forgotten G91 turns every coordinate into a distance from the current position, which is how a tool ends up deep in the vise.

2. Work offset

Find the work offset the program calls (G54, G55, G154 P…, G54.1 P…) and make sure it’s the one you actually set on the machine for this job. Programs copied from an older job often still point at last month’s fixture.

3. Tool length offset matches the tool

On a mill, every tool change should be followed by a tool length offset for that tool: T5 M06 then G43 H05. An H number left over from the previous tool is one of the most common crash causes — the control thinks the tool is a different length than it really is.

On a lathe, check that each T call uses the offset number you meant: T0303 loads tool 3 with offset 3, while T0300 cancels the offset.

4. Rapid moves near the part

Search for every G00. For each one, ask: where is the tool coming from, and is there anything in the way? Watch for:

  • A rapid straight down in Z to a cutting depth instead of to a clearance plane.
  • A rapid in X and Y at a Z level that is still below the top of the stock or the clamps.
  • On a lathe, a rapid toward the chuck or into the diameter of the bar.

5. Cutter compensation in and out

If the program uses G41/G42, check that compensation is turned on with a linear lead-in move that is longer than the tool radius, and turned off with G40 on a move away from the part. Turning comp on or off during an arc, or with too short a move, can gouge the part or trigger an alarm on the control.

6. Spindle speed limits on the lathe

With constant surface speed (G96), the spindle speeds up as the tool moves toward the centre. Make sure a maximum spindle speed (G50 S… on most Haas and Fanuc lathes) is set before G96, and that it is safe for your chuck, jaws and part. Without it, facing to center can push the spindle to its top speed.

7. The end of the program

Check the last lines: coolant off, spindle stopped, tool sent to a safe position (G28 or your shop’s preferred return), and M30 to end and rewind. Also check subprograms and macros: every M98/M97 call needs a matching M99 return.

Prove the first run

Even with a clean checklist, the first run of a new program is the riskiest: use single block, turn the rapid override down, and keep a hand near Feed Hold. Better still, run the program through a simulator first so you can watch every move — including the ones that happen faster than you can read the screen.

That is exactly what NC Proof is built for: it reads Haas and Fanuc programs the way the control does, draws every move on the stock, and flags the mistakes above before the program reaches the machine.