- Posts: 13
- Thank you received: 0
Problem with Huanyang VFD communication via RS485 in LinuxCNC
- deltafox24
- Topic Author
- Offline
- New Member
-
Less
More
2 years 1 week ago #312780
by deltafox24
Hello everyone!. please help me to customize the inverter under linuxcnc. i've been struggling for 2 weeks. I’m facing an issue with connecting my Huanyang VFD to LinuxCNC via RS485. It works perfectly in Windows, but I’m having trouble in Linux. I’m using an RS485-RS232 converter through the COM port, and despite configuring everything, the spindle does not respond, and the program either hangs or there’s no communication with the VFD.System:
- LinuxCNC 2.9.3(Debian 12)
- RS485-RS232 converter
- Huanyang VFD configured for Modbus RTU
- What I’ve done so far:
- VFD Settings:
- The following settings are configured on the VFD:
- PD001 = 2 — control via Modbus.
- PD002 = 2 — frequency via Modbus.
- PD163 = 1 — device address.
- PD164 = 9600 — baud rate.
- PD165 = 3 — 8 data bits, no parity, 1 stop bit (8N1).
- The following settings are configured on the VFD:
- Using
: I tried runningCode:hy_vfd, but the program hangs when opening the port. Here’s the command:Code:hy_vfd
bash
Копировать кодLog output:Code:hy_vfd -d /dev/ttyS0 --rate 9600 --parity none --stopbits 1 --target 1 -g
bash
Копировать кодThe program hangs at the stage of opening the port.Code:hy_vfd: device='/dev/ttyS0', baud=9600, bits=8, parity='none', stopbits=1, address=1, debug=1, PID=1586 Opening /dev/ttyS0 at 9600 bauds (none) - Checking the port via
: I connected to the port viaCode:minicom:Code:minicom
bash
Копировать кодThe port settings are 9600 8N1, but in the terminal, commands do not send and there’s no response from the VFD. The port is not occupied:Code:sudo minicom -D /dev/ttyS0
bash
Копировать кодThe output is empty, meaning nothing is occupying the port.Code:lsof /dev/ttyS0 - Testing with
: I also tried usingCode:mbpollto send Modbus messages:Code:mbpoll
bash
Копировать кодI get the following error:Code:mbpoll -a 1 -b 9600 -P none -d 8 -s 1 -t 3 /dev/ttyS0
objectivec
Копировать кодCode:Read input register failed: Connection timed out - What I’ve tried so far:
- Double-checked all wiring (Data+ and Data-).
- Tried changing the baud rate to 19200, but the result was the same.
- Tried different ports, including
(if using a USB-RS485 converter).Code:/dev/ttyUSB0
- Added my user to the
group:Code:dialout
bash
Копировать кодCode:sudo usermod -aG dialout $USER - Attempted to reload HAL with
and manually loadCode:halrun:Code:hy_vfd
bash
Копировать кодCode:halrun loadusr -W hy_vfd -d /dev/ttyS0 --rate 9600 --parity none --stopbits 1 --target 1 -g - Questions:
- What else can I do to debug the connection with the VFD?
- Could my RS485-RS232 converter be the problem? Could you recommend any converters that are known to work well with Linux?
- Are there any special settings for serial ports or Modbus in LinuxCNC that might be causing this issue?
- Thanks for your help! I’d appreciate any advice or recommendations.Additional Info:
- RS485-RS232 converter: Works perfectly in Windows Mach3.
- Linux: Debian 12 running LinuxCNC.
Please Log in to join the conversation.
- deltafox24
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
2 years 4 days ago #313325
by deltafox24
Replied by deltafox24 on topic Problem with Huanyang VFD communication via RS485 in LinuxCNC
Doesn't anyone know?
Please Log in to join the conversation.
- besriworld
- Offline
- Platinum Member
-
Less
More
- Posts: 327
- Thank you received: 0
2 years 4 days ago #313331
by besriworld
Replied by besriworld on topic Problem with Huanyang VFD communication via RS485 in LinuxCNC
I don't know much, but a few days ago I also worked with modbus and mb2hal. One really useful thing is to turn on debug mode and run linuxcc through the terminal. You will see error messages.
Please Log in to join the conversation.
2 years 4 days ago #313339
by MarkoPolo
Replied by MarkoPolo on topic Problem with Huanyang VFD communication via RS485 in LinuxCNC
is your RS485-RS232 converter a usb device?
First make sure that the system creates a device file in /dev/ and what its name is.
My Huanyang YL-620 works very well, but with a usb rs-485 converter
First make sure that the system creates a device file in /dev/ and what its name is.
My Huanyang YL-620 works very well, but with a usb rs-485 converter
Please Log in to join the conversation.
2 years 3 days ago #313374
by wusel0464
Replied by wusel0464 on topic Problem with Huanyang VFD communication via RS485 in LinuxCNC
Hello,
maybe this link is useful.
www.diycncdesign.com/linuxcnc-2.8-huanyang-vfd.html
Best regards, Frank
maybe this link is useful.
www.diycncdesign.com/linuxcnc-2.8-huanyang-vfd.html
Best regards, Frank
Please Log in to join the conversation.
Time to create page: 0.150 seconds
