raggot
raggot

Reputation: 1012

CANOpen network load higher than expected

I am working on a project with a master computer connected via a CANOpen network to 4 slaves.

At each time step, the computer receives a measurement message from each slave, and sends them a control message. In total, 4 messages are received and 4 messages are sent at each time sample.

The message sent is a PDO with 6 data bytes (8 bytes including COB-ID) The message received is a PDO with 8 data bytes (10 bytes including COB-ID)

My CAN network is configured at 1Mbit/s, and I run my program at 1000 Hz (1 ms sampling time). As the total load resulting from the messages described is 576 bits/cycle, the total load expected in the network is 576kbit/s, or 57%.

What I see, however, is that:

  1. The controlling computer measures a load of ~86% (with minima of 68% and peaks of 100%).
  2. A USB CAN bus analyser I connect to the network registers a traffic of messages (count-wise) that is around half of what I nominally expect (i.e., 4 sent, 4 received each cycle, for 50 seconds should result in 50k messages, while I only see 18-25k). Moreover, I receive 1-2 error messages per cycle from the slave devices that the network is overloaded. Before it is pointed out, even counting the size of these messages as part of traffic wouldn't get close to explain the anomaly in load.

What I'd like to know is whether my way of calculating the CANOpen network load is correct. For instance, are there any protocol-specific handshakes, CRCs, or any sort of extra bytes sent to make the network simply work? It's nothing I could see in the wiki page of CANOpen, but I do know there are such appendices to messages in the original CAN bus standard.

Upvotes: 0

Views: 440

Answers (1)

mspiller
mspiller

Reputation: 3839

In a CAN message, there is more than the data to be transmitted. There is also the arbitration ID (11- or 29bits, depending on whether you use CAN 2.0A or 2.0B), there is a 15 bit CRC, an 7 bit EOF marker, the control field and also some other reserved bits. Depending on the data, there may also be stuff bits.

Using CAN2.0B and assuming 48 bits (6 bytes) of data, you will get a message size of roughly 132 bits and roughly 151 bits for your 64 bits messages.

Summing this up, you will get roughly 1132 bits per cycle which is too much for a 1Mbit/s bus and 1000 Hz.

Hope that helps.

Upvotes: 1

Related Questions