Some of the photos of this publication have been lost during migration to a new platform by BLOGPRESS. Sorry for the inconvenience.
PCB engraving using a CNC
HOW TO MAKE PRINTED CIRCUIT BOARDS BY CNC ENGRAVING
(BU POSTANIN BLOG İÇİNDE TÜRKÇE SÜRÜMÜ DE BULUNMAKTADIR)
Selçuk ÖZBAYRAKTAR MARCH 2018 Rev 1
PCB Engraving using a CNC
INTRODUCTION and SCOPE
Mostly only one or two of printed circuit boards are needed by hobbyists when developing a new device. When these boards are simple, so that they can be realized on a single sided PCB, I used to make them using photoresist spraying and chemical etching methods. I also tried to use photosensitized dry films and toner transfer methods. But none of them were practical enough, I was spending a lot of time and effort to have a PCB on my assembly table. Finally I decided to take another route: Engraving copper lamination of the blank PCB using my desktop CNC.
This method helped me to avoid a lot of headache I have been suffering. Such as:
- I can create conductor lines and drill holes using the same machine and same process at once, without removing the board from machine
- No Problem of hole alignment with conductor pattern
- No chemicals, solvents, acids, contamination,
- No need to challenge to clean the blank PCB to prepare it for resist film coating
- No waiting for drying of photoresist or evening it to dry
- A lot cheaper then other methods
- …
Of course, you will need a desktop CNC for that, but you need it for other purposes too isn’t it? My CNC will be subject of another post in this Blog.
How fine the PCB geometry can be achieved, depend on the precision of the CNC and the cutting tip. My CNC has 20 micron step size and a satisfactory positional repeatability for such loads . When I use a 15 degree tip engraving bit, I can easily obtain 0.5mm thick conductors with 0.5 mm isolation channels between them. Flatness of the board and coating uniformity of the copper foil have effects on this result.
I did not try finer geometries, but I will test it and share the results here.
This method is good for single sided boards which are not very dense. In cases where several connections can not be realized on only one side, they can be easily completed using soldered jumper wires.
Double sided boards can be made using the same method, but it is a bit more complicated since both sides of the PCB need to be aligned carefully. As long as we do not have through hole plating, such PCB’s are really difficult to assemble and solder, and have risks of disconnected vias. So I don’t intend to make double side PCB’s. When I can not avoid a double sided PCB, I still consider Chinese manufacturers who make 10 of them for 5 Dollars, and deliver in 3 weeks to my door.
This method is good when you want a working prototype on your desk in the evening, that you started to draft circuit in the morning.
Another advantage is, you can obtain a very effective cross talk protection between signal lines and noise immunity since you have a lot of copper planes that can be grounded and act as shields.
In this post, I tried to make a complete guide using several resources I found on internet. I tried to make a complete detailed step by step guide. While doing that, I tried to give references to the resources used.
Prerequisities:
Following tools shall be used. I assume reader is already have basic competence to use them. I will not explain their installation and usage of them. These tools are free or have free versions for hobbyists.
- AutoDesk EAGLE
- AutoDesk FUSION360
- InkScape
Success and efficiency of this method requires some considerations during layout and routing work.
- My cutting bit – a DrillPro product bought from Ali Express- can not cut grooves less than 0.5mm, that means that is the limit for isolation gaps.
- Conductor lines, that go parallel side by side should share their nearest borders, which is different than normal designs. They look touching each other and shorted on the drawing. In our manufacturing method we save one unnecessary cutting line and save space. So, using this saving we can have wider conductor lines.
- Cutting bit will eat 0.25mm of conductor line on each side, so consider that you will lose 0.5mm on each line. By the way, 0.5 mm conductors can be obtained safely but, since we do not have through hole plating in holes, there is no mechanical support to these lines except their sticking force to the base material. When there is a slightest pushing force from component lead, these tiny copper lines came loose and broken. So, as long as pads do not belong to SMD components, avoid going to thin connectors, use 2.54mm designed width, so after cutting they will have a safe 2mm width.
- If we have a geometry, full of 2.54mm pitch component pads, make conductor width 2.54 mm, so above mentioned considerations can be automatically met.
Following two drawings should put a light on the above considerations. You can notice the design considering the (RED) jumper wires also :
Normally preferred design
GENERAL DESCRIPTION OF THE PROCESS
To make engraved copper lines, we should select one side -which is more populated- and generate a gerber code file for our CNC. If our PCB is already designed as a single sided PCB, this decision is clear by default. In case of double sided PCB design, we will make one side on CNC by engraving, and connections on the other side have to be done using soldered jumper wires.
In summary overall process flow is as follows:
- Design your circuit layout as a single sided PCB using AutoDesk EAGLE. Or design a double sided PCB, but maximum amount of conductors on top side. (That we will call “prime side” from now on.)
- Save prime side layout in DXF format from EAGLE. In addition to this, while in EAGLE you should create a CAM (make) file. This is a .zip manufacturing package that has a .xln file for drilling holes of our PCB.
- This DXF drawing has lots of unwanted lines in it. These unnecessary pieces of lines are cleaned using AutoDesk FUSION360. Final retouches are made to obtain an optimized board for this process.
- Finalized drawing shall be exported from FUSION360 again in DXF format.
- This new .dxf file is imported in InkScape drawing application. In Inkscape, Drawing moved to place it on correct coordinates, i.e. lower left corner to be placed on “0,0” origin point. Then using a proper plug-in of InkScape, drawing is exported (saved) as a “Gcode” gerber file.
- This .gcode file loaded into a compatible CNC where it is executed to engrave the PCB.
- Before removing engraved PCB from CNC, engraving bit is replaced with a drill bit to drill holes. This time, .xln file is loaded in the CNC for execution of drilling program.
DETAILS OF THE PROCEDURE
In the following section generation of gerber cutting codes that belong to prime side of the PCB is being explained.
Note: In this guide PCB layouts on Eagle and Fusion360 are shown as a normal PCB for the sake of clarity. Actually board shall have very thick lines as explained in the initial paragraphs. At the final stage an EAGLE layout and routing shall look like below:
FIRST STEP , EAGLE WORK :
We carry out our design work on EAGLE. I will not explain how to design a PCB using EAGLE, I assume you already know it. So, create your circuit schematic and board layout, then obtain a resulting board as follows.
Before performing following steps, save your EAGLE Project and create a CAM package. This can be done by clicking on CAM button (generate CAM data). We shall use the .xln file from this package to drill holes. Normally this package is delivered to PCB Manufacturer if you want to order it to them.
Then let us continue to generate CNC cutting program i.e. gerber Gcode file. The .brd file which was created in EAGLE shall be saved in .dxf format as “name_R1.dxf”. (Use your own name of board instead of “name”)
To do this, uncheck all sheets from menu “Sheets”. Then select only top (or bottom depending which is your prime side), pads, vias and dimension sheets.
Then click OK and save the file using File/Export/dxf menu clicks.
To do this, click DXF, and enter name of your file “name_R1.dxf” in the appearing dialog box. Uncheck boxes “always vector font” and “fill areas” , select dimensions as mm, and continue with clicking OK.
Now our file should be saved in the desired location.
WORKS CARRIED OUT IN FUSION360
- import our “name_R1.dxf” file to Fusion360 as a sketch.
- To do this click Sketch/Create Sketch
When Create Sketch or insert dxf clicked, selection of a plane of sketch is required. I prefer to use X/Y (bottom) plane. Select that plane by clicking on it, it should become blue.
Now we shall select the file to be imported. Click “select dxf”:
Then click Open:
Then click OK. Click on the “top” of the cube on upper right corner, so that we will be looking at the drawing from top.
Now we are going to edit our drawing on this sketch and remove unwanted line pieces. Each piece of line means a groove that will be cut by CNC. If we leave all boundary lines as seen on the sketch, our conductor lines and attached pads shall be sliced in isolated sections, whereas we want it to be a continuous connected copper line. For that reason we must remove boundary lines on the connected conductor lines and attached pads.
To do that, click on “Sketch/Trim”. Now we can select and erase unwanted line segments.
Zoom into any part of the sketch that you want to work, so selection can be done easier. When you bring cursor over the line segment that will be highlighted by becoming a red colored bold section.
Click on the red line to remove it, it will disappear, leaving some marks behind.
It is mostly possible that there are a lot of unvisible parasitic line segments left on the sketch. You should use zooming and use “Modify/Delete/Select/OK” function extensively to clean smallest residual lines and dots. Make selections of rectangular areas that look filled with dots, and remnants of the previous trimmings. It is a good idea to check “Show Points” checkbox in the Sketch palette on the right side.
If you fail to perform this task properly, you will have some unexpected holes and objects in the final output, that will spoil your PCB. If that happens, you should return to this step to do further cleaning on your sketch.
Following is an example to such parasitic circle that appears in the InkScape image -we will come to that in next steps. A surprise circle which was not visible on FUSION360 sketch.
It is good to replace rounded line ends and turns with rectangular ones, this makes your engraving program much smaller and work much faster. Finally edited and cleaned sketch looks quite different than its EAGLE version, but optimized for an efficient CNC milling.
Save this finalised sketch under a new name like “name_R2.dxf”. To do that, click on Save As DXF using drop down menu sketch/name_R1/.. in the browser window on the left side of the screen.
Fill in the fields of file name and location in the next dialog box. We shall use “name_R2” to refer it in this guideline.
STEPS CARRIED OUT IN INKSCAPE
Now our finalised design has been saved under a file named “name_R2.dxf. It is time to generate a Gcode CNC command listing. Although there are other alternatives such as “voxelizer” around, I preferred to use InkScape application for this purpose. InkScape is a free drawing application that has a lot of functionalities.
InkScape should have Gcode plug-in. If not, last part of this post gives a guide that explains how to add one.
Now, assuming that you already installed required plug-in, open InkScape app and open name_R2.dxf by importing it. I had version 0.92 of InkScape at the time of publishing this post.
Follow below steps:
Open InkScape app.
Click on File/Import.
Find and select our dxf file in next dialog box.
After selecting dxf file, click “open”, do not touch anything on next dialog box, just click OK and continue.
Our drawing now appears on InkScape workspace, but resting outside of the drawing sheet. We must carry it on the lower left corner of sheet. Rather then dragging with mouse, it is easier to enter “0” into X and Y coordinate boxes on top menu line. Be careful to have exactly “0” in these fields since InkScape puts minus “-” sign in front of zeroes time to time. It is important to place left corner of the drawing on exactly “0,0” otherwise holes and pads will be out of alignment at the end.
Now our drawing is placed as it should be.
To generate the Gcode file, click on “file/save_as” :
On the next screen, enter file name as “name_R2” and from listbox, select Gcode plug-in that is named “3-axis gcode plotter (*.gcode)” seçilir.
If required plug-in was not loaded previously, you can not find this option in the list. In this case save your file as an InkScape (.svg) file and got final section of this post to load that plug-in. Then you can start by reopening InkScape and continue as follows.
If Gcode plug-in available in the list, we can continue.
Now a dialog box will appear, where we can enter CAM (manufacturing) parameters. Here we should enter
- X/Y Dimensions of workspace. This should be compliant with maximum dimensions of your PCB. If your drawing exceeds these dimensions, you will get an error message and Gcode file will not be created.
- Penetration depth of your cuttting bit into PCB (Z down)
- Travel height of your tool,
- Cutting Speed of your CNC
- Etc.
If everything OK, click OK, and Gcode file shall be generated and saved. This Gcode file can be uploaded to CNC and executed.
If you want to visualize your Gcode file Pleasant-3D is a good application for Mac.
Excellon drilling code file that we can find in Eagle CAM (.zip) package is a text file with .xln extension. Your CNC should be able to execute this code :
And this is the resulting PCB coming out from CNC. PCB is good but I am not proud of the edges. I could cut edges using CNC, but it makes a lot of noise, creates a lot of dust and erodes the milling bit.
ADDING GCODE PLUG IN TO INKSCAPE
To be alble to operate the CNC, we need to obtain a gerber file from our DXF drawing.
We can use InkScape for this purpose. But InkScape originally saves its files as .svg, Inkscape files. To give it capability of generating gerber files we must add it a Gerber Plug-in.
To do that, I used GcodePlot extension that is given in Inkscape.org sitesi. In earlier versions of InkScape I was using an Unicorn add-on, but it does not work with latest versions.
When we click on this extension on InkScape.org page, it redirects you to an another page:
When you click on the Link here, it takes you to an “Instructables” page, where author of this plug-in published it. Thanks to him, he has given an excellent description to download and use it.
Description is clear:
When we click on the “gcodeplot scripts” link, you are taken to another site where you can download the plug-in.
We can download and use “gcodeplot.zip” file.
To load this Plug-in to InkScape on MacOs:
Use Finder, right click on “Applications/Inkscape” sağ tıklanarak then click on “Show package contents” option.
Then access to resources/share/Inkscape/Extensions/ folder:
Then copy contents of downloaded zipped GcodePlot folder into extensions folder:
I did not copy all contents, since some of them were already available.
And now if you restart InkScape, you can find “3-axis-Gcode” option under “save-as” listing file types.