Sunday 24 March 2013

Soldering fail

Our laser-cut pcbs were certainly quicker to make than using laser-etching (we converted the pcb image to vector and cut out from around the traces rather than using the laser to etch a rasterized bitmap image) and the ferric chloride made a great job of etching them.

But because the mask had been laser cut, the etched part of the board is very very narrow.
And this has made soldering rather difficult. The tiniest little movement of either iron or solder means it's really easy to create bridges across the tracks - even when using tons of flux

We made a right mess of soldering the pin-header connector too - ripping the traces from the pcb when removing the IDE ribbon cable we'd squashed on top of it. So it looks like we're going to need to re-think the pin header idea - and find a way of solder-masking the rest of the PCB to stop the iron from bridging the traces when too much solder is applied!

Saturday 23 March 2013

Contact etching pcbs with lasered paint mask

It's cold and wet and the nerd cupboard seems such a long way away, and we've a pcb here that needs etching. Making up a batch of ferric seems like a bad idea, and storing it in the house could be a pain. What to do?

On one of the instructables pages, someone suggested contact etching using a sponge:

Apparently it needs only a tiny amount of ferric chloride, so we put about four or five crystals into a ceramic eggcup and added a few drops of hot water. With some hair-dye gloves on, and a bit of sponge, we set to work, rubbing the ferric all over the copper board.

We've actually no idea how quickly it etched. The board is a funny orange colour (rather than the usual green we normally use) so it was almost impossible to tell when all the copper between the traces had been removed - it looked the same to us even after ten minutes!

Thankfully, the car paint sticks to the board really really well, so you can afford to even be a little bit rough with the sponge and board - no fear of the mask flaking off like you sometimes get with press-n-peel. After about ten minutes of rubbing the board over, we thought we'd take the mask layer off and see if anything had happened. If not, we'd put contact etching down as a bad job and never try it again!

The end result was very impressive.

Note how the trace in the top left corner has been completely removed. This is where we put the laser on too high a power and wiped out all but the tiniest, thinnest trace. Perhaps we did over-etch the board with the ferric chloride after all!

Although it's more than likely that we'd damaged the copper. Before starting the etching, we noticed that in a few places the copper had actually bubbled up from the board, where we'd blasted it with a high-powered laser!

As you can see in the photo above, the actual copper itself is damaged where the power of the laser was too high. So as we've etched away the good part, the bad bits have just disintegrated too.

Overall the end result is very good. We're going to repeat the exercise again using green coloured copper clad board, so we can see exactly how quickly the contact etching process takes. And of course, this time make sure we're running the laser at the correct power! The only thing of slight concern is that the laser drawn lines are very very fine. There's still plenty of copper between and around the traces and pads. Whether or not this will affect soldering or make it more difficult, or more likely to bridge, we'll have to wait an see. First instincts tell us that lots of flux is going to be needed to solder these boards!

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"


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!

Laser cutting PCBs

Laser cutting? That's right! We're not laser etching here, we're laser cutting!
We took our PCB design and using Inkscape converted all the strokes into paths. Then, joined all the paths together using the union tool (it took about 45 seconds for the computer to think about that one). Lastly, we swapped the fill (solid black) and the stroke (null) and set the stroke thickness to 0.1mm
The result was a complete outline of our PCB traces:

So why cutting and not etching?
We've already found out that the fastest speed we can run our laser at is about 50mm/sec. And etching a board up to 100mm high, at a precision of 0.1mm means about a thousand horizontal passes. And the board is over 100mm wide, so that's more than 2 seconds per pass, so about 2000 seconds to etch. That's getting on for half an hour to etch a single PCB!

But if we replace etching with cutting, we should be able to get a reasonable "etching" speed from the laser. There's one way to find out -

We sprayed some acrylic paint onto a copper clad board and left it to dry for about 20 mins before running it through the laser cutter. The result was encouraging (but ultimately not really very satisfactory!)

The entire board took just under 3 minutes, cutting at 4mA and 50mm/sec.

But there's something not right here - those are some pretty wobbly traces! As we watched the board cutting, sometimes we could see the still-wet paint closing back around an etched line, making some lines fuzzy and indistinct.

Steve suggested Halford's Matt Black car paint, to be applied in two thin coats (with a few minutes with a hairdryer between coats to help them dry more quickly) rather than one big thick splodgy coat. We did this and tried again

This time the result was quite a bit sharper. But some of the lines (and especially the pads around the SMT resistors) were still a bit wobbly. It seems that running the laser at full tilt introduces a bit of vibration as it's cutting (the laser does bang about a bit as it twists and turns so quickly around those tiny little pads!)

We tried a third time, running at almost half speed, 30mm/sec. The result was much better and hardly any wobble at all in the pads/traces. This final attempt gave us a board which looked like it would etch and give a pretty good result

The only thing is, we forgot that when you reduce the cutting speed, you don't need as much power! The first trace lasered is that big thick etch running along the bottom and left hand edge of the board. It took us a while to realise what was going on, and we had to reduce the power down from about 4mA to 2mA to get a nice clean cut.

A quick wipe of the board after it was finished, with a wet cloth, and the tracks are all nice and shiny and clear of debris, ready for etching. It's getting rather late here now, so that'll have to wait until the morning!
Here's hoping it etches ok (and that we got our cutting depth right and everything still lines up...)

Tuesday 19 March 2013

Back to a modular pcb-based board game

Having tried a non-pcb based board, and found it too fiddly, we're now re-visiting the idea of a pcb-based module for our board game. But we need to address some of the issues that made us think abandoning it was the right approach.

The first thing is that a 7-hex module is a great design, but only for a single module! When you try to put a few of those shapes together, you end up either with big gaps in the tessellating pattern or end up with lots of "spare" squares left over, because of the way the pieces fit together.

Basically, when you put multiple 7-hex segments together, the tessellating "direction" isn't regular:

The "direction" of tessellation is peculiar - neither upwards nor across, but in a not-quite-diagonal direction. This is the first thing we need to address. Ideally we want our modules to line up either horizontally or vertially. But how to achieve this? By simply adding another three squares...

If we want to make a roughly rectangular board game from these modules, we still get a few unused left over squares, but not nearly as many as we'd get if we made the same board layout from 7-hex segments. Plus, the "direction of tessellation" is running across the board. A much more satisfactory layout!

We haven't yet made up one of these boards to try out, but the basic principle is this:

Each board uses two shift registers. The first 5 bits on each register are used to control the leds on the module; the input serial line goes into one shift register and the output from this goes into the serial-in on the next shift register. The output from the second shift register goes back to the connector to allow data to be passed on to the (serial-in on the) next module in the board.

The buttons still use the resistor ladder approach. Since our other design, using a parallel to serial shift-register but with input buttons (instead of hall sensors) would still require pull up resistors on the inputs, we figured we'd keep the resistors and just lose the PISO shift registers. The downside to this approach is that each module must have it's own analogue input on the host micrcontroller. Luckily, we've some Microchip samples coming of PICs with a massive 32 analogue inputs on them. We might yet still need to use two of these together, in which case things may get a little more complex, but for now we're going to stick with this analogue/variable voltage approach for testing for input.

Now - why ten squares? Isn't it a bit wasteful?
Well it is, but here's why we're not worried:

Firstly, a 7-segment approach is wasteful. Only using 7 bits of a shift register rather than the full eight. In this arrangement we're still being wasteful, but now using 5 bits per shift register, instead of the full 8. We did consider expanding the board again, making it 15 squares but decided against it. Why?

A 15 square module would be physically very large. Etching such a large board could prove to be a problem. In fact, just getting the press-n-peel right on something so big could be a nightmare!
But also, we're sticking with 10 because it allows the same design to be used for actual square squares in future, not just hexes. A grid of 3x3 squares could be accommodated using the same techniques (only using 4 bits of one register and 5 bits of the other). Taking it a step further, a module of 4x4 squares could also be made, using all 8 bits of each shift register.

But a bit like avoiding a 15-square module for our hexes, going to a 4x4 grid of squares might cause problems on the analogue read, depending on the resolution of the host micro. A ladder of more than 10 resistors could have lots of cross-over, depending on the accuracy of the resistors in the ladder.

So we figured 10 is a nice compromise. It's not as efficient as using 15 hexes in a module, it does waste a few bits on the shift registers, but it does mean our input resistor ladder has only 10 different points to ground, making each band between inputs that little bit wider, and making it a bit more robust.

So about the only thing left to do is actually make one of these boards up and see if they actually work!

Resistor ladder for digital board game

Having decided to scrap making modules and a pcb-based board game, at one of the open nights at BuildBrighton we managed to put together a simple test piece for our game. It's still a 7-hex module whereas the final board will be 12 by 24 or something, but we're just trying out the idea of "dead-bugging" our design - soldering the parts together with bits of wire rather than mounting onto a PCB.
The result was..... interesting:

The buttons were held in place with hot glue. That in itself makes putting this thing together quite tricky - and there are only 7 playing squares here - the final board will have nearly 400!
Dabbing the wires onto the buttons was easy enough, but sometimes, when adding a wire and a resistor, one would pop off while the solder was still hot. Very frustrating! Because of the hot glue, only one of each pair of terminals was available to solder to.

From the front you'd never know what a mess it was at the back. But gluing the buttons and routing all the wires is a bit fiddly. It's almost like we could do with some kind of board that we could mount the buttons onto, to hold them in place, and then perhaps run the wires on the underside, rather than the same side as the buttons....

Almost like some kind of PCB, but with the buttons on one side and everything else on the fact, a pcb with through hole buttons, rather than surface mount ones would be just the thing! (is this starting to sound familiar?)

Thursday 14 March 2013

Testing clicky buttons for digital board game

Although our buttons aren't soldered up yet and are only held in place with tape, we found out last night that the height of the button head is quite important for our board game to work.

We dropped the hex playing squares into place, and some buttons clicked fine while some didn't. There wasn't much difference (none that was immediately visible) between the two. Except one must have been slightly higher than the other. Luckily that could easily be corrected by adding a small piece of card on top of the non-responsive button. It's incredible that the thickness of a piece of card could be the difference between a button working or not!

Wednesday 13 March 2013

A quick trip to Brighton Plastics on Boundary Road in Portslade (for some clear 3mm acrylic), 20 minutes drawing shapes in Inkscape and 10 minutes on the laser and we've a new prototype to try out!

 (this is the base layer - with holes for the buttons and LEDs to be mounted from underneath)

(this top layer will be cut from clear acrylic and the outer part glued to the base)

Instead of placing our hexes exactly side-by-side, we're cutting them out, leaving a surrounding bit of plastic. Although this is make from clear acrylic at the minute, once assembled, we'll be painting the whole base a single, solid (black) colour. Doing it this way not only saves acrylic, but also ensures that the hex pieces will fit back "inside" the honeycomb surround!

While Steve will probably go ape about us using superglue instead of contact adhesive or some polystyrene cement, we just wanted to see what it would look like so grabbed the first glue that came to hand!

The hexes give a satisfying faint click as each one is pressed. Nothing distracting, barely audible, but enough for you to register that the button has actually pressed down.

The solder tags on the buttons are all on the back of the board now, so there's no need to worry about ugly wires getting in the way (they can just be taped to the back of the board, then the whole thing mounted on a nice base).

At the minute, the hexes are just "floating" inside the honeycomb frame. Tip the board and they all just fall out! Steve suggested using buttons with a taller head on them and putting a few dots of funky foam under each one. By using dots instead of a continuous shape, the hexes can easily be pressed down - and they give an interesting effect to the board: each playing square would now be raised above the rest of the board

We could glue the hexes to the foam and have the foam stuck to the base so none of the squares come loose when the board is picked up and moved around. The only thing is we'd have to change the way we were planning on lighting up the playing squares:

Originally we planned on covering one side of the clear acrylic with a sticker, and using the laser cutter to take out a thin border around the edge of each playing square. But putting bits of funky foam in three of the six "corners" means we'll have to change our engraving pattern - otherwise the foam will get in the way of the light when a square is supposed to be lit up.

The effect isn't quite what we first planned, but is still a reasonable finish. With the correct colour scheme and sticker effect (they don't have to be plain black, they could be textured or slightly hologram-effect) these might actually look pretty cool!

Funky foam isn't so funky

Funky foam is nice and soft and squidgy and quite flexible. But cut it into thin shapes, and the laser makes it go quite brittle and hard.

Plus it's only soft when you push it in one spot. When I mounted a hex onto this foam and tried to depress the entire hex shape downwards, the funky foam proved to be quite resilient! So, as is often the case when prototyping new ideas, it's back to the drawing board.

It's also time to consider the electronics that go under the playing squares too - funky foam is just under 2mm thick. Whatever we use in its place also has to work with the electronic components (push button/led). In our first example, the components sat under the playing piece, which sat on top of the funky foam. By pressing the square down and squashing the funky foam, the push button underneath could be pressed

But in practice, pressing against the foam was actually quite hard work. So now we're thinking of allowing the hex to be ever-so-slightly raised by the push button underneath, with a supporting "honeycomb" structure around each one.

Resting a button between two pieces of 3mm acrylic and we can see that only the button part stands slightly proud. If we were to use 6x6x4 tactile push buttons, and mount our pushbuttons from the underside of the playing board, we'd have a raised area of about 1mm to activate each playing square.

A hole is cut in the 3mm acrylic/mdf playing base and the pushbutton mounted from underneath (this also gives us the advantage of being able to solder to the underside of the board and hide all those nasty blobs of solder!)
 When pushed through, only the push-button part is raised. Over this, we place our hex cut-out shape

And place the playing square on top, simply floating on top of the push button. Each playing square should end up raised by 1mm. They may be fixed to the push button with a dab of glue (being careful not to glue the push button into a fixed position!) or simply left floating.

(Each playing square would also be engraved to allow the light from the LED underneath to shine through when lit but this has not been drawn here.)

Tuesday 12 March 2013

Hex based digital board

It's been a while but we gave the old laser cutter a dusting down this evening and set it to work, trying out some ideas for our Dreadball board game.

Funky foam is a great spongy material for supporting our playing squares - only when it's cut on the laser, the cuts are quite wide, even at full speed (60mm/sec) and at low power (less than 3mA).

Despite this, we managed to get a usable frame from the foam, with pieces just 1mm-2mm wide:

We couldn't find any clear acrylic for this test (the final idea is to cover one side with a black sticker then laser shapes out of it to allow the LED to shine through from underneath). But we did find some rather fetching semi-translucent red

This sits over the funky foam just right!

The completed assembly (minus internal electronics). Although it's just a prototype, it's looking pretty nice.

The next step is to wire up some buttons and LEDs and give it a try!

Saturday 9 March 2013

Linear rails for possible CNC?

A few weeks ago, at one of our Thursday BuildBrighton meetings, Matt suggested another cnc machine idea.   We've already completed one - a pcb drilling machine - and while the mechanics and software side of things were pretty good (for a £30+ cnc) the quality of the stepper motors was always a little suspect!

These cheap little stepper motors are all over the internet (and despite being rated at 5v as this one is, we found running them at 7v-9v the minimum, else they stall really really easily, but they can handle being driven hard at up to 12v. Beyond that, we've no idea - we didn't want to intentionally burn one out!)

What's not immediately apparent from this photo is that the shaft is actually offset from the centre:

And that's because, inside, there's a load of internal gearing which gives these little motors a pretty decent amount of torque for such a small package. In fact, the motors we had were geared by 1:64 on a 1/64 stepper motor - meaning they required 4096 steps for one complete revolution. By the sounds of things, perfect for ultra-tiny movements, and therefore precision accuracy.

Unfortunately, the internal gearing comes with a price - backlash!
When you send up to 100 step pulses to these motors, they can either move a great distance (depending on the size of the cog the motor is turning of course!) or they may not move at all, as all the slack in the cogs is taken up. This can be compensated for, a little, in software, but it's not ideal. So a while back, when some cheap steppers came up on eBay, we got hold of three decent motors and waited for the opportunity to present itself...

As often happens, when eating pizza and talking rubbish at BuildBrighton, discussions soon got around to making another cnc machine - this time with a multiple head attachment, for doing solder paste spotting as well as pick and place for SMT components. We already had the stepper motors, we've got access to equipment for cutting frames, inside of messing about with cheap-and-ok, we thought if we're going to do it, we'll make a pretty decent spec machine this time. And that means linear rails....

This morning, Mr Postie dropped off another peculiar looking package at Nerd Towers, covered in hieroglyphics from the Far East and we tore into it:

Yay! 12mm linear rails. Perfect for any decent-sized cnc machine (up to about A3 cutting bed size we reckon, certainly more than enough for up to A4). They're actually quite chunky but in a reassuring way. The mounting holes are already tapped, ready to take an M5 bolt.

Check out those tiny little ball bearings! These rails (we've got six) are going to be perfect, at least for our X/Y axis on the next CNC machine (whatever that is, whenever it gets made). They're actually quite big for a z-axis, unless Matt has ideas about making a massive monster-sized machine.......