Prototyping quality PCBs on a CNC router - Part II

This is the second article in our series of routing Printed Circuit Boards (PCBs), on a CNC router. In the first article we concentrated on the actual routing and the six steps involved. (the steps in blue in the graphic below)


Exhibit 1

In this article we will focus firstly on the Kicad circuit and board development steps ( in gray), and secondly the LineGrinder steps (in orange) to convert the drawings to a set of tools and tool paths

You could suggest that we are doing this somewhat backwards, would it not make more sense to discuss the preparatory steps prior to the milling steps. At first glance this is entirely sensible, however in our experience there is little written about the last six steps, and this is where we at NoYoo had the most challenge, hence our starting at the milling end was as much about documenting what we'd learned.

This article is not a tutorial on these tools, there are many pdf documents, web pages and YouTube videos on how to use these tools. What we are attempting to do here is join them all together in a workflow so that we can get from good idea to PCB artifact AND you have a reasonable chance of getting a great result … as always you feedback is always welcome


Kicad elements of the workflow


At the highest level we capture our circuit diagram in Kicad Eeschema, which is a comprehensive and reasonably intuitive tool. We then match the components to their footprints in CvPcb , so that as we lay out our printed circuit board, there is correct placement of pins, and physical dimensions. Next we lay out our components, and traces in PCBNew, and lastly check it all with GerbView

LineGrinder elements of the workflow


Whilst there are some important parameters to set and subtle traps in the LineGrinder components, when working to plan, it is very straight forward. Basically the steps consist of converting the top layer outputs from Kicad into G Code, extracting the all important Reference Pins code, and the Top Layer Isolation cuts, Secondly converting the Excellon based Drill File to G Code, and thirdly extracting the Bottom Layer Isolation G Code, the Edgemill G Code and the Bedflatten G Code which is a function of LineGrinder, utilising the artifacts produced by Kicad.

In this section we will also include the configuration parameters we use to get a repeatable result. Whilst these parameters may not be highly optimised yet, they work for us, and we ARE still learning. We hope they are of some assistance to you …

Kicad – Eeschema


As mentioned above, this is not a tutorial on Eeschema, but rather some notes to help build your CNC routed printed circuit board. That said there are a few things that need to be on every schematic to help the process.

On each circuit sheet that relates to a PCB, insert four pad components as Reference Pins. The labeling is unimportant and we keep them to the side in the circuit, (i.e. not connected to any part (per the exhibit below), in our case they are labelled PCB1-4 , though it could be anything, it just needs to be clear to you that these are the Reference Pins. We usually choose TST pins from the Kicad CvPcb library.

Reference Pins - Circuit
Exhibit 2


Kicad – CvPcb


At this point in the process, when you think you have completed your circuit and created a net-list (all the links between all the components). The next major step is to associate each component with a footprint.

Now the footprint libraries can be sourced from many places, and the base set in Kicad are enough to get you started, but not very comprehensive. To add to your libraries you might care to look to the following links, it is a simple matter to download footprint libraries and unzip them into a library folder of your choosing …

https://github.com/KiCad/kicad-library/tree/master/modules/

http://smisioto/no-ip/elettronica/kicad/kicad-en.htm

When allocating footprints,  the footprint is unrelated to the component, so could you use a capacitor footprint for a resistor or indeed a diode footprint for an inductor. Yes you could. The footprints will give you the physical dimensions and the relationships of any pins. For your layout to be successful, be mindful of these two elements. Choose footprints that will assist your PCB, and the fact that it is to be mechanically routed.

Pad Sizes


There are physical limitations at play here, the size of the tool bit, the depth of cut, and angle of the tool bit. choosing a small pad size will improve your density, but may compromise the viability of the board when you come to soldering your components, especially for through hole parts. 

Accordingly pad sizes of 1.3mm will become quite impractical, especially if you are going to drill a 1mm hole through the pad for the component. Doing so will leave only 150 microns of copper either side … this is next to impossible to solder your pin to the pad, and even if it could be done chances are the heat will lift the pad off the board.

As a rule of thumb for through hole soldered pins, a dimension of 2mm by 3mm (oval or rectangle), is a workable pad size. In general we do not care about pins that will not be soldered, which indeed can be the majority of say and Arduino Nano header, or a 16 pin IDC socket. Often we will let through a small size footprint, and edit the few pins to resize the ones we need to solder later in PcbNew.

Reference Pins


We said above the Reference Pins can be labelled anything you like, HOWEVER, they must be distinguished uniquely on the board by the Pad Size. It doesn't matter what the size is, just that it is different to every other pad on the board. For convenience we use 4mm (0.15984 inches). So far this has worked well and is now something of a standard for us.

LineGrinder looks for these reference pins in the Kicad output files, as these pins are the key determinant of accurate alignment between drill holes and pads.

Kicad – PcbNew


It is in PcbNew that the layout of footprint, and connection of nets occurs... this is a critical step to getting a viable board. There are many tutorials available for PcbNew, however in this section we will talk to some lessons, and hard won configuration parameters that will make a big difference to your successful PCB

Layout the physical components watching the nets to get a simple, easy to make layout. Do this BEFORE making one trace. With practice you can make pretty much any single layer board without the need for links or via's to get around components or tracks

Adjust the size of traces to reflect the relative power density, typical traces for through hole components are 1.1mm (with a 0.6mm clearance), although 0.5mm track size is possible with care. Up to 3mm traces might be used for high current power rails. Adjust the size of traces, in conjunction with pad size to get a viable soldering outcome, this is especially true for through hole (single layer boards).

Note : 0.25mm track size is too small to practically mill, even with a 10° tool piece at 0.1mm. We have done it, but definitely NOT repeatably.

For through hole components pad size is important, and in some ways will determine the overall size of the board in the end. An easy pad size to solder is 3mm, if you have room, otherwise we use a rectangle or oval pad size of 2mm by 3mm. Often we will only resize pads that are to be soldered. On many headers this might be only a few pins

Reference Pins


We place the reference pins separate to the main circuit layout, it is possible not to have them symmetric. For an irregular board this may be necessary, you will just need to be careful at each step to ensure you maintain the correct alignment.

For consistency place the outside of the Reference Pins pad on the inside of the Edge Cuts line . Reference Pins can be outside the board edge, BUT not outside the Origin , otherwise LineGrinder will generate and error 800 when converting to G Code, which can be very difficult to back track. Putting the reference pins outside the board can be very handy, especially for odd shaped boards, make sure though that you have the Origin aligned with one of the Reference Pins.

Place the Drill and Place Offset lines (red lines in Kicad) at the centre of one of the reference pins, eventually this point will become X 0, Y0 in Mach 3

Per Exhibit 3 below. The yellow lines represent the Edge Cuts (Kicad), and the Reference Pins are laid out in each corner of the board. The red lines are the Drill and Place Offset lines (KiCad)

Pendulum PCB Rev A
Exhibit 3

Avoid the use of Layer Alignment Targets (PcbNew), there does not appear to be any requirement, as we are using the Reference Pins, (required by LineGrinder). Further the Kicad alignment pins will probably cause the Edge Cuts plot in Kicad to generate code requiring a G Code ARC command which will cause an error 800 in LineGrinder. LineGrinder (v 1.04) is not set up for G Code arcs.

Plot Settings


On the PcbNew plot page is a selection of parameters you can choose depending on your target state for the board, documentation, file format, and Gerber options. Listed below are the settings we use to get a consistent output. Whilst they may or may not be the most efficient way, at this stage they work, and we are always open to improvement

--------------------------------------------------------------------

Plot format : Gerber

Layers : F Cu, B Cu, F Silks, B Silks, Edge Cuts

Options : Plot module value on Silkscreen, Plot Module Reference on Silkscreen, plot module texts on silkscreen, Exclude PCB edge layer from other layers

Gerber options : Use proper file names, Use Auxiliary axis as origin.

----------------------------------------------------------------------

Obviously some of these options are not particularly relevant to a milled PCB, (eg silkscreen options), however we have included them for completeness here …. these are all and the only options we have configured for the plot settings

Drill File Settings


The following options are the ones we use for the Excellon Drill file. Of note is that whilst Kicad is comfortable in either millimeters or inches, and LineGrinder similarly... the Drill file format (Excellon) is only configured for inches. Accordingly and to simplify things we only use inches for all file formats LineGrinder. This is a hard won point, whilst some files perform faultlessly the drill file will give much grief, and frankly it is too complicated to keep switching...

-----------------------------------------------------------------

Plot format : Gerber

Drill Units : Inches

Zeros Format : Keep Zeros

Precision : 2:4

Drill Map File format : PostScript

Options : Minimal Header

Drill origin : Auxiliary Axis

------------------------------------------------------------------

Kicad – GerbView


For our purposes, GerbView is a useful tool to check our work, but does not fulfill any significant process in the work flow.

LineGrinder


There are numerous tutorials on using LineGrinder to make PCBs (some examples listed below). Our purpose is not to supplant this body of work, rather to enhance the experience. There are many , (read:MANY) variables here, different circuit packages, different operating systems and hence tools, and finally many CNC machines and driver software.

Matthew Little: http://www.re-innovation.co.uk/web12/index.php/en/blog-75/224-making-pcbs-with-linegrinder

The GarageLab: http://thegaragelab.com/cnc-milled-pcbs/

And from the author, what must be  the place to start

http://www.ofitselfso.com/LineGrinder/LineGrinderHelp/LineGrinderHelp_IsolationMillingStepByStep.html

In our workflow configuration (Exhibit 1), we have experimented and successfully produced detailed and quality artifacts such as below
20151019_090544 Pendulum Electronics PCB (final)

LineGrinder – Reference Pins


To extract the Reference Pins code load either of the Top Layer ( Front Copper Cu), or the Bottom Layer (Bottom Cu) into LineGrinder and convert the file to G Code. The Reference Pins settings are as below :
LineGrinder Bottom LayerThen save the G Code in a location that you can easily find in Mach 3. Important to note is that the Reference Pin Depth = 0.375 " ( 10mm). These holes deep enough are to ensure the pins can properly seat in the sacrificial substrate below the FR4 PCB board.


LineGrinder – Isolation Cuts


Isolation milling is handled the same way for both Top Layer ( front side copper), and Bottom Layer (back side copper), although the configuration can be different in LineGrinder. Attached below are the settings we use :

Top Layer


LineGrinder Top Layer
Bottom Layer

LineGrinder Bottom Layer


LineGrinder – Drill File


The LineGrinder drill file uses Excellon format which is compatible with Kicad, to the extent that Excellon output is always in inches. Accordingly a hard won lesson for us was to default everything in LineGrinder to inches, and let the computers do the arithmetic. This includes Mach 3 which seems perfectly happy in either

The drill file settings are listed below

LineGrinder Drill File

LineGrinder – Edge Cuts


The Edge Cuts file is configured for four tabs of 1mm (0.040”) will join the PCB to the sheet at the conclusion of cutting. We have tried numerous cutters, speeds and feeds using double and single sided FR4 board, and concluded that a 2mm 2 flute end mill works best. Theoretically a 1mm bit should be able to do the job, but we had too many breakages to make it worthwhile

Edge Cuts settings are listed below :

LineGrinder Edge Mill

As an aside, the settings for the Bed Flatten G Code are also listed, although in practice we don't use this code, preferring to mill a flat pocket that suits the orientation of the machine, rather than the orientation of the board as is done here. In reality the only important thing is to make sure the bed that the blank PCB is attached is flat to the the machine …


Boot Notes


These notes have been compiled with the aim of creating repeatable, high quality printed circuit boards for prototyping circuits. This article and it's predecessor are primarily about the configuration considerations to make through hole boards, as these are the more complex from an alignment perspective. In a subsequent article we will look at the specific requirements for surface mount and SMD components

The set up we are using at NoYoo to make these boards is the following

Kicad – on Raspberry Pi 2 Model B, connected to a 50” plasma display, using Kicad June 2014 (available as a back-port for the pi). This configuration works extremely well, Kicad is incredibly stable, and no performance issues at all.. a great set up... recommended

LineGrinder – on a Toshiba laptop, running Windows XP, also used to drive Mach 3, a SmoothStepper and a 3040 CNC machine. Recommend following the SmoothStepper recommendations about a back level (062), version of Mach 3. All issues of stability and performance disappeared when we rolled Mach 3 back a level.

We hope you find something useful in these notes, feel free to drop us a note if you have any questions … all the best, thanks for dropping by ...
The first article in this series is located << here >>

Comments

Post a Comment

Popular Posts