Trace It, Drill It, Build It: Your Guide to CNC PCB Making

by czwienczek in Circuits > Electronics

5030 Views, 64 Favorites, 0 Comments

Trace It, Drill It, Build It: Your Guide to CNC PCB Making

2025-06-09_09h29_10.png
2025-06-09_09h27_36.png
2025-06-09_09h39_46.png

Welcome to this hands-on journey into the world of homemade PCB manufacturing — a complete, cost-effective process for creating single-sided and even double-sided printed circuit boards using accessible tools and techniques.

In this presentation, you'll discover how to:

  1. 🛠️ Design and prepare PCBs using intuitive software like Fritzing for circuit layout, FlatCAM for CAM processing, and Candle for CNC control.
  2. 💡 Leverage low-cost CNC machines, including modified 3D printers, to mill and drill your own professional-grade PCBs at home.
  3. 🎯 Master essential tips and tricks to avoid common pitfalls, improve precision, and achieve clean, reliable results — even on your first try.

Whether you're a hobbyist, student, or engineer, this guide will empower you to bring your electronic designs to life with precision and confidence — all without relying on expensive fabrication services.

Supplies

2025-06-09_09h31_50.png
2025-06-09_09h32_32.png
2025-06-09_09h40_37.png
2025-06-09_10h29_27.png

Machine Setup Overview

  1. Base Machine: Standard FDM 3D printer (e.g., Ender 3) modified with:
  2. A spindle motor or mini drill mounted in place of the extruder.
  3. Reinforced Z-axis for vertical stability.
  4. GRBL-compatible controller for CNC operation.
  5. Toolpath Depths:
  6. Trace Isolation (Z): −0.06 to −0.08 mm
  7. Drilling (Z): −2.5 mm (or board thickness)
  8. Cutout (Z): −1.6 to −2.0 mm (with tabs)

Finishing and Post-Processing

  1. Abrasive Tools:
  2. Fine-grit sandpaper or abrasive pads for edge smoothing.
  3. Optional: fiberglass brush for cleaning copper surface.
  4. Cleaning:
  5. Isopropyl alcohol to remove dust and debris.
  6. Compressed air or vacuum for fine particle removal.

Free Software

2025-06-09_09h48_02.png

Simple and easy process

Design the PCB in Fritzing and export Gerber files.

Import Gerber files into FlatCAM to generate G-code.

Send G-code to the CNC/3D printer using ControlM or a G-code sender.

Mill and drill the PCB using the adapted 3D printer.

1. FritzingPCB Design Tool

  1. Purpose: Used to design the electronic circuit and generate Gerber files, which are standard for PCB manufacturing.
  2. Key Features:
  3. Visual breadboard and schematic views.
  4. Easy export of Gerber files for PCB production.
  5. Website: fritzing.org

2. FlatCAMCAM Processor for PCBs

  1. Purpose: Converts Gerber and Excellon files into G-code for CNC milling.
  2. Key Features:
  3. Supports isolation routing, drilling, and board cutouts.
  4. Allows editing and previewing of toolpaths.
  5. Website: flatcam.org

3. ControlM / G-code SenderMachine Control

  1. Purpose: Sends the G-code to a CNC machine or modified 3D printer equipped with a drill.
  2. Common Tools: Universal G-code Sender (UGS), ControlM, or similar.
  3. Function: Executes the milling and drilling operations to create the physical PCB.
  4. Website: https://tyvok.com/blogs/news/best-grbl-software-2025-ugs-candle?srsltid=AfmBOopvOAhyp3CPnNsAjxci3akkO0bE0SkW7dPfNZRaa0AkoHno_ZVC

Machine 3D --> Drilling.

2025-06-09_09h49_21.png

https://reprap.org/wiki/Cyclone_PCB_Factory

Setup (Clearance, Distance, Sizes)

2025-06-09_10h00_39.png
2025-06-09_10h07_07.png
2025-06-09_10h07_33.png
2025-06-09_10h10_42.png

1.1 Design Rule Configuration (DRC)

Before generating Gerber files, it’s essential to configure the Design Rules (DRU) to match the mechanical capabilities of your adapted 3D printer.

ParameterRecommended ValuePurpose

Clearance

8 mils (≈ 0.2 mm)

Minimum spacing between traces and pads. Use 16 mils if soldering is difficult.

Trace Width

24 mils (≈ 0.6 mm)

Ensures traces are wide enough for reliable milling and current capacity.

Annular Ring

+50% over default

Ensures enough copper around drill holes. Recommended: 10–40 mils.

Minimum Drill Size

≥ 0.6 mm

Matches the smallest drill bit your machine can handle.

💡 Tip: Save these settings in a custom .dru file for reuse.


Loading and Applying the DRU File in EAGLE

2025-06-09_10h14_35.png
2025-06-09_10h14_57.png
2025-06-09_10h15_38.png

2.1 Load the Custom Design Rule File (DRU)

To ensure your PCB design is compatible with CNC milling and drilling, follow these steps to load the custom CNC_THT.dru file:

  1. Copy the CNC_THT.dru file into EAGLE’s dru directory (typically located in the EAGLE installation or user documents folder).
  2. Open your PCB layout in EAGLE.
  3. Go to Tools > DRC... (Design Rule Check).
  4. In the DRC window, click Load, then select the CNC_THT.dru file.
  5. Click Apply to activate the rules.
  6. Click Check to run a design rule verification.

2.2 Fixing DRC Errors

After running the DRC check, EAGLE will highlight any violations. Common issues include trace clearance and pad spacing.

🔧 How to Fix Clearance Errors:

  1. Click on each error in the DRC report.
  2. Manually adjust the trace width, spacing, or pad position using the Move or Ripup tools.
  3. Re-run the DRC check until all critical errors are resolved.


Generating Gerber and Drill Files

2025-06-09_10h17_08.png

Once your design passes the DRC check, you can generate the manufacturing files:

3.1 Export Gerber Files

  1. Open the CAM Processor from the top toolbar.
  2. In the CAM job:
  3. Select Top Copper and Bottom Copper layers.
  4. Enable Board Outline and Cutouts if needed.
  5. Click Process Job.
  6. EAGLE will generate a folder named CAMOutputs containing:
  7. Gerber files for copper layers.
  8. Excellon drill files.
  9. Board outline files (if configured).


CAM File Generation in FlatCAM

2025-06-09_10h20_24.png
2025-06-09_10h20_43.png
2025-06-09_10h21_00.png
2025-06-09_10h21_37.png
2025-06-09_10h21_57.png
2025-06-09_10h22_28.png
2025-06-09_10h22_45.png
2025-06-09_10h23_06.png
2025-06-09_10h23_30.png

FlatCAM is used to convert Gerber and Excellon files into G-code for CNC milling and drilling. This step is crucial for preparing your PCB design for physical fabrication.

6.1 Initial FlatCAM Configuration

Before importing files, configure FlatCAM to correctly interpret Excellon drill files:

  1. Open the FlatCAM command line (bottom of the interface).
  2. Enter the following commands:

  3. This ensures leading zero suppression is handled correctly, avoiding misaligned drill holes.

6.2 Generating Toolpaths for Copper Traces

1. Import the Bottom Copper Layer

  1. Go to File > Open Gerber… and select copper_bottom.gbr.

2. Configure Units and Mirror the Layer

  1. Navigate to Tool > Double-Sided PCB Tool:
  2. Bottom Layer: copper_bottom.gbr
  3. Mirror Axis: Y
  4. Axis Location: Box
  5. Reference Object: copper_bottom.gbr

3. Generate Isolation Geometry

  1. In the Plot Options, enable:
  2. ✅ Plot
  3. ✅ Solid
  4. Under Isolation Routing:
  5. Tool Diameter: 0.2 mm (adjust based on your bit)
  6. Width: 1 (number of passes)
  7. Pass Overlap: 0.5 (only if Width > 1)
  8. Click Generate Geometry to create the isolation path.

4. Create CNC Job for Traces

  1. Set the following parameters:
  2. Cut Z: -0.06 to -0.08 mm (depth of cut into copper)
  3. Travel Z: 1.5 mm (safe height for travel moves)
  4. Feed Rate: 50–80 mm/min (adjust based on material and bit)
  5. Spindle Speed: 9000 RPM (or your spindle’s optimal speed)
  6. Click Generate to create the G-code.

6.3 Generating Toolpaths for Drilling Holes

1. Import the Drill File

  1. Go to File > Open Excellon… and select drill_1_16.xln.

2. Mirror the Drill Layer

  1. Again, use Tool > Double-Sided PCB Tool:
  2. Bottom Layer: drill_1_16.xln
  3. Mirror Axis: Y
  4. Axis Location: Box
  5. Reference Object: copper_bottom.gbr

3. Configure Drill Tool Parameters

  1. In the Tools Table, ensure:
  2. Drill diameters are sorted in ascending order.
  3. Each tool is correctly assigned to its hole size.

4. Create CNC Job for Drilling

  1. Set the following parameters:
  2. Cut Z: -2.5 mm (adjust based on PCB thickness)
  3. Travel Z: 1.5 mm
  4. Feed Rate: 30–50 mm/min
  5. Tool Change Z: 30 mm (safe height for manual tool changes)
  6. Spindle Speed: 9000 RPM
  7. Click Generate to produce the drill G-code.

Best Practices

  1. Always preview toolpaths before exporting G-code.
  2. Use consistent units (mm or inches) across all tools.
  3. Save your FlatCAM project to avoid reconfiguration later.
  4. Label your G-code files clearly (e.g., trace_bottom.gcode, drill_job.gcode).

CNC Milling and Drilling

2025-06-09_10h25_06.png
2025-06-09_10h27_33.png

This step involves executing the G-code files generated in FlatCAM to physically mill the copper traces and drill the component holes on your PCB using a CNC machine or modified 3D printer.

🧰 7.1 Preparing for CNC Operation

Before starting, ensure the following:

  1. Your machine is mechanically calibrated (X/Y/Z steps/mm, backlash compensation).
  2. The bed is leveled and the PCB is securely fixed using clamps or double-sided tape.
  3. The spindle or drill motor is properly mounted and aligned.
  4. You have the correct drill bits and engraving tools (e.g., 0.2 mm V-bit for traces, 0.8–1.0 mm for holes).

🖥️ 7.2 Using Candle v1.1.7 for CNC Control

Candle is a lightweight G-code sender compatible with GRBL-based CNC controllers.

✅ Steps to Load and Run G-code:

  1. Launch Candle v1.1.7 and connect to your CNC via USB.
  2. Home the machine (if endstops are installed) or manually set the origin:
  3. Move the tool to the bottom-left corner of the PCB.
  4. Lower the Z-axis until the tool just touches the copper surface.
  5. Click “Reset Zero” for X, Y, and Z axes.
  6. Load the Milling File:
  7. Click “Open” and select your trace milling file (e.g., Name_PCB.nc).
  8. Review the toolpath preview.
  9. Click “Send” to begin milling.
  10. Change Tool for Drilling:
  11. After milling, pause the machine, raise the Z-axis, and change the tool to a drill bit.
  12. Re-zero the Z-axis only (X and Y remain unchanged).
  13. Load the Drilling File:
  14. Open the drill G-code file (e.g., Name_FORI.nc).
  15. Click “Send” to start the drilling operation.

See. Recommended CNC Parameters picture.


Tips:

  1. Always simulate your G-code in Candle before running.
  2. Use dust extraction or vacuum to keep the workspace clean.
  3. After milling and drilling, inspect the board under magnification for:
  4. Burrs or copper bridges.
  5. Misaligned holes.
  6. Incomplete traces.