CNC mill phase 1: planning

While I have understood the basics concept of CNC machining–and have utilized it in my work–I never fully appreciated how complex a system a CNC machine is until I set about designing and building one. There are many software and hardware layers are involved in the process, and each of these layers offers nearly endless options to choose from… CAM software, controller software, steppers vs. servos and their torque specs, power supplies, motor controllers, breakout boards, encoders, etc. not to mention the mechanical modifications to the manual mill.

So as a first step in converting my milling machine to CNC I looked at a lot of other people’s conversions with this and similar machines, especially in the copious posts on and specifically the great work that “Hoss” has done. In the interest of not re-inventing the wheel (for now) I chose one of Hoss’s recommended stepper motor configurations from Keling, and bought his plans for the mechanical conversion from a manual to a motor-driven G0704 mill.

From there I started to sketch out a system map, detailing the wire-for-wire connections between the different components to best understand how this might go together. This also helped me to think through the available options, like physical interface elements such as emergency stop buttons and limit switches.

CNC mill system map

The lower area will exist in the base of the machine and will include the higher voltage DC elements that actually drive the stepper motors. A KL-600-48 power supply provides 48V to the three KL-5056D motor drivers. Control signals from the PC come through a C-10 breakout board, which serves to isolate the PC from the motor drivers. It seems that keeping things separate like this is good practice and tends to avoid funky interference or crosstalk problems with the PC.

The upper area represents a “controller box” which will hang off the side of the machine, and will enclose a small form factor PC, a 15″ touchscreen monitor (eBay!), a ruggedized keyboard, and a small cluster of buttons and indicators. The I/Os will include a main power cord, a ‘switched’ power cord to feed the lower cabinet, a DB25 to connect the PC’s parallel port to the breakout board in the lower cabinet, a DB15 to connect other signal to the breakout board, a series of connections for limit switches, three relay connections to control the mill’s spindle and two different coolant systems, and USB and ethernet ports to communicate with the PC.

CNC front panel

A main switch on the front panel controls the power to the entire system– PC, monitor, and the motor power supply in the lower cabinet. “PC power” and “PC reset” switches are connected directly to a header on the motherboard, as are LEDs to indicate power and hard drive activity. A USB port on the front panel is intended to be the main method of getting files on the PC, as I intend to use a pared-down Windows installation with a bare minimum of extras (like network access).

The remainder of the controls are dedicated to the safety system, which is based roughly on a scheme provided in the Mach 3 documentation but adapted to work with an Arduino microcontroller. The first part of the scheme monitors the emergency stop button and limit switches (what they call the “interface”) to make sure the machine and operator are OK. The second part, called a charge pump circuit, reads a 12.5kHz signal that the controller software produces when everything is functioning normally. These functions are monitored on I/O pins of the Arduino, and if either condition reports a problem the Arduino cuts power to the lower cabinet and the milling machine’s spindle (via relays) and lights the appropriate indicator(s) on the front panel. After a limit switch or e-stop event, the “interface reset” button will give the controller software the all-clear and resume power.

The “motion override” button is one that I threw for my own comfort. Say I’m running a program and it comes to a point where I need to change to a different sized end mill before continuing. The program would stop the spindle and pause and wait for me to go in there with my bare hands to switch out the tool. At this point I’m relying solely on software to keep the machine from firing up the spindle and plunging the razor sharp end mill through my hand and into the table (for example). Not that this is likely, but I don’t trust software… after all, robots will kill you. So the “motion override” button tells the Arduino to cut power to the spindle and controller until I press the button again. I know what you’re going to say… the Arduino that’s in control is also running software. Well, Arduino is benevolent and would never try to hurt me.

With the system laid out and all the components chosen, the next step is modeling it up in CAD.

Comments are closed.