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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
As always, eagle files and code are available on github: