Monthly Archives: June 2018

Easy PCB stencil creation and alignment

I have a product that I’ve just started selling; it’s a LED globe/Soldering challenge kit that looks like this:

It has a PCB that looks like this:

image

For my first run, I needed to make 10 kits, and each of them has 12 of these boards, so that’s 120 boards.

I’ve been hand-soldering the prototypes, but it takes quite a while and my eyes aren’t as good as they used to be. I just built a reflow oven based on the controleo3 kit so that I can reflow in cases like this.

Which means I need a stencil. I could easily just order one up, but that means I’m going to have to align this tiny stencil with the board 120 times. Doesn’t sound like fun…

What we need is a way to apply solder paste to a set of boards in one shop and make it repeatable. In the woodworking world, that would call for building a “jig”, or perhaps a “fixture”. Which is what this post is all about; we’re going to use a laser cutter to make all of this oh so much easier.

Teaser photo

Here’s a teaser photo of what we’re going to build:

IMG_9248


Get your board outline and paste mask in SVG format

Since I’m doing my design in Kicad, this was really easy; just go into your design, click the plot button (like you would to create Gerbers), choose the F.Paste and Edge.Cuts layers, and set the plot format to SVG. That’s it.

Well, actually, you should probably modify your paste cutouts to be a bit smaller than they are by default; see this excellent reference for how to do it in Kicad.

If you are using a different package for your design, search online for how to make stencils from it; it will tell you how to export.

Create a combined image in Inkscape

The export give us two separate files; one has solder pads, and the other has the board outline. The first step is to combine them together.

Open both images in Inkscape. Change the color of the edges to blue and the color of the pads to red. We do this so we can control which ones get cut and which ones don’t in the laser cutter.

You do have access to a laser cutter, right? Because if you don’t you’re wasting your time.

Anyway, that gives us two instances of Inkskape:

imageimage

We now need to combine those two together in another image.

Create a new document in Inkscape with File->New. Go to the pads Inkscape version, do a Select All, then a copy. Switch to the new document, choose edit->paste in place.

Repeat the operation with the edge cut Inkscape version.

If your are of true character and have a pure heart, you will get the following:

image

Edit->Select All, then Object->Group. That puts this all together into a single object.

Save the document away with a catchy name like “Combined”. We now have the image for a single board.

Duplication

We now need to create an array of objects; in my case, it’s going to be an array of 4 wide and 3 high. We’ll start with the four:

  • Select the single object.
  • Paste it three time. Line them up approximately. It doesn’t matter like this.
  • Bring up the align and distribute menu. You will never find the icon to do this, so try CTRL-SHIFT-A. Hover around until you find a icon that says “align top edges”, and pick it.
  • Distribute the empty space using “make horizontal gaps between objects equal”.
  • Mine looked like this:

    image

    Those are way too close together for me. Undo the distribute, move one of the edge ones out, and redo the distribution.

    image

    That’s better. The actual spacing is up to you. Group them together and save.

    We’ll do the same thing for the rows; create two copies, align the left edges, and then distribute:

    image


    Save. Looks like we’re done, right? Not quite, there’s one more thing to add:

    Indexing

    This will work fine, but we would have to hand-align the stencil with the boards, and that’s going to be a bit of a pain to do. What I want is a way to make it repeatable.

    The secret is pins. Pins, I say!

    A trip to my local hardware store yielded two 5mm shelf support pins. They are likely longer than I need and I might cut them in half for my usage. They look like this:

    image

    We are going to use them for alignment, which means we’ll need some 5mm holes.

    Flip back to inkscape, and draw a circle. Pick the selection tool, and up under me menu bar, you’ll see the width and the height. Set both to 5mm:

    image

    Set the fill color to full green, set the stroke color to black, flip over to the stroke style, and set the width to 0.1mm. It should look like this:

    image

    Put this one to the upper left of your objects, copy it, and put the second object to the upper right. It should look something like this:

    image

    Note that it doesn’t look that great. That’s okay, we will fix that now.

    Draw a rectangle from one corner of your objects to a point spaced away; this will be the pin location. Something like this:

    image

    Then drag the circle so that it is at the corner:

    image

    I call this “using a gauge block”. Move the rectangle to the other corner and use it to align the other pin as well, and then delete the rectangle. They don’t have to be symmetrical for the technique to work, but I like things to be regular.

    I ended up with this:

    image

    Why so many items and so many colors? We will use them in the cutting process.

    The jig that we created will be a sandwich of different materials; from bottom to top they are:

  • On the bottom will be a piece with only the peg holes cut into it; we will use the black circle outline for those cuts.
  • Next up we will have a piece with the peg holes and the edge cuts, so we will cut both black and blue.
  • Finally, for the top, we will cut the actual stencil; it will have the circles cut for alignment and the solder pads.
  • There’s a bit more complexity than that; I’ll talk about it when I get to the actual cutting.

    Materials…

    The goal of making the fixture is to make laying down the solder paste easy, so the materials need to be chosen carefully.

    My PCB house says that they material they use is 1.6mm thick. I don’t trust material thicknesses, so let’s check:

    IMG_9234

    That’s pretty close, just a 0.04 mm thicker than I expected.

    For the main parts of the fixture, I needed something that was fairly rigid, fairly cheap, and the right thickness. I thought about hardboard but decided to go with what is called “chipboard”; I’m not sure why it is called chipboard because it’s just very compressed cardboard, the kind you find at the back of tablets of paper.

    After looking it locally in vain, I ended up heading to Amazon, where I came across this:

    Grafix Medium Weight Chipboard Sheets, 12-Inch by 12-Inch, Natural, 25-Pack

    Grafix Medium Weight Chipboard Sheets, 12-Inch by 12-Inch, Natural, 25-Pack

    25 sheets was more than I needed by about 24 sheets, but it laser cuts well and is decent for prototypes.

    The thickness isn’t listed in the specification, but that was one of the questions asked, so I looked at the answers and found that is was:

  • 1/16th of an inch at most
  • .057” (1.45mm) (from the manufacturer)
  • Almost exactly 1.5mm per board, determined by measuring a stack
  • 2 mm
  • It’s nice to have some many helpful answers. I could probably make most of those work, so I ordered it. It showed up, and what did I find?

    IMG_9233

    So, the correct answer was “none of the above”. It is notably a full 0.1mm thinner than what the manufacturer says. I’m not sure that just means there is more variance than the manufacturer says or they are just going thinner. Luckily, I can work with that thickness

    For the actual stencil, there were a few choices. You can cut them out of Kapton or out of Mylar. I went looking for Kapton in the common stencil thicknesses of 3 or 5 mil and didn’t find anything that looked good and cheap. So, looking at Mylar led me to Amazon, where I found 4 mil mylar, also in a package of 25.

    What is the mylar thickness?

    IMG_9237

    A quick bit of conversion shows me that the sheet is just over 3.8 mils thick, which is fine.

    Materials in hand, I headed out to my workroom where the glowforge lives to do some cutting.

    Some cutting remarks

    First up was cutting the mylar. The Glowforge has a significant bit of airflow to pull fumes out, and 4 mil mylar would blow right off the crumb tray, so I used ceramic magnets to hold it in place.

    One of the problems with mylar is that when you heat it up it tends to shrink. Since the holes I want to cut are rectangles, the laser head needs to stop at each corner, and at least on the Glowforge, it doesn’t do anything to the beam, so you will get a lot of power right at the corner. Maybe we could break the rectangles into two cuts and carefully manipulate the laser power, but I’m not that confident it would work. If you want to cut it normally, I would recommend trying low speed and very low power.

    Luckily, there’s another option. We can do a raster engrave of the squares and just ablate away all of the material in the middle. This avoids the “stuck in the corner” issue, and since the power level is fairly low and the start and stop is done by turning the laser on and off, there should be fewer issues.

    The right way to do this is to put a piece of paper under the mylar and figuring out what power and speed settings cut through the mylar cleanly but barely touches the paper. I grabbed some settings from the Glowforge Forums and used those.

    For the mylar, we are engraving the red paste mask part of the design and the green circles. The blue board outlines are disabled

    IMG_9228

    This is the first row being engraved. You can see that there is a little sloppiness in the outlines, but in general they are pretty much all the right size. Here’s the final sheet:

    IMG_9229

    The stencils look like what I expected and the 5mm holes look appropriate as well. Maybe this will work after all…

    Next up was cutting the top piece of chipboard with the board outlines. The board outlines are turned on in cut mode, the circles are switched to cut mode, and the paste mask is turned off.

    IMG_9231

    I previously did a proof of concept on this step, so I knew it was going to work. Nice clean cuts.

    And finally, the base cardboard piece. All it has is the circles, so it looks like the above picture with just the circles.

    Assembly

    Sandwich time!

    We start with the base.

    IMG_9239

    And then add in the 5mm pins. This posed a bit of a problem; the pins have a nice chamfer on the end so they didn’t stick into the cardboard very well. I solved this by cutting one of the pins in half with a dremel and an abrasive wheel. I should also note that at 4.96mm, they are just slightly undersized.

    IMG_9240

    So, it turns out that the 5mm holes aren’t quite 5mm in size; they are just a bit smaller so I need to force them in a bit. A friction fit is good, but a forced fit is less good. This is exactly the sort of stuff you learn if you do test cuts. Well, perhaps version #2…

    Adding in the board layer, which aligns quite well with the bottom layer. And the boards fit with just a little bit of movement, which is just about perfect. They are proud (above the surface) by about 0.3mm, which I determined by math. That will probably be okay, but if I want/need it to be closer, I can easily shim it out with some mylar, which at 4 mil is almost exactly 0.1mm thick.

    IMG_9241

    The moment of truth. Adding on the mylar layer. The mylar holes are also too small, perhaps more too small than the cardboard.

    IMG_9242

    What sort of result did we get? It mostly looks pretty good. There is a tiny bit of bowing in the mylar, which I think is due to the “too small holes” part, but it’s probably good enough right now. The alignment is offset a bit but it’s certainly usable:

    image

    Revision #2

    The nice part about building a jig this way is that the materials are cheap and doing another set of cuts doesn’t take much time, so it’s easy to do another revision.

    My first goal was to fix the circles so that they better matched the pins. Since I set them to 5mm explicitly, I figured I’d need to make them a little bit bigger. So, I opened up the design in Inkscape, selected the circles, and what did I find?

    4.95mm

    Huh? I honestly set them to 5mm, but now they are smaller.

    A bit of experimentation revealed what was going on. I am used to working in Visio where the dimensions are inherent properties of the object, so a circle that is 5mm in size is always 5mm in size.

    Inkscape is different. When you way that a circle is 5mm in size, you are setting the outside diameter, and that includes the line width. So, if you set the size of the circle and then change the line width to be thinner, your circle will no longer be 5mm in size. More like 4.95mm.

    Discovering this made me happy, as it meant that the bad fit was from something I understood, not something I did not understand.

    That was a really quick fix, and I cut the new pieces and put the sandwich together. This worked much better; everything went together much easier, and the alignment was better:

    IMG_9245

    Looking closely at the entire stencil, the errors look pretty random. It’s by no means as nice as the commercial stencils I’ve had cut, but it seems serviceable enough.

    I did want to deal with the spacing issue so I could get the board thickness a little closer to the fixture thickness. It turns out that 4 mil is almost exactly 0.1mm, so I cut a spacer as part of the previous revision. Here’s a crappy picture of my first attempt (the stencils are really hard to take pictures of):

    IMG_9246

    That is what happens when you try to cut mylar with high power; the beams stays on at the corners and totally blows it out. I *thought* this would still be usable, but all that melted mylar globs up and is way thicker than 4 mil.

    I cut a second version as part of the revision, using the lowest power that would work.

    IMG_9247

    That is definitely much better, but when I grabbed my micrometer and measured it, it turns out that the mylar melts a bit where it’s cut and the edges are about 0.2mm thick. Since I was hoping for something like 0.3mm total, just using this spacer should be sufficient.

    First pass with solder paste:

    IMG_9248

    And the resulting boards. It was mostly good enough; needed a bit of touch-up for a couple.

    IMG_9249

    LEDs and decoupling capacitor added:

    IMG_9250

    Into the oven:

    IMG_9253

    And all done:

    IMG_9254

    The reflow worked well; 11/12 were fine at the start, and I replace one LED to fix the others.

    IMG_9256

    Round 2

    Round 2 was more of a production run. I changed my technique so that after putting the paste on, I would peel the stencil up and then separate the layers to let the boards fall out the bottom. This worked pretty well. I did 9 rounds plus 4, or 112 boards total, which used up most of my LEDs. Two rounds in the oven, and I had 111 functional boards.

    I really need to build a new test rig; the current one only tests 3 at a time and it’s a pain to load them.

    Summary

    I’m quite pleased with the way that the jib turned out; I pretty much works exactly the way I had hoped, and I can apply paste and populate a set of boards in about 10 minutes.



    Training Wheels Very Very Late Spring Canadian Century

    Because of a conflict, I was unable to ride Flying Wheels this year, but since I have some bigger rides later in the summer – including DORMAR (RAMROD backwards) – I wanted to get in a nice long ride.

    So, I decided to go out and ride a century. But just riding the Flying Wheels route would have been too easy, for a couple of reasons:

    First, I live a little over 5 miles from the starting point, and if I ride there and back that would be an extra 11 miles or so.

    The second reason requires a bit of an explanation… I’ve been leading rides around the Eastside for a number of years now and did my own routes before that. So… I have a particular attitude about routes. Perhaps a Venn diagram would help:

    image

    Rare is the route that I won’t find something to complain about. Some of my complaints are based in fact, but many are based on reasons.

    So, anyway, a little route-tweaking was in order. The big changes I made were:

    1. Starting the route at my house
    2. Ending the route around the south end of Lake Sam to make it a little simpler; otherwise I would ride all the way to the North end just to ride South again.
    3. Getting rid of about 7 miles of farting around in North Bend. I know that they need to find some extra distance someplace and this was an easy way to do it, but I really find that section to be tedious.

    That gave me 99.8 miles, or something like that.

    The ride

    I woke up, skipped breakfast – as I generally do before long rides these days – and got dressed. The weather was in the mid 50s, trending into the low 60s later on. I positively hate that temperature range; it’s just a bit too cold for bare legs for me, but it’s going to be too hot for leg warmers later on. Arm warmers are easy to fit into a jersey pocket; leg warmers are a lot harder. Unsure, I went and stood outside for a few minutes, and decided that if the sun held up, bare legs would be okay.

    Did I mention that the forecast was for partly cloudy? Yeah…

    Before I got dressed I drank down 3 scoops of SuperStarch with a half scoop of Endurox to make it slightly less repulsive. The SuperStarch is based on cornstarch, and a big glass of water with a lot of suspended cornstarch tastes exactly as good as you think it does.

    In my pockets was a ziploc bag of Cheez-its that had seen better days and a single Honey Stinger Chocolate Waffle. I’m experimenting with a bit of carb supplementation recently. I had my arm warmers on and was wearing a stuffable vest.

    I rolled out of the driveway at 8:15 and immediately ran into a problem. Well, two problems. The first was there was a bit of a headwind coming from the North, which would slow me down and make things a bit cooler. The second was that my legs hurt and felt flat.

    After an 8 mile warmup, I came to the base of Inglewood hill, the first on the docket for the day. If you climb Inglewood during Flying Wheels (I have been known to ride up the harder Sahalie drive climb instead), you will know that it is somewhere between a hot mess and complete carnage. I avoid it on my rides because I just don’t like it very much, so this was a rare solo ascent for me.

    On climbs, it’s great if you can find a rabbit. A rabbit is a rider in front of you that you can try to catch. Ideally, the rabbit is just a bit slower than you so that you can make up some time on them during the climb. Early on a weekday morning, there were no rabbits to be found, but halfway up I looked to the side and found that I had a deer who was pacing me just off the side of the road. She’d stop for a moment, I’d get closer, she’d run forward a bit and stop, and the cycle would repeat itself a few times. We eventually came to a road, where she hesitated and I tried to figure out how I could bail because 25’ is way to close, and then she took off into some woods. The rest of the hill was soon dispatched. Not one of my better climbs, but I was at the top.

    The next hill is 236th, climbing from 202 up into the Redmond Ridge/Trilogy developments at the top of Novelty hill. It will surprise you not at all to find out that I think this routing is a mistake. I don’t think it’s necessarily too hard for the century riders, but I do think that it’s too hard for the 47 and 67 mile riders. In the old days, we went east and climbed up Ames Lake; though that does require a left turn that isn’t the safest, I still think it’s a better choice. The century riders could climb up Union Hill Road to get to the same spot as they do currently, or you could just split early and send them up 236th.

    I’m doing okay on the hill, climbing at 230-250 watts, which is my sweet spot these days. I finish the climb, pass the always confusing Union Hill Road intersections, climb some more, and then finally climb a bit more until I reach Novelty Hill road, where the century route turns left.

    Sigh. I will at times take a group down Novelty, but there’s a lot of traffic, there isn’t a great shoulder in places, and there’s a roundabout. All of that to get down to the valley so that you can ride Avondale North for a few miles.

    Ick. I turn right, head east a bit, and turn left on Trilogy Pkwy. This descends, turns west and changes to NE 133rd, and then descends all the way down into the valley. Good pavement, light traffic, and it rejoins the route on Bear Creek Road. I turn right and head north, when the road turns left I follow the ride route and head north, and then when the road ends at Woodinville Duvall road, I do a quick left/right so that I can get on Paradise Lake Rd and head north.

    You may have noticed a theme for this section, that of “heading north”.

    I generally prefer to ride PLR the opposite directly where you lose elevation and feel like you are stronger than you really are, but this direction is mostly okay except for the one 14% hill. Near the end I skip the little loop that would take me to a food stop on the real route, cross 522, and turn right to head North. The parts on the Sammamish Plateau and the Trilogy section were mostly sunny and I was mostly warm, though the descents got a bit chilly. Once I started heading north, it got cloudy and I picked up a headwind, which puts me just on the cold side of chilly. Nothing to do about that but keep riding. A nice section of Fales road takes me more north, and then finally hit the northernmost part of the route, and thankfully turn right to head to the south.

    I have a bit of mental myopia about this section of the route; I think that it’s quick to get from up here down to Fall City, but if you look at the route is around 32 miles. I also think that this section is flat, but only the section south of Carnation is flat; the rest is a seemingly endless succession of rolling hills. That can be fun if you are in a nice group and your legs feel good; not quite so fun when you are by yourself and your legs hurt. Two notable events occur on this portion.

    The first is that I come up and pass a group of 4 riders, ask them how far they are riding, and they say they are doing 90 miles. The second is that as I start to get close to Carnation, I’m on a small downhill and my bike is making a strange sound; the front derailleur is making a rubbing sound.

    That sound is familiar to most of us, buy my current bike never makes that sound, but it has Di2 electronic shifting and the front derailleur auto-trims so that it doesn’t rub. I look down and realize that I am cross-chained; I’m on the small chainwheel up front and the second-to-smallest sprocket on the cassette. This is generally not a good idea as it is less efficient and if you put a lot of force in you can break the chain. Further, it should not happen as I run my system in synchro mode where it will auto-shift the front when necessary.

    I figure it’s a glitch and I manually shift the front. Nothing happens…

    Those of you with Di2 probably know exactly what is going on, but for the rest of you, Di2 is a great system but it does run on batteries. The battery lasts quite a long time, but if you run it down too much, it stops shifting the front derailleur so that a) you will notice that the battery needs to be charged and b) you will be in a mode that preserves the low ratios for riding home.

    This is both annoying and glorious. Annoying because it means I can’t really spin more than 21 or 22 MPH on the gear that it gives me, and I really like to spin on descents to keep my legs warm, especially on a day like today. And glorious because it gives me a wonderful excuse to skip the Snoqualmie Falls climb so that I can get home and recharge it before it stops shifting at all.

    Soon after this happens, I roll into Carnation, hit 53 miles, and stop at a food mart for a bit of a break. I grab a Coke Zero – for the caffeine and the hydration – a snack pack of pepperoni and cheese, and small package of beef jerky. I sit in the sun on the curb and rest my legs.

    Even just sitting here, they hurt. After 10 minutes or so, I’m done with my food and I head south out of town, stopping by the ball field for a quick nature break.

    Then it’s across the valley to the west side and onto the West River Road, so named because it runs on the west side of the Snoqualmie river. This potentially could be a nice section with a nice river view, but in actuality you can’t really see the river at all, but there is lots of farmland and such to look at if you are into that sort of thing. I’d been hoping to make some time on this section, but a combination of a lack of gearing and a headwind slows me down a bit. It’s a relatively short section, and before I know it I’m at an intersection of with highway 202 and the base of the Fall City –> Issaquah climb.

    When I first started riding this was a very hard climb for me; it features something like 450’ total and some short sections in the 14% range. These days, even with 60+ miles in my legs and not feeling great, it’s just not that hard. The country repaved this with some gloriously smooth pavement last year and I had a really nice ascent after that – my last smooth ascent, it turns out, since they decided to put chipseal on top of that gloriously smooth pavement. I’m assuming this costs less in the long run but makes the climb much less nice.

    My ascent is pedestrian in terms of performance though not in terms of method of locomotion, I descend and then start up the “bonus” part of this climb. I’m thinking a bit through this section as I need to make a decision. I have three routes in my head to get home. I can stick on the century route which will take me a bit northwest and then down 236th – a street that was fine 15 years ago but is way too busy for a ride like this anymore (yes, I can’t stop complaining about the route). I can turn left on Fall city Issaquah road and either descend all the way down or take Black Nugget road down for the last part. Or, I can turn left off of fall city issaquah, ride up to the Highlands, and then descend into downtown Issaquah. I opt for the last one, and it’s mostly okay. My legs have been hurting a bit less since I had the snack & cold beverage.

    Now, all that is left is to climb all the way up Newport and then head for home. I’m trying to figure out whether I will hit 80 miles for the ride. I think it will be close.

    This next section is really too boring to talk about, but eventually I make it home pretty near to 82 miles and head inside to have some lunch.

    Overall, a pretty decent ride, delta the leg pain.

    Stats:

    Distance: 81.13 miles
    Time: 5:31:27
    Speed: 14.7 mi/h
    Up: 4437’
    Work: 2997 kJ (read this as “2997 calories”, it’s close enough).

    Food for the day:

    • 3 scoops of SuperStarch + 1/4 scoop of Endurox, 325 calories
    • 42 Cheez-its (+- 7 its), 275 calories
    • 1 Coke Zero flavored brown water with caffeine, 0 calories
    • 1/2 Honey Stinger chocolate waffle, 80 calories
    • Cheeze & pepperoni snack, 150 calories.

    I think that’s 830 calories total for the day.

    Strava link.

    And yes, I’ve made you read the whole thing for an explanation, but the US/Canadian exchange rate is about 0.8, so riding 100 Canadian miles is equal to 80 American miles. Hence “Canadian Century”.