|
Can the CAN bus be overloaded with too many transactions ?
Greetings,
We are using 5 Jaguars (black) with a 2CAN for motor control and for acquiring detailed data (motor current, bus voltage, encoders, temp, etc.) using 3 different threads with an aggregate rate of just over 1000 transactions/sec. While this generally works rather well, we are seeing an occasional CAN timeout message making it to the console screen. We have had some debate as to whether it is possible to overwhelm the CAN bus with too much traffic and that that we need to significantly reduce our polling frequency to avoid this occasional CANJaguar timeout.
I would like to solicit any opinion folks have regarding the use of the CAN bus with the 2CAN and whether it really is possible to have too much CAN traffic which can result in CAN timeouts.
It does seem like the Jaguars themselves and their ability to respond to each request with the Ethernet/CAN bus should be the limiting factor and it should not be possible to cause bus actual difficulty with lots of traffic. A series of transactions to each individual Jaguar can happen in rapid succession (sequential in code) and would represent a rather high (but brief) traffic burst.
I just spent some time looking at the WPILib CANJaguar implementation and was rather surprised to see the semaphore implementation is at the individual Jaguar level and not shared at the higher bus level. I tried to go down a level further to see how this might be handled at the lower levels but could not find the source for FRC_NetworkCommunication_JaguarCANDriver_receiveMe ssage.
I am curious as to whether any of the lower level implementations (perhaps in the 2CAN itself) attempts to ensure only one JANJaguar transaction is out on the CAN bus at a time ?
I am wondering whether our multiple thread implementation attempting to use the CANJaguar implementation with a per CANJaguar individual semaphores might be exposing system vulnerability when our threads just happen to occasionally to attempt to simultaneously transact and simultaneously request info from different Jags ?
I’m going to try to protect the these calls with a single shared semaphore (vs. one per Jaguar)and see if that resolves this occasional glitch.
Any thoughts or opinions on this would be greatly appreciated.
Thanks,
John
|