Huanyang VFD Macro/ Plugin - Page 2

Page 2 of 29 FirstFirst 1234512 ... LastLast
Results 21 to 40 of 568

Thread: Huanyang VFD Macro/ Plugin

  1. #21
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    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



  2. #22
    Member
    Join Date
    Apr 2013
    Location
    Sweden
    Posts
    1899
    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://www.youtube.com/c/AdaptingCamera/videos
    https://adapting-camera.blogspot.com


  3. #23
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    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



  4. #24
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    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.



  5. #25
    Registered jfong's Avatar
    Join Date
    Apr 2004
    Posts
    733
    Downloads
    3
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Dan,
    I tested out your macro and a big THANK YOU!!!!! It works great, no problems getting it to run. Thanks again.



  6. #26
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by jfong View Post
    Dan,
    I tested out your macro and a big THANK YOU!!!!! It works great, no problems getting it to run. Thanks again.
    Hi Jfong, thanks for your feedback. I'm happy to see another Hunayang owner using it. I've done some tweaking to the macro and after I fully test and if all good I will post it.

    Thanks again,
    Dan



  7. #27
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Hi Jfong,

    Below is a new version of the Hunayang VFD macro for UCCNC. If you are using the macro I first posted I suggest switching to this one. Here's a list of what I added.

    1. I guess it could be called "error handling". If the macro don't receive a response from VFD it will continually send string until it responds. You will also get a warning in the UCCNC status message box. I've had yet to see this message in use/testing but it's there in case computer or VFD hip-cups.

    2. The Macro will now periodically send strings to what ever conditions/strings in use. This is easily editable in minutes within the macro. I have it set to resend every 3 min.

    I hope you and others will find this macro as useful as I do.

    Last edited by Dan911; 12-07-2016 at 08:02 PM. Reason: Linked wrong file


  8. #28
    Registered jfong's Avatar
    Join Date
    Apr 2004
    Posts
    733
    Downloads
    3
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Great thanks. I'll give this a try this weekend. I need to make some xmas ornaments.



  9. #29
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    I posted a link to download the HY macro this afternoon and it wasn't until i went to cut something tonight I realized it was the wrong file. It was the same file but I was playing around with delays "exec,wait()" and made the button response a little sluggish. The correct one below.




    M1097.txt



  10. #30
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by A_Camera View Post
    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);
    Hi AC,
    Obviously I value your input and is why I addressed each of your issues.

    "Missing error handling. This is very serious, especially if messages are only sent once."

    Macro will now continually resend string until a response from VFD, also every 2-3 minutes strings(packets) will be resent.

    "Lack of locking COM resource at the start of UCCNC. Continuously opening/closing COM is not a good solution at all."

    OMG... this one had me beating my head against the wall and was the F-ing simplest. goto/start duh...

    port now opens with UCCNC and closes with UCCNC

    "Timing. It relies on UCCNC macro loop timing, which is far too fast for this purpose."

    This was a lot of trial and error, actually 100ms was enough for send and recieve after sent string. Have it set to 1000ms, this was the max before noticing a delay after pushing cw/ccw button. Frequency is set to 2000ms since you could never notice any difference.


    "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:"

    Like you posted... It will be addressed in next release, otherwise add the two lines you posted.

    I basically had to rewrite to accommodate the port issue and want to do some thorough testing before posting since I have 3 versions posted already. If anyone wants to take a look before, LMK and I will send.

    Dan



  11. #31
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Hello All,

    Below is a link for a plugin to control your Huanyang VFD/spindle with UCCNC. Enclosed in zip file is a step by step instructions.

    Dan

    HYPLUGIN.zip



  12. #32
    Registered
    Join Date
    Mar 2014
    Posts
    10
    Downloads
    9
    Uploads
    0

    Default Re: Hunayang VFD Macro

    That never crossed my mind. No setting your min and max rpm to 8000 - 24000 wont help. Its still going send 133.33 to 400 to VFD. If you don't mind I would like to have a little fun with this. If your max rpm is 2500 what's your minimum?
    and using Mach3 with plugin what does the frequency read on your VFD with max rpm and min RPM?

    Please answer me in the Huanyang Macro Thread, were hijacking zymurgy42 thread...lol The link is below
    Not a problem Dan, I'm only to happy to give you any info I can, after all, it's me that's asking for help.
    I normally run my mill at 2000rpm, and I can go down to 400rpm. I don't really know if this is a frequency reading or not but, when I am running at 2000rpm, the readout on the VFD gives me 1999, 400rpm gives me 399, 2500 gives me 2499 etc etc.

    Hope this helps ! My buddy who done all the electronics is working away at the moment, or I could possibly have given you more relevant info.



  13. #33
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by needleworks View Post
    Not a problem Dan, I'm only to happy to give you any info I can, after all, it's me that's asking for help.
    I normally run my mill at 2000rpm, and I can go down to 400rpm. I don't really know if this is a frequency reading or not but, when I am running at 2000rpm, the readout on the VFD gives me 1999, 400rpm gives me 399, 2500 gives me 2499 etc etc.

    Hope this helps ! My buddy who done all the electronics is working away at the moment, or I could possibly have given you more relevant info.
    What your VFD is set to display is your RPM (Rott LED on), the Huanyang VFD has a lot more info to offer, such as output AMPS, temperature, counter, etc,etc. If you press the shift key on your VFD(>>) you can scroll through the LEDS to display it. If you scroll to have the" HZ" Led light on this will display the frequency the VFD is outputting. If I knew the outputting frequency on your min and max RPM I would be able to calculate and modify the plugin to work for you.

    Right now the plugin is set for Chinese spindles which is 50HZ = 3000.

    Dan



  14. #34
    Registered
    Join Date
    Mar 2014
    Posts
    10
    Downloads
    9
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by Dan911 View Post
    What your VFD is set to display is your RPM (Rott LED on), the Huanyang VFD has a lot more info to offer, such as output AMPS, temperature, counter, etc,etc. If you press the shift key on your VFD(>>) you can scroll through the LEDS to display it. If you scroll to have the" HZ" Led light on this will display the frequency the VFD is outputting. If I knew the outputting frequency on your min and max RPM I would be able to calculate and modify the plugin to work for you.

    Right now the plugin is set for Chinese spindles which is 50HZ = 3000.

    Dan
    Ok, no problem, I'll certainly have a look at that, Ok, hopefully these are the HZ readings ?

    At 400rpm > 13.88 at 2000rpm > 69.44 at 2200rpm > 76.38

    Thanks again for your help Dan, much appreciated

    Last edited by needleworks; 01-11-2017 at 06:57 PM.


  15. #35
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by Dan911 View Post
    Right now the plugin is set for Chinese spindles which is 50HZ = 3000.Dan
    I don't think the spindle would be very happy using a 50Hz setting, 50Hz could never = 3000, if 50Hz is written in the plugin then it has no meaning only the number 3000 is active

    50Hz=1440 standard Ac motor at 50Hz= 1440 RPM

    400Hz=3000 Chinese Spindle at 24,000 RPM

    Mactec54


  16. #36
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    3000rpm @ 50hz

    24000/3000 = 8

    8 * 50hz = 400hz

    Last edited by Dan911; 01-12-2017 at 11:29 AM.


  17. #37
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by needleworks View Post
    Ok, no problem, I'll certainly have a look at that, Ok, hopefully these are the HZ readings ?

    At 400rpm > 13.88 at 2000rpm > 69.44 at 2200rpm > 76.38

    Thanks again for your help Dan, much appreciated
    Hey needleworks, let me know how this works. It wont set anything below 400rpm, if you want that removed let me know. It will set any RPM higher so be careful. Remember to change min and max in UCCNC from 8000min 24000max to 400rpm to 2200rpm.

    The settings are based on the frequency's you provided above.

    Dan

    Needles2.zip



  18. #38
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    I left a debugging window that will pop up with hex frequency. I removed it and replaced with Needles2 zip. Don't know if you already downloaded first 1



  19. #39
    Registered
    Join Date
    Mar 2014
    Posts
    10
    Downloads
    9
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Quote Originally Posted by Dan911 View Post
    Hey needleworks, let me know how this works. It wont set anything below 400rpm, if you want that removed let me know. It will set any RPM higher so be careful. Remember to change min and max in UCCNC from 8000min 24000max to 400rpm to 2200rpm.

    The settings are based on the frequency's you provided above.

    Dan

    Needles2.zip
    Dan, you are an absolute star My mill is now working a treat ! It`s snowing heavy over here and very cold, so I only gave it a quick check but everything seems to be working fine now.

    Once again, many thanks for helping me out.



  20. #40
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: Hunayang VFD Macro

    Happy its working for you, Vmax549 written that frequency and crc check all I did was edit it to work for your mill.



Page 2 of 29 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