|
|
Power Supply.
Disclaimer......
Powersupplies for CNC tables contain high voltage and can be dangerous if not constructed carefully. The details show here is for your information only and does not take into account your local voltage or safety requirements. I have no control over your skills as an electrician and therefore offer no guarantee of safely. I recommend ......
- If in doubt you contact a qualified electrician to check your wiring before applying power.
- Keep children and pets away from exposed power supply components.
- Follow your local rules and regulations for main voltage wiring.
- BE CAREFUL. Think twice. Keep one hand behind your back when testing.
Stepper motors need a good meaty power supply capable of supplying several amps. My original supply was a transformer from a discarded UPS. UPS's are a great source of power supply electronics, they usually contain a rugged transformer and some heavy duty power mosfets. Although the transformers in these UPS are designed to run in step up mode ( 12 volts to 330 volts as an example ), they will run the other way around as a step down transformer. I had a transformer from a 24v UPS, and when I connected this back to front and fed 240VAC into the secondary, I had 16VAC on the secondary. After connecting a full wave rectifier and filter capacitor I ended up with about 22VDC. This power supply could supply several amps and it did work ok considering it cost very little to make, mostly spare parts from the jump pile. If I were to build another powersupply based around a transformer, I would spend the money and buy a good toriod transformer, they run cooler and are more efficient.
You can pick up a new cheap battery charger for under $40, and they come with a transformer capable of up to 5 amps. For safety add a double pole single throw switch ( DPST) and fuse. The capacitors should be rated at twice the output voltage. To work out DC out from AC in, based on a full wave rectifier, you multiply the AC voltage by 1.4 to get the DC voltage, ie 16vac times 1.4 equals 22.4vdc.
While my 22vdc supply worked, I knew I needed a higher voltage to get the most out of my stepper motors. The higher the voltage the better, so long as its within the capabilities of the stepper controllers. My stepper controllers had a maximum rated voltage of 24VDC, so I really needed a power supply capable of supplying close to 24VDC at several amps. Unfortunately I didn't have any power transformers in this range, so I looked at another option, PC Power Supplies ( or PS for short ).
The humble old PC PS is a great little bugger. They are tough, in that they can supply lots of amps with short circuit protection, they have their own cooling fan, and are dirt cheap for what they are. There are two main types of PC power supply, the AT and ATX. The older AT supply used a true power switch, the ATX used a power soft-start provided by the PC's mother board and used a different motherboard connector. You can use either type for your CNC project, but you need to make a small modification to fool the PS's into thinking they are powering a PC.
|
AT Modification. Connect a 47ohm 1 watt resistor across the 5VDC output ( Red and Black Wires ). This provides a small load to the power supply to make it operate correctly.
ATX Modification. As well as the 47ohm resistor across the 5VDC output, you need to fool the soft start function into turning on the power supply. To do this, connect pin14 and pin15 together on the mainboard connector.
I had a couple of the older AT type PS's, these could supply 8 amps on their 12VDC output. If I connected these two PS's in series, by connecting the yellow wire from the first PS to the black lead of the 2nd PS, I would have 24VDC at 8 amps. But before we get carried away connecing power supplies in series, we need to make one important modification.
The 0 volts ( black wire ) on these PC PS's is connected the the metal case, its earthed as it were. This is fine for a single power supply in a PC, but if we want to connect PS's in series we need to isolate the metal case from the 0 volt wire. If we dont, and the metal cases touch, then we will be shorting out one powersupply and it will shut down ( or may be damaged ). Even if we manage to keep the metal cases isolated, the 240VAC power lead will still earth out both cases. Now dont go disconnecting the mains lead earth pin, thats not only illegal but dangerous. Instead we just need to isolate the 0 volt lead in the 2nd power supply. The physical connection is usually under one of the screw that holds the PS circuit board in place. You could either cut the copper track leading to this pad, to use a insulated washer under the pad and leave the screw out. Either way, make sure you test there is no electrical connection between the black wires and the PS's metal case with an ohm meter
Final note, the Kill Switch, or E-Stop. Every CNC table should have a kill switch of some shape or size. Basically, the kill switch is a easy to access, press to dissconnect switch that will remove all power from the machine.
Interface Circuit . Most of the hobby CNC software and stepper controllers use the PC's parallel port to send the signals back and forth. Depending on the software, the parallel port has 10 or more pins we can use to interface with out CNC table. In a stepper motor based table, each axis needs at least 2 pins, one for step direction and the other for step increment. So for a 3 axis machine we really only need 6 pins in out parallel port. We can use other pins to switch relays on and off, say for example spindle motor or coolant pump. A note about the PC parallel port. There are a few ports on the back of a computer that should never be plugged or unplugged while the computer is running. These include the parallel port, AT or PS2 keyboard/mouse port, and any SCSI ports. |
NEVER plug or unplug the parallel port while either the PC or CNC table interface circuits are powered up. Always make sure the PC and CNC electronics are tuned off when you plug or unplug the parallel port, or you will damage your computer. Trust me, I've seen it happen several times, once in a laptop that needed to have the mainboard replaced as a result, very expensive.
Below is the first circuit I put together for my CNC router. The opto couplers are there to protect my Printer Port, see above. The relay is used to switch the router head off and on, and uses a simple MOSFET driver circuit. The MOSFET shown was pulled from a dead computer UPS, UPS's, like most PC hardware, are great for spare parts. At first I used K179 and then KT-5191 stepper drivers ( see next page ), these stepper controllers need a logic high to switch, and this is supplied by the opto isolator outputs.
Later I moved to a microstepper controller for my stepper motors, and these needed a sink input to switch, ie the input needed to be switched to ground, so I had to redesign the opto driver part of the circuit. More information on the microsteppers is on the next page.
To add in the near future....
Stepper Drivers.
| The first stepper driver I used were "Single Step" drivers bought from Oatley Electronics. The K179 comes in kit form, very cheap and works fine for small stepper motors. To get the best results, the K179 should be used with a constant current source, and fortunately Oatley also sell a constant current supply in kit form. | ![]() |
![]() | The K142C constant current driver kit includes a fan cooled heat sink and easy current adjustment. I ended up building my own constant current supplies from scratch, but for under $30 each these K142C kits would make life a lot easier. |
|

Transformer based power supply, with three K179 controllers and home made K142C current regulators
The K179 is what we call a single step controller. While a single step controller is fine for small stepper motors, if you want to get more speed and smoother operation, you need to invest in a half step or micro stepper controller.

I found my stepper motors would work fine at low speed, but became unresponsive at higher step speeds. To get more speed, I needed to spend more money.
Along with some larger stepper motors, I bought a couple of half step controllers from Ocean Controls, the KT-5191. The KT-5191 has half step stepping, and built in PWM current limiting. So a single KT-5191 would replace the K179 and K142C boards. Half Step stepping made a big difference to my CNC table. Motor movement was much smoother and quieter. | ![]() |
![]() | The next step was microstepping. I had read about microsteppers, but they were priced out of my range, usually several hundred dollars or more per axis. One day while I was browsing the Ocean Controls web site, I discovered their new range of cheap microsteppers. The SMC-002 M325 was the cheapest at only $99+gst. The M325 has inbuilt current limiting up to 2.5 amps, up to 8 steps of microstepping, and would run at up to 32volts. |
|

When this photo was takes I was running the two AT power supplies, two M325 microsteppers ( X, Y axis ) and one KT-5191 ( Z axis ).
............................................
Stepper Motors.
| The first stepper motors I used were sourced from old dot matrix printers. A little small for my machine, but they did work. Slightly bigger steppers can be found in laser printers and photo copiers. It really depends on the size of the machine you want to build, the type of work it does, and your budget. I wanted a good sized workshop router, so I needed to spend some money and buy bigger stepper motors than those I found in the junk pile. | ![]() |
![]() | While I was browsing the Ocean Controls web site looking for stepper controllers, I stumbled across their range of heavy duty stepper motors. Now these are serious stepper motors, and at good prices. I ended up using two MO-103 23HD803 steppers for the Z and Y Axis, and a big MO-104 34HD101 stepper for the X axis. The MO-103 is rated at 0.6 amps with a holding torque of 1.6Nm, and the MO-104 is rated at 2 amps with 4.1Nm holding torque. |
| The Ocean Controls catalog is growing all the time, and since I bought my stepper motors they have added more motors to their range, such as the new MO-105 motor.In the photos below you can see the X axis stepper motor from the early days, and later with the big MO-104 stepper, a big difference. | ![]() |
![]() My X Axis drive. Originally I used a stepper motor from a old dot matrix printer. It worked, max speed was 200mm/min. | ![]() Same machine, MO-104 stepper, and over 1000mm/min improvement. |
Linear Bearings .
Commercial CNC machines use precision ground linear bearings. These are expensive. Too expensive! A meter of 25mm linear rail can cost several hundred dollars. I myself dont see where the cost is, but anyway.
That said, if you intend to build a machine for precision routing of aluminum or other dense material, then you will need to use precision ground linear bearings. They offer smooth movement with very little side movement. But if your building a CNC table for wood routing, or a plasma/oxy cutter, then home made linear rails will work fine.
My first CNC table used linear bearings from an old Telix machine ( similar to a dot matrix printer ) for the Z axis. These linear bearings had reciprocating balls and suited a shaft of 12mm. Modern printers tend to use brass or bronze bushes instead of bearings, but these could still be used so long as you keep them oiled.

My I made most of my linear bearings from roller skate bearings and RHS or SHS ( Box section tubing ). It works, and its cheap.



The important thing is to have some way to adjust out any slack or play in the rails. My bearings are bolted to the axis on elongated slots. The slots mean I can loosen off the retaining nuts and move the bearing closer to the rail. Its a bit fiddly at first, but once adjusted it tends to stay that way, and I ended up with a machine with very little sideways play in each axis.
Another linear bearing option is nylon or brass sliders. Nylon, or HDPE, has a waxy finish and can be easily shaped into sliders. Like brass or bronze, a nylon slider will need to be kept lubricated to work properly, and there is more friction than true bearings, but it can work.
------------------
Drive.
There are several different ways to move the CNC axis. Most commercial machines use a leadscrew or rack and pinion drives. Also used are chain and wire drives, but these are not as accurate. More recently linear drives have started to appear. The linear drive combines a servo motor and drive system in one, its like a motor that been laid out flat, with the electrical stator running the full length of the CNC axis, and the armature attached to the axis to move. All-thread, or threaded rod, is the cheapest way to build a drive system for your cnc router. My first build used 12mm all thread, which comes in lengths of 2 meters ( 6 feet ) and has a pitch ( distanced traveled per revolution ) of 1.5mm. The all-thread is secured in bearings at each end of my axis, driven at one end by a stepper motor, and a nut running along the threads length is attached to the axis I want to more. Dont be tempted to go too big in thread diameter, remember the drive thread acts like a flywheel, so any change in direction or speed means more work for the stepper motors if you choose a larger thread. |
Backlash. Backlash is the sideways movement in the nut along the thread, the "slop", and its a problem. You want to remove as much backlash as possible, without increasing friction too much. There are a few ways to do this, one way is to cut the nut half way through, and then squash it down onto the thread to take up the backlash, another way I used is two nuts on the same thread, one nut adjusted slightly away from the other untill the backlash is reduced without creating too much friction. | ![]() |

I later changed the all-thread for Acme thread. Acme thread has a much higher pitch, 3.5mm in my case, so this means the axis will travel 3.5mm per revolution. When I was running the 1.5mm pitch all-thread, my stepper motors were running at their maximum speed, so by going to the 3.5mm pitch Acme thread I could expect to at least double the axis speed. I bought my acme thread fromUnited Fasteners in 6 foot lengths for about $50 per length, cheap enough. The problem was the nuts that came with the thread were rubbish! About 1mm of backlash and poor finish on the thread, so I had to make my own nuts.
I has some scrap HDPE ( you can use those plastic kitchen cutting boards, same sort of stuff. ), 12mm thick. When heated HDPE turns into a clear slimey liquid, can be shaped, and then cooled to retain the shape. I cut some blocks as shown, the center hole is slightly smaller than the Acme threads inside diameter. This block was then wrapped around a scrap length of the Acme thread. Using a gas blowtorch, I heated the Acme thread about 2 inches away from my HDPE block. As the thread heated up, the HDPE started melting into the thread. Using a big pair of multigrips, I squashed the block down untill I felt the HDPE had fully melted into the thread, then been carefull to hold everything nice and square, I dunked the whole thing into a bucket of cold water until the Acme thread had cooled. Its then just a case of un-winding the newly formed nut, seperating the two halves and cleaning up the edges with a file and sharp knife. The first few didn't work too well, it takes a bit of practice to get it right. The result is a HDPE nut with no backlash ( the top self tapping screws adjust the backlash ).

I use chain and sprockets for the connection between stepper motor and drive thread, but I could have also used toothed belts or direct drive, so why chain?
Chain has a few advantages for the hobby CNC machine. First up, its cheap, the chain I use has a 1/4 inch pitch, and comes in length of 10 feet for about $30. The sprockets to match are about $5 for the smallest 11 tooth, to $15 for a 22 tooth from memory.
2nd advantage is its very easy to change drive ratio. I can swap sprockets to play around with the axis speed and torque, and its easy to shorten or lengthen the chain with connecting links.
The last big advantage for me is chain has a tollerance of incorrectly lined up sprockets. My stepper motor may not be in perfect alignment with the drive thread, but the chain drive will still work OK.
Dissadvantages? Chains need a drop of oil occasionally, they need to be kept clean, and they can be noisy. Idealy, now that I have set up the machine with the optimum drive ratio's, I should replace the chain and sprockets with a toothed beld setup.
Direct drive coupling is best, if you can run a 1:1 drive ratio. The coupling needs to allow for missalignment between the stepper motor and drive shaft, and this can get a little tricky, but once set up a direct drive will be reliable and quiet.
To add in the near future...
CNC Router Head .
My first cnc router head was the milling attachment from my hobby lathe. It was heavy, but has variable speed and a good sized chuck. This got me started, but as I soon discovered, the spindle speed was too slow for timber routing. My spindle had a maximum speed or 2500RPM, but as I found out after visiting CNCZone.com, I needed a spindle speed 10 times that.
I visited the local hardware store and picked up a plunge router for only $50! Variable speed, cheap with a 1/4 chuck. A bracket was made and the new router put into service. Big improvement.
I wanted to try fine engraving, so modifed a small drill chuck from a dead battery drill to fit the 1/4 router. The drill chuck takes the engraving tps, but as I soon discovered the router itself didnt spin true.
So I visited my local ardware store again and picked up a cheap engraver. I made an adapter to take the engraver, it bolts on next to the routing head. The new adapter also doubles as the vacuume nozzle when I'm not engraving. Unfortunately, I discovered the new engraving tool was also not true, with about 0.25mm wobble.
The moral or the story, dont buy a cheap router heard or engraving tool if you want to do fine machining.

Both the router head and engraver fit side by side, the engraver lower than the router, so I can leave the router attached when I'm using the engraver.

When I'm using the router, I take off the engraver and fit a vacuume pickup to such up all the dust.
-------------------
Software.
There are several software steps in using a CNC router, CAD, CAM and CNC. CAD is where you "draw" the part you want to route on your CNC router. CAM takes the CAD information and creates a series of instruction the CNC software can understand, and the CNC software converts the CAM code into motion.
Some software packages can do 2 or even all 3 of the above operations. For CAD I use a package called Profiler. Profiler is a CAD, CAM and CNC package, it can be used to draw the part, ready the file and process the file on the CNC machine. However Profiler is no longer supported as far as I can tell, I've tried to contact the software authors with no luck.
Another good CAD package, again free, is A9Cad from A9Tech. A9Cad is a Autocad like program and the standard version is a free download.
A neat CAM program to appear recently is CamBam. CamBan is a basic CAD CAM package, wth some very cool features. It can perform a range of router CAM functions, like pocketing or engraving, and has a few neat functions like BMP to NC. Currently its free, and I hightly recommend it.
The first program I used to drive my CNC table was KCam from Kellyware. KCam is a easy to use CNC program, for stepper motors using the parallel port, or more recently with a special interface board, the serial port. KCam reads in your NC code, or it can inport a DXF or other file formats and convert these to NC itself. KCam is under constant development and its getting better all the time. The new serial interface board is called Max Stepper, and gives a big improvement in stepper performance. To get started I recommend KCam as a good MS Windows based CNC software package. Its free to download and works for 1 month, after which it goes into demo mode with restriction on the size of NC files you can run. To unlock the software just visit the Kellyware site and purchase a registration.
Mach2. I've never used Mach2, but from the reviews I've seen its the most popular Windows based CNC software on the market for the hobbiest.
Recently I've started to use EMC2. EMC2 is a linux based CNC software package, and its lightning fast! EMC2 runs on Unbuntu, a very user friendly version of Linux. To get going, you can download a CD image ( yep its a big download at over 600kb ), and use this to install Ubuntu and EMC2 on a reasonably fast computer. It needs a bit of ram, at least 500Mb, and a HD with 4Gb or more. The installation is painless, Unbuntu is a good system, and once going it runs very smooth. It even detected my memory key I use to transfer NC files, like I said, painless. The CNC program EMC2 is run from a desktop icon, but this isnt so user friendly compared to the Windows CNC programs above. Setup involves editing text files, and EMC itself is a very basic looking program with only basic functions on the user interface. But that said, its very fast, smooth, and powerfull once you start to learn about the inbuilt systems, like HAL and Ladder Logic. EMC2 would be at home running your hobby cnc engraver, or a full size industrial plasma cutter.
To add in the near future...
