LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-8502 loses connection intermittently

Solved!
Go to solution

Hi!

 

I am using XNET with a USB-8502 to communicate over CAN bus to a device we are currently testing. Unfourtunately we have been having some issues with the communication over the CAN bus being lost intermittently. The USB-8502 device stops blinking and the labview software stops recieving any frames, this only occurs for a few seconds before the unit starts communicating again. We have just switched both termination resistance of the device (split termination of 1.3 kOhm resistors and one 4.7 nF capacitor in the new design, 60 ohms resistors in the old design) and update to longer cables (CAN_L and CAN_H) which are unshielded, not twisted and run along high voltage cables which are powering a switching high current device. The issue has not been seen before and our hypothesis is that this an issue with EMI from the high voltage cables corrupting the data on the CAN bus. The issue could also be a problem with the device under test though it seems unlikely since the device has been tested separately with both other labview equipment and other equipment entirely.

 

Before jumping to any conclusions about improper noise rejection I would like to know if there are any issues with the code so I will append some screenshots from the code here, unfourtunately I can not post the entire code since there is some sensitive material in the code.

LuckyLuke96_2-1639086766722.png

If this seems okay do you believe the issues are related to interference created by the high voltage/high current cables close to the CAN wires?

 

 

 

 

 

0 Kudos
Message 1 of 9
(4,496 Views)

Another thing to check is that Windows is not trying to control the power for the USB bus for power saving.

The observed problems do not look like EMI would be the main suspect but  certainly sounds like something to prevent anyhow. Depending of the type and magnitude of the voltage and current that is switched on and off in those cables, it could certainly cause enough distortion to cause data errors and in the long run damaged circuitry on the CAN inputs due to transients that could exceed the protection on them. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 9
(4,445 Views)

Hello!

 

The reason we suspected noise from the nearby cables is that we could not recreate the issue when the high voltage/high current devices were turned off, and we could also worsen the issue by moving the CAN cables closer to the high voltage power cables.

 

After shortening, twisting and rerouting the CAN-cables away from all the noise creating high power electronics, the issue seems to have disappeared. This seems to indicate that the issue was either by caused noise from the the other cables or the reduced impedance of the shorter cables?

 

Could this also be an issue that arises from using different terminations on opposites ends of the CAN-bus? The NI-device has a termination resistance of 120 Ohm if I am not mistaken an ours use split termination with 2.6 kOhm and a capacitor for filtering.

0 Kudos
Message 3 of 9
(4,425 Views)

Well it is always a good idea to have a good EMI proof design. And twisted pair, shielded communication links is certainly a good thing to do even if you are not operating near high Ampere kV switched power lines. However the shielding can make things worse if not properly connected. You should never use the shield as an alternate, parallel ground line. That really can mess up things good. Neither can you just blindly connect ground on both sides, if the devices are already grounded through something else like the metal construction they are mounted on.

 

The different termination can be a problem but that is not so easy to say. The relevant impedance is the important part and while your resistor has a pretty well defined impedance independent of the frequency but your capacitor-resistance combo might have a similar impedance at a certain frequency but a very different one at others. I would tend to say that it is probably a good idea to keep the terminations on both sides very similar, but don't know what is the reason for that RC combo. It's also not quite clear what you mean with split termination but I assume you mean that the R and C are in parallel to each other between the + and - data line. For high enough frequencies the impedance would then approach 120 Ohm too, and even higher frequencies would be damped even more. Low frequency signals could however be almost fully reflected on that end as 2.6 kOhm is quite a high impedance.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 9
(4,417 Views)

We have completely skipped connecting the shielding on one side, the device we are testing has the shielding connected via a resistor and capacitor to the low voltage gnd. Unfourtunately the connectors we have recieved are connected with single wires for each pin, even the shielding pin, because of this we have not connected the shielding to anything on the test rig side.

 

Regarding the termination, this is how it is setup with Rterm = 2.6kOhm and Csplit = 4.7 nF. I have been told this is to allow for daisy chaining of the CAN-bus lines.

LuckyLuke96_0-1639386483528.jpeg

 

It seems like the NI-device can only do a 120 ohm termination resistance. I could build a termination resistance circuit like the one in the device we are testing on the testing rig. Do you believe this would help?

 

 

 

0 Kudos
Message 5 of 9
(4,414 Views)

Well I'm not sure what sort of cable you are using but most cables that are twisted pair have an impedance of around 90 to 130 Ohm. So terminating your other end with 2.6 kOhm like that is quite an impedance mismatch. It almost seems like your CAN device might not be fully CAN compliant and not being able to drive into a 60 Ohm load, so they chose to use a higher impedance termination network to not overload the output driver.

 

While an overloaded output driver is of course even worse than having some reflection, it is still very far from an ideal situation. That driver may even have problems to drive the 120 Ohm impedance on the NI interface side.

 

I'm not sure what you mean with daisy chaining. Possibly it refers to having each device with a build in termination network like this and connecting multiple of them together without having to remove the termination from all of them except the last one in the line. I would consider that at best as puttering for a quick and dirty test setup in an environment that is not to noisy. For an environment where you have high dynamic currents in cables or other electromagnetic disturbances nearby this is definitely not proper operation. The cable is a complex network of impedances that need to be properly terminated at both ends with a matching resistor or you get signal reflections no matter what. While Ethernet tries to do equalization at each network connection point to deal with reflections, this is not used for CAN and other RS-485 like differential line transmissions. Instead the transmission line is supposed to be properly terminated on both ends with a resistor matching the cable impedance, not some partial termination at each attachment point.

 

The split termination is not about "daisy chaining" devices but for the suppression of common mode noise. It basically helps balance the voltage level on the differential line around the ground level. And it is important to match the two resistors well, any difference in their value will actually translate some of the common mode noise into differential noise and compromise the receivers noise immunity. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 9
(4,401 Views)

The wires are not twisted pair with a known impedance since they have been ordered completely wrong. When the next build comes around I will make sure we order the appropriate wires!

 

This is essentially what our costumers have in mind if I am understanding them correctly, except with daisy chaining through each device instead of having stub nodes.

LuckyLuke96_0-1639391239979.png

In our testing rig we have this setup currently. This I now realize is incorrect since the previous design of the device had two 60 ohms resistances and therefore acted like the end termination.

LuckyLuke96_3-1639392149762.png

 

Do you believe terminating the end of the line like this would solve the issue?

LuckyLuke96_2-1639392086278.png

 

 

0 Kudos
Message 7 of 9
(4,393 Views)
Solution
Accepted by topic author LuckyLuke96

@LuckyLuke96 wrote:

 

LuckyLuke96_2-1639392086278.png


Yes that is definitely desirable above an unterminated cable end. You do have to watch out about the load on the bus though. With this setup, if you have many devices with the built in termination, you do get a higher and higher bus load with each additional device and that may exceed the driver capabilities of some of the transmitters on the bus.

 

The 2.6 kOhm termination load isn't that high in itself but many 2.6 kOhm impedances in parallel can still add up to a really significant load. 6 devices result in an additional load of 433 Ohm which starts to get significant enough that some drivers might have trouble to supply enough current to still guarantee proper signal slopes within the used CAN bus baudrate.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 9
(4,390 Views)

I will try terminating the other end of the CAN-bus as well, before our device acted as the termination resistance on the other end but this of course does not work now since the physical layer is changed. 

 

In our testing setup we will only use one device on the bus and therefore should be quite safe, but I will forward the concern to our electronic design department. Hopefully they have already accounted for this!

 

Thanks a lot for the help! Quick and professional! 

0 Kudos
Message 9 of 9
(4,380 Views)