Monday, October 12, 2009

It's Alive!

I've made a lot of progress since my last post.  You'll have to read for the long version, but the trailer is that the CNC gantry router is now semi-operational and has been used for an actual project.  Here's how it looks as of last night:

Operable 3-axis gantry router in my garage

Yes, it's still a bit of a mess with wiring all over the place.  You know the old joke such-and-such is the technology of the future and always will be?  There should be some corollary related to cleaning up a  project once its working and begging for new features ("Cleaning up is the next step and always will be?").
The astute observer will notice a few changes since the last post.  The long 3rd axis which I have designated "Z" is now mounted securely to the overhead gantry and the router is mounted to it.  The especially astute observer will also note that the router mounted is not the $22 harbor freight special I mentioned in my last post but a $80 DeWalt.  I'm sure no one saw that coming. More on this later....

Shot of the mount location for the Z-axis

Mounting the Z axis required a little custom hardware.  As can be seen in the picture above the carriage on the X-axis consists of a flat piece of stainless mounted to the linear bearing below and to the ball screw nut via a bracket on the right (viewing from the front of the machine).  Since the picture I have removed the tall upright piece of aluminum with the big rectangular hole in it along with the black chunk attached to the back of it.  This left the flat piece of stainless with two threaded holes in the top to mount the Z axis with.   The 3rd axis already had a nice custom-milled mount with two screw holes on the bottom so all I needed to connect it to the X axis carriage was a an angle bracket.  Since the 3rd axis is so long and heavy and this joint is fairly critical to the stiffness of the machine, I decided to make this bracket out of 303 stainless rather than aluminum.  I know, probably massive overkill but I have had bad luck with small threads in aluminum stripping anyway and making this block out of stainless solved this problem as well.

An angle-bracket only an engineer could love

I realize it is probably difficult to visualize how it all fits together.  The bracket shown above sits on the flat stainless steel block attached to the x linear bearing.  There is one hole barely visible on the left side of the base of the bracket which is where one of two screws go to attach it to the flat stainless piece. The two holes on the vertical face are threaded to receive screws that penetrate through the 3rd axis mounting bracket.  Anyway, the details aren't terribly important - here's how the assembly looks together:

3rd axis mounted on gantry.  The ball screw which is vertical in the picture is actually the x-axis and the third axis is mounted to the left.  You can see the angle bracket shown in the picture above right in the middle of the picture.  The 3rd axis mounting bracket is the black anodized piece immediately to the left of the angle bracket.
Once the third axis was mounted I had to attach the router to its carriage.  Attaching to the carriage is relatively straightforward as it has 4 threaded holes.  There are a million ways one could hold a router.  I think the solution I came up with is a very good combination of simplicity and rigidity:

The router mount

What you are looking at is an aluminum plate with 4 mounting holes, a 90 degree V-slot on the left half and 4 slots for hose clamps.  Hose clamps are really good at holding round things (like a router housing) and the V-slot functions both to align the router body vertically and to "dig in" a little to keep it from rotating.  When the two hose clamps are tightened down, the router is held very securely.  The four counter-bored holes on the right are for attaching the mount to the Z-axis carriage.

So I originally designed this mount for the cheapo harbor freight roto-zip tool I bought for $22.  I made the mount, put the rotary tool on and started cutting.  After breaking 3 small diameter drill bits trying to drill in a PCB, I took a closer look.  I rotated the bit in the tool slowly and to my horror saw the end wobbling back and forth by as much as 1/8".  My first thought was that the collet was no good so I went to Home Depot and found that the Roto-Zip brand collets do in fact fit in the Harbor Freight knockoff but the runout was as bad or worse.  So pulled the bit and collet out, whipped out a small dial indicator and indicated the inner surface of the collet holder on the tool.  It was about .007" out of concentricity which doesn't sound bad, but is if you consider that this will be multiplied the further out the tool gets.  Then I put the collet in with a tool and measured the runout on the tool.  Same order when considering that I was measuring further from the probable axis of the eccentricity - something like .010-.012".  Then I tightened down the collet nut and the runout went to .038".  So it appears that either the nut or the bearing tapers on the collet is terribly non-concentric on this tool and when you tighten it down it just goes to hell.  Rather than screwing anymore with the stupid I think, I just went to Lowes and bought a $80 DeWalt laminate router.

DeWalt laminate router mounted in the holder

The one saving grace of the Harbor Freight tool was that the motor section of it was cylindrical.  Good luck finding a new consumer-grade handheld tool resembling anything close to a pure conic-section these days.  Thank Apple or Ideo or someone but every damn tool I looked at had some big "ergonomic" bump or groove or taper or curve which made holding it mechanically hard.  The DeWalt was the closest but but it's body was still tapered towards the cord-end.  In order to get it mounted with no significant angular misalignment, I clamped the mount plate down on a mill, threw a 1/4" dowel pin the router tool holder and ran it back and forth under a dial indicator.  Initially there was about .8 degree of misalignment, but by shimming the cord-end up with some stiff EPDM rubber, I was able to get this down to less than .1 degree.  I also measured the runout of the tool holder with the same 1/4" dowel pin. At a distance of about an inch from the face of the collet nut, the runout is less than .002" - pretty darn good.  Unfortunately it only has a 1/4" collet so I had to get one of those stupid 1/4"-1/8" adapters for the little tiny 1/8" cutters I bought.  The runout was worse with the adapter, but still a huge amount better than the harbor freight tool.  And the result was that I was able to drill PCB's!...

This was the first thing I cut so I had everything turned down a lot - rapid is slow, feed is slow and I had the router running on 24VDC from teh power supply to keep the speed (and noise) down a bit.  But it worked!

The drilled PCB

I did have a bit of trouble getting the step/in ratio dialed in on the different axis'.  Apparently whoever designed the machine decided it would be a good idea to use 10mm pitch lead screws for the Y and 3rd (my Z) axis but a .2 inch pitch for the X-axis.  The combination of metric and imperial screws made my head hurt for a few minutes and resulted in a few misaligned holes in the above PCB, but I think I have the issue ironed out now.  I don't know what kind of masochistic designer mixes imperial and metric, but note to self - don't do it.  I got the general feeling in looking at the design of the machine this started as that the designer had never touched a machine before but was probably real comfortable plugged into a  CAD station for 8 hours a day.
So high off my first success I embarked on cutting something.  I threw in the cheap, dull and wobbly (yes harbor freight) 1/8" end mill I bought and double-stick taped some balsa wood down the the laminate table I made.

Results are not terribly bad considering the tool.  I switched to a somewhat better small diameter tool and cranked up the feed rate a little.  The result was noticeably better:

Cutting a balsa circle on a cnc router

Finally I decided to do something a little more complex.  The EMC2 website has a very good list of open-source CAM codes.  I have always wanted to try the Inkscape GCode converter plugins so I downloaded the python scripts, threw them in my Inkscape Extensions directory and fired up Inkscape.  It took a little tinkering to get some of the python dependencies right on my Inkscape installation since it includes a lot of pre-compiled shared libraries that I had elsewhere on my system.  Suffice to say it was a slightly aggravating, but not harrowing by any means, experience.  Since GCode is all lines and arcs, the GCode export script will only export paths made of line segments.  So you have to make sure to convert text to paths and bezier paths to line segments only (which is documented on the Inkscape GCode page).  Here's what I came up with:

And here's the result:

Text engraving using Inkscape for Gcode generation

Not bad for a first evening of routing!
The next project (aside from cleaning up wiring of course, ::cough::) is to build a speed control for the router.  To quote my friend John Lawler, the router sounds like a million souls dying when running at full power.  And there are probably a lot of situation where you want a) lower speeds and b) regulated speed control.  Definitely if I decide to try milling some aluminum on the set up.  So the PCB shown drilled above is to do PWM control of the router motor with an AVR Mega32.  I still need to figure out a tachometer scheme for the router motor and one thing I am a bit intrigued by is the techniques described here, here, or here.  The idea of using brush commutation EMI to measure speed occurred to me but of course was not unique and a search on Google Scholar turned up the links above.  I may just try it...