Guide

How to mill a PCB on a hobby CNC router

A milled PCB is ready in an hour or two instead of a week from a board house. You need a hobby CNC router (Mach3, GRBL or LinuxCNC), a piece of copper-clad board, a few small bits, and software that turns your design's Gerber files into G-code. This guide uses PCB TraceMill, which is free for Windows, macOS and Linux.

What you need

1. Export Gerber and drill files

In your PCB design program, export the fabrication files, the same ones you would send to a board house. You need the copper layer(s), the board outline and the drill files:

2. Import the files

Open PCB TraceMill and press Import files…. Pick the design program that made them: the import shows how to export from that program and which layers are required, recommended or optional. Then choose the files, the folder or the ZIP (or drop them onto the window). PCB TraceMill recognises every layer (copper, outline, drills, silkscreen…) and ignores BOMs and reports. The File status box shows what was found: copper is required, outline and drills are recommended.

3. Machine, material and the Recipe

On the Manufacture page, pick your machine (presets for Mach3 routers, GRBL 3018, Genmitsu, Shapeoko, LongMill, LinuxCNC and more) and the size of your copper-clad board. Then press Recipe. You get a complete job:

If you have added your own bits to the tool library, the Recipe uses them first.

4. Check the 3D simulation

The Simulation page mills the job in 3D, with copper, fibreglass and walls shaped like the real bit. Turn on the design overlay and check that every trace is separated, that the holes are where they should be, and that the tabs hold the board. Mistakes here cost nothing.

5. Fix the board to the machine

Most failed PCBs fail here, not in the software. What works, learned from real test runs:

6. Auto-level the copper

No board is perfectly flat, and a tilt of 0.1 mm across the board is already more than the cut depth. Auto-levelling measures the real surface and bends the G-code to follow it:

  1. On the Export page, press Generate probe program. Choose the area (board shape, whole sheet or your own), and the grid spacing (15 mm by default for Mach3).
  2. Clip the probe to a sturdy bit and run the program. Mach3: the heights stay in Mach3's own variables, so there is nothing to install and no file to load. GRBL / LinuxCNC: load the probe log your controller saved. PCB TraceMill checks it and refuses results that look wrong.
  3. Save the corrected G-code. Each file stops before every bit to find Z0 on the copper with the probe. The board map shows where each bit will touch, and you can move any point with a click.

7. Mill

Run the files in order: isolation, drilling, then the cutout. Keep the speeds PCB TraceMill sets, because fast cuts push the board and snap 0.1 mm tips. For a double-sided board, flip it on the alignment pins when the files say so. Break the board out of its tabs, deburr the edge, and it is ready to solder.

Common problems

Get PCB TraceMill

PCB TraceMill is free and open source (MIT) for Windows, macOS and Linux. It is an easy-to-use alternative to FlatCAM, CopperCAM and similar tools, and explains every setting in plain words.

Download PCB TraceMill Source on GitHub

Did this guide help you mill your first board? You can support PCB TraceMill on Ko-fi – it keeps the app free and pays for more test runs.