Update #4 - Tooling and quite a lot about Printed Circuit Boards
We’ve had a very exciting week – a package arrived from Shenzhen on Thursday with the very first test parts from our injection moulding tools. The test is known as ‘T1’ and it’s the first time that the customer (that’s us) sees parts from the tool. T1 parts aren’t the final colour, don’t have the proper surface finish, tend to have sink and ejector pin marks and (hopefully) are a bit smaller than the model you supplied, but we love them despite their flaws!
Getting the T1 parts is a huge milestone for a number of reasons, but perhaps most importantly it means we know what issues need to be addressed before we can move on to the second test, T2 and then to production. I’ll talk about this a bit more next time, as we’re heading out to Shenzhen at the end of the month for the T2 testing and to talk about the assembly and testing process (amongst other things).
Since we’re talking about timing, I’ll just take a minute to let you all know where we are, and how things are looking. The schedule in our Kickstarter campaign had us testing our first samples in July. With T2 happening at the end of this month we are on target for this, but really we were hoping for early July rather than the end. It did take a little extra time to design the carrying box (design work for the card box we’d planned still would have taken time, but could have been done later) but also, I think we were just a little optimistic about that time required to get the design production ready.
From a practical perspective, this means that we’ve used up the time buffer we built in to the project timing and so if we do hit any significant issues from now on, or if we’ve been optimistic elsewhere in our estimates (for example with the time between T2 and the production run) then that could impact delivery.
That said, there’s nothing like a deadline to focus the mind, and Victor and his team in China have years of experience of manufacturing products similar to Line-us, so we’ll be doing everything we can to stick to the schedule. If we do hit any specific issues we’ll make sure to let you all know. As you all probably know by now, we always like to dedicate a bit of our update to an in depth look at a particular topic. This time it’s going to be electronics, and we hope you enjoy it!
Rob and Durrell
Quite a lot about Printed Circuits
We talked about servos last time, and how the app sends the Line-us machine a coordinate to move to. We also explained a little about how you can tell a servo to move to a certain position, but glossed over the detail of how that coordinate gets translated to a servo instruction. The short answer to that question is that you need a tiny little computer.
Tiny little computers, or more correctly, microcontrollers, have been steadily finding their way into all kinds of products for quite a few years now. Washing machines for example used to have electro-mechanical controllers, now they will have a microcontroller because they are cheaper, more reliable and they can be re-programmed if necessary to fix problems.
This is nothing new, but recently manufacturers have started to develop microcontrollers with built in WiFi. This is an important step because combining them can make them incredibly cheap and (relatively) easy to use. A cheap, easy to use little computer that can connect to the internet inside a product opens up all kinds of possibilities, one of which is Line-us.
There are a few different WiFi enabled microcontrollers available, but one in particular, the ESP8266 has caused a bit of a stir among makers and, increasingly, small scale manufacturers. The reason for the ESP’s success isn’t down to a single factor, but the combination of things: it’s available as a pre-built and (very importantly) certified module that can be integrated into your own PCB (which is what we’ve done) or as a ready to go development board from people like Adafruit. It can be programmed using the Arduino environment, or in a dedicated IDE using, for example c++, there is excellent community support, and there are plenty of good quality code libraries available.
Here are two slightly different ESP modules, with the protective cans removed so you can see the insides.
What this all means is that you can start development with an off the shelf board like the excellent Adafruit Huzzah (or SparkFun Thing) and Arduino, and move gradually towards a custom PCB with firmware written in pure c++ as necessary. This is exactly what we’ve done with Line-us, and whilst the ESP isn’t perfect, it’s pretty good and we’re big fans. I’m not going to talk about the software side this time, but will go through the electronics design in a bit more detail to illustrate the point.
We’ve been pretty good at keeping as many of our prototypes as possible, but unfortunately I don’t have the very first breadboard controller we made. This is the earliest we have; clearly far too neat for the first iteration!
We used this board for a lot of the early development work and testing. Some of the components were added later, for example we resurrected the board to test the two LEDs and the button. The blue potentiometer is so that the board could be used as a servo tester.
The next step was to move off from the Huzzah and to integrate the module onto our own board. To do that we built a test circuit on a breadboard to verify the design. It’s not too complicated but we wanted to test out the power regulator. If you look carefully you can see the tiny surface mount regulator with wires soldered onto it on the top left of the board next to the big blue capacitors.
Once we were happy with the design we used a PCB design tool to lay out and connect the components on the Printed Circuit board. There are a few free tools available; we used DesignSpark from RS components, but the process is similar regardless of the tool. First you create a schematic. This is a diagram that shows what connects to what – this is the schematic for the power regulator for the first PCB. This circuit takes the 5v supply from the USB and converts it to the 3.3v required by the ESP. We used the same regulator as on the Huzzah – if it’s good enough for Adafruit, it’s good enough for us.
The next step is to translate that to an actual PCB layout, but it’s probably worth going into a bit detail on what a PCB is first.
A PCB starts life as a flat piece of a composite board about 1 or 2 mm thick with a thin layer of copper on one or both sides (or sometimes a sandwich with 4 or more layers). A photographic or screening process is then used to print a ‘resist’ onto the copper for the parts of the copper that you want to keep to form your circuit. The board is then dipped into a chemical etching bath that eats away the unprotected copper. This leaves copper ‘traces’ that, if all goes well, connect the components that you want connected.
This is what the top copper layer looked like for our first test board. If you’re wondering why lots of the traces seem to go nowhere it’s because we’re using a two layer board so they go through the board to the other side (this is called a via). To get from a schematic to a what you see above requires a bit of work though.
Step one is to make sure you have all of the ‘footprints’ for the components you’re using – the footprints are the copper shapes you need to have on the board to solder the components to. In the picture above you can see the footprint for the USB connector on the bottom right hand side of the board. If you’re lucky you’ll be able to find the footprint in a library, but sometimes you have to find the datasheet for the component and draw it out yourself. Here’s the footprint for the USB connector we’re using in the final design (which is slightly different from the one above).
Once you have the footprints you can start to decide where to put the components on the board. For some, like the USB connector it’s dictated by the design of the product (because you need to be able to plug the cable in!). In general though you want to keep the traces as short as possible and separate the noisy stuff from the stuff that’s sensitive to noise. That last bit is easy to say, but less easy to actually do. At high frequencies (WiFi is 2.4GHz) electricity does funny things and proper RF design is an art form – we got some great advice from very talented friends on this for which we’re very grateful!
Once you’ve placed the components you can get on with ‘routing’ the tracks, i.e. connecting everything up. Most design packages have an auto router, which is fine for an early prototype but for a final board you probably want to do some, or all of the routing manually.
The next step is to run a design rule check (DRC). The DRC checks for many common design problems; things like tracks running too close to each other or that aren’t connected, or components too close to the edge of the board. If your design passes DRC then there’s a good chance it will work!
As well as the copper layers the design package will also create solder masks, pate masks, silkscreens a drill files. The final step is to then create the manufacturing plots, known as Gerbers, that you can send to a PCB manufacturer.
These are all of the layers for the board (this one is for the second version). Red is top copper, blue is bottom copper.
It’s generally quite a good idea to make a mock-up of the board before getting the PCB made, so we laser cut a board in acrylic and stuck on the key components to make sure it fitted into Line-us. Here’s the mock-up (on the left) and the assembled board (middle).
Once you’ve made a board there’s a good chance you’ll want to change something. For this test board we put a USB to serial converter and two buttons on the board so we could load firmware more easily. The board on the right has them removed, and we added two USB termination resistors and a bypass capacitor across the switch at the top. The intention was to simulate the production board more closely before making the next prototype.
The next board was our first try at a production board. By this stage we had approved our engineering design for Line-us and so we knew the final dimensions. We’d also agreed how the board would be fixed inside the machine, and that we would add a second small PCB to mount the button (rather than using a right angle button as in the design above).
Here’s what it looked like: the mock-up, bare PCBs and one that’s been assembled.
We were hoping that this would be the final board, but when we looked at it we decided there were a couple of thigs we weren’t happy with. One was the USB connector, it only had two solder pads so we moved to one with four which will be stronger. The other was a sourcing issue with the connector on the back side of the board. In fact this turned out to be a good thing as the new one is not so high, which means it can be closer to the edge of the board. This allowed us to re-route some traces which should be better from a noise perspective. That board is being prototyped at the moment but looks a lot like the one above.
The last thing I want to mention is manufacturing. The boards in the pictures above were all hand soldered. The components are quite small – from left to right in the picture below: voltage regulator with a capacitor above, four 0603 resistors, the USB connector, an old style through hole resistor and an industry standard US Quarter Dollar for comparison!
… and for dramatic effect, here’s the voltage regulator sitting on the head of a pin!
As you can imagine, they are a little tricky to solder by hand but with a fine tipped soldering iron and a magnifier it’s fine to do a few. More than ten or so gets a bit tiresome, and so a thousand boards for the Kickstarter machines requires some automation.
This is an interesting process and is very different from the old style of assembly where components have wires that go through holes. Almost all PCBs are ‘surface mount’ now; they are much smaller, quicker and cheaper to assemble and more reliable. Assembly is really a three stage process. First, a solder paste (a mixture of solder and flux) is put onto the pads on the PCB. A thin metal mask with holes in just the right places is used to do this (it’s a bit like silk screening). Then, a pick and place machine takes the individual components and (usually with the aid of a vision system) puts them in the exact right places on the board. Here’s a video of one in action: https://www.youtube.com/watch?v=OgxhMpkzvdA
The machines need the components to be on tapes (which come wound onto reels) – you can see them at the bottom of the video. Here’s a close-up of some capacitors supplied in a tape. These are samples so there’s a bit of masking tape stuck on so I know what they are, but you can see two components at the end.
Once all of the components have been placed the board goes into an oven, which melts the solder paste and solders the component to the board.
So, that’s how you make a PCB, at least that’s how you do it if you want to make lots.
Do drop me a line if you’ve got any questions, but just one final thing for those that made it this far (because it has been quite a long update).
When I was talking about T1 parts at the beginning of this update, I said that we generally hoped they would be a bit smaller than the model, but didn’t explain why. Just for fun, we’ll send one of the Line-us postcards we offered as a Kickstarter reward to the first person to come up with a good explanation for why this is. I’m looking for someone who works it out, rather than already knows - so if you work for an injection moulding company I’m afraid you’re disqualified!
Send your entry to firstname.lastname@example.org by Friday 14th July
Rob and Durrell