Introduction: 3D Printed Desktop CNC Mill

Welcome to this project. The CNC UNO is a small desktop CNC Mill that can be used for hobby engraving and routing, PCB milling and education. It is mainly made with 3D Printed ABS plastic parts and plywood. Before starting this project, please observe that this machine is not intended for precision work nor for cutting hard materials like metal. As the machine parts are made of plastic and wood, the machine will flex under heavy load and that is why this project is for fun rather than any serious application. That said, it is a great little machine for hobbyists that want something to play with without having to spend a fortune.

Also, remember that this will not be a 100% exact description of every little detail of the project, although I will try to explain as much as I can. You will probably have to improvise a little here and there. Read through the project before starting and make sure you feel comfortable with the steps described.

Let me know if you want me to add more pictures and steps.

Step 1: What Will You Need?

Here is a list of things you will need to get for the project. I have provided links to where I got the parts.

  • Access to a 3D printer and ABS filament
  • A sheet of 8.7 mm (11/32 inch) thick plywood
  • Lots of small screws and nuts (M2 and M3 or similar)
  • 2 Nema 17 Stepper motors (Link)
  • 1 JKM 42 Stepper motor (Link)
  • A 12V DC motor (Link)
  • A chuck (Link)
  • 8 mm Linear Rail Rod (Link)
  • Set of bearings (Link)
  • Brass copper nut JKM 42 (Link)
  • Set of L298 stepper motor drivers (Link)
  • Timing belts and pulleys (Link)
  • An Arduino Mega 2560
  • STL Files for the 3D printed parts (Link to Thingiverse)

For the electronics you need:

  • Lots of thin cables in different colors
  • A soldering iron
  • A PC power supply or similar to drive the spindle and the steppers
  • A potentiometer (10 K)
  • A rotary encoder (Link)
  • A Joystick module (Link)
  • Some push buttons
  • 1 red, 1 green and 1 yellow LED
  • 1 Nokia 5110 LCD (Link)
  • 3 micro switches
  • A diode, an electrolytic 220uF capacitor, a 10nF disk capacitor, some resistors and a 30N06L MOSFET
  • Optional: SD Card Module (Link)
  • Cooling Fan (Link)

Skills needed for the project:

  • Soldering skills
  • 3D printing skills
  • It will help if you have some basic skills in Arduino programming
  • Basic knowledge of electronics

Step 2: Let's Get Started!

This is the model I made in Rhino 3D when planning the project. I wanted a small and light milling machine that I could play with on my desktop.

Mark the pieces on the plywood and cut them out. The drawing is in millimeters.

Step 3: Glue the Pieces

I cut two pieces of the bottom sides of the frame and glued them together for better stiffness.

I also clamped side pieces together and cut them at the same time to make them as similar as possible.

You can also use nails and screws in combination with the glue.

Step 4: Make the Table

Now, cut out the table and the back plate for the Z axis.

Table size is 25.7 x 24.4 mm.

Back plate size is 80 x 140 mm.

Step 5: Print and Assemble the Plastic Parts

Now when you have the frame ready, print out all the plastic parts and put them together. Use the frame as a reference and cut the steel rods for the X and Y and Z axis to the correct length. Be careful not to cut them too short. It is better to cut them long first and then test with the brackets and the frame, and if they are too long, cut them a bit more. On my machine, I got these lengths (more or less): X-axis 350 mm, Y axis 250 mm and Z axis 120 mm.

Also, test out the length of the X and Y axis timing belts. They should be fairly stretched and you can use the spring from a clothes peg as a tensioner.

On the picture, I had mounted the first motor I used. It later turned out to be too weak so it has been replaced with a bigger motor.

Clamp the parts to the frame and mark and drill all the holes for the mounting screws.

Step 6: Paint the Frame

Sand the frame and paint it. Yes, it has to be silver, otherwise the machine will not work ;)

It is probably a good idea to paint it with a protective coat of clear lacquer as well.

Step 7: Mount and Test End Switches

Assemble the machine. Put cables together with zip ties and try to keep things as neat as possible.

Mount the end switches and test that they click as they should when you move the axis to the stops.

Step 8: Make the Controller

The controller is a whole little project by itself. You can decide to use another box, skip the LCD etc. It is up to you. This is what I did:

I printed out the controller case and mounted the rotary encoder, the joystick, the potentiometer, the LCD, some LEDs, and buttons at the faceplate. Inside I mounted the Arduino Mega, the stepper drivers and a little homemade spindle driver.

I used hot glue, superglue, and screws to hold things in place. I also soldered the buttons to a small piece of perfboard and 3D printed some standoffs that I glued to the back side of the panel so the modules could be screwed into place. If you have different sized buttons and knobs, you may want to design your own front panel instead.

Step 9: Electronics

See tables for how I connected the pins to the Arduino.

You will need to solder all ground pins to the ground pin and all Vcc to the +5 Volt pin of the Arduino.

In series with each LED, you will need to solder a current limiting resistor. Other than that, soldering all these pins should be pretty straightforward.

EDIT: Please note that pin 51,53 on the table has changed to pin 27,29. After having some problems with the serial communication while starting the spindle motor I decided to add a SD card reader module. It uses pin 50 to 53. I recommend anyone to add this too. It makes the machine stand-alone and more convenient to use.

Step 10: The Spindle Motor Driver

For the spindle motor driver, I used a 30N06L MOSFET to switch the power. This is how it is connected.

I soldered the MOSFET, the diode and the resistor to a little perfboard and added a small heat sink to protect the MOSFET from overheating.

Directly on the motor connectors, solder the 2 capacitors to filter out noise from the motor.

Step 11: Stepper Drivers

Then connect the 12V from the PC power supply to each +12V connection of the L298N motor driver boards.

On Output A and Output B you connect the leads for each stepper. You have to play around a little with the leads to see which goes where. After some trial and error, the motor will go in the correct direction. Use the joystick on the controller to test the direction of each motor and switch the cables around until it works as it should.

Note! I have noticed that the drivers get pretty hot when running the machine for longer times. I suggest adding a fan to the controller box to keep things cool.

Step 12: Finish the Project

Paint the controller and screw/glue it together. Use screws for the front panel so you can open it to do modifications later.

Connect the Arduino to the PC and program it with the sketch that you can download from here.

CNC UNO Firmware Files

Test the entire functionality of the controller and make sure the motors go in the correct direction. Check that all buttons, LEDs and knobs do what they are supposed to do; see the controller manual below.

When testing the machine, use very low feed rates (F100 or lower) and do not go deep! The CNC UNO will work with small mills and drills only and they can easily break. Also, by using low feed rates and shallow depths, you put less strain on the machine, avoiding the occurrence of flexing and bending.

I suggest testing it out with small pieces of plywood or similar soft material.

The firmware is a Beta and it is meant to be improved, by me or by others. It has a very limited set of G- and M-codes and basic functionality only. I see many ways in which this project can be improved. For example, one could use inexpensive 3D printer stepper motor controllers, and use micro stepping of the motors for smoother and quieter operation. The controller would gain from having an SD card reader where one could store CNC programs, just like many 3D printers have (EDIT: it has been added now). The spindle motor output should be PWM (Pulse With Modulation) to be able to control the RPMs. WIFI could be added. The list goes on...

Feel free to improve it and add features, and send it to me so it can be shared with others.

Step 13: Controller Manual

When the controller turns on or when it resets, it automatically homes all axes. Once in a home position, the display will show its X, Y and Z axis positions and the current feed rate. At the bottom of the screen, there is a menu controlled by the three buttons below the LCD. The right-most button browses the menu.

HOME SPNDL >

HOME will home all axes to their end point breaker position.
SPNDL will start and stop the spindle.

ZERO JOGXY >

ZERO will tell the controller that the current position of the tool is the zero point.

JOGXY tells us that the joystick will control the jog motion in the X and Y axis. If you press it once, it will change to JOGXZ, changing the joystick to control the X and Z axis.

After an axis has been jogged with the joystick, the controller will remember it as the lasted jogged axis. Now the axis can be fine-jogged with the rotary encoder dial.

DEMO ABOUT >

DEMO will put the machine in a demonstration loop.
ABOUT will show the About screen and the firmware version number.

RUN PAUSE >

RUN will run the cnc program named RUN.CNC on the SD Card.
PAUSE will put the machine in block step mode.

Step 14: Run Programs

To run a CNC program on the machine, you send it via the serial port. The baud rate is 115200 baud.

You can send it with any terminal program that has the XON/ XOFF handshake protocol. Here I use the CNCSimulator Pro from CNCSimulator.com, as it is where I work when I am not at home building CNC machines :) Another communication setting that is important to use is a 100 ms delay between each block for the machine to be able to catch up.

On the picture, the Char delay is set to zero. I have now found out that a small value of 10 works better. You may have to play around with these values to avoid losing characters when sending from the PC.

Step 15: Software

We have added the CNC UNO machine as a virtual machine in the CNCSimulator software so one can simulate CNC programs before running them, to see that all is OK. This addition will be available when we release version 2.0 later this year.

Step 16: G- and M- Codes

Each line (or block) must have a G-code. In other words,they are not modal. All code letters must be written with capital letters.

G00 is fast transport moving all axis in full speed.

G01 is linear movements with programmed feed rate (F).

G02 is clockwise arc movements with programmed feed rate.

G03 is counter clockwise movements with programmed feed rate.

G04 is dwell.

G28 moves all axis to their maximum position.

G73 drills a hole.

M03 starts the spindle.

M04 also starts the spindle (we have no directional control yet).

M05 stops the spindle.

M01 puts the machine in pause mode.

F feed rate in mm/ minute.

Example program

G00 X0 Y0 Z0 (Go fast to X0 Y0 Z0)
G01 Z-10 F400 M03 (Go to Z-10 with a speed of 400 mm/min and start the spindle) G02 X40 Y0 I20 J0 (Do a half circle to X40 Y0 center in X20 Y0) G01 X50 (Go to X50 with programmed feed rate) M01 (Pause) G01 Y50 (Go to Y50) G01 X0 (Go to X0) G04 P1000 (Dwell one second) G00 Z10 (Go up to Z10) G00 X20 Y40 (Go to X20 Y40) G73 Z-10 Q3 F200 (Drill a hole to Z-20 with a step size of 3 mm and feedr. 200 mm/ min) M05 (Spindle stop) G28 (Move all axis to max)

Good luck building your own CNC UNO!

Step 17: A Video of the Machine in Action

This video shows the first version of the machine before I replaced the spindle motor for a much better one.

Comments

author
odtec made it! (author)2017-07-22

Hi, very cool project. I've build it using some litle scraped step
motors and L298 drivers. The problem is, I can't let it working for
more than a minute, the steppers and driver are getting too hot then I
have to shuting it down. I have some drivers with current controle like
the Pololu and I'd like to use them with this machine, but I don't know
how to code to make the required changes. Have anyone made it work with
these kind of drivers ? I'd appreciate any help.

author
Xalax made it! (author)2017-05-01

The software need modifications and now the CNC is ready ??.

temp_1594154603.jpgtemp_983479961.jpgtemp_1804377292.jpgtemp_275527500.jpgtemp_539433526.jpgtemp_1247270414.jpgtemp_1692905932.jpg
author
tekayam made it! (author)tekayam2017-05-10

nice can you send me the working code lllmoez@yahoo.fr thanks

author
Xalax made it! (author)Xalax2017-05-11

Sure, check your e-mail.

author
AbhijitD10 made it! (author)AbhijitD102017-05-01

hi, i have some error massage in arduino.

please give me the solution.

error massage--------

Arduino: 1.6.6 Hourly Build 2015/10/14 10:42 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\ABHIJIT\Downloads\CNC-UNO-master (1)\CNC-UNO-master\CNCUNO\CNCUNO.ino: In function 'int8_t sgn(int)':

CNCUNO:1339: error: 'int8_t sgn(int)' was declared 'extern' and later 'static' [-fpermissive]

static inline int8_t sgn(int val)

^

CNCUNO:193: error: previous declaration of 'int8_t sgn(int)' [-fpermissive]

pinMode(PIN_RESET, OUTPUT);

^

exit status 1

'int8_t sgn(int)' was declared 'extern' and later 'static' [-fpermissive]

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

author
Xalax made it! (author)Xalax2017-05-04

Hi, I still believe that the problem is the modification of the software. Sure I can send you mine if you want.

author
AbhijitD10 made it! (author)AbhijitD102017-05-05

Thank you,

Please send me the verified file (.ino)

My email is

abhijit9679@gmail.com

author
Xalax made it! (author)Xalax2017-05-06

Please check your e-mail.

author
Xalax made it! (author)Xalax2017-05-02

Hi Abhijit, I have had the same problem. You have to modify the firmware and match the brackets. Every start bracket "{" have to end with an end bracket "}".

author
AbhijitD10 made it! (author)AbhijitD102017-05-02

Thank u for reply,

I could not solve this prorblem by using "{","}" .If possible please send me the .ino file.

It shows again some error massage like-

^

C:\Users\ABHIJIT\Downloads\CNC-UNO-master (1)\CNC-UNO-master\CNCUNO\CNCUNO.ino: In function 'void stepaxis(Stepper*, int)':

CNCUNO:1339: error: expected initializer before 'if'

if (val < 0)

^

CNCUNO:1341: error: 'val' was not declared in this scope

if (val==0)

^

CNCUNO:1342: error: return-statement with a value, in function returning 'void' [-fpermissive]

return 0;

^

CNCUNO:1343: error: return-statement with a value, in function returning 'void' [-fpermissive]

return 1;

^

exit status 1

expected initializer before 'if'

author
Xalax made it! (author)2016-05-20

Hi,

The CNC is built, all axis goes to zero when it's switched to ON and I can move all axis by the joystick. The communication between the CNC and the Hyper Terminal is established via the Arduino's USB connector. I still don't have communication with the SD-card reading neither to the CNCSimulator software.

Any suggestions on how to send a g-code to the machine?
And why the SD-card is not responding?

author
tekayam made it! (author)tekayam2017-05-10

hi sir ca nyou send me the working code via mail lllmoez@yahoo.fr thank you

author
kevin4 made it! (author)2016-08-22

Can you put up the Rhino file please

author
Xalax made it! (author)Xalax2016-10-09

Hi Kevin, you can download the firmware from the link above. But I couldn't make it works...

author
JoshuaR113 made it! (author)2016-06-02

Can you help us to build this one?

author
AntonisP2 made it! (author)2016-05-03

I don't see anywhere the emergency/brake switch connection. Can anybody advice where is connected?

author
Xalax made it! (author)Xalax2016-05-14

I connected it to the RESET of the Arduino. Maybe it's not the right way, but it works. It's a good idea to use an ON/OFF switch too.

author
Revanchist made it! (author)2016-04-10

Is there a list of the plastic parts to print? I didn't notice how many of which part to print...

Thanks!

author
Xalax made it! (author)Xalax2016-04-10

Hi,

You can download a printable .stl files see (link above) but you may have to make some changes.

author
Revanchist made it! (author)Revanchist2016-04-10

Yup I noticed the link to where to download them from... but I can't see where it says how many of each of the pieces... I have the pieces I don't have the quantities to print.... or simply one of each?

author
Xalax made it! (author)Xalax2016-04-24

Hi, did you print the parts?

author
Xalax made it! (author)Xalax2016-04-12

Hi, Begin with printing one piece of each .stl file and you'll notice soon if you need more then one piece of some part. Before printing you have to download and open these .stl file by the printer software. Then you'll export each file to g-code to the 3D-printer, so you will be able to see all objects before printing.

author
program01 made it! (author)2016-04-06

Hi,

I also have the CNCsimulator expired :(.

I wanted to see some details on the hardware of the machine.

You said that you did it with rhino 3D. Could you send us the file to compensate the software we couldn't use ?

author
daniel caire made it! (author)2016-03-05

Hi & Help, I´m having troubles with the CNC SIMULATOR software licence, do you have any idea of keep using it, I was on vacation and I didn´t use it and suddenly expired :( or another similar software?

Thanx for all help I can get.

author
EliasS4 made it! (author)2016-02-29

Can i use the same machine for a 3d printer with a 3d printer pen...?

author
EliasS4 made it! (author)EliasS42016-02-29

something like this https://www.tinkernut.com/portfolio/hack-old-cd-roms-into-a-cnc-machine/

author
program01 made it! (author)2016-01-21

Hi,

I want to build this machine but as I don't have a PC power supply,

I'm asking you if someone knows how many Amperes does it requires ?

thank in advance

author
Xalax made it! (author)Xalax2016-02-12

Hi program01,
Count the sum of all output you need.

Ex1:
2 motors á x Watt + 1 motor á y Watt + (LCD, Arduino, LED) z Watt.
So you need a Power supply of minimum (x+y+z) Watt.

Ex2:
If the data of your motor is 2.5A @ 12V so the Power will be 2.5*12 = 30W (P=V*I)
¤ Add now about 60% for the start condition 30*1.6 = 48W for 1 motor.
¤ If you have 2 similar motors: 48*2 = 96W

author
dexter_g800 made it! (author)2015-12-29

good idea

temp_-1795285209.jpg
author
bparker2 made it! (author)2015-12-29

Hi I have almost finished a small mill like this using 6mm threaded rods an Arduino cnc shield 3 A4988 stepper drivers 3 Nema 17 I have Arduino mega,Uno, Duemilanove and others that I can use but I am not looking forward to trying to set the software for a first run can anybody suggest an easy to follow tutorial I know people will say Google it but there are so many that are not very clear I would like somebody that is new to Arduino to point me to one that got them up and running. I know I have quite a lot of Arduino items but I just spend £20/£30 now and again on eBay I don't know much about them as yet. I am not saying there is anything wrong with this tutorial but it uses different drivers and I don't know if it's all compatible with mine.

Thanks Bill

author
farrelan made it! (author)2015-12-22

Can you lay out the parts to be cut from wood and export to dxf. I would like to use my full size router to cut this frame. Love to build this for pcb work.

author
CssmT made it! (author)2015-11-30

Hi bob, can I to use marlin firmware with this scheme?

author
tkayastha made it! (author)2015-11-14

why silver?? does the frame has to be conductive??

author
Xalax made it! (author)Xalax2015-11-15

No choose the colour that suits you.

author
BobS77 made it! (author)2015-11-09

Is the table size supposed to be in centimeters? It says 25.7 x 24.4 mm which is tiny and looks like it would be the right size if it were centimeters. Other than that this looks great and can't wait to start building my own!

author
Xalax made it! (author)Xalax2015-11-15

Hi BobS77, you've right the dimensions is given in centimetre.

author
starrytime made it! (author)2015-11-11

hi, I am planning to make one but just a question: what kind of files can you mill with it ? (.stl, etc or do you have to write the program for every piece) thanks :)

author
Xalax made it! (author)Xalax2015-11-13

Hi starrytime, someone should know the answer beter then me.
But I think it's a g-code file. watch the Youtube and the description above.

author
starrytime made it! (author)starrytime2015-11-11

sorry for the double post :/ but couldn't I use threaded bars instead of the belts?

author
HannahL17 made it! (author)2015-10-26

Hi,

I'm trying to order the chuck and the link doesn't work. I found this http://www.aliexpress.com/snapshot/7017738903.html...

what size diameter do I need?

Thanks!

author
Xalax made it! (author)Xalax2015-10-27

Hi HannahL17,

I ordered > THIS < chuck from aliexpress.
But don't forget to inform the seller about your motor shaft diameter.

author
HannahL17 made it! (author)HannahL172015-10-27

yes, but what is the motor shaft diameter needed for this project?

author
Xalax made it! (author)Xalax2015-10-27

I would say its your decision what motor you want to buy but I bought > THIS < motor and the shaft diameter is 5mm.

author
Xalax made it! (author)2015-10-22

Printing and assembling the hardware!
I'm modifying the stl file, printing and assembling the Z-axis for now.
Hope to get the rest of the parts I ordered soon, but I guess it will take about 3 weeks to get them from China :(

author
MMantas1 made it! (author)2015-10-10

Got compiling error:
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\Sd2Card.cpp:26:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>

can anyone help with it?

Xalax, read previous messages: in cncuno rename to

#include <Stepper.h>

#include <SD.h>

and these files will be found in library

author
Xalax made it! (author)Xalax2015-10-11

Thanx MMantas1, Now I can see those files under the library.

But the compiler is case sensitive, so be sure if the <SPI.h> file under your library is written in CAPITAL letters...

author
MMantas1 made it! (author)2015-09-08

Hi,

Motor clamps are for 45mm?? but on pictures i see 36 mm motor mounted.

Can i get 36mm clamps stl please? because my motor 36

author
Xalax made it! (author)Xalax2015-10-09

Hi MMantas1,

Did you fixed the clamps yet?

author
Xalax made it! (author)2015-10-09

Hi and HELP :)

I downloaded the Arduino files from "https://github.com/cncsimulator/CNC-UNO" as mentioned. But when I verified the files the compiler ask for "stepper.h" which is not located with the other files.

How did you compiled the "CNCUNO.ino" without the "stepper.h and stepper.c"?

Thanx for all help I can get :))

author
KarryC made it! (author)2015-09-18

About This Instructable

205,735views

1,665favorites

License:

More by Elektron8:3D Printed Desktop CNC mill
Add instructable to: