Modbus to run GS-2 drive?


Results 1 to 15 of 15

Thread: Modbus to run GS-2 drive?

  1. #1
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default Modbus to run GS-2 drive?

    I see that Mach 3 has Modbus capabilities. Does anyone know how difficult it would be to interface a PC running Mach 3 with an Automation Direct GS-2 drive using the modbus protocol over RS-232 or 485? I was originally looking to use another CNC controller program (CNC Zeus) mainly because it was capable of directly controlling my spindle without additional hardware, but I have not been thrilled with the performance, and Mach 3 looks like it might work well, provided I can control my spindle with it.

    Similar Threads:


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    Hopefully Peter will see this and have an answer for you. He makes the ModIO board. http://www.homanndesigns.com/ModIO.html

    If you look at the ModIO user manual, it has some info on setting up Modbus devices that might help you out.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Member phomann's Avatar
    Join Date
    Aug 2005
    Location
    Australia
    Posts
    1091
    Downloads
    0
    Uploads
    0

    Default

    Yes, Mach3 can control MOdbus devices including the ModIO http://www.homanndesigns.com/ModIO.html

    Mach will drive the GS-2 directly although I haven't done it. I use the DigiSpeed http://www.homanndesigns.com/DigiSpeedDeal.htmlto drive my motor controller.

    Cheers,

    Peter.


    Quote Originally Posted by mecheng10 View Post
    I see that Mach 3 has Modbus capabilities. Does anyone know how difficult it would be to interface a PC running Mach 3 with an Automation Direct GS-2 drive using the modbus protocol over RS-232 or 485? I was originally looking to use another CNC controller program (CNC Zeus) mainly because it was capable of directly controlling my spindle without additional hardware, but I have not been thrilled with the performance, and Mach 3 looks like it might work well, provided I can control my spindle with it.


    -------------------------------------------------
    Homann Designs - http://www.homanndesigns.com


  4. #4
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default How to implement modbus for VFD

    Another question here: Suppose I want to communicate directly between my host pc running Mach 3 and my VFD (Automation Direct GS-2) using Modbus. How do I go about doing it? I have looked at the Modbus control setup in Mach 3 and I don't understand how to set it up for direct communication with such a device. An example of what I would like to do it is as follows:

    -Use Mach 3 to communicate directly with a GS-2 drive using the a serial port on the host pc and the RJ-12 port on the drive as well as a custom cable
    -Communicate using RS-232C or RS 485 (preferred if possible due to EMI immunity)
    -Whenever Mach 3 encounters a M03 command in a running program
    ---write 0001 hex to address 091B hex on GS-2 drive
    ---write 0000 hex to address 091C hex on GS-2 drive
    ---read 091B and 091B hex from GS-2 drive
    ---if values not correct, resend
    -Whenever Mach 3 encounters a M04 command in a running program
    ---write 0001 hex to address 091B hex on GS-2 drive
    ---write 0001 hex to address 091C hex on GS-2 drive
    ---read 091B and 091B hex from GS-2 drive
    ---if values not correct, resend
    -Whenever Mach 3 encounters a M05 command in a running program
    ---write 0000 hex to address 091B hex on GS-2 drive
    ---read 091B hex from GS-2 drive
    ---if value not correct, resend
    -Whenever Mach 3 encounters a S____ command in a running program
    ---convert S command to desired drive output frequency
    ---write ____ to address 091A hex on GS-2 drive
    ---read 091A hex from GS-2 drive
    ---if value not correct, resend

    I would like to extend this general concept to include reading and resetting drive errors from Mach 3 as well as triggering external faults on the drive in the event of an e-stop etc.

    My real question hear is: Does MAch 3 have the capabilities to due this type of thing? Would I have to write my own code to do this?

    Thanks,
    -Brian



  5. #5
    Registered
    Join Date
    Oct 2004
    Location
    US
    Posts
    118
    Downloads
    0
    Uploads
    0

    Default

    You would have to setup the registers in decimal and enable bitpacking... Should be no probelm and if you start on that project please feel free to mail me and i will help you with the settings

    Thanks
    Brian



  6. #6
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default programming modbus spindle control

    I am just becoming familiar with how Mach works. Here is what I have determined so far. Please correct me if I'm wrong.

    -Control of the spindle through Modbus can be accomplished by writing VB script that can be activated by a button that could be added to the user interface using a screen designer or that could be caled from within the G-code. Is there a way to automatically activate such a script when starting Mach?

    -Communication with the spindle device can be accomplished through modbus by using the built in direct or polled modbus communication functions such as FillFromInput and GetInput within the script.

    Am I on the right track here?

    -Brian



  7. #7
    Registered
    Join Date
    Oct 2004
    Location
    US
    Posts
    118
    Downloads
    0
    Uploads
    0

    Default

    You are close but here is no VB that needs to be done and there is no need to work on the screen All you have to do is setup the bitpacking and set the register that you need to send the word for the velocity. I have the manual for the drive here and I have one inthe mill in the shop... just need time to get out there and get it working



  8. #8
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default Modbus settings

    Barker,

    Not having to write any code sounds great! I'm a little rusty. Not sure I understand how the S word get translated into the correct frequency command, and send over Modbus without code though. To me it looks like the standard version of Mach only supports spindle speed control using step and direction signals, and PWM. Under config/ports and pins, I see Modbus spindle. Is that the right thing to use. It appears that is supposed to work with 3rd party breakout boards. Would you be willing to post the needed setting? I think I understand the GS-2 side of things ok, but not the Mach 3 side of things very well.


    Many thanks,
    -Brian



  9. #9
    Registered
    Join Date
    Oct 2004
    Location
    US
    Posts
    118
    Downloads
    0
    Uploads
    0

    Default

    Yup, no problem tell me the register in Decimal and what bit you need changed. the settings on the mach3 side will only take me a few min



  10. #10
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default Decimal Addresses

    If my hex to decimal conversion is correct, this should be what I need to do:

    -Whenever Mach 3 encounters a M03 command in a running program
    ---write 1 to address 2331 on GS-2 drive
    ---write 0 to address 2332 on GS-2 drive
    ---read 2331 and 2332 from GS-2 drive
    ---if values not correct, resend
    -Whenever Mach 3 encounters a M04 command in a running program
    ---write 1 to address 2331 on GS-2 drive
    ---write 1 to address 2332 on GS-2 drive
    ---read 2331 and 2332 from GS-2 drive
    ---if values not correct, resend
    -Whenever Mach 3 encounters a M05 command in a running program
    ---write 0 to address 2331 on GS-2 drive
    ---read 2331 from GS-2 drive
    ---if value not correct, resend
    -Whenever Mach 3 encounters a S____ command in a running program
    ---convert S command to desired drive output frequency
    ---write ____ to address 2330 on GS-2 drive
    ---read 2330 hex from GS-2 drive
    ---if value not correct, resend


    -Brian



  11. #11
    Registered
    Join Date
    Oct 2004
    Location
    US
    Posts
    118
    Downloads
    0
    Uploads
    0

    Default

    Here are the Macro's that you will need to change:

    M3

    Call Setmodoutput(1,1) 'Turn on the spindle
    Call Setmodoutput(2,0) 'This tells the spindle to turn CW
    DoSpinCW()


    M4

    Call Setmodoutput(1,1) 'Turn on the spindle
    Call Setmodoutput(2,1) 'This tells the spindle to turn CCW
    DoSpinCCW()

    M5

    Call Setmodoutput(1,0) 'Turn on the spindle
    Call Setmodoutput(2,0) 'This tells the spindle to turn CW
    DoSpinStop()

    And you can see the settings in the pic...

    Hope that helps
    Brian

    Attached Thumbnails Attached Thumbnails Modbus to run GS-2 drive?-gs2-settings-jpg  


  12. #12
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default Macro code

    Barker,

    This seems much simpler than I originaly thought. I do have a couple of issues though. Please see my comments below.


    M3

    Call Setmodoutput(1,1) 'Turn on the spindle
    Call Setmodoutput(2,0) 'This tells the spindle to turn CW
    DoSpinCW()


    M4

    Call Setmodoutput(1,1) 'Turn on the spindle
    Call Setmodoutput(2,1) 'This tells the spindle to turn CCW
    DoSpinCCW()

    M5

    Call Setmodoutput(1,0) 'Turn on the spindle
    Call Setmodoutput(2,0) 'This tells the spindle to turn CW
    DoSpinStop()

    It appears that buffIndex starts counting with 0, so shouldn't the 1s be 0s and the 2s be 1s?

    Also, to set the spindle speed given the settings you gave, could I modify the spindlespeed macro to something like this:

    spindlespeed

    rpm = GetRPM()
    SetSpinSpeed( rpm )
    ratio = ??? 'Determines ratio of motor output frequency to spindle speed
    freq = rpm/ratio 'Calculates desired output frequency given ratio
    Call Setmodoutput(64,freq) 'Set drive output frequncy to desired value


    -Brian



  13. #13
    Registered
    Join Date
    Oct 2004
    Location
    US
    Posts
    118
    Downloads
    0
    Uploads
    0

    Default

    You don't need any of that stuff for the output to the motor... Reg 64 gets data from the spindle tab under ports and pins. you just need to tell it what number gives you max RPM. As for gears... there are 20 gears that you can set up and all the scaling is taken into account We work hard to make things simple.

    Yup I could be off by one register but you get the idea



  14. #14
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    80
    Downloads
    0
    Uploads
    0

    Default Macros for Spindle Control w/ GS-2

    Change the extension on the attached files to .m1s and put them in your macros folder for the instance of Mach 3 that runs your mill to use your GS-2 VFD to control spindle speed from Mach 3.

    -Brian

    Attached Files Attached Files


  15. #15
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    578
    Downloads
    0
    Uploads
    0

    Default

    Hello all,
    I have a GS2 also and was wondering what all is needed to interface to Mach3.

    1) Does the cable go directly from drive to PC serial port? Or should there be a breakout board of some sort?

    2)Any documentation on making the cable to connect serial PC port to RJ port on drive?
    Looking for advice on where to start, as i have never done anything with Modbus. (obviously)
    Any help much appreciated.
    Thanks,
    Troy

    www.tsjobshop.com, www.homecncstuff.elementfx.com


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Modbus to run GS-2 drive?

Modbus to run GS-2 drive?