Friday, 22 March 2013

Laser etching PCBs instead of CNC routing

Well, our last post created a bit of interest - although some of it was just asking for clarification: we're not really etching the PCB with the laser cutter - it's still a copper clad board and the laser cutter still can't cut through anything metallic. But what we are doing is painting a mask onto the copper board (Halford's own brand Matt Black car paint if you ask) and then using the laser cutter to etch around our traces, much like a PCB CNC router would do.

Some people have already used a laser cutter to "etch" the PCB mask. What this means is that the laser cutter "draws" a bitmap by passing the head quickly left-to-right, firing the laser to make up the image, one scan line at a time. This is a very accurate way to create images (and a great way of "drawing" PCBs) but it can be really slow.

We're using the laser cutter in "cut mode" - so our artwork needs to be made entirely from vectors, not a bitmap. Depending on your PCB software, this could be easy (export CNC router files as dxf/vector) or a little more involved (ExpressPCB doesn't have an export option - it's free software to encourage you to use an online fabricator, but you can "print" your designs to a virtual printer, CutePDF)

We took our PCB design and printed it to a PDF using CutePDF.
Then we opened it in Inkscrape and hacked it about a bit. Here's how:


Print the top copper layer in ExpressPCB to the CutePDF virtual printer. Enter a filename and a PDF magically appears. Open this PDF in Inkscape


Our PDF was made up of a number of different types of objects (shapes, paths, lines etc) but to begin with they were all grouped together as one complete, moveable object. So the first thing to do is select all and UnGroup.


We selected the background and put it on it's own layer (so it can be made visible/invisible as needed). We also coloured it a different colour so that we can tell which shapes are on which layer. The first thing to note is that all the (black) traces on our PCB have been drawn over the white outline shapes.


This step is optional, depending on whether you want drill hole markers in your pads. We selected every centre of every hole, cut it from the PCB, added a new layer and pasted-in-place the holes. We then coloured them yellow so that they could be easily identified as being on the "holes" layer (and not part of the PCB layer)


With the holes layer invisible, select a white section of the PCB. We want to remove all traces of the white parts of the PCB, leaving just the black traces.


From the Edit Menu, select Find and in the pop-up dialogue put #ffffff as the "style" to find. Note that #FFFFFF doesn't always work - keep to lower-case just to be sure! Make sure the tick box for "find in this layer" is selected (we don't want to go deleting anything else by accident!), then hit find and wait a little while. All the white parts on the PCB layer will eventually become selected. Hit the delete key on your keyboard.


Right, that's got rid of all the white. Select all the black PCB traces on this layer. They're a peculiar mix of shapes, strokes and fills. Select "convert-to-path" to make them all similar shape objects. This can take a while. Go and make a brew.

When the eggtimer finally disappears, all your selected shapes should be the same type, so now we can merge them all together. From the Path menu again, with all the black parts selected, choose "union" to join them all together. Go get yourself a biscuit to go with that brew. This might take a while.

Eventually you should end up with one solid black shape. The highlight marks around the object(s) should now highlight one single shape.


If you want your pads to include drill holes, turn the holes layer back on. All your holes should appear as yellow dots (or whatever colour you changed them to). With the entire black shape selected, hold down the shift key on the keyboard and select a yellow dot. From the Path menu, choose "difference". The hole should be cut out from the black shape:


The reason we changed the colour of our dots is so that we can see when they have actually been cut out of the PCB traces, and are not just sitting on top of them. Repeat this with all the holes on the board (it's repetitive but not actually that hard to do all the holes).

Now here's where the magic begins. With the entire black shape selected, right click on stroke settings in the bottom left corner of the screen. Select "swap fill and stroke"


Ta-da!


Now, remember that this board is currently designed for press-n-peel; when it's transferred, the image gets flipped. Because we're drawing the PCB directly onto the copper, it's important to remember to flip the entire image. So turn on the background layer, swap the fill and stroke to get just the outline, then select all and from the Path menu, Flip Horizontally


That's it. We're done. Phew!
Don't forget to save as a format that your laser cutter can handle (we use .dxf) - if you're using RetinaEngrave or other virtual printer port software, you can print directly from Inkscape to your laser.


Don't forget to turn up the speed on your laser, and turn down the power. You're only cutting through a very thin layer of paint, and the copper board underneath will cause the laser beam to scatter - so plenty of speed (though not too much to make the cutter vibrate as it's working) and as low power as you can get away with!

You can use exactly this same technique, saving the results as dxf, to create files to load into a CNC mill, to do direct PCB milling on any compatible CNC machine too!