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

Over Center, Under Pressure

One of the ways the mold-a-rama process differs from traditional injection molding is the way the part is ejected from the mold. Usually one of the dies has a set of ejector pins that pop the part out of the mold (if you look at most plastic products you will see a series of small circular or square indentations on the back side, these are small marks left from when the ejector pin pressed the part out of the mold.) In this lego manufacturing video you can see the thin ejector pins stick out right as the part falls out of the mold at the 40sec mark.

To keep the machine simple, the mold-a-rama uses no ejector pins. Instead it relies on the part staying in place while the molds open around it. This is possible because the bottom of mold-a-rama die is actually open. This is a picture of the bottom of my mold dies.

Bottom of Molds

The base of the plastic part sticks to the tank lid (which is why all mold-a-rama toys have some kind of flat base.) Traditional injection molding dies form a sealed cavity when they meet, save for the sprue, the opening where plastic enters the mold. Mold-a-rama dies form a complete cavity by sealing against the melt tank lid (the aluminum square below the molds, which also serves as a cover for the plastic melting tank). As you can imagine, it is very important that the dies press firmly against the melt tank lid, otherwise plastic would leak out between the dies and the tank lid.

Below is a CAD screenshot of the mold cylinder assembly I originally made, the die is the blue rectangle. Can you guess if they functioned correctly?

overcenter_cyl_mount

The answer is no, no they did not. When the dies closed against each other they popped up slightly, instead of being forced downward to seal against the melt tank. The can been seen in the video below. Watch towards the end and you will see the pair of molds raise up slightly.

 

If I were to run this in an injection cycle I would have melted plastic spewing out.  After some head scratching I realized I had the mold cylinders (the grey rectangular part in the CAD screen shot) placed above the pivot point (the grey circular part), this meant that when the molds pressed against each other it tended to rotate the entire mold cylinder and mold counter clockwise about the pivot point, which meant the mold moved in the upwards direction. I tested this theory by flipping the entire mold cylinder and mount upside down. Now the mold cylinder was below the pivot point, which meant the mold cylinder now tended to rotate clockwise about the pivot point, forcing the die downward. This video shows how the molds are forced downward when they meet.

 

Armed with this realization, I redesigned the mold cylinder mounts to match the flipped version I had tested. With the two designs side by side (old on left, new on right) you can see how the mold cylinder location has changed relative to the pivot point.

compare_mounts

I also used this as an opportunity to to redesign the way the dies are constructed and how they interface with the mold cylinder, but that is for another post! Below are some pictures I took while machining the parts for the cylinder mounts.

photo 1

photo 2 (1)

The above part was the first part I CNC cut on my mill and boy was it a learning experience. I probably scrapped 3 or 4 parts before I made the first one correctly. Between fixturing, weird g-code bugs, and getting feeds and speeds right I learned so much on that first part.

The final product. The slotted screw holes allow me to fine tune the position of the die at the extended position. The bolts holding the bracket to the cylinder have serrations under the heads which bite into the aluminum.  This prevents the cylinder from slipping relative to the bracket when the dies meet. The other large cutouts are clearance holes for the cylinders air fittings.

P1020523

 

The Apartment Workshop Series: Mini Mill

I’ve been thinking about getting my own mill for several years. I just like the idea of being able to shape metal. For the type of odd ball projects I like, I end up making a lot of my own parts, or customizing off the self ones. Having a mill allows me to do that easier and with much greater precision. I briefly looked at 3D printers, but parts produced on them have such low mechanical strength they really aren’t suited to my projects. Plus I like the idea supporting subtractive manufacturing (milling), as all anyone ever talks about is additive manufacturing (3d printing) these days.

Picking a mill can be a daunting task. There are so many factors to consider: price, working envelope, CNC or manual, construction, spindle type, etc. Being that I planned on operating this inside my living room, my options quickly narrowed. After much research I found several machines that fit the bill:

Little Machine Shop 3900 Solid Column mini mill

480.3900

Taig Micro Mill

nmmill19a

Sherline 2000/5400

5400pic

The taig and sherline are a closer match, as the LMS mill is more of a mini mill, while the others are more micro mills. The LMS mill was my favorite due to the much heavier construction, more powerful motor, and standard r8 spindle. However it is just slightly too large, on it’s own it is not that big, but when you factor in that it will need an enclosure (which is kind of a must have if you plane on running a mill inside your house) it just get’s too big.

Between the taig and sherline, I prefer the taig. It’s heavier steel construction make it much stiffer than the all aluminum sherline. Neither one will handle steel all that well, both can easily do plastic, but for aluminum the extra rigidity of the taig helps reduce chatter.

I was all set to buy a taig, but I came across a deal I could not pass up on craigslist. I got a sherline 2000 CNC ready mill, with steppers for less than 1/3rd the retail price. Whoever was using it last was cutting wood, as there are wood particles all over. It will need to be disassembled cleaned and lubed before use.

photo-2

It fits very nicely on my workbench, and even when an enclosure is added it should not hog too much of the work surface. It did not have a control box, so I’ll need to start looking at stepper drivers, power supplies, and machine control software. Looking forward to this!

Sealing it

With the melt tank installed and the pump body assembled, I can now start fitting the injection cylinder to the tank. The large (50mm!) air cylinder moves a piston in the pump body to draw in molten plastic, and then force it into the mold cavity. The piston seals to the pump body with a cup seal. The original mold-a-rama actually has no seal on the piston itself, it seals around the shaft of the injection cylinder, the seal can be seen here:

DSCF5337

This is the injection ram of the mold-a-rama. The seal is in the center of the picture on the aluminum plate, the fiberglass insulation is covering the tank.

Installing the seal was a real bear. The cup seal is sized for a 3″ cylinder, it flares out to ~3.25″ OD to press against the cylinder walls. I needed to compress is to fit it into the cylinder. Softening the seal really had no impact on it’s flexibility, what I really needed was a piston ring compressor. Lacking that I used several daisy chained cable ties. That still didn’t work well so I used some plastic tools to push the seal in.

IMG_0290

I wasn’t sure what to use to insulate the melt tank until a fateful trip to Lowes. In the pipe insulation section I found this self-adhesive aluminum foil backed foam tape. The adhesive holds up to the tank temperatures, and the heat radiating off the tank is noticeable reduced (as measured using the calibrated portion of the back of my hand).

IMG_0292

I looked long and hard for a plastic water tank that was compact, but had a large enough opening to fit the water pump through. The water pump is supposed to be submerged in the water tank, this  will extend the pump life by keeping it cooler. I gave up on finding a plastic tank and made a metal one myself. The body is made from 6″x6″x.120″ wall aluminum tubing with a water jet aluminum flange and lid. A cable gland seals around the power cable. The gold cylinders sticking out from the flange are rivnuts, those along with thumb screws will allow tool-less removal of the water tank  lid for refills. I plan to add a sight glass later on so I can check the water level with out removing the lid.

IMG_0712

The mount for the mold delivery cylinder (the one that pushes the finished plastic part into the retrieval bin) is made from a small piece of 1″x3″ aluminum tubing welded to the top frame and a shaft collar.

IMG_0713

The lower half of the aluminum shaft collar is welded to the back of the rectangular tubing, the upper half is free  and is what clamps onto the cylinder.

IMG_0714

The molder is pretty awkward to move around as it doesn’t sit on a wheeled base. I added handles to each side to make moving it a little easier. The first set of handles I got from McMaster were plastic, thinking the machine couldn’t weight more than 100-150lbs, it turns out I forgot to take into account two very heavy items: the water chiller and the compressor. After putting those in, the machine weights closer to 200lbs. The plastic handles were quickly swapped out for some beefy aluminum ones. I’ll still probably move the machine with the compressor and chiller removed, but now I have a lot move confidence in the handles while moving the machine.

IMG_0717

And finally, before I go, a sneak peak of the new molds!

IMG_0725

Build Blitz Weekend 1

With the deadline for complete rapidly approaching, progress has stepped up. I spent most of my Saturday machining, welding, and cutting.

The bottom of the main valve on top of the injection cylinder has pipe threads to accept a compression fitting. One note about pipe tap, you need to be really careful about your tap depth. If you tap too deep with a tapered pipe tap you can end up in a situation where your fitting bottoms out before the threads tighten up, leaving you with a leaky pipe connection. So pay attention to that thread call out and test with a fitting if you are unsure.

IMG_0261

Here are all the parts for the injector valve assembly. This regulates the flow of plastic and air into the mold cavity via the shuttle valve sliding back and forth.

IMG_0262

Starting hole layout for the melt tank. I kind of wish I had used steel for the tank instead of stainless steel. Stainless is a real pain to work with. It’s hard to cut, hard to drill, hard to bend, hard to weld. Just really unfriendly in general. The original mold-a-ramas used an aluminum tank, but I got a really good deal on the stainless tank I started with to make this part.

IMG_0263

Another area where I’m differing from the original mold-a-ramas is the piston design. The original injection cylinder sealed agains the rod of the hydraulic cylinder used to inject plastic for the melt tank to the mold. In my design I have the seal on the piston. I’m very nervous excited to see how well this works. There is another disk, not shown, that will retain the seal against this piston.

IMG_0264 IMG_0265 IMG_0266

 

A few more from this weekend:

IMG_0267

I really need to hire a hand model.

IMG_0268

 

There are a few more bits and pieces that need to be fabricated (frame for cover, water tank, brackets for a few items), but the bulk of it is done. Next up is programming, wiring, and test/debug.

Mold-A-Rama Build Begins

I have spent the last 5 months designing, buying parts, redesigning, and buying more parts. I am finally at the point of cutting metal and bolting stuff together (the fun part). I have to say, it feels pretty good. Below you can see the 80/20 frame (mostly 1010 series with a lower frame made from 1020 series extrusion) , it is still missing a few crossbars near the top, as I hadn’t yet tapped the ends of the extrusion to accept a corner fitting.

I was initially concerned about how rigid the 1010 uprights would be given that the they are only attached to the bottom 1020 frame with two plates each. I found that it holds up surprisingly well to small amounts of force (hand applied), and this is even without the aluminum weldment that fills the space between the two angled bars. You can also just barely make out the waterjet cut 120 degree brackets on the front angle.

photo (12)

No longer just shapes on a computer screen.

I’m also very close to some initial tests with the pneumatics. I have new sensors for air cylinders that interface better with a micro controller, and have started breadboarding the transistors to drive the solenoids valves.

Process Control Using Arduino

This project involved designing a device to regulate the flow of chilled water through a heat exchanger based on the coolant temperature of an internal combustion engine. It’s made up of three parts: A controller, a motorized valve, and a temperature sensor.

The controller consists of an arduino, a LM298 based motor driver, resettable fuse, LCD and misc. buttons/connectors.

The motorized valve is a standard ball valve with a bracket to support a gear motor and a encoder for position feedback.

The operator inputs a desired coolant temperature which is maintained by adjusting the flow through the heat exchanger. During this project I learned about driving inductive loads with a micro controller, PID tuning, and closed loop feedback control.