01 / 20

G-Code
Generation

Learn how Fusion 360 post-processes toolpaths into machine-readable G-code: the universal language that tells CNC machines where to move, how fast to cut, and when to change tools.

Manufacturing Autodesk Fusion 360

What is G-Code?

G-code is a standardized programming language (RS-274 / ISO 6983) used to control CNC machines. Each line of G-code is an instruction that tells the machine exactly what to do: move the tool, turn the spindle on, set the feed rate, and more.

Anatomy of a G-Code Line

G01 X25.400 Y12.700 F500 G-command (linear move) X-axis target (25.400 mm) Y-axis target (12.700 mm) Feed rate (500 mm/min)

Essential G-Code Commands

G00
Rapid move: moves at max speed to a position (no cutting)
G01
Linear cut: moves in a straight line at a controlled feed rate
G02 / G03
Arc cuts: clockwise (G02) and counter-clockwise (G03) arcs
M03 / M05
Spindle: M03 starts spindle (CW), M05 stops it
M06
Tool change: signals the machine to swap to a different tool
G28
Home return: sends the machine back to its reference point

The Post-Processing Pipeline

CAD Model 3D geometry CAM Toolpaths operations & strategies Post-Processor machine-specific config G-Code File .nc / .gcode / .tap CNC Machine cuts the part The post-processor is the critical translation layer. It maps Fusion's internal data to your machine's dialect.

What the Post-Processor Actually Does

Fusion 360's toolpaths are stored in a neutral, internal format. The post-processor reads this data and outputs G-code formatted for a specific machine controller. Different machines need different post-processors because:

1
Command syntax varies: some controllers use G28 for homing, others use G53 or a custom macro.
2
Coordinate systems differ: absolute (G90) vs. incremental (G91) modes, work offsets (G54–G59).
3
Safety codes change: tool-change sequences, coolant commands, and program start/end blocks are machine-specific.
4
Units and precision: some machines expect inches (G20), others millimeters (G21), with varying decimal precision.

Absolute vs Incremental Positioning

G90: Absolute X Y (0,0) (40, 30) (90, 70) G91: Incremental X Y start (+40, +30) (+50, +40)

How to Post-Process in Fusion 360

1
Finish your CAM setup: define stock, create operations (facing, pocketing, contouring), and simulate to verify toolpaths.
2
Open Post-Process dialog: go to Actions → Post Process (or right-click a setup/operation).
3
Select the correct post-processor: choose the one matching your CNC controller (e.g., "Grbl", "FANUC", "Haas", "LinuxCNC").
4
Configure output settings: set units, file name, program number, and any machine-specific options.
5
Post and review: click Post, then open the .nc file and inspect the G-code before sending it to the machine.

Example: Simple Facing Operation

Here is a simplified G-code output for a facing pass on a 100 mm × 50 mm aluminum block. Each line serves a specific purpose:

% (Program start) G90 G21 G17 (Absolute, mm, XY plane) G28 G91 Z0 (Home Z-axis first) T1 M06 (Select tool 1, tool change) S8000 M03 (Spindle on CW at 8000 RPM) G90 G54 (Absolute, work offset 1) G00 X-10 Y0 (Rapid to start position) G00 Z5 (Rapid down to clearance) G01 Z-0.5 F200 (Feed down to cut depth) G01 X110 F500 (Linear cut across face) G00 Z25 (Retract) M05 (Spindle off) G28 G91 Z0 (Home Z) M30 (Program end)

Example: Feed Rate Calculation

The feed rate (F-value) in your G-code is calculated from cutting parameters. The formula for milling feed rate is:

Example: A 3-flute end mill at 8000 RPM with \( f_z = 0.05 \) mm/tooth:

Example: Circular Arc Cuts

X Y (50, 0) (150, 0) G02 (CW arc) G03 (CCW arc) center (100, 0) I = 50
(Clockwise arc from start to end) G02 X150 Y0 I50 J0 F400 (I, J = offset from start point to arc center)

Choosing the Right Post-Processor

Fusion 360 ships with hundreds of post-processors. Selecting the wrong one can produce G-code that crashes your machine or produces wrong cuts. Match the post to your controller brand:

Grbl
Open-source controller used on hobby CNC routers, laser cutters, and 3018 machines
FANUC
Industry-standard controller found on professional milling machines and lathes
Haas
FANUC-based controller with Haas-specific macros and tool-change sequences

Common Mistakes

✕ Wrong Post-Processor
Using a generic post when your machine needs a specific one. Always match the post to your controller brand and model.
✕ Skipping Simulation
Sending G-code directly to the machine without simulating. Fusion 360's built-in simulation catches collisions and gouges.
✕ Wrong Units
Designing in mm but posting in inches (or vice versa). A G20/G21 mismatch can make cuts 25.4× too large or small.
✕ Ignoring Safety Lines
Removing or editing the program header (G28, G90, G54) without understanding what those codes do. This can cause crashes.
✕ No Work Offset
Forgetting to set G54 (or the correct work offset) so the machine doesn't know where the workpiece origin is.
✕ Editing Raw G-Code
Manually editing G-code without re-verifying. One wrong decimal point on a Z-move can plunge the tool into the table.

G-Code File Extensions

Different machines and controllers expect different file extensions. The content is the same G-code: only the extension changes based on convention:

Extension Common Use Controller
.nc Most CNC mills and routers FANUC, Haas, generic
.gcode 3D printers, Grbl-based CNC Grbl, Marlin
.tap Older CNC machines Various legacy controllers
.ngc LinuxCNC machines LinuxCNC / EMC2
.cnc General purpose Various

Key Concepts Summary

Concept What It Does Why It Matters
Post-Processor Translates toolpaths to G-code Machine-specific output
G00 / G01 Rapid move / Linear cut Controls motion type and speed
G02 / G03 Arc cuts (CW / CCW) Creates curved geometry
G90 / G91 Absolute / Incremental Defines coordinate system
M-codes Machine functions (spindle, coolant) Controls auxiliary hardware
Feed Rate (F) Cutting speed in mm/min Affects surface finish and tool life

Question 1 of 5

What is the primary role of a post-processor in Fusion 360?

Question 2 of 5

Which G-code command performs a linear cutting move at a controlled feed rate?

Question 3 of 5

A 4-flute end mill is running at 6000 RPM with a feed per tooth of \( f_z = 0.04 \) mm. What is the resulting feed rate \( F \)?

Question 4 of 5

What happens if you use a post-processor designed for a FANUC controller on a machine running Grbl?

Question 5 of 5

In G-code, what is the difference between G90 and G91?