EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: matkar on August 31, 2013, 03:21:17 pm
-
Hi,
I'm developing a CAN bus device. I'm trying to make some improvements to ease the use of the device. I'd like to implement a mechanism that will automatically invert CANH and CANL lines if a wrong connection to the network is detected.
There are two issues to resolve:
- Detecting connection polarity
- Reversing connection
As concerns detection I haven't put a lot of thought in it. Currently I'm more concerned with reversing. My ideas are:
- Using a DPDT relay. Bad sides are inductive spikes, turn on current spike and drawing power from limited power supply. I'd use this method as a last resort.
- Solid state switching solution with some analog switches. I'm not sure if this would work since analog switches have some internal resistance which will probably cause trouble on CAN.
- Using two reversely connected CAN transceivers and switching between the two of them.
My questions are:
A: Do you think it's worth bothering with this functionality?
B: Has anybody of you ever seen or made similar solution?
C: Can you suggest a better solution? Anything goes...
Regards,
Matjaž
-
I have used DPDT relay for this exact problem in one high volume industrial product (which went trough rigorous testings) and it works like a charm.
Solid state solution is not simple as the common mode range of CAN is if I remember correctly -7V do 7V. You have to cover the whole range and impose minimal resistance to the bus..I suspect this is very difficult.
-
Do you remember which brand/type of relay did you use? Am a bit concerned about added capacitance. What was the product's CAN bitrate?
Good point regarding solid state solution.
I will assemble and test double transceiver metod and report back the results.
-
Dont forget, that the CAN transceivers have lot of built in ruggedness. ESD, overvoltage, short circuit protection. If you put a solid state before it, it has to handle that.
Using two can controllers will divide the number of devices by two. There is twice the load on the lines.
If reverse connection could be a serious issue, I would rather put two LED, resistor, and a microswitch before the receivers. During installation, there is communication, you press the button, either of the LEDs will blink. Make good connection green, bad connection red. The installer will see if the cable is wrong or not.
-
If you use a good signal relay with latvhing coils it should work fine.
-
Do you remember which brand/type of relay did you use? Am a bit concerned about added capacitance. What was the product's CAN bitrate?
Good point regarding solid state solution.
I will assemble and test double transceiver metod and report back the results.
I don't, the cheapest one from Digikey probably. Don't worry about the capacitance, it's not an issue here.
You can easily determine if the connection is reversed by looking at CAN controller's error counters (Tx and/or Rx).
-
My questions are:
A: Do you think it's worth bothering with this functionality?
B: Has anybody of you ever seen or made similar solution?
C: Can you suggest a better solution? Anything goes...
A: No, you should not encourage users to wire things wrong. Protection against accidental reverse polarity or misconnection YES, but not trying to make it work if it is wired wrong.
B: No.
C: Perhaps a warning LED or notice in software to suggest they have wired the CANL/H round the wrong way.