Injection molding

This isn’t a very technical post, but it was fun to make and I think resulted in some neat looking renders of the printer.  When we sent the injection mold design files off to the mold maker a few weeks ago, they needed some reference images on how the parts fit together.  This allows them to determine where to place sprues, finished surfaces, etc.

These were done in Blender with the Cycles render engine using CUDA.  There is some pixelation because I stopped it around 500 cycles since it was for reference only.  It has an internal light emitter which would need at least several thousands cycles to have a smooth image.

SmartOS networking and install issues

I figured we’d take a break from printers for a few minutes and talk about SmartOS – the open source operating system spearheaded by Joyent as a cloud OS.  I’m a big fan of SmartOS.  In particular, I love ZFS – it’s a fantastic filesystem.  That said, I had a number of issues recently while setting up a new install on some Dell servers.

First, SmartOS does not take any space on the main ZFS pool – it runs entirely from a PXE boot environment, USB drive, or CD.  While a PXE environment would certainly be ideal, in a small scale colocation environment, USB is much easier.  I picked 8GB Sandisk Cruzer Fit drives.  They are very small, with almost no protrusion from the case, and offer plenty of room for updating SmartOS when needed.

The install itself is almost non-existent – you setup a global drive pool and networking information for the administrative interface.  From there, you can add KVM or Joyent (SmartOS) zones.

My issues came into play after shipping to the colocation provider.  They limit the port speed to 10 Mbps and had it set as “10/full” on the switch.  Generally, forcing the duplex on a network interface isn’t a good idea, but can easily be remedied in Linux or Windows.  However, I ran into some caveats on SmartOS.

The Dell R420 and R210 II servers I’m using utilize Broadcom NICs.  Unfortunately, because they are closed source, Broadcom drivers on SmartOS seem to have some quirks.  I found I had to force the duplex and port speed two different ways for the “bge” and “bnx” drivers.  For the “bnx” driver:

# ndd -set /dev/bnx0 adv_1000fdx_cap 0
# ndd -set /dev/bnx0 adv_1000hdx_cap 0
# ndd -set /dev/bnx0 adv_100fdx_cap 0
# ndd -set /dev/bnx0 adv_100hdx_cap 0
# ndd -set /dev/bnx0 adv_10fdx_cap 1
# ndd -set /dev/bnx0 adv_10hdx_cap 0
# ndd -set /dev/bnx0 adv_autoneg_cap 0

For the “bge” driver:

# dladm set-linkprop -p en_1000fdx_cap=0 bge0
# dladm set-linkprop -p en_1000fdx_cap=0 bge0
# dladm set-linkprop -p en_100fdx_cap=0 bge0
# dladm set-linkprop -p en_100fdx_cap=0 bge0
# dladm set-linkprop -p en_10fdx_cap=1 bge0
# dladm set-linkprop -p en_10fdx_cap=0 bge0
# dladm set-linkprop -p adv_autoneg_cap=0 bge0

That successfully brought up the admin interfaces.  To save on space, these two servers have their secondary NIC directly connected.  The interface showed as “up” at “1000/full” but no traffic was passing.  I found I had to force the interface to 1000 Mbps full-duplex on both ends and disable auto-negotiation.

You can make these changes persistent by adding a custom SMF as outlined on the SmartOS Wiki.

Overall, I love SmartOS.  However, the documentation seems to be extremely lacking and the support community is currently relatively small due to it’s relative young age.  Remember, most docs from Solaris 10, 11, and similar projects such as OpenIndiana will at least give you a starting point with any problems you might have.

Small-scale surface mount reflow

While building the mPrinter, we’ve assembled a lot of prototypes.  While it’s certainly possible to solder 0402 and 0603 surface mount components by hand, it’s not a lot of fun.  If you don’t want to hand solder, there are two main ways to do small-scale reflow: an oven or a hot air rework station.  We went with a small oven, and this post goes over a bit of the experiences we had.

Picking an oven

In concept, reflowing is simple – you want a controlled temperature profile over a set period of time.  Manufacturers of solder paste and components generally have information on this profile in their datasheets.  There are two basic ways to go: a commercial oven, or building your own.  A lot of people swear by building their own, but with the price of small desktop ovens available from overseas I found it hard to justify fiddling with building one.  The oven we ended up using is the venerable T-962, made in China and available from various eBay suppliers.

I’ve read a lot of mixed reviews on this oven.  In short, my experience was great.  Every single board I’ve done has come out perfect.  The only issues have been caused by variations in paste approval, and are generally limited to solder bridges on fine-pitch components.

Circuit boards

I use a mix of making my own boards and ordering them for prototyping.  I have the luxury of having a CNC mill, so it’s trivial to drill and etch accurate double-sided boards at home.  The largest inhibiting factor is vias.  There is no easy and fast way to quickly make a large number of vias at home without a plating process.

When you have the time, there are a number of great services to get boards made.  I generally use one of two: OSHPark for small-batch quality boards in about two weeks, and Advanced Circuits BareBones service for next-day service.  This article features boards from the later.

A circuit board from Advanced Circuits BareBones service.

In exchange for quick turnaround from Advanced Circuits, the boards have no solder mask and no silkscreen.  I was happy to find this didn’t cause any reflow issues at all.  The boards are high quality and as noted on their website, shipped the next day.  I had them within 72 hours of ordering.

Solder paste application

The first step of the process involved applying solder paste to the circuit board.  You can use stencils, or just do it by hand.  Just by nature of the board layout and surface tension, paste application is very forgiving.  As long as you generally get the paste amounts right, parts will suck themselves into place and be perfectly aligned during reflow.

The most useful tools in this process, as with hand soldering board components, are: a Panavise , tweezers, and a microscope or loupe.  The Panavise is a small desktop vise that securely holds your circuit board while you work on it.

A Panavise securely holds your board while you work on it.

When you order your solder paste, you’ll probably be surprised to find it’s just a tube of paste.  There is no tip or even a plunger to remove the paste.  Generally, the smaller tubes are 10cc and the larger ones 30cc.  I order my syringes and tips from CML Supply.  I find the 22 gauge tapered plastic tips to be perfect for most applications.

Application of the paste is pretty straight forward.  For passive components with two pads, a small dot on each side is adequate.  For multi-pin parts such as ICs and connectors, you can simply apply a ribbon of paste down the row of pads.  If you get any bridges, they’re easy to clean up later.  Using tweezers, simply place each part on top of the applied paste in the appropriate locations.

A circuit board with solder paste and all components applied ready to go into the reflow oven.

Reflowing the board

The reflow process is pretty straight forward.  You simply board the board in the oven, start it, and come back about 10 minutes later to a completed board.  I use profile 3 on the T-962, which I’ve found to work best for my particular application.  One annoying caveat of the T-962 is the timer.  It can be off by nearly as much as several minutes.  Fortunately, it doesn’t seem to serve any real purpose other than user feedback.

Cleaning up mistakes and through hole parts

After reflow is complete, it’s not abnormal to have a few solder bridges.  Here, solder wick is your best friend.  Make sure to get a good quality one, and make sure it’s fresh and not oxidized or it will be very hard to work with.  I like a small braid which heats up quick and works well with fine pitch parts.

Make sure to use a chisel tip on your iron, or you run the risk of overheating the area prior to the point at which the wicking occurs.  I turn my iron up slightly for this, setting it around 380-400° C.  The photo below shows a before and after of a solder bridge on a TQFP32 IC.

Finished board

While it does take a little bit of preparation, once you have the process in place I find reflowing even a single board quicker than hand soldering.  It really shines in batches of 3-4 boards that are identical.

Below you can see a finished mPrinter revision 3 PCB, with all the through hole parts mounted.  There are some additional headers that have been soldered on that will simply be test points on production boards, but in general it will be identical to this board.

Circuit board assembly

The first revision of the circuit boards have arrived.  With a few minor exceptions, there were no design mistakes made and the boards work well.  This is the first time all the parts have been together on one board, and not disparate parts on breadboards and smaller boards linked together.

The required changes are minimal, and the board is up and running fine without them.  Mistakes include:

  • Why, oh why did I design the board with 0402 parts?  There is plenty of room.  The next revision will be at least 0603.  Hand soldering 0402 isn’t that hard, but it adds extra time.
  • The pins for the wire-to-board headers for the LEDs and button are too small.  They had to be drilled out, destroying the vias.
  • I picked an obscure diode footprint.  Changing the footprint results in much cheaper reverse current protection diode options.
  • Ditto for the crystal footprints.
  • There was an interrupt signal wire to the WiFi radio on a wrong pin.  It’s the larger of the “blue-wire” fixes you see.

All in all, the assembly went well and everything is working.  Programmers have “Hello, world!”, MCUs have a blinking LED, and network programming has a ping test.  Seeing this ping on our custom production board was nice:

$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=100 time=7.592 ms
64 bytes from icmp_seq=1 ttl=100 time=7.432 ms
64 bytes from icmp_seq=2 ttl=100 time=7.730 ms

A new reflow oven gets here next week, so we’ll have some more (and prettier) prototype boards assembled then.  In the meantime, the focus is on finishing up the first revision of the firmware.

Some notes on debugging

I use very few key debugging tools:

  1. An oscilloscope.  Largely replaced in digital circuits with a logic analyzer, but invaluable for checking logic level mismatches, noise levels, etc.
  2. A USB logic analyzer.  I use a Saleae, which is one of my favorite tools to debug with.
  3. A good multimeter.
  4. An MCU programmer with an in-circuit debugger.
In the photo below, all of the white wire ares the SPI control signals into the WiFi radio.  There are hooked up to a logic analyzer for debugging.

In the screenshot below, you can see the logic analyzer at work.  The Saleae Logic is nice because it includes build in analyzers.  You can see an SPI analyzer on the clock, SDO, and SDI lines, and a serial analyzer on the debug port of the radio module.

Rendering PCB designs in Eagle and SketchUp

A few years ago, I saw a neat program that exports PCB designs from Eagle and lets you use POV-Ray to render them.  It was a great idea, but making the models for each component was a fair amount of work.

This week I stumbled on eagleUp, a ULP for Eagle that exports PNGs of the appropriate layers, and then has a corresponding SketchUp plugin that places the images and component models in the appropriate locations.  Being a long-time user of SketchUp, making new parts was a breeze (they are scaled up 1000 times to allow for more detail).

I (and many others) find the default SketchUp rendering engine to be severely lacking.  The samples in this post were made using the third-party Maxwell renderer.

This board already has had some updates made to it, but this revision is similar to what will be the production model.  There is a PIC24F, an ARM Cortex-M0, an 8 Mbit EEPROM, the WiFi module (green and silver colored), a buzzer, and other miscellaneous smaller components. The brown ZIF connector goes to the print head.

CNC fun

I’ve had a small CNC machine for a while, but never used it much.  One of the things I’ve come to really rely on it for is prototyping circuit boards.

It’s extremely convenient and easy to export drill files from Eagle, drill through holes on the CNC, then etch as normal.

Today I was working on changing the shape of the primary circuit board.  You can see in one of the photos below, I cut out the shape and left several tabs around the perimeter.  In this case, I used a piece of scrap because this was just a physical fit test and it wouldn’t be etched.  The other photo shows drilling some holes with PCB drills (around .01 inches in this case I believe).

Rapid prototyping

Things are progressing very quickly around here.  On Thursday, we got the first rapid prototype of our case design.

The first step in the design process is developing and testing the model in a CAD application.  Our designer uses SolidWorks.  An early design revision is shown below.

The next step was getting the actual print made.  We chose to use SLA due to cost, material characteristics, and resolution.  We sent the models off to the rapid prototyping company, and we just got the printed model Thursday.  We used InterPRO, a company based in Connecticut.  They were very responsive and provided a quick turnaround at competitive rates.

While you can choose various finishing options, we chose a basic satin media blast.  The parts still have their “step lines” from the printing process.

Finishing the parts to see what the final model would look like involved a lot of sanding, priming, and painting.

The light ring was wet-sanded to 2000-grit, then sprayed with a gloss polyurethane.  The other parts were sanded to 800-grit, then sprayed with black paint and matte lacquer.

We’re still playing with the light ring a little bit to improve light transmission.  We have 4 LEDs in there now, with room for up to 8.

It’s very exciting to see the 3D model in a physical form.  We have some minor model revisions that need to be made, and we’ll be test-fitting the rest of the electrical and mechanical components this week.  After the changes are made, we’ll order the parts that require updates again – then have the steel injection molds made for mass production.