586,072 active members*
4,652 visitors online*
Register for free
Login Register
CHIRON Group SE Forum

PERFORMANCE MEETS PRECISION

Phase Converters > Huanyang VFD RS485 / Modbus - Page 5
Page 5 of 7 34567
Results 81 to 100 of 131
  1. #81
    Join Date
    Feb 2007
    Posts
    711
    custom_postgui.hal:17: Pin 'pyvcp.spindle-speed' does not exist
    That is why linuxcnc won't start up. Did you copy the necessary lines over to custompanel.xml?

    As far as the permissions, I don't know what would cause that, but I've never had to use root with ubuntu, only sudo from user account.
    It may be worth starting from scratch. The binary won't run, make fails, and the permissions issue, a fresh install may be what you need.

  2. #82
    Join Date
    Feb 2007
    Posts
    711
    one more thing, I guess make will only run once unsuccessfully.
    do this:
    make clean
    sudo make && make install

    see if there are still errors.

  3. #83
    Join Date
    Mar 2013
    Posts
    11
    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".

    Attachment 206404

    Now I have the GUI as shown below

    Attachment 206406

    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.

  4. #84
    Join Date
    Feb 2007
    Posts
    711
    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.

  5. #85
    Join Date
    Mar 2013
    Posts
    11
    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?

  6. #86
    Join Date
    Feb 2007
    Posts
    711
    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.

  7. #87
    Join Date
    Mar 2013
    Posts
    11
    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

  8. #88
    Join Date
    Mar 2013
    Posts
    11
    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

  9. #89
    Join Date
    Feb 2007
    Posts
    711
    oh yeah, make sure pd001 and pd002 are set to 2. Im guessing they already are since you said mach3 works.

  10. #90
    Join Date
    Mar 2013
    Posts
    11
    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.

  11. #91
    Join Date
    Feb 2007
    Posts
    711
    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.

  12. #92
    Join Date
    Mar 2013
    Posts
    11
    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

  13. #93
    Join Date
    Aug 2013
    Posts
    2
    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

  14. #94
    Join Date
    Aug 2013
    Posts
    2
    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.

  15. #95
    Join Date
    Mar 2013
    Posts
    11
    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.

  16. #96
    Join Date
    Dec 2003
    Posts
    24221
    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.

  17. #97
    Join Date
    Mar 2013
    Posts
    11
    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
    Attachment 210484

    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.

  18. #98
    Join Date
    Jun 2010
    Posts
    12
    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.

  19. #99
    Join Date
    May 2012
    Posts
    5
    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

  20. #100
    Join Date
    Jun 2010
    Posts
    12
    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.

Page 5 of 7 34567

Similar Threads

  1. Mach3+DZB200M + Modbus RS485 + brain
    By Ceyhun in forum Mach Software (ArtSoft software)
    Replies: 5
    Last Post: 10-30-2014, 12:42 PM
  2. Replies: 4
    Last Post: 01-27-2013, 06:49 PM
  3. RS485 for POWERMAX 65
    By FredCNC in forum Hypertherm Plasma
    Replies: 8
    Last Post: 08-24-2011, 02:46 AM
  4. Spindle vfd control via modbus & rs485?
    By Pplug in forum Techno CNC
    Replies: 0
    Last Post: 05-25-2011, 01:24 AM
  5. rs-232 and rs485 bus
    By eloid in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 03-13-2007, 04:39 AM

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
  •