A Build-Your-Own Three Axis CNC PCB
Milling Machine
Fabrication and User Manual
Teaching Learning Centre for Design and Manufacturing Education
Indian Institute of Information Technology, Design and
Manufacturing-Kancheepuram
Chennai 600127
July, 2016
Teaching Learning Centre for Design and Manufacturing Education
TEAM MEMBERS INVOLVED
SATHYAKUMAR. N (Author of the Manual)
KAMAL PRASADH BALAJI
RAJA GANAPATHI
DAPHNE. R
Copyright © 2017 by Teaching Learning Centre for Design and Manufacturing
Education, IIITDM.
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted
in any form or by any means, including photocopying, recording, or other electronic or
mechanical methods, without the prior written permission of the publisher, except in the case
of brief quotations embodied in critical reviews and certain other noncommercial uses
permitted by copyright law. For permission requests, write to the address below.
Teaching Learning Center (TLC),
IIITDM Kancheepuram Campus,
Melakottaiyur Village,
Off Vandalur-Kelambakkam Road
Chennai 600127
E-mail: [email protected]
Teaching Learning Centre for Design and Manufacturing Education
TABLE OF CONTENTS
1. Introduction ....................................................................................... 3
2. Installation and Configuring EAGLE ............................................... 6
3. Using EAGLE-Schematic ............................................................ ...12
4. Using EAGLE-Board Layout ......................................................... 18
5. Generation of G-code ...................................................................... 27
6. PCB Isolation Routing and Drilling ................................................ 31
7. Special Procedures .......................................................................... 37
8. Conclusion ...................................................................................... 42
APPENDIX
DATASHEETS
BILL OF MATERIALS AND PART SUPPLIERS
PAPER PUBLISHED ON THIS PROJECT
Teaching Learning Centre for Design and Manufacturing Education
3
1. INTRODUCTION The need for fabricating a prototype circuit arises frequently in electronics, including education and
research laboratories. In resource-poor countries in the developing world, this is hindered by the high cost of commercial Printed Circuit Board (PCB) prototyping machines and long turn-around commercial fabrication process. Practical, hands-on laboratory teaching and experimentation becomes necessary to
improve learning in electronics. In this project and in the following series of tutorials, a low-cost build-your-own (BYO) semi-automated three-axis PCB milling machine for double-sided PCB prototyping is developed using commercial components and open source hardware and free open source software to
provide students, teachers, and engineers an understandable, affordable source for PCB prototyping. Also, the main problems encountered during fabrication of PCB have been mentioned and the techniques used to solve are discussed in detail.
1.1. Need for PCB Prototyper in Engineering Institutions
The semiconductor industry is one of the fastest growing industries in our country and thereby. With
this, the production and the standard of printed circuit boards (PCB), which is the heart of every
electronic product, are on the rise. PCBs not only provide mechanical support for the electronic
components and also provide other services like electrical impedance matching, electromagnetic
shielding and heat conduction. Specialized courses and curriculum in PCB design and electronics
assembly are introduced in electronics engineering education. However, due to high cost of
commercial and often imported PCB prototyping equipment, there is a severe lack of practical hands-
on PCB design teaching and learning in India. This situation can be remedied with the increasing
affordability and versatility of open source hardware like microcontrollers and microcomputers,
commercial off-the-shelf components like actuators, sensors as well as free, open source software, which can be integrated for design of low-cost PCB prototyping machines for electronics education.
Do-it-yourself (DIY) PCBs can be designed using simple techniques such as using an iron to transfer
ink printed on a transparency to a PCB with chemical etching. Such as like the one presented in this
YouTube video at www.youtube.com/watch?v=6uInan-TjiA. But these methods lack sufficient
consistency for surface mount devices (SMDs) and the drilling of holes is tedious since it has to be
done manually. Further, the environmental and health hazards from chemicals used in these processes are significant.
Fig.1.1. Showing the process of chemical etching
Development of safe and high resolution milling and drilling of PCBs is enabled using isolation
routing which overcomes many of the above mentioned drawbacks. In Isolation milling, the copper
from the board is first removed to recreate pads, which are signal traces and structures based on the
pattern generated by a PCB parts layout file.
http://www.youtube.com/watch?v=6uInan-TjiA
Teaching Learning Centre for Design and Manufacturing Education
4
In this project, a BYO PCB prototyping machine has been developed and deployed to make both single- and double-sided boards for through-hole technology and Surface Mount Technology (SMT).
The common problems encountered while soldering the components on the PCB and aligning the
board layers have been discussed. Modern and innovative approaches used on an industrial level to
overcome these problems have been implemented in our machine and studied. Commercial techniques
used in easy and comfortable operation of PCB prototyping machines have been incorporated in the
machine.
The above features have been implemented using open source software programs so that teachers and
students themselves would be able to fabricate high-resolution PCBs in an academic environment
matching near-commercial quality. A major advantage of the proposed system is that users can
maintain and repair the machine on their own, without expensive annual maintenance contracts or
import of costly spare parts. With the understanding and experience gained, the users can also
gradually add advanced features like fully automated PCB machines with pick and place assembly, vision feedback, etc.
1.2. Reconfiguring CNC Milling Machine as PCB Prototyper
The design of the CNC milling and drilling machine used in the proposed PCB prototyping system is based on
our earlier developed 3-axis CNC milling system, presented in our other tutorial on Making Your Own 3-Axis
CNC Milling machine. A detailed explanation about the mechanical design, hardware and the software can be
found in that.
The main specifications of the milling machine are listed below:
Table 1. PCB milling machine specifications.
X,Y,Z axes travel 180 x 180 x 50 mm
Motors Steppers: 3x NEMA 17,200 step/rev, 2-phase,
1.3A
Spindle motor: 5000rpm @24 V DC, 0.3A no
load
Lead screws Stainless steel, 3xM8x1.25, 20 tpi
Stepper drivers 3 x single axis, rated 3A, up to 1/16 micro
stepping
Speed X, Y axes: 8 mm/sec
Resolution Electrical: 1.8° (0.0062 mm/step)
Mechanical: 0.01mm/step
Weight 14 kg
USB microscope Resolution: 640x480 pixel
Microcontroller Arduino Uno
Fig.1.2. Mechanical Setup of the Machine Fig.1.3. Electronics Hardware Assembly
Teaching Learning Centre for Design and Manufacturing Education
5
A camera is mounted parallel with the spindle axis using a as shown in the below figure. A high speed spindle
motor of RPM 5000 is used and is powered by the 24V uniform supply from the SMPS used for CNC. The
milling and drilling tool bits are mounted to a high speed spindle motor with a precision ER-11 chuck which
holds bits with 1/8 shank dia. A 30° V-engraving bit with end width of 0.1mm is used for routing. A 0.6mm
single-fluted drill bit is used for making holes and a 0.6mm end mill bit is used for copper rubout and for cutting
sections of the boards. All the tool bits used for the operation are made constant in their height by adding a
depth setting ring. All bits used are tungsten carbide bits because of their extended tool life.
Rest of the machine settings and tools used in this PCB milling machine are same as the generic CNC milling
machine explained in the previous tutorial.
1.3. Isolation Routing Procedure
The outline of the procedure for fabricating PCB is as follows. The detailed explanation of the softwares used and the design procedure is explained in the individual sections of the Manual.
The PCB design is first generated using a Computer Aided Drawing Software by the name Autodesk Eagle CAD. The design of the circuitry is first drawn in a schematic file which is something like a typical circuit diagram.
The circuit design is then transferred into the Board layout file in the same software where the exact positions of the components of the circuit and the mounting holes and vias of the board are placed. The
components are connected by the copper traces here where they can be set in different bent styles, angles, width, distances, etc.
The board layout is input into Computer Aided Manufacturing (CAM) Software called as FlatCAM which converts it into a G-Code file which has the machine readable form of instructions for the CNC. The CAM software simply analyses the position of the copper tracks and the position of the components and generates tool paths to route and drill the board matching the board layout. Other
machining parameters for milling are also adjusted here.
The converted G-Code files are then fed into the machine using G-Code sender program called Universal G-Code converter which controls the CNC controller.
The tool is first moved and set to an arbitrary origin position (with respect to all three axes). Now the Etching G-code file is run which cuts out the tracks and the pads. Now the tool is moved again to its previously set origin position and the drilling G-code file is run.
In case of double-sided boards, the same procedure is followed for generating G-Code data; the top side is engraved first and then the board is flipped and aligned to the axis of the top layer and the bottom layer is engraved and drilled.
Fig.1.4. Camera mounted parallel to Spindle Fig.1.5. Tool bits used
6
2. Installation and Configuring EAGLE
2.1. Download & Installation.
EAGLE is available on Autodesk’s download page https://www.autodesk.com/products/eagle/overview.
Please download the most recent version that matches your operating system (the software is available for Windows, Mac and Linux). It’s a relatively light download – about 85MB.
EAGLE installs just like any ordinary .exe program, it’ll self-extract and then present you with a series of dialogs to configure the installation.
The alternatives used in the place of Eagle are Fritzing, KiCAD, Cadense OrCAD and Proteus PCB Design
mostly. While the former two are open-source the later too are professional but highly commercial. Eagle has been found to be ample enough for designing even complex PCB boards unless they are very much multi-layered like covering 8 layers or so.
Note: Few contents of this manual have been excerpted from Official Eagle Manual. For more detailed
instructions, you can look up the Documentation page of eagle.autodesk.com and https://learn.sparkfun.com/tutorials/tags/eagle
2.2. Using EAGLE as a Freeware
On the last screen of the installation process, you should be presented with a window like this:
However, there are a few limitations when using the free version:
Your PCB design is limited to a maximum size of 100 x 80mm of PCB board area, which is still pretty big. Even if we’re designing a big Arduino shield, we would still be under the maximum size.
Only two signal layers allowed. If you need more layers check into the Hobbyist licenses.
Can’t make multiple sheets in your schematic editor.
If you need to upgrade your license there are a few versions available. Most licenses are still incredibly low priced.
https://www.autodesk.com/products/eagle/overviewhttps://cdn.sparkfun.com/assets/7/6/7/1/3/51f6beabce395fec6d000004.PNG
7
2.3. Exploring the Control Panel
The first time you open up EAGLE, you should be presented with the Control Panel view. The Control Panel is the home window for Eagle, it links together all of the other modules in the software.
You can explore the six separate trees in the control panel, which highlight separate functions of the software:
Libraries – Libraries store parts, which are a combination of schematic symbol and PCB footprint. Libraries usually contain a group of related parts, e.g. the atmel.lbr stores a good amount of Atmel AVR devices, while the 74xx-us.lbr library has just about every TTL 74xx series IC there is.
Design Rules – Design rules are a set of rules your board design must meet before you can fabricate your PCB. In this tree you’ll find DRU files, which are a pre-defined set of rules.
User Language Programs (ULPs) – ULPs are scripts written in EAGLE’s User Language. ftp://ftp.cadsoftusa.com/eagle/userfiles/doc/ulp570_en.pdf. They can be used to automate processes
like generating bill of materials (bom.ulp), or importing a graphic (import-bmp.ulp).
Scripts – Script files can be used to customize the EAGLE user interface. In one click you can set the
color scheme and assign key bindings.
CAM Jobs – CAM jobs can be opened up by the CAM processor to aid in the creation of gerber
files.
Projects – This is where each of your projects is organized into a single project folder. Projects will
include schematic, board design, and possibly gerber files.
2.4. Using the Libraries
Included with EAGLE is a list of part libraries, which you can explore in the Control Panel view. There are
hundreds of libraries in here, some devoted to specific parts like resistors, or NPN transistors, and others are devoted to specific manufacturers. This is a great and a comprehensive resource, but it can also be a bit confusing. For example, even if you just want to add a simple through-hole electrolytic capacitor, there are dozens of libraries and parts to sort through to find the right thing.
In many cases you will need to download and use the additional libraries suited for specific purpose. For example if you are designing a Arduino board based on the manufacturing designing from Sparkfun, you can use the Sparkfun libraries, which are filtered down to only include the parts that they’ve used in their designs only. So, in the following example we will see how to install Sparkfun libraries and use them.
ftp://ftp.cadsoftusa.com/eagle/userfiles/doc/ulp570_en.pdfhttps://cdn.sparkfun.com/assets/7/3/6/0/7/51f6c679ce395f756e000000.png
8
2.4.1: Downloading the Additional Libraries
The most recent version of the libraries of different manufacturers can always be found in their website or in their respective GitHub repository. Here’s how you can install and use the SparkFun libraries in addition to) the default ones. All you’ll need to do from the main repository page is click “Download ZIP” as shown below and extract them.
2.4.2: Updating the Directories Window
Go back to the EAGLE Control Panel window now, Go to the “Options” menu and then select
“Directories”. This is a list of computer directories where EAGLE looks when it populates all six objects in the tree view…including libraries.
In the “Libraries” box is where we’ll add a link to the directory where the downloaded EAGLE libraries are stored. There are a few options here. If you’d like to keep the default libraries and add the downloaded
SparkFun library, add a semicolon (;) after “$EAGLEDIR\lbr”, and paste the downloaded EAGLE Libraries directory location after that.
https://github.com/sparkfun/SparkFun-Eagle-Librarieshttps://cdn.sparkfun.com/assets/5/9/a/9/c/51f6d74fce395f5c67000006.pnghttps://cdn.sparkfun.com/assets/7/3/a/7/0/51f6d989ce395fd16d000004.png
9
2.4.3: Using Libraries
Now, when you go back and look at the “Libraries” tree, there should be two folders included, one of which should be our downloaded SparkFun Eagle Libraries.
Then, right-click on the “SparkFun-Eagle-Libraries-master” folder, and select “Use all”. Then check the libraries in each of the two folders. Next to them should be either a grey or green dot. A green dot next to a library means it’s in use, a grey dot means it’s not. Your libraries tree should look a little something like this in the below picture. Similarly download the ITEAD Eagle library for basic parts.
https://cdn.sparkfun.com/assets/f/6/e/3/6/51f6e9f3ce395f526e000002.pnghttps://cdn.sparkfun.com/assets/3/3/f/4/a/51f6ea91ce395f8269000004.png
10
2.5. Opening a Project and Exploring
EAGLE is packaged with a handful of example PCB designs. Open an example by expanding the
“Projects” tree. From there, under the “examples” folder open up the “arduino” project by double-clicking the red folder (or right-clicking and selecting “Open project”). Note that, in this view, project folders are red and regular folders are the standard yellow.
Opening the project should cause two more EAGLE windows to open: the board and schematic editors. They should be used together to create the finished product that is a functional PCB design.
https://cdn.sparkfun.com/assets/6/e/b/b/f/51f6eb55ce395fee66000007.pnghttps://cdn.sparkfun.com/assets/f/7/9/3/0/51f7e46f757b7f6528767828.png
11
Schematic (left) and board editors both open.
The schematic editor (on the left above) is a collection of red circuit symbols which are interconnected
with green nets (or wires). It helps tell the circuit of what the board design does, but it doesn’t have much influence on the end PCB product. Parts in a schematic aren’t precisely measured, they’re laid out and connected in a way that’s easy to read, to help us and others who read our design file understand what’s going on with the board design.
The board editor is where the real PCB design happens. Here different coloured layers overlap and intersect to create a precisely measured PCB design. Two copper layers – red on top, blue on the bottom – are strategically routed to make sure different signals don’t intersect and short out. Green circles called
“vias” pass a signal from one side to the other. Bigger vias allow for through-hole parts to be inserted and soldered to the board. Other, currently hidden, layers expose copper so components can be soldered to it.
2.6. Maintaining Consistency between Schematic and Board
Windows
Both of these windows i.e. schematic and board layout work hand-in-hand. Any changes made to the schematic are automatically reflected in the board editor. Whenever you’re modifying a design it’s important to keep both windows open at all times.
If, for instance, you closed the board window of a design, but continued to modify a schematic. The changes you made to the schematic wouldn’t be reflected in the board design. The schematic and board design should always be consistent.
There are a few ways to tell if you don’t have consistency between windows. First, there’s a “dot” in the
lower-right hand corner of both windows. If the dot is green, everything is fine. If the dot is magenta, a window is probably closed that shouldn’t be. Second, if you close either of the two windows a big, huge warning should pop up in the other window.
If you see that warning STOP doing anything, and get the other window back open. The easy way to get
either a board or schematic window back open is by clicking the “Switch to board/schematic” icon –
/ (also found under the “File” menu).
https://cdn.sparkfun.com/assets/b/1/3/0/5/51f80387757b7fcd1cdd54c9.pnghttps://cdn.sparkfun.com/assets/2/0/c/0/f/51f7fefb757b7fda1c200df7.png
12
3. Using EAGLE: Schematic
3.1. Introduction
PCB design in EAGLE is a two-step process. First you design your schematic and then you lay out a PCB based on that schematic. EAGLE’s board and schematic editors work hand-in-hand. A well-designed
schematic is critical to the overall PCB design process. It will help you catch errors before the board is fabricated, and it’ll help you debug a board when something doesn’t work.
3.2. Creating a New Project
3.2.1. Create a Project workspace
We’ll start by making a new project folder for our design. In the control panel, under the “Projects” tree, right click on the directory where you want the project to live (by default EAGLE creates an “eagle” directory in your home folder), and select “New Project”.
Give the newly created, red project folder a descriptive name. Example: “LED_Glow”.
3.2.2. Create a Schematic
The project folder will house both our schematic and board design files (and eventually our gerber files
too).To add a schematic to a project folder, right-click the folder, hover over “New” and select “Schematic”.
A new, blank window should pop up. Welcome to the schematic editor.
https://cdn.sparkfun.com/assets/8/0/3/2/4/51f82d95757b7f9a1c923eb3.pnghttps://cdn.sparkfun.com/assets/0/3/7/6/9/51f833f8757b7f371c50b50e.png
13
3.3. Adding Parts to a Schematic
Schematic design is a two-step process. First you have to add all of the parts to the schematic sheet, then those parts need to be wired together. You can intermix the steps – add a few parts, wire a few parts, then add some more – and wire again.
The circuit we are going to fabricate is a simple circuit which makes the LED glow when the switch is turned on. Though the circuit is quite a simple one and could be fabricated on a single layered PCB, it has been designed on both layers of the PCB for the purpose of teaching how to do double-sided PCB design.
3.3.1. Using the ADD Tool
The ADD tool – (on the left toolbar) – is what you’ll use to place every single component on the
schematic. The ADD tool opens up a library navigator, where you can expand specific libraries and look at the parts it holds. With a part selected on the left side, the view on the right half should update to show
both the schematic symbol of the part and its package. An example of how the part and its description is displayed is shown below after this figure.
To add a part from a library either select the part you want and click “OK”, or double-click your part. You need not press ADD button every time you are adding your parts. It re-opens itself after you add the parts. Press Esc key to exit the ADD tool.
https://cdn.sparkfun.com/assets/b/2/1/b/f/5203d359757b7f8e1e389650.png
14
3.3.2. Add a Frame
The frame isn’t a critical component for what will be the final PCB layout, but it keeps your schematic looking clean and organized. The frame we want should be in the SparkFun-Aesthetics library, and it’s named FRAME-LETTER. Find that by either searching or navigating and add it to your schematic. Your Frame is not an integral part of the Schematic. You may skip this step if you want.
After selecting the part you want to add, it’ll “glow” and start hovering around following your mouse
cursor. To place the part, left-click once. Let’s place the frame so its bottom-left corner runs right over our origin cross.
https://cdn.sparkfun.com/assets/9/3/c/f/f/5203d4b5757b7f227ced6884.pnghttps://cdn.sparkfun.com/assets/4/9/a/3/d/52127b1e757b7f763c8b4569.png
15
After placing a part, the add tool will assume you want to add another – a new frame should start following your cursor. To get out of the add-mode either hit escape (ESC) twice or just select a different tool.
3.3.3. Save
Right now your schematic is an untitled temporary file living in your computer’s ether. To save either go
to File > Save, or just click the blue floppy disk icon – .
3.3.4. Adding the Components
Next we’ll add four different parts all devoted to our voltage supply input. Use the add tool and search options and look for these parts or similar parts. The part and attributes name shown below may vary according to the version of your Eagle.
Part Package Name Library Part Name Quantity
SOC004 ITEAD Eagle Library for Basic parts CR2032 Battery holder 1
EDG-01 Eagle Library Switch DIP Pin-1 1
LD260 Eagle Library LED light 1
R0204/7 Eagle Library Resistor 1
Voltage Supply Symbol SparkFun-Aesthetics VCC 1
Ground Symbol SparkFun-Aesthetics GND 2
All of these parts will go in the top-left of the schematic frame. Arranged like this:
https://cdn.sparkfun.com/assets/d/8/a/b/8/5203d92d757b7fcb7a88858c.pnghttps://cdn.sparkfun.com/assets/a/6/f/7/a/5203e92e757b7fc17b3d34d1.png
16
If you need to move parts around, use the MOVE tool – (left toolbar or under the Edit menu). Left-click once on a part to pick it up (your mouse should be hovering over the part’s red “+” origin). Then left click again when it’s where it needs to be.
To rotate parts as your placing them, either select one of the four options on the rotate toolbar –
– or right click before placing the part.
3.4. Wiring Up the Schematic
With all of the parts added to our schematic, it’s time to wire them together. There’s one major warning
here before we start: even though we’re wiring parts on the schematic, we not going to use the WIRE tool
– – to connect them together. Instead, we’ll use the NET tool – (left toolbar, or under the Draw menu). The WIRE tool would be better-named as a line-drawing tool, NET does a better job of connecting components.
3.4.1. Using the NET Tool
To use the NET tool, hover over the very end of a pin (as close as possible, zoom in if you have to), and left-click once to start a wire. Now a green line should be following your mouse cursor around. To terminate the net, left-click on either another pin or a net.
The hard part, sometimes, is identifying which part on a circuit symbol is actually a pin. Usually they’re
recognizable by a thin, horizontal, red line off to the side of a part. Sometimes (not always) they’re labeled with a pin number. Make sure you click on the very end of the pin when you start or finish a net route.
Whenever a net splits in two directions a junction node is created. This signifies that all three intersecting nets are connected. If two nets cross, but there’s not a junction, those nets are not connected.
When your schematic is done, it should look a little something like this:
https://cdn.sparkfun.com/assets/8/4/9/b/d/5203f942757b7fcc2bcb6ef2.pnghttps://cdn.sparkfun.com/assets/a/c/0/a/c/52040a3b757b7f04237ab526.png
17
3.5. Tips and Tricks
3.5.1. Names and Values
Every component on your schematic should have two editable text fields: a name and a value. The name is
an identifier like R1, R2, LED3, etc. Every component on the schematic should have a unique name. You
can use the NAME tool – on any component to change the name.
A part’s value allows you to define unique characteristics of that part. For example, you can set a resistor’s resistance, or a capacitor’s capacitance. The importance of a part’s value depends on what type of
component it is. For parts like resistors, capacitors, inductors, etc. the value is a critical piece of information when you’re generating a bill of materials or assembly sheet. To adjust a part’s value
parameter, use the VALUE tool – .
3.5.2. Group Moving/Deleting/Etc.
Any tool that you use on a single component, can also be used on a group of them. Grouping and
performing an action on that group is a two-step process. First, use the group tool – – to select the
parts you want to modify. You can either hold down the left-mouse button and drag a box around them, or click multiple times to draw a polygon around a group. Once the group is made, every object in that group should glow.
After grouping, select the tool you want to use. The status box in the far bottom-left will have some helpful information pertaining to using the tool on a group:
In order to perform any action on a group, you have to select the tool, then hold down CTRL and right-
click the group. After you CTRL+right-click, the tool will operate on the group just as it does a single component.
If you have any nets incorrectly connected like above, DELETE – – it.
3.5.3. Copy/Paste
EAGLE’s Copy – – and Paste – – tools don’t work like other copy/paste tools used in other
softwares like word editors. Copy performs both a copy and paste when it’s used. As soon as you copy a part (or any object on the schematic – name, text, net, etc.) an exact copy will instantly come up and follow your mouse awaiting placement. This is useful if you need to add multiples of the same part (like GND nodes or resistors).
Paste can only be used to paste a group that has previously been copied to your clipboard. To use paste you first have to create a group, then (with the copy tool selected) CTRL+right-click to copy it, but hit ESC button. This’ll store the copied group into your operating system’s clipboard, and you can use paste to
place it somewhere. This tool is especially useful if you need to copy parts of one schematic file into another.
https://cdn.sparkfun.com/assets/c/5/0/9/d/5212817b757b7f35338b456a.png
18
4.1. Using EAGLE: Board Layout In the board editor, the conceptual, idealized schematic you’ve designed becomes a precisely dimensioned and routed PCB.
In this tutorial we’ll cover every step in EAGLE PCB design: from placing parts, to routing them, to generating gerber files to be converted to CNC job files. We’ll also go over the basics of EAGLE’s board editor, beginning with explaining how the layers in EAGLE match up to the layers of a PCB.
4.1.1. Create a Board From Schematic
To switch from the schematic editor to the related board, simply click the Generate/Switch to
Board command – (on the top toolbar, or under the File menu) – which should prompt a new, board editor window to open. All of the parts you added from the schematic should be there, stacked on top of eachother, ready to be placed and routed.
https://cdn.sparkfun.com/assets/b/a/f/f/d/520e54d7757b7f917c8b4571.png
19
4.2. Learning Layers Overview
PCB composition is all about layering one material over another. The thickest, middle part of the board is a insulating substrate (usually FR4). On either side of that is a thin layer of copper, where our electric
signals pass through. To insulate and protect the copper layers, we cover them with a thin layer of lacquer-like soldermask, which is what gives the PCB color (green, red, blue, etc.). Finally, to top it all off, we add a layer of ink-like silkscreen, which can add text and logos to the PCB. We don’t have the option to
add soldermask and silkscreen in machines built in our laboratory at TLC but if you intend to fabricate the PCB through a professional fabrication house, you can add them.
The layers of a double-sided PCB (image from the PCB Basics tutorial).
4.2.1. EAGLE’s Layers
The EAGLE board designer has layers just like an actual PCB, and they overlap too. Eagle use a palette of colors to represent the different layers. Here are the layers you’ll be working with in the board designer:
https://learn.sparkfun.com/pcb-basics/compositionhttps://learn.sparkfun.com/tutorials/pcb-basicshttps://cdn.sparkfun.com/assets/7/4/5/6/2/52051a15757b7f5114a22142.pnghttps://cdn.sparkfun.com/assets/4/9/4/2/3/520e5d2d757b7f976f8b456b.png
20
Color Layer
Name
Layer
Number Layer Purpose
Top 1 Top layer of copper
Bottom 16 Bottom layer of copper
Pads 17
Through-hole pads. Any part of the green circle is
exposed copper on both top and bottom sides of the board.
Vias 18
Vias. Smaller copper-filled drill holes used to route a signal
from top to bottom side. These are usually covered over by
soldermask. Also indicates copper on both layers.
Unrouted 19
Airwires. Rubber-band-like lines that show which pads need to
be connected.
Dimension 20 Outline of the board.
tPlace 21 Silkscreen printed on the top side of the board.
bPlace 22 Silkscreen printed on the bottom side of the board.
tOrigins 23
Top origins, which you click to move and manipulate an
individual part.
bOrigins 24 Origins for parts on the bottom side of the board.
Holes 45
Non-conducting (not a via or pad) holes. These are usually drill
holes for stand-offs or for special part requirements.
To turn any layer off or on, click the “Layer Settings…” button – – and then click a layer’s number to select or de-select it. Before you start routing, make sure the layers above (aside from tStop and bStop) are
visible.
4.3. Arranging the Board
4.3.1. Create a Board From Schematic
Click the Generate/Switch to Board icon – – in the schematic editor to create a new PCB design based on your schematic:
https://cdn.sparkfun.com/assets/2/4/4/c/7/520e8531757b7f0d708b4568.png
21
The new board file should show all of the parts from your schematic. The gold lines, called airwires, connect between pins and reflect the net connections you made on the schematic. There should also be a faint, light-gray outline of a board dimension to the right of all of the parts.
4.3.2. Moving Parts
Using the MOVE tool – – you can start to move parts within the dimension box. You can also select a group and right-click on the group and select Move:group to move a group. While you’re moving parts,
you can rotate them by either right-clicking or changing the angle in the drop-down box near the top.
While you’re relocating parts, hit the RATSNEST button – – to get the airwires to recalculate.
4.3.3. Adjusting the Dimension Layer
After the parts are positioned inside the dimension line, we need to fix our dimension outline. You can either move the dimensions lines that are already there, or just start from scratch.Use the DELETE tool –
– to erase all four of the dimension lines. Add mounting holes to the board if you wish to.
https://cdn.sparkfun.com/assets/d/b/8/b/4/520527cc757b7f7b14884e0f.pnghttps://cdn.sparkfun.com/assets/3/9/8/2/3/52052b67757b7fd014094f67.gif
22
Then use the WIRE tool – ( – to draw a new outline. Before you draw anything though, go up to the options bar and set the layer to 20 Dimension. Also up there, you may want to turn down the width a bit (we usually set it to 0.008").
Then, starting at the origin, draw a box around your parts. Don’t intersect the dimension layer with any holes, or they’ll be cut off. Make sure you end where you started.
4.4. Routing the Board
Routing is the process where we will turn each of the golden-yellow airwires into top or bottom copper traces.
4.4.1. Using the Route Tool
To draw all of our copper traces, we’ll use the ROUTE tool– – . After selecting the tool, there are a few options to consider on the toolbar above:
Layer: On a 2-layer board like this, you’ll have to choose whether you want to start routing on the top (1) or bottom (16) layer.
Bend Style: Usually you’ll want to use 45° angles for your routes (wire bend styles 1 and 3), but it
can be fun to make loopy traces too.
Width: This defines how wide your copper will be. Usually 0.01" is a good default size. You
shouldn’t go any smaller than 0.007" (or you’ll probably end up paying extra). Wider traces can allow for more current to safely pass through. But in circuits where you need to supply 1A through a
trace, it’d need to be much wider.
4.4.2. Ripping Up Traces
Much like the WIRE tool isn’t actually used to make wires, the DELETE tool can’t actually be used to
delete traces. If you need to go back and re-work a route, use the RIPUP tool – – to remove traces. This tool turns routed traces back into airwires.
You can also use UNDO and REDO to back/forward-track.
4.4.3. Route
Use the Route option shown above and route all the airwires shown in the board layout. You may want to
start on the closest, easiest traces first. Or, you might want to route the important signals – like power and ground – first. Here’s an example of our fully-routed board. The blue colour represents bottom layer and red colour represents top layer.
https://cdn.sparkfun.com/assets/2/0/e/7/1/5205293d757b7f8e15e147cb.pnghttps://cdn.sparkfun.com/assets/9/0/2/6/2/52053bcd757b7f434a43b1f2.png
23
4.4.4. Using the Auto router
If you’re short on time, or having trouble solving the routing complexity of your board, you can try loading
up EAGLE’s Autorouter – – to finish the job easily.
If you don’t like the job the autorouter did, you can quickly hit Undo to go back to manual routing.
The autorouter won’t always be able to finish the job, so it’s still important to understand how to manually
route pads (plus manual routes look much better). After running the autorouter, check the bottom-left status box to see how much is completed. If it says anything other than “OptimizeN: 100% finished”, you need to do some manual routing.
https://cdn.sparkfun.com/assets/4/b/2/f/f/52054a53757b7fcd11078219.pnghttps://cdn.sparkfun.com/assets/3/9/e/2/4/5213a45b757b7f76578b4567.png
24
If you want to know more about optimizations and settings to be made in the autorouter. Check the EAGLE’s manual linked in resources section where an entire chapter explains it.
After the routing is done, there are a few checks we can do to make sure it’s 100% complete
4.6. Checking for Errors
4.6.1. Ratsnest – Nothing To Do!
The first check is to make sure you’ve actually routed all of the nets in your schematic. To do this, hit the
RATSNEST icon – – and then immediately check the bottom left status box. If you’ve routed everything, it should say “Ratsnest: Nothing to do!”
If ratsnest says you have “N airwires” left to route, double check your board for any floating golden lines and route them up.
4.7. Generating Gerbers
When you’ve finalized your design, the next step is to generate gerber files to be converted into CNC job files. Gerber files are kind of a “universal language” for PCB designs. Gerber files, each describe single
layers of the PCB. One gerber might describe the top copper layer, while another defines where the bottom copper layer and another the drill positions.
4.7.1. CAM Processor
Open the .brd file and Go to File→CAM Processor. First we have to generate Gerber files for the top layer,
then the bottom layer and then for the drill file. In order to generate the CNC job for the top layer choose the top layer and the pads and the vias. Choose the other settings as shown in the below picture which is
https://cdn.sparkfun.com/assets/5/5/6/b/7/52054cfe757b7fc9113ba8c8.png
25
particular for FlatCAM (which is the CAM software we will use in the next section). Now go ahead and select “Process Job”. This will export all the files into the same folder as your .brd file.
Note: Either choose pos.coord in all the files or omit that option in all the files. This option includes
the hidden layers into the output and shifts the Co-ordinate system to include all this in the positive co-ordinate space. You can omit this option if you feel your hidden layers occupy more space.
You need to generate two Gerber_RS274X files for top and bottom layer individually with separate names. Remember to select the mirror option for bottom Gerber file as shown in the below picture.
26
For exporting gerbers to drill vias and holes, you will want to do the same above again, but select the
“EXCELLON_24”. Excellon file is the drill file that contains drill specifications, size and coordinates.
The files are saved by default in the respective Eagle project folder. It is recommended to save all the files including CNC job files in their respective Eagle project folder only for easy modification and updation.
Now, Open the Gerbers and Excellon files for which you need to generate CNC job files in FlatCAM, which is explained in detail in the next section of the Tutorial.
27
5. Generation of G-Code FlatCAM is a program for preparing CNC jobs for making PCBs on a CNC router. Among other things like editing CNC G-Code files, it can take a Gerber file generated by any PCB CAD program, and create
G-Code for Isolation routing.
5.1. Direct-Installation of FlatCAM in Windows
Download the .exe installer of the latest Flacam version from the repository @ “https://bitbucket.org/jpcgt/flatcam/downloads/” and run it in your machine. It will self-run and include everything you need.
5.2. Exporting CNC Jobs for Routing
This section is a step-by-step tutorial introduction to the most common operation in FlatCAM.
1. Open a Gerber file: File→Open Gerber. The file is automatically analyzed, processed and plotted.
2. Go to options and change from application options to Project options the defaults to mm and the Tool size to 0.2mm which corresponds to the end size of the 0 deg V-tool we recommend to use.
3. Enter the diameter of the tool you will use for isolation routing and hit “Generate Geometry”. The units
are determined by the project setting and are shown on the bottom right of the screen. If you want to work
using different units, go to Options, Project Options , Units. This will change the units for the whole project.
This creates a new geometry object listed under “Project” with the same name as the Gerber object with an “_iso” postfix, and its options are shown in “Selected”.
https://bitbucket.org/jpcgt/flatcam/downloads
28
3. Create a CNC job from the new geometry by indicating the desired parameters as shown in the figure above and explained below:
Cut Z: The depth of the tool while cutting. -0.09 mm is the typical value for isolation routing.
Travel Z: The height above the board at which the cutting tool will travel when not cutting
copper.(Typical value: 1.5mm)
Feedrate: The speed of the cutting tool while cutting in inches/minute of mm/minute depending on the
project settings.(Typical value: 100mm/sec)
Tool diameter: The cutting tool diameter. Use the same value as when creating the isolation routing
geometry.
A CNC Job object has been added to your project and its options are shown in the “Selected” tab. Tool
paths are shown on the plot. Blue are copper cuts, while yellow are travelling (no cutting) motions.
Click on the “Export” button under “Export G-Code”. This will open a dialog box for you to save to a file. This is the file that you will supply to your CNC G-Code sender.
29
Similarly export a file for the bottom layer of your PCB too.
5.3. Exporting CNC Jobs for Drill Files
For details see the Excellon Object reference section.
1. Open a drill (Excellon) file: File→Open Excellon. The drill file will be drawn onto the plot and its options form should show up.
2. A drill file will usually contain different tools (drill diameters). You can choose to create a CNC job for each individual tool or bundle some of the tools together in the same job (in case you did not intend to use drill bits of different diameters).
http://flatcam.org/manual/objectreference.html#excellonobject
30
Click on Choose under Create CNC Job to open a selection window with the list of tools. Each has the format id: diameter, where the diameter is in the project’s units. Check the boxes by the tools you want to
include in the job. The comma-separated list of tools should appear in the Tools entry box.
3. Adjust Drill Z (Drilling depth), Travel Z (Height for X-Y movement) and Feed rate (Z-axis speed in project units per minute) to your desired values, and click on Generate.
A CNC job will be created and the tool-path will be shown on the screen. Click on the “Export” button under “Export G-Code”. This will open a dialog box for you to save to a file. This is the file that you will
supply to your CNC G-Code sender.
31
6. PCB Isolation Routing and Drilling
(A video demonstration of Isolation Routing for fabricating Double-sided PCB is given in the TLC project Webpage)
6.1. Universal G-Code Sender
A detailed explanation on how to use the universal G-code sender and calibration of CNC using it has been given in the previous tutorial. So, for now let us just assume that the CNC machine is properly calibrated and the user has enough idea on what the UGS does. The figure below shows the UGS opened in PC and
connected to the CNC Arduino controller. And we know that the UGS can open and execute any .nc files generated by CAM software and the live visualization can be viewed in the G-Code sender when the machine is running.
Fig.6.1. Showing UGS open with file mode.
Before we move on to making our own PCB there are few fundamental theories and practices to be learnt on how a
copper bare-board is captured and measured or aligned by a CNC machine.
6.2. Zeroing the Tool Tip
Moving the CNC tool tip to its exact origin position is known as Zeroing the CNC. Several methods and devices have been proposed for doing this precisely but the best and convenient solution is to use a microscope/camera mounted parallel with the tool axis(as parallel as possible). The camera points downwards
facing the PCB surface and shows an image of the part of the PCB focussed on the computer screen including crosshairs.
6.2.1. Calibrating Camera Offset
We know that the tool centre represents the centre of the axes and that the camera is mounted at a distance parallel with the tool axis. This distance is known as camera offset and this offset should be balanced every
time when zeroing the CNC. The software we recommend to use for camera video streaming is AMCap which has a feature of always staying on top of the other running programs in your computer screen and shows a magnified image with cross-hairs in the image.
In order to measure the camera offset, a hole is first drilled on the board surface using a drill tool and the spindle is moved until the crosshairs of the camera image line up with the center of the hole. The offset
distance is now measured from the position displayed in Universal G-Code Sender (UGS) as shown in Fig.6.2. We then save these coordinates into the macros tab of UGS (shown in the figure 6.3) which when
32
executed tells to set a position as offset point with respect to origin using command G92.Now, In order to set an arbitrary drill hole as origin, we just need to position the hole in camera and press the macro button with
the corresponding macro. For example, the figure below 6.2 shows how to measure the camera offset in UGS and the figure 6.3 shows how to set camera offset using the Macro. The macro G92 X44.5 Y35.1 sets the drill hole viewed under camera currently to be origin since the camera is at a distance of (44.5,35.1) from tool centre. The above procedure will accurately set desired any desired location to X, Y = 0.
Fig.6.2. Showing to measure current work position in UGS.
Fig.6.3. Showing macro to set offset.
6.2.2. Probing for Z-Axis
Fig.6.4. Showing macro to set offset.
33
But, the vertical position of the spindle, Z axis is also an important axis to zero out properly. For this, one wire is connected to the probe which as the positive terminal of the circuit. This terminal is pulled high with a
10K resistor and connected to an input pin (Ex: A5) of Arduino. Another wire connected to the ground pin is attached to the surface of the PCB when we mount it. We then use probing command “G38.2 Z-20 F20” in UGS which moves the tool towards the board at a feed rate of 20mm/sec upto 20mm until the tip touches the
board and makes an electrical contact through the wire. Now, this way the CNC easily determines the exact top of the surface and sets the origin position for Z axis.
Fig.6.5. Showing macro to set offset.
6.3. Making Double-Sided PCBs
In case of prototyping single-sided PCBs, the tool is moved and set to any arbitrary origin position (usually
on the lower left corner of the board) and probed for Z-axis. Then the Etching G-code file is run which cuts out the tracks and the pads. Now the tool is moved again to its previously set origin position using the “Return to Zero” option in UGS and the drilling G-code file is run.
But In case of double-sided boards, the same procedure is followed and the top side is engraved. Next, the
board is flipped and aligned to the axis of the top layer and the bottom layer is engraved and drilled. In any cases, it is not possible to align the board accurately with the x-axis with the help of alignment pins or markings; therefore the angle through which the board is rotated has to be measured to account for minute
variations. For this purpose, three reference holes are drilled on the four corners of the PCB board first along x and y axis. The two holes serve to measure the alignment angle while the third hole helps us easily detect which layer is up. The experimental procedure to do that is as follows.
Manually jog the tool along the four corners of your job using the command “G0” and drill the holes corresponding to the thickness of your board using Z- button on UGS. The below picture shows to manually jog to various corners of the PCB and drill hole using the Rapid positioning command with the length of the sides of the PCB being 60 mm.
Fig.6.6. Showing macro to manually move to all corners of the PCB.
34
Now measure the value of camera offset as explained in the top section and execute auto-levelling and warp the board if you feel the board is bent. Run the g-code file for the top layer exported from your
FlatCAM.
Fig.6.7.UGS showing the visualization top layer of PCB.
For the bottom layer, turn the board around and capture the alignment holes along the edge of a board to measure how much the board is skewed. The work position is measured in the UGS under UGS tab as explained in previous section. The G-Code file for the bottom layer is rotated through this angle
measured using the G-Code command G-68.Example: The below picture shows the macro to rotate the board just about the origin to 2.3 degrees.
Note: In case your CNC/GRBL version is no compatible with G68 option, then you need to use
separate software to rotate the CNC file. Example: You can use G-Code ripper option shown below
and load the CNC job file and select rotate option and enter your degree there and select the origin
option to be default. Make sure to include a minus sign if it is anti-clockwise.
Fig.6.8. Showing macro to rotate the co-ordinate system and hence the G-Code file.
35
Fig.6.9. Showing rotation of the G-Code file using software.
The tool is moved to the origin position again using the camera-zeroing and camera offset macro in the UGS. Now the G-Code file for the bottom layer is run. Once the bottom routing is done, the drill g-code
file is run successively. This takes care of both translation and rotation while flipping the PCB and the tracks and holes would match each other on both the sides.
Fig.6.10. UGS showing the visualization top layer of PCB.
36
Fig.6.11. UGS showing the visualization drill file of PCB.
37
7. Special Procedures Often in PCB designing, there arise special needs to make complicated circuits that involve PCB traces on
both of the sides. There are also other problems while fabricating PCBs such as uneven bed flattening etc. In this section of the tutorial, we will see how to use convenient techniques for easy calibration and adjustments in PCB fabrication.
7.1. Autolevelling
One problem that exists while trying to create finely etched traces is the inconsistency in the height across the
surface of the board. Reasons for this are that the CNC bed may not be flat or that the boards could be warped or
bent, which is usually the case if the boards are larger in size. Even minute height variations such as 1mm would
increase the groove width to 0.672mm.This can in turn cause the copper tracks between grooves to become too
narrow, or create shallow “aircuts” forming incomplete traces when the height reduces. The technique used here
to solve this is to probe the PCB surface in a grid pattern for height variations and modify the G-code so that
there is uniform depth while milling. A figure depicting PCB board milled without and with the use of
Autoleveller respectively when the bed is not flat is shown above.
The software used here to do this is Autoleveller which interacts with the CNC controller and modifies and
outputs a G-Code file for us to run with UGS eliminating the height variations. Load the G-Code into the
autoleveller software using the Browse button; you would see that the Probe settings vary automatically
matching the dimensions of the PCB file loaded. You can change the default settings such as probe spacing(the
space between the points of the probing grid, probe depth(the maximum distance the probe will go down if no
contact on board is made) and probe clearance(the distance between the board surface and the probe tip as it
moves up before going to the next point of the grid).
Note: Make sure that you connect the probe clip to the tool tip before you run the Autoleveller else the tool will
bury itself into the board and break. Also shrink the board dimension by 5mm in X Length and Y length tab of
your Autoleveller for the bottom layer of a double-sided board as we drill holes in to the origin position of the
PCB in top layer.
Fig.7.1. Showing the making of PCB board with and without the use of Autoleveller on a skewed platform.
38
7.2. Copper Area Clear
Removing large areas of copper is necessary when trying to avoid shorts due to dust, isolating components
or in RF circuits, where the remaining unused copper is just unwanted core load. We will see how to eliminate all copper that is not specified in the Gerber source, while still being able to selectively choose what to clear.
Open a Gerber file in your FlatCAM software. In the Selected tab for the Gerber Object, under Non-
copper regions, provide Boundary Margin and click Generate Geometry. This creates a new Geometry Object containing a bounding box around the Gerber object, with the given margin. Then subtract the
Fig.7.2. Showing the GUI page of Autoleveller
http://flatcam.org/manual/objectreference.html#gerberobjecthttp://flatcam.org/manual/objectreference.html#geometryobjecthttp://flatcam.org/manual/objectreference.html#geometryobject
39
Gerber object from the bounding box, resulting in a Geometry object with polygons covering the areas without copper.
Now we can choose which polygon we want to “paint”, this is, draw a tool path inside it to cover all its
surface. In the Selected tab for the newly created Geometry Object, under Paint Area, provide the following:
Tool diam.: The diameter of the tool that will be used to cut the area.
Overlap: Fraction of the tool diameter by which to overlap each passing cut. The default value of 0.15 is the minimum to ensure no copper is left in 90 degree turns of the tool path.
Margin: Distance for the tool to stay away from the polygon boundary. This can be used to ensure that large tool does not touch copper edges that have or will be cut by a smaller more precise tool.
40
Click on Generate and then click on the plot inside the polygon to be painted. This will create a new Geometry Object with the desired tool paths and they can overlap too.
7.3. Board Cut-Out
To cut the PCB to the desired shape and remove it from a larger blank PCB, a tool path that traces the board edge can be created. Gaps to hold the board until the job is complete can be placed along the edge.We will see how to create rectangular cutouts with 2 or 4 gaps.
Open a Gerber file and find the Board Cutout section in the Selected tab.
Specify the following
Margin: This will create a rectangular cutout at the given distance from any element in the Gerber.
Gap Size: 2 times the diameter of the tool you will use for cutting is a good size. Specify how many and where you want the Gaps along the edge, 2 (top and bottom), 2 (left and right) or 4, one on each side.
41
Click on Generate Geometry. The figure above shows an example of the results. Create a CNC job for the newly created geometry as explained in earlier tutorials.
42
8. Conclusion
8.1. Experimentation
Different sets of experiments have been done with the designed machine to verify its practical utility and
presented below. In the former part, the line resolution of the PCB is tested and a series of SMD footprints has
been fabricated. The fabrication of RF circuits is discussed in the later part.
8.1.1. Wire Width and Wire Resolution
A series of copper tracks with diminishing width has been tried and the thinnest track line that could be safely
fabricated with the machine is found to 0.2mm. Table 2 shows the calculation of the resolution of the line width
measured using microscope. (∆W) is the deviation in the width from the theoretical input width (WIN) to the
actual routed width on PCB (WPCB). Fig.8.1.a. shows the lines routed in the order of diminishing thickness from
top to bottom and a 0.1mm irregular track line at the top.
Table 8. 1. Calculation of line width resolution.
Input unit WIN(mm) WPCB(mm) ΔW(mm)
0.6 0.563 0.037
0.5 0492 0.008
0.4 0.422 -0.022
0.3 0.352 -0.052
0.2 0.212 -0.012
0.1 NIL NIL
8.1.2. Resolution of SMT
Fig 8.1.b. shows a fabricated board with some of the conventionally used SMT. It consists of SMT IC
packages such as SOIC, TQFP, SOT23 and resistor and capacitor packages such 0603, 0805, 1206, SMA etc. It
has been inferred that a SMT footprint with a pitch size of as low as 0.3mm can be fabricated safely with the
machine.
Fig.8.1. PCB fabricated with Lines and SMT footprints
43
8.2. Fabricating Radio-Frequency Circuits A conventional branch line coupler is constructed employing four λ/4 transmission line in a ring. We have
designed and fabricated a branch line coupler using microstrip technology working at 2.45 GHz on a low cost
1.65 mm thick FR4 epoxy material with dielectric constant of 4.4 and a loss tangent of 0.02.The physical
dimensions were calculated using microstrip line calculator and the board was drawn in eagle. The below graph
illustrates the full-wave simulated S-parameters of the designed branch line coupler. From the graph, the return
loss (S11), throughput (S21), coupled (S31) and isolation (S41) are calculated as -3.7 dB, -3.7 dB, -27.4 dB, and
-31.63 dB, respectively. The experimental measurements of the fabricated prototype and further calibration are
under progress.
8.3. Scope for Future Work
A software program to find the rotation angle for the bottom layer during fabricating two sided boards and to
perform G-code transformation is being developed. It will identify the reference holes on the corners of the
board using computer vision (OpenCV) and send signals to the CNC to move the camera to the centroid of the
rectangle and measure the angle of the axis of bottom layer. It will then create a transformation matrix and
modify the G-Code and run the etch files automatically. This program will also have the ability to interact with
the CNC controller and automatically send macros, find the camera offsets and perform zeroing of CNC and run
the whole operation cycle on its own.
Pick and place mechanisms for changing the tool and placing the SMD components can be added in future. In
order to implement more precise and fast operation of the machine and as well as for laboratory teaching, CNC
machines with stepper or servomotors having optical encoder feedback can be developed.
8.4. Conclusion
A BYO PCB prototyping machine has been designed and developed for fabrication of both single and
double-sided boards with through-hole and surface mount technology. The resolution of the machine was
studied and fabrication of RF circuits has been presented. An industrial method for soldering the components has
been mentioned. Problems usually encountered while fabricating high precision and double-layered PCBs have
been discussed. Commercial techniques used for easy and comfortable operation of PCB prototyping machines
have been incorporated in the procedure. The machine is fabricated with commercial and inexpensive open
source hardware components and software and so can be readily disseminated, adapted and improved for
widespread use in electronics education.
Fig.8.2. Fabricated PCB of a Conventional BLC Fig.8.3. Full wave simulated S-parameters of BLC
APPENDIX
DATASHEETS
BILL OF MATERIALS AND PART SUPPLIERS
PAPER PUBLISHED ON THIS PROJECT
USBUSBUSBUSB HandheldHandheldHandheldHandheld MicroscopeMicroscopeMicroscopeMicroscopeUSERUSERUSERUSER’’’’SSSS IntroductionIntroductionIntroductionIntroduction
FunctionsFunctionsFunctionsFunctions andandandand applicationsapplicationsapplicationsapplications
The USB HANDHELD MICROSCOPE is a new electronic product for themicro object observation. It is a tubular imaging system consisting of anoptical lens, an image sensor, an illumination mechanism, and an imagetransfer control circuit connected to a computer. You can display the imagescaptured by the USB HANDHELD MICROSCOPE on the computer screen,store them on the computer, print them, or send them over the Internet.
AAAApplicationspplicationspplicationspplications
As a USB microscope, it can magnify stamps, coins, antiques, insects,electric circuits, machines, hair, skin, fabrics, food, decorations, etc.
AttentionAttentionAttentionAttention
Before installation and use of this product, please read the instructions inthis manual to ensure its correct use.
SafetySafetySafetySafety instructionsinstructionsinstructionsinstructions
Before using this product, please carefully read the following safetyinstructions.
1. The socket that the computer is plugged in must be properly grounded,as the computer supplies power to this product. If in any doubt, pleasehave a professional electrician check and verify the grounding to ensuresafety.
2. Never use this product in stormy weather.
3. This product contains delicate and precision components. Be gentlewhen using it and avoid harsh handling or excessive force that maycause damage to the product.
4. The temperature of the handle increases slightly during use and it feels alittle warm. This is normal. If the product is overheated and hot to thetouch, immediately cut off the power and contact us for repair.
5. Never leave the product on unattended. Unplug from the USB port afteruse.
6. Do not disassemble this product. Disassembling this product will result inirreparable damage. The company is not responsible for damageresulting from disassembly of the product by the user. In case of anydifficulties in using the product, please contact us.
7. This product may only be used by children under supervision of an adult.Never give this product to a child to use or play by him or herself. Keepthis product out of reach of children.
8. Do not let this product come in direct contact with steam, vapor, water, orliquids of any kind. Such contact can cause irreparable damage that isnot covered by warranty.
9. When not in use, put the handle in the transparent sleeve and store it in atightly sealed box to avoid moisture and decay. Damages resulting from
improper storage are not covered by the warranty.10.The cable with this product has been strictly tested. To ensure safe use,
do not replace it.
SystemSystemSystemSystem RequirementsRequirementsRequirementsRequirementsFor best picture quality, the following specifications are recommended:1. Windows XP, Vista ,windows 72. 128M RAM or above3. At least one USB port (For best effect, USB 2.0 port is recommended).4. CD-ROM and a 40G or higher hard disc.
TechnicalTechnicalTechnicalTechnical SpecificationsSpecificationsSpecificationsSpecifications1. DSP: Digital Image Monarch Processor.2. Sensor: high-quality CMOS sensor3. Resolution: 640*4804. Colors: true color 24bit (RGB)5. Interface: USB2.0.6. Frame rate: 30 frames/sec (CIF and VGA).7. Magnification: 200×8. Size: 12mm in diameter,9. USB cable length: 1.6 meters
InstallationInstallationInstallationInstallationTo avoid mistakes in the installation process, please strictly follow thesesteps:Place the included CD into the CD-ROM drive.Find the icon of ‘amcap.exe’.Copy the ‘amcap.exe’ to your PC. Just copy but never try to install it.
Plug the HANDHELD MICROSCOPE into the USB port, and double click onthe icon of ‘amcap.exe’ to open the image window.
Bill of Materials and Part Suppliers
Part Specification Part Supplier Cost(INR) Recommended
Quantity
Total Cost
Stepper motors 3xNema 17, 1.8o,
200 step/rev, 2-
phase, 4 wire,
bipolar, 1.3A
StepperOnline 920 3 2760
Lead screws
with Bearings
Stainless steel,
3xM8x1.25, 20 turns
per inch
Amazon.in 710 3 2130
Spindle motor 24-36 V DC, 5000-
8000 rpm, 0.3A no
load
Zen
Toolworks
5790 1 5790
Power supply 24 V, 15A, 360 W,
switching mode
power supply
Zen
ToolWorks
3850 1 3850
Stepper motor
drivers
3xsingle axis, rated
3A, peak 3.5A, 24V
DC rated, up to 1/16
microstepping,
adjustable step,
current, and half-
decay
Sainsmart 1160 3 3480
USB camera
microscope
640* 480 pixel
resolution, 200X
magnification factor
Adafruit 7070 1 7070
Microcontroller Arduino Uno, R3
board, with
ATmega328P @
16MHz
Amazon.in 400 1 400
Tool Bits 0.6mm Drill bit,
0.8mm End mill bit,
V-Carving bit
Zen
Toolworks
257, 321,
192
3,3,3 751,963,576
Other Materials PVC board, Probe
clips and wires,
Emergency kill
switch, Fasteners
Local
Suppliers and
Amazon.in
(Chennai:
Angappa
Naicken St.,
Parrys)
3000 1 3000
Fabrication Cost CNC cutting and
Milling of PVC
board
15,000 1 15000
TOTAL 45,770
Available online at www.sciencedirect.com
ScienceDirect
Materials Today: Proceedings 00 (2017) 0000–0000
www.materialstoday.com/proceedings
2214-7853 © 2017 Elsevier Ltd. All rights reserved.
Selection and/or Peer-review under responsibility of International Conference on Advances in Materials and Manufacturing Applications
[IConAMMA 2017].
IConAMMA_2017
A Build-Your-Own Three Axis CNC PCB Milling Machine
N. Sathyakumar, Kamal Prasath Balaji, Raja Ganapathi and S. R. Pandian*.
Teaching Learning Centre for Design and Manufacturing Education
*Department of Electronics Engineering
Indian Institute of Information Technology, Design and Manufacturing, Kancheepuram, Chennai 600127,India
Abstract
The need for fabricating a prototype circuit arises frequently in electronics, including education and research laboratories. In
resource-poor countries in the developing world, this is hindered by the high cost of commercial Printed Circuit Board (PCB)
prototyping machines and long turn-around commercial fabrication process. Practical, hands-on laboratory teaching and
experimentation is necessary to improve learning in electronics. In this paper, a low-cost build-your-own (BYO) semi-automated
three-axis PCB milling machine for double-sided PCB prototyping is developed using commercial components and open source
hardware and free open source software, to provide students, teachers, and engineers an accessible and affordable resource for
PCB prototyping. Also, the main problems encountered during fabrication of PCB have been mentioned and the techniques used
to solve them are discussed in detail.
© 2017 Elsevier Ltd. All rights reserved.
Selection and/or Peer-review under responsibility of International Conference on Advances in Materials and Manufacturing Applications
[IConAMMA 2017].
Keywords: Build your own technology; CNC PCB machine; PCB manufacturing; Auto-levelling; Open source hardware and software.
1. Introduction
It is estimated that the global electronics industry output will reach USD 2.4 trillion by 2020. The demand in
semiconductor industry in India alone is expected to be USD 400 billion in 2020 and it is expected to create around
27 million job opportunities [1]. By contrast the entire Indian IT sector provides around 3.7 million jobs. Therefore,
the Indian government is encouraging initiatives such as Make in India, Digital India, Startup India, and Skills India
to facilitate growth of manufacturing and electronics industries in India, creating numerous high-paying jobs in the
process.
Thus, semiconductor industry is one of the fastest growing industries in India. With this, the demand for and
production of PCBs, which is at the heart of every electronic product are on the rise. PCBs not only provide
mechanical support for the electronic components but also provide other services like electrical impedance matching,
http://www.sciencedirect.com/science/journal/22120173
2 Author name / Materials Today: Proceedings 00 (2017) 0000–0000
electromagnetic shielding and heat conduction [2]. Specialized courses and curriculum in PCB design and
electronics assembly are introduced in electronics engineering education. However, due to high cost of commercial
and often imported PCB prototyping equipment, there is a severe lack of practical hands-on PCB design teaching
and learning in developing countries. This situation can be remedied with the increasing affordability and versatility
of open source hardware like microcontrollers and microcomputers, commercial off-the-shelf components like
actuators, sensors as well as free, open source software, which can be integrated for design of low-cost PCB
prototyping machines for electronics education.
Do-it-yourself (DIY) PCBs can be developed with simple techniques such as using an iron to transfer ink printed
on a transparency to a PCB with chemical etching. But these methods lack sufficient consistency for surface mount
devices (SMDs) and the drilling of holes is tedious since it has to be done manually. Further, the environmental and
health hazards from chemicals used in these processes are significant [3].
Development of safe and high resolution milling and drilling of PCBs is enabled using isolation routing which
overcomes many of the above mentioned drawbacks. In isolation milling, the copper from the board is first removed
to recreate pads, which are signal traces and structures based on the pattern generated by a PCB parts layout file.
In this paper, a BYO PCB prototyping machine has been developed and deployed to make both single- and
double-sided boards for through-hole technology and Surface Mount Technology (SMT).
The common problems encountered while soldering the components on the PCB and aligning the board layers are
discussed. Modern and innovative approaches used at an industrial level to overcome these problems have been
implemented in our machine and studied. Commercial techniques used in easy and comfortable operation of PCB
prototyping machines have been incorporated in the machine.
The above features have been implemented using open source software programs so that teachers and students
themselves would be able to fabricate high-resolution PCBs in an academic environment matching near-commercial
quality. A major advantage of the proposed system is that users can maintain and repair the machine on their own,
without expensive annual maintenance contracts or import of costly spare parts. With the understanding and
experience gained, the users can also gradually add advanced features like fully automated PCB machines with pick
and place assembly, vision feedback, etc.
The paper is organized as follows. Section 2 discusses how a PCB is designed from open source software and
fabricated using an inexpensive CNC milling machine. Section 3 describes the software and procedure to make a
PCB layout file and how to generate the fabrication data. In section 4, issues and techniques prevalent in PCB
fabrication are prescribed. Discussions of experiments and results are given in section 5.
2. Prototype 3-Axis PCB milling machine
2.1. Electromechanical setup
The design of the CNC milling and drilling machine used in the proposed PCB prototyping system is based on
our earlier developed 3-axis CNC mill, as presented by Pandian [4]. A detailed explanation about the mechanical
design, hardware and the software can be found in [4].
Fig. 1. Mechanical setup of the machine
Fig. 2. Electronics hardware assembly
Author name / Materials Today: Proceedings 00 (2017) 0000–0000 3
The mechanical system in Fig.1 consists of three stepper motors for motion along the x, y, and z axes, a PVC-
built frame, a high-speed spindle motor, lead screws for power transmission and other related accessories. The main
specifications of the milling machine are listed below:
Table 1. PCB milling machine specifications.
X,Y,Z axes travel 180 x 180 x 50 mm
Motors Steppers: 3x NEMA 17, 200 step/rev, 2-phase,
1.3A
Spindle motor: 5000rpm @24 V DC, 0.3A no
load
Lead screws Stainless steel, 3xM8x1.25, 20 tpi
Stepper drivers 3 x single axis, rated 3A, up to 1/16 micro
stepping
Speed X, Y axes: 8 mm/sec
Resolution Electrical: 1.8° (0.0062 mm/step)
Mechanical: 0.01mm/step
Weight 14 kg
USB microscope Resolution: 640x480 pixel
Microcontroller Arduino Uno
2.2. Tooling
The high speed DC spindle motor is used for isolation routing through milling and for through hole drilling. The
milling and drilling tool bits are mounted in turn on the spindle motor with a precision ER-11 chuck which holds
bits with 1/8 shank dia. A 30° V-engraving bit with end width of 0.1mm is used for routing. A 0.6mm single-fluted
drill bit is used for making holes and a 0.8mm end mill bit is used for copper rubout and for cutting sections of the
boards. All bits used are tungsten carbide bits because of their extended tool life.
2.3. Electronics assembly
The electronics unit of Fig.2. is placed compactly on the rear of the milling machine. Single stepper motor drivers
are used to power the individual stepper motors for moving the bits along the x, y, and z directions. The stepper
drivers are powered by a switched mode power supply (SMPS) DC power source of 24V.
Stepper drivers are reconfigurable with different settings for maximum permissible running current, stall current,
excitation modes of stepper motor actuation, etc. The running current can be varied from 0.3A up to 3A. Excitation
modes are available for full step, 1/2, 1/4, 1/8, and 1/16 of stepper motor turns. An emergency kill switch is included
from the input side and also a probing setup is used as explained later.
2.4. Arduino based controller
GRBL [5], [6] is a free, open source software used to generate CNC machine G code and M code signals that will
drive stepper motors using the Arduino microcontroller. G-code and M-code are programming languages [7] that are
interpreted by CNC controllers. G-code provides instruction commands for position, speed and path of the motion;
whereas M-code provides auxiliary commands for spindle motor speed, coolant flow, tool change etc. Compiled
version of GRBL software code is available in the form of hex file and is burned into the Arduino. Grbl CNC code
will receive signals from Arduino’s serial buffer and parses it to decode the serial data into G-code. Grbl settings in
Arduino will be stored in the EEPROM of Arduino and so when configured once will not be erased during power
off. Settings can also be viewed and modified anytime by sending corresponding configuration characters. $$
symbol is used as configuration character from which we can view different settings of the machine, such as axis
feed rate, steps/mm, software limits, axis acceleration values, and resolution of movement.
4 Author name / Materials Today: Proceedings 00 (2017) 0000–0000
3. PCB fabrication procedure
The design of PCB is drawn in Eagle computer-aided design (CAD) software and the fabrication data is generated
in one of many acceptable formats such as .brd or Gerber files. This file is then imported into computer-aided
manufacturing (CAM) software, which outputs a G-Code file which is a machine readable form of instructions. The
overall procedure in PCB design, conversion and fabrication is explained below.
3.1. PCB layout design
The process starts with circuit schematic design of PCB in Eagle computer-aided design (CAD) software [8].The
free student version of the software allows us to create up to 999 sheets including all 16 layers. Firstly, all the parts
needed for the circuit are added and connected according to the circuit diagram on the Schematic sheet. Eagle has a
library navigator which has a collection of parts used in circuitry to be added in the schematic. Thousands of user-
created library packages are made available online by the open source PCB community and could be added to the
existing libraries. The voltage and the ground terminals are added and the components are connected with each
other. A typical circuit diagram is shown in Fig. 3, and its schematic in Eagle is shown in Fig. 4.
Fig. 4. Circuit drawn in schematic Fig. 3. Circuit diagram of LED flasher using 555 timer
Fig. 5. Board layout corresponding to Fig.4
Author name / Materials Today: Proceedings 00 (2017) 0000–0000 5
The conceptual circuit schematic is next converted into the board Layout, where the actual positioning of
components and copper traces are done. Initially, all the parts from the schematic would appear in the Board file
stacked upon each other connected by airwires corresponding to the net connections made in the schematic. Once
the components are positioned onto the board, they are connected by the copper traces set on a single side or double
side. Copper traces can be set in different bent styles, angles, width, distances, etc. The parts are arranged in such a
way that the PCB is compact and small. A sample board design layout appears in Fig. 5.
Finally, we use the Design Rule Check (DRC) of Eagle to check our design for possible errors. Some of the
important and common errors DRC finds are minimum clearance distance between traces, inappropriate trace widths
or drill sizes and overlap between pads or traces.
3.2. G-code generation
The completed file has to be fed into computer aided manufacturing (CAM) software PCB-GCode converter [9]
which converts the .brd file into a G code file with the input tool and machine parameters specified. PCB-GCode is
the User Language Program (ULP) for Eagle produced by Cadsoft that we use as CAM software for producing G
code. ULP loads in the Eagle program and accesses its data structures and creates a variety of output files of desired
type and specifications. Various parameters for the toolpaths, design type, feedrates and other machining parameters
for PCB are inputted into the settings of the PCB-Gcode software.
Some of the important machining settings used are
1. Isolation - Increasing isolation helps in eliminating small slivers of copper left in-between tracks after cutting
process.
Isolation=Etching tool size + Minimum Isolation + (Pass No.*Step size)
2. Generation - The settings under this allow you to specify if you are fabricating a single or double-sided board,
which side you want the drilling process to happen, mirroring the pattern, etc.
3. Drill - Changes the depth of drills and mounting holes and drill dwell time.
4. Feed rates - These settings control how fast the CNC mill will cut and drill the board. As the feed rate
increases, the stress on the tool increases. Also, slower feed rates will ensure a smooth and clean cut on the board.
5. G-Code profiles - Altering the files under this helps you change the formats used by the program to generate
the G-codes to suit your machine.
Once all the input parameters are entered correctly, the software shows the preview and generates G-Code files
that cut out tracks individually for top and bottom layer, drill holes, engrave texts, and mill out sections of the board.
3.3. CNC machine control
The G-Code program is sent to Arduino from control computer (typically, a PC) by serial communication. Few
standard GUI open source software packages available for this are bCNC, Universal G Code Sender [10] or CNC
Grbl controller. These programs are very versatile and control the machine in manual mode or file mode. Options
similar to the human-machine interface (HMI) of expensive commercial CNC machines are included which help in
moving each axis individually, setting workspace origin, and homing cycles. Also, current position of world
coordinates and job coordinates are displayed based on signals sent from the software.
The software has options to set the current position to origin, return the machine to origin position, as well as
write and save complex commands under the macros tab used for tool and work offsets. The files generated by the
CAM software are loaded one by one and the tool is moved to the origin position and the job is run.
3.4. Isolation routing
In prototyping single-sided PCBs, the tool is moved and set to an arbitrary origin position (usually on the lower
left corner of the board). Now the etching G-code file is run which cuts out the tracks and the pads. Now the tool is
moved again to its previously set origin position and the drilling G-code file is run. Usually the option in the PCB G-
code software to create spot drills in the etching stage is used and then the actual drilling G-code file is run. Spot
6 Author name / Materials Today: Proceedings 00 (2017) 0000–0000
drills create ‘dimples’ or dents in the drill points so that the actual drill tool tip does not deflect and walk-off center
and the hole is drilled correctly. In case of double-sided boards, the same procedure is followed and the top side is
engraved. Next, the board is flipped and aligned to the axes of the top layer and the bottom layer is engraved and
drilled.
4. Techniques used in fabrication
4.1. Zeroing the CNC and probing
Moving the CNC tool tip to its exact origin position is known as Zeroing the CNC. Only then, we can ensure the
preciseness of the CNC and it has been a challenge in CNC operation. Several methods and devices have been
proposed for this but the best and convenient solution is to use a microscope/camera mounted in parallel next to the
spindle. The camera points downwards towards the raw material and shows a magnified image on the computer
screen including crosshairs. A hole is first drilled on the board surface using a drill tool and the spindle is moved
until the crosshairs of the image line up with the center of the hole. The offset distance between the camera and the
tooltip is now measured from the position displayed in Universal G-Code Sender (UGS) and then the offsets are
input under the macro tab of UGS. Thus, in order to set any point we want as origin, we move the camera to that
point and use the macro to set the current position as offset point with respect to origin.
The above procedure will accurately set desired X, Y = 0. But, the vertical position of the spindle, Z axis is also
an important axis to zero out properly. For this, one wire is connected to the tool tip, i.e. the probe and the other end
is pulled high with a resistor and connected to an input pin of Arduino (Fig. 6). Another wire connected to the
ground pin is attached to the surf