VFD Installed

Initial VFD Integration

My initial spindle integration was done on a borrowed spindle, with a borrowed Huanyang VFD (both of the type found all over eBay), side-by-side with the Lenze SMV VFD that I first purchased for my machine.  This was mostly a matter of getting over the learning curve of properly programming the various parameters of each VFD.  Here, since the spindle was running only for seconds at a time and under no load, the spindle was uncooled – but try that only at your own risk.

Initial VFD integrationI did get both VFDs working, but ultimately the Lenze VFD fell short of expectations for me.  The quality was good and it was easy enough to work with, but the main selling point of this unit (which is considerably more expensive than eBay VFDs) is that it offers vector speed/torque control, which is supposed to allow a much broader range of spindle speeds, maintaining respectable torque down to much lower RPMs than a traditional VFD.  
However, I was never able to get the vector modes working.  There’s an auto-tune function that is supposed to determine the motor parameters for vector control – but every time I tried it, it either failed to tune, or it completed but wouldn’t run the spindle.  The other option is to enter motor parameters manually, but no such parameters were published for this type of eBay-grade spindle. Inquiring with the seller got me absolutely nowhere – they didn’t even understand the question.

The final nail in the coffin for the Lenze VFD was that certain valuable features – namely dynamic braking and modbus communications – are sold as add-on modules.  Unfortunately, they’re also quite expensive – over $100 each – which would have pushed my total VFD cost to over $600.  

That put me over the edge, so I offloaded the Lenze VFD on eBay and bought a Hitachi WJ200-022SF to replace it.  The Hitachi is very comparable in price to the Lenze, but it natively supports modbus control and it contains a built-in braking unit.  Braking still requires adding an external braking resistor, but that’s a problem that can be solved with careful selection of high-power resistor – which can be found cheaply as surplus. 

This leads me to an important lesson learned – there are compact chassis-mount, aluminum-body wirewound power resistors readily available – usually gold-anodized.  I tried to use them, but each one failed (open-circuit) during the very first braking event.  These resistors are commonly rated for 50W, but the job of braking a spindle involves a very short, high-current spike lasting a second or less – somewhat of an impulse.  In my experience, that proved to be too much for the resistive wire coil in these resistors.  

DO NOT use this type of power resistor for braking!

Instead, look for tubular-style ceramic power resistors, consisting of wire or metal ribbon wound on a hollow ceramic core.  They’re quite a bit larger – typically 6 to 8 inches long and an inch or more in diameter – but they are able to absorb the current impulse involved in use as a spindle braking resistor.    

The inertia of a typical 400Hz router spindle is not that large, so the total amount of kinetic energy that needs to be dumped into the braking resistor per braking event is not tremendous.  In practice, I found that the resistor will warm up enough to feel the difference by touch, but even after repeated braking cycles in quick succession it still didn’t get hot enough to be concerning.

Why is braking important?

Spindle braking is something I didn’t know I needed before I bought my first VFD, but the value became apparent pretty quickly.  High-speed spindles necessarily have decent bearings and balance, so once spun up to 24000 RPM they can take many seconds to spin down to a stop if allowed to freewheel.  

Personally, that was enough to get me concerned about safety – in the event of a problem during operation, when the machine needs to stop due to a detected fault or operator intervention, I’d really prefer for the spindle to not keep spinning for 10+ seconds.  (Of course, if it was actually cutting material at the time, then it would stop much more quickly)

VFDs can actively slow the spindle down, faster than the inherent friction would otherwise achieve, but their ability to do so is relatively limited without somewhere to dump energy.  VFDs work by taking the AC input power (240V 60Hz single-phase, in my case) and rectifying it to high-voltage DC which goes into very large storage capacitors.  The VFD uses power transistors (e.g. IGBTs) to drive each of the 3 motor phases with an AC waveform, which is synthesized from the HV DC.  When braking, the spindle motor actually acts as a generator, and the VFD is able to dump power from the spindle back into the HV capacitor bank, which charges these capacitors to a higher voltage than the nominal level of the rectified input power.  

Here a limitation comes in, because the capacitors, transistors and all other associated circuitry can only tolerate just so high a voltage.  Any decent VFD is smart enough to protect itself from overvoltage by stopping the braking action – usually manifesting as a brief period of braking, followed by tripping a fault condition – after which the spindle freewheels the rest of the way to a stop.  Braking using this method can still achieve a modest improvement in deceleration time, but in my experience it was still a few seconds at best.

Dynamic braking solves this problem with the use of another high-power transistor on the HV DC bus, which can turn on once the DC voltage rises above some threshold, dumping the excess energy into the external high-power resistor.  With this method, braking can be substantially faster – I’ve got my deceleration time set to about 1 second.  I’ve tested it to even faster values, but it starts to get kind of violent – more like slamming the spindle to a stop, which doesn’t sound good and can’t be great for the spindle.

VFD Installation

VFD InstalledDue to the higher voltages, heat and electrical noise associated with the VFD, I elected to install it in its own box, separate from the rest of the machine control electronics.  The box I ended up with is a pretty tight fit, but I was able to get the VFD, braking resistor, auxiliary cooling fan, and a 30A contactor all in there.  An XLR jack brings in lines from the main control box including power to the 12V fan, 12V to switch the contactor (which switches 240V power to the VFD) and RS-485 for Modbus control (more on that in a future article)

With the ‘rolling chassis’ of my CNC router together, my focus shifted to mounting cable chains on the three axes to support all the wiring.

I ordered all my cable chains from IGUS – they come at a premium price relative to the Chinese cable chains you find on eBay, but you the quality is high and you have a lot of options – width, height, enclosed or open, snap-open on either the inside or outside radius, minimum bend radius, mounting options on either end, internal dividers, and exact length.  The removable slats can pivot open in either direction, and can be easily removed entirely.  They snap in very securely and so far none of them have broken in the process of removal or reinstallation.

X and Z cable chains mountedThe X cable chain is naturally the longest, and I also didn’t want it to be able to sag down below the bottom of the gantry, where it might catch on something while the machine is running.  I mounted it at either end using simple brackets that I welded up from steel angle iron and U-channel.  I later ended up switching to a piece of 1515 extrusion for the end that mounts to the gantry (see later photos).  Pictured here, there is a small L bracket which supports the chain mid-span, but for a more robust solution I subsequently added a sheet metal tray that provides better support.  I also elected to flip the X cable chain around the other way relative to the first photo, so that I could install the control box(es) on the right-hand side of the machine.

X cable chain support trayThe support tray is simply thin sheet metal, bent into a channel shape using a bending brake, painted black and mounted using some off-the-shelf steel L-brackets (redrilled to match the T-slots in the extrusion)

The Z cable chain needs to be long enough to clear the drive motor (not shown) throughout the full range of motion of the axis.  I found that with the chain flush mounted to the front and back of the Z axis, it rubbed against the motor, so I designed mounting brackets with enough of a standoff and a slight angle to mitigate this.

I used a short length of 1530 extrusion anchor fastened to the riser extrusion to mount the top of the Y cable chain.  While I was at it, I switched the bottom mount of the X chain to a piece of 1515 extrusion for more versatility.  The Y chain is mounted using another 3D-printed adapter bracket, since the mounting holes in the chain end don’t match the width between the T-slots.Y cable chainThe bottom end of the Y cable chain mounts to an assembly made of two pieces of 1530 extrusion, mounted to the underside of the base with standard angle brackets.  This arrangement is strong and adjustable so it was easy to get the chain positioned just right.  
Incidentally, this is the second Y cable chain I tried – the first had an unnecessarily small bend radius, and turned out to be too narrow to comfortably fit all the cables and hoses

IGUS does sell an array of different dividers that can be installed in the cable chains to partition them to keep wiring organized.  I found it a bit confusing to try to spec and order those, and I expect they may have been a bit expensive anyway, so I came up with my own design and 3D printed several dozen of them.3D printed cable chain dividersThese snap onto the slats of the chain – I placed them every 3rd link or so.  These were a tremendous help in achieving clean cable runs, as well as segregating signal lines (sensitive) from power lines (noisy) and the water lines for the spindle. 

  I also 3D printed a number of cable clips that bolt to the frame extrusion and clip shut.  Each of these clips was designed with slots sized specifically for all of the cables/hoses that go through it.

Cable organizerI placed several such clips in various spots across the machine – anywhere that cables needed support.  The nice thing about these being 3D printed is that any time I need to add or change anything, it’s a simple matter to just modify the design and print another.


For all of the Clearpath servo wiring, I elected not to purchase the power and control cables from Teknic – they’re nice, but they come in fixed lengths, so I would end up with a lot of excess cable to deal with.  Instead, I ran SJOOW rubber-jacketed 16/2 power cord for the power wiring, and stranded shielded ethernet cable for the control signal wiring.  In a later post I’ll detail my control electronics, but suffice it to say that the control wiring connects to my breakout board via RJ45 connectors, so I simply bought off-the-shelf ethernet cables, cut them in the middle to length, and terminated that end with the appropriate Molex Mini-Fit Jr connector to go into the servo.

One big plus of the pre-made wiring that Teknic sells is that the connectors have an overmolded strain relief.  I wanted to emulate that, but don’t have any capability for injection molding, so I did some experimentation.  I 3D printed backshells in TPU filament, which is flexible, in two halves (clamshell).  Those get clamped over the back of the connector, with some silicone in there for good measure.  The beauty of using a thermoplastic like this is that with the backshell in place, I simply ran a soldering iron around the seam which sealed the two halves together.  This worked great – the two halves show no signs of pulling apart without being cut. Clearpath servo connector "overmolds"

I had to do some adaptation to connect water lines to the spindle.  The fittings on this (imported) spindle are compression style, meant for 6MM ID tubing.  The barb is rather small, and I was not happy with how secure they were(n’t) when I tried to stuff 1/4″ tubing on there.  I was able to source small enough tubing, but I didn’t like how thin-wall it was.  My solution was to use a short length of that tubing to get out of the spindle, up into the Z cable chain, and then an inline barb fitting adapts it to standard flexible clear 1/4″ ID PVC tubing with a sufficient wall thickness that it’s not so prone to kinking.  I also incorporated a piece of spring stock over the thin-wall silicone tubing to add more resistance to pinching or kinking.

I’m still not completely thrilled with these water line connections – because the tubing is so soft and thin, even with the compression nuts tight it would still be possible to tug the hoses off the barbs.  Someday I will revisit and improve that, but for now it’s held up.

More to follow on the rest of the water cooling loop in a future post…