CNC ROUTING MACHINE

Page last updated on Sunday Jun 12, 2005

Status

Mechanicals are complete. X, Y, Z, A, and C-axes are complete. Limit and home switches are installed. Box pieces ready for assembly. Software suite found, downloaded, and mostly tested functional for this process. Spindle needs replacement. Project 80% complete and on hold.

Introduction

The goal here is to design and build a very low-cost, very simple, desktop cutting and routing machine, which might do pc-boards, wood "gingerbread", plaster for rubber stamp molds, etc.--that is, not focussed on any single task. To fit the South Lab here, the size must allow it to fit on a shelving unit, roughly 3x2x2 feet. The size of the work can be about 19-inches in diameter (if C-axis is used), or 1lx16 inches (if just X and Y are used) by 6-inches tall. Initial parts pile for machine The mechanism itself has five degrees of freedom: X, Y, Z, and a 90° rotation in the XZ-plane all built upon the ceiling of the unit, and a 360° rotary table on the floor. The earlier design was to use just the X, Y, Z axes, but... well, in spite of the added slop, the extra two degrees of freedom make it so much cooler! This picture shows the workbench in April 2003, with some of the parts stacked together. Construction has taken about three months over the past year, largely due to the "file-to-fit" character of the project, and the excuse to scrounge through the surplus outlets in the San Francisco Bay area. :-) Given that it's my first CNC, I'm experiencing all the joys of first-timer "gotchas". But, then, I like to underdesign stuff sometimes just to find out what the limits are.

Material costs are: $50 Wood, $30 surplus motors, $20 screws & couplers, $5 chuck, $45 slides, $5 surplus power supply, $10 PCBs bare, $5 connectors, $10 switches, $10 50ft surplus 10ea/20AWG shielded cable, $20 misc electronics hardware, $25 old laptop PC. I had or was given some of this, so my out-of-pocket was just under $200 instead of $235.

Hardware

To maintain the low cost and simplicity, I opted for open-loop stepping-motors. Lead screws also are rather expensive and would have cost several hundred dollars, so I grimaced and reached for common 3/8th x 16tpi threaded rod. To salve my concern over not installing backlash springs, I chose 1-3/4-inch long threaded couplers to mate with the threaded rod epoxied to the shallow channel on the underside of the platforms. This proved to work quite well. The backlash I spot-checked on Y with my dial indicator at only one count (.0003"), which could be dial indicator error. Soon I'll dig out my test indicator look closer. I'm not sure what the accuracy is yet. I wasted a lot of time trying to "true" these threaded rods in the coupler. If I did it over, I would simply epoxy them into the coupler as I did for the Z-axis and keep the couplers from needing to travel too close to one another so concentricity errors don't bite you. The rod is mild steel anyway and I found it easy to bend straighter by hand. In any event, any cosine error here is bound to be swamped by thread accuracy, for which the long coupler helps a lot. For the sheet material I settled on quality three-quarter-inch plywood. For the slides, I thought I'd try sandwiching a pair of half-suspension drawer slides between two thick plywood sheets for each linear dimension--half-suspension because the mechanism is not as sloppy as full-suspension, and not allowing the slide to exceed half its travel in either direction, which would tend to improve rigidity by keeping the sliding parts somewhat constrained, benefitting from the thick plywood. As a general rule, I chose to keep the length-to-width ratio greater than one to reduce yaw as one slide moved farther than the other. My biggest unintentional tactical error was to fail to protect the drawer slides during cutting from the shavings. Even after dismantling and washing they will never operate anywhere close to their original smoothness. Overall, though, the mounting of the slides and underestimating the torque of the motors were what nearly unset me. A little lithium grease and I was back in business. So much for the hope of using dry graphite! One of the most difficult decisions I made was to reject the use of some slides designed for light machine operation that I found surplus at Triangle Machinery in San Jose as being several inches too long. The lab here has three-foot workspaces between support beams.

C-Axis

The rotary table is a 24-inch diameter round of 3/4-inch plywood, whose radius was shaved until it just fit 360 teeth from .02"-pitch timing belt around the circumference (a convenient visual reference, also giving me an even count after each revolution of the table). I found enough .080"-pitch belting to implement the 90°-axis along with surplus pulleys. C-axis being tested On the whole, I highly recommend this belt for making really cheap gears. The photo shows test-jogging in progress via TurboCNC. With the intrusion of this motor, the available diameter for the work is now 21-inches. High-speed slewing isn't feasible at this stage for four reasons: (1) system friction, (2) proper acceleration and top speed values, (3) need for a current chopper at higher voltage to force motor current at these speeds, and (4) proper high-speed & high-current diodes which are more necessary in this operational mode. I'll be doing a better design down the road. For now, though, it's taking G-commands just fine. On further research, I found that the 5V, 1A motor I use for the C-axis has too much inductance for really high-speed work.

Considering conventional CNC axis naming (from the operator's viewpoint: on the left of the machine's front access panel and in front of the computer), the +X-axis faces into the room through the access shield, the +Y-axis is away from the computer and the operator, the +Z-axis upwards, the +A-axis (which turns around the Y-axis) allows movement from 0-90° (tool straight down to tool horizontal, facing away from the operator), and the C-axis (which turns around the Z-axis) is the horizontal rotary table on which work is mounted and which rotates clockwise for positive angles (as if the tool were moving counterclockwise). You can see the large silver and black motor with the long left-to-right shaft in the above picture. The X-axis (front-to-back) is mounted on this. You can just see the motor toward the back with the shaft extending off the lower left of picture. The Z-axis is mounted on the triangular, boxy structure. The Z-axis plate, upon which the 90°-rotary-dimension will be mounted, is facing the bottom of the picture with the motor protruding. At the top is the "lazy susan" bearing-ring that will be used under the rotary table. I recommend care when drilling the center holes for this type of rotary axis. I had to hand-drill, and not making a drill jig for hole straightness was a big mistake. The hole was used successfully to shave the radius quite evenly, but I was forced to widen the hole slightly during mounting which caused it to be slightly off-center as seen from the drive gear. Also, the center bolt was intended to be tightened optimally to take up the slop in the bearing ring. With care, I still think this approach could work.

X-, Y-Axes and Physical Layout

This picture shows unit splayed so it may be worked on easily. The C-axis and the electronics are shown against the back wall mounted on what will be the bottom plywood sheet. The electronics are mounted inside a box which is in turn mounted on the base sheet. There is a lid (not shown). At bottom of picture, the axes-assembly is shown flipped upside-down for access. Y-axis ready for mounting The Y-axis is complete, with the X-axis ready for threading onto motor assembly. One can just make out the threaded rod attached to the Z-axis motor already mounted on the XZ-assembly. The gray patch between the rails on the X-platform is where I've epoxied the coupler into the channel. In the electronics area, the line transformer can be seen at the top which will provide the isolation needed for the 115VDC power supply for the cutting motor. Just below it is a switching power supply which supplies the logic power and (when suitably downconverted) the motor power for the steppers. The lower half of the box will have a PCB mounted for each axis, just as the C-axis is shown completely wired and functional.

Z-, A-Axes

I had intended for the longest time to find some teflon as a bearing for the quarter-circle which comprises the A-rotary-axis. As it wasn't convenient to obtain, I grudgingly opted for wood-on-wood (gasp!) As it turns out, my fears were not really justified. The fine finish of the plywood works just fine over the full surface of the quarter-circle piece. This has also given me the convenience of using a piece over-so-slightly thicker for part of the motor-mount. A-axis on Z-axis The resulting assembly moves remarkably free of significant abrasive friction. This will last a while, at least. The backlash (and sloppiness in the other directions) at the cutter chuck due to the B-axis appears to be about 0.010 inch (on a good day). I could clamp this axis (as well as the rotary table) if circuit board cutting is feasible (there will also likely be a Z-axis position with minimum slop.) This technique might have worked better if the quarter-circle had been more fully contained throughout its rotation range. The picture is shown turned sideways.

For the cutting motor, I wanted something smaller and of slightly better quality than a Dremel which have sloppy bearings and aren't designed for the steady use, and was lucky in my scrounging to find some 115VDC motors for a small grinder. The shaft was very short with a flat on it. I partially drilled-out a quarter-inch threaded coupler (1/4-inch x 20tpi), and drilled & tapped three set screws for runout. Into the coupler, I threaded a length of 3/8-16 rod. Onto the rod, I threaded the chuck portion of a drill adapter. This arrangement just doesn't cut it. The motor would be fine, but with a pulley coupled to a real spindle. I should have a proper shaft with its own supports, given such a short motor shaft. I'll have to use my Dremel for a cutter until I can put one together.

Electronics

The schematic of the hardware driver for each motor is shown here. I designed it to use simple logic gates, for those, like me, who don't want to chase down obscure chips. (Hmm. I should change those to pull-up resistors on the schematic one of these days... That, and redesigning it to use 74LS86 and 74LS74 chips for less static sensitivity.) The design is based on a "walking ring counter", wherein Q outputs of flip-flops are fed into subsequent D inputs, and so on around in a circle, save for one which uses its NOT_Q output. Driver schematic A curious property of this configuration is that there are equal on and off times for each stage, and each successive flip-flop stage is time-shifted by one pulse. In this case, our ring consists of only two flip-flops. If you work out the logic sequence in this deceptively simple circuit, there are four possible states which are counted through in these four bits, each bit of which is passed on to a motor winding. In series with each flip-flop I've placed exclusive-OR gates to act as programmable inverters. The two on the left (connected to the Direction signal) come from the computer's parallel port, and determine which direction this motor will step. The two on the right (connected to the Polarity signal) is a convenience which gives us the option of flipping our +/- axis polarity to match the cutting file should my hardware polarity be in error (note this gives a cheater way of mirroring our work in any of our axes, too.) The second signal from the parallel port is Step. This functionally acts as a clocking pulse for our counter. By choosing the the four flip-flop outputs to feed to the transistors, flipping the polarity with any of the XORs do not change the count state of the motor. As it is clocked and synchronous, a reversal can be set up without losing a single motor step. For noise, interface, and and static sensitivity reasons, I found myself changing the 24k pull-downs to 10k pull-ups and grounding the frame of the 25pin D-sub connector from the parallel port.

The TurboCNC software does allow you to choose whether the parallel port uses active-high or active-low signal polarities, but I've selected active low due to the hardware interface of the parallel port: Output signals are essentially open collector with a 4.7kohm pull-up resistance. You can short these to ground safely, but not to the plus-supply voltage. So, the only safe thing you can actively do to them is pull them down. The polarity switch, then, allows you to keep the parallel port's active-low polarity while still controlling it. I have (probably very foolishly) chosen very static-sensitive B-series CMOS chips for my interface. In order to at least keep the high-impedence inputs from floating around due to noise if you happen to disconnect the parallel port (which will cause the motors to chatter furiously), I have included some pull-up resistors. The connections to each motor phase is not shown properly as each motor is a little different and you will have to try different combinations until it steps. Note the D flip-flops are clocked on the positive-going edge. This is another reason for using active-low on the parallel port. TurboCNC holds the polarity after the first pulse in a given direction, but the first pulse may provide the direction at the same time causing a race condition. By waiting for the end of the pulse, we guarantee there will be sufficient set-up time for the Direction signal to establish itself, even at "0" pulse-width (the software allows a 0-32000µs pulse width adjustment range.) The MOSFETs can be any fairly low-channel-resistance device. If the ON resistance is low enough (less than around 0.1 Ohms), no heat-sinking will be necessary. With NE22 FETs, 3.6A causes them to run hot (due to the barely adequate 5V drive to the gates), but okay. The gate resistors provide a bit of isolation, and the diodes are for motor-regeneration currents (these can be common power diodes at low speeds).

Printed Circuit Board

Here is the PCB layout artwork for one axis . The input is the parallel/printer port connector and power supply, and the outputs are connectors which feed cables to each motor. The scaling is 600dpi.

Driver PCB Complete

Here is the the PCB-making process I used. The completed board for one axis is shown here. I have socketed the static-sensitive ICs and MOSFETs. The layout allowed for axial-lead diodes, but I found these two dual, fast-recovery diodes after the fact. While this allows a minimum footprint, if you expect any heat or vibration, you might not want to use these 0.1-inch-spaced snappable socket strips and choose to lay the MOSFET flat to the board.

Calibration & Testing

X-axisY-axisZ-axisA-axisC-axis
Motor makeDelta Precision MotorsDelta Precision MotorsDelta Precision MotorsNippon Pulse Motor Co.Sanyo Denki Co.
Motor model86SH-62B2B86SH-62B2B86SH-62B2BPJ5001W-17Step-Syn103-770-0119
Motor voltage2V2V2V1.425
Motor resistance (ohm)0.550.550.551.425
Motor current/ph used3A (70% of rated)3A (70% of rated)3A (70% of rated)1.5A (70% of rated)1A (rated)
Motor hold torq (oz-in)100
Motor step size1.8°/step (200 steps/rev)1.8°/step (200 steps/rev)1.8°/step (200 steps/rev)1.8°/step (200 steps/rev)1.8°/step (200 steps/rev)
Motor Thd/gear3/8-16 UN3/8-16 UN3/8-16 UN24 teeth12 teeth
Platform gear pitch3/8-16 UN3/8-16 UN3/8-16 UN.08" (108 teeth in 90°).02" (360 teeth)
Mechanical advantage16:116:116:118:130:1
Dist/Angle per step0.000313"0.000313"0.000313"0.1°0.06°
Backlash0.002"0.005"0.05°0.04°
Linearity0.002"/in0.003"/in0.05°0.04°
Position accuracy0.0100.0070.05°0.04°
Repeatability0.0030.05°0.04°
SquarenessXY = 0.2° XZ = 0.1° YZ < 0.05° XA < 0.05°
Motor start spd (pps)100100100100100
Motor acceleration400400400400400
Motor max speed (pps)400400400400400
Platform stall (lbs)306

Notes: The last inch before the limit switch at Y+ suffers from lost steps due to motor misalignment. Main portion of Y-axis had low enough friction to run at 800Hz, but not consistently toward the ends.

Software

I didn't expect to fully bridge the gap, but with much persistance I found more than enough tools for those of us on an extremely limited budget to actually do the job!

AutoDesk's dwg & dxf formats are the industry standard, and I found a utility from the OpenDWG Alliance to convert freely between AutoDesk's native dwg and their dxf file sharing formats. They have half-a-dozen other zip files containing info and utilities if you want to dig deeper: (1) dsniff checks the integrity of dwg files, (2) dump13 and (3) dumpa for dumping the contents of dwg files of version 13, and 12 and before, respectively, (4) dwgspec which is the Autocad R13/R14 DWG file structure, (5) toolkit is a reference manual to their product$ which allow you to write C & C++ code to create dwg and dxf files outside Autodesk (not a freebie, if I recall), and (6) viewkit is a reference manual to their product$ which is a vectorizer for dwg & dxf which sits on top of the toolkit.

To generate and import dxf files, I found SoftCad 1.16 Lite on the CADalog resource center, which allows you to construct, edit, import, and export DXF files, and also includes the TXT plain ASCII text format in case you need to reverse-engineer some data out of your files and write your own routines. Another nice little package is CadStandard Lite which can read and write dxf format. It has dimensioning, appears quite functional except for lack of shading, and for the low $25 fee you can get the Pro version which has all that and more.

Downstream, just before your hardware driver, is your software driver, admirably tackled by the shareware DOS program from DAK Engineering, TurboCNC, which handles up to 8 axes and accepts Gerber RS-274D files. As my 486-33 broke, I now use an old Toshiba T2100 monochrome laptop, dedicated to run TurboCNC under freeDOS. (I had to format my hard disk as TurboCNC could not seem to read files when I booted and ran it off the 3.5" diskette. Only about 700kB were used--pretty cool!)

To convert between dxf files and RS-274D (g-code cutting files) for use with the TurboCNC driver, there is the free ACE Converter in the CNC Pro Suite. (Say no in the CNCpro installation window and then say yes in the ACE converter installation window. The full CNCpro sounds like a nice package, if you can afford the $199). If ACE gives you problems, try the demo version of FlashCut. If you have a fancier driver and you need to move upstream with the RS-274D file to a Gerber RS-274X cutting file (a newer extension on the old standard G-code of RS-274D), there is the View Companion from Software Companions, for $49 (std versions). The $64 (pro) version allows document editing. This is not a trivial conversion, as implied cutting paths will not be explicit in the model. "Real" packages tend to start around $500 + $100/yr for "low cost". Note the View Companion RS274-D to -X conversion is unnecessary if you use the TurboCNC driver which takes 274D. Another nifty package is a cutting profiler which takes jpeg or bmp bitmap pictures and turns them directly into the G-code needed to make a relief cut, topographic map cut, printed circuit board, etc. It's not optimal as it scans in a plain grid pattern, but it works. Easy to use, too.

A couple of these packages were found through the PMDX resource list. Some other useful whitepapers include a 274X intro, Gerber basics, Gerber format.

To sum up, get these packages if you need to get started for free and pay very reasonable shareware donations down the road: (1) TurboCNC, (2)ACE converter, (3)freeDOS, (4)CadStandard Lite or SoftCad 1.16 Lite, (5)Profiler, and (6)DConvert. There are a quite a few others I found that need reviewing, but this will get you well-started.

There's actually a lot of other alternatives. If you want to play with every cool discovery in this arena I thought to bookmark, try this table:

Software
Srch pcwrld elepcb
CAD freecad 123D
*cadstd cycasL *pgsfL
tgrcad netview justcad
uprspc frefire rasvec
algolab eztrace vizup
20sim *blndrL *trbocd
gmax *eagle
CAM:? trbcnc *acecn
! tc wt ro pc ch dy m
dnc&ng scn2nc *profilr
*pcngv *atcdx *cncsim
*mshcm *wtopo @G
flshct
Elec liatro pcb123
srapcb 4pcb xprpcb
dryfilm *eagle
Prgmg freedos fdisk

Lessons Learned

It's certainly possible to build a CNC on the cheap, but it really helps if you know where the pitfalls are! I did okay in overall space design. The original three dimensions were okay, but I was seduced into adding the fourth and fifth even though the structure was unsuited for it. My original cutting motor was flat-out stupid. It should have been pulley-driven with a nice clean shaft with little runout. Hence, the bandage of using the Dremel tool. CNCs generate a lot of noise and the cable assembly doesn't do much to help this. Additionally, the cable assembly is expensive and time-consuming, as well as prone to failures if the strain relief is insufficient. While I may have done okay, only real testing will prove it. I was somewhat unprepared for the power supply requirements. I now understand (having been a rank beginner with CNCs) that current-sources are a much better approach. These still need to be designed and constructed. The ways and drive screws have too much friction and it was only by applying a good deal of lithium grease that I could get them to move at all. I had grossly underestimated what the motors' torque "looked like." A final point was the fact that rotational degrees of freedom are dependent on X, Y, and Z, and are not so standardized. Unless one is prepared to deal with tool offsets of this nature, one should stick with the three primary dimensions.

My feelings are that I should finish the CNC and play with it a bit. My gut feeling is the fourth and fifth dimensions will chatter far too much and will have to be locked-down or removed. The cutting tool will need replacement with a real one. After a bit, the cable assembly will give me no end of headaches. I think that I would ultimately like to replace it with a pulse-modulated communications link, possibly infrared but preferably modulating 48VDC at 3A on a pair of wires. Any failures, then, would be obvious as to cause and easily repaired. The current controllers will be small units mounted at each motor, taking in 48V and the communication. E-M noise should be reduced and there should be less noise susceptibility this way. Eventually, I would like to make another CNC and pay a bit more attention to the ways to keep the friction low (possibly even use real precision slides!) The overall accuracy needs careful consideration for your applications. Artistic wood carving is not a precision application, but circuit boards are. Yet, considerable accuracy can be sacrificed even for this if you consider that it can be limited to meet the needs of the largest component to be attached to the board (if you're mounting components by hand.) Except for the play in the latter dimensions, the basic accuracy and precision needs are mostly met.

Stay tuned for further developments...


Home Projects