CNC tool chain for PCBs - Part 1 of 3

Per a previous post, I purchased an inexpensive desktop mill for the primary purpose of milling PCBs.  While it came with everything necessary on the hardware side, it's mostly left to the user to determine how to drive it.  For those following a similar path, this is how I've been doing it.

There are three, high level, steps to this process:

  1. Create the PCB image and drill files
  2. Convert the image & drill files to G-Code
  3. Send the G-Code to the mill

The three tools I use for this are:

  1. KiCad
  2. FlatCAM
  3. UGS Platform

Note, I'm a Linux person but I believe these tools will work on Mac and Windows.

To explain my process, I'll  be using a small board I designed and built to work with the ubiquitous ESP8266 8-pin breakout board.  It provides power connections, programming & reset switches and I/O headers.

KiCad

There are many references and tutorials covering how to create a circuit schematic and PCB design with KiCad.  In this document I'm going to focus on the last step, generating the image and drill files.

Setting  the origin

By default, the traces and holes are be referenced to the edge of the sheet, not the edge of the board. You can compensate for this is in FlatCAM but it's much easier and less error prone to tell KiCad to use an alternate origin as the reference point.

Simply select Place > Drill and Place Offset,  position the cross-hairs at the new origin then left-click.  KiCad will place a red, circle&cross at the reference point.   You can see this at the lower left corner of the PCB design example here:

Setting the origin

Generating the Image and Drill files

Select: File > Plot window

Plot window

Traces and Edge Cuts

Start by selecting the layers you're going to mill.  In this example we're going to mill the bottom layer and the edge of the board, i.e.  B.Cu and Edge.Cuts

  • Check to the option to 'Use auxiliary axis as origin'.  This uses the alternate origin you specified above.
  • Make any other changes like, e.g.  You may want to select an alternate Output directory
  • Click 'Plot'
Plot complete

If all goes well you'll see green lines in Output Messages showing the gerber files were generated.

Drill files

  • In the same plot window, select: Generate Drill Files...
  • Once again, be sure to select Drill Origin > Auxiliary axis so everything is referenced to the alternate origin you specified above.
  • While not required, I like to select Drill File Format > Excellon > 'PTH & NPTH in single file so I end up a single file for all holes.
  • Click Generate Drill File
Drill window
Drill complete

Close the Drill and Plot windows.

We now have Image and Drill files which we can pass to FlatCAM.  I'll discuss FlatCAM in a future post.