Huanyang VFD Macro/ Plugin - Page 2

Page 2 of 32 FirstFirst 1234512 ... LastLast
Results 13 to 24 of 376

Thread: Huanyang VFD Macro/ Plugin

  1. #13
    Gold Member
    Join Date
    Apr 2013
    Location
    Sweden
    Posts
    1552
    Downloads
    2
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Dan,

    Thanks for sharing this and it's great that it is working, however there is at least one thing I don't understand in this macro. "Sact" is not seem to be used so why is it there at all? Or, is this not the whole macro?

    Like I mentioned before, without indentions and comments it is a bit difficult to understand and looks overcomplicated and incomplete. However, if you share this with the intentions of others might be interested in using it, it would be better if shared fully, or at least given some explanations.

    Last edited by A_Camera; 11-19-2016 at 03:24 PM.
    https://adapting-camera.blogspot.com
    https://www.youtube.com/channel/UC_vrAWOz5YGX6_e3qtXg3YA


  2. #14
    Registered
    Join Date
    Mar 2010
    Location
    America
    Posts
    709
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by A_Camera View Post
    Dan,

    Thanks for sharing this and it's great that it is working, however there is at least one thing I don't understand in this macro. "Sact" is not seem to be used so why is it there at all? Or, is this not the whole macro?

    Like I mentioned before, without indentions and comments it is a bit difficult to understand and looks overcomplicated and incomplete. However, if you share this with the intentions of others might be interested in using it, it would be better if shared fully, or at least given some explanations.
    Hey A_C

    First off let me start by writing I can take No credit for the the Sset and checksum conversion, Vmax549 generously written it for me, he was also a huge help in the rest. I did post the full macro and I thoroughly tested with gcode, MDI, buttons and worked flawless without a glitch for hours before posting.

    Good observation with the Sact, I removed it and it didn't take any effect. All my testing was done with it though, maybe TP will post why its there. There is some tweaking I would like to do, but the macro is perfectly functional as is. If you or anyone have any questions or see ways to tweak please post, that's why I posted macro instead of linking download.

    Dan



  3. #15
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    717
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    (;-) DAN can take a lot of credit as I only feed him parts and pieces as I was able to make them work. He did a GREAT deal of work in testing as I do not have one of those VFD here to test with.

    Teh Sact was a duplicate and it can be removed . I started in one direction then changed teh function and i never went far enough back to clean it all out.

    NOW can it be made more efficent ?? I am SURE it can. Teh idea was to get it all working dependably then take teh code back apart and streamline teh process if possible. BUT the old addage holds true IF it is not broken don't try to fix it as you might break it not fix it.

    (;-) TP



  4. #16
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    United States
    Posts
    30729
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    I made this a sticky.
    I'll probably be getting a Huanyang at some point, as I can get two, and have a spare for less than a Hitachi.

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

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

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


  5. #17
    Registered
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    650
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    I appreciate all the hard work. I've been pretty busy with upcoming holidays and such that I haven't used my cnc in a few weeks. When I get a chance, I will be testing out the macro and update everyone. Thanks Dan and everyone involved. Much appreciated for sure.



  6. #18
    Registered
    Join Date
    Mar 2010
    Location
    America
    Posts
    709
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Hey Gerry,

    I hope I don't jink myself by posting this, but had my HY vfd for over 2 years with at least and average of and hour a week of use with no problems and still going. Also, when you step up from a 2.2kw and only 1 phase available your choices of VFD becomes limited.

    I certainly have no complaints.

    Dan



  7. #19
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    United States
    Posts
    30729
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Thanks Dan. I already have the spindles, just need the VFD.
    What are you using to go from the PC to the VFD? A USB to RS-485 or something like that?

    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

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

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


  8. #20
    Registered
    Join Date
    Mar 2010
    Location
    America
    Posts
    709
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    RS232 to RS485

    Bought it on ebay over 2 years ago for $5.00 free delivery...lol



    Huanyang VFD Macro/ Plugin-rs-485_jpg_3-jpg



  9. #21
    Registered
    Join Date
    Mar 2010
    Location
    America
    Posts
    709
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Hello All,

    I attached a revised version of the Hunayang Macro below. Once again a big thanks goes to Vmax549 who written a bypass to frequency write. What this does is it only writes frequency to VFD when its changed. It uses the Getvar and Setvar that only works with the newer version of UCCNC, if older versions are used it will give a script error.

    This was written for a Hunayang VFD, but with a little editing of strings that it sends to VFD, it can be used with any VFD,




    M1099.txt



  10. #22
    Gold Member
    Join Date
    Apr 2013
    Location
    Sweden
    Posts
    1552
    Downloads
    2
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by Dan911 View Post
    Hello All,

    I attached a revised version of the Hunayang Macro below. Once again a big thanks goes to Vmax549 who written a bypass to frequency write. What this does is it only writes frequency to VFD when its changed. It uses the Getvar and Setvar that only works with the newer version of UCCNC, if older versions are used it will give a script error.
    I am not sure it is a good idea to send only on change. One advantage of Modbus is that it is self correcting, meaning that in case the VFD for some reason would lose the set data, it is corrected in the next packet because it is periodically resent. Also, the script does not have any error handling, it assumes that the VFD will receive the message without error. If there is noise or any other disturbance on the line the message will be discarded and the VFD will not act as expected, and if there is just one single message which is sent the VFD will not work as expected. There is no control of the VFD response, so UCCNC has no idea if the message was received or not. This script fills a gap in absence of a real plugin, but it is just a quick and easy solution, not very well designed technically. It works, and that's fine, but there are some issues connected to handling communication this way, so I would not rely on this in any critical or professional situation.

    Issues with this solutions are:

    • Missing error handling. This is very serious, especially if messages are only sent once.
    • Lack of locking COM resource at the start of UCCNC. Continuously opening/closing COM is not a good solution at all.
    • Timing. It relies on UCCNC macro loop timing, which is far too fast for this purpose.
    • Lack of localization. Will be fixed in next UCCNC release, but for now anyone living outside of USA and/or using other than US English Windows should add these two lines at the beginning of the code:


    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US", false);
    Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US", false);

    If those lines are not added the macro should only work when called as an M-code, not if it is in a macro loop. You and Vmax have not seen this since you are using the "right" Windows. I spent the whole weekend fighting with a short macro which worked well if called manually but failed in macro loop and I could not understand why, so I gave up and sent a mail to Balßzs during the evening. He replied pretty fast with those two lines and after adding those lines the macro worked even in macro loop. This will be corrected in the next UCCNC release, but for now it may be necessary to inform users about it.

    Those are just some of the things why I can not see this as anything other than a gap filler in waiting for a better plugin. Don't misunderstand me, I am really glad Vmax came up with this solution, but it is not very well written and is not going to be better if the periodic sending is removed, quite the opposite, more complicated and risky to use.

    Quote Originally Posted by Dan911 View Post
    This was written for a Hunayang VFD, but with a little editing of strings that it sends to VFD, it can be used with any VFD,
    In my opinion, it isn't a good idea at all to use this script to control any VFD which uses Modbus. The built in functions in UCCNC are miles better than this solution, even if this solution works for HY VFD which is not following any Modbus standards. For any device using Modbus as it supposed to be used, this function can be solved in a few lines of code, so even if this may be adjustable for other devices, it is better to use the built in functions for handling datacom and Modbus.

    https://adapting-camera.blogspot.com
    https://www.youtube.com/channel/UC_vrAWOz5YGX6_e3qtXg3YA


  11. #23
    Registered
    Join Date
    Oct 2005
    Location
    USA
    Posts
    717
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    HIYA A_C Please free free to update teh script to your standards (;-). OR write a pnew plugin just for teh HY VFD.

    There are many modbus variants( flavors) out there that require single shot control. Some even warn about excessive writes to the mem chips. How valid the MEM problem is I have no idea and don't really care.

    Some who use teh mobus protocal to a point also require single shot writes for control. Hypertherm's rs485 modual for there plasma units is one of those as well. It uses a variant of modbus ASCII.

    IF all controls were fully compliant to the "default" Modbus standard there would be no need for scripts like what Dan created.

    The quest cam up as to comercial applications. Would I use this approach ??? NOPE neither would I be using a HY VFD either (;-)

    Is this a work around to a known problem for teh DIY cnc world?? SURE IS

    So in this case does teh Modbus plugin work for teh HY VFD ?? NOPE

    Does it work for a Hypertherm RS 485 control for plasma ?? NOPE

    Does Dan's method work (;-) YEP

    Can it be made better ?? Sure it can . Please free free to update it then repost it back here for everyone like Dan did.

    (;-) TP



  12. #24
    Registered
    Join Date
    Mar 2010
    Location
    America
    Posts
    709
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    I didn't no much about Modbus standard until I started on this project, but isn't Modbus standard just a universal form of communication?? If I modified the string in script to communicate with any other VFD wouldn't that be somewhat Modbus standard?

    I spent a good amount of time monitoring how HY plugin, SpindleTalker and the Modbus plugin in UCCNC communicated through serial port and you wouldn't no the difference if just monitoring with a serial port monitor with all including script.

    If you or anyone feel sending frequency just once is not good then edit script to send 2x,5x,10x or just remove the compare and have it send continually.

    It you or anyone thinks a macroloop is to fast add "exec.Wait(??);" to each string send to your preference.

    I was never completely happy with opening and closing of port but it hasn't caused any problems. If there's noise problems on system its going to cause problems everywhere.



Page 2 of 32 FirstFirst 1234512 ... LastLast

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

Huanyang VFD Macro/ Plugin
Huanyang VFD Macro/ Plugin