Huanyang VFD RS485 / Modbus - Page 8

Page 8 of 11 FirstFirst ... 567891011 LastLast
Results 85 to 96 of 127

Thread: Huanyang VFD RS485 / Modbus

  1. #85
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    PD163 = 1
    PD164 = 2 (19200)
    PD165 = 3 (8N1 for RTU)

    line in custom.hal
    loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd -v -d /dev/ttyUSB0 -p even -r 19200 -s 1

    in hy_vfd.c
    // assume that nothing is specified on the command line
    baud = 19200;
    bits = 8;
    stopbits = 1;
    debug = TRUE;
    device = "/dev/ttyUSB0";
    parity = "even";
    slave = 1;

    I cross referencing everything now



  2. #86
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    PD163 = 1
    PD164 = 2 (19200)
    PD165 = 3 (8N1 for RTU)

    line in custom.hal
    loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd -v -d /dev/ttyUSB0 -p even -r 19200 -s 1

    in hy_vfd.c
    // assume that nothing is specified on the command line
    baud = 19200;
    bits = 8;
    stopbits = 1;
    debug = TRUE;
    device = "/dev/ttyUSB0";
    parity = "even";
    slave = 1;

    I'm cross referencing everything now



  3. #87
    Registered
    Join Date
    Feb 2007
    Location
    usa
    Posts
    707
    Downloads
    2
    Uploads
    0

    Default

    oh yeah, make sure pd001 and pd002 are set to 2. Im guessing they already are since you said mach3 works.



  4. #88
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    Yes they are set to 2.

    I still can't find out why it is not working. I have "cross referenced" the files custom.hal and hy_vfd. I also checked the settings of the VFD and compared them to the results of hy_vfd in terminal.



  5. #89
    Registered
    Join Date
    Feb 2007
    Location
    usa
    Posts
    707
    Downloads
    2
    Uploads
    0

    Default

    I don't know if you can use a port monitor to see what is happening on ttyUSB0, I used a serial port terminal when getting mine to work, but I am using a physical serial port, not a usb adapter. Other than that, make sure /dev/ttyUSB0 exists, and isn't 1 or 2 if it's plugged in a different bus (not sure if this is likely) and make the the case is correct, ie. not /dev/ttyusb0.



  6. #90
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    I will have to continue tomorrow. I will try to use a physical serial port tomorrow instead of the adapter and make sure that /dev/ttyUSB0 exist.

    Thanks again,
    Magnus



  7. #91
    Registered
    Join Date
    Aug 2013
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by MagnusMar View Post
    PD163 = 1
    PD164 = 2 (19200)
    PD165 = 3 (8N1 for RTU)

    line in custom.hal
    loadusr -Wn spindle-vfd hy_vfd -n spindle-vfd -v -d /dev/ttyUSB0 -p even -r 19200 -s 1

    in hy_vfd.c
    // assume that nothing is specified on the command line
    baud = 19200;
    bits = 8;
    stopbits = 1;
    debug = TRUE;
    device = "/dev/ttyUSB0";
    parity = "even";
    slave = 1;

    I'm cross referencing everything now
    Magnus, your own post lists a communication mismatch with your inverter set to 8N1 and your computer set to 8E1



  8. #92
    Registered
    Join Date
    Aug 2013
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    I've been messing with this for almost a full day now and finally got mine working: Here's what I learned:

    First: PD001 and PD002 = 2, then PD163-PD165 need to be set to match your computer, they are all 0 by default.

    Second: the inverter has to be set to RTU mode, not ASCII. PD164 = 3, 4 or 5. I didn't find this information anywhere, but confirmed it in the source code.

    Third: Mine does NOT work if I have parity enabled. No function at all, no apparent communications, nothing. So much so that I thought my wiring was bad, though it wasn't. I had to set my inverter and computer to 8N1. 8E1 and 8O1 just do nothing for me.

    Fourth: I left out the pyvcp code at first because I'm not going to use it in the end. It was a couple hours before I discovered the line in custom_postgui.hal
    setp spindle-vfd.enable 1
    This is critical, nothing at all happens without it. Since I don't need to whole GUI panel I just copied that line to my own custom.hal and it works fine, except the speed buttons don't work. That should be an easy fix.

    Hope this helps someone. And thanks to the authors of this sweet code.



  9. #93
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    I had to travel abroad so I started again today fixing it. I finally got it to work I changed the PD165 settings to 4 (8E1 for RTU). That did the trick. Thanks CrazyMonkeyBen!

    I´m now up and running with spindle control, yeah. I can use the speed buttons as well as running gcode.

    There's still is a minor flaw. The c code looks up the parameter in PD144 which has a range of 0-9999. This set value is the rated motor revolution and in my case the motor is 24000 RPM. The problem is that this set value correspond to the revolution at 50 Hz. This means that I have to set the value at 3000 (since 400 hz/50 hz = 8 and 8*3000 rpm = 24000 rpm) for the actual RPM shown in the gui to be correct.

    This is a problem since this affects the gcode as well. Lets say that I run the gcode M3 S1000. This gives me a RPM of 8000.

    Thanks again guys. You were very helpful.



  10. #94
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    22706
    Downloads
    0
    Uploads
    0

    Default

    Are you running the later improved plug in from
    A new Huanyang VFD plugin
    http://royaumedeole.fr/informatique/...-huanyang-vfd/
    Al.

    CNC, Mechatronics Integration and Custom Machine Design

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


  11. #95
    Registered
    Join Date
    Mar 2013
    Location
    Denmark
    Posts
    11
    Downloads
    0
    Uploads
    0

    Default

    Everything was working fine the other day. Today I fired up my linuxcnc (after shutting down the computer) and I can't set the speed of the spindle.

    It seems that gui shows a value of 0 for both Motor Poles and Rated Motor RPM as seen in the attached screenshot
    Huanyang VFD RS485 / Modbus-screenshot-4-jpg

    I'm able to start the spindle by M3 (I hear the relay clicking noise in the VFD) but I can't set any speed. I guess this is because it gives a value of 0. It seems strange that it reads all of the other settings correctly but not these two. I have checked all of the settings in the VFD.

    I will continue to try to figure it out some other day. Any suggestions are welcome.



  12. #96
    Registered
    Join Date
    Jun 2010
    Location
    US
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    I too experienced this. It would correctly ready the motor poles and rated rpm about 1 in 6 times of starting up. It turned out that the issue was with the hy_vfd driver. What was happening was a series of events:
    * Occasionally, at startup, when querying the drive parameters, specifically when querying the number of motor phases, the first half the reply would be received followed by the second half in the second read attempt.
    * Now the return result of querying the phase is one byte shorter than the code defaults to expecting. It is built to detect this and handle it properly, except....
    * There is a bug with the code when the reply packet is received in two chunks, and it's a different length than expected. The code incorrectly checks p_msg[2] for the length of the reply packet, which, during the second chunk of the reply, points to the third byte in the second chunk, not the third byte in the overall message. The solution was to change the code to use msg[2] instead of p_msg[2] in hy_modbus.c. I don't have the line number handy since my hy_modbus.c is further modified to retry on failed CRCs, and a few other things that I tried to do to solve the issue (which didn't, in the end, help).

    I'll try to put together an archive of the whole thing when i get a chance, but for anyone who is using this module, and experiencing intermittent failures during startup, that change should get it resolved in 99% of cases.



Page 8 of 11 FirstFirst ... 567891011 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 RS485 / Modbus

Huanyang VFD RS485 / Modbus