My First Robot part 4 – Power Regulator PCB

With Adafruit’s lithium ion battery pack and USB/DC/Solar charger our power strategy is off to a good start. I chose those in part because I could easily add a solar panel later, but assuming the robot is running continuously, that would result in a possible output voltage range from 2.5V (the shutdown voltage of the LiIon battery pack) to 6V (the full-sun output of the solar panel). The Raspberry Pi (and ATMEGAs, which I’ll probably use as ‘standalone’ Arduinos) want a 5V supply, requiring either a buck or boost depending on the output voltage from the charger. I couldn’t find any turnkey solutions, but I did find this buck-boost DC-DC converter IC. The LTC3112 from Linear takes 2.7 – 15V in and provides 2.5 – 14V out, configurable with two resistors. Maximum current depends on Vout, at 3V in and 5V out I should get at least 1A. The documentation included some pretty thorough design guidelines, including a complete demo board schematic and layout, so I set about designing one of my own.


The design is pretty similar to the demo board. I removed a few things I didn’t need and added a bunch of output pads, and a second set of inputs so additional boards can be daisy chained. I’m told the component layout of boards like these is extremely sensitive, so I stayed as true to the demo board’s layout as possible.


I’ve been wanting to try outsourcing my PCB fabrication, and I think this finicky design was a good one to start with. The best value for this one seemed to be OSH-Park, and the process was really easy and smooth. They even take native Eagle files, so there was no messing with Gerbers, etc., and the instant preview made it easy to catch errors. Two weeks later I got three of these beauties in the mail. Ten bucks, delivered.

2014-04-26 21.54.47

Typically the next step for me would be dabbing tiny dots of solder paste onto the pads and mashing the components into them, but these boards look so nice and professional that I knew it was time to try a solder stencil. I recently gained access to a laser cutter, so I ordered some .004″ thick Mylar from McMaster and conducted a quick test.

I first exported the “Cream” and “Dimension” layers from Eagle as a 1200 dpi .png image, then brought that into Photoshop. I then selected all the pads (Select -> Color Range on black) and shrunk them down one pixel layer at a time using Select -> Modify -> Contract, Saving As every time until I had seven different versions, each one eroding the pads by about .0008″ all around. I cut these on the laser, using Raster settings of 30% power and 40% speed. Turns out the best one for this layout (with the fine pitch of that IC) was the “minus 4 pixels” version. By the way the fogginess of the Mylar there is the result of sanding off some very small ridges that had formed around all of the openings.

2014-04-24 13.53.30

Next I made a couple of fresh ones and cut a piece of 1/16″ acrylic to serve as a fixture to hold the board in alignment with the stencil.

2014-04-26 21.57.38

Here we go. First try, not bad! I made a little mess in the mounting holes, but generally the transfer was nice and clean.

2014-04-27 18.03.02I tweezered the components onto the board (my cheat sheet can be seen in the background) and fired up the reflow toaster oven.

2014-04-27 18.10.50About 6 minutes later…

2014-04-27 20.11.12

The inductor slid around a bit as the solder melted, but it’s still on its pads and not touching anything else. The IC looks perfect. You can see where R1 and R2 can be changed with thru-hole resistors to provide any output between 2.5 and 14V. The IOUT pad provides an analog voltage proportional to the current draw of the load, which I may end up using to monitor which systems are consuming the most power.

I works! 9V on the left, 3V on the right, identical output (and pretty darn close to 5V, too). I realized I had to hook up an LED to get a good output, probably because the multimeter was not drawing enough current and the IC went into a shutdown mode.


Robot is ready to go wireless!

UPDATE: Here’s the files and BOM to make your own:

OSH Park link

Eagle .sch and .brd files

Bill of Materials (Google Docs)


My First Robot part 3 – Drivetrain

Once I decided a custom tank tread wasn’t going to work for me, I went back to searching the internet for an off-the-shelf solution. Someone recommended looking at Lego Technic parts, and sure enough I found this on Ebay (EDIT: a helpful commenter on hackaday pointed out this much cheaper option). I don’t know what set this came from, but they are just about the right size (a little on the small side, maybe) and the price was right. Once they arrived I got them into CAD and quickly pulled together a basic design.



Aside from the treads this design is driven entirely by a few key components. First are two small SM-S4303R servos, which offer continuous rotation without modification. After much debate I decided on this lithium ion battery pack from Adafruit for two reasons: it has 6600mAh capacity which should provide hours of use between charging, and it is known to work well with this multi-source charger, also from Adafruit. I have plans to include solar charging in the future, which will impose some challenges, but I’ll get into that later.


2014-04-12 13.08.02 The rear tank tread wheel is mounted to a sliding part that allows the tread to be tensioned just right. The front wheels are attached directly to the servos, via a modified servo horn that I turned down to size on the lathe and glued into the wheel. Shown below (from left to right) is the original servo horn, the same part after turning its diameter down, and the wheel it is about to be glued into.

2014-04-12 13.23.28


Once glued together, the screw that holds the wheel onto the servo is trapped in the assembly:

2014-04-12 13.56.17


The chassis is 3D-printed, and I used small brass threaded inserts everywhere, considering how much I expect to be disassembling/reconfiguring things…

2014-04-24 17.04.41


…which made assembly nice and smooth.

2014-04-23 18.44.01


The top part is a slab of polycarbonate, meant to be easily removed and re-drilled, etc. as things change and evolve. Here it is, ready for electronics!

2014-04-23 20.17.49

My First Robot part 2 – 3d-printed tank treads

I found it surprisingly difficult to find just the right small-scale tank treads I wanted for Isabell’s robot, so naturally I looked into brewing-my-own. I first went down the RTV silicone path, but soon reeled it back to reality… I want to get this off the ground soon, then maybe look into full custom treads for the next generation. So the following is an experiment, sort of a feasibility test for 3D-printed tank treads.



This is really my first pass at a “tooth” design in CAD, based on nothing really. The cog teeth are simply arc sections meant to make the lead-in and lead-out smooth, and the tread profile is a rough approximation of the cog teeth.



This is the result, using an FDM tread on a laser-cut acrylic wheel assembly. I actually made three different sized sets of wheels and picked the best fit, then measured and cut the rectangular parts to provide a decent pre-load on the tread. The whole thing is held together precariously with a couple of dowel pins (and comes apart quite easily).

I had some concerns and they were mostly justified… The tread slips off the wheels easily after playing with the assembly for a couple of minutes, but that could be fixed with some retaining features. Also I suspected the tread would take a ‘set’ after sitting still for a couple of days– a function of the creep properties of ABS. Sure enough, a few days later I took the tread off and it had an elliptical shape, which I could feel in the form of on-again-off-again resistance when rolling the assembly along. I’ll bet a thinner-walled tread would be less prone to taking a set but still be strong enough to survive all the deformation. Ultimately I think the idea is feasible, but an RTV-cast silicone part would be my first choice for many reasons.


My First Robot, part 1

Isabell is ready for robots!

Isabell is ready for robots!

Several months ago I backed a Kickstarter campaign for Primo, a simple Arduino-based teaching tool for introducing programming logic to kids age 4-7. My oldest daughter was just 3, but my pledge got me plans and code only, and I figured the way projects go around here it just might be done by the time she’s 4. The Primo experience involves a cute (albeit simple) little robot named “Cubetto”, and right off the bat I figured I would modify some things to make him more… well, awesome. Little did I know of the rabbit hole I was about to tumble into.

As usual I started off with some sketches, thinking about what the robot could do aside from the Primo stuff. A suite of sensors would enable all sorts of behaviors, from simple (light seeking, line following) to more complex (play catch, drawbot). I would definitely enable a simple “radio control” mode, but I’m much more interested in autonomous (or semi-autonomous) behaviors. Isabell is obsessed with the Curiosity Mars rover, so it should definitely have some of that DNA. I also believe the rover should have some personality, so I’m looking into some simple dot-matrix display “eyes” that can communicate artificial emotion, and a simple speaker to give it a voice.




I’m focusing on a tracked design for now, so it can navigate a moderately challenging indoor environment. I love the idea of solar charging, or at least autonomously finding its own charging station. Of course it needs a camera so I’m drawn to the Raspberry Pi as a brain, which might also make remote control from an iPad relatively easy. I imagine the Rasp Pi might talk to one or more Arduinos, which can handle low-level functions like battery monitoring or distance sensors. I already have some small full-rotation servos, which will make the drivetrain simpler (vs. motor controllers, gearboxes, etc.).

My main guiding principle here will be flexibility/modularity, so features can be added or changed as we try things, get bored with them, imagine new uses, learn stuff, etc. Next step, start building the platform.


CNC mill oiling system – plumbing

This is it… Grizzly Miller is in several large pieces on my bench, and the major upgrades have begun. First up, oiling system.

I made some refinements to the original concept and even built a tube-bending tool for the small brass tube I’ll be using.

2013-03-25 18.17.27

First step was machining the X and Y axis ways on the mill’s cross slide. I used a simple ‘S’ curve, programmed point-by-point into an old ProtoTRAK-converted Bridgeport. On the same machine I pocketed out some clearance for the X-axis ball nut.

Beyond these sketches, most of the design work happened on-the-fly. This is unusual for me, but I don’t have CAD data of the original milling machine parts, and tube fabrication turns out to be more sculpture than engineering anyway. I also bought a silver solder kit specifically meant for joining copper alloys, and tried a small test piece from some scrap material.

2013-03-23 15.39.00

I then fabricated the main brass manifold and mounted it to the cross slide. From there it was a matter of drilling end points in the cross slide and connecting the dots with brass tubing. Each of the four ways are connected with my modified banjo fitting, which allows for flow control adjustments. The two ball nut mounts were modified to accept an oiling tube, which will simply splash each ball screw with oil. The manifold will be fed by a flexible tube, which will attach to the little stub coming off the manifold.

The soldering process is messy and dangerous, but once the parts are cleaned up they’re really quite beautiful.

2013-03-24 16.15.45

2013-03-24 23.57.17

The finished cross-slide assembly:

2013-03-24 16.53.04 2013-03-24 16.52.42 2013-03-24 16.52.50

The Z-axis got a similar treatment:

2013-03-25 13.33.56

More to come, stay tuned!


vacuum pump muffler

I recently bought a small vacuum pump for a project (I will get into that at a later date) and found it to be surprisingly noisy. At first I thought the noise was emanating from the housing itself, but when I blocked the outlet port with a finger the noise was cut down dramatically. A colleague suggested a muffler (thanks Keith!) and another gave me some tips on how they work (thanks Andy!) so I set out to make one.

It turns out there are several strategies for muffler design, and some of them get complicated, acoustically speaking. Most engine mufflers are optimized for unrestricted air flow, as air resistance saps horsepower. In my case the air flow is relatively low and I’m not concerned about a fractional drop in suction, so I went with a simple maze-like muffler design, intended to disperse and diminish sound pressure as the waves travel through the maze.



I printed the parts on the FDM machine…

2013-03-19 09.13.19

then glued the two halves together. Is there anything Loctite can’t do?

2013-03-19 09.17.01

The inlet port is sized for my 1/4″ ID hose, although in a future iteration I would add a barb feature to make the attachment a little more positive. For now I’ll just use a small hose clamp.

I measured the sound level (from 18″ away) at about 93 dB without the muffler, then about 82 dB with it. Hear for yourself:

DIY tube-bending tool

My plans for the milling machine oiling system call for some small-diameter bent brass tubing. I looked into the various tools designed for this, but the high end is too expensive and the low end looks pretty cheesy. I also wanted a small bend radius, which is hard to come by in off the shelf tools. It seemed easy enough to design a simple bending tool, and besides there’s nothing I like better than making stuff that makes other stuff.

My tubing has a 3/16″ OD and I was aiming for a 3/8″ bend radius (to the centerline of the tubing). I only anticipate needing 90 degree bends, but it didn’t seem any harder to allow for 180 degree bends. With these parameters I modeled up a simple design in CAD and ordered a few pieces of brass and steel from onlinemetals.

The first step was to grind a lathe tool blank to a 3/16″ diameter half-round shape. With this I turned some 3/4″ brass round rod into a set of rollers that closely fit the 3/16″ tubing.

2013-01-19 12.21.54

2013-01-19 15.36.45

I then milled the end of a 4″ length of 9/16″ square brass bar to accept the smaller roller, and drilled it for a tight fit to a 1/4″ dowel pin (1″ long).

2013-01-19 15.35.31

I then drilled two 12″ lengths of 1/8″ x 3/4″ mild steel to accept the two rollers and welded two more shorter lengths of steel to create a rectangular tube handle. Done and done!

2013-01-19 16.31.06

The square brass bar is clamped into the vise, and the tube to be bent is gently clamped to the brass bar with a rubber-jawed clamp. The first test worked perfectly!

2013-01-19 17.28.41

2013-01-19 17.32.03

The bends aren’t perfect– there’s a small amount of collapsing, probably from the small bend radius and the imperfect roller profiles. But I sawed through one of the bends at the thinnest part to see how much collapsing there was, and I think it’s acceptable for my needs.

2013-01-19 17.34.50

Here is the collapsed section (top) next to the normal tube section for comparison. Not bad!

2013-01-19 17.38.59

Next step: experiments in brass soldering.

CNC mill to-do list

Making progress (finally) on the mill upgrades, including full enclosure, flood coolant, oiling system, and ball screw conversion. Stay tuned!

3D-printed shop vac adapter

Believe it or not, 3D printing can be used for more useful things than clip-on mustaches… I have a miter saw with a missing dust bag, so whenever I use it I fill the immediate area with a fine coating of sawdust. I always thought a shop vac attachment would be more useful than the bag anyway, so I bought a 1.5″ to 2.5″ adapter that didn’t work at all. So I simply measured both ports and sketched up a quick elbow adapter.

I then modeled it in CAD, converting inches to mm and fine-tuning some of the dimensions and details.

A couple of simple sweeps and shell features, plus some details for hose clamps (a backup, in case the friction-fit doesn’t work):

The print took about 8 hours and required copious support material (which in turn took copious cleanup) but it came out perfect.

And fit perfectly too (no hose clamps required)!

I’ve uploaded the part to Thingiverse… enjoy!

bouncy-ball race trophies

That’s right, bouncy-ball races. Crushtoberfest is about three things: mustaches, drinking, and a complicated competition that makes adults look ridiculous. This year we had a couple of great ideas–like mini-bike jousting–but one too many conversations about safety killed that one:

Lack of time was also a factor this year, so compromises were made and we ended up here:

Since there’s really no “making” in the event, I looked to create a fun trophy instead.

A combination of FDM 3D-printed parts, laser-etched name plates, stained oak and lots of gold spray paint resulted in a surprisingly “official” looking trophy.

clip-on mustaches for Crushtoberfest ’12

It’s Crushtoberfest time again… time for mustache-related tomfoolery leading up to our big, hairy keg party. With all the men-folk growing their best mustaches (open to any facial hair this year, BTW), the ladies inevitably feel left out, so this year I wanted to help get them involved.

Sadly enough this was one of the more challenging 3D modeling projects I’ve had recently. I first sketched a couple of splines to define the general shape of a mustache, then created an ellipse perpendicular to those curves. I then projected the splines onto a curved surface so the mustache would better follow the shape of the face, and swept the ellipse along them.

I then mirrored the ‘stache and cut out an additional scoop in the back to make room for the clip. The clip was designed to fit into the nose and clamp the part in between the nostrils. I took a blind stab at the sizing of all the elements, hoping it would be  flexible enough to be comfortable but stiff enough to not fall out. I printed one out and tried it on… Turns out the spheres up top were not big enough and the clip was way too stiff, resulting in immediate pain, especially when removing it.

In the revised design I added some loops in the clip to make it more compliant, made the pads bigger and flatter, and added some fingernail nubbins to help spread the pads to put the mustache on.

I took this one around to some test subjects and we determined the mustache was a little too wide and thick to allow for beer drinking, so the next revision shrunk everything down a little.

The geometry of the clip changed enough to affect the compliance, but we’re still within acceptable stiffness. The best part is the layer lines inherent in the FDM process makes for a near-perfect mustache-hair texture. Here’s the finished product, ready for Crushtoberfest!

UPDATE: I uploaded the .stl files to Thingiverse!

UPDATE 10/25: Here’s an alternate style, for those of you into the push broom. Also available on Thingiverse:

CNC mill oiling system – concepts

As I’m preparing to dismantle the milling machine for its major ball screw overhaul, I’m thinking about what else I want to do while it’s apart. One thing that most commercial machines have is a semi-automated way of oiling the sliding parts of the machine. Like most of the awesome mods that can be done to this particular mill, Hoss has already figured it out, so I’ll base much of what I do on his existing work.

The biggest component of this project involves modifying the saddle in such a way that it can deliver oil to each of the four X and Y-axis ways. A series of tubes (shown in blue below) deliver oil into holes drilled into the saddle (shown in red), which in turn come up in the middle of each way. The surface of the ways are then milled with a shallow “S” curve groove to distribute the oil across the surface. Additionally, the saddle holds the ball nut mounts so it can conveniently distribute a squirt of oil to each of the ball screws as well.

The Z axis ways will be oiled from the head, so it will have its own plumbing. But the two assemblies will have to meet on the column via some flexible tubing, then connect to the oil pump and reservoir.

I have some thoughts on implementing my oiling system in a more compact way than Hoss. There are a lot of tight spaces in which this will operate, and other things I may want to integrate into the same real estate like limit switches, way covers, scales, etc. Furthermore I feel that clear plastic tubes are useful for seeing that oil is present in the system but they seem a little too flexible for my taste, probably requiring that they be tacked down periodically to prevent them getting in the way. I’m thinking about using rigid copper or aluminum tubes that are bent into position, which seems to be the way most commercial machines do it.

I took a look at McMaster’s selection of fittings and decided they are too bulky for my application, and probably way overkill for the relatively low pressures my system will see (up to 7 psi). I started thinking about how small a fitting could get, and figured that soldered connections are about the best you can do. The trouble with fully soldering all the connections is that the plumbing becomes permanent to the machine, which is probably bad. So then I thought maybe the plumbing could all be soldered into a semi-flexible assembly that is then pressed onto fittings in the saddle (see the above sketch).
These fittings were starting to look a little fussy to machine, and in a high vibration environment like a milling machine I don’t like the idea of friction alone making a pressure connection (albeit a low-pressure one).


So next I thought about a hollow screw solution that would also serve to attach the fitting to the saddle. There would need to be a nice soft seal (like an o-ring) that could compress enough to allow aligning the hole in the screw (shown in green) to the hole in the sleeve (medium blue). Then I realized that if the screw had a shoulder that reasonably sealed to the inside of the sleeve, it could also serve as a flow control valve– useful for getting the flow consistent between the varying oiling points. The idea can also be adapted to a tee configuration, where there is free flow past the junction:

So I was feeling pretty good about myself when a coworker pointed out that I had basically re-invented a banjo fitting, which is a low-profile, high-pressure connection commonly used in brake lines. A banjo fitting has a donut-shaped reservoir around the bolt, designed to provide free flow at any orientation. So my design provides the flow adjustment that a banjo fitting intentionally avoids, which is a useful feature in my low-pressure system.

Oh well. I realized a long time ago that coming up with something that has already been invented is just means you’re on the right track.

why I will never again shop at McMaster-Carr

Wait… WHAT????!!!!!!

UPDATE 6/26: Yesterday I received a very cordial and apologetic email from McMaster-Carr, explaining that they have had problems with “piracy” on their web site and that my experience was an error of mistaken identity. They sounded genuine and assured me that it would not happen again. Good thing, too, because I don’t know how I would have never shopped there again.

I love you too, McMaster-Carr. We’re cool.

the importance of sketching

I’ve often talked to students, young designers, and colleagues about the importance of sketching as a part of the design process, whatever flavor of design that might be. I like to think that I practice what I preach, but sometimes I forget.

I have been struggling with the design of an enclosure for my CNC mill that would allow me to use flood coolant and contain the mess of metal and plastic chips this machine can create. I had a rough idea in my head, and looked around at existing enclosures, so I immediately jumped into CAD to sort out the design. For days I iterated on-screen, unhappy with the results but trudging through each new concept until I hit a wall.


So last night as I sat on the couch I opened up my laptop to give it another go, only to find technical issues that kept me from launching my CAD software. Frustrated, I shut the laptop and pulled out my sketchbook. Within minutes I was teasing out the solutions that were so elusive on screen, and by the time I shut off the lights I had my design roughed out.

So, one more time, especially so I remember: Never underestimate the importance of sketching. CAD is an invaluable tool, as are rendering packages and Illustrator and Photoshop, etc. But for quick ideation, brainstorming, breaking through a mental block, or simply communicating with your fellow designer/engineer/marketing person, nothing beats sketching.

Thanks for humoring me. And stay tuned for my next rant, titled mock it up before you fock it up

home made chuck key

This weekend I spent a lot of time in the shop machining parts for my CNC mill, and ran into a problem with the lathe. The four jaw chuck has these adjustment screws to move the jaws in and out, but I can’t find the chuck key needed to adjust them. They use an inverted key–it’s and innie, not an outie, like most chuck keys–and it’s almost impossible to adjust without that particular tool.

I had a leftover piece of steel rod, so I made my own:

9x20 lathe chuck key CNC machined

The ends were machined on the mill, clamping the piece upright in the vise. The shoulder was turned on the lathe (in the three jaw chuck!).

9x20 lathe chuck key CNC machined

I milled a socket into the other end for a 3/8″ ratchet, although the fat body makes it easy to turn quickly by hand. (I tried to knurl the end but I still don’t know how to knurl properly, so I just mucked it all up)

9x20 lathe four-jaw chuck



sneak peek! hot shop styles for 2012

This new milling machine creates a lot of tiny shards of aluminum. And apparently those are not good for a toddler to eat, so I’ve had to take steps to reduce the amount of aluminum chips I drag into the house from the shop. I think my solution is pretty stylish…

shop coveralls G0704 CNC mill

CNC surface machining

I’ll be posting more about exactly what this part is in the near future, but for now I’m super excited about making my first surfaced part on the mill…

This is ABS, which I’m using to test the program before moving on to brass. Good thing too, because one of the last commands jammed the end mill down into the part… I pressed the reset button just as the bottom of the collet was carving out a pocket in the ABS and nothing was damaged, but if I was using brass things would have been ugly.

The end mill is a 1/4″ three flute uncoated carbide ball end mill. The spindle speed was around 2400 rpm and the feed was 7.5 ipm.

CNC milled PC board

One of my goals for the CNC mill has been to help fabricate PC boards, primarily in terms of cutting out the overall shape and drilling any through holes. For simple boards, however, it is possible to machine the circuit traces into the copper and avoid the entire photo-etching process altogether. I recently had a chance to try this process out, and the results were quite good.

This particular board needed to be circular, and needed to have a rectangular opening for a switch, so CNC routing the outline is really the way to go. The circuit is relatively simple, so it also lends itself well to routing the traces. If I were to etch this circuit the usual way with photoresist, developer, etchant, etc. etc. it would have taken three times as long.

PC board layout in Cadsoft's Eagle


The board was designed in Eagle as usual, but I then used an add-on to Eagle called PCB-gcode to generate gcode from the traces. There are a number of settings to specify depths, tool settings, speeds, etc. but it is fairly self-explanatory.

PCB-GCODE screenshot

I chose some pretty basic settings, which resulted in the following preview:

PC board layout in PCB-GCODE

I was never able to figure out how to generate the outlines using PCB-gcode, so I re-drew them in Mastercam and went from there. PCB-gcode is supposed to have that ability but there appear to be some bugs in the software that limit its ability to deal with circles and arcs. If anyone has made better progress than me I’d love to hear about it.

CNC machining a PCB on G0704 CNC mill Anyway the final product came out pretty good. I was pretty pleased with myself having tightened up the backlash to only .004″ per axis, but after machining .024″ wide traces I realized how bad that is. Under the right circumstances this is a good technique to save time, but I wouldn’t try to machine extremely fine traces or tight-pitched pads until I work those last few thousandths of backlash out of my machine.






[flickr video=6710516711]

milling machine modifications, part __?

In this minor modification I added a 50 lb. gas spring between the column and the head, meant to assist the Z-axis motor in lifting the weight of the head.

gas spring modification G0704 milling machine CNC

The stock part is a 50 lb. gas spring with ball-joint fittings, McMaster part #4138T621. I simply drilled a hole in the column (and tapped it for 5/16-18) for the lower pivot, but the upper pivot point wanted to be above the top of the head to allow for a full 12″ of travel. I designed and machined a simple aluminum part to extend the upper pivot point and mounted it to the head. While I was at it I also machined a nice little cap to cover the hole where the Z-axis crank was.
gas spring modification G0704 milling machine CNC

The backlash in the lead screws has been giving me relatively poor surface finishes, so I bead blasted these parts to even them out. I like the look, but the “toothy” surface really grabs onto dirt.

I was hoping to double the rapid speed I could get out of the Z-axis, but I didn’t quite make it… It went from 15 in/min to about 25 in/min, although I just bought some better way oil so we’ll see if that makes up the difference.

first CNC movements

Manual entry of G-code, with a Sharpie mounted in the drill chuck…

[flickr video=6487457455]

antenna ball

For the ham radio operator on my gift list…

antenna topper turned 9x20 lathe aluminum

After eyeballing the spherical shape using a mixture of cutting tools, rasps and files, I wet-sanded the tool marks off and polished it with red and green compound. Then I parted it off (pictured above) and drilled the mounting hole. I was going to measure the sphericity I got by eye but decided I’d rather not know.

CNC mill parts

Tonight I finally finished the metal parts for the CNC conversion. These were made from a subset of the “phase 1” plans I purchased, and are all the custom parts I need to attach my stepper motors to the G0704 mill.

aluminum and steel parts for my G0704 CNC milling machine conversion

Most of these were pretty straightforward. The standoff-looking parts are steel rod, parted off to length and then drilled and tapped. The fatter bushing-looking things are aluminum, also round rod that was drilled out then trimmed to length. The big flat aluminum parts were a little more challenging, requiring some milling, but the holes were all center-punched and drilled on the drill press (I still don’t trust positioning on the mill due to the backlash in the screws).

steel part for my G0704 CNC milling machine conversion

This cylindrical steel part took several hours. Starting from a 1.5″ steel rod, I first turned the skinny stem part, then flipped it around to bore out the inside. The tricky part was getting the piece clamped into the lathe so it was perfectly concentric to the shaft I already turned. Apparently my three-jaw chuck is not perfectly centered, so I used the four-jaw chuck and aligned the part manually using a dial indicator attached to the cross slide. According to the indicator I got within half a thou for concentricity… good enough!

steel part for my G0704 CNC milling machine conversion

Once it was centered I bored out the inside and put the little shoulder on the end. Next it was drilled and tapped (for set screws), then off to the mill to make the flats on the shaft.

The most challenging part was probably this aluminum bearing block, shown here in the four jaw chuck. Again, concentricity here is key, so a lot of time was spent getting this guy aligned when I flipped it around.

aluminum part turned on a 9x20 lathe for my G0704 CNC milling machine conversion

Technically I’m ready to mount the motors to the mill, but I’m hesitant to start the process. I’ve gotten used to having a milling machine available, and once I take the handwheels off it’ll be out of commission until the CNC conversion is complete and working! Here we go…

Mach3 setup

I’d love to say that getting the CNC controller software (Mach3) to talk to my stepper motors went quickly and flawlessly. It didn’t, but to be fair there are several hardware steps between the two and I don’t blame Mach3. Anyway by the end of the day I had gotten to this point:

Next step is mechanically attaching the motors to the mill, then addressing the whole Arduino safety system.

CNC controller – assembly & wiring

Assembly of the controller box has gone very well. The PC components (motherboard, hard drive and power supply) all mount to the monitor’s VESA holes through a flat aluminum bracket, and the monitor attaches right to the front panel. The keyboard gets sandwiched between a flat steel plate and the front panel, with some minor modifications to its silicone cover to make it fit.

small form factor PC and touch screen built into custom CNC controller box

The rest of the assembly revolves mainly around the PCBs and front panel controls. Before mounting the PCB assembly I installed the small USB daughter board that provides a USB port on the front panel.

USB daughter board for custom CNC controller box

The rest of the assembly mounts over this, aligning the tact switches to the button actuators. The remainder of effort went into managing the many wires neatly into the cabinet.

custom CNC controller box

The lower cabinet assembly was much more straightforward:

stepper motor drivers for G0704 CNC milling machine

stepper motor drivers for G0704 CNC milling machine

Of course I wanted to fire it up as soon as possible, even though nothing was connected. The Arduino IC was not yet programmed so none of the UI elements were working, but I was able to transfer files through the USB port.

custom CNC controller box for G0704 milling machine

This is far from complete, but I’m ready to start integrating the Mach3 software with the electronics and make sure they can talk to each other.

CNC mill – metal fabrication

With the CAD design more or less complete it’s time to make some parts. I generated some 2D views of the various parts and plotted them at full scale, then spray-mounted them to some sheet metal, most of which I had cut to size beforehand.

fabricating parts for the custom CNC controller box

As a result, most of the fabrication involved simply drilling and tapping the right sized holes in the steel:

fabricating parts for the custom CNC controller box

But some of the more complicated parts required cutting out larger areas of material. I did most of this very slowly with the jig saw and a metal-cutting blade. But some of the rectangular areas allowed me to use the mill!

fabricating parts for the custom CNC controller box

I quickly realized that this machine will be challenged by steel, as even this thin material caused the whole column/head to flex as I cranked on the wheels. I think it will be possible to machine steel, but the feeds will need to be very slow and it will definitely require copious amounts of coolant.

Here’s the “lower cabinet assembly”–the part that will house the motor drivers and their power supply–welded up and primed:

fabricating parts for the custom CNC controller box

The front panel of the controller box required extensive modification, done entirely with the jig saw and drill bits (the large holes were made with a step drill). I couldn’t wait to dry-fit the assembly onto the mounting arm:

fabricating a custom CNC controller box

The front panel also required a fair amount of welded parts on the back side, for mounting the monitor and keyboard. Notice how the thin sheet metal warped after welding:

fabricating a custom CNC controller box

Final fitting before priming and painting:

fabricating a custom CNC controller box

Next step, assembly…

controller box mounting arm

I don’t usually build as I go, without detailed planning or at least some sketches. But one Saturday a few weeks ago I had several hours to myself and I was itching to make some physical progress on the CNC conversion, so I took a quick inventory of my metal stock pile and just started building.

custom CNC controller box welded steel The mounting arm for the CNC controller box–that physically attaches the box to the mill–is a very simple part with well-defined parameters. The controller box has four mounting holes on the back side and the column of the mill is a thick iron casting that can be drilled & tapped basically anywhere. I knew approximately where I wanted the box to be, so it was a simple connect-the-dots part design. I had a 2′ length of square steel tube and some angle iron, so I started chopping it up and dry-fit it to the back of the controller box.

MIG welded steel

I MIG welded it together (still practicing that welding… getting better) and cleaned it up, then primed it with some Rustoleum, then did a quick test fit on the mill.

custom CNC controller box mounting arm

custom CNC controller box

A couple of coats of black lacquer and it’s good to go!

custom CNC controller box mounting arm

CNC mill phase 4: PCB fabrication

By now I’ve got a pretty good system down for fabricating PC boards:

1. print artwork onto transparencies
2. laminate the dry film resist onto copper
3. expose the board on the UV light box
4. develop the film, rinse
5. etch the PCB in a tupperware in a sink full of warm water (I’ve been experimenting with acid cupric chloride, but my go-to is still ferric chloride), rinse
6. strip the film off with acetone & tin plate the board with Tinnit (also in container in warm water), rinse with ammonia solution
7. drill & trim board
8. dab on solder paste and place components
9. reflow solder in the toaster oven
10. hand-solder through hole components

This is basically the process I followed this time, but this was the biggest PC board I’ve made to date at around 11″ long. To start with, I couldn’t fit the whole thing on a 8-1/2 x 11″ transparency out of my laser printer, so I had to print it in two pieces and tape them together.

PCB artwork transparencies

I also couldn’t fit the board in my typical etching tray, so I had to use our good Pyrex baking tray for the etching and plating. Otherwise the process went smoothly. I intentionally sized the board to just fit into my reflow toaster oven, and despite using expired solder paste the boards came out pretty good.

PCB - ready to etch

CNC mill phase 3: PCB design

In my CNC controller design most everything is handled by the PC and the off-the-shelf breakout board and motor controllers. But there is an ‘optional’ hardware layer that provides a measure of safety–both for the user and the machine–and a degree of feedback as to the status of the system. This is where a couple of custom PCBs come in.

The design of this subsystem is based off a sample from the excellent Mach 3 controller software documentation (without permission to reproduce it, see page 4-24 of this pdf document). Essentially the system monitors a series of limit switches–designed to prevent the machine from trying to move beyond its mechanical limits in any axis–and one or more E-stop buttons, which together are called the ‘interface’. It also listens for a 12.5kHz electrical signal that the Mach 3 software generates when it is running normally, and if any of these conditions are abnormal the power is cut to the stepper motors and the machine’s spindle. The Mach 3 example does this in an analog way with a clever series of relays, and includes LED indicators and a reset button to provide system feedback to the user.

I realized that a microcontroller could do the same job and offer some more flexibility, and ultimately be simpler. At the heart of this board is a standalone Arduino–basically an ATMEGA 328 and a small handful of discreet components. The IC just to the right of that is a MAX232 chip for serial communication with the PC. This is certainly not necessary, but I figured I have a PC in the same enclosure, so why not enable it to connect directly to the Arduino, either for reprogramming purposes or for some future physical computing need related to the CNC mill. To the right of that is an HEF4538 monostable multivibrator IC and the rest of the ‘charge pump’ circuit provided by Geckodrive’s Mariss Freimanis, which turns the 12.5kHz signal from Mach 3 into a logic high or low into the Arduino. To the upper left is a simple 12VDC (from the PC power supply) to 5VDC power supply, for the ICs and the C-10 breakout board in the lower cabinet. This 5V and GND and the rest of the lines between the Arduino and C-10 board connect to a pin header, shown directly below the Arduino.

CNC mill - main board schematic

On the very far right is where the E-stop and limit switches will connect to an Arduino I/O pin, and a pull-down resistor to keep the pin from floating. The E-stop and limit switches are connected in series and set up in a ‘normally closed’ configuration. This is an added measure of safety as an inadvertently severed wire will indicate a fault, rather than fail to indicate a real problem should one arise. As configured here, a normal condition will read as ‘high’ on the I/O pin.

On the upper right is a series of switches and indicators: MACH OK and INTERFACE OK indicators, INTERFACE RESET and MOTION OVERRIDE buttons (each with their own indicators), and a PC POWER button with power and HD activity LED and a PC RESET button. The latter are not connected to the Arduino at all but go directly to the PC motherboard.

pushbutton The reason the other buttons and LEDs are part of the PCB is that I had a handful of Klockner-Moeller illuminated switches. Except that they are not actual switches and they are not illuminated; rather they are the actuator in a larger assembly that includes switches and lamps. Being real industrial controls, these full assemblies are extremely expensive. Also, I am dealing with signal-level voltages and currents and don’t need anything heavy-duty. So I designed my board to sit just under these switch actuators and provided a couple of small tact switches that are depressed when the big button is pressed. In the middle of each set of switches is two LEDs that will fire up through the middle and illuminate the button.

On the lower right and directly above the Arduino are two headers that connect to the relay board. This is where the AC power terminal block is, and where the relays that switch AC power reside. The first three relays are for switching the main power to the lower cabinet and AC power to two different (future) coolant systems. The other two relays replace the original power switch on the mill (it is a DPDT switch) so the controller box will now have control of the mill’s spindle.

CNC mill - relay board schematic

Since my PC board far exceeds the maximum size that the free version of CadSoft Eagle allows, I designed the Arduino board in two halves and joined them together in Illustrator. The large cutout for the E-stop button provided a nice natural break between the two halves. The upper half was also too big, so I designed it with much less vertical space between buttons and simply stretched the image out later.

CNC mill - PC board artwork

Note: if these images look very slightly skewed to the left, you don’t need to check your eyes. My laser printer warps the transparency film as it’s going through the hot printer, so double-sided PCB artwork doesn’t line up when flipped to face each other. So I printed two copies of a square grid and flipped them face-to-face, then measured the offset so I could compensate for it. Now as a last step before printing transparencies, I skew the entire page in Illustrator horizontally by -.179 degrees, and I end up pretty close every time.

Here’s the relay board, and a small daughter board for the USB connector on the front panel.

CNC mill - PC board artwork

Next step: PCB fabrication!

CNC mill phase 2: CAD

With the system map complete and the major components sourced I set about the mechanical design of the enclosures. I originally intended to design and build a custom enclosure for the computer and drivers, out of brushed aluminum/stainless, etc. but came to my senses. Sometimes you have to recognize when to go all out, and when to just get it done. So in that spirit I found a suitable electrical pull box from Automation Direct and probably saved myself a month of fabrication and finishing time. That’s not to say this box will work as-is off the shelf, so there’s still plenty of opportunities to fabricate and modify.

enclosure This is the main two-part enclosure after the extensive modification required to mount the PC and monitor, keyboard and PCBs. Since the enclosure is steel I opted to weld as much of it together as possible in the interest of simplicity. Most of the front panel is cut away for the monitor and keyboard, so the ribs that are welded in also add rigidity. A continuous steel hinge is welded to the front panel and then bolted to the enclosure to join them together.

The touchscreen monitor will mount to the ribs on three sides, allowing the PC components to attach to the VESA mounting holes on the monitor through a simple, flat aluminum bracket. The keyboard will be sandwiched against the inside of the front panel with a flat steel plate.

front panel assembly 1

The interface elements on the right side of the front panel are connected to a large PC board that includes the Arduino and charge pump circuitry. A smaller board isolates the relays, most of which will be switching AC power.

front panel assembly 2

The original concept was to pack everything into the controller box so it would be a standalone assembly, but I came to understand the risk of packaging higher DC voltage components (like stepper drivers) into the same box as sensitive logic-level components (like a PC). So the motor drivers and their power supply moved into the base of the milling machine, mounted to a welded steel assembly that will mount into the base through an opening cut through the back. The pink datum planes in the screenshots represent the interior space available in the upper half of the machine’s base, which is pretty much consumed by the electronics.

lower cabinet assembly

Next up is the PCB design for the interface board in the controller box…

CNC mill phase 1: planning

While I have understood the basics concept of CNC machining–and have utilized it in my work–I never fully appreciated how complex a system a CNC machine is until I set about designing and building one. There are many software and hardware layers are involved in the process, and each of these layers offers nearly endless options to choose from… CAM software, controller software, steppers vs. servos and their torque specs, power supplies, motor controllers, breakout boards, encoders, etc. not to mention the mechanical modifications to the manual mill.

So as a first step in converting my milling machine to CNC I looked at a lot of other people’s conversions with this and similar machines, especially in the copious posts on and specifically the great work that “Hoss” has done. In the interest of not re-inventing the wheel (for now) I chose one of Hoss’s recommended stepper motor configurations from Keling, and bought his plans for the mechanical conversion from a manual to a motor-driven G0704 mill.

From there I started to sketch out a system map, detailing the wire-for-wire connections between the different components to best understand how this might go together. This also helped me to think through the available options, like physical interface elements such as emergency stop buttons and limit switches.

CNC mill system map

The lower area will exist in the base of the machine and will include the higher voltage DC elements that actually drive the stepper motors. A KL-600-48 power supply provides 48V to the three KL-5056D motor drivers. Control signals from the PC come through a C-10 breakout board, which serves to isolate the PC from the motor drivers. It seems that keeping things separate like this is good practice and tends to avoid funky interference or crosstalk problems with the PC.

The upper area represents a “controller box” which will hang off the side of the machine, and will enclose a small form factor PC, a 15″ touchscreen monitor (eBay!), a ruggedized keyboard, and a small cluster of buttons and indicators. The I/Os will include a main power cord, a ‘switched’ power cord to feed the lower cabinet, a DB25 to connect the PC’s parallel port to the breakout board in the lower cabinet, a DB15 to connect other signal to the breakout board, a series of connections for limit switches, three relay connections to control the mill’s spindle and two different coolant systems, and USB and ethernet ports to communicate with the PC.

CNC front panel

A main switch on the front panel controls the power to the entire system– PC, monitor, and the motor power supply in the lower cabinet. “PC power” and “PC reset” switches are connected directly to a header on the motherboard, as are LEDs to indicate power and hard drive activity. A USB port on the front panel is intended to be the main method of getting files on the PC, as I intend to use a pared-down Windows installation with a bare minimum of extras (like network access).

The remainder of the controls are dedicated to the safety system, which is based roughly on a scheme provided in the Mach 3 documentation but adapted to work with an Arduino microcontroller. The first part of the scheme monitors the emergency stop button and limit switches (what they call the “interface”) to make sure the machine and operator are OK. The second part, called a charge pump circuit, reads a 12.5kHz signal that the controller software produces when everything is functioning normally. These functions are monitored on I/O pins of the Arduino, and if either condition reports a problem the Arduino cuts power to the lower cabinet and the milling machine’s spindle (via relays) and lights the appropriate indicator(s) on the front panel. After a limit switch or e-stop event, the “interface reset” button will give the controller software the all-clear and resume power.

The “motion override” button is one that I threw for my own comfort. Say I’m running a program and it comes to a point where I need to change to a different sized end mill before continuing. The program would stop the spindle and pause and wait for me to go in there with my bare hands to switch out the tool. At this point I’m relying solely on software to keep the machine from firing up the spindle and plunging the razor sharp end mill through my hand and into the table (for example). Not that this is likely, but I don’t trust software… after all, robots will kill you. So the “motion override” button tells the Arduino to cut power to the spindle and controller until I press the button again. I know what you’re going to say… the Arduino that’s in control is also running software. Well, Arduino is benevolent and would never try to hurt me.

With the system laid out and all the components chosen, the next step is modeling it up in CAD.