CNC machine prototype
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.
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.
- Send directly from a computer using a USB cable.
- Loading the job files onto an SD card and plugging the card in.
- Wirelessly using an Xbee module.
- 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.
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.