CNCCookbook: Be a Better CNC'er

Do you want to be a better CNC'er in 37 Seconds?

Get Better Tool Life, Surface Finish, and Material Removal Rates Fast.

It's that easy. You can install and get results now.

IH Mill VFD & CNC Spindle and Coolant Control

The work required to control the mill spindle from Mach3 is not terribly hard, but there are a lot of details, so I've split it off to a different page to make it easier to follow this subsystem.

Controller Board Selection

Given the Smoothstepper and Geckos handle the 6 axes worth of motion, and the safety circuitry is covered, the next thing is what's needed for spindle and coolant control. Controlling the spindle typically means outputting a 0-10V DC signal that controls speed and having 2 signals that control spindle on/off and forward/reverse.

Lots of ways to skin this cat, but my favorite is the PMDX-106, because it has front panel overrides for spindle on/off, direction, and speed. Sweet!

That's a lot of Doh-re-me for essentially just the extra front panel controls. There's also a Safety Charge Pump interlock, which is nice and could be daisy chained into the E-stop circuit, but there is a much cheaper alternative. Homann Designs has a board called the DigiSpeed SD that's only $30. You get the variable spindle control voltage and 2 relays for start/stop and direction. I've got no charge pump circuit, so I'd have to rely on some other means of shutting down my spindle in the event of an E-Stop. It can't be too hard to put something in series with the spindle on/off output though, so I'll noodle on that and plan to use the Homann board.

Alternatively, the CNC4PC Variable Speed Control Board is pretty similar to the Homann Digispeed also, and costs $32.50.

Coolant control is easy, I just need 2 relays controlled via the breakout board outputs. The CNC4PC dual relay board fits the bill nicely for $18. I'm thinking a couple of IES sockets for power cords on the rear auxilliary panel will complete the coolant control.

CNC4PC Variable Speed Control Board $32.50

A breakout board to allow point to point wiring for a Smoothstepper.

Homann Designs DigiSpeed SD $30

0-10V DC control signal for VFD plus 2 relays for on/off and direction.

PMDX-106 Spindle Control Interface $89 - $109

- Works with 0-5V, 0-10V, and potentiometer interfaces to the VFD to control spindle speed.

- Optional front panel potentiometer and switches allow forward, reverse, and variable speed overrides of Mach 3 along with LED indicators.

- Full isolation works with non-isolated VFD's

- Filter can limit speed ramp for sensitive controls

- Charge pump safety interlock

- Needs either 7-9V unregulated DC or 5V regulated DC power supply

- Takes a direction input, PWM input (generated by Mach on an output pin), and charge pump in.

CNC4PC Dual Relay Board $18

2 x 10 amp relays either AC or DC

VFD Mounting and Wiring

I'm concerned about chips or coolant getting into the VFD's cooling slots, so I'm doing quite a bit of agonizing over just where to mount it. Most people mount their VFD's up high on the mill head, but this seems exposed to an errant chip. Another possibility is to mount mine on the NEMA enclosure along with the rest of the electronics. Unfortunately this would put it even closer to where chips are being slung that if I stuck it on top of the mill.

My conclusion is I will mount the VFD in a box either on the mill (most likely) or on the wall behind the mill. If I build a flood cooling enclosure for the mill, I may move the box onto the outside of the enclosure.

Based on the VFD manual, I need a box on the order of 9" wide x 13" high x 6" deep. I will likely provide a receptacle on the box for the motor, a 5-pin connector of some kind for control signals back to the CNC enclosure, and a cord with twist lock plug back to the existing receptacle I use for the mill. This box is quite a big larger than the VFD to provide room for cooling.

I wound up buying this little NEMA enclosure on eBay from seller electrical_parts for $50:

It's slightly smaller than the desired dimensions, but not by much. I need to decide whether to put a fan on the box too.

VFD Notes

I'm running a Hitachi L200-015NFU VFD. It's good for up to 2 HP motors, and cost about $200. Rumor has it my CNC4PC motor control board will put out a little voltage even when Mach3 hasn't commanded it to run, but that the VFD has a programmable parameter to deal with that. The answer is to select the active portion of the analog input voltage range. Set parameter A013 to say 1volt (this is set in a percentage) and set parameter AO15 to 0Hz (this should set the frequency to 0 Hz when the cnc4pc is outputting any voltage less that 1 vdc (the AO13 value), and turn off the motor. I'll need to remember to do that when I set up the VFD!

This particular VFD delivers full torque over a 1:10 speed range, so for example with a 1700 rpm motor I can still get full torque at 170 rpm. The output frequency range is 0.5 to 400 Hz, so in theory, I could run my motor quite a bit faster than its rated speed. The problem in doing that for any time is the motor's bearings are probably not rated for it. The accuracy is 0.1% of the maximum frequency.

The input signal is a 0-10 VDC signal, a forward run/stop signal, and a reverse run/stop signal. This is very compatible with my CNC4PC motor control board which will output all 3.

Some configuration notes:

1. Make sure the TM/PRG dip switch is set to TM to accept control from the input terminals.

2. The motor wiring should be AWG12.

Control Wiring:

0-10 VDC output from CNC4PC: Terminal "O"

Ground for 0-10 VDC from CNC4PC: Terminal "L"

CCW1/NO from CNC4PC: Terminal "1"

VCC from CNC4PC: Terminal "PCS"

CCW2/NO from CNC4PC: Terminal "2"

Since the connections to run foward (Terminal "1") and backward (Terminal "2") are NO, and the relay has to close to trigger the spindle, we can assume that E-stop cutting the power to the motor control board will open the relay and thereby stop the spindle in the event of an E-Stop.

Here is the overall schematic for how the VFD is controlled by the system:

Preliminary, and for informational use only. Do not use as a plan for your CNC machine!

I'll be using 22 AWG shielded 6 conductor cable to route the VFD control signals back to the VFD NEMA enclosure.

Some Useful VFD Links

5Bears Installs a VFD on his Enco Bridgeport Clone

PM Article on Wiring a VFD to a Mill

One Stop Buy VFD Cable by the Foot



CNC Mill Conversion:

To Do List

Z-Axis Mod

One Shot Oiler

Epoxy Granite Fill


    Axis Modules

    VFD Spindle


Sale Details

Featured Articles

Step-By-Step Guide to Making CNC Parts

CNC Router Cutter Types

Why Use a Single Flute Endmill?

Step and Servo Motor Sizing

The Truth About Tool Deflection

10 TIps for Router Aluminum Cutting

2 Tools for Calculating Cut Depth and Stepover

CNC Machine Hourly Rate Calculator

Special Purpose CNC Calculators

Feeds and Speeds Guide

CNC Cutter Guide

Feeds and Speeds By Material

G-Code Tutorial

  Feed Rate Calculator

Sales, and Special Deals


GCode is complicated.
G-Wizard Editor
makes it easy.

Try It!


Feeds and Speeds:
Made Easy.

Try G-Wizard



Do you want to be a better CNC'er in 37 Seconds?

Get Better Tool Life, Surface Finish, and Material Removal Rates Fast.

It's that easy. You can install and get results now.


Start Now, It's Free!