DIY CNC Machine for Hobby Use

One of the coolest tools you can have as a DIY’er is without a doubt a CNC machine. Nowadays, you can even buy one for a relatively low sum in the form of a kit, straight from eBay/AliExpress. A few years ago, while I was still a student, I’ve decided to build one myself. I’ve decided against a kit for two main reasons. The first was the cost, at the time these kits weren’t as wide-spread and cheap as they are now, and I was concerned with cost. The second being the desire to do something of my own, and learn in the process. My aim was to build a machine that will be sufficient for my needs, which means engraving panels for my other projects, as well as some work on wood (MDF mostly).

Since this was meant to be a learning project, I didn’t jump straight into buying everything, but instead took it step by step. As a first step, I went to one of the local junk-yards and bought a couple of stepper motors, along with a disassembled industrial scanner. It was very cheap, and seemed like a solid base to modify for use as the X-axis of the machine. After taking it apart for some well needed cleaning, and putting it back together it actually looked in good condition. It uses a belt to drive the frame, coupled to a Lin Eng. stepper with a 90degree gear-box. The belt is reinforced with some steel wires, so it seemed like it will suffice for my limited needs.

Fig. 1. X-axis Frame (upside down) from an Industrial Scanner

To start off with the other side of the project, the electronics, I’ve used one of the extra stepper motors I’ve purchased and assembled a driver for it. The driver was based on the L297/L298 combo, which are quite outdated by now. My main interest was to build one of these myself, to learn from doing it, and to get a better feeling of how fast it can operate the motor, and how much current (torque) I will need to aim for.  Nowadays I’d be ashamed of assembling something so rough as this board, but at the time it was an easy and cheap enough solution, and it worked quite well.

Fig. 2. L297/8 Based Driver Board

After using these to get a feeling about the requirements, I’ve started planning my next steps. As far as electronics go, I’ve designed a better driver board with some more modern IC’s. However, when I’ve started estimating cost, I arrived at the conclusion it will be cheaper to but readily available Chinese driver boards from eBay than building my own board using similar IC’s.  So I went with the cheaper option and ordered 3 TB6560 based drivers, as well as an LPT breakout board.

As for machine control, I was originally playing around with the idea of writing something of my own and controlling it with something like an Arduino Mega. However, after searching the web, I was very impressed with LinuxCNC (a.k.a. EMC2), and decided to stick with this one. This obviously meant getting a computer with an LPT port. Lucky for me I’ve had an older HP laptop in storage, and it had an LPT port (yes, it was that old). It was more then sufficient for playing around, but the jitter was quite terrible (tested from within LinuxCNC). Therefore I kept on looking for a better suited desktop computer for this task. After trying a few computers, including a few brand PC’s, the lower jitter was achieved on an older (no-brand) Pentium 4 machine. I’ve removed the high performance graphics card, disabled hyper-threading, and was able to get very low jitter numbers. This very same PC is still used as the machine controlling to this day, its simply the best match for this application.

Next was to plan and start making the parts for the machine itself. Some parts such as the lead-screw or Z-axis, and some of the smaller parts I’ve ordered from eBay. Most of the larger parts I’ve had to make locally. After planning it all on a piece of paper I went to a local workshop and ordered the aluminium parts. I’ve had them cut to shape since I didn’t have the tools to do this myself. However, drilling/tapping/assembly was something I could do myself. You can see some of the steps in the following pictures.

Fig. 3. Assembling Side Walls for Measuring Y-axis
Fig. 4. Z-axis Partial Assembly
Fig. 5. Z-axis Further Assembly
Fig. 6. First Assembly – Front
Fig. 7. First Assembly – Back

There is obviously a need for a work platform to which I could mount the piece that I will be working on. In an effort to minimize cost, I’ve assembled this from pieces of MDF.

Fig. 8. MDF Work Table with Mounting Rails

I’ve made a decision to use one of my available tools as the spindle, again, for cost reduction. There were 2 possible candidates, a Dremel (125W model), or a Ryobi trimmer (TR-50A). The Ryobi is much stronger, so might seem like the better candidate. However, it is so loud, that operating it inside the house is simply not an option. Because of this the Dremel was chosen. I’ve created a very rough MDF piece to mount the Dremel to the machine, which I would later use to create a mount with a better fit to the Dremel.

I’ve connected everything together, powered it all for a 24V lab power-supply, and starting playing around with it just to check what the abilities are, at least as far as resolution was concerned. One of these is the famous horse shape I’ve seen some other people use for similar tests.

Fig. 9. One of the First Experiments with the CNC Machine

I was a bit disappointed to find out there were some problems with the low-cost electronics which caused incorrect movement at time. Trying to complete a long job seemed like it was impossible. This took quite a bit of work to find the source of the problem, during which I’ve modified the driver boards to solve the problem.

First thing that bothered me was the fact the driver boards didn’t follow the correct sequence of power-up/down. Therefore I’ve stripped them of the included 5V regulator, and designed a small PCB that will take care of the proper operation. It will first create the 5V logic supply, and only then power up the higher voltage rail. On power down the bulk capacitor, C1, will hold the 5V rail active for a while longer after the 12V rail falls. The simplified schematic is included below. The assembled board is slightly modified compared to the simplified schematic, to limit the inrush current from the power-supply at power-up, to prevent it from going into protection mode. All 12V supplies can be tied together, and can actually be higher than 12V, as long as the relays are chosen accordingly. E-stop is an optional emergency switch that will cut the high voltage rail to the drivers in case they have to be stopped in a hurry.

Fig. 10. Start-Up/Power-Down Sequence Control Circuit

This, along with some additional decoupling caps, as well as a few other small modification seemed to do the trick, and problems went away. I’ve also chosen to replace the lab power supply which I needed elsewhere with a modified PC power-supply, therefore the use of 12V rails. This was sufficient for my needs, as I wasn’t after extreme speed anyway.  All the boards were mounted to a piece of MDF along with a larger aluminium heat-sink to cool all the driver IC’s.

Fig. 11. LPT BoB, Motor Drivers, and Supply Control Board

This was the state the machine remained in for quite some time, and I have used it to create quite a few parts. Including aluminium panels for my electronics projects. These include the M³ headphone amplifier I’ve shared in the blog, as well other projects, such as the γ2 DAC seen below (yes, I have replaced these ugly screws).

Fig. 12. Aluminium Panel Made with the CNC Machine

The machine did undergo a few modifications over the years. These slightly modified electronics,such as extra Arduino board which was meant to enable operating the CNC machine as a 3D printer. This was done by adding a small breakout board to the RAMPS board of the printer controller to send logical signals to the existing motor drivers. I’ve even made a replaced Z-axis mount with the heated extruder for the printer, and replaced the power-supply for a more powerful one to support the extra heaters power.

Fig. 13. Modified Electronics
Fig. 14. Extruder Mounting – Partially Assembled

I have eventually decided against using this machine as a 3D printer. While I was able to print a few basic shapes, it was too time consuming to get it properly calibrated. This was a problem because it was meant to be something that could be changed between printer/CNC modes quickly, which is impossible if calibration is needed every time. Additionally, the high moving mass of the CNC means the acceleration is simply not nearly as fast as small, lightweight printers can achieve, resulting in slower print.

Other than these changes I’ve also modified the CNC  part of the machine. This included replacing the Dremel (which has failed after a few years) with a stronger 500W spindle with variable speed control. It is air-cooled and fairly cheap nowadays, so it was an easy replacement for the broken Dremel. Additionally, I’ve replaced the stepper motors of the Y/Z-axis for better motors sold by Lin Eng., same as the X-axis motor. This has without a doubt improved the speed and torque of the machine. A more up-to-date picture of the whole machine can be seen below. The motor cables use GX16 connectors, so that the machine can be separated from the controlling electronics placed below it next to the controlling PC.

Fig. 15. Final State of the DIY CNC Machine

I might edit this post in the future with a bit more information on the software side of things, based on my limited experience with design and machine control software. I will note that the machine control in my case is still done by LinuxCNC. Its a very capable (and free) tool, which can do much more than I’m asking of it. However, its very easy to learn and use, and I see no reason to replace it. For these of you who don’t want to use a PC for this job, there are other options such as GRBL using a simple Arduino board.

Leave a Reply

Your email address will not be published. Required fields are marked *