. .

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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:

    Click image for larger version. 

Name:	Mach3 Modbus config for Bosch Rexroth EFC 5610.JPG 
Views:	3833 
Size:	82.8 KB 
ID:	19094

    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:

    Click image for larger version. 

Name:	Mach3 brain for Bosch Rexroth EFC 5610 explained.jpg 
Views:	5068 
Size:	516.5 KB 
ID:	19093

    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.

  2. The Following 2 Users Say Thank You to A_Camera For This Useful Post:


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Supercomputer models one second of human brain activity
    By Lee Roberts in forum General Computing
    Replies: 8
    Last Post: 20-01-2014, 05:31 PM
  2. Mach3 digitizing wizard not saving file
    By dudz in forum Probing, Digitizing & Scaning
    Replies: 0
    Last Post: 08-09-2013, 09:48 PM
  3. File upload problems - attachments file extension support !
    By Swarfing in forum General Discussion
    Replies: 14
    Last Post: 08-03-2013, 02:37 PM
  4. HID interface for remote control of Mach3
    By Smiler in forum Electronic Project Building
    Replies: 0
    Last Post: 10-05-2009, 12:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •