585,741 active members*
5,149 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > PlanetCNC > MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDATED]
Page 1 of 2 12
Results 1 to 20 of 24
  1. #1
    Join Date
    Mar 2017
    Posts
    1304

    MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series

    Hi,

    We published first part of tutorial series Modbus communication with HuanYang VFD and PlanetCNC TNG


    If you have any questions, tips or suggestions, please let us know, we would appreciate any feedback.
    https://planet-cnc.com/modbus-commun...ang-vfd-part1/




    Best regards, Team PlanetCNC

  2. #2
    Join Date
    Mar 2017
    Posts
    1304

    re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDATED]


  3. #3
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Hi,
    Unfortunately I have a different type of VFD and parameters numbers are not identical, so it does not work.
    I don't know how to change them in your scripts to make this to work.
    This is all I can get:
    BEGIN #Modbus_HuanYang_VFD_Parameter_read_scan
    BEGIN #Modbus_Write_Read_Data_VFD_param
    PRINT VFD parameter data
    BEGIN #Check_VFD_response_data_param
    CRC OK: 52040
    Address OK: 1
    response check failed with error code: -4
    END #Modbus_HuanYang_VFD_Parameter_read
    Expression:
    exec('#Modbus_HuanYang_VFD_Parameter_read') = 0
    Here is my VFD user manual if you want to help https://gofile.io/d/AY8X3a

  4. #4
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    After delete the comment on line 109, as per tutorial, here are the results:
    BEGIN #Modbus_HuanYang_VFD_Parameter_read_scan
    BEGIN #Modbus_Write_Read_Data_VFD_param
    PRINT VFD parameter data
    0x01, 0x06, 0x50, 0x01, 0x00, 0x02, 0x48, 0xCB
    BEGIN #Check_VFD_response_data_param
    CRC OK: 52040
    Address OK: 1
    response check failed with error code: -4
    END #Modbus_HuanYang_VFD_Parameter_read
    Expression:
    exec('#Modbus_HuanYang_VFD_Parameter_read') = 0
    I only need the part that control the spindle on/off and the speed, not all the read parameters staff.
    I hope you can help.

  5. #5
    Join Date
    Mar 2017
    Posts
    1304

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Nobody really needs to read parameters. But it is easiest thing to do and should be first step in an attempt to communicate via VFD. When you learn how to do this other stuff gets mush easier.

  6. #6
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Quote Originally Posted by PlanetCNC View Post
    Nobody really needs to read parameters. But it is easiest thing to do and should be first step in an attempt to communicate via VFD. When you learn how to do this other stuff gets mush easier.
    Yes, I have no idea how to do that, I have read all tutorials and understand nothing about programming.
    I only want to control the spindle with G-code.
    What I understand from error code "Response check failed with error code: -4" is that the .fc(function) is not correct for my VFD and I don't know how to find the right one.
    Anyway, thank's for reply, not much help.

  7. #7
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    I can control the spindle via Modbus Poll, address for control on/off is 0x1000 and for control speed is 0x2000.
    Changed those in your files at .fc with no results.

    Attachment 488974

  8. #8
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Learning hard.
    Moved registry to write at .data_size and changed .fc(function) to 06hex and success.

    "M3 start"
    #Fwd entry
    VFD Status: 11
    BEGIN #Modbus_Write_Read_Data_VFD
    PRINT VFD parameter data
    BEGIN #Check_VFD_response_data
    CRC OK: 48
    Address OK: 1
    Function Code OK: 6
    END #Check_VFD_response_data
    END #Modbus_Write_Read_Data_VFD
    VFD Status: 12
    BEGIN #Modbus_HuanYang_VFD_control
    BEGIN #Modbus_Write_Read_Data_VFD
    PRINT VFD parameter data
    BEGIN #Check_VFD_response_data
    CRC OK: 2313
    Address OK: 1
    Function Code OK: 6
    END #Check_VFD_response_data
    END #Modbus_Write_Read_Data_VFD
    END #Modbus_HuanYang_VFD_control
    VFD Status: -1
    "Successfull start of spindle via Modbus"
    "M5 start"
    VFD Status: 31
    BEGIN #Modbus_HuanYang_VFD_control
    BEGIN #Modbus_Write_Read_Data_VFD
    PRINT VFD parameter data
    BEGIN #Check_VFD_response_data
    CRC OK: 2313
    Address OK: 1
    Function Code OK: 6
    END #Check_VFD_response_data
    END #Modbus_Write_Read_Data_VFD
    END #Modbus_HuanYang_VFD_control
    VFD Status: -1
    "Successfull stop of spindle via Modbus"
    Except that the spindle not start!
    Anybody to help? Please?

  9. #9
    Join Date
    Mar 2017
    Posts
    1304

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    I think that page 100 of your vfd manual describes commands to start/stop spindle.

  10. #10
    Join Date
    Aug 2011
    Posts
    252
    Quote Originally Posted by PlanetCNC View Post
    I think that page 100 of your vfd manual describes commands to start/stop spindle.
    I found commands and managed to control the spindle trough modbus pull program, but can't do it with Planet CNC files provided in tutorial as I wrote already, I'm stuck.

  11. #11
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Well,
    First: I managed to lock my VFD parameters, I don't know how I did it. Luckly I can control the spindle through Modbus pull program.
    Second: When M3, M4 an M5 files are in script folder and load a g-code in TNG, in the graphic area is not showing.
    P.S. Now that parameters are locked, I can make more tests maybe without damaging other things.

  12. #12
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Planet CNC,
    I made the scripts to work finally, but only for 2 seconds it start the spindle than stop. I see the same behavior on Modbus Pull program if I don't leave at least one poll channel open to read one parameter once a second.
    I tried #LOOP5 but is to slow, my question is if you can make another #LOOP1 for every second?
    Best Regards
    P.S. The problem with M3,4 and 5 files in script folder still exist.

  13. #13
    Join Date
    Dec 2003
    Posts
    24220

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    The Huanyang MODBUS design is a 'cobbled' up version, I know when i was attempting to get it working for another system, I had a great deal of help from Sébastien at Royaumedeole. France, he wrote a plug in for Mach3 for it.
    Modbus is a nice way for control, setting the speed digitally, as well as reading any parameter you wish.
    CNC, Mechatronics Integration and Custom Machine Design

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

  14. #14
    Join Date
    Nov 2013
    Posts
    4361

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Hi,
    the early Huanyang VFDs had a non-standard MODBUS implementation. There have been a few plugins that have worked around that, Al_The_Man having written one.

    Haunyang must have suffered some customer blowback because the current 'GT' models are MODBUS compliant and any MODBUS capable software solution should work.

    Craig

  15. #15
    Join Date
    Dec 2003
    Posts
    24220

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Quote Originally Posted by joeavaerage View Post
    Hi,

    Haunyang must have suffered some customer blowback because the current 'GT' models are MODBUS compliant and any MODBUS capable software solution should work.

    Craig
    That must have been after I posted early on, to the effect that Huanyang Tech's must have been smoking something when they designed it! :violin:
    CNC, Mechatronics Integration and Custom Machine Design

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

  16. #16
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Al_The_Man and Craig, thank you for your reply but my VFD is Fuling (aka Folinn).

    All the problems sorted out.

    Here I attach the functional files for FULING DZB312B

    Don't use it for other VFD's, (like I did with those posted for Huanyang by PlanetCNC) also use it at your own risk.
    This costed me some days for learning Modbus, some PlanetCNC coding and contact Fuling Electric to unlock my VFD.
    Best Regards

    P.S. This are the settings you must change before attempt to control your Fuling VFD through Modbus:
    F0.01 - 2 RS-485 (default 0)
    F0.03 - 6 RS-485 (default 1)
    F3.03 - 2 keypad and RS-485 (default 0)
    F6.00, F6.01, F6.02 and F6.03 default are good but need verification)

  17. #17
    Join Date
    Mar 2017
    Posts
    1304

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    -Great! Thank you for pushing it trough and getting the scripts working with your VFD.
    Maybe in the Expr_Modbus_fuling_VFD_control file, under #Modbus_Fuling_VFD_control function, change the naming of private variables from data_size to address Lo-Hi and data Hi-Lo. For better clarification, just a tip.

  18. #18
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Quote Originally Posted by PlanetCNC View Post
    -Great! Thank you for pushing it trough and getting the scripts working with your VFD.
    Maybe in the Expr_Modbus_fuling_VFD_control file, under #Modbus_Fuling_VFD_control function, change the naming of private variables from data_size to address Lo-Hi and data Hi-Lo. For better clarification, just a tip.
    Good point, I have struggled with that and I suggest more explication lines in code next time for a noob like me.

  19. #19
    Join Date
    Aug 2011
    Posts
    252

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Another suggestion for all who want to take the scripts from tutorial and make it to work with your VFD's:
    First thing to do is LOCK PARAMETERS with your own known locking code, before to make a mistake and lock the parameters without knowing. (like I did, don't be like me )
    And forget about parameter read aka Expr_Modbus_HuanYang_VFD_Parameter_Read.txt, is useless if you don't have that specific VFD.
    All you need you will find in your VFD manual, read it carefully.
    Best Regards

  20. #20
    Join Date
    Jan 2023
    Posts
    7

    Re: MODBUS communication with HuanYang VFD and PlanetCNC TNG – tutorial series [UPDAT

    Hello,

    i am trying to get an Omron MX2-2,2kw inverter to work with planet cnc and RS485. I am switching from an working Mesa 7i76e and there the RS485 was really simple, but with planet cnc i have no idea how to get this combination in an usable condition.
    I ve read all the tutorial again and again, but nothing worked..

    Maybe there is someone with an working configuration for an Omron/Hitachi MX2 ?

Page 1 of 2 12

Similar Threads

  1. Replies: 3
    Last Post: 02-04-2023, 06:14 PM
  2. Replies: 13
    Last Post: 01-06-2023, 02:12 PM
  3. PlanetCNC TNG - License issue, PLEASE READ!
    By PlanetCNC in forum PlanetCNC
    Replies: 0
    Last Post: 08-09-2022, 07:18 AM
  4. Gantry square procedure tutorial with PlanetCNC TNG
    By PlanetCNC in forum PlanetCNC
    Replies: 2
    Last Post: 07-08-2022, 12:01 PM
  5. Replies: 0
    Last Post: 07-06-2022, 04:17 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
  •