operate

Ben Heck’s CNC Router Tutorial



Sharing buttons:

the Ben Heck show is brought to you by

element14 the electronic design

community where you can connect and

collaborate with top engineers from

around the world join now at

element14.com hello and welcome back to

the Ben Heck show we've had a lot of

requests lately for us to talk about CNC

machines so I thought that'd be a good

topic for this episode now a CNC machine

is a computer numerical controlled

machine granted a paper printer or a 3d

printer or even a modern washing machine

is controlled by a computer but CNC

usually means machines that have a bit

that Mills material out of a stock those

machines will have an XY Cartesian

system with a zero-zero home basically

you'll move the head over to zero zero

and all of your designs will go from

that point inside of a bounding box of

some kind so XY much like a 3d printer

then on the arm there'll be a motor or a

spindle on the z-axis which means it

goes up and down with a cutting tool and

that's what will actually cut into the

material creating your shape

it's a subtractive method of creation

which means it's removing material

subtracting it from stock in order to

create what you want this is in contrast

to a 3d printer which is an additive

process that's adding material to a base

to create an object the advantage there

is you don't have to add all the

material for something large like a desk

you only remove the parts you need to

reveal the pieces cncs are good for

larger objects as I just mentioned

things that need to be stronger you know

you can cut things out of wood plastics

metal whatever you want rarely as long

as you're conservative with your bit

speeds the build times are faster you

know just making one cut to remove a big

piece it's a lot faster than trying to

3d print all the layers of a big piece

and you can also do PCB milling with it

you can take a blank copper piece put it

in a CNC machine use a V bit and trace

out the circuits that you want to make

for today's example we're going to be

using a shape okuu which is an

affordable Desktop CNC machine will

create an object to make with the

machine go over all the parts of the

machine turn that object into g code and

then cut it out let's get started

amazing hacks how can we make this

portable inspire designs I am the

internet troll regrettable acting each

week element 14s the Ben Heck show

brings you innovative projects using

electronics engineering and more let's

go over the parts of a standard CNC

milling system first we have a power

supply this is a 24 volt switching power

supply 24 volts is the voltage used for

the stepper motors and that voltage is

knocked down for the driver board which

is this right here it has a

microcontroller on it a bunch of

input/output a USB connection and these

four plugs are for the four stepper

motors so we have actually two Wyatt

motors that way it's basically easier to

and cheaper to put a motor on each side

and drive them at the same time than to

try to make a linkage for a single motor

yeah so we have all this poured it out

nicely to some plugs in the case here

and they're nicely labeled so we know

where everything goes

there are also some plugs for limit

switches we may not have to use limit

switches on this machine but what a

limit switch does is when the machine

homes it'll go all the way one way click

oh that's my limit all the way another

way click that's my limit oh now I'm

home so we can hook those up here if we

want one thing of note is you don't want

to move the head manually very fast if

the machine isn't on because you're

actually generating current in the

motors and that current will be fed back

into the system which it's not what I

supposed to be so always if you have to

move it manually always move it slowly

and if you're transporting it in a car

make sure that you have everything inert

otherwise like if you take a turn and

this goes room right you could send too

much current back and destroy one of

integrated circuits those are the kind

of things you need to think about when

you're using CNC machines we go from the

driver

or to the stepper motors and these are

what really make the machine a CNC

machine these are direct driver motors

the motors are connected directly to the

belts some machines will have gearboxes

attached to the stepper motor it'll look

like one solid unit but you'll have a

lot more torque with something like that

this is a smaller system so you're not

going to have that again there's two

motors for the Y and they basically are

inverse of each other so when you

activate them they both go in the same

direction so that makes it a lot easier

to do we have a linkage here for the Z

this is the Z can't go very fast with it

but this goes up and down and it drives

our tool this is a DeVault looks like a

trim laminate router they're pretty

reasonably priced usually under $100 but

they're very loud that's something to

think about when you're deciding what

kind of motor to get what kind of

machine to use you know you're gonna

hear that loud noise for like 30 minutes

or an hour if you're routing something

so you need to think about your spouse

your neighbor your kids your pets you

know noise is something to take into

account or you can soundproof your

garage I guess that's always an option

the stepper motors drive some sort of

tooth accurate system that will move

everything back and forth in this

machine there are inert belts and the

belts are connected to pulleys and when

the pulley turns it causes the machine

to move along the belt so it's kind of

like a rack and pinion made with a

flexible belt

there are also machines where the belt

will loop at the end although you won't

have as much torque with that you'll

also see machines that have a threaded

rod it'll be basically a long threaded

rod and there'll be a captive nut on

that and when the rod rotates the nut

will move the entire system back and

forth you get a lot more torque with

something like that but the speeds are a

lot lower but this belt system that they

have here it's a pretty affordable way

of doing it as long as you keep

everything tight it should be okay

although you want to be careful with

your torque if you try to move this too

fast

the bit won't be able to cut the

material quickly enough and this will

bind up basically it will be the fail

point and you'll lose steps which means

the machine won't remember where it was

so if it makes a circle it won't return

back to the correct spot so it's always

about moving the machine at a speed that

is safe for your cutting tool and your

bit and your material for these machines

it's more about not breaking the machine

or the bit rather than the part itself

getting bucked up like it might be with

a 3d printer this part that I'm moving

here is the Y arm

it's what the Y motors activate it's

also the y-axis of the Machine basically

Y is u Z up or down just like in our

Cartesian graph and that shaft moves the

x axis left and right which is this

again I'm not moving to very quickly

that I want to send energy back to the

driver board and then finally on our x

axis we have the z axis which plunges up

and down into the material there are

some machines where this will move back

and forth but instead of the whole

gantry moving the piece will actually be

moved back and forth it just kind of

depends on how the machine works this I

like because it's you know it's very

simple one reason a machine might move

the material back and forth instead of

this large gantry is because everything

you have on the gantry adds weight so

what this motor has to move isn't as

much as what this motor has to move and

it's not as much as what these motors

have to move of course there's two of

these you know these motors have to move

all of this weight whereas this motors

has to move this weight so yeah it's

kind of about distributing the weight

but I like these systems just because

it's more straightforward and you don't

have to worry about the piece moving in

and out and clunking against stuff so

the heart of the machine is the cutting

tool itself and you want to basically

use the best cutting tool you can afford

because you'll get a higher speed lower

noise hopefully and the bit will rotate

in a straight manner if you think about

like a crappy drill from like Harbor

Freight sometimes the bits you know the

blue like who wants that so you want a

good tool and a good bit and you also

need to think about how much cutting

depth you're going to get you're limited

by the travel of the tool and you're

also limited by the length of the bit in

fact the length of the bit is the

biggest limitation you can get like bits

that are like you know inch

and a half long you know fairly long

bits but you have to be concerned about

breakage like the longer the bit is the

more it can wiggle the more chatter the

more it will wobble at the end so I

typically like to use the shortest bit

possible for the job

most of my bits on my big CNC are only

like half an inch long

I just design according to that and I

very rarely break them let's create

something to make on the shape oku how

about six by three inches that's a

reasonable side is I'm going to create a

bounding box which will represent the

piece of material that I'm gonna use and

then inside the bounding box I will I'll

type my name it'll just be like you know

grade school or everything you make has

your name on it the most important thing

to think about with CNC milling is the

shape of your bit bits are round so

anything you do has to work with a round

bit so for starters I'm going to use

this some background it font so I can

make my name and it will work with a

curve so I will make a circle the size

of the bit which is an eighth inch and I

can check that it will indeed cut

everything that's your work nicely so

basically you know what what we see is

what we'll get I'm gonna bring this up

here I'll make another bounding box

around my name okay and then I'll make

sure everything is no color just a solid

stroke doesn't really matter what the

stroke is there we go I'm going to do an

example up here to show you why the

shape of the bits important let's say

you've had a square that was half an

inch right now if you were pocketing

this or cutting it out with a bit on the

inside you wouldn't get a square shape

because the bit is round see

the resulting cut would look like this

you'd have rounded corners and yeah

maybe that's what you want who knows but

it might not be especially if you want

to make something slot into it it

wouldn't work because if you tried to

slot a square object into an object with

rounded corners well like that one song

a circle won't fit where a square should

be wow I just quoted I'm saying that

firehouse so what I like to do is make a

slotted tab so I'm going to make a

circle that is slightly larger than my

bit so 0.1 3 inches I'm going to put

this in all four corners and now I'll

combine it so now when this cuts out the

bit will go along on the inside and it

will leave a clean space for your square

tab that you put into it and you can

actually make it a little bit more

aggressive than that even if I take this

point 1/3 circle I rotate it 45 degrees

and I will just put it into the corner

like that see as long as enough is cut

out to allow the square edge to fit

you're good so you know be creative

you've probably seen these shapes on

things I've cut on the show before so

here's our nametag I'm going to save

this as an SVG which stands for scalable

vector graphics it's a kind of a I don't

want say generic but it's a standard

form of graphics that are easy to open

so I can open this vector file with a

web browser for instance I'm going to

pass it through Inkscape Inkscape is

kind of the go-to program for a hobbyist

vector art because it's free so a lot of

the programs assume that you use it so

Adobe Illustrator specific things might

not actually work but Inkscape will so

if I pass my file through Inkscape it

will help it conform to the next steps

of this project

I'm just gonna make sure everything's

ungrouped looks like it is make sure

these things are paths not objects okay

I save this as an SVG again now we're

ready to create some G code

I'm going to power up the CNC machine

okay and plug it into my computer now

there's a really cool online tool called

chili pepper that you can use to drive

machines that are based off tiny-g

such as this one we start with a program

called Jas cut which will actually

create the tool paths and this is all

online so yeah check it out over here we

have the material depth the z0 is going

to be the surface of the material that's

how I usually do it on my other machine

so that sounds good and yeah this is an

online app that has all of the same kind

of settings that you've seen me used

before using my CNC machine zero

lower-left so go over here and open the

SVG file that we made on the other

computer now I'll see how the bounding

box gives it an overall shape even

though the part we're going to cut a

smaller than that now here's the cool

part it's really easy to make tool paths

with this we select on the objects come

on there we go okay okay we're going to

create an operation which means

something that we want the bit to do

we're going to select pocket quarter

inch deep generate and this thing even

has AG code simulator which is pretty

pretty awesome see it'll show you

exactly what it's going to do it's even

in - look at that you can even look at

it in three dimensions

very cool ok I'm going to go back to the

edit tool path I'm going to select this

outer box and I'm going to create

another operation and this is going to

be outside so the bits going to go

outside that line and I'm not going to

cut it all the way out but let's just do

a quarter of an inch again generate go

back to simulate G code and this will

show us everything that will happen so

that's actually what the bit will do

okay so the z0 will be the surface of

material you got to remember that zero

lower-left sounds good alright cool I'm

going to go to save G code I'm going to

save it locally on my computer let's

call it Ben nameplate G code save his

local file I just put it that's fine

let's put in the software folder cool so

we've used an online tool to create G

code very nice okay I'm going to run

this program that I downloaded from the

chili pepper app the serial port JSON

server this will allow the web browser

to communicate to the serial port and to

the CNC machine let's go back to the

chili pepper page alright so down here

we do connect a hosts do connect a

localhost

okay now that program is letting us see

or letting the web browser see the port

so let's connect to that all right we

should be connected to the board let's

try to do something let's do 10

millimeters for every move cool looks

like it's connected

now when you're setting up a CNC machine

you want to take into account the

revolutions of the motors and the

pulleys and your gearing for instance

you need to know what the step of your

motor is such as 1.6 degrees per step

and then how many steps there would be I

believe that would be 120 steps per

revolution so your code will know how

many steps to initiate in order to move

a certain distance and what I usually do

is I make a paper pattern of ten by ten

millimeter grids and I move it around

ten millimeters at a time and then I can

see that it's actually moving the right

distance so it's a combination of your

motor steps the micro stepping that your

board is set to and your pulleys and

your tooth - gears because you have to

think that when the pulley the pulleys

diameter diameter times pi will tell you

how far it will move with one revolution

so you have to put all that stuff in

I've already endowed that into this one

so it should be pretty good so one thing

I do want to do is set a zero point and

I'm actually going to put the material

in first before we do that so I'm going

to move the machine clear all right now

here's some engineering foam that I'm

going to use I'm gonna put it right put

it right in the middle now one of the

most important things with mechanical

CNC is holding your workpiece in place

you know on my big CNC machine I'll use

screws or there's a vacuum feature that

it has this is a little bit more limited

so what I'm gonna do is I'm gonna

actually just blue painters tape this

foam block in place just so that doesn't

move the bit should cut through this

foam like butter

so our clamping method doesn't have to

be super strong one thing a lot of

people will do is they'll make a CNC

machine like this and then use the CNC

machine to make parts for a better CNC

machine so it's like immediately

self-replicating all right I'm going to

go and grab

the g-code that i created alright now

this is pretty slick there's a preview

on here that shows you what it's going

to look like you can see the toolpath

and the the depth so right here you see

that it's going to do two passes to make

the name and for some reason three

passes to the outside cut so I'm going

to set z0 position in this block of foam

that should work

there is a electrical plate we can use

to complete a circuit between the bit

and a plate to set the Z depth but we're

having some noise issues with this unit

so I'm just going to do it manually when

we generated the g-code we said at the

top of the material was zero so that's

what I'm going to do here that looks

pretty good maybe just up just a hair

okay I guess we can check by moving

other things around and see if it

scrapes the tape that looks pretty good

alright so I'm going to go back I'm

going to hit zero out which will make

this zero zero point so even if I were

to raise the Z or move the X or move the

Y if I say go to zero it will move back

to its original position okay we're

ready to start the tool and run the

g-code as I mentioned these things are

kind of loud so I'm going to wear my

headphones well these are actually noise

blocking headphones there's no audio in

them

all right the milling is done I'm gonna

move the tool out of the way clean it up

and we can take a look

probably could have done a better job

taping it but whatever it stayed in

place pretty well it worked out pretty

good let's do a quick overview of CNC

milling CNCs are good for making large

shapes out of large flat stocks using

strong materials like wood plastic or

metal and it's also really good for

milling circuit boards

however CNC machines are not as good at

small objects because they're hard to

hold in place things with inside shapes

such as screw posts or inner chambers

and you know complex 3d objects in

general they're easier to do on a 3d

printer until you get into like really

advanced CNC machines but nothing on a

tabletop model and some final CNC tips

CNC machines are roughly the same cost

as consumer-grade 3d printers so you

know if you go for one of the other your

choice holding down the material and not

breaking the bit are the two most

important things when it comes to using

CNC machines you have to think about

those things the most finely you should

take motor noise into consideration when

choosing a CNC machine they can be

pretty loud so what were your neighbors

spouse kids pets think you can get

spindles which run at a higher frequency

than a standard router motor but they're

a little bit more expensive that's all

the time we have for today

be sure to visit element14.com to keep

track of future builds upcoming episodes

and special events we'll see you next

time

starting craft Asia manually I'm awesome

Captiva is running dick the Ben Heck

show is brought to you by element14 the

electronic design community where you

can connect and collaborate with top

engineers from around the world join now

at element14.com