Let's Make Robots!

CNC machine prototype

Machine parts from aluminium, plastic and wood

This year, one of my major projects is to develop a low cost CNC milling machine kit. There are two parts to this project, the controller and the actual machine.

The Controller:
I wanted as much freedom as possible when designing the mechanical side so I made sure I designed a controller that could do anything and everything I wanted. many hobby controllers use seperate PCB's for motor controllers, logic etc. My controller has everything on one large PCB measuring 220mm x 120mm.

The heart of this controller is an ATmega2560 with an ATmega8U2 for the USB interface. This makes the controller compatible with the Arduino Mega2560. Arduino libraries are available for all the hardware used in this controller making it easy to program using the Arduino IDE.

A large 240x128 graphics display (display area is 108mm x 57mm) gives me enough resolution that a thumbnail of a part can be displayed. If you have more than 1 file on the SD card then this can help revent you from selecting the wrong file by accident. The resolution also makes it easier to display a detailed menu system.The display is white text on a blue background and has both brightness and contrast controls. A built in DS1307 RTC allows the time to be displayed and is handy for keeping track of how long a job takes to complete.

Menu navigation can be done easily using the cursor keys on the right hand side with 4 option selection buttons on the left hand side similar to what you might see on an ATM. 

Sending jobs to the machine can be done in 4 different ways.

  1. Send directly from a computer using a USB cable.
  2. Loading the job files onto an SD card and plugging the card in.
  3. Wirelessly using an Xbee module.
  4. Wirelessly using a Bluetooth module.

It is also possible to update the controllers code wirelessly. A switch on the back allows you switch serial port 0 between the USB interface and the Xbee. Click on the photos for a hi-res image.

This is a 5-axis controller. Although my current prototype machine is only 3-axis, I hope to expand once I work out all the basic issues such as machine resolution and accuracy. Each stepper is controlled by an A4988 stepper controller with software controllable current limiting and resolution up to 1/16 steps. Each axis has a home and limit switch input

As I want to mill a range of materials there are 4 unidirectional motor outputs for cutting tools, fluid pumps and blowers. These motor outputs include current monitoring and PTC fuses. There are external interrupts for monitoring the speed of up to 2 cutting tool motors. The idea behind two cutting tool motors is that you can fit one with a course cutting tool and the second with a finishing tool. I want to design the machine to swap between them.

The controller is designed for 24V @ 20A. All motor outputs are 24V. A 5V @ 3A switchmode regulator supplies the logic and 9 servo outputs. These servo outputs use analog input pins so they can also be analog inputs or digital I/O. Although servos are not normally needed for a CNC machine it makes it easy to control the aim of the cutting tool fluid or air blower while the safety guard is in place. There are 4 emergency stop switch connectors on the board for safety guards and manual stop buttons.

A 3.3V @ 300mA LDO regulator supplies 3.3V for the bluetooth and Xbee modules. The I2C interface has both 5V and 3.3V connectors making it easy to add additional sensors or devices.

The Machine:
This is a work in progress. We have started with a reasonably good quality kit and now I am upgrading it. The beams are very high quality, extruded anodized aluminium (50mm x 50mm) which provide good rigidity and light weight. The slide mechanisms are the same as used by many lathes and other workshop machinery. Bearings are not used as they reduce overall accuracy.

The cheap brass collets have been replaced with a collet system used in professional CNC machines. As this is a small hobby machine, the biggest milling tool the collet system will take is a 5mm bit. In this photo I also have a 3mm collet for smaller tools.




I've rebuilt the frame several times to increase rigidity. Now it's pretty solid but it's a lot heavier and uses a lot more parts. My next goal is to try and replace the base section with a single cast aluminium piece. This will help increase rigidity and reduce both the part count and weight. As a bonus it will also be waterproof so it can hold the cutting fluid.

The maximum size for parts produced by this machine is 150mm x 150mm x 75mm. The reason the height is less is because of the length of the spindle that holds the cutting tool. This frame is only for a basic 3-axis machine. Later once I work out the details I would like to go to at least a 4-axis design.




Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Can you post a picture about the connexion of the collet to the motor ?

Thanks but that is exactly what I don't want.

I don't want individual modules with lots of wires connecting them which is why I put everything on a single PCB. It makes the kit easier to assemble.

I don't want to use those kind of bearings because they introduce too much play. The slide mechanism I am using now is more ridgid.

this is a great project and I have been considering something along the same line. just  wondering how you are planning to program the parts in. Are you going to use a cad like program then convert it to machine code with another program?

Most 3D / CNC systems use G-code to control the machine. They generate the 3D file with a program like Sketchup or Blender and then use anothe program to convert to Gcode.

For now I will just write firmware that accepts the Gcode from these other programs but later I want to try and write code that will generate it's own Gcode directly from an STL file. The STL format is easy to read and can be generated by all 3D software.

In both cases the file can be sent to the controller using USB, Xbee, bluetooth or by plugging in an SD card with the file.

im using inkscape to draw, PyCam to convert to Gcode and mach3 to run the Gcode to my 6040, i found reviewing my tool paths in PyCam has save many mistakes . also being able to add support, tool size and stile , offset , internal and external cuts , pocketing for holes or enclosed,

my concern is that if the code decides to cut the external out line first before internal holes and you have not added support your cut will fail and damage to the mill is likely .

some kind of visual tool path checking and simulation is needed in my opinion and having an on board STL to Gcode converter would be problematic   

To begin with i will try and use readily available software as you suggest. The fact is I probably won't have time to write my own code.

That is what I am used to then. I run a turret punch at work and I have to take the Autocad files and run them through a program called Striker to get the G code. I've even had the opportunity to write a few simple designs in G and it is rather easy for the punch. I am sure for the 5-axsis systems it is allot more difficult though.


The controller looks very interesting. Will it be sold separately for people that want to use it in other projects like 3D printing?
Will it be open source hardware and software?

Personally I would like the controller to be sold seperately but I am not sure if my boss will do that or not. A lot depends on the distributors.

It won't be opensource hardware because here in China there are too many factories that will copy it. They may do so anyway but I don't want to make it too easy for them. Schematics will probably be available.

I will make any software I write freely available and supply a spreadsheet with the pin / hardware connections so it is easy for others to write their own software.