Variable-Frequency Drive

I’ve just finished the variable-frequency drive (VFD) for my 1970s Schaublin 102 lathe. Before I dig into details, there’s a youtube video here:

My new VFD drive in action

I bougth this lathe around a year ago and it came with a bulky, two-speed 3-phase motor. My workshop at the time didn’t have a wall outlet for 3-phase power so I decided to run the lathe on regular 1-phase 230 volts using a frequency inverter. I knew that this kind of motors run poorly on inverters but I tried anyway. The result was even worse than expected, it barely ran and lacked any torque.

The old drive

So as expected I had to get a more suitable motor. After a bit of online research I ordered a physically smaller, 080 size Lenze MF series motor. This series of motors is specifically designed for inverter operation and offers constant torque over a wide range of frequencies. I sized it to offer slightly more torque than the original motor but that still resulted in a considerably smaller size and weight.

New motor temporarily mounted

I temporarily mounted the new motor with an adaptor made of 3 sheets of wood and added a cheap RPM meter I ordered on Alibaba. With a pot and two switches quickly mounted on top of the motor I got a working lathe. The new drive offered enough torque in all situations I encountered as well as a wide range of speeds. The main downside was that I lost the 3-speeds the lathe originally offered because the original V-belt pulley with its 24mm bore would not fit the new motor’s 19mm shaft. So I started to design a more permanent arrangement.

Carelessly mounted Alibaba RPM meter worked reliably (but super slow)

Just turning an adapter for the original pulley was not really an option because that would have resulted in a top speed of 8000+ RPM while only going down to about 200 RPM in low gear. So I decided to use the original pulley but with a fixed 2:1 reduction before that, giving me a more useful 100-4200 RPM range. For that purpose, I decided to use a 25mm, HTD-5M toothed belt.

Basic arrangement with shaft, bearings etc.

After playing around with several different designs in Fusion360 I started turning the various parts above. The motor, gearing as well as the inverter and controls were to be held together by an aluminium structure.

The 2:1 gearing at the core of the new drive

With the mechanics in place I started designing the electronics around it. For me, that’s the easy part 😉 Obviously, I need a pot and a 2-way switch to control the speed and direction plus a main switch. But since my lathe doesn’t have a lead-screw and hence can’t cut threads I thought I might one day want to add a CNC control just for that purpose. So I wanted to be able to remote-control the entire drive as well as to provide the necessary signals for a CNC control to monitor the speed.

Basic construction using 4 aluminum plates

While the chinese RPM meter worked reliably, it reacted super-slow to changes in speed and the bulky sensor proved difficult to mount in an elegant way. On top of that, it offered only a resolution of a single impulse per rotation and no information regarding the direction of rotation. I googled a bit and ordered a GTS45 gear tooth sensor from Renishaw. Its output is a standard, 90 degrees out-of-phase quadrature signal. Despite being a quality, industrial grade sensor, it only costs around 20 EUR and they are happy to sell them in single quantities. I also ordered a maching 90mm, 64-tooth tooth weel.

The remaining 64-thooth thooth-wheel with sensor in the background

I turned away most of this tooth wheel until only a rim with an 80mm bore remained. That then fitted nicely besides the pulley on the headstock. I decided to design my own RPM meter and to fully integrate it into the rest of the control. This reduces everything to a single PCB which simplifies wiring quite a bit.

Front panel

I wanted to have nice, large switches on the front panel even though the forward/reverse switch only provides a control signal and doesn’t switch any power. I also turned a know for the pot out of 1.4305 stainless steel. Together with the 4-digit 7-segment display, the physical layout was pretty much given. So I had to design the PCB to somehow fit in.

Back side of the front panel

To simplify things, the control runs right off mains voltage which is converted to 12V and 5V DC right on the board. The 12V rail is used to power the sensor as well as to operate 3 DR12 relais. Everything else runs on 5 volts. The inverter is controlled by two of the relais (one for forward, the other for reverse) while the third relay is used to choose beween two speed sources, one from the front-panel pot, the other one from an external input.

PIC microcontroller and input filtering

At the core of the design is a PIC16F18855 microcontroller. There are numerous inputs and outputs:

  • Forward, Reverse and Speed output to the inverter
  • Inputs for the forward/reverse switch and the pot on the front panel
  • Inputs for the quadrature signals from the sensor (as well as power supply for the sensor)
  • Inputs & outputs for remote operation: Enable, On and Reverse digital inputs, speed analog input (0-10V) and quadrature digital outputs

All digital inputs are RC-filtered and Schmitt-triggered before they are used. The PIC consumes all these inputs and then controls the display and the 3 relays accordingly. The cleaned inputs from the sensor are then also made available for the remote control via ULN2003 darlington pairs.

State of digital inputs is displayed via LEDs

The state of all digital inputs as well as the relays is clearly displayed using LEDs. While these are invisible inside the case, they are valuable while programming and setting things up.

Final assembly

With the motor coated with 2-component paint in RAL7031 blue grey, everything was assembled and wired using shielded wires. All that remained was to install it on the lathe and to try it out.

Finally. The new drive is mounted on the lathe and ready for use

For testing the remote operation functionality, I had to build some sorts of a remote control first. Besides the switches and a pot it also needed an RPM meter capable of dealing with quadrature signals. For the fun of it, I designed my own. I’ll describe that in a future post.

Remote control using a DIY RPM meter

As always, eagle files and code are available on github:

5 thoughts on “Variable-Frequency Drive”

  1. Nice job!

    Dont you think it is safer to stop the machine first before reversing direction? Now if the user (you) stops the machine, but accidently reverses the direction, your first thought would be it actually stops, but then it speeds up again. Safe would be: Switch direction to zero. After the machine stops, switch to an different direction. If directly an different direction is chosen, the machine stops, but only starts again if the switch is first set to zero.

    Also, please cover up the belt.

  2. Lukas,

    You are talented engineer. In general and also in specifics as an electronics, electrics and mechanics. Nice solutions. Thanks for sharing.

    With regards,

  3. Really. That’s not building a VFD. That’s making a controller for a purchased VFD and not even a very fancy controller.

  4. I’d also prefer the title to be sth like “lathe VFD upgrade”.
    But, congrats, it does look like all the work resulted in a nice build!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.