7
\$\begingroup\$

I am running a short (2 m) CAN bus with about 20 nodes. 1 Mbit/s speed, PIC 18F2580s and 18F4580s with MCP2551 transceivers, 10 MHz (with PLL to 40 MHz) crystal oscillators. Both ends are terminated at 120 ohms. Sample point is at 70%.

Nodes are in three groups, each powered from a separate isolated power supply, but the grounds are all commoned along the bus.

I get quite a number of message errors, framing, bit stuffing. Looking at CANH and CANL on an oscilloscope, everything looks beautiful. No ringing, no reflections, and the timing correct. Measuring the oscillators with an accurate frequency measurer shows only a tiny variation.

So far, the only way I have been able to reduce the number of message errors is to beef up the ground wire along the bus until I get the GND difference below about 150 mV. The further above that I go, the more errors I get.

Why? According to the MCP2551 datasheet, they should be able to cope with GND differences up to 7 V!

Am I misunderstanding something?

\$\endgroup\$
4
  • 2
    \$\begingroup\$ With your scope on, do you get errors still? Effectively this will ground CAN 0v through your scope earth clip \$\endgroup\$ Jan 25 '11 at 12:43
  • \$\begingroup\$ Plugging the 'scope into the ground can help. But the correlation still holds. If I it reduces the GND voltage difference, then the error rate decreases. \$\endgroup\$ Jan 25 '11 at 14:08
  • 1
    \$\begingroup\$ You say you have isolated supplies. You also say you get large ground differences between nodes, unless you use a large, heavy ground wire. These are mutually exclusive statements. If each node is isolated, no current can flow on the ground. You have a bad supply(s), or the supplies you are using have enormous common-mode noise output. \$\endgroup\$ Jun 16 '12 at 6:58
  • 1
    \$\begingroup\$ Are you using off-the-shelf brick DC-DCs? Some of those can be horrible. Put common-mode chokes on the power connections to every node, and see if that helps. \$\endgroup\$ Jun 16 '12 at 6:59
3
\$\begingroup\$

Are you sure the message errors are a result of the CAN bus and not a result of the performance of the rest of the node(the PIC circuits)?

CAN is differential, as long as you don't exceed the common mode voltage limits of the transceiver the relative ground levels shouldn't matter and there is no need to send a ground connection with the CAN signals (maybe a shield but thats a different story).

However with isolated power supplies yet the ground connection being there you well could have some ground current loops that are causing problems with the rest of the circuit.

\$\endgroup\$
8
  • \$\begingroup\$ The error rate seems to be a direct function of the GND voltage difference. I can make the error rate increase or decrease right before my eyes, simply by decreasing or increasing the amount of copper connecting the grounds. \$\endgroup\$ Jan 24 '11 at 23:16
  • \$\begingroup\$ yep thats not surprising, if there is current flowing through the ground loops, which it sounds like there definitely is, decreasing the resistance reduces the voltage drop on the ground...have you tried just removing this ground between all the nodes and just leaving the CAN H/L ? As mentioned, its not needed for CAN and it doesn't sound like its part of the power supply so its really not doing anything but creating a current loop that is causing problems. \$\endgroup\$
    – Mark
    Jan 24 '11 at 23:40
  • \$\begingroup\$ lets put it another way, If you've connected the grounds of all the nodes and are using 6 feet of 18 guage copper to do so. If you measure 150mV between the two end nodes there could well be 3.32 AMPS of current flowing between those nodes on the ground wire. That is a major problem and can cause all sorts of issues with the entire circuit. \$\endgroup\$
    – Mark
    Jan 24 '11 at 23:57
  • \$\begingroup\$ Mark, if I remove the GND connection between nodes, then the difference goes up, and so does the error rate. The problem is that each group of nodes is powered from its own isolated power supply, so there is nothing much preventing the GND difference going beyond the spec 7v maximum. \$\endgroup\$ Jan 25 '11 at 8:28
  • 2
    \$\begingroup\$ @rocketmagnet Where are you getting 7V? The datasheet for that transceiver lists +- 42V for common mode DC voltage limit on CANH/CANL. As long as your using similar isolated supplies and they are plugged into even remotely the same power system you shouldn't see much different in the board ground potential, maybe a couple volts. Board ground level differences have no effect on differential signaling, thats one big reason to use differential signaling. If you remove all connections between nodes except the CANH/CANL and still have problems there is another issue in the design. \$\endgroup\$
    – Mark
    Jan 25 '11 at 8:47
2
\$\begingroup\$

Maybe we need to change your circuits a little bit. What I've seen done on RS-232 and RS-422 might work for CAN:

Opto-isolate the CAN transceivers from the boards. Power them from fully isolated DC-DC converters. Then the transceiver circuits will float and hopefully be nearer each other.

I've also seen this done on an application note to (not really) "opto-isolate" a USB interface by putting it "outboard".

I'll watch in interest as my robot servo cards all talk CAN and we get pretty big currents in the chassis, but I haven't tried to use the CAN interface in anger (we've been using them in RS-232 with an old proprietary protocol).

\$\endgroup\$
1
\$\begingroup\$

From what I understand, the maximum CAN bus 1 Mbit/s data rate can be a challenge even with a short bus. Have you tried lowering the data rate to 500 kbit/s to see how it affects your error count?

\$\endgroup\$
1
  • \$\begingroup\$ Sadly this is not an option. We need all the bandwidth we can get. \$\endgroup\$ Mar 20 '11 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.