Putting the Project into an Enclosure; Part 2 Machining the Case

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

How am I going to machine this thing?

I didn’t tackle any 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 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 software Alibre does have a 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


Some of the traps I found is that the model needs to be aligned with the Z-Axis 0, this is how the 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.


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.


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


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


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.


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 PCBProject 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 homeFront with LCD installedSide profilSide profile


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

Led working

6 thoughts on “Putting the Project into an Enclosure; Part 2 Machining the Case

  1. It is very rewarding when all the R&D, CAD, hardware, and software comes together, isn’t it. Even more so when you are the only one doing it all. 🙂

This site uses Akismet to reduce spam. Learn how your comment data is processed.