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
- A CNC router. A 3018-class GRBL machine works, and so does a bigger Mach3 or LinuxCNC router. Any machine that runs G-code is fine.
- Copper-clad board (FR4, single- or double-sided). The copper is only 0.035 mm thick, which is why levelling matters.
- An isolation bit. Best results come from a tapered end mill, then a pyramid bit, then a V-bit, all with a 0.1 mm tip and 10–20°.
- PCB drills for the holes and a corn / router bit (about 1–2 mm) for the cutout.
- A probe clip and a wire for auto-levelling. Most machines have a probe input.
- Masking tape and glue to hold the board flat.
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:
- KiCad: File → Fabrication Outputs → Gerbers (F.Cu, B.Cu, Edge.Cuts), then Generate Drill Files (Excellon).
- EasyEDA / JLCPCB: Fabrication → PCB Fabrication File (Gerber). You get a ZIP, which you can import as it is.
- Altium, Eagle, Fusion Electronics: the normal Gerber RS-274X + Excellon output.
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:
- Isolate traces cuts a groove around every trace and pad. The depth and the number of passes come from the narrowest gap measured on your board. With smart clearance, narrow gaps get one groove down the middle, so a slightly wide groove eats the gap and not your traces.
- Drill holes are grouped by drill size. Holes bigger than your drills are milled in a gentle spiral.
- Cut out board cuts outside the outline and leaves small tabs, so the board stays in place until the end.
- Double-sided boards get alignment pins on the flip line, so both sides line up.
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:
- Centre the board on the sheet. The middle is the flattest part.
- Solder a ground point on a corner for the probe clip.
- Put masking tape on the board and on the table, with glue between, then press them together.
- Wait about 30 minutes for the tape to settle, then probe, and mill right after.
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:
- 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).
- 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.
- 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
- Traces still shorted in some places: the groove was too shallow there. Use auto-levelling, and check that the board is taped down flat.
- Traces cut too thin or missing: the groove was too deep or the bit too wide. Use a smaller tip, let the Recipe pick the depth, and probe again.
- Broken V-bit tips: the feed was too fast or the bit plunged into the board. Use the suggested speeds, and probe with a sturdy bit or a steel pin.
- Double-sided board out of line: drill the alignment pins and flip on them, not by eye.
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.