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.
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
Essential G-Code Commands
The Post-Processing Pipeline
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:
Absolute vs Incremental Positioning
How to Post-Process in Fusion 360
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:
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
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:
Common Mistakes
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?