-
25-08-2016 #1
This thread is for those who are interested in trying out Modbus, using only two thin twisted pair wires and Mach3 brains feature. So if you are not interested, save the time and leave now because it can be boring and too long for you.
Most people use 0-10V and inputs of their VFD to control the spindle speed and direction. That simple straight forward solution has been around for ages and widely spread, but has some disadvantages because it demands a good and reliable, very linear 0-10V PWM generator and several wires, all these may be noise sensitive, causing unexpected behavior as well as using up several digital inputs and outputs of the VFD and the BoB. I don't know why so few people are interested in other ways of controlling the VFD, perhaps it is because they think it is too complicated, or don't know better and do as they always done, or as others seem to do. Some of those who try a different approach are trying to find plugins for their VFD and that is not always possible and definitely not necessary, because Mach3 has a ready made function for this, which is fairly easy to adapt to any VFD, but it is pretty badly documented.
With my 40 years of engineering career, mostly in the fields of datacom related and computing business, using digital inputs and outputs and a crappy, unreliable and nonlinear 0-10V DAC felt very strange and stone age, but not knowing better, I thought, this is what most people use, so this MUST be the best way... then I though NO WAY if there is a communication line use THAT... and so like many other, I started to look for plugins for my VFD... realizing that my VFD (Bosch Rexroth EFC 5610) is far from what most amateurs are using, so there is no chance of find anything, I have to make my own, but writing C++ code takes time and I don't have that much of that thing. Then about a week ago I discovered the unknown territory of Mach3 brains and thought that THIS IS IT!
Of course, this ended pretty quick after a day or two in a disappointment because I found some serious limits in the functionality and implementation, so I started thinking that part of my problem can be solved by a macropump macro, which is acceptable if necessary and much faster than I can write a plugin in C++. This was about a week ago, however continued work resulted in finding solutions in Mach3 brain and I have now solved everything I needed to solve and abandoned the macropump use.
A Mach3 brain file is all that is needed to control a VFD and a spindle if only basic functions are needed. Any VFD can be controlled with my solution, using a simple USB - RS485 converter and two wires connected between that and the VFD. Normally a shielded twisted pair wire should be used, but right now I have what I have, which is just a lamp wire, between my PC and the VFD. Of course, that will be replaced with real communication wire later on, but that is not the highest priority now.
Start with wiring and plugging in the RS485 dongle, or connect to RS232 if that is what you want. I can't help with the RS232, I use a simple USB interface, this is the one I bought. I only know of the VFD I have, so I can't help you with connecting yours, you have to ask the seller or consult your manual or the web. Configure the port in Windows and check that it is recognized and working. I have Windows 10 Pro 64 bit on my computers and the dongle is plug and play, no driver needed. As far as I know, there are dongles which may not work under Windows 10, so that is something you have to check out, but I had no issues with mine.
Once you have it all wired up and working in Windows you have to create a Modbus configuration file. Open your manual and find the relevant information. Note that if you are only interested in basic functions (CW/CCW/Stop/RPM) than you only need Cfg #0 and #1. The rest of my configuration is bonus, which I explain later. This is how my configuration looks like, but you need to alter the addresses to suit your VFD:
When you have your manual in hand you can test each address and command if you click on the "Test ModBus" on the top right of the window. Don't continue unless you manage to control the spindle through the test function. From there you should be able to run the spindle CW and CCW and to stop it as well. Remember that for the spindle to spin you must set or send a frequency as well. Remember also that you need to configure your VFD so that it reacts to commands from the communication line. Normally the default is the control panel, but there should be a setup or a DIP switch or a jumper to change that. Again, this is not something I can help with, only if you are using the Rexroth I have, or the other models which are compatible with it.
The brain view looks like this:
Note again that if you are only interested in basic functions (CW/CCW/Stop/RPM) than you only need what is connected to Cfg #0 and #1, which are the two first lobes, i.e. the ones marked CW, CCW and OFF, plus the one where it says "S-word from Mach3". I have edited in some explanations in red, and those I think are pretty simple to understand. Ask if something is not so clear, I'll be glad to explain. Start up brain editor and create your own file using mine as guidelines. I will not post the brain file itself because this way you'll learn more in my opinion.
Basic functions:
Basic functions are: running CW/CCW and stop plus the spindle RPM. These functions are very easy to implement.
The brain reads OEM LEDs for CW, CCW and Run, and sends a data to Modbus output port according to the commands for these rotation controls. The modbus address for this is defined in Cfg #0.
In my VFD data value 129 is the command for starting the spindle in CW direction, 133 is for starting in CCW direction, and 136 is for stopping the rotation. This command data must be sent to holding register address #32512.
To control the RPM the frequency value must be sent with two decimals in integer format, so 24,000 RPM = 400Hz and the data to be sent will be 40000 to holding register address #32513. In my picture the spindle RPM is set to 16,300 and to get there Mach3 must multiply that with 0.6 and send 27166, corresponding to 271.66 Hz. The decimals are truncated, but that doesn't really matter, the RPM is accurate enough.
Bonus functions:
I will explain the rest of the brain if there is an interest for it, but this starting post is long enough now, so I stop here for the time being, except that the rest demands some modification to Mach3 screens as well and also modification of M3 and M4 macros.Last edited by A_Camera; 26-08-2016 at 08:18 AM.
-
The Following 2 Users Say Thank You to A_Camera For This Useful Post:
-
25-08-2016 #2
Thanks A!
I for one have printed this to hard copy and filed it in my Mach3 workshop folder.
Do continue,
Regards,
NickYou think that's too expensive? You're not a Model Engineer are you? :D
-
The Following User Says Thank You to magicniner For This Useful Post:
-
26-08-2016 #3
Thank you. I will continue as soon as I can.
I am actually pretty surprised how little interest there is in both Mach3 brains and the use of RS484 Modbus to control and monitor VFD. It is an industry standard and very common there for a reason. It is an extremely reliable way of controlling machines in generally noisy environment, suitable for many purpose, not only controlling VFDs, but it allows easy adding other type of inputs/outputs which have RS485 interface and Modbus protocol. Even in home environment, for hobby use, I think is very suitable and much better than the one wire one input/output type of solution which is widely spread. OK, as discussed elsewhere, like in every other serial communication, there is a delay introduced, but to be honest, the few milliseconds lost because of the serial communication can be ignored in this type of slow machinery. Advantages definitely overweight the disadvantage of that delay. It is pretty cool to be able to make the VFD do all the things with only two thin wires instead of several relays, using up many inputs and outputs and connecting several thicker wires, which still will NEVER allow the same kind of control and monitor as the Modbus allows. The expansion possibilities are large, adding other extra units with additional digital or analog inputs and outputs is pretty simple as well, just hanging these on the same pair of communication line, since each are addressed, so there is no conflict, each unit knows which one is asked and which one supposed to send an answer.
Reading back values like real RPM, frequency, temperature, output voltage, current, torque or whatever else you are interested to read back is impossible unless you use a communication line. OK, one digital output on my VFD is a pulse output, so I think that could be used for some of that, as well as one analog output cold be configured for another of those values, but it would be so much more complicated to read those two and would need two more wires...
Anyway, I will DEFINITELY use Modbus over RS485 as far as that is possible and see no reason not to. Until recently, I thought that the use of Modbus was out of the question for me, unless I write a plugin to Mach3, so I am pretty happy that this assumption was wrong and nothing more than some configuration and creation of brain file is needed. OK, for the additional functions, what I call "Bonus functions", there is a need for modification of Mach3 windows and some simple macro changes, but that is no big deal, anyone can do it with the free software provided by Artsoft.
-
26-08-2016 #4
-
26-08-2016 #5
The bigger reason is Modbus is seen as being complicated. Which for somebody non-techy, it is. Get a single setting wrong, and it won't work, or at least not as expected, with no easy way to test why for your average home CNC'r.
Combine that with VFDs and Modbus equipped VFDs traditionally being expensive, meaning basic 0-10V DC speed controllers were far more commonplace, and you can see why 0-10V is the more commonly used method for home CNC. Plus it's easier to diagnose, as you only need a multimeter to narrow down where the problem lies.Avoiding the rubbish customer service from AluminiumWarehouse since July '13.
-
Well said it is much better with KISS as everybody is not from a techy background
..Clive
The more you know, The better you know, How little you know
-
26-08-2016 #7
I'm very interested in this, but then, I am a techy...
It's not because of the start/speed control aspect, as this is pretty straightforward if you have a BOB or motion controller with adequate analogue output. OK, linearity might not be absolutely spot-on but I doubt that for most practical purposes that matters. However, the idea of being able to read back VFD parameters (spindle speed, etc) to display on the PC screen sounds attractive. Personally, I would not have considered this because I had no idea what a Mach3 brain was so would have never gone looking for this kind of information. I've probably missed something obvious, but I don't find the Mach3 documentation leaps out at me. Easy enough to do the basics but you seem to be somewhat on your own if you go just a little off-piste. For example, do a Google search for "mach3 brain" and the best result seems to be a YouTube video. Personally, I would rather have a decent manual in front of me!
But maybe I've just missed some hidden site full of Mach3 docs, so if anyone can tell me where it is... In the meantime, I shall follow this thread with interest.
-
But maybe I've just missed some hidden site full of Mach3 docs, so if anyone can tell me where it is... In the meantime, I shall follow this thread with interest..Clive
The more you know, The better you know, How little you know
-
27-08-2016 #9
Thanks, Clive - there's a pointer in there that ends up with a few Mach3 tutorial videos which gave some background. However, I also had a hunt around for something about the HY inverters and Modbus, as the HY manual mentions it in passing but gives no specific information on what you can control or monitor. Apparently, HY have used their own very non-standard interpretation of the Modbus standard and although someone has produced a Mach3 plugin which gives access to some of the HY inverter features, I have not yet found the kind of information needed to use with a Mach3 brain.
Still, it has all thrown a bit of light on the "brain" feature, and I'm now wondering if that could be used to, for example, provide a custom Mach3 facility for master/slave homing which my CSMIO-IP/M does not do. Too many distractions from actually getting on and finishing the router...
-
28-08-2016 #10
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Supercomputer models one second of human brain activity
By Lee Roberts in forum General ComputingReplies: 8Last Post: 20-01-2014, 05:31 PM -
Mach3 digitizing wizard not saving file
By dudz in forum Probing, Digitizing & ScaningReplies: 0Last Post: 08-09-2013, 09:48 PM -
File upload problems - attachments file extension support !
By Swarfing in forum General DiscussionReplies: 14Last Post: 08-03-2013, 02:37 PM -
HID interface for remote control of Mach3
By Smiler in forum Electronic Project BuildingReplies: 0Last Post: 10-05-2009, 12:59 PM
Bookmarks