I needed 12 similar PCBs for a bigger project. The most clever idea would be to design them, then order them with pre-mounted SMC parts from JLCPCB or Oshpark. But I needed to test the circuit, the PCB design and the whole module before deciding to order it. For this I wanted to create a prototype of the PCB.
Designing the PCB in EasyEDAThe PCB has on the top side some copper traces and three SMC RGB LEDs. All these are in bright red. On the bottom side I drew some lines to indicate where to add some resistors (through hole components, not SMC). Then there are a lot of holes. The idea is to make a PCB with a copper layer on only one side. But this described process can easily be extended to a PCB with copper on both sides. In that case, special care has to be taken to make the holes conduct from one layer to the other.
While this design might be quite correct for ordering the PCB from a provider like JLCPCB or Oshpark, it needs a lot of editing before it's ready for a CNC router.
Exporting from EasyEDAExport the design to an SVG file. You get to choose which layers you want to export. Choose the top layer, the board outline and the multilayer:
When exporting, an SVG file is downloaded. Open it in Inkscape:
If we would treat this image as a bitmap, we could do a shortcut via tracing a bitmap in Inkscape. It would be a bit like jumping back and forth from vector graphics to bitmap graphics. I will show later how that is done. Right now we stick strictly to vector graphics, since that's what the EasyEDA editor is all about. And that's what a CNC router is all about.
This SVG image consists of several objects of different kinds. All the copper traces between different elements are polyline objects, with defined line widths. All the rectangular pads are defined as rectangles. The circular objects consist of one black circle and one smaller white circle. Then we have the outline, which is a black rectangle (or a square in my case). There is even a circle involved in the rectangle. I have no idea why. Here's how it looks like in the XML Editor:
I've clicked on one copper trace line. I changed the stroke colour for case of visibility and moved it to the top. I opened the XML Editor in Inkscape just to check what kind of object the trace line is. It appears to be a polyline, with two end points and some vertices inbetween. Just to show how these vector graphic objects work, I show the following in minor steps. First I convert the polyline to a path (Path->Object to path, or Shift+Ctrl+C). Now it looks like this:
Now it's a path and not a polyline. The vertices can be moved, changing the path of the trace. The line width can be changed. Actually I'd like to do it at this point, because creating the copper traces with a CNC router is not very precise and we don't want to end up in too narrow traces. So I could change the line width:
Here I changed it from 0.254 mm to 0.5 mm. But it's still just astroke. I don't want the CNC router to follow this stroke. I want it to follow the outline of the stroke. So it has to be changed to a path following the edge. This is why I changed the stroke width at this point. To the following I do Path->Stroke to path:
Now you see that the vertices don't follow the central line of the stroke, but the edge. The very path I want the CNC router to follow! For visibility, I'm going to change the object contour (stroke) to black and the fill colour to red. I do it on this copper trace and I do it on the rectangular patch to the left.
But wait!
The rectangular patch seems to be a combination of a polygon and a circle. The circle is quite unnecessary and I have no idea what it is, but I'm going to get rid of it. Also the circular objects are a bit too complicated, consisting of the smaller white circle and the bigger black circle. These are grouped objects (svg:g in the XML Editor). We can get rid of all groupings once and for all. Ctrl+A to mark all objects. Shift+Ctrl+G to ungroup all selected groups. When doing that, it appears all white circles turn black. They are still there, on top of the bigger black circle.
Now I can click to select the bigger circle (click again, if you got the smaller circle). Shift+click the copper trace and Shift+click the rectangle to add them to the selection. Then do Path->Union or Ctrl + +.
Now we have one single object in red. We lost the black stroke, probably because the rectangle never had it and the rectangle probably was highest up in the XML code. We also see the smaller black circle on top of it. We can leave the black circle there, because it marks the place where to drill a hole. But for clarity, I delete it now. If I change the stroke colour to black, everything looks like this:
This is the very essence of this lesson, dear pupils. What we now see is onesingle object, an svg:path object with its own id in the XML code. It can't be divided anymore, so it's not like an ungroupable grouped object. But now, when the CNC router is going to follow the outline, it won't separate the copper trace from the rectangular patch.
The same has to be done with all other connected areas. Learn to use the hotkeys, they are crucial for the experience of this actually being a simple procedure! In short:
- Change the line width of the copper traces if needed (perhaps this should be done already in EasyEDA)
- Change them further to paths (Path->Stroke to path or Ctrl+Alt+C)
- Select all objects (bigger circle, copper trace, rectangular patch) that belong together by clicking the first one and Shift+clicking all the rest.
- Make a union (Path->Union or Ctrl + +).
- Change stroke style and fill colour to check that you got it right.
Changing the line width the easy way
I had some copper traces with a line width of 0.254 and some with 0.5. The quick way to set all to 0.5 is selecting one with line width 0.5 and copy it. Then click at each object and do Shift+Ctrl+V. (I mentioned the shortcut first, because that's the only sane thing to learn when learning editing with speed. You can also do Edit->Paste style.)
Mind the gapThis image shows all areas which are to have a copper layer:
For clarity, I've changed the line width to Hairline. But when the CNC router mills along this hairline, with say a 0.5 mm tip, it will eat into the copper traces. If it's a cylindrical tip, it has a certain radius, which will eat in on the traces. If it's a conical tip, the deeper it goes, the more it eats in on the traces. Let's say it's a 0.5 mm cylindrical tip (basically a 0.5 mm drill). Its radius is 0.25 mm. If we could push all contours 0.25 mm outwards, we would be ok.
Let's focus on a small detail:
The trace between the circular patch and the rectangualr patch is 0.5 mm wide. Some gaps between the traces seem to be less than 0.5 mm. We can examine in Inkscape what happens, if we use a 0.5 mm drill. First we push out the boundary by 0.25 mm:
The yellow outline shows the original boundary. Pushing the stroke of an object outwards is called Outset. First set the amount of outset in Edit->Preferences->Behaviour->Steps. Then mark your object and do Path->Outset.
If we now set the stroke to 0.5 mm wide, we get:
The black area shows pretty good how the 0.5 mm drill would cut into the PCB. The red area inside doesn't differ much from the original (the yellow outline). In the meantime we see how the 0.5 mm drill would eat into the copper trace below, because the gap between the traces was under 0.5 mm. But keeping in mind that the original trace width was 0.254 mm (probably a standard setting in EasyEDA), this might be ok.
Performing the same actions to the whole circuit gives us this:
At some places the copper trace has shrunk to half of what it was, but as I said, it's probably ok. If not, I have to rearrange things in the layout. I still want to check one thing. Looking only at the strokes as hairlines, we notice this:
If 0.5 mm is enough space between the copper traces, it's unnecessary to let these strokes overlap each other. By editing the strokes by hand, I can get rid of the overlapping. Here I edit the paths by moving the nodes:
I've marked the three nodes of the overlapping segment. Then I grab one of them (the red one) and drag them halfway towards the line below. After that I mark the object below and raise the corresponding nodes to meet the previous moved stroke segment.
After taking care of all overlapping parts, the hairline image looks like this:
And with 0.5 mm stroke it looks like this:
Some copper traces in the middle of the board are less than 0.5 mm, but now I've optimised their width by removing the unnecessary overlapping.
The white parts in the image still would be copper layered. Big areas of copper being left on the PCB could potentially cause capacitace issues. If that is the case, one has to mill those areas away. Inkscape has functions for preparing the right path for that, too.
But before that, we will prepare the holes. I already deleted the smaller white circles. But I can get them back, if I do a new export from EasyEDA and this time only export the board outline and the multilayer. After deleting the white circles, I got this:
I decided to actually drill the holes with a proper 1 mm drill bit, while the copper traces should be made by engraving the paths, or the contour lines of the traces. A look at how the G-code works led me to do some simple text editing instead of trying to get Inkscape create everything.
Inkscape doesn't deal with single points. Instead the images consist of these paths from point to point. So I decided to draw a polyline from hole to hole:
To find the center of the hole, enable snapping. The hotkey is %, but check the settings for snapping! Here I have enabled snapping to the middle point of objects. After drawing a path through all holes, I get something like this:
If I output this to G-code, I just get an engraved path with straight lines. The G-code would look like this:
...
G00 Z5.000000
G00 X17.271990 Y22.732740
G01 Z-1.900000 F100.0(Penetrate)
G01 X21.716990 Y22.859740
G01 X24.129990 Y22.605740
G01 X24.129990 Y20.065740
G01 X24.129990 Y17.398740
G01 X24.129990 Y14.985740
G01 X24.129990 Y12.445740
...
After initializing, the tool is set to 5 mm above the copper plate.The tool is moved to the given xy coordinate.The tool is lowered to 1.9 mm below the copper surface, which practically perforates the PCB. Then the tool moves to next xy coordinate, engraving through the PCB! This is not wat we want. We want the tool to raise, then move, then make another hole etc.
To accomplish that, we edit the file a bit. First of all, G00 means quick move to given coordinate. G01 means slowly engraving or cutting (depending on tool) to given coordinate. F100.0 means 100 length units per time unit, I think it's mm / minute. Knowing all that, we change the code to:
...
G00 Z5.000000
G00 X17.271990 Y22.732740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X21.716990 Y22.859740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X24.129990 Y22.605740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X24.129990 Y20.065740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X24.129990 Y17.398740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X24.129990 Y14.985740
G01 Z-1.900000 F100.0(Penetrate)
G00 Z2.0000
G00 X24.129990 Y12.445740
...
What I've done is I've added the G00 Z2.0000 after each penetration. Then I've changed the following XY movement from G01 (slow engraving) to G00 (quick move). Notice how the drill command (G01 Z-1.9000) and the lift up command (G00 Z2.0000) are exactly the same each time. That's copy-pasting, right? A lot of ctrl+v, down arrow, ctrl+v, down arrow, ctrl+v, down arrow... again something really worth learning. Some clever code editors designed for G-code might handle this much better. I leave it to you to do the research.
My first fully engraved PCB
...failed. Of course. That was expected. But nevertheless I was very satisfied with the result. There's very little to adjust. Here's the result:
I used a 1 mm drill bit for the holes and a 45 degree carving bit for the traces. 45 degrees means if you dig 0.3 mm deep, your trace is somewhat 0.25 mm wide.
Some important traces couldn't hold together (marked with red). At some places not belonging to the circuit, the copper got lose from the board and might cause harm (marked with green). Here's a cool macro image from the board:
The carved ditch is far from 45 degrees. You just can't calculate trigonometrics. It's more about trial and failure. But this image shows that the copper layer is really thin. It's either 30 or 60 µm. I could make shallower carvings, making wider traces and still separate the traces from the surrounding copper. And I haven't even considered yet carving away more of the surrounding copper.
Looking at this first attempt gives me a lot of ideas where the traces could have gone differently. Instead of going back to EasyEDA, I just edited the Inkscape file:
The path marked with red was re-arranged, allowing the traces below to be wider.
Comments
Please log in or sign up to comment.