Overall design strategy for simple logic to control a lathe? - Page 1
Forum section: electronics / projects

author: alanambrose
author_rank: Frequent Contributor
timestamp: June 29, 2023, 11:41:42 am
content: Hi,This is for home use, so I don't need a full-fat industrial solution necessarily. I'm looking to get to the solution fairly quickly and easily without industrial levels of expense. I may need to do a mill next.I need to make a controller to drive vfd digital inputs mainly from momentary push switches. I need a little bit of main contactor drive before the vfd. I need a little bit of basic logic e.g. forward and reverse can't be selected at the same time, only one of 5 speed settings can be selected i.e. they're mutually exclusive. And I need the momentary switches to drive latches - so when the forward momentary is pushed it latches the forward signal until either stop or reverse is selected. Some debounce on the switches would be good. Not much more than that. I might want to amend the control logic a little as I use the lathe and therefore figure out a slightly better user-interface.I am good with low voltage hardware, software, firmware but know little about control panels, PLCs etc. The vfd expects standard 24V signals.Should I build this with say 5V logic and a 24V interface, say on a vero-style breadboard? Arduino-style with a 24V interface? Low end PLC? I could, but would rather not spin a custom board for it just because of the time involved vs. the small amount of logic required. The vfd can even be controlled by modbus...Thoughts from people who know about this stuff?Thanks, Alan

author: beanflying
author_rank: Super Contributor
timestamp: June 29, 2023, 12:15:26 pm
content: Is your VFD actually a 4-20mA signal input rather than a 24V signal to control speed? A simple 5-10k Pot is also often used across a 5V rail (like below) which would save a lot of fuss. Or on a lot of them you have a choice of connections from these on the same VFD.I have had a play with a similar board to this ages ago with an ArduinoeBay auction: #172762112695for a 4-20mA controller so worth considering rather than reinvent the wheel for a few $ So you use this but controlled with 0-5V from your Arduino if you go down that path.Fairly 'normal' for direction to be a common and two connections like this really general diagram (just so everyone is on the same page) all you need here really is three states Fwd, Brake (time delay of X seconds until stop), Reverse. Jump to fast and the VFD smoke will escape. Easy to do in code and for a little isolation relays off an Arduino if you decide to use one. ** Don't forget the Diodes lest you release Arduino smoke.

author: jwet
author_rank: Frequent Contributor
timestamp: June 29, 2023, 12:21:44 pm
content: Industrial stuff like this generally uses (or used) kind of relay logic. "Motor starters" are a stout relay with auxiliary low voltage contacts that let you make little logic circuits like latching. Big names are Allen Bradley and Schneider. Don't worry about switch bounce, everything is pretty slow to get going and you've have to hold buttons down. They also have over load circuits as well. They rely on a certain electrician type jargon that takes some getting used to. Relay logic is a bit confusing for electronics guys but pretty simple. VFD's came from this world and they generally have provisions for start, stop, reverse etc. Most accept an external pot input for speed. If you want presets, you could make this a rotary switch with fixed resistors, etc. Look at your VFD documents, its likely that you can do what you want with little more than switches -- even power is brought out. I would avoid Arduino's etc- extra complexity and EMI problems will be frustrating. The simplest setup is to be remove the control head- the little LCD panel and some buttons, from the VFD and double stick tape it to your lathe. Many VFD's let you pop out the keypad and remote it and remote it. Put the VFD elsewhere (don't bury it, they need airflow) and have the panel close at hand. A lot of VFD's these days are Chinese and have terrible manuals. Luckily they're mostly copies of western designs. Get a copy of the western manual to help you decode the Chenglish. Hope this helps.

author: alanambrose
author_rank: Frequent Contributor
timestamp: June 29, 2023, 01:40:59 pm
content: OK thanks for responding and good points. The vfd is a good quality Kaskawa GA500 rather than no-name. It comes with a 768-page fairly well-written manual! - longer than some micros that I've used. The typical set-up is below from page 51 of their manual.>>> A simple 5-10k Pot / you could make this a rotary switch with fixed resistorsYeah, one of those solutions might be simplest.>>> The simplest setup is to be remove the control head- the little LCD panel and some buttons, from the VFD and double stick tape it to your lathe.That's what my lash-up is at the momenthaving recently installed a new 3-phase motor and vfd. But I would like to be able to control speed / forward reverse / eStop etc with proper size buttons rather than fiddling with menus - it might be important at times...>>> Relay logic is a bit confusing for electronics guysYeah, given I am happy designing digital logic with chips, code, karnaugh maps etc, it's causing proper brain-strain. How do you do 'mutually exclusive' with relays for instance.Maybe I need to throw away my generalized software hat for the moment and focus on the key simple stuff.I see a bunch of clone 'FX2N-14MR' PLC boards around - is that a possible direction?Ta, Alan

author: jwet
author_rank: Frequent Contributor
timestamp: June 30, 2023, 03:49:50 am
content: I hadn't seen those cheap PLC's (FX2N-14MR), pretty cool. I think even that is over kill probably but couldn't hurt, the VFD will likely do what you want. You're going to have to build a little box with buttons and switches any way and having a $30 PLC sure couldn't hurt. Bare Arduino's really have no place in a shop. I try to keep all this stuff as simple as possible in my shop- nice big Allen Bradley Buttons, big fuse holders and terminal blocks with labels. I have to say though I do love VFD's, what a god send.Good luck/

author: H.O
author_rank: Frequent Contributor
timestamp: June 30, 2023, 05:08:35 am
content: Have you checked the VFD manual regarding "3-wire sequence"?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 03, 2023, 12:01:10 pm
content: Most VFD's have an (isolated) low voltage output. It's often 10V so you can directly add a potentiometer for a 0 to 10V speed input signal, and usually this output can deliver enough current to also add some switches to feed back to the inputs.Overall, there is no need to overthink it.I have wired my VFD with a poteniometer and two of those metal penis switches. One switch for CW / CCW and the other switch for On/ Off. For the VFD those are all just logic inputs, so there is no real need to prevent "illegal" switch combinations.For example if I toggle the CW / CCW switch while the motor is running, then it first neatly stops the motor, then waits a (programmable, I think it's 0.5s) time and then accelerates to motor in the opposite direction. I use this a lot. The VFD is connected to my milling machine and I use this for tapping. I have also tweaked the VFD settings to have a low torque at low RPM. I can now tap blind M6 holes and just lett it bottom out and the motor stops because of the torque limit. And this is just with a cheap Huan Yang VFD.If you want 5 preset speeds, then just add a 5 position switch and a bunch of voltage dividers (for the 0 - 10V input) or series resistors (for the 4 - 20mA input).If you want more control, then you can consider using the digital interface. MODBUS is quite standard on VFD's and MODBUS is a very simple protocol. You can also easily find some libraries on "arduino" level programming.

author: alanambrose
author_rank: Frequent Contributor
timestamp: July 03, 2023, 01:04:56 pm
content: I guess that's the problem with having 5 ways to do something>>> I have to say though I do love VFD's, what a god send.I was thinking they add abunchof complexity for not much gain - I'm surprised no one seems to do a much simpler single-phase-to-3-phase boxwithouta 700-page manual.But I do quite like the soft start thing, and I'm sure I'll like it when I can pick from my 5 standard speeds and have a proper e-stop close to hand.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 03, 2023, 01:35:12 pm
content: Also, a VFD can not completely replace the gearbox on a lathe.The motor will have a maximum torque that is independent of the rpm, while with a mechanical gearbox you increase the torque at lower RPM (Motor power stays the same).As a result, you want to use the gearbox of the lathe to get to a "near enough" rpm, and then use the VFD to do the fine tuning. Adjusting the speed to nearly zero is also very handy when you want to do threading on your lathe. In my current setup I have a single VFD and use two contactors to switch the VFD between my milling machine and my lathe. (Switch only when the motor is off) and this works quite well. I would not recommend it though. A VFD such as the Huan Yang costs only around EUR 100, and therefore the extra wiring and contactors are hardly justifiable.You write you also do low voltage hardware, firmware & software. Adding a RPM sensor (with display) directly on the output shaft (so independent of gear settings) is a simple and useful side project. Controlling the VFD with a potentiometer and combining that with an RPM display makes more sense to me than wiring up a 5 (or so) position switch.Wiring up a VFD is fairly simple. You do have to read the manual and adjust some settings for your situation. You can set things like maximum frequency Volt/Hz ratio, boost for low RPM and some other parameters. There often are 100 (or more) settings in a VFD, but only a handful are important.