Bandwidth tuning
There are several factors determining how much data is sent wirelessly, and the timing of it:
-
Overall bandwidth
CAN messages per second -
Latency
How long (on average) does it take for a CAN message from this bus to appear on the bus of the remote peer -
Jitter
The variation in time delay between transmission and reception of a CAN message.
Note
As an example, a message that always takes exactly 9ms to appear on the peer bus would have:
Latency 9ms
Jitter 0
whereas another system where the messages took between 7 and 13ms to appear on the remote bus would have:
Latency 7ms
Jitter 6ms
The standard configuration maximises overall performance, but in the case of a particular requirement, various adjustments can be made through the Object Dictionary.
Several objects will be explored, below, that can influence the metrics above.
BT SPP maximum buffer age ms¶
Note
0x3333:0x2A [BT SPP maximum buffer age ms]
- This parameter defines the maximum time in ms after which buffered CAN data will be send over the Bluetooth connection.
- Default
10ms
Essentially, this defines the maximum time that data can wait before being sent over Bluetooth to a connected peer.
This value can be reduced (down to 1), which would be particularly noticeable in terms of latency on a low-bandwidth bus.
This time is started when the first message enters the buffer - and when timed-out, initiates the transmission of the buffered data.
Reducing this value prioritizes many small messages quickly over fewer larger messages less frequently.
This may have negative effects on the bus behavior.
Wi-Fi maximum buffer age ms¶
Note
0x3333:0x2B [WiFi maximum buffer age ms]
- This parameter defines the maximum time in ms after which buffered CAN data will be send over the Wi-Fi connection.
- Default 10 ms
This functions identically as the Bluetooth version does, above - but for the Wi-Fi interface.
BLE maximum buffer age ms¶
Note
0x3333:0x2D [BLE maximum buffer age ms]
- This parameter defines the maximum time in ms after which buffered CAN data will be send over the BLE connection.
- Default
10ms
This functions identically as the Bluetooth and Wi-Fi versions do, above - but for the BLE interface.
Maximum Bluetooth Packet Size¶
Note
0x3333:0x2C [Maximum BT SPP Packet Size]
- This parameter reflects the maximum transmitted packet size for a device configured for a Bluetooth interface.
Higher values allows higher throughput. - Default
640(bytes) - Maximum
854(bytes)
This value works in concert with 0x3333:0x2A [BT SPP maximum buffer age ms] to define the
- duration between data packets sent, and
- amount of data sent per packet
These two values could be considered in conflict
- A large packet size optimises for larger packets less frequently (at the expense of latency)
- A lower buffer age optimises for frequency of transmission over anything else.
- A smaller packet size would reduce average latency (in high traffic situations)
- In extremely high bandwidth applications, a high buffer age may be required.
Because of these conflicts, these OD values cannot be both maximized.
Careful tuning for a particular requirement may be needed.
Note
The default value of 640 has been determined to provide compatibility with CLW3000 devices.
When deployed into an environment with CLW3000 devices - this value provides complete compatibility.
If there are no CLW3000 devices connecting to this CLW4000 device - then a higher value of this object (850, for example) will provide higher bandwidth.
CAN Filters¶
To improve the latency of important CAN messages, CAN filtering can be enabled in order to reduce the total volume of data sent, and potentially improve the latency of required messages.