Writing Custom CAM Post-Processors for GRBL and grblHAL: Fusion 360 and Vectric Configuration
This site's coverage of Fusion 360 CAM, Vectric Aspire, and the various CNC controller firmwares (GRBL, grblHAL, Mach3/4, LinuxCNC) all touch on post-processors in passing — the piece of software that converts CAM's internal toolpath data into the actual G-code your controller understands. Most of the time the stock post-processor that ships with your CAM software just works. But "just works" breaks down the moment you need something the generic post doesn't do by default: a custom tool-change macro for a manual bit swap, spindle warm-up dwell commands, coolant/mist control signals, work-offset handling for a multi-fixture job, or 4th-axis wrapped output on a controller the stock post doesn't explicitly support. This guide covers what a post-processor actually does and how to customize one for GRBL and grblHAL controllers in Fusion 360 and Vectric.
What a Post-Processor Actually Does
CAM software doesn't generate G-code directly from your toolpath strategy — it generates an internal, controller-agnostic representation of the tool motion (positions, feed rates, spindle speed, tool changes) and then hands that off to a post-processor, a small script that translates it into the specific G-code dialect your machine's controller expects. This is why the same toolpath in Fusion 360 produces different-looking G-code depending on whether you select a GRBL post, a Mach3 post, or a LinuxCNC post — same motion, different command syntax, different assumptions about what the controller supports.
Post-processors matter because controllers genuinely differ in what they accept. GRBL, for instance, has historically had limited or no support for canned cycles (G81 drilling cycles, for example) and no support for tool length offset commands the way industrial Fanuc-style controllers use them — a post-processor written for GRBL needs to either avoid those commands entirely or expand them into the raw linear moves that achieve the same result.
Fusion 360: Editing a Post via the Post Processor Library
Fusion 360's post-processors are written in a JavaScript-based scripting language (built on Autodesk's cam-post processor framework), and the stock library includes maintained posts for GRBL, grblHAL, Mach3/4, and most other common hobby controllers. Rather than editing Autodesk's shipped file directly, duplicate it first — Fusion stores custom posts separately from the library defaults, and editing a copy means library updates won't silently overwrite your changes.
- Open the Post Library from the Manufacture workspace (Actions → Post Process → the folder icon to browse the library) and locate the base post closest to your controller — grbl.cps for GRBL, or the grblHAL-specific post if your controller firmware is grblHAL rather than stock GRBL, since grblHAL supports additional G-code (like tool changes and work offsets beyond G54-G59) the base GRBL post doesn't assume.
- Common edits live in a handful of predictable functions: onOpen (program header, units, initial state), onSection (per-toolpath setup — this is where spindle speed and coolant commands typically get written), onManualNC or onCommand (for injecting custom M-codes), and onClose (program footer — safe retract, spindle off, program end).
- To add a manual tool-change pause (essential if your GRBL router has no ATC and every bit change needs a physical stop), find or add an M0/M1 program-pause command inside the tool-change handling, along with a message output via a comment or M0-linked prompt telling the operator which tool number to install next.
- Test changes incrementally — regenerate the post output after each edit and read the resulting G-code, not just trust that the script ran without errors. A post-processor script can run cleanly and still emit G-code your controller silently ignores or misinterprets.
Vectric (Aspire/VCarve): Editing a .pp File
Vectric's post-processors are plain text configuration files with the extension .pp, using a simpler token-substitution format rather than a full scripting language — this makes them more approachable to hand-edit than Fusion's JavaScript posts, at the cost of less flexibility for genuinely complex logic.
- Post-processor files live in Vectric's install directory under a PostP folder; copy the closest matching stock post (again, work from a copy, never the original) and rename it distinctly so it's easy to identify in the post-processor selection dropdown.
- The file is organized into sections with header tags like [header], [Tool_change], [footer], and each contains a mix of literal G-code text and variable tokens (like %toolpath_feed_rate% or %spindle_speed%) that Vectric substitutes at export time.
- Adding a dwell command after spindle start (common advice for router-mounted spindles that need a moment to reach full RPM before the first cut) is typically a one-line addition to the [Spindle_start] section — a G4 P2 for a 2-second dwell, for instance.
- Vectric's documentation includes a full token reference — read it before guessing at a variable name, since an unrecognized token is silently dropped rather than causing an error, which makes typos in this format easy to miss.
Common Customizations Worth Making
CustomizationWhy Manual tool-change pause with a clear on-screen messagePrevents the single most common desktop CNC mistake — starting a multi-tool job and not noticing the controller is waiting at a pause for a bit swap that never happens Spindle warm-up dwellA VFD-driven spindle needs a moment to spin up to commanded RPM; cutting immediately at the very start of a program can start the first pass at a slower actual RPM than the toolpath assumed Coolant/mist output (M7/M8 commands)If you've added a mist coolant solenoid to your setup, having the post automatically toggle it at toolpath start/end (rather than manually flipping a switch) removes a step that's easy to forget Work offset (G54-G59) selection per operationNeeded for multi-fixture batch jobs — the stock post from most CAM software defaults to a single work offset and needs modification to emit different offsets per toolpath group 4th-axis wrapped outputRotary/4th-axis toolpaths need A-axis output in the correct units (degrees vs the linear-equivalent wrapped distance some CAM strategies compute internally) matched to how your specific controller and rotary hardware are configured Safe-Z retract height enforcementAdding an explicit, generous Z retract at every rapid move and at program end guards against a toolpath section transition catching a clamp or fixture that a tighter default retract would clearTesting a Custom Post Safely
- Generate G-code with the new post and read through it manually before ever sending it to the machine — check units (inches vs mm), that spindle speed and feed rate values look sane, and that tool-change sections appear where you expect.
- Run the output through a G-code simulator (CAMotics, NC Viewer, or your CAM software's own backplot) as covered in this site's simulation and verification guide — this catches gross errors like a missing retract or a rapid move plunging through material before it ever reaches the spindle.
- Dry-run the program on the actual machine with the spindle off and the Z height raised well above the stock, watching the full toolpath execute in the air first.
- Cut a cheap, disposable test piece (scrap MDF or foam) before trusting a custom post on real material or a job with real cost invested in the stock.
When Not to Bother
Post-processor customization is worth the time investment when you're hitting a specific, recurring limitation — manual tool changes on every multi-bit job, a coolant system you have to remember to switch by hand, or 4th-axis work the stock post doesn't handle correctly. It's not worth it as a first stop for problems that are actually feeds-and-speeds, workholding, or CAM strategy issues — a post-processor only changes how correct toolpath data gets translated into G-code; it can't fix toolpaths that were wrong to begin with.
A custom post-processor is one of the few genuinely "programming" tasks in an otherwise mechanical hobby, and it pays off precisely in proportion to how repetitive your jobs are — a one-off project rarely justifies the setup time, but a shop running the same multi-tool sign-making or batch production workflow repeatedly will get real, compounding value out of a post that automates the manual steps a stock post leaves to the operator.
Related Guides
- Fusion 360 CAM for Hobby CNC: Complete Guide
- How to Use Vectric Aspire for CNC Routing: V-Carving, 3D Reliefs, and Toolpaths
- How to Use EstlCAM for CNC Routing: Toolpaths, G-Code, and GRBL Control
- CAM Toolpaths Explained: Profile, Pocket, V-Carve, and 3D
- CNC Router Beginner Guide: CAM Software, Toolpaths, and Your First Cut
- CNC Toolpath Strategies Explained: Adaptive Clearing, Trochoidal Milling, and Helical Boring
- Adding a 4th-Axis Rotary to the Wolfpawn 4040 Pro: Wiring and Your First Cut
- Wolfpawn 4040 Pro — Machine Reference & Connection Guide