Integration challenge: CNC mill

While I probably should be working on the organization project (see previous posts), I have recently been distracted by a new endeavor: a CNC mill.  Before I get into the details, however, I should lay out the back-story.

If you haven’t noticed yet, this blog covers software development, electronics, and woodworking.  I find the two to be quite similar in practice; large, complex things are made up of smaller, more basic things.  In woodworking, standardized dimensions of wood are cut and shaped and added to other pieces of standardized dimensions of wood that have been cut and shaped until a new object of a certain purpose appears.  In electronics, standardized components are mixed and matched and wired together in a fashion until it creates an object which completes a certain purpose.  In software development, standardized methods within a computing language are strung together in a pattern that creates a program, which in turn fulfills a certain purpose.  In all of these cases, small bits of pre-determined structure are fit together to create a bigger, more meaningful result.

Growing up, my dad taught me that everything has parts.  Everything is made up of dissimilar pieces that otherwise have nothing to do with each other, but when organized in a certain way, it completes a sum.  All a person needs to do to design that sum is to figure out the basic parts and put them together in the right way.  So began my love of woodworking and my career in IT.

So here I am; a person who sees every object as a sum of parts.  In my professional life, I see programs as individual commands.  In my wood shop, I see tables as individual boards.  At my electronics bench, I see electronic products as a pattern of components.  These builds are not silos, however.  Instead, those who create can continue to build up by integrating elements that are even more dissimilar than the parts that came before.  While there is no limit to the complexity of a woodworking project or the complexity of a computer program, there is a point at which people stop building because the arena of one field only solves so many issues.  Integration, however, expands our horizon.

This became my new challenge: integrate my areas of creation.  Begin a project that includes woodworking, software development, and electronics design.  When I considered the physical nature of woodworking and the virtual world of software, one shining option appeared: a CNC mill.  A CNC mill, to put it frankly, is a tool that carves out material to the shape designed in a computer.  A user can create a 3D model in a computer program and then connect the computer to this powertool, press a button, and walk away as the computer tells the mill how to carve out the model in a physical space.  To do this, the software analyzes the conceptual computer model and forms a string of movements that the carving tool (usually a small router) will follow in all three dimensions.  This string of movements is known as g-code.  This is a standardized syntax that allows all CNC mills to understand movements described by all computer modeling applications that are designed for CNC milling.

And there it is: my new challenge.  Using 3D modeling software to control electronics to carve out physical parts, I will have integrated all three of my building arenas.  Details to come.


One too many things to consider

Having decided to reorganize my workshop, I drew up some plans for cabinets that would run across the back of garage.  This would provide solutions to two issues: first, it gives me more storage space and secondly, it provides a work surface (a.k.a. a work bench).  I figured this would be a great time to design a workbench and storage solution that would not only give me a great work place, but also integrate my tools in such a way that I don’t just have tools on my workbench, but rather integrated for least impact when not in use.  I got cracking in Visio and designed what I felt to be the best option for my new workbench and cabinets.

Back Wall diagram

From left to right, I added two 36″ wide base cabinets at 36″ high.  These are followed by a shorter cabinet.  This one is 17″ wide.  It sits 3.75″ shorter than the standard 36″ tall cabinet because this one holds the compound miter saw.  The deck of the saw is 3.75″ high, which taking the shortened hight of the cabinet into account sets the deck of the saw flush with the rest of the counter.  This is followed by a third standard 36″ cabinet. 

After the first four cabinets, there is a gap.  The width of this gap is the width of my table saw deck.  I’ve also built a new rolling stand for my table saw that places the table surface of the saw at 36″.  When the saw is rolled into the gap, the saw deck, again, sits flush with the counter.  Another 36″ wide base cabinet sits to the right.  One 18″ wide cabinet will be created  to sit in the far right corner.  If my math is correct, there will be a gap between these last two that are wide enough for my garbage can to tuck between the cabinets and under the counter.

The counter top material is 3/4″ MDF sitting on 3/4″ pine strips that run the depth of the cabinets.  The face of the MDF is a 2×4 cut down to a final dimension of 1.5″ deep by 2″ high and attached by biscuts.  I haven’t yet decided if I’ll route a round-over across the top edge or if I’ll keep it square.

The first four cabinets are complete and in place.  I was excited to move the tablesaw in place.  I then picked up my compound miter saw and dropped it onto the short cabinet.  Yes, the deck of the saw perfectly matches the height of the MDF countertop, but I didn’t take the required depth of the saw into account.  The saw has a good deal of structure behind the cutting deck’s fence, which pushes the saw out from the way a great deal.  Furthermore, the saw is a sliding model, which requries 9 more inches to get the blade all the way back.  Now looking at the setup, the saw would have to hang off the front of the counter in order to get the blade all of the way back.  In doing so, the deck no longer is supported by the countertop on either side.

How disheartening.  At least it looked good on paper.  It would have been a great setup if it had worked, but I can’t keep it this way.  The compound miter saw is completely unuseable in this space.  I expect that I’ll end up doing another pull out solution like I did with my table saw. 

My wife suggested that the roll-out stand that I build for the compound miter saw should have a pair of fold-out arms to support wide pieces while cutting (to make up for the fact that I can’t use the counters anymore.  She is so smart.  I knew there was a reason I love her.

Sometimes it isn’t worth going overboard when trying to get every last piece to integrate perfectly.  Some things have too many variables.  As a woodworker, I hate to admit that third dimension is too many for me to handle, but in this case that is where I went wrong.  I’ll chalk it up to learning.

Introduction to Rotary Encoders

The other day, I was at Ax-Man, the local surplus store.  I ran across a bin of rotary encoders and thought, “I need to play around with some of these.”  I picked up two of them at about a dollar a piece and brought them home.

Rotary encoders look a bit like rotary pots, except they don’t have starting and stopping points.  Instead, a rotary encoder will continue to turn indefinately.  Also, instead of producing a varying resistance like a pot does, the encoder produces gray code.  The units I got produce 4-bit gray code, meaning that it has five pins: 1 common pin and four signals producing binary patterns.  Each time the knob is turned one click in either direction, the pattern of binary changes.  By comparing the before and after pattern, a circuit can determine if the user turned the knob to the left or right and by how many clicks.

With the house to myself last night, I opened up my box of electronics testing tools and got to work.  I developed the circuit below:

Rotary Encoder Test Setup

With this circuit, I have an arduino powering the common pin on the encoder via the 5V line.  Two signal pins are used similarly to the way buttons are used with a microcontroller (the signals are either on or off; there is no analog value).  Pull down resistors are used on the signal lines.  This allows the Arduino to read either high or low values on digital pins 2 and 3.  This produces one of four possible combinations: 00, 01, 10, 11.

To note: rotary encoders come in several bit resolutions.  As I said, mine are 4 bit, which are probably overkill. I’m only using the first two signal pins, which basically causes my encoder to act like a 2-bit encoder by dropping the last two bits.

By comparing the current bit pattern to the previous, the arduino determines if a clockwise or counterclockwise click has been made.  In my example code, a clockwise turn increases a pwm voltage on pin 9, which is read by my multimeter.   Similarly, the counter clockwise turn decreases the voltage.  The program also displays the octal value of the voltage supplied by pin 9 via the serial output.

Download the code here.

Video overview: (

Moving Parts

Last summer, my lovely wife Jennifer and I remodeled our kitchen.  This included tearing out the floor and adding more insulation to the crawl space below.  Obviously, without a floor, EVERYTHING that was in the kitchen needed to be removed: appliances, cabinets, furnishings, the whole nine yards.  Anything we didn’t need immediately went into the garage.  This included the old upper wall cabinets, which I decided to keep for my shop as we replaced all of the kitchen cabinets with new ones.

Eventually the kitchen project came to what I consider a finish.  My wife disagrees, pointing out a few places that need some touch-up.  Meanwhile, my garage is now full of junk; so much so that most of last summer, our cars were parked in the drivewway because there was no room for them in the garage.  As winter rolled in, we needed to get the cars in the garage, which meant something had to go.  The easiest solution was to tear down my workbench and use the space it took up for storage of the things that took up all the room in our parking spaces.

Not having a workbench is not only a foriegn concept to me, but also creates a new problem: where do I put all the things that used to be on my workbench?  Every other surface is already covered with junk from the kitchen, so where do I put things like my bench sander, drill press, and compound miter saw?  I’m ashamed to say that these have been tucked away in dank, dark corners of my garage that I haven’t seen now in months.

During the winter, my wife and I made a list of all the things that we need to fix in the house in order to get it into a sellable state (just in case).  Jenn asked me if I could start working on some of these things, which up front seems perfectly reasonable.  Looking at the list, however, I begin thinking of what tools I’ll need to approach the projects and then realize that I have no clue where these tools are.  I know I have a drill.  It is orange and black.  It is somewhere in my garage.  The key word here is “somewhere”.

It is clear to me that before anything happens, the garage needs to be organized.  I need to move all of the junk out, build a new workbench, and get my tools back into a spot where I can find and use them.  So begins the great shop rebuild of 2011.  More details to come.