MLDesign Technologies, Inc.

Mainnavigation

Subnavigation

BORDER

 
 
 

Pagecontent

A CAN Bus Model

A simple CAN (Control Area Network) bus system

The Model

The top-level CAN model is shown below. It consist of two major components?the CAN MAC module and the CAN Simulation Bus Controller module?plus five traffic sources. The global time in the model counts in seconds. Simulation time index 1.0 is equivalent to 1.0 second. The bus speed is set to 100kbit/s. Four different types of messages are transmitted by the nodes. A variable source produces messages with increasing frequency of occurrence. A constant packet stream emitted by Constant- Packet-Source is influenced by the the variable packet source that produces messaged with an higher priority. In the simulation it is shown that the transmitting time of the messages of the constant packet source is increasing while the frequency of occurrence of messages of the variable packet source increases. At the end there is no packet transmitter from the constant packet source, because the bus operates at full capacity. Node five evaluates the response time of the two sensors. Therefore it sends request messages to the sensors. When the bus operates at full capacity even the high prioritized messages are not transmitted, because the queue of node five is blocked by low prioritized messages.

Top-level CAN bus model
Top-level CAN bus model

CAN MAC Node Details

This module represents a node of the CAN bus. All incoming packages from port "PacketToSend" saved into a FIFO-queue. After transmitting, a package will put to the "ReceivedPacket" output port of every Node excluded the transmitter node. The time from entering the queue and transmitting successfully is calculated an put to "TransmitTime".

CAN MAC module
CAN MAC module

Bus Controller Module

The CAN Simulation Bus Controller module controls the operation of the bus. The controller module starts by determining the number of nodes. Once the number of nodes has been determined, the controller shifts to a loop pattern called bus cycle that is repeated until the simulation stops. One bus cycle consists of following iterations over the nodes. The first iteration determines the node, which is dominating the others. After calculating the length of the message the next iteration leads to the result, whether one node detected an error or not. Then all nodes are informed by another iteration about that result. The model generates several dynamics reports, such as those shown below. Other reports (dynamic and summary) are easily added.

CAN Simulation Bus Controller module
CAN Simulation Bus Controller module
Bus load (dynamic display)
Bus load (dynamic display)
Response time for high priority sensor
Response time for high priority sensor
Response time for low priority sensor 1
Response time for low priority sensor 1
Transmission time for the constant source
Transmission time for the constant source

 
Download PDF