Controllers

Controllers and G-code

NativeCAM writes each controller's own dialect, and its export checks hold every file to that controller's rules. Here's what it supports, and how far each one has been tested.

Supported controllers

ControllerMachinesFilesStatus
Avid Mach4Avid PRO series on Mach4.tapRun on a real machine
Grbl 1.1, grblHAL, FluidNC, Carbide MotionShapeoko, X-Carve, LongMill, AltMill, many DIY machines.ncFrom documentation and firmware source
LinuxCNCLinuxCNC and PathPilot machines.ngcFrom documentation
MassoMasso G3 machines, Onefinity Elite (Masso).ncFrom documentation
Centroid CNC12Acorn, Oak, Avid EX.cncFrom Avid's EX posts
BuildboticsOnefinity (original controller).ncFrom documentation
ShopBotShopBot (OpenSBP part files).sbpFrom ShopBot's command reference and vendor posts
RichAuto DSPAxiom and many full-sheet routers.ncConservative; its handling is undocumented
Anything elseWith your own Vectric .ppThe post'sChecked against the controller's rules where known

Only Avid Mach4 output has run on a real machine so far. Treat the rest as unverified: run the acceptance test, then air-cut. Results from your own machine are what move a controller from "from documentation" to tested, so please report them.

Pick the controller with the setup assistant or under Job Setup ▸ Machine ▸ Controller.

Avid Mach4

The post is modelled on Avid's own Vectric post (v3) and Fusion 360 post, so files behave like the ones Avid supports:

  • .tap files with CRLF line endings and parenthesised comments (nested parentheses become braces).
  • A safety line G00 G94 G20 G17 G90 G40 G49 G80 (or G21 for metric), then G91.1 for incremental I/J and G64.
  • Tool changes retract, stop the spindle, then call T#M6, so Avid's M6 macro handles the manual change and touch plate. ATC machines also get G43 H#. An optional M00 pause mode suits setups without an M6 macro.
  • M07 turns the dust collector on after each tool change, then S#### M03 and an optional G04 P# spin-up dwell, always written with a decimal point.
  • Arcs as G02/G03 with I/J, each under 180°, including helical arcs. 4 decimal places in inches, 3 in millimetres.
  • The footer retracts, parks, then M05, M09, M30.

Grbl family

Grbl 1.1, grblHAL, FluidNC and Carbide Motion have strict parsers, so the post only writes what each one accepts:

  • G90 G94 G17 and G20/G21; no G64, G90.1, G43 H or canned cycles. .nc files with LF line endings, every line within Grbl's 79-character limit (126 on FluidNC); long comments are shortened.
  • M8 for the dust collector (stock Grbl has no M7), S#### M3, and G4 P dwells in seconds.
  • Arcs as G2/G3 with incremental I/J, cut as lines where rounding would trip Grbl's arc check (error 33).
  • Tool changes. Stock Grbl rejects M6 but keeps running the lines after it, so the next tool's cuts would run with the old bit. NativeCAM writes T# M6 only where something stops for it: Carbide Motion, a tool changer, or gSender or CNCjs named as the program that sends the file. Otherwise each tool gets its own file. Choosing the pause (M0) tool change keeps one file for senders that handle it.
  • Run-time estimates use Grbl's planner: 16 blocks of look-ahead, a 0.01 mm junction deviation and rapids blended like feeds.

Other controllers

ControllerWhat NativeCAM writes
LinuxCNC.ngc; G91.1 and G64 P blending at the arc tolerance; T# M6 then G43 H# (LinuxCNC's M6 doesn't apply the tool length); M8; G4 P in seconds; checked strictly, as LinuxCNC rejects anything it doesn't know.
Masso.nc; T# M06 (Masso applies the length itself); G4 P in whole milliseconds; no G43, G64 or G91.1, which Masso's documentation doesn't list.
Centroid CNC12.cnc with CRLF, as Avid's EX posts write; T# M6 then G43 H# from CNC12's tool library; M7.
Buildbotics.nc; G91.1; T# M6, which pauses for the change by default.
ShopBot (OpenSBP).sbp part files, not G-code: a check of ShopBot's unit setting before any move, SA, MS/JS speeds in units per second, M2/M3/MZ and J2/J3/JZ moves, CG arcs, PAUSE n dwells and END. Spindle and tool-change commands follow ShopBot's own posts. Without a tool changer each tool gets its own file.
RichAuto DSP.nc in millimetres only, with no comments and arcs as short lines (their handling isn't documented), one file per tool.

Your own Vectric post

For a controller NativeCAM has no post for, Job Setup ▸ G-code Output ▸ Use a Vectric Post… runs your own Vectric .pp file as a template. Arcs the post can't express are written as short lines, a post with no tool-change block saves a file per tool, and posts that need rotary wrapping or inverse-time feeds are refused. Before you use it, a sheet compares its output with NativeCAM's own post on the acceptance test. NativeCAM never ships or shares anyone's posts. Tutorial →

Export checks

On export, NativeCAM reads back the file it's about to save and checks it before the save panel appears:

  • Against the controller. Units set before moving and matching the machine, line length, accepted codes, I/J only on arcs, arc radii within the controller's tolerance, a feed before the first feed move, tool numbers, dwells written so the controller reads the right unit, the spindle on before cutting, a lift to safe Z before the first sideways move after each tool change, and no rotary (A) moves for a controller without a rotary axis.
  • Against the toolpaths. Every cutting move, arc direction and centre, feed, dwell, tool and spindle speed is compared with what the toolpaths asked for. This catches post bugs a simulation of the toolpaths can't, such as doubled coordinates or a dwell in the wrong unit.
  • Against the machine. The whole program, retracts and park included, is measured against the machine's travel and Z travel with the tool's stick-out.

Errors ask you to confirm before exporting; the command line refuses to write a failing file without --force. Export Air Cut… saves the same program with every Z raised, and Export Setup Sheet… saves a printable page for the machine (example).

Trying a new controller safely

The acceptance program has a square, circles from 1 to 50 mm radius in all four quadrants, a helix, a 3-second dwell and two tool changes.

  1. Run it in check mode where the controller has one (Grbl's $C).
  2. Run it as an air cut.
  3. Run it 0.5 mm deep in scrap and measure the circles. Unit and arc errors show up in their sizes, and re-zero errors in the depth after each tool change.

Save it from the last page of the setup assistant, or from the command line:

swift run -c release nativecam-cli acceptance --controller grbl --sender gSender --units mm

Controller names: grbl, grblHAL, fluidNC, carbideMotion, linuxCNC, masso, centroid, buildbotics, openSBP, richAuto.