USB RS 485 disconnects when spindle stops
- mBender
- Offline
- Premium Member
- Posts: 113
- Thank you received: 11
not quite sure if this is the right sub forum, but I couldn't find a better place. I have some weird trouble with a USB RS 485 adapter and disconnections when the spindle stops. I am working with my two examples github.com/xsnoopy/LinuxCNC-Yalang-yl620...s485-Modbus---VFDmod and github.com/xsnoopy/LinuxCNC-Yalang-yl620...Modbus-ClassicLadder
The disconnection happens in both cases VFD Mod or Classic Ladder. Sometimes when the spindle stopps, the USB adapter get thrown out and reconnects to ttyUSB0 or ttyUSB1 ( it jumps from USB0 to USB1 and back). I created a udev rule which always creates a symlink from ttyUSB0 and ttyUSB1 to ttyRS485 when the usb to serial adapter is plugged in. Using ttyRS485 in LinuxCNC.
Anyway, everytime I get a disconnect I have to restart LinuxCNC, rehome,...
Anyone an idea how to fix it?
Syslog gives me the following error:
This is the output before and after:Dec 9 10:21:01 LinuxCNC kernel: [ 5415.333356] usb usb3-port2: disabled by hub (EMI?), re-enabling...
Dec 9 10:20:18 LinuxCNC kernel: [ 5371.900647] usb 3-2: USB disconnect, device number 33
Dec 9 10:20:18 LinuxCNC kernel: [ 5371.901069] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
Dec 9 10:20:18 LinuxCNC kernel: [ 5371.901121] ftdi_sio 3-2:1.0: device disconnected
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.748280] usb 3-2: new full-speed USB device number 34 using ohci-pci
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.983390] usb 3-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.983405] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.983414] usb 3-2: Product: FT232R USB UART
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.983421] usb 3-2: Manufacturer: FTDI
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.983427] usb 3-2: SerialNumber: B000P5Q2
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.996442] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
Dec 9 10:20:21 LinuxCNC kernel: [ 5374.996521] usb 3-2: Detected FT232RL
Dec 9 10:20:21 LinuxCNC kernel: [ 5375.007224] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB0
Dec 9 10:20:23 LinuxCNC ModemManager[418]: <info> Couldn't check support for device '/sys/devices/pci0000:00/0000:00:12.0/usb3/3-2': not supported by any plugin
Dec 9 10:21:01 LinuxCNC kernel: [ 5415.333356] usb usb3-port2: disabled by hub (EMI?), re-enabling...
Dec 9 10:21:01 LinuxCNC kernel: [ 5415.333364] usb 3-2: USB disconnect, device number 34
Dec 9 10:21:01 LinuxCNC kernel: [ 5415.334438] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
Dec 9 10:21:01 LinuxCNC kernel: [ 5415.334455] ftdi_sio 3-2:1.0: device disconnected
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.632251] usb 3-2: new full-speed USB device number 35 using ohci-pci
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.871361] usb 3-2: New USB device found, idVendor=0403, idProduct=6001, bcdDevice= 6.00
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.871376] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.871385] usb 3-2: Product: FT232R USB UART
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.871392] usb 3-2: Manufacturer: FTDI
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.871398] usb 3-2: SerialNumber: B000P5Q2
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.877445] ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.877541] usb 3-2: Detected FT232RL
Dec 9 10:21:02 LinuxCNC kernel: [ 5415.881359] usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB1
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
- Posts: 17938
- Thank you received: 4811
I would try:
1. Make sure RS-485 wiring is not in physically near power wiring
(especially motor wiring)
2. Line filter on VFD input
3. Common mode choke on RS-485 wiring
4. Common mode choke on motor wiring (near VFD)
Please Log in or Create an account to join the conversation.
- mBender
- Offline
- Premium Member
- Posts: 113
- Thank you received: 11
2. Line filter on VFD input is installed. Did not made a difference.
3. and 4. Just googled common mode chocke. Which one do I need to buy?
I have shielded motor cable, shield connected only at the VFD.
Shielded RS485 cable, shield only connected at the USB Adapter. Ferrit Cores in the data line of the RS 485 signal wires.
LinuxCNC pc, breakout board powered by 5v power adapter OR 5v from the PC. No difference.
I the stepper driver, VFD and LinuxCNC PC all at the same outlet. IS it worth putting the VFD to a different outlet?
Please Log in or Create an account to join the conversation.
- mBender
- Offline
- Premium Member
- Posts: 113
- Thank you received: 11
Also tried putting the PC on a separate power line, did not help either.
Please Log in or Create an account to join the conversation.
- zz912
- Offline
- Platinum Member
- Posts: 509
- Thank you received: 81
CZK19.63 23%OFF | USB to RS485 485 Converter Adapter Support Win7 XP Vista Linux Mac OS WinCE5.0https://a.aliexpress.com/_mNLBw0Y
You can try it. I have to make GND. But it works me in several aplication.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
- Posts: 238
- Thank you received: 37
Please Log in or Create an account to join the conversation.
- mBender
- Offline
- Premium Member
- Posts: 113
- Thank you received: 11
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19460
- Thank you received: 6529
First thing i would check is grounding/shielding everywhere.
Please Log in or Create an account to join the conversation.
- mBender
- Offline
- Premium Member
- Posts: 113
- Thank you received: 11
Rumors told me I will receive an Oscilloscope not to far in the future. That will hopefully help.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19460
- Thank you received: 6529
-
For slow stuff, buy Anker, BaseUS, Ugreen, charging cables, high quality and always sold as USB2.0 so you know what you are getting. And properly shielded!
Got over 40 of these lately, checked the internal resistance, from 0.1 Ohm for 1.5 meter long to 0.22 Ohm for 3 meter long ones.
Still, you will have to add some ferrite "doughnuts" to motor wires at the VFD output, if they are not already there.
Please Log in or Create an account to join the conversation.