588,075 active members*
4,957 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Phase Converters > Huanyang VFD -2.2kW-Which modbus function controls the frequency?
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2012
    Posts
    0

    Huanyang VFD -2.2kW-Which modbus function controls the frequency?

    I'm trying to cobble some software together to control this crazy thing. LOL

    I've been sending both the 02 and the 05 functions to the VFD for speed commands and they both get back responses; however I don't see the changes take effect. PD003 even changes to the new settings but the spindle speed doesn't change.

    Does the spindle have to be stopped before changing speeds ? I can start and stop the VFD over the modbus interface and run it in both CW and CCW directions but I don't seem to have much control over the speed yet.

    What functions do you have to send in order to control the speed? I'm hoping someone has already been down this path. Thanks

  2. #2
    Join Date
    Feb 2007
    Posts
    711
    post #26 on this page http://www.cnczone.com/forums/diy-cn..._modbus-3.html

    You can read that whole thread, or download those files and look at the source, should help you out some. Also check out post #19 in that thread.
    also if you have pd001 and pd002 set for comm port, then you cant change speed with pd003 or the panel.

    There is a mach3 plugin somewhere you could look at also, I dont know if the source code is available though.

  3. #3
    Join Date
    Dec 2012
    Posts
    0
    alan,

    THANK YOU so much. I read that thread previously, I don't know how I missed those files. I wish I'd seen this two weeks ago. LOL

    Last night I finally decided to reset the vfd to factory defaults. I learned that setting pd0013 to 8 as the included instructions indicated does nothing. LOL Setting it to 01 instead 'did' reset it.

    I think my vfd was in some sort of cookoo mode allowing most everything to work except speed control. I was wondering why I had to use pd001=2 and pd002=3. I couldn't find anyone using 3 for 002 but if I used 2 for both I got back good responses from the vfd but the spindle never spun up. I could even hear the internal relays clicking when responding to the commands but no spindle movement. When using 3 I got responses and spindle motion, just not much control over it. After the factory reset, I could use the pd002=2 and I seemed to have control of the speed with the 05 function.

    I see the code you linked to uses the 02 function for speed control instead of 05. I'm not sure what the practical differences are. Edit: oops, a closer look shows that 05 'is' being used to set frequency.

    I had decided to skip checking the responses returned by the vfd but after now having code in front of me I might attempt it. What I noticed when testing was that the CW, CCW and Stop commands will sometimes generate a response from NOT the current command but from the previous command. If the same command is issued a second (or more) times then the response 'is' valid for that command. It's like some internal buffer is one command behind occasionally, but for only some commands.

    Also, the concept of pd003 not controlling the speed when using rs-485 had me baffled. I'd read that but when I changed the contents of pd003 with the keypad, then came back later and checked them, the value I put there was indeed still in there. I just never got my head around the fact that huanyang was ignoring it. It looked pretty, but was apparently meaningless. My code would grab that value and slightly modify it (to bump the speed up or down slightlly), then place the new value back in pd003. That never worked right and now makes sense.

    Again, thank you so much, I feel like I've got a new toy for Christmas.

  4. #4
    Join Date
    Feb 2007
    Posts
    711
    Glad you have something to work with. I'm haven't wrapped my head around understanding the code or how it interfaced with the vfd.
    I did a little programming in high school but haven't kept with it.

    Im sure you have read the last few pages of the huanyang manual that talks about the serial communications?
    The huanyang protocol doesn't fully comply with modbus standard (from what I have heard, not familiar with either).
    Apparently from the earlier post I referenced, the manual has mistakes also.
    Just in case you were basing your work from a modbus paper or something.

  5. #5
    Join Date
    Dec 2012
    Posts
    0
    Yeah, my included manual doesn't even have a section on modbus but I found one online that had a little more info. None of the manuals are all that great. Some of the commands are non-standard and odd. Most of the info I've learned has been from the internet and there's not much out there; the linked thread you gave me is by FAR the best resource I've seen so far for writing your own program to control the vfd.

    I just printed out that code; I'm going to go study it to see how much error checking I'm willing to do. I'd never used rs-485 so that was a learning experience too. Initially it had a lot of noise with garbled data but a couple of well placed capacitors seems to have cleaned it up. I initially had some crude error-checking code but removed it when I saw how unpredictable some of the responses were. I'll probably put some back in.

    One thing I read, and it was good advice, was to use a 2nd rs232/rs485 adapter and a spare pc to monitor the communications between the controller and the vfd. This has worked fantastic. I downloaded some terminal program called Hercules (from HW-group) and it shows all the commands and responses going back and forth. It makes troubleshooting a little easier.

    So far I've gotten the code to run the vfd CW, CCW, stop and now (finally) it will set the speed. I think the only things left are some simple error-checking and possibly retrieving the current and actual speed. It says I can request the vfd temperature but I've never seen it show anything but zeros so I don't think it functions. Some of these cheap vfd's have had parts missing, like the rs-485 chips, so it wouldn't surprise me if they left out temp sensors too. LOL

Similar Threads

  1. Huanyang VFD RS485 / Modbus
    By scotta in forum Phase Converters
    Replies: 130
    Last Post: 05-15-2022, 03:13 PM
  2. Anyone's Huanyang VFD temperature function work ?
    By czralv in forum Phase Converters
    Replies: 14
    Last Post: 04-29-2020, 06:32 PM
  3. MODBUS
    By cncbpt in forum Screen Layouts, Post Processors & Misc
    Replies: 1
    Last Post: 02-07-2013, 06:24 PM
  4. USB Modbus I/O Using PIC
    By rdhopkins in forum PIC Programing / Design
    Replies: 7
    Last Post: 05-03-2012, 01:23 AM
  5. Modbus and the PIC
    By Al_The_Man in forum PIC Programing / Design
    Replies: 10
    Last Post: 01-30-2012, 04:51 PM

Posting Permissions

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