Huanyang VFD RS485 / Modbus - Page 5

Page 5 of 7 FirstFirst ... 234567 LastLast
Results 81 to 100 of 129

Thread: Huanyang VFD RS485 / Modbus

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

    Default

    Knocking my head on the table right now. The pyvcp gui is now working. I seem to have completely oversee the setting in the stepconfig wizard. I need to mark the "include custom PyVCP GUI panel".

    Huanyang VFD RS485 / Modbus-pyvcp-png

    Now I have the GUI as shown below

    Huanyang VFD RS485 / Modbus-linuxcncgui-png

    Now I just need the appropriate settings for the baud rate and the com ports. I'm trying that out now as I speak.

    Again, thanks for everything.



  2. #82
    Member
    Join Date
    Feb 2007
    Location
    usa
    Posts
    711
    Downloads
    2
    Uploads
    0

    Default

    Run linuxcnc from terminal so you can see any errors or warnings.
    It'd be nice to see if it still shows segmentation fault when hy_vfd is run.

    I was getting about a page a second of communication errors until I got the settings right.
    Also, know that you can control the vfd, but won't see any feedback, unless linuxcnc is started after the vfd is powered up.



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

    Default

    Thanks for that Alan.

    I have now set the baud rate to 19200 and the com port to ttyUSB0. The VFD PD164 is set to 2. I have a USB to RS485 board with visible leds. The leds are flashing green an red when I open linuxcnc, so something is at least happening. I have tried another baud rates and com ports and when I choose the wrong ones the led do not flash.

    magnus@magnus-desktop:~$ dmesg | grep tty
    [ 0.000000] console [tty0] enabled
    [ 0.275264] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 0.275665] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [ 0.275896] 0000:00:03.3: ttyS1 at I/O 0x1128 (irq = 17) is a 16550A
    [ 12.150842] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0
    Here is the output of hy_vfd, no segmentation error.
    magnus@magnus-desktop:~$ hy_vfd
    hy_vfd: device='/dev/ttyUSB0', baud=19200, bits=8, parity='even', stopbits=1, address=1, verbose=1, PID=8287
    Opening /dev/ttyUSB0 at 19200 bauds (even)
    I was getting about a page a second of communication errors
    Same here

    Here is a copy of the errors

    magnus@magnus-desktop:~$ linuxcnc
    LINUXCNC - 2.5.3
    Machine configuration directory is '/home/magnus/linuxcnc/configs/CNCdtu'
    Machine configuration file is 'CNCdtu.ini'
    Starting LinuxCNC...
    spindle-vfd: device='/dev/ttyUSB0', baud=19200, bits=8, parity='even', stopbits=1, address=1, verbose=1, PID=7919
    Opening /dev/ttyUSB0 at 19200 bauds (even)
    read_data: reading setup parameters:

    query_length = 6
    Modbus query = [01][01][03][04][00][00][7D][8F]
    query_ret = 8
    response_length_computed = 8
    waiting for message (8 bytes)...
    length to read = 8
    read return = [08] bytes
    msg_length = [08]
    characters received =[00][00][00][00][00][00][45][00]

    ERROR invalid crc received 4500 - crc_calc 1B (-16)
    crc check = -16
    read_setup: FAILED

    query_length = 4
    Modbus query = [01][04][01][00][41][89]
    query_ret = 6
    response_length_computed = 8
    waiting for message (8 bytes)...
    length to read = 8
    read return = [06] bytes
    msg_length = [06]
    characters received =[00][00][00][00][00][00]
    message was incomplete, length still to read = [02]
    read return = [02] bytes
    msg_length = [08]
    characters received =[F8][A7]

    ERROR invalid crc received F8A7 - crc_calc 1B (-16)
    crc check = -16
    read_data: FAILED
    The modbus communication icon in linuxcnc is red, meaning I don't have communication, I guess.

    After about 30 sec I get this error message in linuxcnc
    RAPI: ERROR: Unexpected realtime delay on task 1
    This message will only display once per session
    Run the Latency Test and resolve before continuing
    I have tried some gcodes such a M3 S5000 but the spindle does not start.

    Any advice?



  4. #84
    Member
    Join Date
    Feb 2007
    Location
    usa
    Posts
    711
    Downloads
    2
    Uploads
    0

    Default

    you need to set pd163,pd164,pd165 to match what is on the line in custom.hal for hy_vfd (or in the defaults, which I would verify)
    My mistake on the seg fault, I get that also when hy_vfd is run from command line.
    hy_vfd --help will show all options, make them match what is in the vfd parameters.

    - - - Updated - - -

    your realtime delay warning is probably from latency set too low, I don't think it will relate to the vfd stuff.



  5. #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



  6. #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



  7. #87
    Member
    Join Date
    Feb 2007
    Location
    usa
    Posts
    711
    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.



  8. #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.



  9. #89
    Member
    Join Date
    Feb 2007
    Location
    usa
    Posts
    711
    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.



  10. #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



  11. #91

    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



  12. #92

    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.



  13. #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.



  14. #94
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    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.


  15. #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.



  16. #96
    Member
    Join Date
    Jun 2010
    Location
    US
    Posts
    12
    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.



  17. #97
    Registered
    Join Date
    May 2012
    Location
    Australia
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default

    Hi all,

    Not being terribly strong on coding etc myself I was wondering if I can get some help displaying the inverter temperature. It appears that the information is already retrieved (“hal_float_t *Tmp; // Temperature (to be confirmed)” amongst other various references.

    I addedd to the custom_postgui.hal file as followers:-

    net hy-Temp <= spindle-vfd.Tmp => pyvcp.vfd-temp

    and added the following to the xml file:-

    <tablesticky sticky="w" />
    <label>
    <text>"VFD Temperature"</text>
    </label>
    <tablesticky sticky="e" />
    <number>
    <halpin>"temp"</halpin>
    <format>"4.2f"</format>
    </number>

    But I just get a 0 displayed.

    Cheers



  18. #98
    Member
    Join Date
    Jun 2010
    Location
    US
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    Sorry for the very late reply. I thought I had posted a reply, but then today I looked and I don't see it here.

    In the stuff you posted, you have these 2 lines..
    Quote Originally Posted by tricarpa View Post
    net hy-Temp <= spindle-vfd.Tmp => pyvcp.vfd-temp
    <halpin>"temp"</halpin>
    I believe the halpin needs to be "vfd-temp" (thus matching the hal file definition) in order to work, but I'm unsure as I'm not very hal-savvy.



  19. #99
    Registered
    Join Date
    May 2012
    Location
    Australia
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default

    Yeah sorry, I made a mistake in my original post the hall file is:-
    net hy-Temp <= spindle-vfd.Tmp => pyvcp.temp

    So the XML file is right, but thanks it did make me check it.

    I also added this to the Hal file:-
    net hy-ACV <= spindle-vfd.ACV => pyvcp.AC-V

    And this to the XML:-
    <label>
    <text>"AC - Volts "</text>
    </label>
    <tablesticky sticky="e" />
    <number>
    <halpin>"AC-V"</halpin>
    <format>"4.0f"</format>
    </number>
    <tablerow/>

    I get ACV data when the VFD runs (albeit in the thousands instead of the hundreds eg. 2100 ACV instead of 210.0 ACV), but that is something I can fix(I think).



  20. #100
    Registered
    Join Date
    May 2012
    Location
    Australia
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default

    I also noticed my Lower Limit Frequency is showing 0 as well??



Page 5 of 7 FirstFirst ... 234567 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