In this video, I'm going to finish a project that has sat in my office, unfinished, since
2011: my desktop CNC machine.
A CNC machine is a tool that can automatically cut a design out of material like wood or
metal.
The design begins on a computer and is converted into machine instructions called gcode.
The CNC machine will read the gcode one line at a time and remove material until the design
has been completely cut out of the material.
A CNC machine is made up of several parts.
The part that actually does the cutting is called an end mill.
An end mill is similar to a drill bit.
The difference is that after an end mill has been plunged into the stock material, it can
be moved around side to side and it will still cut material away.
The end mill is inserted into the spindle motor which rotates it at a controlled speed.
This subassembly which I’ll refer to as “the cutting tool” is attached to a mechanical
frame.
The frame is built with gantries that allow the cutting tool to move in the X, Y, and
Z axes.
That movement is achieved by attaching stepper motors to belts, pulleys, and lead screws.
Stepper motors are ideal for this application because of their precision, but they require
special electronic drivers that energize their coils in a specific sequence.
In the past it was common to use a computer with a parallel port to talk to the stepper
motor drivers, but nowadays microcontrollers with a UART connection are becoming more popular.
For my CNC machine I'm using an Arduino compatible board running special firmware called GRBL.
The gcode instructions are sent to the arduino by a computer, and the GRBL firmware interprets
that gcode and sends the step pulses and direction signals to the stepper motor drivers.
Lastly, most CNC machines have input switches that send feedback from the machine.
For example my machine has limit switches that close when the machine reaches the end
of its range.
This prevents the machine from moving beyond its physical limits and causing damage.
If you want to know more about my CNC machine, I've written a detailed project post about
it on my website so feel free to check that out.
A link will be provided in the description.
This project has been on my list far too long, and it's time to finish it up!
Before I can check the box next to this project I want to complete four specific things.
First, I want to put in a proper power supply.
Right now I'm using a power supply from a desktop computer, and I want to use a supply
made for this application.
Second, I want to wire up the start, stop, and pause buttons.
I've already mounted these buttons, but they're not hooked up to anything.
These buttons make it easier to physically interact with the CNC machine instead of using
the software.
Third, I want to work on cable management so that there aren't wires going all over
the place.
Finally I want to upgrade the spindle.
I'm going to swap out the dremel rotary tool I’ve been using for a 400W brushless DC
spindle.
Banggood.com was kind enough to send me one to use in this project.
Once I get these things done, I want to fire it up and give you a demonstration of what
this machine can do!
Before I get started on my list I want to modify the base of the CNC machine.
As you can see here I've built a plywood enclosure that has a hinge on one side.
The idea was be able to lift up the machine to access the storage area underneath and
put electronics in there.
I've decided I don't like this design, so I removed the hinge and cut the box in half
on my table saw.
I think this shorter box enclosure will fit my needs better.
Now I’m ready to upgrade the power supply.
First I removed the old computer supply, and put in two new supplies.
The one on the left is a 24V 360W supply for the stepper motors.
The one on the right is a 48V 480W supply for the brushless DC spindle.
I installed an IEC connector that is equipped with a switch and a fuse.
This makes it easy to turn on/off everything with one switch.
The fuse adds an extra layer of safety should anything go wrong.
Once I got the AC side wired up, I plugged everything in and powered it up.
I adjusted the knob on the spindle supply until I measured 48V on the output.
Next it was time to wire the 24V terminals to the stepper motor drivers.
I used spade terminals on all the wires to ensure reliability.
You can insert stranded wire directly into these screw terminals, but I wouldn't recommend
it.
Here's how things looked after getting these wired up.
I had these three arcade style buttons lying around so I used them for the start, stop,
and pause buttons.
I need to wire them up to the arduino board using some shielded cable with twisted pairs.
In a minute I’ll talk about why I chose shielded wire for these switches.
I stripped the ends of the wire, tinned them, and soldered them to the switches.
I covered the joints with heat shrink tubing and aimed my heat gun at them.
The next step was to wire them to the arduino.
Up until this point I had been using an arduino nano breakout board with screw terminals to
make all the connections.
The screw terminals were oversized for the gauge of wire I was using and they kept coming
out, so I ended up ditching the breakout board, and just soldering the wires directly to the
arduino.
This is the permanent home for this arduino board so I’m not worried about soldering
everything permanently.
This left me with no way to mount the arduino board to the plywood box.
So I jumped into fusion 360, designed a mount, and printed it out on my 3D printer.
Did I mention I love having a 3D printer for things like this?
Here’s what the wiring looked like at this point.
The most time consuming part of this whole project was cable management.
Up until this point I had stepper motor and limit switch wires going all over the place.
The motors and power supplies in this machine can create quite a bit of electromagnetic
noise that can interfere with other parts of the system.
The first thing I needed to do was remove the old wiring and replace it with new shielded
wiring.
The reason I went with shielded cables this time around was to reduce the effect of the
electromagnetic noise being emitted by the stepper motors and power supplies.
The problem was so bad before that it was causing noise on the limit switch wires and
I was actually getting false positive readings even though the switches weren’t being closed.
Using shielded wires and connecting the shielding to ground significantly reduces the noise
on these wires and pretty much eliminated the false positive limit switch alarms I was
seeing.
Now that the wiring was complete it was time to get them under control.
I ordered some drag chain that solves this issue beautifully . I needed a way to mount
the drag chain to the frame so I modeled some parts in fusion 360 and printed them out.
I routed all of the wires through the drag chain.
The last step was to put connectors on everything.
I chose 6 pin DIN connectors for all the motor wiring and limit switches.
The last step for completing my CNC machine was to upgrade the spindle.
I was using a dremel rotary tool before which works, but is not the ideal tool for this
job.
I also think that the dremel was contributing to the EMI issue I was having.
I asked my friend Dan who is an expert on CNC machines what I could do about this problem,
and he recommended that I get a brushless DC spindle.
A couple of months ago Banggood.com reached out to me and asked how they could support
my channel.
I asked them to send me a 400W brushless DC spindle like Dan had recommended.
They were incredibly supportive and sent this one to me.
I told them I would test it out and give an honest review of the product.
I will leave a link in the description where you can buy one of these.
I asked Dan to help me make a mounting adapter for this spindle.
He was extremely helpful and generous with his time, so thank you Dan!
This mount fits the slots in the Z axis aluminum extrusion.
When I went to bolt the spindle to the mount, I notice that the pre drilled holes on the
Banggood spindle mount weren’t aligned very well.
I think that I may have just been unlucky with the one I was sent.
We were able to make the holes a little larger with a file and get things to fit.
Other than that, I’m very happy with this spindle.
It takes an input voltage between 20-50V DC.
It has one switch to turn the spindle on/off, one switch to change between clockwise and
counterclockwise rotation, and a potentiometer to control the speed.
I had no trouble connecting this up to the power supply I bought, and getting it up and
running.
One other complaint I have about the spindle driver is that it has a 10V analog input pin
to control the speed.
On the other hand the arduino I’m using for my controller will only output a 5V digital
PWM signal.
I’m not able to connect the Arduino output directly to the spindle driver.
I will have to convert the 5V PWM signal into a 10V analog voltage.
Not a huge deal, but it would have been nice to have had the option to connect it directly.
Even though I had the problem with the crooked holes and the spindle control signal, I would
still recommend this spindle if you are going to build a CNC machine.
Again, a big thanks to Banggood.com for supporting this video.
I think that’s everything on my list.
This machine is far from being complete, but I think it’s at a point where I can start
using it.
I wanted to run a test cut, so I loaded my byte sized logo into the controller software.
The blue tool path is where the end mill will cut the logo into the wood.
I put a scrap piece of pine 1x6 and secured it with tape.
I lowered the endmill down to the corner of the wood and started the job on the computer.
I was super excited to watch this thing spring to life.
I have been working on this project for many years to get to this point and it was very
rewarding to see it come to fruition.
I sanded the finished logo and applied some walnut colored stain.
This should give you an idea of what a small CNC machine could be used for.
I didn’t build this machine so I could cut out simple logos in wood.
With the right end mills you can cut complex 3D shapes out of wood, metal, foam, and plastic.
There are many projects that suddenly become possible by having a machine like this.
I originally wanted to build this so I could mill my own circuit boards.
I pulled up a design I’ve been working on and used some software to create the tool
path for milling out the copper traces on the circuit board.
I loaded the copper clad into the work area and secured it down with some double sided
tape.
I drilled the through holes with a 1.2mm drill bit.
Then I swapped that out for a 30 degree engraving V bit.
This was my first time going through this process, so I didn’t have high expectations.
This first attempt didn’t turn out very good, but you get the idea.
I know it will take some trial and error to get the right cutting depth for the V bit.
I also need to make sure I have a flat work surface so that the V bit is evenly cutting
across the surface of the copper clad.
I’m so happy to have finally finished (air quotes) this project.
Like I said, I have been working on this since 2011.
I think this was a great machine to start with because of its size.
However I know that I will soon grow beyond its work area of about 6” x 6”.
I already have plans for a larger machine with a work area of 1m x 1m that will allow
me to build larger projects.
I think that’s it for this video.
I’ve posted a couple of other videos here that I think you might like.
I make a lot of other project videos like this on my channel.
If that’s something you’re into, subscribing to byte sized will help YouTube’s algorithm
find and suggest more videos like this for you to watch.
Thanks for watching, and I’ll see you next time.