October 7, 2014

Building a CNC router with kids

Last summer, we prototyped a picket fence design, using traditional power and hand tools. Over the past year, we have done some renovation in the back yard, including having the landscapers take out the old fence and put in new fence posts. We left the fence itself as a family project to do over the course of another year or two.

The prospect of shaping the folded circular design from the prototype on the top of about 500 cedar fence pickets was enough to convince me we needed some automation to help. I must admit it didn't take a lot to convince me that what we really ought to do was build a CNC router. Of course the kids are not driving this project, but I have tried to involve them at every stage. I hope that it continues to provide them with an engaging way to explore software and machines.

I've done a couple machines like this before, so the basic principles and pieces are familiar to me. In fact, my final project for 6.111 in school was to build a little tabletop CNC router and the controls to run it with two housemates from the coop I lived in (Pika), J.D Albert and Stephen Preer. Maybe I'll post on that at a later date; it was an awesome project and I don't think its too much to say it changed my life. In the last few years I've done some similar things at work.

Machine Design
The design is influenced heavily by some surplus Parker slides I bought on ebay with the thought that I could use them for a CNC. They actually were used in the laser trim module on an Evergreen silicon ribbon growing furnace. I know this because I work with a number of ex-EGS people and they recognized them right away. A lot of these hit ebay some time after Evergreen was liquidated and scrap dealers started taking furnaces apart and putting components on ebay. I think I payed about $250 for two slides.

They are lead screws driven with stepper motors, which I figured would be fine for my application. I'm sure they are worn from near continuous operation in the Evergreen factory, but I also know the guy who used to go around greasing those slides so hopefully he can give me some tips to keep them running. Plus I doubt I'll be actually using it for that many hours per year.

If I count correctly, I only had to make 9 machined parts. I purchased extruded 6061 aluminum in 6.3, 9.5, and 12.7mm thickness from Online Metals to fabricate these parts, with the work being done on a few late nights on a friday in the shop at my job. There were a couple other tidbits I used the work shop for, but surprisingly little machine shop activity.

I made up some sketches in Autocad.

I know, I know, Solidworks is way better for this sort of thing. But I don't have Solidworks on my work computer, and the time I had to do this was while I sat at my desk eating my lunch for a few minutes a day.

 There were some mistakes and some needed adjustments and so on when I actually built it, so please no one use these as is without going through and thinking about everything. The sketches are also not terribly clear, so of limited use to anyone else. But I like to put things like this up online just in case they could help someone else someday, and for me to refer to later.

I made the length of the X carriage longer than the parker slide, so I could fit a 60cm wide piece of sheet material into the workspace, even if I couldn't cut on the whole thing.

The far side of the X carriage rides on a THK rail from ebay. I ought to have used the 4 hole size extrusion for the vertical columns instead of the 2 hole, since that is the main place that flexes when you grab the right side of the X carriage and yank it back and forth.

I'm not sure using the parker slides was really the best solution. On the Next Machine, maybe I'll try V guide rails and grooved rollers.

Z Axis
I thought about buying another parker slide for the Z axis, but I didn't really need much travel, and I was getting concerned about how far the tool was sticking out from the carriage cross beam. This makes the table size bigger without increasing the work envelope, and exerts an undesirable moment on the Z slide when cutting in the X direction. So I made the dubious decision to build the Z axis from a low profile THK rail and a Haydon-Kerk integrated lead screw stepper (both from ebay).

In retrospect I should have used a bigger stepper motor, or else some counter balance or spring to help with the mass of the slide and spindle assembly. Even though it is a lead screw, the weight of the spindle backdrives the motor when the motor is unpowered, which is annoying since then it crashes the cutter into your work or the table and loses it's Z home setting. I did put a little stop tab in to catch it before the THK carriage runs off the rail (after it happened the first time and I had to put the balls back into the carriage, oops). I can surely figure out a gas spring or something to assist with this, but for now it works. It is low profile and with appropriate travel.

I glommed a home switch onto the assembly too.

There are many extrusion systems out there, with 8020 being perhaps the best known one in the US. We have used Robotunits quite a bit at work and I've grown to like it a lot. The company has a fanatical zeal about keeping the catalog lean and not cluttered up with a ton of parts. In a way this is nice, but it is rather limiting in some cases. I really like their end connectors, and I love the fact that the slots in the different size extrusion profiles are the same dimensions, so the same T nuts and connectors are almost completely interchangeable. There is a 50mm base line and a 40mm base line. I designed this machine around the 40mm line, mainly to save some cost. I'm slowly tinkering on one at work with somewhat different parts (based on some Tol-o-matic belt slides off ebay), which I designed with the 50mm extrusion.

In most cases, every nut is a drop in T nut which can be put in from the slot (rather than needing to be slid in from the end, as with many 8020 nuts). The T nuts are well designed, with a spring steel leaf which holds them in place in the slot.

The nuts go in easily with the nut inserter tool, or a with a tiny bit more difficulty without the tool. This is so much better than the lame drop in 8020 nuts with the silly rubber whisker which always comes off or gets in the way when bolting into the nut.

The basic machine is a box, with a couple crossbars on top to support the table, and crossbars around the bottom to support a lower shelf. Casters are bolted onto the four corner verticals.

On top, there are flat aluminum bars stretching across the left and right edges. The one on the left is machined to attach to the frame with flat head screws, and to allow a Parker slide to bolt on, plus the button box toward the front.

On the right, the bar is drilled for flat heads into the frame below, and tapped with M4 holes to mount the THK rail.

Between these metal bars is a 19mm plywood table, with 9 flat head screws to attach to the frame. I figured if I needed more stiffness or wanted to rig a downdraft workholding/dust collecting system in the table I could put another layer of wood onto the bottom of the top extrusion frame area.

The lower shelf is also 19mm plywood, notched at the corners for the vertical supports. I also ended up making two extra verticals going from an under table cross bar down to the lower shelf plywood, to mount the electrical enclosure.

I ordered the frame with precut parts from my local Robotunits distributor, Gibson Engineering. This order was by far the single most expensive purchase I made for the project at about $650. The basic extrusion is pretty reasonable. But like other systems I have worked with, the connector parts really add up.

I sorted out the Robotunits order and the kids started putting it together one Saturday morning.

They were able to do this with not much help from me after I told them what needed to go together and showed them how to do it. Jewel necklace lifting straps help.

They thought it was a good time,

except when Child 1 got accidentally bonked in the head with a piece of extrusion.

I had the right tools all set up for them.

They thought the T nut and end connector system was pretty nice.

Ah, kids these days don't know how good they have it, not having suffered through 8020 T nuts and connections!

The plastic endcaps are nice too; just jam them in and expand a plastic sleeve with a philips head screw.

We got the basic frame together and the wheels on, and kept the thing in the dining room while we worked on it over the next month or so, which Becky was a great sport about.

Perhaps inevitably it got turned into a number of forts.

I put on the left and right machined bars

and mounted the Y slide and the THK rail, then put on the carriage plates for these, with vertical extrusion risers pre-attached.

Next came the 40x80mm cross rail, which I put on oriented horizontally. This was flanked by two 6.35x101.6mm aluminum plates oriented vertically, so as to form an I profile for the carriage.

It ended up being pretty stiff, the main problem being the torque created in the vertical riser on the parker slide by pushing on the carriage beam.  The two screws holding the vertical riser to the carriage plate seem to not be enough to keep it from twisting a little. I'll try tightening the daylights out of the screws, but I probably should have used a 4x extrusion for that particular part.

The X axis parker slide bolted to one of the 6.35mm thick carriage beam elements, with the Z axis base plate screwing to the carriage of the X slide.

The kids put on the 19mm plywood pieces.

The machine was a fixture in the dining room for a while

Child 3 started calling it "his house"

The spindle is a chinese 20K RPM 1500W air cooled model, which I bought on ebay with a Huanyang inverter for work. I'm borrowing it for home, but now that I know it works pretty well I'll buy one for home use. Only downside is that the inverter takes 220V, so there are less places to plug it in. I'll try to find a 115V version for my home model. All the other stuff which power runs to in the control box is universal input so it will run fine on either.

I've read online that there is a town in China called "German". So in product listings for stuff like this they can say it has German bearings. Heh heh. So far so good on the spindle though.

I also bought a 65mm clamping block on ebay to hold the spindle,

and an 85mm LED "Angel Eye" ring for light. I mounted the led ring to the bottom of the clamping block. It needed 12V to run, like the little display I hooked to the BBB, so I put in a small DIN mount 12V supply in the cabinet.

Above pic also shows the dust collection I rigged up using some stainless hose from McMaster. I stuff the end of my Fein shop vac into this when it is running. Works ok, though doesn't collect 100% of the dust. I think most of the small stuff does get sucked up.

Bought a small piece of shielded cable from Igus to run between the inverter and the spindle. The connector for the spindle has a very small diameter cable clamp. A few minutes on the bridgeport and it was opened up to accommodate my cable.

Picked up some solid carbide router bits and extra ER11 collets on ebay, both from china. One thing I didn't realize about ER11 collets is that they have to engage a feature in the collet nut. This is cool because when you loosen the collet, the nut actually pulls the collet out of the taper, thus freeing your bit. But the collet has to be put into the nut before the nut/collet is put onto the spindle and threaded in. If you try to put the collet into the spindle first, then thread the nut on (as I did), the bit will be clamped off center and will wobble badly. I was stumped when this happened, but it was quickly cleared up by a few minutes of looking on the web, and after putting it together in the proper sequence everything looked good.

For now, the spindle is turned on and off manually by a key switch on the switch box. This way I can run the program more easily with the spindle off and the Z home artificially high, to make sure it is going to do the right thing.

Controls Hardware
I've built a couple machines for work that use EMC2 as the controller. This also makes it easy to do stuff like jog and home, and you can see the G code you are going to run before and during the operation. This time I decided to try the linux machine controller version that runs on BeagleBone Black, MachineKit. The BeagleBone Black is cheap, small, and capable. I downloaded a card image with MachineKit, and it pretty much just worked.

We needed a BBB stacking card to drive the motors. At the time, Charles Steinkuehler had made the first version of his CRAMPS board available for order on OSH Park and written up admirably detailed instructions on assembly on the ShapeOko site. So I ordered some PCBs from OSH Park and some parts from Digikey.

I put on the surface mount parts at work, but let the girls solder all the through hole parts on the board. They had never soldered before, so I got them started on some breadboard and headers, which they conquered easily.

They speedily went on to do all the 100 or so joints on the CRAMPS board with only a couple that needed touching up by me later.

I was very impressed!

They were sad when we finished, and I had to promise to bring home more stuff they could solder.

My dad taught me to solder at our kitchen counter when I was a kid, and I remember having to struggle more with it. Good tools probably help; I have a fairly nice Weller iron I picked up very cheaply from the liquidation auction of Evergreen Solar's Devens plant.

We also spent some time bending and soldering little sculptures with brass wire.

Child 1 soldered the header pins into the Pololu driver daughterboards.

Meanwhile, I bought an electrical enclosure on ebay. I got one with a clear window since I thought it would make things more interesting. We mounted a couple blue cabinet lights to the top, and layed out all the main components that needed to go in the enclosure on the backplate.

A little drilling and tapping later, and we had the pieces in place.

We also made up a little control box with an estop and reset, go, and spindle on/off switches,

The main enclosure was outfitted with some bright blue case lights, and I ended up mounting it to the machine with two extra lengths of extrusion, attached to the bottom wood shelf on the bottom, and one of the tabletop frame crossbars on the top.

Looks rockin with those blue lights.

At work we had a big cart of wire salvaged from a european wet etch bench which ended up being scrapped, so I took some of that to use for the machine wiring.

I sketched a schematic for how we wanted to connect things, but I think the kids were not ready to digest this, and I ended up doing most of the wiring.

They kept asking when there would be more soldering!

I used a length of multiconductor cable to connect the switch box to the main enclosure, which the girls helped me pull.

Never hurts to endeavor to be graceful while pulling wire:

They were very impressed with the multitude of colors and patterns for the pairs in the multiconductor cable.

Some ebay sourced Igus chain was used on the X and Y axes to help with cable management. I think the size I got would be good if the cables were carefully arranged, but it is a little tight now because I didn't put them all in at once and they consequently make some crosses inside the Igus run. I bought extra end mounting plates for the chain from Igus directly, which was amazingly convenient and affordable.

The X Igus lays down in the I beam shape made by the extrusion and side plates. This looks nice now, but probably that trough will get full of dust and chips. The Y Igus is supported by a few brackets off the edge of the tabletop extrusion to the outside left edge of the machine.

Coming down the X axis Igus we have cables for:
  • Z stepper motor
  • Z home sensor
  • Spindle
  • LED light

Down the Y axis Igus we have all the Y cables, plus:
  • X stepper motor
  • X home sensor

The limit switches which came on the slides are 24V PNP output, so I made up some terminal block mounted voltage dividers to cut the signal voltage down to CRAMPS input level. I still haven't finished hooking these up. The limit switches and motors on the slides came with M8 and M12 connectors, so I bought some matching flying lead M8 and M12 cables from Automation Direct, which ran back to the control box.

After completing most of the wiring, we could get the axes jogging and debug the connections.

Software Toolchain
Not optimal, but working. I'll use as an example the first part cut with the machine, a bracket for my apple tree espalier cable trellis. I needed 32 of these parts cut from 19x240mm (1x10) S2S western red cedar boards.

So far what I have done is make a vector drawing in Autocad or Inkscape. I drew up this scaled version of the side view of an assembled trellis support in Inkscape.

Then I took the bracket, scaled it and layed out a 2 up version that would fit on the boards I wanted to cut from.

I'm still open to a home budget friendly CAM package that runs on linux and mac, but what I have used to date has been PyCAM. As far as I can see the documentation for this is close to non-existent, but by surfing support forums, heavy use of google searches, and enough fiddling around, it is working for my present needs. It is nice in that you can see a 3d view of the toolpaths it has generated. This allows you to fiddle a setting, generate the g code, modify the settings, re-generate, etc.

Pycam seems to open SVG files saved by Inkscape better than DXF files. This was a relatively easy part to set up since I am cutting it through all around.

Anyone know an easy way to do retain bridges in Pycam? When the router cuts the last bit of my part free, the part floats around in the pocket and the router ends up digging a gouge into the edge before it retracts. Only happens on one of the two brackets, strangely enough. Must have to do with the rotation of the router and where the part is finally cut free. I could make an outline in Inkscape with interruptions, then put this on the bottom pass in Pycam, but making that set of paths in Inkscape sounds tiresome.

To deal with the issue, I started setting the Z home such that a thin layer of wood was left at the bottom of the part, i.e. it wasn't cut completely free. Then I could pop it out after the program was done and clean up the flash with a sander. Not perfect though, because some of the cedar grain tends to peel away in the long grain direction when the part is popped out, marring the surface of the part. These were for a trellis, so I wan't too concerned, but if I was making high end furniture or something I would need to spend the time to figure out a real solution.

Data Transfer
The G code file was saved to a USB drive, which was popped into a USB hub off the BBB USB A port. I still need to install some case mount USB sockets on the electrical enclosure. The apple keyboard I am using has USB ports on it, but sometimes won't read a USB drive if the drive wants too much power (check using dmesg from command line on BBB after inserting drive, if it doesn't show up).

The G code file is opened up in Axis on the BBB.

Running the First Parts
First we did some testing using a pen taped to the spindle block, with butterfly shaped sample G code from the EMC install.

Then I took apart the machine and moved it to the basement. I finished up wiring in the spindle drive and got that going, then rigged up some dust collection.

The motors are driven with plug in Pololu drive boards. I have the current turned down pretty low because otherwise the driver chips shut off with thermal overload, resulting in a scrapped part. With the current turned down low, its not too hard to stall the Y axis, which also results in a scrap part. I tried some stick on heat sinks, but the adhesive got gooey and they fell off (being mounted vertically as they are). So I need to machine a real heatsink to go on top of the Pololu drivers. I'm thinking something which would screw into the four stacker holes in the CRAMPS board. The only slightly tricky thing is making them so they can contact the driver chips without hitting anything else, and leaving the current control pots open for adjustment.

In practice, I found that I could not run the motors at more than 1A without overheating the Pololu drivers, but this amount of current was ok for cutting slowly.

For these brackets I just set up some screws and washers to hold down the boards while cutting. The fence pickets will need something more sophisticated, probably with a bunch of toggle clamps.

Material utilization was pretty good.

Here is are two short videos of the tool cutting a part.

I cut 32 of these parts before I started assembling them. One brace consists of two parts put together with epoxy and two stainless screws.

Next up

  • Finish hooking up limits, figure out how to get them going in the software
  • Heat sink on motor drivers
  • Design files for 4 up picket fence cutting, clamping bars, etc.
  • Build 4 up picket fence clamps