In order to contrast and analyze the real-time performance of the powertrain system of a plug-in hybrid electric vehicle, a mathematical model of the system delay is established under the circumstances that the transmission adopts the CAN (controller area network) protocol and the TTCAN (time-triggered CAN) protocol, respectively, and the interior of the controller adopts the foreground-background mode and the OSEK mode respectively. In addition, an experimental platform is developed to test communication delays of messages under 4 different implementation models. The 4 models are testing under the CAN protocol while the controller interior adopts the foreground-background mode; testing under the CAN protocol while the controller interior adopts the OSEK mode; testing under the TTCAN protocol while the controller interior adopts the foreground-background mode, and testing under the TTCAN protocol while the controller interior adopts the OSEK mode. The theoretical and testing results indicate that the communication delay of the OSEK mode is a little longer than the one of the foreground-background mode. Moreover, compared with the CAN protocol, the periodic message has a better real-time performance under the TTCAN protocol, while the nonperiodic message has a worse one.
The controlling and managing system of a plug-in hybrid electric vehicle controls the main assemblies through bus and makes full use and coordination of advantages of each part, so that the vehicle can get the best operating condition. The system adopts network-based control mode, which affects the real-time performance. References [
The delay of the bus communication can be divided into 4 parts: generating delay, queue delay, transmission, and receiving delay [
On the aspect of the on-line delay of CAN bus, [
On the aspect of the on-line delay of TTCAN bus, [
Most of the studies on the vehicular network delay have paid attention to the on-line delay, while they have ignored the on-chip delay [
On the aspect of the on-chip delay based on the foreground-background mode, [
And for the analysis on the aspect of the on-chip delay based on the OSEK mode, aiming at general static embedded real-time operating system, [
In this paper, the delay characteristic of the vehicular distributed real-time control system is analyzed, including the on-line delay and the on-chip delay. To finally achieve a better performance of the system, the overall delay model which adopts the different on-chip mechanisms and the different networking protocols is analyzed, and the cooperation of the on-chip scheduling and the network scheduling is also taken into consideration.
The power comes from three parts: vehicle engines and power units in an APU system, power battery pack, and plug-in charging system. However, the actual power for the running vehicle is mainly supplied by the APU system and the vehicle-mounted power battery pack. The composition of the plug-in controlling system is shown in Figure
Composition of the plug-in controlling system.
In Figure
The powertrain system of a plug-in hybrid electric vehicle consists of 5 nodes, and the setting conditions of parameter groups of each node are given out in Table
Message sending conditions of each node of powertrain.
Sending node | Message | Sending rate (ms) | Receiving node | Message content |
---|---|---|---|---|
Vehicle controller | ID06 | 10 | Motor controller | Motor controls parameter |
ID10 | 40 | APU controller | APU controls parameter | |
ID15 | 80 | All of the nodes | Condition of the vehicle controller | |
ID03 | Nonperiodic | All of the nodes | Vehicle is giving an alarm | |
| ||||
Motor controller | ID07 | 10 | Vehicle controller | Motor working parameter |
ID12 | 40 | All of the nodes | Motor working condition | |
ID01 | Nonperiodic | All of the nodes | Motor is giving an alarm | |
| ||||
Variable speed controller | ID08 | 20 | All of the nodes | Transmission working parameter |
ID11 | 40 | All of the nodes | Transmission working condition | |
ID02 | Nonperiodic | All of the nodes | Transmission is giving an alarm | |
| ||||
Battery management system | ID09 | 20 | Vehicle controller | Battery pack working parameter |
ID16~44 | 80 | Message display | Battery pack is collection points message | |
ID04 | Nonperiodic | All of the nodes | Battery system is giving an alarm | |
| ||||
APU controller | ID13 | 40 | All of the nodes | APU working parameter |
ID14 | 80 | All of the nodes | APU working condition | |
ID05 | Nonperiodic | All of the nodes | APU is giving an alarm |
According to Table
The bus adopts the CAN transmission and TTCAN protocol, and the interior of controller nodes adopts the foreground-background mode and the OSEK mode, respectively, to realize the total communication delay of the powertrain distributed real-time controlling system of a plug-in hybrid electric vehicle under these 4 working conditions. Considering the specific application to be a passenger car, the vehicle communication should be corresponding to protocol SAEJ1939. Therefore, the massage form is defined as expanding frame form.
Aiming at the distributed real-time controlling system based on the CAN bus, [
Communication delay model.
The communication delay of the bus can be divided into 4 parts, which are generating delay, queue delay, transmission delay, and receiving delay [
The generating delay: the period from the moment of microcontroller that sends node receiving the request from the same node to the moment of writing the prepared data into the sending cache queue of the CAN controller.
The queue delay: the period from the moment of massage entering the sending cache queue of the CAN controller to the moment of the massage obtaining controlling right of the bus.
The transmission delay is the period from the moment of massage occupying the bus to the moment of massage leaving the bus.
The receiving delay is the period from the moment of massage leaving the bus to providing the effective data to the microcontroller that receives nodes.
To describe it easier, this paper divided the communication delay into two parts: on-line delay which includes queue delay and transmission delay and on-chip delay which includes generating delay and receiving delay.
For the periodic message, the queue delay could be expressed with an iteration formula as follows:
In the previous formula,
The transmission delay of message
In the previous formula,
The average queue delay and transmission delay are independent of each other, and the average on-line delay is the sum of the two:
In the previous formula,
Substituting (
To the nonperiodic messages, according to the priorities ranking from high to low, the highest-priority message is called type 1 message; the second high-priority message is called type 2 message, and so on, while the lowest-priority message is called type
Firstly, consider type 1 message, which means the problem of the average queue delay of messages with the highest-priority.
When a type 1 message requests to transmit on the bus, its average waiting time
In the previous formula,
Then, consider the problem of the average queue delay of type
When a type
In the previous formula,
Then, consider the transmission delay; the on-line delay of the message is
What is different from the analysis of on-line delay of the periodic CAN messages is that every periodic TTCAN message transmits in the appointed exclusive-time window, ensuring that the bus is free when each periodic massage gets triggered by scheduling the overall time. Therefore, the queue delay of the periodic message will not exist any longer. As a result, under the TTCAN protocol, the on-line delay of the periodic message is just transmission delay. Substituting
Nonperiodic TTCAN messages are all assumed to be scheduled in the arbitration time window. Based on the analysis of average on-line delay of the CAN nonperiodic message, the effects of exclusive-time window and free-time window are taken into consideration. When the nonperiodic message
Set the number of the exclusive-time windows (or the free-time windows) within the average arriving period of nonperiodic massages to be
In the previous formula,
According to (
In the node of the controller, the average performing time of the task can be expressed as follows:
In the previous formula,
The generating delay of messages means the time needed from the moment of sending node requesting to generate message to the moment of writing the generated message into the sending cache of bus controller, which means the period from the moment that the message sends the task to the moment that the task is finished in the node. Message receiving delay means the time needed from the moment that the message leaves from the bus to the moment that the carried data is provided to the target task of receiving nodes, which means the period from the moment that the message receives the task to the moment that the task is finished in the node.
The bus adopts the CAN and TTCAN transmission protocols, respectively, and interior of the controller nodes adopts the foreground-background mode and the OSEK mode, respectively. The overall communication delay of the powertrain distributed real-time controlling system of a plug-in hybrid electric vehicle under these four working conditions is analyzed. The specific experiment environment is expressed as follows.
The bus baud rate of the communication delay testing platform is set to be 250 Kbit/s, and the expanding data frame form is adopted to write communication programs of the 5 nodes shown in Figure The program is divided into 5 tasks, which is used for realizing the transmission of 3 periodic messages and 1 nonperiodic message as well as the receiving of messages. The controlling strategy related to each task is finished inside the task. The priority of the receiving tasks of messages in the node is the highest, and the priority of tasks sending from the message equals the priority of the message.
Table
The individual performing time of tasks under the foreground-background mode.
Description of tasks | Performing time (ms) |
---|---|
Sending message ID03 | 0.0132 |
Sending message ID06 | 0.0352 |
Sending message ID10 | 0.0272 |
Sending message ID15 | 0.0162 |
Message receiving | 0.0142 |
Table
The individual performing time of tasks under the OSEK mode.
Description of tasks | Performing time (ms) |
---|---|
Sending message ID03 | 0.0292 |
Sending message ID06 | 0.0512 |
Sending message ID10 | 0.0432 |
Sending message ID15 | 0.0322 |
Message receiving | 0.0302 |
According to Tables
When the transmission protocol adopts the TTCAN mode, the matrix period, the basic period, and the width of the time window which means the transmission column width in the matrix period should be determined.
Firstly, assume that the matrix includes
In the previous formula,
Length of the basic period is usually set as the greatest common divisor of all message periods, while the length of the matrix period is usually set as the least common multiple of all message periods. The calculated matrix period needs a schedulable analysis in order to explain whether the matrix period is enough for scheduling all of the messages or not. Reference [
In advance,
Let the width of each column in the matrix period be the same, and the width
Let the basic period be the greatest common divisor (GCD) of the period:
Let the matrix period be the lowest common multiple (LCM) of the period:
The ratio
The number of the basic periods
The number of the time window needed in a basic period is
Let
In the previous formula,
If the schedulable condition is satisfied:
For the messages sent by each node of the powertrain of a plug-in hybrid electric vehicle which is defined in Table
The matrix period of the plug-in powertrain of the TTCAN protocol.
In Figure
For the periodic message, the transmission under the TTCAN mode needs the cooperation of the interior scheduling of the node and the window scheduling on the bus.
The periodic message
In the previous formula,
The cooperation of the trigger phase of the sending task and the transmission window of the corresponding message on the bus can be realized by the overall time stamp provided by the reference message. According to the trigger phase
Then, the tests of the communication delay of the powertrain of a plug-in hybrid electric vehicle are conducted in 4 working conditions separately, which are the following: testing under the CAN communication protocol while the controller interior adopts the foreground-background mode; testing under the CAN communication protocol while the controller interior adopts the OSEK mode; testing under the TTCAN communication protocol while the controller interior adopts the foreground-background mode; testing under the TTCAN communication protocol while the controller interior adopts the OSEK mode.
Under the foreground-background mode, 3 timer interruptions control the sending of 3 periodic CAN messages, an exterior triggered interruption controls the sending of a nonperiodic CAN message, and a CAN receiving interruption controls the real-time receiving of the CAN message. Figure
The communication delay of the nonperiodic message under the foreground-background mode with CAN protocol.
The communication delay of the periodic message under the foreground-background mode with CAN protocol.
According to Figures
The comparison of the measured and theoretical communication delays of the message of the vehicle controller node under foreground-background mode with the CAN protocol.
Message ID | Measured average communication delay (ms) | Theoretical average communication delay (ms) | Average communication delay error | Maximum measured communication delay (ms) |
---|---|---|---|---|
ID03 | 0.75585 | 0.73658 | −2.62% | 1.4599 |
ID06 | 0.73184 | 0.75523 | 3.10% | 1.4097 |
ID10 | 0.80478 | 0.77407 | −3.97% | 2.3594 |
ID15 | 0.79332 | 0.78634 | −0.89% | 3.9359 |
Under the OSEK mode, the sending and receiving of the message are directly controlled by OSEK tasks. The communication delay of nonperiodic messages is shown in Figure
The communication delay of the nonperiodic message of the vehicle controller node under the OSEK mode with the CAN protocol.
The communication delay of the periodic message of the vehicle controller node under the OSEK mode with the CAN protocol.
According to Figures
The comparison of the measured and theoretical communication delays of the message of the vehicle controller node under OSEK mode with the CAN protocol.
Message ID | Measured average communication delay (ms) | Theoretical average communication delay (ms) | Average communication delay error | Maximum measured communication delay (ms) |
---|---|---|---|---|
ID03 | 0.76043 | 0.7692 | 1.14% | 1.6344 |
ID06 | 0.76505 | 0.78827 | 2.95% | 1.6427 |
ID10 | 0.86326 | 0.80728 | −6.93% | 2.1817 |
ID15 | 0.88312 | 0.81935 | −7.78% | 3.878 |
Figure
The communication delay of the nonperiodic message of the vehicle controller node under the foreground-background mode with the TTCAN protocol.
The communication delay of the periodic message of the vehicle controller node under foreground-background mode with the TTCAN protocol.
For the communication delay of the periodic message shown in Figure
According to Figures
The comparison of the measured and theoretical communication delays of the message of the vehicle controller node under foreground-background mode with the TTCAN protocol.
Message ID | Measured average communication delay (ms) | Theoretical average communication delay (ms) | Average communication delay error | Maximum measured communication delay (ms) |
---|---|---|---|---|
ID03 | 5.2397 | 5.1803 | −1.15% | 15.317 |
ID06 | 0.6094 | 0.6174 | 1.30% | 0.6173 |
ID10 | 0.6014 | 0.6094 | 1.31% | 0.6093 |
ID15 | 0.5904 | 0.5984 | 1.34% | 0.5983 |
Under the OSEK mode, the sending and receiving of the message are directly controlled by OSEK tasks. Figure
The communication delay of the nonperiodic message of the vehicle controller node under OSEK mode with the TTCAN protocol.
The communication delay of the periodic message of the vehicle controller node under OSEK mode with the TTCAN protocol.
According to Figures
The comparison of the measured and theoretical communication delays of the message of the vehicle controller node under OSEK mode with the TTCAN protocol.
Message ID | Measured average communication delay (ms) | Theoretical average communication delay (ms) | Average communication delay error | Maximum measured communication delay (ms) |
---|---|---|---|---|
ID03 | 5.3449 | 5.213 | −2.53% | 16.198 |
ID06 | 0.6414 | 0.6494 | 1.23% | 0.6830 |
ID10 | 0.6334 | 0.6414 | 1.25% | 0.6334 |
ID15 | 0.6224 | 0.6304 | 1.27% | 0.6640 |
The following analysis results can be acquired according to Tables According to the measured transmission process of messages, the matrix period and the schedulable analysis proposed in Section Under all kinds of the working conditions and modes, the theoretical and the measured results are approaches. The maximal error is just −7.78%, which indicates that the theoretical model is reasonable. Under the CAN protocol, for the same message no matter it is periodic or nonperiodic, the average communication delay under the OSEK mode is longer than the one under the foreground-background mode. The reason is that the generating delay and the receiving delay (on-chip delay) under the OSEK mode are longer than the ones under the foreground-background mode. Under the CAN protocol, the longest communication delay of each message under the OSEK mode is not consistently longer than the longest communication delay under the foreground-background mode, which means that the longest communication delay has more randomness than the average communication delay. Under the TTCAN protocol, for the same message no matter it is periodic or nonperiodic, the communication delay under the OSEK mode is longer than the one under the foreground-background mode. The reason is that the generating delay and the receiving delay (on-chip delay) under the OSEK mode are longer than the ones under the foreground-background mode. For the periodic message, no matter it is the foreground-background mode or the OSEK mode, the communication delay under the TTCAN protocol is shorter than the one under the CAN protocol. It is mainly because the queue delay of the communication delay under the TTCAN protocol is 0, which makes the integral communication delay decline. For the nonperiodic message, no matter it is the foreground-background mode or the OSEK mode, the communication delay under the TTCAN protocol is much longer than the one under the CAN protocol. It is mainly because only arbitration window in the network bandwidth allows the sending of the nonperiodic message under the TTCAN protocol. As a result, the exclusive window and the free window enlarge the queue delay of the nonperiodic message and delay the transmission of the nonperiodic message, which causes the increase of the communication delay of nonperiodic messages.
The analysis results above are acquired under the conditions that the periodic message and the nonperiodic message are transmitted in the network at the same time and that the working conditions of the sending delay and the receiving delay inside the node under the foreground-background mode and the OSEK mode are considered at the same time.
Regarding the powertrain network system of a plug-in hybrid electric vehicle as the studying target, the communication delay of the message is tested. Firstly, the topological structure and the definition of the parameter set of each node of the powertrain system of this plug-in hybrid electric vehicle are given out. The bus is established adopting the CAN protocol and the TTCAN protocol, respectively, and the delay model of the foreground-background mode and the OSEK mode systems are adopted inside the node. The schedulable rules under the TTCAN protocol based on the average loading arithmetic which takes the periodic message and the nonperiodic one into consideration at the same time are established. According to the rules, the matrix period of message transmission in the powertrain system of a plug-in hybrid electric vehicle is established as well. Through the measured message transmission process, it could be acquired that the matrix period is enough to finish the schedule of messages, verifying the accuracy of the scheduling algorithm. The on-chip and on-line united scheduling problem of the periodic message under the TTCAN mode is analyzed, and the best on-chip phase of the sending task of the periodic message is defined. Then, the communication delay of the message is tested under the foreground-background mode and the OSEK mode, using the CAN and TTCAN as the transmission protocol, respectively. In the 4 working conditions above, after analyzing the test data, it could be concluded that the communication delay time of the OSEK mode is a little longer than the one of the foreground-background mode in the same condition. The real-time performance of the periodic message under the TTCAN protocol is better than the one under the CAN protocol, while the real-time performance of the nonperiodic message is worse than the one under the CAN protocol. The data of the measured average communication delay is very similar to the theoretical one, and the maximal error is just −7.78%, which means that the theoretical model is reliable.
The authors declare that there is no conflict of interests regarding the publication of this paper.
This work is sponsored by the Aerospace Support Technology Fund (2013-HT-HGD09), the National Laboratory for Electric Vehicles Foundations (NELEV-2013-004), Shandong Province Outstanding Young Scientists Research Award Funds (BS2012NJ001), and Beijing Science and Technology Project (Z121100005612001).