Post Processor Engineering

Common Causes of Incorrect G-Code from CAM Post Processors

When posted G-code is wrong, the post processor is often blamed. Sometimes it is at fault; sometimes the cause is in CAM setup or machine data. Knowing the common causes speeds up diagnosis.

Causes by source

SourceTypical causeSymptom
Post selectionWrong machine or controller post chosenWrong codes, alarms, unexpected motion
Controller mismatchPost written for another series or option setUnsupported codes, cycle alarms
KinematicsWrong rotary direction, pivot or limitsWrong positions after rotation, over-travel
Units and formatInch/mm mix, missing decimal pointsMoves 25.4× or 1000× wrong
Modal state bugsPost assumes a modal code is still activeWrong plane, feed mode or offset after a tool change
CAM setupWrong WCS, offset number, tool number or lengthCorrect code, wrong place
Machine dataWrong M-codes, tool change position, limitsFunctions not activating, alarms
G18                  (previous op used XZ plane for arcs)
T5 M06
G00 X20. Y10.
G02 X30. Y20. I10. J0.   (arc intended in XY - but G18 still active!)

(Fix: post always re-outputs G17/G18/G19 at each operation start)

Diagnosing: post or CAM?

  1. Check the CAM toolpath in stock simulation. If it's wrong there, it's a CAM issue.
  2. If CAM is right, simulate the posted G-code. If that's wrong, it's a post issue.
  3. If both simulations are right but the machine differs, check machine data and offsets.

Prevention

  • One approved post per machine, clearly named, under version control.
  • Safe start blocks that restate modal codes at every operation.
  • Built-in post checks for limits, speeds and tool ranges.
  • CAM templates with correct WCS and tool data.
  • G-code simulation for new posts and complex work.
Most incorrect G-code is predictable, and preventable with the right post design.

Fix incorrect G-code at the source

See our CNC post processor development service and post processor debugging.

EM
ENGIMANDI CNC Team

We develop, customise and commission CNC post processors for Fusion, NX CAM, Mastercam, SolidCAM and other CAM systems.