2010 November

November 2010


In my previous post I described the design process I went through in selecting the right components from my Rallylog that would fit into the Sparkfun Project Case, all while mounted on a PCB.  What follows is the process of getting the actual case machined with my Zenbot CNC machine.

How am I going to machine this thing?

I didn’t tackle any machining until after my PCB design stabilised (three revisions) but the day did come when I had to work out how I was going to automate the machining of the project case.  As I previously mentioned in my last post that I was going to use my ZenBot Mini CNC to do the work, I just need to figure out how it was going to do it. 

To tell the truth I have hardly used my CNC other than for prototype PCB isolation routing.  I had never used if for cut-outs or any 3D machining.  One thing I needed was a way to produce my tool paths or G-Code that Mach3 uses, Mach3 is the controlling software I use with my Zenbot.  It takes the G-Code and handles all the X,Y,Z movements. I could hand code G-Code but, hey, I’m not that good!!!  So I needed some CAM software  Alibre does have a CAM option, but I had a heart attack when I received the price, so after much googling I found Cambam,

The Fixture

As I mentioned I needed a way of holding the Sparkfun project case in a repeatable way as I need to machine 10 of these, also I was going to be doing the machining from the inside of the case, this way I could pocket around the LCD at the same time as I did my cut-outs and light pipe holes, all in one hit.  So some sort of fixture was called for…..

I decided to mill out the profile of the top spark fun case to create a fixture where I can just drop in any case top lock it in and then press the ‘go’ on Mach3.  To do this I imported the Sparkfun 3D STL Model that I used in Alibre, again I had some issues of the “standards” and used a open source program called Meshlab to first import in the STL model with the clean-up enabled then to save it as a new STL.  This work and I now had the Sparkfun project case in the CAM software

image

Some of the traps I found is that the model needs to be aligned with the Z-Axis 0, this is how the Cambam sees the top of the work piece.

Cambam has a handy function for exactly what I want to do, this “Mold” function, allows a mold to be created from the 3D object, and by varying the Clip Areas I can control how deep I want my mold, in this case just 3MM so I can get the Case top to sit nicely in the fixture.

My Zenbot can only take a max shank size of 1/8 as I had initially replaced the Dremal for a Wolfgang Engineering Spindle for my PCB routing, for those interested these spindles Rock!!! the spinout is incredibly tight.

Creating Tool paths

I first created 2 tool-paths in Cambam, one to rough out and remove most of the material quickly with a 3.175mm end mill (1/8)  and a second tool-path to finish with a ball mill to do the edge profiles.  Cambam generates the crossovers and the plunge rates based on the tool size.

image

image

image

Setting Machine Origin

Another feature of Cambam is I can set the machine origin, this is the origin of all the Axis (X,Y,Z) in relation to the work piece, now I have the way to repeatedly setup my work pieces by referencing everything back to this origin mark (red X below).  If I marked this on my fixture all I have to do is zero my Zenbot to this origin before I run the job and everything will be referenced correctly.   In this case it’s 5mm below the work piece corner.

image

Machining the Fixture

 

I had some scrap plastic board that came with some flat packed furniture that was to become my fixture.  Below you can see the rough tooling has finished and it running the finishing tool-path.  you can see where I marked my origin in the bottom right of the work piece.  I use this to Zero Mach3.Sparkfun fixture

Zenbot Maching Sparkfun Project Case Fixture

 

Perfect fit, no slop or play, I did re-jig my tool paths to go down another 1mm in depth so the inside of the case is aligned with my Z-Axis Zero (or the top of the fixture) that makes things easier when I go to do my cut-outs and pocketing.

Test fit

Machining the Project Case

Now that I had my fixture for the actual case I needed to work out my cut-outs, drills and pocketing, using the same project file in Cambam that I used for the above fixture machining, I created addition layers for my cut-outs.  This was good as I could see where everything was located in relation to the 3D model, I used measurements from my Alibre model to place the Circles and rectangles that were to become my machining profiles. 

The only gotcha is that you have to think in reverse as I’m machining from the inside.  Below are the cut-outs and drill points for the light pipes

 

image

This is with the pocketing areas added.  I decided to add the pocketing around the buttons as well just in case. 

image

With the machining tool-paths added, Cambam also has the ability to add tabs in the cut-outs so the work wont foul you bit.  I decided to try this.

image

The Results

I’m very happy with the way everything has worked out.  By putting in the extra work in the design stage it seems to have paid off, the Sparkfun Project Case fitted my assembled PCB like a glove, everything aligned up perfectly.

Here is the final result with cut-outs finished, light-pipes installed and the pocketing for the LCD and switches, the actual pocketing for the switches was not needed so the 3D model was fairly accurate.  I didn’t photograph any of the cutting in actions so will post a few more when I finish the rest off.

Result cutout and pocketing

I used the same procedure to machine out the end piece from my USB and SD card, that is: mill a mould fixture with a known offset and then generate tool paths within cambam for the cut-outs.

Case and Assembled PCB

Project case end

This is showing my REV B PCB in the case, this had the range issue and the separation of the ground plane below the ID-20 reader corrected the issue.

Snug home

Front with LCD installed

Side profil

Side profile

Light pipes and LCD working, showing a card read under my test program.

Led working

For the open Hardware Rallylog device I’ve been working on, I’d based my design around fitting into the handy Sparkfun Project Case and since most of my projects never get to the “enclosure” stage, they are either used bare PCB or thrown into anything that may provide some protection against the elements, such as the widget sensor housing.
(http://blog.strobotics.com.au/2009/06/15/widget-sensor-housings/). 

This project was different for me since I’m required to build 10 of them for the local motorbike club, something a bit more “finished” than your standard geek project.  Throughout this project I’ve learnt how to use 3D modelling to check mechanical layout and tolerances, also to use mechanical data supplied in technical data sheets in selecting my components.  This along with taking into account PCB heights, button heights.  Overcoming challenges like how do I get my LEDs to the outside without using panel mount LEDS, or how do I protect or mount my LCD display again with out using a panel mount.  I then used all this to make things easier for me when it came to production to produce CNC tool path G-Code to cut my enclosures.

I thought I’d document the process that I’ve gone through to get my Rallylog nice and snug in the Sparkfun Project Case.  BTW this may not be the right way, but it’s the journey I took, I would love to hear from people who do this professionally for a living to get a feel of the full product design process.

It has to be easy to make and assemble

Right from the outset of the project I wanted this to be easy to assemble.  Seeing I have to make 10 of them (to start with) I wanted everything to be mounted on the PCB so all I have to do is get my enclosure and put in the finished PCB, screw it all up and its working, i.e. I didn’t want to have a panel mounted LCD or LEDS that I had 1) manually fix to the Enclosure, and then 2) “wire” back to the PCB.  I wanted something that I can reproduce easily and with the least amount of human work, I love my projects, but quickly hate having to manually do a lot of repetitive work like solder up individual LEDS etc. (I guess I ‘m lazy).  I also have a small CNC machine at home, A Zenbot Mini that I purchased off eBay some time ago, so I wanted to automate the panel cut outs as much as possible.  I wanted this to be repeatable, using a handheld Dremal is not my idea of fun, especially if I have 10 to do now I will quickly loose interest after the first one, and it’s definitely not repeatable. Also if I get an order for another 1, 10, 100 down the track I definitely don’t want to do it manually, and I don’t want to think too hard about getting things set up.

I could have also gone with an Arduino board and made up a custom shield or use the RFID shield, again it would have meant more painful hand assembly, so I decided to stick with a custom board fitted into a readymade enclosure.

It all starts with the User Interface

Whilst I already had my initial schematic laid out (in Kicad), before I started my PCB layout process I needed to work out what it was going to live in.  I was very eager to start laying down track as I love designing PCBs, but I had to hold myself back and ask a couple of questions first:

  1. What am I going to put it in?  It needs to be functional, fairly robust, and fit everything in, including the battery, the RFID module, the LCD, SD Card socket and so on.  It needs to be off the shelf that I can easily modify, no custom injection moulded case for this project ( I wish)
  2. What is the user interface going to look like?  I needed to keep to the KISS principle.  The majority of users at this motorcycle club are semi-retirement to retirement age, so not the most savvy when it comes to geek gadgets,
  3. Will it be easy to assemble?

When you stop and think about it, it makes sense to start with the user interface and how this will fit into an enclosure, then move onto the physical PCB layout and component selections, else my PCB might not fit into the case, it may be too big, too small, same goes for components selected. The user interface may not be functional and then we’d have to start again.

The User Interface design

My initial schematics included a Nokia LCD display and a joystick for user input.  Also a couple of LEDS for visual feedback.  

When I asked myself the three questions above I quickly went back to the drawing board, as the Nokia display failed Question 3), same went for the Joystick, also I felt that it was would have been a bit too had for the target audience to use, so it failed Question 2) as well. 

In the end I decided to go back to a tried and proven UI design that consisted of a simple and easy to read backlight 2×16 LCD character display with three push buttons for user input and two LED indicators, something a bit easier for the end user to use.

As yet I had not selected the parts i.e. the  LCD or switches, I just had the layout in my mind (or on paper) the UI layout that was a three button input under a standard 2×16 backlit character LCD, and x2 LEDS to the left of the LCD display, these LEDS would be Red and Green, which could be used to indicate different statuses easily, really simple!

UI sketch

The Enclosure

Once I had the basis of the interface this is where the engineering juggling started, I had to find an enclosure that would meet my requirement, and find components at the right price that would work with the selected enclosure in the way I wanted.

I had a look around on a number of sites and found there is a wide variety of enclosures out there, however without physically having one, its a bit hard to start working out measurements and getting a general feel for it in your hand.  As luck would have it I already had a couple of Sparkfun Project cases at home that I had purchased for a “future” project, well this was that “future” project, I used this initially as my enclosure of choice, it seemed to fit well in the hand and be spacious enough to seemingly fit everything in, i did this initial check by putting in the ID-20 RFID reader module and a 9V battery to see how things would fit.  At this point I still did not have an LCD or buttons selected.

Once I had my enclosure selected it is now a matter of finding the right size components to fit, as mentioned above I wanted everything mounted on my PCB, and now I had the dimensions of the enclosure I could start my PCB design and component selection, this process I found to be the most time consuming.  However I initially needed to start working out my clearances with my PCB in the enclosure, I’m also a visual person, I need to see things to make it easier for me to understand, so I decided it would be much easier to utilise 3D modelling and model the enclosure and mock up my UI, I’ve used Alibre in the past and this is what I modelled the Rallylog enclosure in. 

The 3D Model

Not wanting to re-invent the wheel I contacted Sparkfun customer support with a request for a 3D model of the Project enclosure and received an email from Casey Haskill, the designer of the enclosure, he was more than accommodating (Many Thanks Casey!!!)  and sent me the files in IGES format, one that Alibre supported……supposedly.

The great things with standards is that everyone has their own take on them, obviously Alibre was no exception, the problem was that each time I went to import it failed, after a bit of research I found a small utility program that I used in a two step process that allowed me to clean up the IGES and export it as an STP file, one that worked with Alibre.

image

Once imported I can now can get accurate measurements and start modelling individual components.  My modelling is very simple, make a basic 3D model using the supplied mechanical data, no fancy surface or trying to emulate the real thing. 

One of the immediate things I could see is that either I had to use a panel mounted PCB or I needed a two tiered PCB design as the headroom above the PCB was quite large.  The panel mounted LCD was ruled out due to easy of assembly rule, so I knew that I would be dealing with a two layered PCB design.

Alibre is great for quickly creating 3D objects and by changing dimensions it regenerates the 3Dmodel, so I quickly created a two tiered mock up of a PCB with the correct thicknesses of the PCB substrate being used, this was added to the enclosure assemble so I could visualise the internal dimensions.  The two PCB layers are separated by the dimensions of a standard 0.100 header and socket of 8.5mm.

image

 

image

From this I now had the dimensions required from the top of my PCB to the inside and outside of my case.

Now I needed to know what LCDs, buttons and LEDs out there that when mounted on the PCB  how they would interact mechanically as far as clearances with the enclosure, however I had to work into the constrains of my circuit design and of course price. 

Due to I/O restraints I couldn’t use the standard character LCD in 8 bit or even 4 bit mode, so that ruled out most of the cheapest LCD displays around.  So it had to be I2C, SPI or Serial,  my initial design was done with the Nokia LCD in mind and so used SPI, as I wanted it to mount onto my PCB, almost all LCD I’ve found have their own PCB with a connector that either plugs into a cable or you plug it into a socket onto the PCB, so another layer on top of the existing PCB was not feasible.  I located the I2C range of New Haven Displays and found one that would fit given the dimensions, however I couldn’t get them locally and ordering in from New Haven was approx. $USD50 per display, not economical!  Unfortunately there were not many alternatives. 

After talking with my local local supplier he put me onto the EA-DOGM Series of LCD Character displays, these can be run in SPI Mode or traditional 4 or 8 bit mode, there are also directly mounted on the PCB, and have an optional LCD backlight module that mounts under the LCD module. The price was even better, $AUD15 for 2×16 and $AUD4 for backlight, perfect pricing just need to check how they would fit.  From the Technical data sheet I whipped up a simple model and added it to the PCB

image

image

image

image

From this I could see that the LCD would fit if PCB mounted, but had an interference with the top of the Sparkfun case, this was acceptable as I would need to machine the cut-outs at some point.

I then did the same for switches and their buttons, I wanted the button to just clear the case and not be too pronounced or the reverse I didn’t want it to be recessed.  In the example below using 6mm Omron switches and their associated square buttons.  I found they were too pronounced out of the case.

image

I ended up finding the 12mm Sparkfun Push Button which met the right criteria and the button just cleared the case, after modelling it looked perfect, however the switch body itself has some interference with the top of the case, this meant that if I wanted to have a switch with the right height I would have to machine out the inside of the case.  

image

Engineering decision time….After weighing up the aesthetics and the work involved in machining out the case I decided to stick with machining out the inside as I would already have the top case mounted for cut outs, what if I just flip it around and machine from the inside, that way I could kill two birds with one stone.  I could pocket out around the switches ( and the LCD if required) and then perform the panel cut out.  I didn’t know how I was going to perform this but seemed doable. 

Just to make sure where my interferences I used a great feature of Alibre called “Assembly Boolean” where I can select the top of the project box as my blank, and then select all the buttons and the LCD as my tools, the Result is the top of the Project box with all interferences subtracted so I can I know where to machine.

image

Just to cover my bets I added both switches to my design, that way I could use either if the other didn’t work, much easier to add the extra footprint at design time that to find out after that I really should have used the other switch, so I had an escape clause Winking smile

image

The LEDS

What about The next thing I needed to worry about was what to do with the LEDS.  Where possible I now use SMD components rather that PTH, but using the PTH over SMD was going to be my only choice, however they would be standing quite tall off the board, and as the end user would have to remove the back of the case to eventually change batteries, I didn’t want them to be able to damage the LEDs if incorrectly re-assembled for any reason. 

I started looking around for solutions, not being in the industry I wondered how they did it, looking at every day consumer electronics I saw that pretty well every LED indicator is displayed through a plastic window, that’s what I needed, but what are they, after much Googling I found the correct term of “Light Pipe”, this made things easy.  I could stick with my 0603 SMD LEDS and have a standard 3mm vertical light pipe (they come in many different flavours) bought directly to the top of the SMD LED.

image

 

The Final PCB

Happy with the components selected I then proceeded to finished my PCB design, again to make things easy to assemble I designed the two layers as a single board separated by tabbed routes and tooling strips so the individual boards can be separated after assembly.  I also moved my LEDS over to the right hand side to accommodate for the PCB connectors finished result. 

To see the full assembly steps see my previous blog entry http://blog.strobotics.com.au/2010/07/21/rallylog-assembly-progress/

rallylog pcb

 

Next…How I machined my enclosure cut-outs

Switch to our mobile site