drivers for waveshare RS 485 usb serial converter for huangyang vfd

More
29 Nov 2023 14:08 #286784 by SvenH
I did come across that, group seems ok, am i right:

 sven@svencnc:~$ groups sven
sven : sven dialout cdrom sudo audio video users

I'll look in to permissions for the usb port.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 14:27 - 29 Nov 2023 14:29 #286785 by SvenH
I followed:
www.xmodulo.com/change-usb-device-permission-linux.html

and now have:
crw-rw---- 1 root dialout 188, 0 29 nov 15:20 /dev/ttyUSB0

For good measure I switched wires again for testing.
Last edit: 29 Nov 2023 14:29 by SvenH.

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 16:29 #286800 by dm17ry
sudo usermod -a -G dialout $USER

log out, log in

and it's usually a good idea to have rs485 devices grounds connected. it *may* work with just 2 wires, but it's easy to get out of the transceivers common mode voltage range

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 17:21 #286805 by SvenH
Thanks, will try tomorrow.

Just to be sure, $USER=$USER or $USER="me" in this case? Or even $USER=$"me"?

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 17:48 #286806 by dm17ry
$USER is a shell environment variable which will be replaced by the current user name. e.g:

dmitry@nostromo:~$ echo $USER
dmitry
dmitry@nostromo:~$

or you can type your login name instead of $USER

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 18:48 - 29 Nov 2023 21:05 #286808 by SvenH
Last edit: 29 Nov 2023 21:05 by SvenH.

Please Log in or Create an account to join the conversation.

More
29 Nov 2023 19:43 - 29 Nov 2023 19:43 #286811 by DaBit
If the tty cannot be opened due to permissions LinuxCNC will not start since the hy_vfd component will fail to start. This is not the case, so permissions on /dev/ttyUSB0 are likely not the culprit.

Please start a terminal, do a 'cd ./linuxcnc/configs/<your configuration>' and start linuxcnc using the command 'linuxcnc <your configuration>.ini'. The terminal will show errors as they occur. Look for something related to hy_vfd
Most likely they are also in linuxcnc_debug.txt or a similar named file (I am not behind a LinuxCNC PC at the moment)

Question to the forum: are there any breaking changes in hy_vfd between LinuxCNC 2.7/Wheezy and LinuxCNC 2.9/Bookworm?
Last edit: 29 Nov 2023 19:43 by DaBit.

Please Log in or Create an account to join the conversation.

More
30 Nov 2023 08:34 - 30 Nov 2023 08:54 #286851 by SvenH
The bits that seem to matter:

LINUXCNC - 2.9.1
Machine configuration directory is '/home/sven/linuxcnc/configs/Alu-XYZA'
Machine configuration file is 'Alu-XYZA.ini'
Starting LinuxCNC...
linuxcnc TPMOD=tpmod HOMEMOD=homemod EMCMOT=motmod
Note: Using POSIX realtime
Found file(REL): ./Alu-XYZA.hal
hm2: loading Mesa HostMot2 driver version 0.15
hm2_pci: loading Mesa AnyIO HostMot2 driver version 0.7
hm2_pci: discovered 5i25 at 0000:04:00.0
hm2/hm2_5i25.0: Low Level init 0.15
hm2/hm2_5i25.0: Smart Serial Firmware Version 43
Board hm2_5i25.0.7i76.0.0 Hardware Mode 0 = standard
Board hm2_5i25.0.7i76.0.0 Software Mode 0 = io_spin
Board hm2_5i25.0.7i76.0.0 Software Mode 1 = io_ana_spin
Board hm2_5i25.0.7i76.0.0 Software Mode 2 = io_enc_ana_spin_fv
hm2/hm2_5i25.0: 34 I/O Pins used:
hm2/hm2_5i25.0:     IO Pin 000 (P3-01): StepGen #0, pin Direction (Output)
hm2/hm2_5i25.0:     IO Pin 001 (P3-14): StepGen #0, pin Step (Output)
hm2/hm2_5i25.0:     IO Pin 002 (P3-02): StepGen #1, pin Direction (Output)
hm2/hm2_5i25.0:     IO Pin 003 (P3-15): StepGen #1, pin Step (Output)
hm2/hm2_5i25.0:     IO Pin 004 (P3-03): StepGen #2, pin Direction (Output)
hm2/hm2_5i25.0:     IO Pin 005 (P3-16): StepGen #2, pin Step (Output)
hm2/hm2_5i25.0:     IO Pin 006 (P3-04): StepGen #3, pin Direction (Output)
hm2/hm2_5i25.0:     IO Pin 007 (P3-17): StepGen #3, pin Step (Output)
hm2/hm2_5i25.0:     IO Pin 008 (P3-05): StepGen #4, pin Direction (Output)
hm2/hm2_5i25.0:     IO Pin 009 (P3-06): StepGen #4, pin Step (Output)
hm2/hm2_5i25.0:     IO Pin 010 (P3-07): Smart Serial Interface #0, pin tx0 (Output)
hm2/hm2_5i25.0:     IO Pin 011 (P3-08): Smart Serial Interface #0, pin rx0 (Input)
hm2/hm2_5i25.0:     IO Pin 012 (P3-09): IOPort
hm2/hm2_5i25.0:     IO Pin 013 (P3-10): IOPort
hm2/hm2_5i25.0:     IO Pin 014 (P3-11): Encoder #0, pin Index (Input)
hm2/hm2_5i25.0:     IO Pin 015 (P3-12): Encoder #0, pin B (Input)
hm2/hm2_5i25.0:     IO Pin 016 (P3-13): Encoder #0, pin A (Input)
hm2/hm2_5i25.0:     IO Pin 017 (P2-01): IOPort
hm2/hm2_5i25.0:     IO Pin 018 (P2-14): IOPort
hm2/hm2_5i25.0:     IO Pin 019 (P2-02): IOPort
hm2/hm2_5i25.0:     IO Pin 020 (P2-15): IOPort
hm2/hm2_5i25.0:     IO Pin 021 (P2-03): IOPort
hm2/hm2_5i25.0:     IO Pin 022 (P2-16): IOPort
hm2/hm2_5i25.0:     IO Pin 023 (P2-04): IOPort
hm2/hm2_5i25.0:     IO Pin 024 (P2-17): IOPort
hm2/hm2_5i25.0:     IO Pin 025 (P2-05): IOPort
hm2/hm2_5i25.0:     IO Pin 026 (P2-06): IOPort
hm2/hm2_5i25.0:     IO Pin 027 (P2-07): IOPort
hm2/hm2_5i25.0:     IO Pin 028 (P2-08): IOPort
hm2/hm2_5i25.0:     IO Pin 029 (P2-09): IOPort
hm2/hm2_5i25.0:     IO Pin 030 (P2-10): IOPort
hm2/hm2_5i25.0:     IO Pin 031 (P2-11): IOPort
hm2/hm2_5i25.0:     IO Pin 032 (P2-12): IOPort
hm2/hm2_5i25.0:     IO Pin 033 (P2-13): IOPort
hm2/hm2_5i25.0: registered
hm2_5i25.0: initialized AnyIO board at 0000:04:00.0
Found file(LIB): /usr/share/linuxcnc/hallib/xhc-hb04.tcl
xhc-hb04: waiting for XHC-HB04 device
xhc-hb04.tcl: !!! <halui.spindle.stop> target pin does not exist, continuing
xhc-hb04.tcl: !!! <halui.spindle.start> target pin does not exist, continuing
xhc-hb04.tcl: using std_start_pause_button
xhc-hb04.tcl: Using existing outpin signame: spindle-cmd-rps-abs
APP: monitor-xhc-hb04 found: </usr/bin/monitor-xhc-hb04>
note: MAXV     max: 100.000 units/sec 6000.000 units/min
note: LJOG     max: 100.000 units/sec 6000.000 units/min
note: LJOG default: 75.000 units/sec 4500.000 units/min
note: AJOG     max: 5600.000 units/sec 336000.000 units/min
note: AJOG default: 36.000 units/sec 2160.000 units/min
note: jog_order='XYZA'
note: jog_invert=set()

ERROR invalid crc received 44BF - crc_calc 68EB (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 68EB (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 84BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

ERROR invalid crc received 44BF - crc_calc 78EA (-16)
error reading setup from VFD, retrying

@ Bart:
It looks like the stuff about xhc-hb04.tcl may also relate to the high acceleration during homing and jogging, you added slower acceleration for these but I needed to remove something from the pendant from config, will search for this and include.

Some errors showing up when shutting down:

hm2/hm2_5i25.0: Watchdog has bit! (set the .has-bit pin to False to resume)
hm2/hm2_5i25.0: Watchdog has bit! (set the .has-bit pin to False to resume)
Shutting down and cleaning up LinuxCNC...
ERROR invalid crc received 44BF - crc_calc 78EA (-16)
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (31) LBPCOM Fault

error reading setup from VFD, retrying
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (30) Illegal Remote Mode
task: main loop took 35.010058 seconds
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (29) Under Voltage
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (28) Over Voltage
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (27) Over Current
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (26) Over Temperature
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (25) No Enable
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (24) Watchdog Fault
hm2/hm2_5i25.0: Smart Serial port 0: DoIt not cleared from previous servo thread. Servo thread rate probably too fast. This message will not be repeated, but the hm2_5i25.0.sserial.0.fault-count pin will indicate if this is happening frequently.
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 local error = (13) Communication error
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 local error = (3) Timeout
hm2/hm2_5i25.0: Smart Serial Comms Error: There have been more than 1 errors in 10 thread executions at least 200 times. See other error messages for details.
hm2/hm2_5i25.0: ***Smart Serial Port 0 will be stopped***
hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (31) LBPCOM Fault

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (30) Illegal Remote Mode

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (29) Under Voltage

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (28) Over Voltage

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (27) Over Current

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (26) Over Temperature

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (25) No Enable

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 remote error = (24) Watchdog Fault

hm2/hm2_5i25.0: Smart Serial port 0: DoIt not cleared from previous servo thread. Servo thread rate probably too fast. This message will not be repeated, but the hm2_5i25.0.sserial.0.fault-count pin will indicate if this is happening frequently.

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 local error = (13) Communication error

hm2/hm2_5i25.0: Smart serial card hm2_5i25.0.7i76.0.0 local error = (3) Timeout

hm2/hm2_5i25.0: Smart Serial Comms Error: There have been more than 1 errors in 10 thread executions at least 200 times. See other error messages for details.

hm2/hm2_5i25.0: ***Smart Serial Port 0 will be stopped***

task: 8108 cycles, min=0.000007, max=35.010058, avg=0.014363, 1 latency excursions (> 10x expected cycle time of 0.010000s)
A non blocked signal was caught
xhc-hb04: connection lost, cleaning up
hm2_5i25.0: dropping AnyIO board at 0000:04:00.0
hm2/hm2_5i25.0: unregistered
RTAPI_PCI: Unmapped 65536 bytes at 0x7f4c2db2c000
hm2_pci: driver unloaded
hm2: unloading
WAIT_DATA(): comms time out

ERROR Communication time out (-12)
error reading setup from VFD, retrying
Note: Using POSIX realtime

 

Last edit: 30 Nov 2023 08:54 by SvenH.

Please Log in or Create an account to join the conversation.

More
30 Nov 2023 09:58 #286854 by DaBit
Let's focus on the HuanYang VFD first, shall we? That one is blocking, HB04 accelerations are not. 

Since the wiring and VFD configuration worked fine with 2.7 we have two possibilities for the hardware setup:
- Configuration is correct, issues are purely software related.
- Configuration was not correct, and some setting was not important with 2.7 while it is with 2.9

Does anyone know about such a setting? I am not too familiar with the HY-VFD component. 

@SvenH: can you:
- Check the setting of VFD parameters PD001, PD002, PD163, PD164, PD165? They should match this document: linuxcnc.org/docs/html/man/man1/hy_vfd.1.html
- Check that D+ and D- lines from the USB->RS485 converter match the corresponding terminals on the VFD. The CRC errors could be related to + and - being swapped.  (here is someone else with similar issues: forum.linuxcnc.org/49-basic-configuratio...h-hy-inverter#148533)
- Paste the hy-vfd component instantiation from your postgui HAL here too so others can have a look. 


Then about the software. The hy_vfd component seems to have changed 2 months ago: github.com/LinuxCNC/linuxcnc/tree/master...r_comps/huanyang-vfd
Seems unrelated, but could that be causing issues?

Please Log in or Create an account to join the conversation.

More
30 Nov 2023 10:26 #286858 by SvenH
All errors I now get are:

ERROR Communication time out (-12)
error reading setup from VFD, retrying
WAIT_DATA(): comms time out

ERROR Communication time out (-12)
error reading setup from VFD, retrying
WAIT_DATA(): comms time out

ERROR Communication time out (-12)
error reading setup from VFD, retrying
WAIT_DATA(): comms time out

ERROR Communication time out (-12)
error reading setup from VFD, retrying
Shutting down and cleaning up LinuxCNC...
WAIT_DATA(): comms time out

task: 1567 cycles, min=0.000008, max=0.013308, avg=0.009983, 0 latency excursions (> 10x expected cycle time of 0.010000s)
A non blocked signal was caught
xhc-hb04: connection lost, cleaning up
hm2_5i25.0: dropping AnyIO board at 0000:04:00.0
hm2/hm2_5i25.0: unregistered
RTAPI_PCI: Unmapped 65536 bytes at 0x7fe58895f000
hm2_pci: driver unloaded
hm2: unloading
WAIT_DATA(): comms time out

ERROR Communication time out (-12)
error reading setup from VFD, retrying
Note: Using POSIX realtime

Adding additional info in next post.

Please Log in or Create an account to join the conversation.

Time to create page: 0.183 seconds
Powered by Kunena Forum