4
\$\begingroup\$

In order to save cost on the system in one of my current projects (no cables) I would like to eliminate the CAN cable and add traces to the PCB (one pair from left to right to connect the connectors + 1 pair stub to the CAN Transceiver on each board). As I have anyway a continues chain of PCBs connected by a connector with free Pins this seems fairly reasonable to do. I'm planning to implement CAN with a fairly low speed (125kbits/sec).

Each PCB looks roughly like this:
enter image description here

The system is set up likes this and is about 50m long! enter image description here

I've read a couple of other questions (e.g. here, here and here) and articles and application notes (such as this, this and this). But am nowhere near to fully understand it.

I have a couple of questions for this:

First one is regarding the transmission line impedance.

  • The 120Ohm standard are differential impedance of or singled ended for each CAN_H and CAN_L?
  • how to reach 120Ohm impedance on a 4 layer board? (I use JLCPCB standard 4 layer stack-up, and with their calculator I don't reach 120Ohm for single ended and for differential I only get close with 3.5mil trace + 4mil spacing - which is close to their absolute minimum).Layer Stack-up
  • Can I / should I add extra components to the bus traces, to reach the 120Ohm?

Regarding shielding:

  • Despite the impedance topic, in the CAN specification a shielded twisted pair cable is recommended. Shall I in that case better route the CAN lines on one of the inner layers and shield it by a GND plane above, beside and below?

Regarding twisted pair:

  • Would it make sense to model the traces on the PCB similar to a twisted pair (e.g. something like this enter image description here

Overall the questions can be summarized to:

Which trace width, spacing on which layer give me the best result for long CAN traces on a 4 Layer PCB and how do I shield it?

\$\endgroup\$
3
  • \$\begingroup\$ Can you cut away the ground and run the CAN bus over clear PCB? Then 120 Ohms is easy. Even just cut away inner_layer_2 and have a whole 1 mm of board between top_layer and its groundplane? A few tracks crossing the bus won't matter, unless they're a high speed signal. \$\endgroup\$
    – tomnexus
    Commented Aug 18, 2020 at 18:44
  • 1
    \$\begingroup\$ Also, 125 kHz has a wavelength of 2400 m, so with a 50 m bus length, I'm not sure the impedance will matter very much. But wait for the CAN experts... \$\endgroup\$
    – tomnexus
    Commented Aug 18, 2020 at 18:46
  • \$\begingroup\$ I could route on layer 1 and have layer 2 below empty. Layer 15 and 16 however must have a power plane and traces (layer numbers are flexible, but at least 2 layers are used) \$\endgroup\$ Commented Aug 18, 2020 at 23:23

2 Answers 2

3
\$\begingroup\$

I have not designed with CAN bus specifically, but I have implemented USB differential pairs and WiFi (2.4 Ghz) single ended transmission lines.

Your problem looks like a classic differential transmission line. 125kbits/sec should be fairly forgiving. 1Mb/sec is tougher.

If you have the luxury of a 4-layer board, definitely route the CAN signals on inner layers. This will give you the equivalent of a shielded cable. The outside layers should be ground or power planes. Ground and power planes should be capacitively coupled to each other, making them roughly equivalent for shielding purposes.

Your idea of crisscrossing traces to create a "twisted" pair is intriguing, but I suspect it will cause you more headaches: 1) signal reflections at each via 2) every buried via is a potential defect point for board manufacturing. #2 depends on the quality of your board house. I would implement a traditional differential pair (Zo=120ohms).

For calculating transmission line spacing, I have found Saturn PCB's toolkit to be quite helpful: http://saturnpcb.com/pcb_toolkit/ I will note that to reach your 120 characteristic impedance, you will likely need wider traces.

According to this TI document a mismatch in cable lengths can cause reflection issues with CAN bus. https://www.ti.com/lit/an/slla279a/slla279a.pdf.

Remember to provide for 120ohm termination resistors (across the can bus lines) at the transmitting end and the last receiver on the bus.

Connector: should be fine as long as the contacts are clean. Separate the can bus pins from other high speed pins with a ground pin in between. Personally, I would also include solder pads or a CAN connector in case you need to fall back to wire between the circuit boards. If so, then I would put 0 ohm resistors in series with the CAN lines on the main connector. This will give you the flexibility to disable the CAN lines on the connector and switch back to wire. Designing a plan B is cheap while laying out the circuit board.

Trace width and spacing depend on your PCB stackup. Use Saturn PCB's toolkit with the "Differential Pairs" tab.

I would use a stackup like

L1=Ground, L2=signal/transmission lines, L3=Power, L4=signal or

L1=Ground, L2=signal/transmission lines, L3=signal, L4=Power.

If you have copper fill on other layers, you can tie them to ground with stitching vias. Don't route high speed signals in parallel with the diffential pair unless they are separated by a ground fill (shielding). If high speed signals must cross on adjacent layers, make them perpendicular.

Saturn PCB v7.10

\$\endgroup\$
2
  • 1
    \$\begingroup\$ To add to this, I've found that on cheap PCB stackups where microstrip impedance is unreliable, coplanar waveguide is an excellent alternative that cares far less about the dielectric constant of the substrate. It does tend to take up a bit more room, especially if you picket-fence it with vias, but it works pretty well. \$\endgroup\$ Commented Aug 27, 2020 at 15:23
  • \$\begingroup\$ The stackups you suggested are common but bad advice. There should always be - with no exception - ground layer next to each signal or power trace. 4 layer boards are tricky but a decent stackup is: signal/pwr - gnd - gnd - signal/pwr. Differential pairs must be treated as two single ended traces with gnd right next to them. \$\endgroup\$ Commented Aug 28, 2021 at 20:20
1
\$\begingroup\$

To layout differential lines you should NOT design them like twisted pair wires... Vias act like inductors and any change of direction normally causes reflections. So what you want and what is the optimum, is a simple straight line.

Normally you layout differential lines side by side (if you don't it's loose coupling... which also works in some cases), NO 90° turns, you need to keep both traces at the same length (almost) and stubs short (in case of can we talk of some cm - think you can find the values in the standard). The distance between the lines and the width of the traces needs to be calculated, so with your pcb material and layer thickness you maintain the required 120Ohm impedance...

You might try https://sourceforge.net/projects/atlc/ or http://www.hdtvprimer.com/KQ6QV/atlc2.html to calculate differential transmission lines.

Kicad is also shipped with a Transmission Line Calculator, or good old http://www.hp.woodshot.com/ HP AppCad... You even find stuff for the normal programmable calculators.

If you follow rules for much more sophisticated systems like LVDS, CAN should never let you down - it's pretty robust even in very harsh environments.

https://www.ti.com/lit/an/snla302/snla302.pdf

Haven't checked it but as far as I remember these numbers are OK For a certain Busspeed you have the length of the Busline and the length of one stub... guess on a PCB you never run into troubles with CAN

  • 1 MBit/s 40m 0.3m
  • 500 kBit/s 100m 0.8m
  • 250 kBit/s 200m 1.5m
  • 100 kBit/s 500m 3.0m
  • 57 kBit/s 1000m 5.0m
  • 38 kBit/s 2000m 7.0m

PS: As Mr_Engineer stated: You need to terminate. But both ends (its a real bus so any node listens and transmits)! both with 120 Ohm (its 60Ohm at dc, but 120Ohms for the middle/dominating Frequency of the Bus...) - we have a product with only one side terminated and it works for more than 20m line length, but then you need to tweak the values. Stay with the standard!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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