Create Prototype PCBs on Your Home CNC

April 2021

The one thing I wish I understood before starting on my home PCB milling project was that this was a new skill and it takes significant time and focus to master. It probably took me close to 3-4 weeks of focused effort to go from knowing almost nothing about using a CNC to producing a usable PCB. Now that I have this skill, producing new PCB prototypes will be super fast, but if you think this is a one-off project for you, you may be happier just sending the Gerber / Excellon files out to a PCB manufacturer and waiting a few weeks for a cheap and high quality board.

Overall, I was happiest doing Scratch Milling as described by Robin Debreuil simply because it’s very fast once you have figured out how to do it.

The Workflow

Screen Shot 2021-04-01 at 8.28.56 AM.png

Create the circuit schematic

Plan out your design. I used the open source software KiCad. Some people like Eagle.

IMG_1929.jpeg

Test the design

Prove that your design work using a breadboard. It’s messy, but this is why we want to make a PCB.

Screen Shot 2021-03-30 at 7.26.52 AM.png

Create the board layout

KiCad is again useful for this step. This is where you actually lay down traces.

Screen Shot 2021-04-06 at 8.08.29 AM.png

Make a jig

For a double sided board, you need a) to pick an axis that you can very accurately flip the PCB around b) the copper clad needs to be perfectly placed in a known location that is parallel with the axis c) you need a very level service so the tiny bits evenly scratch or mill the surface of the PCB. A jig makes this all work.

Screenshot 2021-04-17 073932.png

Prepare the gcode

  • Export Gerber and Excellon from KiCad

  • Import Gerber and Excellon into FlatCam

  • Export gcode from Flatcam

  • Open gcode in bCNC

IMG_1982.jpeg

Mill & Drill

After all the prep, it’s time to go and make this thing!

  1. Drill mounting holes on the copper clad

  2. Mount the clad to the milling part of the jig

  3. Zero X,Y,Z

  4. Drill/mill holes

  5. Auto-level

  6. Scratch mill side A

  7. Flip clad

  8. Scratch mill side B

Handy Resources

Process

Documentation Links

  • KiCad manual

  • FlatCam manual - While this documentation is very good, it seems to be written for version 8.5 which isn’t as feature rich and usable as the most recent versions.

  • bCNC wiki

IMG_1939.jpeg
  • I went with 3/8” HDPE cut into 6” squares from Tap Plastics. They had it ready 10 minutes after I called them which was way better than ordering something online and waiting. I got 10 of these square for $33 and went through 6 of them when figuring out my jig.

  • I’ve been using 2”x3” double sided FR1 Copper Clad from Carbide 3D. FR1 is a resin core as opposed to the more common FR4 fiberglass core. Milling either of these will produce dust that you probably don’t want to breath, and resin sounds less awful than fiberglass so I’m going to stick with that.

  • I ordered the Carbide 3D Nomad 3 CNC shortly after it was announced. This is their 2nd or 3rd iteration of the machine. I liked that they have an established community which made me feel like I’d get better support. Their documentation could be better. The machine has been rock solid so far. There are other machines out there, some very inexpensive, that could work too.

  • I started with the variety pack of bits from Carbide3D because I had no clue what I was doing. These are expensive compared to what you can find at Amazon and since you’ll be breaking bits, you’ll need extras. For these reasons, I would suggest buying 10 packs of the size you need. What size do you need? My current opinion is that for holes 1mm and larger, a 1mm bit will work well for both drilling (1mm holes) and milling (holes larger than 1mm). For holes smaller than 1mm, you’ll find that the drill bits flex a bit and milling doesn’t always give you a hole that is the size you expect. Therefore, try and get bits that are as close to hole size as possible. For my application, I found that I was able to do what I needed with this 1mm bit, this 9mm bit, and this 8mm bit.

  • After experimenting with this engraving bit, I found I was getting results much faster using the scratch milling technique described by Robin using this fine tipped carbide scribe tip. I believe the more narrow tip gives you more room for error when the PCB isn’t perfectly flat. Make sure you find one that works with the 1/8” collet on your Nomad or the correct size for your machine.

  • Since the Nomad 3 comes with a BitZero2, I found it pretty easy to rig up a PCB auto-level sensor using the following parts:

    — M8 bolt

    — M8 nut

    — wire

    — ring terminal or something similar that will attach to PCB

  • Robin advises using rivet nuts to mount the PCB to the jig because they don’t have threads are should be more accurate to mount. I used these M3 rivet nuts and they seemed to work, but if I had to do it again, I would try getting it to work with M3 screws since I have a lot of those around. You’ll also need M3 nuts to secure the PCB to the to the jig when milling / drilling. I found some flat head ones at the local hardware store which I liked because they provide more clearance for the CNC tool.

Shopping List

IMG_1972.jpeg

Jig design considerations

Figure out how to mount the jig to the base plate of the CNC - In my case I bought the threaded table from Carbide 3D and designed my jig to mount to the 4 of the 1” spaced holes. If I had looked more carefully at Robin’s design, I would have realized that he built his jig using the same size and bolting pattern that the waste board uses. I think I could have saved some money using Robin’s approach.

Dedicated mounting hole drilling space - For my 2”x3” jig, I use the top pocket for drilling the mounting holes while the PCB clad is attached with double sided tape. I added tabs on each side to make it easy to pry the PCB out of the pocket.

Dedicated pocket for drilling / milling - The bottom pocket is optimized for drilling and milling. By having the PCB only touching jig at the 4 corners, I reduce the chances that I’ll drill into the jig. The mounting post on the bottom right is slightly lower to accommodate the probe thickness

Consider putting the probe under the PCB - Because my circuit uses the full width of the PCB, I had an issue where the tool probe was hitting the ring terminal and giving bad auto-level numbers. I solved this by placing the prove under the PCB. You could also solve this by not having your circuit use up all the space!

Screen Shot 2021-03-31 at 6.56.14 AM.png

KiCad Board Layout

  • 0.34mm trace clearance - Are you trying to run traces in between the tightly spaced Teensy 4.1 pads? I found that setting the clearance of those traces to 0.34mm runs the traces right between pads. You can set this by clicking the button on the top row: Board Setup -> Design Rules -> Net Classes

  • plan which side you’ll solder on - I designed my board on the F_cu layer in KiCad which meant I needed to mirror it for milling since it will actually be on the bottom layer on my milled PCB. This is because we don’t have plated through holes that you get from a fancy PCB production house and we need to be able to solder things from the less populated side of the board.

  • Use Edge.Cuts layer to establish the border of the PCB - This will help you figure out how much space you actually have to work with. Use the ‘Add graphic lines’ tool on this layer to create the edge cuts. The edge cuts also determine how the fill zone is bounded.

  • trace a fence - Unlike the examples from Robin, my circuit extended all the way to the edges of the PCB. This meant I needed a way to prevent the bit on the CNC from crashing into the mounting screws. My solution was to add traces surrounding the mounting holes as a fence to keep the bit away from the corners..

  • make traces in an order that makes it easier - The method that worked well for me: First trace the power, then the signals, and finally use Place->Zone to do a ‘copper fill’ in the remaining areas for ground. The copper fill with ground supposedly helps reduce electrical noise and also fewer areas need to be etched.

  • tiny screws for vias - You may be wondering, what’s with the massive vias? The goal of these PCBs is to be able to produce them quickly for prototyping. Using tiny screws seems to speed things up a bit and they look nifty too. I’m having good luck using these tiny nuts and screws as quick no-fuss vias. Early tests are promising, though a dab of solder probably wouldn’t hurt to create a durable connection. To get these to work, I needed to define the via size as 4mm and the via drill at 1.6mm in Board Setup -> Design Rules -> Net Classes.

  • connector/component selection - Ultimately I’m sure this comes down to some level of personal preference and experience, but in general I would suggest looking for connectors and components that will work with the 2.54mm pitch spacing found on breadboards as this will save you time. In my case I ended up using a lot of JST-XH series connectors which seem to be pretty decent.

  • set the auxiliary axis to 0,0 of your jig - In KiCad you can set the location of an auxiliary axis. This can be used to plot the origin of your jig so that the gcode is oriented around this point.

  • exporting from KiCad - Click the plot button, set your output directory, and make sure you check the “Use auxiliary axis as origin” option before exporting Gerber files (layers) and Excellon Files (drill holes). When exporting the Gerbers, make sure you export F.Cu, B.Cu and the Edge.Cuts layers as this is is used later for 2 sided PCB processing in FlatCam

Screenshot 2021-04-17 074008.png

FlatCam

A free open source tool for converting Gerber and Excellon files to gcode

Select your OS - I had the easiest time getting FlatCam running on Windows. I had trouble getting FlatCam to work on OS X (challenges with brew) and Ubuntu 20 (package issues). Long term, I will probably try to get FlatCam running on a version of Ubuntu that doesn’t complain about package mis-matches. I’m guessing Ubuntu 18 will solve my issues, but will need to try that another day

Select FlatCam version - Version 8.5 seems rock solid, but the usability is not great. I started with 8.5 and then migrated to 8.993 beta which seemed stable enough for my purposes. 8.994 crashed a lot for me.

Read the manual - As of this writing, the well written FlatCam manual is written for version 8.5. It’s still worth reading through as it should give you a pretty good idea regarding workflow, etc.

Procedures / Feeds and Speeds - This procedure worked for me using FlatCam 8.993 BETA and Scratch Milling

  • Setup

    • File->Save Project As

    • File->Open->Open Gerber->$FILENAME-F_Cu.gbr

    • File->Open->Open Gerber->$FILENAME-B_Cu.gbr

    • File->Open->Open Gerber->$FILENAME-Edge_Cuts.gbr

    • File->Open->Open Excellon->$FILENAME-NPTH.drl

    • File->Open->Open Excellon->$FILENAME-PTH.drl

  • Mirror front for two sided PCB (We do the front b/c in my KiCad design I made the front have all the spots that we will solder and I want that on the bottom for easy access)

    • Tool->2 Sided PCB

      1. Gerber: $FILENAME-F_Cu.gbr

      2. Mirror Axis: I am having better luck with Y using this jig

      3. Reference: Box

      4. Select Edge_Cuts_GBR

      5. Click Mirror next to Mirror Operation: Gerber

      6. I like to update the names of each object so I can keep track what is what.

      7. Project-> Select F_Cu.gbr

        1. Selected->Name: Rename file so it's clear that this is a mirror object and which axis you mirrored around and any other critical details

  • Generate CNC Job

    • Project->Select $FILENAME_F_Cu.gbr

    • Selected->Isolation routing

    • Change tool diameter to 0.5 (We pick a large number to reduce the number of routes between elements )

    • Click Generate Isolation Geometry

    • Project->Geometry->Select $FILEMNAME_F_Cu.gbr

      1. Right Click->Edit

      2. At bottom you'll probably need to change grid size

      3. Use 'add path' button at the top to add geometry to make sure there are cuts where you need them

      4. When done, right click and close object, save edited object

    • Project->Geometry->Select $FILENAME_F_Cu.gbr

      1. Selected->Geometry Object

      2. Parameters for Tool 1:

      3. Cut Z: -0.35

        1. Travel Z: 3

        2. Feedrate X-Y: 2500

        3. Feedrate Z: 2500

        4. Spindle Speed: 0

        5. Generate CNC

        6. Save CNC Code

  • Holes: Mills

  • 1.0 tool

    1. CutZ: -2.0

      1. Travel Z: 3

      2. Feedrate X-Y: 100 (b/c it's milling)

      3. Feedrate Z: 40

      4. Sprindle Speed: 24000

    2. Smaller Tools

  • Holes: Drills

  • 1.0 and 0.9 tools

    1. Cut z: -2.0

      1. Multi-Depth: 0.5

      2. Travel Z: 3

      3. Feedrate Z: 300

      4. Spindle Speed: 24000

open source CNC command sender software that is an alternative to Carbide Motion. The main reason I leaned to use bCNC was because I wanted to take advantage of the auto-level feature which helps correct for copper clad that isn’t perfectly flat

Screenshot 2021-04-17 074408.png

bCNC

You may want to avoid running bCNC on OS X - I started with bCNC on OS X using a 2017 1.4GHz Dual Core i7 Macbook with 16GB of ram. It was sluggish, had UI artifacts, and choked when I tried to do auto-leveling. I then switched to a less powerful Windows based Latte Panda Alpha with 8GB of ram and “Intel Core™ m3-8100Y, Dual-Core 1.1GHz CPU that bursts up to 3.4GHz” and have gotten much better results. In theory I should be able to connect a touch screen to the Latte Panda and use the bCNC buttons with it which might be fun. I don’t know why the Mac sucked, but I blame OS X and Python not playing well together. I also tried running bCNC under Linux on the same Latte Panda Alpha hardware and it was even smoother than Windows.

G54 workspace mystery and a possible solution - I still haven’t gotten my head wrapped around this one. I found several references online suggesting that the Nomad does something funky with the G54 workspace. Of course, I feel like I’ve experienced failures during milling that have something to do with the G54 workspace therefore I tried to always use the G55 workspace. Of course, I also noticed that bCNC likes to default back to G54 after certain operations and if you don’t notice this, yikes! My solution which is janky but seems to work: After all zero operations I make sure to zero both the G54 and G55 workspace with the same values. Before starting any new operations (milling, probe, etc) I check to make sure I’m in the G55 workspace.

bCNC is much harder to master when compared to Carbide Motion - Figure out a way to ease into bCNC because it takes some time to get used to. On the other hand, it’s very powerful, and probably worth it in the end. Give yourself some time to figure it out on some test runs and know that you’ll need some time to master this software

When using the auto-level feature, don’t click the auto-level button - The UI and manual isn’t the best. I thought I needed to select all the traces and click auto-level to auto level. In reality, auto-level is automatically applied if you have probed and if you do click auto-level you get over correction in the mill job.

Crazy people override the door sensor on the Nomad - Obviously this is a safety risk and I would not advise doing this. But I will note that bCNC seems to do annoying things every time the door opens. I’ve heard some crazy people override the door sensor with a magnet.

Drill holes first - Once you feel like you understand how to scratch mill properly, you’ll probably want to drill holes first and scratch second. I had situations where drill holes 2nd resulted in the copper pads pushing off the PCB and this can be solved by drilling first.

Procedures to scratch mill with auto-level on bCNC:

  • Install for Windows

  • Launch from command prompt with the command: bCNC py -m bCNC

  • File->Connect

  • Control->Reset, Control->Unlock

  • Jog tool to safe location (arrow keys or buttons on UI work for this under Control tab) and click the XYZ=0 button to zero things out

  • Run Home operation (home button)

  • Open isolation routing gcode file Note: If you are using Google Drive to share files, you can open the drive by entering “G:” in the filename field. Make sure Google Drive is running and verify which drive letter Google Drive is attached to!

  • Zero out X,Y using the method of your choice. Remember that the origin is the lower left of your jig. It’s pretty important to stick with this X,Y=0 because all the drilling and milling operations need to have the exact same origin for things to line up right. Also give yourself insurance and zero out both the G54 and G55 workspace. :)

    • BitZero2 Probe Method

      • Probe->Center

      • Jog probe into position similar to how you would do it with Carbide Motion

      • I use 15 for the probe distance.

    • Visual method seems to work fine too. I’ve been using a scrap copper clad to help line up the bit with the lower left of the jig.

  • Zero out Z

    • Because we’ll be using auto-level, it’s time to use the probe attached to the PCB (see the photo above Shopping List on this page)

    • double check to make sure the probe is 5mm or less from the PCB and that the probe is working

    • Click Z=0

    • Probe->Probe: Enter -5 for Z. This is the coordinate being probed to in mm

    • Click Probe button

    • When probe hits PCB, click Z=0 for both G54 and G55 workspaces

  • Auto Level Procedure

    • Jog Z of tool up a few mm

    • Probe->Auto-Level Button->Margins (This establishes the outer limits of the PCB etching area)

    • Probe->Auto-level Button->scan

    • Setup area to be probed

      • X,Y: If your etches go to the edges like mine, set X and Y Min to 0.5 more and Max to 0.5 less of margins to ensure that the probe isn’t probing outside the PCB edges

      • Z:

        • set Max Height to something high enough to clear mounting bolts. I found 2 is ok for the mounting bolts I use. If you use too large of a number, probing will take a long time.

        • set Min to worst case. -2 should be ok

      • Steps: I used x=9 and y=7 for my 2”x3” PCB. I think the key here is to make sure you aren’t going to hit the mounting bolts when probing and that you get enough probe spots to get accurate auto-level results

    • Start scanning by clicking the Scan (gear) button

  • Get ready to scratch mill!

    • REMOVE THE PROBE FROM THE CNC!

    • jog the tool away from the PCB a little so you have a little time to stop things if things to crazy

    • Control->play button