Long, Low speed CAN bus
"Chuck Hackett" <[email protected]> Fri, 1 Nov 2019 18:08:08 -0400
| Newsgroups | gmane.comp.hardware.bus.can |
|---|---|
| Message-ID | <[email protected]> |
(sorry, the process broke the urls to the images, I have substituted 'tinyurl's) I have an application that uses CAN bus over substantial distances > 2,000 feet, outdoors with CAT-5 buried in conduit. (See: http://www.minirailsolutions.com/) Environment: Very low speed. ~ 12,500 bps. Controller: MCP2515 Driver: MCP2551 Clock source 14.7456 MHz crystal divided by 2 my ATMega1284 processor * Lightning/Surge protection using GDT, TBU, TVS *** Current MCP2515 bus timing parameters: BRP 24 SJW 2 ** Samples 1 PSEG 8 PSEG1 4 PSEG2 3 My understanding is that the above values result in a sample point of 80% * New board design uses separate 7.3728 MHz crystal for the CAN drivers (new board has two controller/driver sets). ** Never have understood this value well enough to intelligently pick a value. *** The TBU adds about 11 ohms of resistance to each of CH & CL. This is in series with the driver at each location, not in series with the cable from site-to-site. My Issue ... The bus is very long. I have measured the round-trip cable resistance at about 85 ohms per 1,000 feet. In one bench test using a 564' length of CAT-5 to simulate field cable, four trips through the cable resulted in a length of 2,256 feet and a round-trip resistance of about 191 ohms. Using 120 ohm terminators the signal level (using a scope) was below 1.2v (differential) so the driver did not decode the signal. I removed the terminators and it was obvious on the scope that that was bad because there was no resistance to discharge the cable capacitance (large RC discharge time). I then tried 1k terminators and all worked fine. For the final test I had 7 controllers at one end and two at the other generating a total of about 15 messages per second. I could see that there was some RC discharge curve effects but, I assume, because I am using very low speed and sampling at 80% this was ok. Above 2k total (two 4k resistors) RC effects started cause errors (recessive did not drop low enough, fast enough). Showing voltage levels from near (higher) and far (lower) ends of the cable (20ms/div, all traces 1v/div): https://tinyurl.com/yywjxkyc Showing the RC effects (500 us/div): https://tinyurl.com/y38gz52y My Conclusion ... In my usage (low bps), cable mismatch, reflections, etc. caused by wrong terminators, stubs, etc. are not as important to getting maximum distance at is the signal amplitude. Questions ... Am I right in my conclusion (proper cable termination not important to me, for maximum distance use larger 'terminators')? There is still a distance limit due to timing as a result of the travel time of the ACK bits from the far end of the cable. There is also a limit on how large the 'terminators' can be because the RC discharge time will become significant at some point. Do my bus timing values look reasonable? (sometimes seems like a 'black art') Can someone give me more insight into what value I should use for SJW? My understanding is that this addresses clock jitter but I doubt that's an issue with my low bps rate. Regards, Chuck Hackett Tampa, Florida, USA -- Archives and useful links: http://groups.yahoo.com/group/CANbus Subscribe and unsubscribe at www.vector.com/canlist/ Report any problems to <[email protected]>