CAN Bus Neural
CAN Bus Neural
CAN Bus Neural
in one
step, the optimization problem is divided into two phases,
where the locations of the RBFs center and covariance
matrix are computed first, and the weighting connections are
calculated in the second phase.
With a predefined error function (3)
(3)
in (2) can be modified according to gradient descent
algorithm iteratively, i.e.
(4)
where . In (5) and (6), we summarize the iterative
formula of the steepest descent method
(5)
(6)
|
.
|
\
|
=
) ( ) (
2
1
exp ) , , (
1 T
i i i i i i
c x c x c x
= =
j j j j j
e y z E
2 2
2
1
) (
2
1
) (
) ( ) ( ) ( ) 1 (
t
E
t t t t
= + = +
{ }
, , ,
O
ij i i
W i, j = c
j i O
ij
E
e
W
3
2
3
2
2
2 2
3
1
2
1 1
1
) (
0 0
0
) (
0
0 0
) (
) (
in
in n
i
i
i
i
i
O
ij j
i
i i i
O
ij j
i
c x
c x
c x
W e
E
W e
E
"
# % # #
"
"
c x
c
hidden layer output layer input layer
x
1
x
2
x
n
y
1
y
2
y
p
c
1
,
1
c
m
,
m
W
o
Message Sceduling
Controller, MSC
y(kT)
plant
SRT message buf
NRT message buf
HRT message buf
Winner
Takes All
FIFO
buffer
i
((k+1)T)
decod
x(kT)
Yes
No
(i((k+1)T)) > 0
Backward Through
parameter learning
| | ) ) 1 (( ) ) 1 (( ) ) 1 (( T k T k T k + + = + F D x
In the next section, we will discuss message scheduling
control and how the training data can be generated for
supervised learning.
III. Message Scheduling Control and Backward Through
Time (BTT) Algorithm
In this section, we present a complete framework for online
adaptation of RBF networks that can be used for dynamical
message scheduling control. In our CAN model, the
transmission time D(
i
)
(7)
is defined as the time which elapses from an application
process making a transmission request (i.e. T
S
(
i
)) to the
reception of the last bit of the frame by the intended receiver(s)
(i.e. T
E
(
i
)). The subscript i of
i
denotes one of predefined
messages,
i
{HRT,SRT,NRT}. If each class of message
i
has its own predefined maximum predefined transmission time
D
max
(
i
), then the most effective index to evaluate the
performance of message scheduling is the transmission delay
(
i
), defined as the time elapsing from the transmission
request to the successful transmission of the first bit of the
frame over the network. In formula,
(8)
According to the definition of transmission delay (
i
),
message
i
is said to be timely transmitted if (
i
) 0 (or
D
max
(
i
) D(
i
)). If (
i
) is greater than zero, however,
message
i
cant guarantee its deadline requirement or is
notified of the deadline failure. In Fig. 3(a), message
i
cant
complete its transmission until T
E
(
i
), which exceeds the
predefined limit for message
i
. In this case, message
i
fails
to fulfill the requirements of timely transmission. This causes
performance degradation and even instability of real-time
application systems interconnected into the CAN bus. On the
contrary, Fig. 3(b) is the case of timely transmission.
Fig. 3. (a). Message
i
cant complete its transmission
before
max
( )
D i
T (b). case of timely transmission.
To avoid starvation for the low-priorities objects, we did a
experiment by forcing a fixed delay L(
i
) after any
transmission requests for different priority classes. This
method, however, simply limits in advance the bandwidth
allocated to each type of message, thus, decreasing the
wasted network bandwidth. In this way, the delay vector is L
= [L(HRT) L(SRT) L(NRT)]
T
= [n
1
T n
2
T n
3
T]
T
. Moreover, it
requires also a certain degree of a priori knowledge of the
maximum allowable transmission time and the network
traffic load. Therefore, we assumed that D
max
= [D
max
(HRT)
D
max
(SRT) D
max
(NRT)]
T
= [100T 150T 200T]
T
and the traffic
loads are F(
i
) = 30 for
i
{HRT,SRT,NRT}. Table 1 and
Table 2 illustrate the transmission time under different
conditions of vector n = [n
1
,n
2
,n
3
]
T
. In Table 1, all messages
are timely transmitted (i.e. (
i
) < 0). However, too large of
the value of n
2
in Table 2 is notified of the deadline failure
for SRT message (i.e. (SRT) > 0). The simulation results
reveal the fact that values of n
i
affects the performance of
message scheduling significantly. We therefore reasonably
assume that there exists
Table 1. Transmission time v.s (n
1
,n
2
,n
3
)=(60,85,0).
D(
i
) Min Mean Max (
i
)
D(HRT
)
61T 61.45T 90T (HRT) < 0
D(SRT) 86T 102.33T 120T (SRT) < 0
D(NRT
)
1T 124.07T 180T (NRT) < 0
Table 2. Transmission time v.s (n
1
,n
2
,n
3
)=(50,140,0).
D(
i
) Min Mean Max (
i
)
D(HRT
)
51T 51.37T 80T (HRT) < 0
D(SRT) 141T 154.36T 200T (SRT) > 0
D(NRT
)
1T 122.53T 162T (NRT) < 0
We strongly believe that there exists some implicit
relationships between traffic load F, delay vector L, and (
i
).
If n or L is chosen properly in advance, (
i
) can be
completely decided. In fact, vector n or L can only be selected
by trial-and-error. Moreover, the network traffic load is
usually time-varying, values of (n
1
,n
2
,n
3
) has to be changed
accordingly. It implies F and L are time-dependent, F = F(t)
and L = L(t). If we consider the competing time between
heterogeneous and homogeneous classes, the implicit function
between F, D, and (
i
) can be reasonably expressed as
(9)
In (9), F(t) = [F(HRT,t) F(SRT,t) F(NRT,t)]
T
and D(t) =
[D(HRT,t) D(SRT,t) D(NRT,t)]
T
. Unfortunately, the function
is highly complex and the explicit solution is almost
impossible to find or doesnt exist. To optimally utilize the
system resources for different types of messages while
guaranteeing timely transmission, we are not intended to find
) ( ) ( ) (
i S i E i
T T D =
) ( ) ( ) (
max i i i
D D =
D
max
(
i
)
T
E
(
i
)
T
S
(
i
)
D(
i
L(
i
)
(b)
) (
max
i D
T
(
i
)
D
max
(
i
)
T
E
(
i
)
T
S
(
i
)
D(
i
)
L(
i
)
(a)
(
i
)
) (
max
i D
T
0 )) ( ), ( ), ( ( =
i
t t D F
the exact solution. Instead, we propose a neural network
approach for message scheduling control. The controller is
realized by several radial basis functions and forms a radial
basis function network. The purpose of the RBFN is to reveal
the implicit relationship between the input vectors x(t) = [D(t)
F(t)]
T
and a proper output vector y(t), which features resource
reservation as well as dynamic message scheduling such that
an appropriate class of message to be served in the next time
instant. Since the proposed MSC is implemented by the RBFN
network, in the rest of the paper MSC and RBFN will be used
interchangeably.
At any time instant t, the input vector x(t) = [D(t) F(t)]
T
of
the MSC consists of transmission time and the current network
flow rate, where D(t) = [D(HRT,t) D(SRT,t) D(NRT,t)]
T
and
F(t) = [F(HRT,t) F(SRT,t) F(NRT,t)]
T
. Consequently, the
inferred output y after WTA (Winner Takes All) identifies the
message to be served in the next time instant. For optimal
message scheduling, the parameters of the MSC of the RBFN
have to be designed by the so-called supervised learning. The
learning employs two levels of adaptation, namely, adaptation
of the connection weights between the hidden layer and the
output layer and adaptation of the parameters of the radial
basis functions. Unfortunately, the optimal message
scheduling is impossible to predict in advance. Consequently,
without complete knowledge about the target vector z, the
parameter learning method in (5) and (6) cant proceed.
Moreover, in many applications, it would also be desirable
for an online training algorithm to be able to provide stable
outputs, whenever the system dynamics change.
Fig. 4. On line Backward Through Time (BTT)
algorithm.
Therefore, in this paper we devise an on-line Backward
Through Time (BTT) learning algorithm which continuously
monitors (
i
,t) for message
i
and constructs a schedule
table sequentially as shown in Table 4. In the beginning, the
schedule table records both input vector x and the
corresponding vector y (and
i
), based on the default
parameter in the RBFN. If at any time instant t, (
i
,t)= rT
is greater than zero, it implies that the transmission time for the
corresponding message is unacceptable or the bandwidth
allocation in the previous time instant is improper. At this
point, we retrieve the vector x(t (r-1)T) from the schedule
table and reassign its corresponding output class (or target) by
the current type of message. Consequently, the desired target
vector z can be extracted. This vector {x z} sets up the
necessary information for on line supervised learning and the
parameters of RBFN can be tuned accordingly. Fig. 4 shows
the complete framework for online BTT adaptation algorithm
of RBF networks.
In the following, we conduct some experiments to evaluate
the performance of the proposed BTT method in CAN
message scheduling.
IV. EXPERIMENTAL RESULTS
In the simulation of message scheduling, we assume the
number of radial basis functions for the MSC is fixed and
known in advance. The messages generated at each node by
the user are inserted according to a FIFO (First In First Out).
The message is generated randomly in a predefined range and
is defined as the traffic load F(
i
). Table 3 summarizes these
necessary information, including D
max
(
i
), F(
i
), and the
number of RBFs.
Table 3. Simulation parameters.
Maximum
transmission time
D
max
(HRT) = 120, D
max
(SRT) = 200,
D
max
(NRT) = 400
Traffic load
F(HRT) = 30~50, F(SRT) = 30~50,
F(NRT) = 30~50
# of RBFs 7
In the beginning, the parameters of MSC are initialized
randomly. The MSC shares out the system bandwidth among
three different messages fairly and all messages are timely
transmitted. As time goes on, the HRT messages can only
transmit using the residual bandwidth that is left after SRT and
NRT messages have been allocated. Therefore, HRT messages
become less and less competed with others since HRT
messages have the smallest allowable transmission time.
Consequently, the transmission time of HRT message can not
fulfill with the requirement of timely transmission. On the
contrary, the transmission time of SRT and NRT are far below
D
max
(SRT) and D
max
(NRT). However, in this time interval,
MSC continuously activate the on line BTT algorithm as
mentioned in section III. The behaviors of the RBFN intend to
give a higher priority to the HRT messages and allocate more
system bandwidth for HRT messages while keep the SRT and
NRT messages meet the basic requirements. Fig. 5 reveals this
fact.
Yes
BTT Algorithm
Initialization of
RBFN
Forward stage
of RBFN
Training stage
of RBFN
Update
Schedule Table
(
i
,kT) > 0
Extract {x,z} for
supervised learning
No
Fig. 5. Simulation results of message scheduling under
the conditions of Table 3. The dotted lines denote the
maximum allowable transmission time.
We also calculate the ratio (
i
) of message
i
that fail to
accomplish its transmission before D
max
(
i
) versus total
number of that type message being transmitted. In Fig. 6,
(
i
) is recorded from Fig. 5. As was expected, the curves of
(
i
) are gradually improved and become level off when the
system is stable.
Fig. 6. Curves of (
i
) versus t.
V. CONCLUSION
The CAN is a network protocol that supports
communication among field devices in the control and
distributed systems. This study introduces a bandwidth
allocation algorithm in the CAN bus such that different types
of messages, hard real-time, soft real-time, and nonreal-time
messages, can satisfy their basic requirements for timely
transmission. The proposed MSC is implemented by radial
basis function networks which dynamically decide the
proper type of message to be served in the next time instant.
Simulation results demonstrate the effectiveness of the
proposed method. In out current work, the number of RBFs
is fixed during training phase. For modeling dynamical time
varying systems, the number of RBFs should be adaptively
changed in order to capture the dynamics of the CAN bus
system. That means the proposed algorithm should not only
tune the parameters of RBFN but also add or delete some
RBFs. In this way, the MSC or the RBFN can retain a
reasonable size, but at the same time describe well of the
system at any time instant. This involves the so-called
structure learning strategy with the parameter learning
method. This research topics is still under investigation and
will be our future works.
ACKNOWLEDGMENT
This research was supported by the National Science
Council under contract number NSC94-2213-E-212-036.
REFERENCES
[1] Robert Bosch, CAN Specification Version 2.0, Bosch,
Sep. 1991.
[2] Farsi, M., Ratcliff, K., and Barbosa, M, An overview of
controller area network, Computing & Control
Engineering Journal Vol. 10(3), P. 113-120, June 1999.
[3] Zuberi, K.M., & Shin, K.G., Non-preemptive scheduling
of messages on controller area network for real-time
control applications, Proc.of the first IEEE real-time
technology and applications symposium, pp. 240-249,
1995.
[4] K. Tindell, A. Burns, and A. J. Wellings, Calculating
controller area network (CAN) message response times,
Contr. Eng. Practice, vol. 3, no. 8, pp. 11631169, 1995.
[5] Audsley, N.C., A. Burns, M.F. Richardson, A.J. Wellings
(1991). Hard Real-Time Scheduling : The Deadline
Monotonic Approach. Proceedings of 8th IEEE
Workshop on Real-Time Operating Systems and
Software.
[6] Tindell, K. and A. Burns (1994). Guaranteeing Message
Latencies on Control Area Network (CAN). First
International CAN Conference 94.
[7] Tindell, K., A. Burns, A. Wellings (1995). Calculating
Controller Area Network (CAN) Message Response
Times. Control Engineering Practice, 3(8):1163-1169.
[8] Livani, M.A. and J. Kaiser (1998). EDF Consensus on
CAN Bus Access for Dynamic Real-Time Applications.
Lecture Notes in Computer Science 1388 (Jose Rolim
Ed.), pp. 1088-1097, Springer Verlag Berlin, 1998.
[9] Zuberi, K.M. and K.G. Shin (1995). Non-Preemptive
Scheduling of messages on Controller Area Network for
Real-Time Control Applications. Proc. Real-Time Techn.
and Appl. Symposium.
[10] Kaiser, J. and M.A. Livani, Invocation of Real-Time
Objects in a CAN Bus-System, First Intl Symposium on
Object-Oriented Distributed Real-Time Computing
Systems, Kyoto, 1998.
[11] Uykan, Z., Guzelis, C., Celebi, M.E. and Koivo,
H.N, Analysis of input-output clustering for determining
centers of RBFN IEEE Trans. on Neural Networks, Vol.
11(4), pp. 851-858, July 2000.
[12] S. Haykin. Neural Networks: A Comprehensive
Foundation. Macmillan College Publishing Company,
New York, 1994.
0
200
400
600
D
HRT message
0
100
200
D
SRT message
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
0
100
200
300
400
D
NRT message
t
0 2000 4000 6000 8000 10000
0
0.1
0.2
0.3
0.4
t
HRT
SRT
NRT
i
)
Table 4. Schedule Table
t input vector output vector output class transmission delay
kT x(kT) y(kT)
i
((k+1)T) = NRT (NRT,(k+1)T) 0
(k+1)T x((k+1)T) y((k+1)T)
i
((k+2)T) = SRT (SRT,(k+2)T) 0
# # # # #
(k-r-1)T x((k -r-1)T) y((k -r-1)T)
i
((k -r-1))T) = ??? (SRT, (k-r-1))T) 0
# # # # #
(k-1)T x((k-1)T) y((k -1)T)
i
(kT) = HRT (HRT,kT) = rT > 0