Best multi star topology with up to 1000 masters?


#21

CAN will probably work fine, you can just drop the speed. It just wasn’t a good solution for my application, especially as we already have the RS485 and sw/fw in place. flexray is also a good option, but it is expensive, it was picked to replace CAN because of the limitations and issues with it.

it’ll be interesting to see the results of a 1000 node CAN daisychain.


#22

Yes this is quite a lot of nodes, the downside to CAN is that each node on the network is checking the other node communications and can invoke an “error frame” as a result (and depending on how you configure your controllers) this can cause problems on a bus with a high number of devices or a bus that is not ideally structured (like a star).

I’ve personally worked on networks that have about 30-40 nodes running at 250kbaud and it was quite robust (it was the main control network for an X-Ray system). In this case we had a star and probably 100 meters of cable but in the center was a hub that was capable of managing each individual stub and taking it off of the network if it became a problem. I do not think that this system would have been nearly as easy to implement/maintain if it was done with RS485.


#23

sure and the spec of CAN is 30 nodes, so sounds like you were in spec, so no reason it shouldn’t work. remember rs485 is just the electrical spec, CAN has the protocol too. if you’re inside the electrical limits, but outside the protocol limits you can change the protocol in rs485.

i like CAN, i use it often and have an automotive background, but i just have pause about the number of nodes, just as i did for my recent exploration about updating from RS485 on our 350-600 node current systems.


#24

I’m curious where the spec is 30 nodes?

Things that would limit the ceiling of CAN nodes are:

Available Node ID’s (I think this is 11bits … 2^11=2048)
Parasitic Capacitance of CAN transceivers (seems like this would be variable based on the transceivers that you use)
Propagation delay of ACKs (more a limit of capacitance/bus length)


#25

So much great info and thoughts. I have been searching and searching and did run in to this tutorial:
http://www.computer-solutions.co.uk/info/Embedded_tutorials/can_tutorial.htm It was som what revealing on the questions you pose. And if you read the data sheet https://www.nxp.com/docs/en/data-sheet/PCA82C251.pdf it staes 110 nodes. But as LukoBeno did point out this is dependent on a number of factors but one of the most important must be speed since each node add a capacitance to the system. I will take all your suggestions and go with CAN and use some repeaters for the star nodes. I will also buffer the star nodes so that the data can be resent if no ack was recived on one leg. Also this would give the option during debugging to identify troublesome stubs and just splitt them in to two nets with a repeater in between.

Once again thank you for all valuable input! :slight_smile:


#26

A suggestion would be to prototype with Teensy 3.1: https://github.com/teachop/FlexCAN_Library

I’m always a fan of finding Arduino compatible hardware and the right software libraries to learn.

If you can swing it, the following tool is also worth it: https://www.totalphase.com/products/komodo-cansolo/


#27

CAN uses a lossless bitwise arbitration method of contention resolution; if two nodes start transmitting at the same time, the address of one of the nodes will be corrupted and that node will cease transmission. This is possible because CAN transceivers only drive the line into one state (from recessive to dominant), similar to I2C.

RS485 transceivers drive the line high and low so if two nodes start transmitting at the same time, the data from both nodes may be corrupted as the line is driven to some mid-rail value. RS485 supports 32 Unit Loads on the bus. Many transceivers are rated at 1/8 UL, which allows 256 nodes on the bus (see Texas Instruments SLLA272B - The RS-485 Design Guide).

I have used RS485 in a multi-master system in my first job, with a PIC16F877. I used a simple CSMA/CD (Carrier Sense Multiple Access with Collision Detection) scheme, where the UART interface simultaneously writes to and reads from the RS485 bus allowing byte-wise collision detection (differential drive prevents non-destructive testing). If the data was corrupted the master would cease transmission and retry after a random time. It worked OK but I only had a few masters.


#28

LukeBeno, I agreee with you in the neat part of just smash it together in Ardruino. It’s so fast most of the time. And great tools are worth the cost. As a consultant time is money! :slight_smile:

James. So what you say is that RS485 can be as stable as CAN with the right lib. I still leaning to CAN since I can relay on years of industry standard used in an environment where faults can = deaths.


#29

ISO 11898 40m 1Mbs can is 30 nodes, sorry for not clarifying. CAN is the base protocol for a lot of specs.


#30

I’m saying that electrically CAN and RS485 are different and I don’t think you can run a CAN protocol over RS485. CAN only drives the signal to one state whereas RS485 drives to both states. That means CAN can do non-destructive collision detection whereas RS485 cannot.

I don’t think you could have 1000 RS485 nodes on a single bus due to loading.


#31

No worries, that makes sense based on those parameters. It does seem like the ceiling for CAN is somewhere around 120 nodes.

Automotive networks basically stub off the main CAN bus and then bridge to LIN for the really dumb devices (like switches and other indicators)


#32

Interesting. I still would like to have it all the same net so that debugging would only require one set of tools and replacement parts will kept to a minimum. It’s so interesting how I feel like I have learned a lot on this thread. :slight_smile:


#33

no worries. i spent 10 + years in automotive developing ecu’s, their firmware and software, i wish it was that simple but yep more or less


#34

yeah agreed, i have 500+ nodes with repeaters, and terminators on a daisy chain with 20Mbps transceivers which is why i said a few of them would do it.