Archives for posts tagged ‘G0704’

our new addition

Oh, and we also had a baby. But even 6-month-old Izzie is excited about our newest shop addition, a Grizzly G0704 milling machine.

I just got it bolted down to the floor and assembled. Next step is the extensive cleanup and break-in, followed by some manual milling to get accustomed to what this little guy can do. Coming soon: full CNC conversion.

makin’ chips

Finally got to making some chips with the mill today. ABS and aluminum scraps with a 1/2″ HSS end mill, just facing the rough edges to make rectangular blocks. So basically turning chunks of stuff into slightly smaller (and geometrically regular) chunks of stuff.

I also tried some simple features like slots and pockets. I’m finding the backlash in the screws to be frustrating– .004″ in the Y axis and .008″ or more in the X. It’s hard to measure the Z but there’s definitely some there too. The CNC controller software can compensate for this, but until then it’s up to me. Also I definitely need to mark the handwheels with which direction they move the table.

I’ve already got some manual milling projects lined up, including the CNC controller enclosure. Still refining the design but I’m getting there. Can’t wait to have a metal-cutting robot in my garage!

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.

CNC mill phase 2: CAD

With the system map complete and the major components sourced I set about the mechanical design of the enclosures. I originally intended to design and build a custom enclosure for the computer and drivers, out of brushed aluminum/stainless, etc. but came to my senses. Sometimes you have to recognize when to go all out, and when to just get it done. So in that spirit I found a suitable electrical pull box from Automation Direct and probably saved myself a month of fabrication and finishing time. That’s not to say this box will work as-is off the shelf, so there’s still plenty of opportunities to fabricate and modify.

enclosure This is the main two-part enclosure after the extensive modification required to mount the PC and monitor, keyboard and PCBs. Since the enclosure is steel I opted to weld as much of it together as possible in the interest of simplicity. Most of the front panel is cut away for the monitor and keyboard, so the ribs that are welded in also add rigidity. A continuous steel hinge is welded to the front panel and then bolted to the enclosure to join them together.

The touchscreen monitor will mount to the ribs on three sides, allowing the PC components to attach to the VESA mounting holes on the monitor through a simple, flat aluminum bracket. The keyboard will be sandwiched against the inside of the front panel with a flat steel plate.

front panel assembly 1

The interface elements on the right side of the front panel are connected to a large PC board that includes the Arduino and charge pump circuitry. A smaller board isolates the relays, most of which will be switching AC power.

front panel assembly 2

The original concept was to pack everything into the controller box so it would be a standalone assembly, but I came to understand the risk of packaging higher DC voltage components (like stepper drivers) into the same box as sensitive logic-level components (like a PC). So the motor drivers and their power supply moved into the base of the milling machine, mounted to a welded steel assembly that will mount into the base through an opening cut through the back. The pink datum planes in the screenshots represent the interior space available in the upper half of the machine’s base, which is pretty much consumed by the electronics.

lower cabinet assembly

Next up is the PCB design for the interface board in the controller box…

CNC mill phase 3: PCB design

In my CNC controller design most everything is handled by the PC and the off-the-shelf breakout board and motor controllers. But there is an ‘optional’ hardware layer that provides a measure of safety–both for the user and the machine–and a degree of feedback as to the status of the system. This is where a couple of custom PCBs come in.

The design of this subsystem is based off a sample from the excellent Mach 3 controller software documentation (without permission to reproduce it, see page 4-24 of this pdf document). Essentially the system monitors a series of limit switches–designed to prevent the machine from trying to move beyond its mechanical limits in any axis–and one or more E-stop buttons, which together are called the ‘interface’. It also listens for a 12.5kHz electrical signal that the Mach 3 software generates when it is running normally, and if any of these conditions are abnormal the power is cut to the stepper motors and the machine’s spindle. The Mach 3 example does this in an analog way with a clever series of relays, and includes LED indicators and a reset button to provide system feedback to the user.

I realized that a microcontroller could do the same job and offer some more flexibility, and ultimately be simpler. At the heart of this board is a standalone Arduino–basically an ATMEGA 328 and a small handful of discreet components. The IC just to the right of that is a MAX232 chip for serial communication with the PC. This is certainly not necessary, but I figured I have a PC in the same enclosure, so why not enable it to connect directly to the Arduino, either for reprogramming purposes or for some future physical computing need related to the CNC mill. To the right of that is an HEF4538 monostable multivibrator IC and the rest of the ‘charge pump’ circuit provided by Geckodrive’s Mariss Freimanis, which turns the 12.5kHz signal from Mach 3 into a logic high or low into the Arduino. To the upper left is a simple 12VDC (from the PC power supply) to 5VDC power supply, for the ICs and the C-10 breakout board in the lower cabinet. This 5V and GND and the rest of the lines between the Arduino and C-10 board connect to a pin header, shown directly below the Arduino.

CNC mill - main board schematic

On the very far right is where the E-stop and limit switches will connect to an Arduino I/O pin, and a pull-down resistor to keep the pin from floating. The E-stop and limit switches are connected in series and set up in a ‘normally closed’ configuration. This is an added measure of safety as an inadvertently severed wire will indicate a fault, rather than fail to indicate a real problem should one arise. As configured here, a normal condition will read as ‘high’ on the I/O pin.

On the upper right is a series of switches and indicators: MACH OK and INTERFACE OK indicators, INTERFACE RESET and MOTION OVERRIDE buttons (each with their own indicators), and a PC POWER button with power and HD activity LED and a PC RESET button. The latter are not connected to the Arduino at all but go directly to the PC motherboard.

pushbutton The reason the other buttons and LEDs are part of the PCB is that I had a handful of Klockner-Moeller illuminated switches. Except that they are not actual switches and they are not illuminated; rather they are the actuator in a larger assembly that includes switches and lamps. Being real industrial controls, these full assemblies are extremely expensive. Also, I am dealing with signal-level voltages and currents and don’t need anything heavy-duty. So I designed my board to sit just under these switch actuators and provided a couple of small tact switches that are depressed when the big button is pressed. In the middle of each set of switches is two LEDs that will fire up through the middle and illuminate the button.

On the lower right and directly above the Arduino are two headers that connect to the relay board. This is where the AC power terminal block is, and where the relays that switch AC power reside. The first three relays are for switching the main power to the lower cabinet and AC power to two different (future) coolant systems. The other two relays replace the original power switch on the mill (it is a DPDT switch) so the controller box will now have control of the mill’s spindle.

CNC mill - relay board schematic

Since my PC board far exceeds the maximum size that the free version of CadSoft Eagle allows, I designed the Arduino board in two halves and joined them together in Illustrator. The large cutout for the E-stop button provided a nice natural break between the two halves. The upper half was also too big, so I designed it with much less vertical space between buttons and simply stretched the image out later.

CNC mill - PC board artwork

Note: if these images look very slightly skewed to the left, you don’t need to check your eyes. My laser printer warps the transparency film as it’s going through the hot printer, so double-sided PCB artwork doesn’t line up when flipped to face each other. So I printed two copies of a square grid and flipped them face-to-face, then measured the offset so I could compensate for it. Now as a last step before printing transparencies, I skew the entire page in Illustrator horizontally by -.179 degrees, and I end up pretty close every time.

Here’s the relay board, and a small daughter board for the USB connector on the front panel.

CNC mill - PC board artwork

Next step: PCB fabrication!

CNC mill phase 4: PCB fabrication

By now I’ve got a pretty good system down for fabricating PC boards:

1. print artwork onto transparencies
2. laminate the dry film resist onto copper
3. expose the board on the UV light box
4. develop the film, rinse
5. etch the PCB in a tupperware in a sink full of warm water (I’ve been experimenting with acid cupric chloride, but my go-to is still ferric chloride), rinse
6. strip the film off with acetone & tin plate the board with Tinnit (also in container in warm water), rinse with ammonia solution
7. drill & trim board
8. dab on solder paste and place components
9. reflow solder in the toaster oven
10. hand-solder through hole components

This is basically the process I followed this time, but this was the biggest PC board I’ve made to date at around 11″ long. To start with, I couldn’t fit the whole thing on a 8-1/2 x 11″ transparency out of my laser printer, so I had to print it in two pieces and tape them together.

PCB artwork transparencies

I also couldn’t fit the board in my typical etching tray, so I had to use our good Pyrex baking tray for the etching and plating. Otherwise the process went smoothly. I intentionally sized the board to just fit into my reflow toaster oven, and despite using expired solder paste the boards came out pretty good.

PCB - ready to etch

CNC controller – assembly & wiring

Assembly of the controller box has gone very well. The PC components (motherboard, hard drive and power supply) all mount to the monitor’s VESA holes through a flat aluminum bracket, and the monitor attaches right to the front panel. The keyboard gets sandwiched between a flat steel plate and the front panel, with some minor modifications to its silicone cover to make it fit.

small form factor PC and touch screen built into custom CNC controller box

The rest of the assembly revolves mainly around the PCBs and front panel controls. Before mounting the PCB assembly I installed the small USB daughter board that provides a USB port on the front panel.

USB daughter board for custom CNC controller box

The rest of the assembly mounts over this, aligning the tact switches to the button actuators. The remainder of effort went into managing the many wires neatly into the cabinet.

custom CNC controller box

The lower cabinet assembly was much more straightforward:

stepper motor drivers for G0704 CNC milling machine

stepper motor drivers for G0704 CNC milling machine

Of course I wanted to fire it up as soon as possible, even though nothing was connected. The Arduino IC was not yet programmed so none of the UI elements were working, but I was able to transfer files through the USB port.

custom CNC controller box for G0704 milling machine

This is far from complete, but I’m ready to start integrating the Mach3 software with the electronics and make sure they can talk to each other.

Mach3 setup

I’d love to say that getting the CNC controller software (Mach3) to talk to my stepper motors went quickly and flawlessly. It didn’t, but to be fair there are several hardware steps between the two and I don’t blame Mach3. Anyway by the end of the day I had gotten to this point:

Next step is mechanically attaching the motors to the mill, then addressing the whole Arduino safety system.

CNC mill parts

Tonight I finally finished the metal parts for the CNC conversion. These were made from a subset of the “phase 1” plans I purchased, and are all the custom parts I need to attach my stepper motors to the G0704 mill.

aluminum and steel parts for my G0704 CNC milling machine conversion

Most of these were pretty straightforward. The standoff-looking parts are steel rod, parted off to length and then drilled and tapped. The fatter bushing-looking things are aluminum, also round rod that was drilled out then trimmed to length. The big flat aluminum parts were a little more challenging, requiring some milling, but the holes were all center-punched and drilled on the drill press (I still don’t trust positioning on the mill due to the backlash in the screws).

steel part for my G0704 CNC milling machine conversion

This cylindrical steel part took several hours. Starting from a 1.5″ steel rod, I first turned the skinny stem part, then flipped it around to bore out the inside. The tricky part was getting the piece clamped into the lathe so it was perfectly concentric to the shaft I already turned. Apparently my three-jaw chuck is not perfectly centered, so I used the four-jaw chuck and aligned the part manually using a dial indicator attached to the cross slide. According to the indicator I got within half a thou for concentricity… good enough!

steel part for my G0704 CNC milling machine conversion

Once it was centered I bored out the inside and put the little shoulder on the end. Next it was drilled and tapped (for set screws), then off to the mill to make the flats on the shaft.

The most challenging part was probably this aluminum bearing block, shown here in the four jaw chuck. Again, concentricity here is key, so a lot of time was spent getting this guy aligned when I flipped it around.

aluminum part turned on a 9x20 lathe for my G0704 CNC milling machine conversion

Technically I’m ready to mount the motors to the mill, but I’m hesitant to start the process. I’ve gotten used to having a milling machine available, and once I take the handwheels off it’ll be out of commission until the CNC conversion is complete and working! Here we go…

first CNC movements

Manual entry of G-code, with a Sharpie mounted in the drill chuck…

[flickr video=6487457455]

CNC surface machining

I’ll be posting more about exactly what this part is in the near future, but for now I’m super excited about making my first surfaced part on the mill…

This is ABS, which I’m using to test the program before moving on to brass. Good thing too, because one of the last commands jammed the end mill down into the part… I pressed the reset button just as the bottom of the collet was carving out a pocket in the ABS and nothing was damaged, but if I was using brass things would have been ugly.

The end mill is a 1/4″ three flute uncoated carbide ball end mill. The spindle speed was around 2400 rpm and the feed was 7.5 ipm.

home made chuck key

This weekend I spent a lot of time in the shop machining parts for my CNC mill, and ran into a problem with the lathe. The four jaw chuck has these adjustment screws to move the jaws in and out, but I can’t find the chuck key needed to adjust them. They use an inverted key–it’s and innie, not an outie, like most chuck keys–and it’s almost impossible to adjust without that particular tool.

I had a leftover piece of steel rod, so I made my own:

9x20 lathe chuck key CNC machined

The ends were machined on the mill, clamping the piece upright in the vise. The shoulder was turned on the lathe (in the three jaw chuck!).

9x20 lathe chuck key CNC machined

I milled a socket into the other end for a 3/8″ ratchet, although the fat body makes it easy to turn quickly by hand. (I tried to knurl the end but I still don’t know how to knurl properly, so I just mucked it all up)

9x20 lathe four-jaw chuck



CNC mill oiling system – plumbing

This is it… Grizzly Miller is in several large pieces on my bench, and the major upgrades have begun. First up, oiling system.

I made some refinements to the original concept and even built a tube-bending tool for the small brass tube I’ll be using.

2013-03-25 18.17.27

First step was machining the X and Y axis ways on the mill’s cross slide. I used a simple ‘S’ curve, programmed point-by-point into an old ProtoTRAK-converted Bridgeport. On the same machine I pocketed out some clearance for the X-axis ball nut.

Beyond these sketches, most of the design work happened on-the-fly. This is unusual for me, but I don’t have CAD data of the original milling machine parts, and tube fabrication turns out to be more sculpture than engineering anyway. I also bought a silver solder kit specifically meant for joining copper alloys, and tried a small test piece from some scrap material.

2013-03-23 15.39.00

I then fabricated the main brass manifold and mounted it to the cross slide. From there it was a matter of drilling end points in the cross slide and connecting the dots with brass tubing. Each of the four ways are connected with my modified banjo fitting, which allows for flow control adjustments. The two ball nut mounts were modified to accept an oiling tube, which will simply splash each ball screw with oil. The manifold will be fed by a flexible tube, which will attach to the little stub coming off the manifold.

The soldering process is messy and dangerous, but once the parts are cleaned up they’re really quite beautiful.

2013-03-24 16.15.45

2013-03-24 23.57.17

The finished cross-slide assembly:

2013-03-24 16.53.04 2013-03-24 16.52.42 2013-03-24 16.52.50

The Z-axis got a similar treatment:

2013-03-25 13.33.56

More to come, stay tuned!