Building a CNC Mill Stepper Driver

When I bought my Sherline mill, it came with stepper motors, but no driver box. The drive box takes the output from a PC parallel port (small electrical signals indicating which axis should move and in what direction).

Drive boxes contain several essential parts:

  1. Power supply
  2. Stepper motor drivers
  3. Break out board
  4. Connectors
  5. Fuses and wiring

I’m kind of particular about the control electronics of a piece of equipment. Control electronics should be layout in such a way that they are easily serviced. Nothing worst than trying to trace down a problem in a rats next of wiring. Below is as list of some practices I like to use when laying out an electronics enclosure.

  1. Components should be spaced to allow airflow around them
  2. Components should be removable without taking out an inordinate amount of other components
  3. Mount components to a removable panel, rather than directly to the enclosure
  4. Wiring should be neatly bundled, using removable wiring loom where possible
  5. Removable connectors are preferred over soldered connections
  6. Wire ferrules should be used when making connections to terminal blocks.
  7. Wiring going to a removable external panel should have extra length to allow the panel to be removed without straining connections (called a service loop)

Finding the right enclosure was probably the hardest part of this project, mostly because I had many criteria.

  1. Mostly made of metal
  2. Top should be removable without taking front or rear panel off
  3. Removable front and rear panels
  4. At least 10″x10″ and ideally ~4″ tall (based on some rough dimensions of the power supply and driver)
  5. Less than $50

I found several enclosures that fit a few of the requirements, such as:

Par-metal table top series. Nice, but too much money.

20s01

Circuit Specialists EM Series Price is right, but a little too tall.

em-04-0The one I settled on was from eBay, but I also found it on amazon

$_57

This enclosure fit all my criteria. My only gripe with it would be that the front and back panel are plastic and snap in place instead of using screws.

As I mentioned above, mounting components such as drivers and power supplies to a removable panel inside the enclosure makes assembly and service much easier. Parts can be installed and wired on the bench and the panel can be placed into the enclosure in one shot. This is a pretty common practice in industrial control panels. In fact, most enclosure suppliers (like Hoffman) sell panel kits that fit into their enclosures.

I took measurements of the inside of my enclosure and cut a panel out of 0.090″ aluminum sheet. 1/4″ nylon spacers and 8-32 hardware secure the panel to the enclosure. To find the position of mounting holes, I printed out a 1:1 scale outline of the power supply and laid it down next to the driver adjusting their relative locations until I was happy with the clearance.

IMG_4384

IMG_4386

When it came to the rear panel layout I did use CAD software, as I wanted the connectors to spaced evenly and I needed to make sure I had room to run the wiring. Again, I printed a 1:1 scale drawing with the cutouts and screw holes marked, and traced that onto the rear panel.

controller rear controller inside

A step drill made quick work of the holes for the circular DIN connectors and AC input fuse.

IMG_4426

The remainder of the cutouts were made on the mill.

IMG_4428 IMG_4431

A sharp utility knife squared off the corners of this cutout for the power switch on the front panel.

IMG_4433

Skipping forward a few steps, the AC input connector and fuse has been installed and wired to the front power switch and power supply.

IMG_4434

I used 4 wire 22 gauge shielded security system cable from McMaster to make the internal connections from the driver board to the DIN connectors. Where the wires connect to the Phoenix connectors (also called Euroblocks, those green pluggable screw terminal connectors) I terminated the wires with wire ferrules and heat shrink over the cable covering.

IMG_4416

Using wire ferrules instead of bare stranded wire in a screw terminal is good practice, as the strands of wire tend to get broken in screw terminals, increasing the contact resistance.

If you’d like to learn more than you ever probably wanted to about wire ferrules and their use, see this white paper from Weidmuller.

IMG_4435

IMG_4436

A cable tie mount on the power supply neatly bundles the stepper motor cables.

IMG_4437

One last overall shot

IMG_4438

At this point I thought I was done. However, my decision to use the 4 axis all-in-one board was bugging me. It’s known to be buggy, and if one axis blew the board could be taken out entirely. In the name of making a more robust driver, I switched to individual axis drivers and a break out board.

513su4LQ-GL

The breakout board was pretty easy to mount. 4-40 self tapping screws and nylon spacers secured the board to the enclosure panel. The individual drivers where more challenging. There wasn’t enough room to lay them flat, which meant they need to be mounted on the edge of their heat sink. I thought about a few ways to mount them (screws coming up from the bottom, adhesive, pieces of all thread) before I came up with the idea of using a small strap through the heat sink fin.

Using the same 0.090″ aluminum, I machined some 3/8″x4″ straps, with 1/8″ holes for 4-40 hardware.

IMG_4463
Laying out a hole pattern to space the drivers on a 2″ pitch.

IMG_4464

First test fit.

IMG_4466

Success! The driver is firmly attached, and most importantly, I can remove the driver easily if I need to change setting on the DIP switches. An added bonus is that the heat sink can conduct some of its heat away to the aluminum panel beneath it.

Fortunately the wiring I had made previously for the stepper outputs fit fine, so those did not have to be remade.

IMG_4467

Some labels on the back finish the driver box off.

IMG_4443

IMG_4444

Advertisements

Sherline Mill Oiler Repair

While browsing the sherline website I stumble upon a page that describes a feature added to the CNC mills in 2010. It’s a series of passages in the saddle and an oil reservoir. This oiler system sends lubricant to the lead screws reducing wear. This is very important on a CNC machine as the axis moves much more and much faster than a manual mill ever would. Furthermore, the sherline uses a very simple 1/4-20 UNC threaded rod as the lead screw, which is much higher friction than the ball screw found on most CNC mills. I didn’t see this on my mill when I picked it up, but when I looked closer, what I though was a setscrew was actually the broken off remainder of the oil reservoir.

P1020358

The previous owner must have either over tightened it, or run into it with a mill. I used a screw extractor to remove the broken piece. It came out easily, it’s made of aluminum so the tool had no problem getting a good bite.

P1020360

I ordered the replacements through sherline, PN 50930 for the oiler body, and 50920 for the cap.

P1020364

Installation was as easy as screwing in the body.

P1020366

This was one of the easier repairs I’ve ever made, and a really pleasant discovery, as now I know that the mill is at most less than 4 years old.