. .
Page 1 of 2 12 LastLast

Hybrid 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:	3840 
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:	5074 
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:


  3. #2
    Thanks A!
    I for one have printed this to hard copy and filed it in my Mach3 workshop folder.
    Do continue,
    Regards,
    Nick
    You think that's too expensive? You're not a Model Engineer are you? :D

  4. The Following User Says Thank You to magicniner For This Useful Post:


  5. #3
    Quote Originally Posted by magicniner View Post
    Thanks A!
    I for one have printed this to hard copy and filed it in my Mach3 workshop folder.
    Do continue,
    Regards,
    Nick
    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.

  6. #4
    Quote Originally Posted by A_Camera View Post
    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.
    I suspect many people will shy away from Modbus because the documentation for the cheaper Chinese VFDs is only just adequate to support manual and, if you're lucky 0-10V speed control ;-)

    - Nick
    You think that's too expensive? You're not a Model Engineer are you? :D

  7. #5
    m_c's Avatar
    Lives in East Lothian, United Kingdom. Last Activity: 3 Days Ago Forum Superstar, has done so much to help others, they deserve a medal. Has been a member for 9-10 years. Has a total post count of 2,908. Received thanks 360 times, giving thanks to others 8 times.
    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.

  8. #6
    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

  9. #7
    Quote Originally Posted by magicniner View Post
    I suspect many people will shy away from Modbus because the documentation for the cheaper Chinese VFDs is only just adequate to support manual and, if you're lucky 0-10V speed control ;-)

    - Nick
    Perhaps you are right. However, many people use other VFDs than the cheapest ones, so in that group there should be some interest. Even most of the cheaper VFDs have Modbus support, but sure, you must have a technical interest or some knowledge to start with it.

  10. #8
    I decided to make some changes since I discovered some Brains features which are useful in the design of Brains file. I have also decided to split the file into two parts, one is the basic control and the other is the "bonus features". I think this makes it simpler for others to reuse my idea and adjust the necessary changes.

    I have also made a short video which could be used as a simple guide. This video is just the first part. At the end of the video there are three pictures showing the brain file with the basic controls with three Mach3 commands: M3 S3000, M4 S9000 and M5.



    For best detail, please watch in full screen mode. It is 19 minutes long, so if you just want to see the Brain file views you can jump directly to the last 40 seconds.
    Last edited by A_Camera; 28-08-2016 at 07:11 PM.

  11. The Following User Says Thank You to A_Camera For This Useful Post:


  12. #9
    Yes it did help indeed! Thank you again. I can now send M3, M4, and M6 commands via the MDI in Mach.

    The only thing that I have to do now is change the ' RPM DRO' To read and display the 'True RPM' Values.
    I know that I have to use a screen editor to change the 'RPM' somehow from no. 39 to '1002'. Thing is, I'm using 'Screen4' and 'MachScreen' and I cannot find a procedure to do this.

  13. #10
    Quote Originally Posted by visedge View Post
    Yes it did help indeed! Thank you again. I can now send M3, M4, and M6 commands via the MDI in Mach.

    The only thing that I have to do now is change the ' RPM DRO' To read and display the 'True RPM' Values.
    I know that I have to use a screen editor to change the 'RPM' somehow from no. 39 to '1002'. Thing is, I'm using 'Screen4' and 'MachScreen' and I cannot find a procedure to do this.
    I see...

    Perhaps you can't fix it Screen4, or it is not no. 39 but something else, I don't know. I used the standard screen.

Page 1 of 2 12 LastLast

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
  •