Real-time performance analysis of CAN bus control network
2026-04-06 06:48:22··#1
Introducing communication networks into control systems connects intelligent field devices and automation systems, enabling distributed and networked control of field devices while strengthening the connection between field control and upper-level management. However, due to the numerous information sources within the network, information transmission requires time-sharing of network communication lines. Given the limited network capacity and bandwidth, collisions and retransmissions inevitably occur, resulting in unavoidable delays during transmission. Currently, international researchers in the CAN bus field have proposed several high-level protocols, but none of these protocols simultaneously support network flexibility and real-time performance. This paper takes the CAN bus as the research object and proposes two improvement schemes for the design of network closed-loop control systems. I. CAN Closed-Loop Network Control System As control systems become increasingly complex, for an independent closed-loop control system, the controlled object and controller are generally distributed in different parts of the network. A typical CAN bus closed-loop network control system is shown in Figure 1. Figure 1. Typical Closed-Loop Networked Control System (NCS) Compared to traditional closed-loop control systems, designing a closed-loop networked control system (NCS) requires considering a new constraint: the bandwidth limitation of the communication network. Four factors affect network bandwidth performance: sampling rate (at which each device sends information to the network); the number of components requiring synchronous operation; the length of the data or message; and the protocol for control information transmission. For NCS, two main indicators are generally required: latency constraints and transmission guarantees, meaning information must be successfully transmitted within a specified time. Failed transmissions or significant delays from sensors to actuators will affect system performance or make it unstable. Below, based on the analysis of the time-domain characteristics of the CAN bus control network, we will propose some methods to reduce network latency and improve network bandwidth utilization. II. Time-Domain Analysis of CAN Network The CAN protocol is optimized for short messages and uses a message priority arbitration method for media access. Messages with higher priority always gain access to the media during arbitration, so the transmission delay of higher-priority messages can always be guaranteed. Compared to other networks, the main disadvantage of CAN is its lower data rate. Because the CAN network is a bit-synchronous bus, its maximum speed is 1 Mbps, which also limits the maximum network length. Here, we will use the method of studying time-domain parameters to describe the delay of the CAN control network. For the NCS in Figure 1, the total delay of the control system is TdeIay, which includes the delay time from when the sampled signal is sent from the sensor to when the control output signal reaches the actuator. Specifically, it can be divided into the delay of the sampled signal in the transmit buffer TsampdeIay1, the transmission delay of the sampled signal Tseddelay1, the delay of the sampled signal in the controller receive buffer TsampdeIay2, the controller's calculation delay Tmcu, the waiting time of the control output signal in the controller transmit buffer TcondeIay1, the transmission delay of the control signal TseddeIay2, and the waiting delay of the control signal in the actuator's receive queue TCOndelay2. The total time delay can be clearly expressed by the following equation: Tdelay=TsampdeIayl+TseddeIayl+TsanpdeIay2+Tmcu+TconOn·deIayl+TseddeIay2+TcondeIay2 (1) =(TsampdeIayl+Tsampdelay2+TcondeIayl+Tcondelay2)+(TseddeIayl+Tseddelay2)+Tmcu (2) With the application of high-speed devices such as DSP, Tmcu can be ignored relative to other variables, so the above equation can be ≈Twalt+Tsend(3). Here, Twalt is regarded as the queuing time, and Tsend is regarded as the transmission time. The queuing time Tsend will depend on the network protocol and plays a major role in controlling the determinism of the network. Specifically, it depends on the data length, the lead bit, the padding, and the bit time. Let Ndata be the data byte length, Nhead be the boot byte length, Nstuff be the padding byte length, and the bit length be Tb_l (approximately 1us). Then the transmission time is Tsend = (Ndata + Nhead + Nstuff) / 8Tb.t (4). Analysis shows that the transmission time (Tsend) of information is determined by the protocol itself. To improve the real-time performance of the system, the waiting time (TWait) of information in the network must be reduced. Therefore, we will improve the real-time performance of the system from two aspects: reducing the amount of information in the network and balancing the network load. III. Multi-rate sampling After analyzing the delay of the CAN bus closed-loop control network, to reduce the delay of the control system, we should first minimize the information transmission tasks in the network, and secondly, under the premise of a certain network bandwidth, balance the network load to improve the utilization rate of the network bandwidth. For NCS, due to the decentralization of nodes, it is unlikely and impractical to sample all physical signals at a single rate. Generally, the shorter the sampling time of the sampler and hold, the better the performance of the system. However, the faster the A/D and D/A converters are, the higher their cost. For systems with signals of different frequencies, a good approach that achieves both good performance and low system cost is to use A/D converters with different speeds. Therefore, multi-rate sampling is a natural choice for NCS. In distributed systems, sampling typically uses time-driven A/D and D/A converters. While this sampling method is well-suited for many single-loop control systems, synchronous (time-triggered) sampling often presents numerous problems for multi-rate sampling systems. For example, network bandwidth limitations impose higher signal requirements, and excessive redundant signals exacerbate system delays, empty sampling, and message loss, thus degrading system performance. To address network bandwidth limitations and eliminate the negative impact of redundant signals on system performance, a combination of synchronous (time-triggered) and asynchronous (event-driven) sampling methods is often employed. When the samplers or hold circuits in a digital control system operate with different sampling periods, a multi-rate sampling control system is formed. Based on whether the samplers or hold circuits in a multi-rate sampling digital control system are synchronized and the relationship between the sampling periods, multi-rate sampling digital control systems can be further classified. If the system's samplers, hold circuits, and microcomputer calculations are all performed synchronously under the same clock, and based on the relationship between the sampling periods, synchronous systems can be divided into: input multi-rate sampling control systems, output multi-rate sampling control systems, and generalized multi-rate sampling control systems. If the samplers, hold circuits, and microcomputer calculations in a system are not synchronized under the same clock, and based on the relationship between the sampling periods, asynchronous systems can be classified into: input multi-rate sampling control systems, output multi-rate sampling control systems, and generalized multi-rate sampling control systems. Traditional theory and engineering practice are largely limited to synchronous multi-rate sampling control systems. Research on asynchronous multi-rate sampling digital control systems is more complex and typically employs stochastic methods for analysis. Assuming the sampling time of each sampler and hold circuit is a random process, stochastic system methods are then used. Figure 2: Digital Control System IV. Dynamic Time Window ( Note: The original text contains some inconsistencies and inconsistencies in the original text, which have been omitted from the translation.) To balance network load and improve network utilization, and considering the characteristics of CAN, we can designate a node with system control functions in a CAN network, which we'll call the master node (distinguished from other nodes by its highest priority). The others are called slave nodes. We design a network system that includes a time-triggered system and an event-triggered system. The former deals with time-triggered information, while the latter deals with event-triggered information. How do we distinguish between these two? Time-triggered information is considered a synchronous system relative to nature; while event-triggered information is defined as an asynchronous system relative to nature. Generally, event-triggered communication is more efficient than time-triggered communication. However, this efficiency is incalculable when considering the worst-case scenario. Since event triggering is asynchronous relative to nature, the worst-case scenario is when all events occur simultaneously. Solving this problem often requires substantial resources (e.g., communication bandwidth). Time-triggered communication, on the other hand, is often a synchronous process relative to nature. It allows time slots to be predetermined in advance within the controlled environment to control the maximum loop time. Its most important feature is the ability to perform state-dependent control based on different information flow transmission patterns on the network. Different states can be set for different information flows to reduce information waiting to be sent at the same time; this state-dependent control improves network utilization. To decouple these two systems, we introduce the concept of Dynamic Time Window (DTW). A DTW contains two sub-windows: an asynchronous window (AW) and a synchronous window (SW). The asynchronous window is used to send and receive event-triggered messages, while the synchronous window is used to send and receive time-triggered messages. Since event-triggered messages are generally infrequent and arrive randomly, and timely responses are typically required, the asynchronous window precedes the synchronous window in the system time window. We also propose the concept of a maximum asynchronous window to maximize timely responses to event-triggered messages and prevent system network disasters. The structure of a STW is shown in Figure 3. Here, let the window start time be Tm, the asynchronous window time be Ta, the synchronous window time be Ts, and the total system window time be Tc. The bidirectional arrows represent a QoS pointer mechanism; their sliding defines the time of the asynchronous and synchronous windows. Why set a QoS pointer? Because event triggering information is an asynchronous system relative to time and has randomness, the number of event triggering service requests in the entire network is dynamically changing. When there are few event information in the network, the QoS pointer can be moved to shorten the asynchronous window; conversely, when there are many event information in the network, the asynchronous window can be lengthened by moving the QoS pointer, but there is a limit. In this way, network bandwidth can be effectively utilized. How to set the system time window Tc? What parameters are affected by the change of Tc? Let η be the maximum effective utilization of the network, then η = 1 - (Tm/Tc) (5) Obviously, from equation (1), Tc determines the maximum utilization of the network. As Tc increases, the maximum utilization of the network increases, so why not increase Tc as much as possible? Because as a control network, it requires real-time performance. If Tc is relatively large, the synchronous system and the asynchronous system will be coupled, so Tc cannot be too large. Therefore, the setting of Tc depends on the specific network. What constitutes a system disaster? The system consists of two subsystems: an asynchronous system (Sa) and a synchronous system (Ss). Since the information content of the synchronous system is determined by the sensor sampling rate, its information content is constant. However, for the asynchronous system, because it is asynchronous with respect to time, a disaster occurs when all asynchronous signals occur synchronously. This is also a disaster for the overall system. Because we have set a maximum asynchronous window, the network still has a certain transmission capacity when a disaster occurs. This balances the network load in the time domain, and as the number of nodes in a single network segment increases, bandwidth utilization is significantly improved, thus reducing the delay of control information. Experimental simulation results will follow. V. Simulation Analysis Here, we assume that the amount of asynchronous information in a system tends to follow a normal distribution. In our simulation, we set the transmission time of each frame to 1 unit of time. The frame start time is 4 units of time. The asynchronous information tends to follow a normal distribution n(40, 16). As the bus time window length changes, the bus utilization also changes. We will obtain the bus utilization of dynamic time windows and static time windows (i.e., asynchronous and synchronous window lengths are equal). The system simulation results are shown in Figure 4. From the figure, we can see that: 1. First, under the premise of a certain distribution of asynchronous information, there is a certain value of the total time window length that maximizes the bus utilization. In engineering practice, this means that there is an optimal value for the amount of synchronous information. 2. Second, the dynamic time window has a better bus utilization than the static time window, and this is more obvious as the bus time window length increases. Figure 4 System simulation results VI. System Implementation System implementation based on CAN bus: In this system, there is a master node, which mainly completes the scheduling of network information and is given the highest priority. Next, other nodes that transmit and receive event information are given the second highest priority. Finally, nodes that transmit and receive time information are given the lowest priority. The master node performs the following functions: sending window start information and a QoS pointer, both of which are broadcast frames. When the master node sends the window start information, all nodes receive it, achieving network synchronization. QoS information is not mandatory for every system window. If the event information can be sent within the maximum asynchronous time, QoS is not sent; conversely, when the asynchronous window reaches its maximum asynchronous time, the master node sends a QoS pointer, which is received by all nodes. All asynchronous nodes then stop sending information, and only then can synchronous nodes begin sending information. The asynchronous nodes perform the following functions: they constantly listen to the bus. When the window start information arrives, because asynchronous nodes have higher priority than synchronous nodes, they can send information, and asynchronous information is scheduled according to priority among these asynchronous nodes. When the QoS pointer information arrives, all asynchronous nodes stop sending information and can only receive it. The functions of the synchronous node: The synchronous node also constantly listens to the bus. When the window start information arrives, because the synchronous node is relatively low compared to the asynchronous node, although it also sends information at this time, it will exit as soon as asynchronous information arrives. When the QoS pointer information arrives, the synchronous node can send information because the asynchronous node stops sending information. VII. Conclusion This paper systematically discusses the characteristics of a closed-loop network control system based on the CAN bus and analyzes its time-domain delay. Combining the characteristics of the CAN bus itself, the concept of multi-rate sampling and dynamic time window was adopted to design a CAN-based network control system. Laboratory-level debugging proves that the closed-loop network control system has good real-time performance.