584,849 active members*
4,276 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 37
  1. #1
    Join Date
    Apr 2013
    Posts
    1899

    Mach3 VFD control via modbus using brain file

    Hi all Mach3 brain and modbus experts.

    I am pulling my hair out of frustration... I can't control my VFD from Mach3 via modbus using brains. The problem is a fairly simple issue and hopefully it is easily solvable but for some reason I don't know/understand how. I have a Bosch Rexroth EFC5610 inverter which I would like to start/stop and set the RPM on via modbus. Nothing fancy, not even reverse running, so it supposed to be easy.

    Some background of what is working:

    I have no problems controlling the VFD using the "Test modbus" function in modbus configuration window. I can stop and start the VFD and send the frequency so the modbus communication is working just like I want and as described in the VFD manual.

    I have also defined two configurations and set up the modbus addresses 32512 (7F00 hex) in cfg 0 and 32513 (7F01 hex) in cfg 1.

    I have also managed to create a brn file for sending the frequency to the VFD, and that part is working well. Whenever I change the RPM in Mach3 or send the G-code S the brain is calculating the frequency and sends it to the VFD, the panel display changes and if I start the spindle via the control panel it spins up to that speed. In other words, the brain is working and Mach3 is communicating with the VFD, sending data trough cfg 1 to modbus data address 32513 (7F01 hex). This proves that the modbus communication is working even through the Mach3 brain.

    The actual problem I need your help for.

    What is NOT working is the spindle on/off control. The reason is that this VFD demands the data value 129 dec (81 hex), and 136 dec (88 hex) to stop the spindle to be sent to the modbus addresses 32512 (7F00 hex). So this makes a simple on/off control pretty complicated because I have no idea how to convert 0 to 136 (dec) and 1 to 129 (dec) and output only one value through one single termination with modbus output to the VFD, depending on Mach3 Output1 condition. I can define one of the two (stop or start) and if I define Output 1 to on and Output 2 to off then it works but I would prefer only using one Mach3 Output for the task.

    I include a schematic drawing to illustrate what I would like to do, but if you have a proposal for another solution, you are welcome. I am all ears and open for any possible solution as long as modbus can be used.

    Attachment 330880

    Thank you for any constructive comments.

  2. #2
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Nobody has a clue about how to solve this...?

    Last night I installed a modbus sniffer and that confirmed the communication line. There is no error there, the physical communication and the protocol is fine. I did some new tests also of some ideas I had, but it is still not to my satisfaction. It seems that brains alone can't do this, which is a pity because it would give a nice and clean control. I will do some VB macro modifications for M3 M4 and M5 tonight and hope to solve it that way, but that's a "dirty" solution in my opinion.

  3. #3
    Join Date
    Dec 2003
    Posts
    24216

    Re: Mach3 VFD control via modbus using brain file

    It is too bad the Huanyang modbus plug in's on the Mach site only works with their product as they use a different form of Modbus protocol to standard.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  4. #4
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by Al_The_Man View Post
    It is too bad the Huanyang modbus plug in's on the Mach site only works with their product as they use a different form of Modbus protocol to standard.
    Al.
    Thanks for your comment, but really, there is no need for complicated plugin...

    Problem solved, now I have full control over the Rexroth VFD using a VERY simple brain and a VERY short macro. Very nice. No need for 0-10V and several wires just to start/stop and set speed. Modbus is really great, so I'll even expand my brain file later on to get real RPM readings, E-stop handling, temperature reading and so on... :banana:

  5. #5
    Join Date
    Dec 2003
    Posts
    24216

    Re: Mach3 VFD control via modbus using brain file

    Going to publish it here?
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  6. #6
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    It's really very simple, once I realized it can't be done by brains only. I include a few screen captures and the VB macro necessary for this to work. I will continue expanding the functionality but for now I am very happy that I made it working as I wanted and the minimum I needed.

    The RS485 converter is just a simple and cheap eBay USB plug. It was plug and play, the serial interface installed nicely without intervention.

    I then defined two configurations, one for the on/off control and the other for the spindle speed and...

    Attachment 330966

    ...created a very simple brn file, using the Brain Editor containing two lobes.

    Attachment 330968

    First lobe reads the S value and divides with 0.6 to get the necessary frequency corresponding the S speed, which in this VFD must be given with two decimals as an integer value, in other words, 150.45Hz is equal to 15045. In the screen capture example S = 3000 and the modbus output is 5000, which is interpreted and displayed by the VFD as 50.00Hz.

    The second lobe reads User DRO #2000 and whatever is in it is passed directly without processing to modbus output. This controls the spindle start and stop. Only CW is implemented now, but I will implement even CCW later on, just for fun and for consistency, not that I need it.

    The DRO gets the values from a VB macro which is running continuously after Mach3 start up. The macro is placed in the mill macro directory and MUST be called "macropump.m1s". Once that is done it must be made running automatically by ticking the tick box "Run Macro Pump" in General Config window. Mach3 must be restarted after this change, otherwise the script will not run.

    This is my current macropump.m1s file:

    Code:
    ' This VB macro runs continuously after Mach3 start up
    ' if "Run Macro Pump" is enabled in General Logic Configuration window.
    ' The macro file must be named macropump.ms1 and placed in the Mach3 macros folder.
    '  
    ' Define some constants
    
    Const SpindleOnLED = 11		' Spindle LED #11 indicates spindle on/off (CW or CCW)
    Const CCR_Data_DRO = 2000	' Rexroth EFC 5610 Communication Control Register data DRO
    Const VFD_ON = 129 ' Modbus command data to turn ON the VFD in CW direction
    Const VFD_OFF = 136 ' Modbus command data to turn OFF the VFD
     
    If GetOEMLED(SpindleOnLED) Then	' Check spindle LED status
    	SetUserDRO(CCR_Data_DRO, VFD_ON)	' 0x0081 turns on the VFD
    Else
    	SetUserDRO(CCR_Data_DRO, VFD_OFF)	' 0x0088 turns off the VFD
    End If
    
    ' When this macro is executed User DRO #2000 is set to a value
    ' depending on SpindleLED status. A simple brain file is activated to
    ' pass it on to the VFD via Modbus without further processing.
    Tested and working well, but I will continue expanding it.

    Good luck whoever is interested.

  7. #7
    Join Date
    Nov 2008
    Posts
    412

    Re: Mach3 VFD control via modbus using brain file

    Just found this thread. Very informative, thanks for sharing your file
    Forget about global warming...Visualize using your turn signal!

  8. #8
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by lancut View Post
    Just found this thread. Very informative, thanks for sharing your file
    Thanks. I hope somebody finds it useful. The Rexroth VFD is not as widely spread as some other brands, at least not in the "home users and amateurs" group of people, but in any case, my solution can be applied on any VFD, all that is needed is to change the Modbus addresses 32512 and 32513 to whatever is used and to change the macro script constants VFD_ON and VFD_OFF to whatever value switches on and off the VFD which is controlled. This makes my solution really global, I guess most, if not any, VFD can be controlled with this solution. The next steps will be to add:

    • E-Stop. Pressing the Stop button on the VFD stops the spindle, but as soon as the button is released the spindle is restarted because Mach3 continues pumping out the command and the VFD receives and interprets the data, so this must be changed. I want Mach3 to stop and execute E-stop if I press the Stop button on the VFD control panel.
    • Actual speed feedback to Mach3 to display the speed.
    • "Speed Arrival" to prevent G code execution after M3 unless the spindle is up in speed.
    • Reverse running. To be implemented for possible future use and compatibility with the VFD and Mach3 capabilities of running the spindle in reverse (CCW) direction.
    • Motor temperature monitor. Pretty easy to implement by adding a PT100 only and defining an analogue input in the VFD for this task.


    The implementation of my method allows users without programming skills to program, or find a plugin, to get full control of their VFD through modbus. This solution and control method is really universal, as opposed to using plugins, which must be designed and programmed for each unique VFD.

    The freeing up outputs and inputs on the BoB and the VFD using only a simple, twisted pair communication wire is a big bonus as well, making the connection of a VFD much simpler. Actually, to test I used simple, unshielded lamp wire, not suitable for normal communication, several meters coiled up and mixed with power cables coiled on the floor as well as 5 meters of motor cable also in a coil all over the room since my VFD is still on the floor and not installed properly yet but have not noticed any issues. So I guess that any two wire would work, even if I plan to install it with real wires.

    It is also providing higher running reliability, since a glitch or noise in the communication will be corrected within the time frame of the next message, which for now in my case is configured to 50ms, since the message sending is repeated endlessly every 50ms until the Mach3 application is closed. If the VFD is controlled via inputs and there is a glitch or short pulse on the wrong input the spindle is stopped, or will result in a dramatic, sudden speed drop and possibly breaking of the tool or destroying of the work piece. Perhaps that is not happening often, but it can happen.

    Also to get rid of the 0-10V needs to regulate RPM is very nice. With direct frequency output the speed is more accurate than via the 0-10V provided by the BoB. The modbus implementation will also free up a parallel port task of pulsing and continually generating the PWM frequency necessary for the BoB to create the 0-10V output to control the spindle speed. Even if this is done via the UC300 in my case, Mach3 is still involved and pumping out the PWM pulses via the UC300 plugin, so using modbus will reduce the load on Mach3 and UC300 as well. OK, it adds some new tasks to Mach3 as well, but I think that the calculation and the brain running is not as time critical as the parallel port control, so I believe that in the end, it is positive and reduces the total load on Mach3.

  9. #9
    Join Date
    Dec 2003
    Posts
    24216

    Re: Mach3 VFD control via modbus using brain file

    Thanks for posting, I have never really looked into Brain file, I did make a T.M. motor controller board using the Plug in from Sebastien in the Mach forum for the Huanyang and used the same communication parameters as the Huanyang.But I would rather include other VFD's.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  10. #10
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by Al_The_Man View Post
    Thanks for posting, I have never really looked into Brain file, I did make a T.M. motor controller board using the Plug in from Sebastien in the Mach forum for the Huanyang and used the same communication parameters as the Huanyang.But I would rather include other VFD's.
    Al.
    I think that with my method you could control any VFD. At least if it is just basic control, like running CW and CCW, setting the RPM and reading some parameters. The brain file would be excellent, but it has some missing capabilities which would have been pretty simple to implement considering all the work needed to implement the function the first place. But even as it is, I think it is better than having to write C++ code and a dedicated plugin.

    BTW, last night I changed my script a bit, so now the script handles the commands for Run/Stop, CW and CCW and also the "Speed Arrival" flag. It is cool to see that the G-code stops after M3 and waits until the spindle is up at the right speed, so no need to have any delays in Mach3. Have not tested yet with what happens if I don't have an S before M3 or what happens if I have the M3 followed by S on the same line, but even if those combinations are not working, it is really a small inconvenience and I will change any G-code file which might cause issues if it is an issue at all.

  11. #11
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    An update in case there is an interest for this...

    I have abandoned the macropump solution and solved the code conversion problem in Mach3 brain. I think this gives a cleaner and nicer solution. I have also implemented some control and monitoring functions. There is also a bug in Mach3, which is why the true RPM DRO is displaying crap and always overwriting the real value with that crap. I guess this bug will never be solved, but there is a work around. Open up the screen in a screen editor and renumber the real RPM from #39 to something above #1000 in the User DRO range, I used #1002. By default this DRO is displayed in two windows, change in both. I have also cleaned up the Diagnostics widow and made some modifications to it, added an area with VFD and spindle data.

    This is how my Modbus configuration looks like:

    Attachment 331696

    Note that I have not optimized the times, just selected different values.

    Change the Modbus variable addresses to suit your VFD. I can't help with any other than the Bosch Rexroth I have, but I am pretty sure every VFD can be configured this way and controlled via Mach3 brains.

    This is the new brain file view:

    Attachment 331694

    I think the explanations are pretty straight forward. Run spindle CW/CCW/OFF is controlled by the most complicated part, that is where the code conversion was necessary. If you want to use this on a different VFD just change the marked values in your brain file to what is needed by your VFD.

    This is the VFD spindle field I added in Mach3 Diagnostics window:

    Attachment 331698

    I have modified M3 and M4 macros so that code execution is stopped until the spindle speed is reported stable by the VFD. I will post the modification as soon as I can, but it is really a simple one, only a while loop, checking User LED #1002. If that LED is on it will reset the LED and exit the macro to continue with the rest of the G-code.

    This is a simple G-code to test it:

    Attachment 331700

    Note that an M5 must be added if there is a direction change (or speed change) in the middle of the code execution, like in my example. This is not necessary if the spindle is controlled manually, after a manual entry "M3 S12000" you can enter "M4 S6000" and the spindle will decelerate, change direction and accelerate up to 6000 RPM. Never the less, I don't care, I don't think I will need to change direction even in the middle of code execution, and if I'd test thread cutting this is a very small inconvenience...

    Anyway, now that I know how it is working, I am pretty happy with using brains instead of macropump.

  12. #12
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    During the weekend I decided to make some changes because I discovered some very useful Brains features. 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 start up guide for those interested and willing to try out Modbus and Mach3 Brain. 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.

    https://youtu.be/AFbH6ps0hVY

    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.

    With "basic controls" I mean setting and reading back the spindle RPM, running the spindle in CW and CCW direction, stopping the spindle.

  13. #13
    Join Date
    Mar 2010
    Posts
    813

    Re: Mach3 VFD control via modbus using brain file

    Great thread and thanks!!. I read constantly here in the forums post on "how to control spindle through Mach" and it seems Modbus is always overlooked with suggestions of other methods. I see now why, its complicated...LOL

    I watched your video several times and downloaded your Bosch Rexroth EFC5610 manual to help me follow along. Before I even try to begin and comprehend the brain file, I cant get past how you were able to determine the functions and the addresses to send them to just with the manual. 129 (81 hex), 133 (85 hex)...etc. Any guidance or point in direction will be appreciated.

    Thanks again, and looking forward to part 2.

  14. #14
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by Dan911 View Post
    Great thread and thanks!!. I read constantly here in the forums post on "how to control spindle through Mach" and it seems Modbus is always overlooked with suggestions of other methods. I see now why, its complicated...LOL

    I watched your video several times and downloaded your Bosch Rexroth EFC5610 manual to help me follow along. Before I even try to begin and comprehend the brain file, I cant get past how you were able to determine the functions and the addresses to send them to just with the manual. 129 (81 hex), 133 (85 hex)...etc. Any guidance or point in direction will be appreciated.

    Thanks again, and looking forward to part 2.
    Hi Dan,

    Thank you for your words. I thought nobody was really interested in this, so I stopped posting about it. The video has less than a hundred views, no comments at all, and since it took quite some time to make it I decided not to continue. I can't promise that there will be a part 2, even if the video says so, but if you are really interested in the Rexroth solution, I can give you some hints. Do you have the same VFD or just interested in how I solved?

    Anyway, just to get to the same references in explaining how I arrived to the codes, here is the link to download the documentation.

    https://md.boschrexroth.com/modules/...326,20,1194196

    The manual has over 400 pages and is pretty detailed, but necessary for understanding the Modbus communication.

    I assume you have already wired up the VFD and you are using serial RS485 Modbus.

    The following images show the parameters in red which I have changed.

    Attachment 334454

    Attachment 334456

    Attachment 334458

    Without these changes the control will not work. Of course, you can get it working also as second control, but it is easier to set it to first, as the main control. The communication parameters are OK even at default, just make sure that Mach3 communication parameters match E8.10, E8.11 and E8.12.

    Chapter 14.1 and 14.2 (pages 254-256) describes the communication parameters in more detail but there is no need to change more until you know what you are doing and everything is working with these settings.
    The whole chapter 14.3 is important, so read pages 257 to 274 and if necessary, read several times. Some pages are less important, so for example if you only have one Modbus device you can skip the networking part. So, now to your main question about how I figured out which code is what. Well... apart from the fact that I have a very long back ground and many years of experience in software/firmware programming as an engineer, also worked with data communication, encryption and communication protocol conversions/interpreters, I simply took the manual, opened up the last pages about Modbus examples and did as the three examples say on page 272. Basically, that page told me almost everything I needed to know for basic control.

    Attachment 334468

    After that, I went to page 268 to actually understand the start/stop control and fill out the table with different bit values.

    Click image for larger version. 

Name:	Page 268.jpg 
Views:	7 
Size:	125.7 KB 
ID:	334462

    After understanding this part it is important to understand how the frequency, and through that the actual RPM is set. I don't remember if that is explained in the manual, or just too easy to figure out, but based on the example, you can see that by sending a frequency value multiplied by 1000 to the next register address (#32513) the frequency is set. This can be done in one write command, just like the example in the manual shows, or separately as I am doing. I could not figure out how to do it in one command from Mach3, which is why I do it the way I do it. It would be better to do it in one single message, that is more professional and would reduce the number of individual messages and increase the communication rate, but I don't know how to solve that in Mach3, so I just gave up on that idea.

    The rest is "bonus" because it is not necessary for basic controls, but necessary only if you want to implement extras, like reading back the RPM, temperature or analog/digital input/output values. I read the RPM, as well as some other values, like current, voltage, temperature, analog inputs 1 and 2 and digital output 1, which in my case indicates the "speed arrival" when the spindle RPM is at the set speed. This allows me to introduce a control over M3 and M4 commands, a simple "if" in the M3 and M4 macros prevent the G-code from continuing unless the spindle speed is right, which in turn allows me to set zero in the Mach3 configuration screen for the spindle acceleration/deceleration delays. I also read back some status information about the motor, so I also read back if the motor is stopped or running or if it is running in forward or in reverse rotation. This is page 269 in the manual.

    Values are read back the same way as explained in the example, just that the different register addresses must be set correctly. Mach3 serial configuration test screen is nice help, if it works there you can be sure it is working and if not it is probably you (or a Mach3 bug) causes the error.

    Page 267 is very important, that page explains how to access all the registers and the parameter addresses. So for example, to read back the spindle RPM you have to read the parameter address 1001h (#4097 dec) which is the second item in the d0 group. See page 365 in the manual for the d0 group contents. I am reading even other parameters in the same "d0" group. The list below shows all the d0 parameters, red arrow marks the parameters I am reading.

    There is a bug in Mach3 which prevents writing to the real RMP DRO. This can only be fixed by editing the screen and renumbering the DRO from 39 to a user DRO value. I gave it value #1002. This way the Mach3 brain is capable to write the real RPM in that DRO. I made some other modifications to the Mach3 screen as well, the main screen results can be seen in this short video. Screen in Mach3 editing is s totally different chapter and is very buggy. I used Screen4 free software, which works but crashes pretty often, so it is pretty annoying.

    https://youtu.be/L3jwsjl_mq8

    This video is a sort of "good bye" video. I bought a UC300ETH bundled with UCCNC, which hopefully will arrive today or tomorrow. One reason is that occasionally the USB controller stops working. Not happening often, but when I made this video it crashed just at the end of the work, which p!ssed me off. I think the problem is Mach3, but can not exclude the USB connection principle (error recovery is not supported by USB, unlike in Ethernet), or the UC300 hardware or the plugin. Anyway, the UC300 continues to show the right state, running a communication analyzer shows communication is OK even after the crash, but Mach3 is not able to recover. I think that the inability to recover is a Mach3 issue primarily. Perhaps it could be fixed by the plugin as well, I don't know, but I want to try something else. I intended to buy the UC400ETH plus the UCCNC to be able to use the UC400ETH even with Mach3 if I wanted, but was informed about the current deal on the recently released UC300ETH so I bought that one, and will continue with UCCNC if possible.

    Note that in the above video I run a screen recorder in parallel with Mach3. It is possible that this caused the USB communication to crash, but I think Mach3 is far too sensitive and can crash even at other times. I can not put my finger on exactly why, but it does not matter if I will be happy with UCCNC and the Ethernet motion controller.

    Sorry for this long post, but you asked for it...

  15. #15
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    To continue the long post above...

    There is a warning in the manual about writing too often saying that:

    Frequent writing may damage the internal registers!
    ● When data is written into the internal registers, there is a limit on the writing
    times. The register address may be damaged once the writing times is beyond
    the writing limit. So please avoid frequent writing!
    I don't know what the definition of "too often" is, the manual does not give any figures. This meant though that it would be a good idea to reduce the data flow. I will probably reduce the communication speed back to default 9600bps, or perhaps even slower. If it is easier done in UCCNC than I will also write to several registers in the same message. This does not reduce the number of writing into the registers, but makes communication more professional. I may also leave the idea of constantly writing to registers, which is very good in case there is a communication issue, but not very good if the above warning is taken seriously. Mach3 brains, and also the corresponding function in UCCNC, are pushing out a constant flow of data, reading and writing all the time in an endless loop, so the number of writing is a bit limited with the reduction of communication speed, but I will try to make it more intelligent, only repeat the writing if reading does not correspond what is expected. For example, if the "Spindle speed reached" parameter is not true then I'll send write commend to command RUN and also will send the speed frequency value, but as soon as the VFD reports back about the speed being reached I will stop the writing. This could reduce the number of writing commands quite dramatically.

    I hope for greater flexibility and higher reliability in UCCNC, especially since it will interface through Ethernet and not USB. I am still waiting for the UC300ETH to arrive, so currently I can only use UCCNC in demo mode, which is OK since I can work with the Modbus interface while waiting. I can now control the VFD even in UCCNC, but had no time yet to work with the necessary macros. I have just had UCCNC for three days, and all I can say that it seems to work nicely. Modifying the screen is much easier and stable, it does not crash all the time and the screens are always easily resizable. But... it is still our "honeymoon", so of course, right now everything is beautiful, nice and dandy.

  16. #16
    Join Date
    Oct 2005
    Posts
    1145

    Re: Mach3 VFD control via modbus using brain file

    That is interestin of what you said about the unit and i'st warning about writes. Teh modbus protocal for RTU,TCP,ASCII is ALL about continous streaming for data request. IF you loose teh data stream in rtu the device will error out and reset. ASCII is alittle more tolerant of data delay as it does have a start and stop bit and is more tolerant of data block delays.

    IF you move out of the protocal you are no longer using MODBUS. then you have to create your own protocal to send receive and confirm data AND create teh CRC/LRC AND NOT cause teh device to error for lack of data streaming. The device IS locked into teh modbus protocal. I am not sure IF yo can change your side of teh arrangment.

    But it will be interesting to see if it works.

    (;-) TP

  17. #17
    Join Date
    Mar 2010
    Posts
    813

    Re: Mach3 VFD control via modbus using brain file

    Thank you for your reply and explanation, I downloaded your manual and seen the examples you posted but didn't understand where the 81,85,88 derived from. The pic below helped.
    No, I don't have Boschrexroth inverter. I just thought by viewing your manual and following what you've done would help me get a better understanding of MODBUS.

    I have a Hunayang VFD controlled by Mach3 with the Hunayang Plugin. I think it works great, but this keeps me from upgrading to Mach4, UCCNC or a better inverter. Although I have no complaints about Hunayang VFD, its been going for 2 years now. This is why I find MODBUS of interest and very surprised not more by others.

    Thanks again and will be following.

    Click image for larger version. 

Name:	Page 268.jpg 
Views:	7 
Size:	125.7 KB 
ID:	334462

  18. #18
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by vmax549 View Post
    That is interestin of what you said about the unit and i'st warning about writes. Teh modbus protocal for RTU,TCP,ASCII is ALL about continous streaming for data request. IF you loose teh data stream in rtu the device will error out and reset. ASCII is alittle more tolerant of data delay as it does have a start and stop bit and is more tolerant of data block delays.

    IF you move out of the protocal you are no longer using MODBUS. then you have to create your own protocal to send receive and confirm data AND create teh CRC/LRC AND NOT cause teh device to error for lack of data streaming. The device IS locked into teh modbus protocal. I am not sure IF yo can change your side of teh arrangment.

    But it will be interesting to see if it works.

    (;-) TP
    No, Modbus is about sending and receiving messages. It is a pretty dumb and simple protocol. You can send a stream, stop sending and restart later on whenever you want. The important thing is that when you start sending you cannot interrupt, must send the full message packet with the right checksum at the end. So there is no need for continuous writing and reading. BUT... if the serial port is released another process in your PC can take over. Of course, that is easy to prevent, just don't start another Modbus user.

    By the way, in UCCNC it is pretty simple to send any number of commands/data in one single packet, so it is pretty easy to send a message which contains both the RUN and the VFD output frequency message, just as it is in the example I copied in above. So it looks better and better every time I look at UCCNC.

  19. #19
    Join Date
    Apr 2013
    Posts
    1899

    Re: Mach3 VFD control via modbus using brain file

    Quote Originally Posted by Dan911 View Post
    Thank you for your reply and explanation, I downloaded your manual and seen the examples you posted but didn't understand where the 81,85,88 derived from. The pic below helped.
    No, I don't have Boschrexroth inverter. I just thought by viewing your manual and following what you've done would help me get a better understanding of MODBUS.

    I have a Hunayang VFD controlled by Mach3 with the Hunayang Plugin. I think it works great, but this keeps me from upgrading to Mach4, UCCNC or a better inverter. Although I have no complaints about Hunayang VFD, its been going for 2 years now. This is why I find MODBUS of interest and very surprised not more by others.

    Thanks again and will be following.

    Click image for larger version. 

Name:	Page 268.jpg 
Views:	7 
Size:	125.7 KB 
ID:	334462
    Dan, if you download UCCNC and run it in demo mode you can check out the Modbus interface there. It seems miles ahead of Mach3 and you can easily experiment with the VFD, as long as you have saved your settings, nothing really can happen, other that it may not work with Modbus. The important thing is that you set communication as primary control, wire it up and start sending messages. Maybe your VFD is not that well documented but the short time I spent with looking into the manual of that Chinese VFD, I thought it looked pretty much similar, except that I think it demands multiple commands to be sent and the commands are not the same, but that is always different in different VFD. The main thing is that Modbus protocol standard is followed, and as far as I remember, the Chinese are following it. I'd give it a try if I were you, or if I had time or access to one of those Chinese VFD's.

  20. #20
    Join Date
    Mar 2010
    Posts
    813

    Re: Mach3 VFD control via modbus using brain file

    That is definitely my future intentions. This was all Chinese to me a week ago and you helped shine a speckle of light on it for me but have a way to go before experimenting. I was surprised how much info I was able to gather regarding Modbus and the Hunayang VFD on the internet and this forum. What I'm hoping to do and researching now is use a serial monitor or Modbus sniffer to see what addresses and calls the plugin uses. Hoping this helps with my manual set-up. Any suggestions will certainly be appreciated.

    Thanks again for your very informative thread.


    P.S I use a uc100 and had similar lost connection your experiencing. I replaced the wire that it came with with a shielded one and the problem went away.

Page 1 of 2 12

Similar Threads

  1. DELTA-E VFD MODBUS BRAIN - Help Needed
    By techie4971 in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 03-07-2017, 02:48 PM
  2. UCCNC and Mach3 Modbus MPG?
    By Signal9 in forum UCCNC Control Software
    Replies: 5
    Last Post: 09-19-2015, 07:42 PM
  3. Mach3+DZB200M + Modbus RS485 + brain
    By Ceyhun in forum Mach Software (ArtSoft software)
    Replies: 5
    Last Post: 10-30-2014, 12:42 PM
  4. Modbus TCP with Control Techniques SK Commander VFD for spindle control
    By fishin_fl in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 08-26-2013, 04:07 PM
  5. Which VFD for spindle control Mach3 via Modbus
    By silyavski in forum Phase Converters
    Replies: 28
    Last Post: 07-06-2011, 01:43 PM

Tags for this Thread

Posting Permissions

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