You are on page 1of 8

S.H.Hong and W.-H.

Kim
zy
zyxwvutsrqpo
Bandwidth allocation scheme in CAN protocol

zyxwvuts
Abstract: The CAN (controllcr area network) is a serial comniunicatioii protocol for distributed
rcal-time control and antoniatioii systcms. Data gencrated from ticld devices in inanufacturing
autoination aid process control systcnis are classified into thrcc categories; rcal-time event data,
real-time control data and non-real-time data. These data sliarc a common CAN medium. Unless
the traffic of the CAN protocol is efficiently cnnirolled, performance of tlic real-time application
systcins interconnccted into the CAN bus can be degraded. Tlic paper propascs a bandwidth
allocation algorithm that can be applicable to the CAN protocol. The bantlwidlh allocittian
algorithm not only satisfics the pcrrorinarice requirement of real-time application systcins
interconnectcd into the CAN but also fully utiliscs the bandwidth of thc CAN. The bandwidth
allocation algorithm intradnced in tlic paper is validated using a simulation experiment.

1 Introduction

Tlic CAN (controller area nctwork) [ 1J is a serial commu-


nication protocol that supports clisiributcd real-timc control
and automation. Although originally designed for automo-
zyxwvu
Hong, S.H. and Kim, W.H., 2000. Bandwidth allocation scheme in CAN protocol. IEE Proceedings-
Control Theory and Applications, 147(1), pp.37-44.

current frame, Tindel et al. [43 presciited the analytical


method io determine h e worst-case response time of the
CAN protocol, including the costs of error-handling and
rctransmissi on.
Hong [ 5 ] reported a scheduling algorithm for thc deter-
tive applications, CAN has applications in many industrial mination or the sumpling time of control data in the
process control tind automation systems bccause of its integratcd coinrnunication and control systems that accom-
simplicity and low cost. Data gencrated from distributed modate periodic control data only. The schedtilirig algo-
control and automation systems arc classified into real-timc rilhrn not only satisfics the performance reqiiiremcnt of
arid non-real-time data. In the CAN bus, thew data share a control systems but also considerably increases the utilisn-
cninmon iietwurk medium. In this circuinsiance, truismis- tion of network rcsaurces. This study extends the schedul-
sion of real-time data could be interfcrcd by non-real-time ing algorithm introduced by Hong to the bandwidth
data, and tlic network-induced deluy of real-timl: data could allocation of CAN protocol that accommodates real-time
cxcccd a predefiiicd limit. This causes pcrforinnnce dcgra- and non-real-tiinc data siinultaneously. Thc bandwidth
dation and cvcn instability o r real-time application systems allocation algorithm introduced in this study is vcrified
interconnectcd into the CAN bus. Thus, when thc CAN bus iising the siniulation expcriinent.
is inipleinentcd on iiitluslrial automation and control
system, its nctwork traffic must be thoroughly analysed
and controlled. 2 CAN protocol
Zuberi and Shin [23 proposed MTS (mixcd traffic
scheduler) far the sclicduling of nctwork traflic in the The CAN is opelatcd on the basis of CSMAINBA (carrier
CAN bus. The MI'S uses ED (earlicsl-deadlinc) scheduling sense multiple access with nondestructivc bitwise arbitra-
for high-speed messages and 13M (deadlinc-monotonic) for tion) meclianisin. Each node senses tlic state of thc bus
low-speed mcssages. It provides higlicr schedulability than before the transmissinn of data. Nodes defer transmission
fixed-priority scherncs like DM whilc incurring less over- of data until thc bus state is idle. When a bus idle condjlion
head than dynamic ED scheduling. Cena and Valetizuiio i s dctccted, any node inny start Iransmining. 11'more than
[3] presented PP (priority promotion) and DPQ (diskibuted one iiodc transmits its message, bus access conflicts need to
be resolved. This can be done through comparison of the

zyxwvut
priority qiicuc) schemes, which ensure a detcrniinistic
boiind of transmission time to rcal-time data and a fnir identifier field. CAN makes use of n wircd-OR bus to
sham of the network bandwidth for non-rcal-time data with connect all the nodcs. While transmitling the identifier,

zy
a slight modification of the CAN protocol. DPQ considcrs cach node moiiirors the serial-bus line. TFthe transmitted bit
the system as a global distributed I W O queue, arid assigns is reccssive (logical nnc) and a dominant (logical zero) bit is
the priority using thc cxtended 29-bit identificr field, and monitored, the nodc gives up from transmitting and starts to
receive incoming data. Thc node transmitting the highest

zyxwvutsrqponmlk
PP increases thc priority o f tach station according to the
priority identifier will go through and gets thc bus. 'The

zyxwvutsrqpon
time elapsed since the statinn first atteinpierl to transmit the

zyxwvutsrq
identifier For each message inust be unique to prevent a tie.

o IEE, 2000 3 Bandwidth allocation algorithm in CAN


ISG Prucccdingv nnliiic no. 20000126 protocol
DCII: 10.104~~/j~-cta:2000012~
Paper fiwt 1-cccivcd 16th Febrtiary and in 1-eviscd form 21id August 1913 In the CAN bus, tlic network incdium is sliaved by rcal-
'The nullinrs arc with thc Dcpnrtinent or Control iiild Instrumentation tiinc and non-rcal-tinie,(iats. Real-time data are subdivided
Engineeriiig, Hanyang University, Aiissn 425-79 I, Korcn into control aiid eveiit'data. Control datu are gcnerated
I t 5 P i u i ~ . - U ~ n ~l!kn il ~ t Appi.,
y Yo/. 147, WO. I, Jarrutrry I O U 0 17
zyxwvutsrqp
zyxwvuts
zy
zyxwvut
zyxwvutsr
from feedback control loops which consist of controllcr
and p l a i t The sensor and controller in a control loop
periodically generute their datn according to a givcn
sampling interval. The sensor and controller dntn inust be
of the sampling times among /I4control loops. The macrw
cycle is divided by rcal-tirnc ( T , ) snd non-real-time (T,,)
intervals again. During the rcal-tiinc interval, control data
arc transmitted using the window schcduling algorithm

zyxwvutsrqp
completely transferred within the sampling interval. E v m r presented in ITong [ 5 ] . Non-real-time data arc transniittcd
duto arc usually used for the notification of events such as during the non-real-time intcrval. Event data are trans-
monitoring, diagnostic and alarm information. Event data rnittcd at any interval with the highcst priority because they
are generated citlicr sporadically or periodically. Thew must be transmitted as soon as possible.
data must be transmitted within a spccificd hound o f To apply the bandwidth allocation algorithin lo the CAN
time interval. Non-real-time d#to colnprisc program and bus, a method that divides the network bandwidth into real-
data filcs, and database management information. Tlic tinic and non-real-time intcrvals needs to be acquired. In
delay of‘ non-rcal-timc data is not so significant compared thc CAN protocol, this can bc siniply accomplished by
to that o f rcal-tiinc data. Thus, non-real-time data n u s t be marking an appropriate value in the identifier field of the
transmitted using thc rcsidunl batidwidth that is left after CAN fiame. In the case of event data, the first two bits of
real-time data traIic has bccn sllocated. the 11 bit identifier field are set to ‘00‘. The first two bits of
The bandwidth allocation algoritlim introduced in this conlrol and non-real-time data arc sct to ‘01‘ and ‘IO’,
study satisfies the delay rcquircrncnt of the real-time respecrivcly. Because ’0’ (dominant bit) is dominant to ‘ I ’
control snd event data. In addition, it rnaximiscs the (recessive bir) in tho identifier field, event data have

zyxwvut
utilisatiori of tlic bandwidth of the network mediuin by priority over coiitrol data, and control data take precedcncc
fully utilising the rcsidual bandwidth through which non- ovcr non-real-time data in traiismittitig. This tneans thal

zyxwvut
real-time data are transmitted. In lhc following, tlic abbre-
viations used in this paper are summarised:
M= number of control loops interconncckd into CAN bus
N , = nuinbcr of iiodcs that geiicrate control data
Ne=number of nodes that generate event data
N, = number of nodes that gcncrate non-real-time data
L, =transmission time of control data packet
non-real-limc data cannot be ti-ansinittcd until the real-
time-interval is over, During the non-real-time interval, if
any node generates control data, the network bandwidth is
aulomatically resiiined to the real-tinic interval.
During the real-time interval, control data are trans-
miltcd by incans of n window schcduling algorithm. In
thc window scheduling algorithm. N , nodes dynamically

i =, zyxwvut
L, = tvaiisinissioii time of event dnta packet
L, =transmission time of non-rcal time message at node
[a),, i = I-MI =innxiin~w~allowable loop delay o f control
[i: I-Ne]
loop i
= avcrilgc arrival rate of event data packer at
node i
[Ai!, i = l-.N,J =average arrival rate of non-mal-time
mcssage at node i
[q,i = 1-MI = sanipling interval of control loop i
share thc y ( y 5 N,) windows. Thc window is n time slot
whose length i s identical to L,. To comply with the window
scheduling algorithm, the number of data gcncratcd during
thc real-time interval niwl llot cxceed y , To restrict thc
nurnbcr of saniplerl (or gcneratcd) data within 7, rhe
window schcdiiling algorithm schcdulcs tlic start-of-
sampling instant and sampling interval of each coiitrol
data. Non-real-time data transniittcd through the non-real-
time interval must not trespass on h e rcal-tiinc intcrval.
Thus, the packet transmission time of non-real-time data
Event data and non-real-time messages nsually arrivc at needs to be atljustcd as occasion demands.

zyxwvuts
rmdom, and their typical distribution is not known. In this The basic concept of tlic window sclieduling algorithm
study, the arrival process of event data and non-real-time

zyxwvuts
[5] is briefly summarised in the following. The CAN bus is
incssages is ussutned to have a Poisson distribution. The assumcd to have M control loops. Each control loop is
queuc capacity of control data is restricted to onc bccause assiiined lo havc two data transmitting nodcs; sensor and
the most recently gcneratcd sciisor and controller data must controller. The sensor and coiitroller nodes in the samc
bc transmitted. The queue capacily OF cvcrlt and noti-real- conLrol loop sample their data with an identic.il1 sampliiig
lime data is assumed to be sufficiently large so that no ciatn rate. Thc loop delay is defined from thc instant when the
are rejected due to the owrflow o f the transmitter queue sensor node samples a sensor data to the instant whcn tlic
when the network traffic is srablc. Fig. I shows the basic controller data that is gcncrated using the tagged scnsar
concept of the bandwidth allocation algorithin in the CAN data is completely arrived at tlic actiiator node.
bus. The bandwidth of tlic CAN bus is divided by a time Let us corisidcr a control loop i which samples their data
slot of a macrocyclc which is identical to TI, thc miriiniuni with an interval T, The loop delay is timc-varyiiig because
the network-induced dclay from sensor to controllcr
and finm controller to actuator (Bi,,) is tinie-varying[5]. It
has alrcady bcen stiowri that simply rcplacing U,:, atid
by their suprema could riot be the solution for the design of
I I I I I I I I I I I I I I time-varying dclay sysfems[6]. Let r, be the Mh instant
I l l l l l l l l l l ~ l l l
*M-I*M whcn thc actuator command arrives at the plant. Because
OL(, is tiinc-varying, the interval [tk, rk+,) i s also time-
varying. The effect d tirne-varying delay on thc control
I 1 system is exerted by thc intcrval [ f k , tk,.]) rather than thc
aniouiit of time-mryirig delay itsclf. l h e interval [lk, (,+:.,)
becomes maximum whcn min #i,t2
occurs at the ktIi arrival
followed by inax@$ occurring at ( k + 1)th arrival. ’The
suprcnium of [ak, bk+,) is Ti +(sup O$ - inin &). 111 addi-
tion to the contmllcr-actuator delay, wc nccd to consider
thc sensor-controller dclay. The supremum of Si, is
Thus, the suprcinuin of loop delay hcconies
event data event data event data event data 21;-+(sup Oio - inin U:(,). In lllc window scheduling algo-
Fig. 1 Bur?dwidih dlocaiion iri CAM hirs rithm, every control data item is transmitted within the
3R K E P~OC,-CUIIIIWI
Theory App/., Ynl. 147, No, 1. J n m m y 20DU
zyxwvutsrqp
zyxwvutsrqpo
zyxwvuts
zyxwvutsrqpon
zyxwvutsrqpon
zyxwvutsrq
zyxwvutsrq
macrocycle TI. Thus, sup $,, is TI, arid niin OLQ is L,, the
packet transmission time of the conk01 data. To satisfy the
perforrnancc reequireincnt of the control system, tlic
sampling time of control loop I musi be dctcrmined to
satisfy the -Tollowingcondition:
9 of thc corresponding nodes must be shifted to the next
instant, A,,, . Thus, tj is detcrrnitietl as follows:

where d'(Aj)is the number of sarnplcd data at A , including


The maximum allowable loop delay of each control loop, the sampling at node j .
( i - l-w, is assumed to be known in advance. (1); can l'hc window scheduling algorithm requircs that the
be obtained from the dynamic o f the control loop and a clock of nodcs in thc common medium w e d s to be
modified constant versioii of the originally time-varying synchronised. If the clock of nodes is drifted and the
network-induced delay. skew bctwcen the clack exceeds Tl, mare than y control
Let us define the vectors T and a,whosc cleinents data could be gciicrated during any Ti, and tlic stability
conaist of the wnpliiig intcrval of the ith control loop 2; condition of control data could not be satisfied (see eqn.
(i = 1-A4) antl maximum allowable loop delay (DJj = l-hf), 12). Rodd cl al. ['I]proposed a clock synchronisation
rcspectively : sclicme it) tlic CAN protocol, which is iinplcmented in a
hardware mcthorl. Ciergelcit and Streich [I 01 also prescntctl
a softwairc method of clock synchronisation in which two
clock syiichronisation messages arc Iransniitted succes-
sively. T n this study, it is asvutncd that the local clock of
all nodes in a common mediiim is synchroniscd using

zyxwvutsrq
Vectors T and 0 arc defined in an increasing 0rdcrIi.c. cither R hardware or softwarc method.
Ti 5 TI+,,(1); 5 Tn Fig. 1, T I and T,, arc the minimum As shown in Fig. 1, the rest of z, in T I is allocated to the

zyxwvutsrq
and maximum satnpling intervals among M control loops, traiisniisaion of non-real-time data. In thc bandwidth allo-
respectively. cation algorithm, coiitrol data hmvc priority over non-red-
In thc real-timc interval, tlic window scheduling algo- time data. Thus, if any node begins to [ranstnit control data,
rithm deterrnincs Ti(i= I-M). Couiiting the timc-varying the non-real-time interval T , , i s aiitoinatically suspended.
characteristic of the nctwork-induced delay of control data, However, if a non-real-time data item is bcilig transmitted
TI is detcrinined from eqri. I as TI =((Dl +L,)/3 beforc- at the instant A , when control data arc sanipled, tmnsmis-
hand. Sanipling timc Ti (i = 2-M) of the rest of the control sion of thc non-real-time data must bc completed. Let us
loops is determincd such that the number of datu generated consider the extremc case when thc non-real-timc interval
during the real-timc interval inust not cxceed y. Lct aK be is shrunken such that only onc non-real-time data pacltct
the average number of data genonled froin N, nodes can bc transtnittcd. 11' the transmission time of non-real-
during Ti, i.e. time data packcl L, excccrls TI z,, 2, trespasses on T ~
~ .
Thus, if' the transmission time o f non-real-timc data is
longer tlian the tnaxinium packet transmission time (timc
to transmit a maxiniuin size frame that consists of 130 bits
itwludiug worst-casc stuffing bics a i d inter-frame spucc),
I,,, must be restricted as follows:
whcrc k, = Ti/3',.Try : [ a K ]aiid
, the sampling intervals TI,
i = 1 to N,, arc integer multiples of each other, thcn all the
data generatcd diiring any interval of T.K (thc largest
sampling time consisting of kJMof the T, imacrocycles)
Far the traffic of the CAN bus system to be stable, the data
can bc accomniodated by the windows offered during the
arrival rate must be restricted to the extent that does not
same interval of T,. Tu satisfy the pcrrormnncc require- exwcd network capacity. 'I'hc stability condition of cvoiit

zyxwvutsr
metit o f the control system, Ti must also satisfy the
data and non-real-timc data can be obtained by a slight
condition given in eqn I . Thns, T, siiouId be dctcrrniiied
inodificatioii of the rcsults from Tbc and Cheng [l 11, who
as follows:
prescii~cd the stability cotidition using tlic concept of
station backlog. In this study, arrival rates of evcnt data

zyxwvut
packets antl iim-real-time data are assumed to have a
Poisson distribution. livcnl data are lransinitted with the
highest priority, antl thcir transmission is not infliiciiced by
whcrc y = { x } dcnofes that y is D. power of two, 2*1, the transmission o f control aiid non-real-time dlta.
ni E {O,l,Z,.. .I, which is the closest to but does not Consider the uvcrage nnmbcr of event data that arrivc at
excccd, x). This ensures that the sampling intervals of iw a node i over P very long timc intelval o f 1. For thc
control loops are integer iniiltiples or each other. Tlic queucing system to be stable, tho time requircd to serve
cxisting protocols such as Profibus-PA [7] and TCN[8] all of those data must be, on average, sinaller than t. Since
already adopt this relationship for periodic data. tl?e avcrage number of data packcts that arrive during t is
In Fig. 1, A,(1 = 1-M) is the first instant of tlic Ah l', slot j&l, thc time requircd to transmit all these data packets at
within T,. Jn the window schcduling algorithm, thc no& i is (>$)Le. Now consider the timc required to
number of data generated st A, must nut cxceed y. To traiismit event data from other nodes during 1. For a node
guarantee this requiremcnt, the window schcduling algo- j ( f i),the avcrage,nutnbcr of data packets that arc trans-
rithm schedules not only h e sampling interval but also the mitted during f is &, if &f < .@, or A:t data packets among
start-of-sampling instant a.(] = 1 -Nc) of each control data the arrivtlls to node j , othorwise. 'rhus, the time required to
J
item, From j = l-Nc, 9 IS assigned to A, starting from transmit cvcnt data, from other nudcs during t bccomes L,
I = 1-M. If thc number o f assignments at A , excccds y , thcn min[ALt, 2'4. For thc cvcnt data quciic at iiodc i to
i'mc.-Confru!7 h r y Apppb. Yo/. 147, No. 1. .Iflnirur)l 2000 39
zyxwvuts
zyxwvutsrq
be stable, all the data that arrive in the tinic of length 6 must
be transmitted in a linic < t, i.e.
Lct 11s consider the stability condition of contrnl data. As
shown in Fig. 1, the event dala cilii be transmitted during a
real-time interval, and the real-time interval must not

zyxwvu
exceed T I . In the practical manufacturing automation and

zyxwvutsrq
process control syslcms, cvent data arc not SO- frequently
gencratcd compared to the control data [12]. The prob-

zyxwvutsrq
For the network systcm to be stable, all thc transmitter ability that n event data arc gcncrated during TI is
qucucs in the network systcm innst be stable. If tlie
trnnsniiltcr queue with the highest arrival rate of event
data i s stable, all the transmitter queues of event data in the
network systcm become stable. Thus, the stability contli- For inslance, when TI = 1Oms and J,L=O.O1 ms-', the
tion of event data becomes probability that 1 I O event data arc generated during T,
is 7.89 x Ti1 this study, it is assumed that the
maximum nunibcr o f event data that can be generated

zyxwvutsrqpon
(9)
from all nodes during T, is restricted to ni, which is
predctcrtnined such that thc probability of z F I , cvent
Non-real-limc messages are usually scginented into several data being generated during TI is sufficiently small. If
packets, and inscrrcd into the transiniltcr queue. These yl;,+nil,r TI, some control data will not be trans-
packets are ti-ansinittcd one by one, and rcassembled at mitted within TI, and rejected from the transmiltcr
the destination node. If the arrival rate of non-real-time queue due to thc overflow of qucue capacity. Thus,
niessages at node iis Ai, and it is segmented to p i packcts, the probabilistic stability condition of control data is
the average number of non-real-time data,packets gcncratcd given as follows:
per unit tiinc at node I becomes Ai =p,Ab, A non-real-time
data packet is traiisinitted with the lowest priority, and it is yLc -I-n,L, 5 r, (12)
influenced by the transmission of event and control data. Bccausc the stability coiidition of event data givcn in eqn.

zyxwvutsrq
Lct us also consider the avcragc number of non-rcal-time 9 is included in eqn. 11, the CAN bus which ellcompasses
[lata packets that arrive at a node i over a veiy long period of event, conlrof and non-real-time data must satisfy the
t. For the queueing system to bc stable, the time requircd to stability conditions given in cqns. 11 and 12, simulta-
transmit all of these data must be, 011 thc avcrage, shorter neously. The bandwidth nllocation algorithm it1 the CAN
than t. Since the avcragc number of data packcts that arrive protocol is suinmariscd in the following.
during t is A:$, the timc vcquired to transmit all these data
packcts becomes (A;&, Lct us colisider the t h e rcquired
to transinit non-real-time data froin other nodes during t .
For a nadcj( # i), datapackcts are transmitted if a$ < ?:f,
or A;! data packcts are transmitted ainoiig the arrivals to Stop I ; Determine the sainpling time T, of tlic control data.
noded, oihcrwisc. Thus, the time rcquircd to transmit non- Let ml = min[cb,, i= 1-M]
real-time data froin other nodes during I becomes
L,, x21J+iinin[&r, In addition, wc nccd to consider i; = 3
@I+-%
the time required to transmit control data during t. The
number of niacrocycles TI during t is ( t / T l ) . The avcragc
number of control data gencratcd during T, is
uK = zzl T./Tl. It takes a&, on average, to transmit
control data during the tiinc frame of TI, and thus the
time requircd to transmit coiitrol data during t becomes (tl
T I ) ~ K I , cFinally,
, Ict us consider the liinc required to
transmit event data during 6. It the arrival ratc o f event
data at node k is 1-1, thc number of event data transmitted ?= r'Kl
during 6 becomes I$. Thus, thc time required to transmit
event data during t becomes Le :z,Atf. For the non-rcal- If yLC + nlLe > .TI, then
time data quciic at node i to be slablc, all the data packets
(control data traffic is ovcrlonded

zyxwvuts
zyxwvutsrq
that arrive during t must bc transmitted in a time < t, i.e.
3 rcdiice M or N, : goto Stcp I )

-t(I/Tl)ol,L, + L e zyxwvutsrqp
N,
k= 1

For the network system to be stable, all the transmitter


qucues in the network system must bc stable. If tlie
1;t < f (IO)
else
Ti= kiT,
Step 2: Dctcrmine the Brsl sampling insrants r j o f control
data.
Let tl = A , = 0
For(j=2; l = l ; j s N c , / 5 k M ; j = j + l ,l = l + I )
lransmitter queue with the highest arrival ratc of non-
real-timc data is stable, all tlic transmitter queues in thc fI = inf[Al 3 A ! - ] ; id&) 5 71
network syslcm become stable. Thus, the stability condi-
tion of a network system becomes Step 3: Determine thc packet length of non-real-time
data.
N
If L,, > 2'1 - (YL, + +,), thcll
L, = TI - w,+ n,L,)
40 IEE Proc.-Conanl Theor, Appl, Yol. 147. No. 1. h n u u r y 2000
Let zyxwvutsrqponm
zyxwvutsrq
zyxwvutsrqponm
zyxwvutsrq
zyxwvutsrqpo
zyxwvutsr
zyxw
zyxwvutsrqpon
zyxwvutsrqp
zyxwvutsrqp
Ai =pjAi
L J T , tL, ~;:~a;?
C&&+-(CI~
reduce N , or iV, : goto Step 3 )
End
4 Simulation results and analysis
I , thcll
(event or non-real-~imcdata traffic is overloaded +
The CAN bus has 15 nodes and 20 data transmitter queues.
The number of control, cvent and non-real-time queucs is
10, 5 and 5 , respectively (N,= 10, N e = 5, iv, =5). In
Table I , Remark indicates thc direction OF data flow from
sourcc to destination.
As shown in Table 1 , the priority of the frame identifier
is granted to the order OF event data, control data and non-
rcal-timc data. With regard ID the control loops, control
In this Section, thc bandwidth allocation algorithm in the loop 5 is granted to tlic highest priority, and control loop I
CAN protocol is validaled using thc simulation expcriment. is thc lowest priority. Thc capacity of the control data
The network system is classified as a discrcte-event system transmitter queuc is limited to one, and that of event and
whercthe state ofthe systcm is changedwith the occurrence non-real-time data transmitter qucucs is sufficiently large
of events. Thus, the CAN simulation model is dcveloped so that no data are rejected duc to overflow of the
using SIMAWARENA [ 131, which is the dcvelopmcnt tool transmitter qucuc. The data rate n of the CAN bus is scl
for the simulation model of discrcte-evcnt systcins. to 125 KWs.
In the simulation model, tlic CAN bus is assumed to Scnsor data and control signals are periodically gcner-
comprise five control loops (M= 5 ) . Each control loop has atcd in each control loop. The length of coiiirol data is
t h e e nodes: sensor, controllcr and actuator. Table 1 shows assumed In be 8 bytes, which is the maximum length of il
the configuration of each node in the siinulation model. data packet. The total length of control data is 130 bits,
Node groups (I, 2 , 1 I), (3, 4, U ) ,(5, 6$ 131, (7, 8, 14) and iiiclurling overhead, worgl-case stuffing bits and inter-frame
(9, 10, 15) belong to the control loops 1, 2, 3, 4 and 5 , space (3 hits), and thc packct transmissioii timc L, is
respectively. In Table I , data typcs 1, 2 and 3 represent 1.04ins. The sensar node in each control loop also trans-
evcnt, control and non-real-timc data, respectively, Sensor inits monitoring data to thc supervisory controllcr nodc.
nodes 2, 4, 6, 8 and 10 have two transmitter queues for The interarrival time oC monitoring data is lOms
control and cvcnt data. controller nodes 1 , 3 , 5, 7 and 9 (2= 0.1 ms-'), on Rveragc, with thc exponential distribu-
also have two transmitter queucs For control and non-real- tion (this is intciitionally highly imposed traffic load). The
tiinc data. Actuator nodcs 11, 12, 13, 14 and 15 have tlic length of event data is assuined to bc 2 bytes bccause event
reccivcr queue only and do not have a transmitter queue. data usually transmit a limited amount of infomation. The

Table 1: Canftguratlan of nodes in simulation model


Control Node Data Frame Node Data Data Remark
loop identifier no bPe iength
-
Sensor Sensor data 01001001000
2
2 B bytes sensor I + controller 2
Monitoring data 00001001000 1 2bytes Sensor I -+ supervisory
1 Actuator - - 11 - - -
Control signal 01001010000 2 8 bytes controller 2 --> actuator 11
Controller 1
File 10001010000 3 30K bytes controller 2 -. supewisory

Sensor data 01000111000 2 8 bytes sensor 3 i controller 4


Sensor 4

2 Actuator
Controller

Ssnsor
I

Fite zyxwvutsrqp
Monitoring data

Control signal

Ssnsor data
Monitoring data
-
oooooi I iooa

01001000000
10001000000

01000101000
00000101000
12

6
-
1

2
3

2
1
2 bytes
I

8 bytes
30K bytes

a bytes
2 bytes
-
sensor 3 --+ supervisory

controller 4 -> actuator 12


controller 4 i supervisory

sensor 5
sensor 5
--t

i
controller 6
supervisory
3 Actuator - - 13 - - -
Conirol signal oioaoiiooao 2 8 bytes controller B -+ actuator 13
Controller 5
File iooooiiooao 3 30 K b y b s controller 6 + supervisory

Sensor
Sensor data 01000011000
8
2 a bytes sensor 7 -+ controllar 8
Moniloring data oooooo1iooa 1 2 bytes sensor7 --t supervisory

4 Actuator - - 14 - - -
Controller Control signal oioooiaoaoo 7
2 8 bytes controller 8 -> actuator 14
File 100~0100000 3 30K bytes controller 8 -> supervisory

Sensor data 01000001 000 2 8 bytes sensor 9 ~f controller 10


Sensor 10
MonitorinQ data ooooooaiooo 1 2 bytes sensor 9 --f supervisory
5 Actuator - - 15 - - -

Controller Control signal oiaaooioooo 9


2 8 bytes controller 10 -3 actuator 15
File iooooaioooo 3 30K bytes controller 10 3 supervisory
-
4L
zyxwvutsrq
zyxwvut
zyxwvutsrqp
zyxwvutsrq
total length of event data i s 73 bits, including overhead,
worst-case stuffing bits and inter-frame spacc, and the
packct trnnsinission time L, is 0.584 111s.The controIler
iiodc in each control loop is assumcd to trnnsmit Lilc dntn to
the supervisory controller node. The lcngtli of non-real-
time data is assiimed to bc 30 KH. In the practical cmc, file
bus adopts tlie bandwidth allocation algorithm introduced
i n Chapter 3 . The traffic condition of ‘Nonalgorithm’ is the
sanie as that of Algorithm (11s given in Table 1). Howevcr,
Nonalgorithm docs not count tlic first sainpliiig instants of
control data (i.e. ti = 0 ms, i = l.-Nc), and thus it does not
folIow Ihc bandwidth allocrttion algorithm. ‘Rejcctcd data
data are dclivered from thc upper layer. and packetiscd d o ’ in Table 2 iiidicatcs the ratio of the numbcr of
before bcirig transmitted. In this study, thc arrival of a non- rejected data out of tlic number nP genernted data, where
rcal-time data packej is morlcllcd such that its iiiterarrival the rejeclcd data means thc d a h rejectcd at the trsnsmittcr
time is 17.065 ins (1;= 0.0586 ins-”), oil avcragc, with the queue due to the overflow o f queue capacity.

zyxwvutsrqp
zyxwvu
exponential distribution. The supcrvisory controller node lhble 2 shows that thc average and innximum data
is assumed not to gcncrate any message, a n d the actuator lalencics of event data are alinnst identicaI in both cases

zyxwvuts
node in each control loop also only rcccives nnd docs not

zyxwvutsr
zyxwvuts
zyxwvutsrqpo
transmit its data. In this cxample, it is assumed that rhc
maximum dlowahlc delay of cvcnt data (11; is 10 ins. The

&?,m4, mS,] = [29 m8,60 ms, 120 ms, 240 ms, 480 ins].
From Slcp 1 o f the algorithm given in Chaptcr 3, (Dl aiitl
TI are determined as 29111s and IOms, rcspcctively, a i d
[ k , , k2, k,, k4, c 5 ] = [ I , 2: 4, 8, 161. The averagc number of
control data sanipled from five control loops during TI is
bccausc the event d a h are traiisinitted with the highest
priority. The inaximiiin dstn latciicy of event data is
3.93 ins, which is smaller than its maxiinum allowable data
inaxim~inmloop dclay of five control loops is given as [O!, latciicy of 1Onis. Tn the case ofcontrol data, maximum dala
latency in the Algorithm is 0.59ms. It does nnt cxceed the
miniintiin sampling iiilcrval T I = loins, and no data arc
rejected. In the case o r Natialgorithin, however, the maxi-
inuin data latency of control data bccomes 1 4 3 1 ins
( > IOms), and 19 (oiit nf 474) data arc rejected in thc
aK = 3.875! and the nutriber of‘ windows in tlic real-time transmitter quciie. Data latciicy of non-rcal-time data docs
intervol is y=4. In this cxample, it. is assumed to bc not have significant meaning in the performance analysis of
required that the probability that more than ni avciit data thc CAN bus. No non-real-time data are rejoctcd bccause the
are gencratcd during T , = 10ms must bc < 5 x IO-’, and trafic condition is stable. Table 2 shows that thc bandwidth
nt is dctcrinined ns IO. Bccmse yL, + n J c 5 TI, the traffic allocation algorithm introdiiced in this study restricts the
of control data is probobilistically stable. Thc vector of dclny of went and controf data to a prespccified litnit at the
sampling time in thc five control loops is [TI, T,, T,, T,, cxpense of increasing the dclay of non-rcal-time data thal
T,]=[lOms, 20ms, 40tns, 80ms, IciOnis]. From Stcp 2, docs not influeiicc thc perforinancc of application systems.
tlic first sampling instant ofcontrol data imin nodes 1-10 Tablc 3 shows the simulntion results wlieii thc traffic
is determined as [ L , ,t,, 13, t,, t 5 , &, f,, Is, t9, t l o ]=[Oms, condition is identical to thc previous cuse (as given in
Oms, Oms, Oms, IOms, IOins, 30ms, 30 ms, 701ns, Ttible l), but thc data rate i s rctiiiced to 100 KB/s. 111 this
70 ins]. From Slcp 3, 7’, - (YL, -f- n,L,) is larger ilian the CBSC, tlie s,tabiIity condition givcn in the algorithm becomes
,v
transinission time ofthc iliaximum packet length ( 1 30 bits) ‘ / ’ ~rk:,14
I.,, x f k , p n+ ( M ~ L ~ ) /+L,, = 1.249 > I , and the
of the CAN protocol. Thus, the transmission time O ~ non- R traffic load exceeds the capacity o f the network bandwidth.
real-time data packct is determincd as L,, = 1.04 m s . Table 3 shows thnl thc cffixt of the iiicrcment o f trnrfic lorid
Because ~2~1-t +
I,,,
N
+ ( E ~ L , ) / T , C, C k ; l ~=0.9997
a is mainly exerted on the non-rcal-time data which has the
i1, the traffic of the nctwork system i s stable, and the lowest priority class. Because the network system is
nctwork bandwidth is nlmost fully iitilised. unstable, noli-real-time data are rejected at the transmitter
Table 2 shows thc results obtaiiicd from the simulation queue (in this siinulation analysis, the qticue capacity of
inodd. In Table 2 , ‘Algorithm’ is thc results when CAN non-rcal-tiine dals is set to 133). However, lhc maximum

Table 2: Performance comparison of algorithm and nonalgorlthm (B= 125 KBls)


Average data latency, Maximum data latency, Rejected data ratio
ms ms (rejectiodgeneration)

Algorithm Non- Algorithm Non- Algorithm Nan-


algorithm algorithm algorithm

Event data 1.13 1.18 3.93 3,93 01603 0/613


Control data 3.18 4.13 9.59 14.81 01470 19/474
Non-real-time 40.62 14.17 764.00 156.97 01354 0/35 1

Table 3: Performance comparlsan of algorlthm and nonalgorithm ( B = 100 KBls]

Average data latency, Maximum data latency, Rejected data ratio


ms MS (rejection/generatian)
__ c

Algorithm Non- Algorithm Non- Algorithm Non-


algorithm algorithm algorithm

Event data 1.55 1.54 4.92 4.92 ma3 01614


Control data 4.29 5.97 9.99 21 2 0 01470 46f474
Non-real-time - I - I 2251354 183/349

42
zyxwvutsrqp
zyxwvutsrq
zyxwvutsrq
zyxwvutsrqpo
data latency of evcnt data i s still smaller than its maximum
allowable data latency or IOnis, and no event data arc
rejectcd. In the case whcn the bandwidth allocation algo-
rithm is applied, the maximum data latency of control data
is 9.99ms, which is still snider than thc maxirniiin
250 r

200

allowablc delay o f IOms, and ti0 cunkol data are rcjccted.

zyxwvutsrq
Thus, tlic bandwidth allocation algorithm satisfics the
perfarmaim rcquiremcnl of evcot and control data even
though the ti affic condition is ovcrlo~dedto soinc extent.
'Thc effect ol' the rciectioti of control data on thc
pcrlbrmancc of feedback control systcin is ill ustrnted in
thc following. Control loop I consists or tiodcs 1 mid 2 ,
The trnnsfcr function of plant at nodc 2 is wlccted as

zyxwvut
I 50
G,,(s) = -
+
(0.3s 4- 1)(0.03#7 I)
and the analoguc cquivulcrice of tlic trsnsfcr fiinction of a
digital controllcr at nodc I is
7(s t 5 )
C,(S) = --
s

zyxwv
where s is the :+lace traiislbrmiltion variable. Fig. 2
shows the pcrrorinancc comparison af Algorithm and
Nonalgorithm when W = 125 KWs. As shown in Table 2,
several control data ai'c rejected in tlic case of Non-
algorithm. This d m rcjectiun lcads to jittcr in thc control-
Icr signal, which causes high frcqucricy iioisc in the
actuator coininand lcading to cxcessivc wear of tlic actua-
tor. Thc rcsponsc of plant output is also retardcd, and the
performance is ;ilso degradcd.
In this Seciion, the stability condition of thc network
system givcn in eqn. 1 I of Section 3 is vcrilied using thc
siniuhtioii cxperitncnt. Fig. 3 shows thc changc in the

zy
niimber of waiting nzassagcs in tlic non-real-rime data
transmitter qiicuc for difrerent arrival rutcs of non-renl-
time data. The traftic loads nT event and control datn are
given RS thc abovc cxainplc and /I= 125 KWs. Fig. 3

tims, ms
8 zyxwvutsrqponm sliows that the ntuiilber of w a i h g riicssages is cventually
stabilised when %! is < 0.0586 ms- I. Howcvcr, whcn
A{! > 0.0586ms-', the number o f waiting niessagcs is
iticreascd as tinic elapses, atid the CAN bas system
bccomes unstable.
Thc examplc given in this Section consists of il rclarively
small numhcr of nndcs with intetisc tral'fc load at cach
node. Iivcn though the rniniber of i d e s is incrcased, the
bandwidlh allocalion algorithm iiitrodiicerl in this study
can bc readily applicablc providcd that thc stability condi-
tions givcii in eqtis. 1 1 and 12 are satislied.

5 Conclusions

The CAN is a network protocol that supports cninniiinica-


(ion among field deviccs in the distributcd control and
automation systcms. Uata genertltcd from ficld deviccs arc
classifcrl into three cutcgories o r control, went and non-
real-time diita. The cxcessive data Iattcncy of cvciit aiid
control data can degrade thc pcrformiuicc of application
syskins intcrconnectcrl to tlic CAN bus. This study intro-
duces a bnndwidlh aliocatiotz algoriihm in thc CAN bus.
'I'he bandwidth allocation algorithm satisfies the p c r b
Inance rcqiiirenient or red-time applicatioii systcms as well
as fully utilising Bic bandwidth of the CAN bus. Tlic
bandwidth allocation algorithm is vcriiicd using the simu-
lution inodcl that integrates tiic discrctc-event niodel,of the
41
zyxwvutsr
zyxwvutsrqpon
zyxwvut
zyxw
zyxw
zyxwvuts
CAN protocol and ihc continuous-time model of a feed-
back control system. The bandwidth allocation algorithni
area network for real-time CIM applicnlions’, ELL‘ Trurrs. Robufics
A t t i t m , 1997, 13,(Z), pp. 310-314
3 CENA, G,, aatl’VALENZANO,A.: ‘An iinpmvcd CAN fieldbus for

zyxwvu
introduced in this study can be effectivzly utilised in the industrial applicatioii’, /ERE Tram. Ind Necmt., 1997, 44, (4), p p
design and implementation phase of distribntcd real-time 553-564

zyxw
zyxwvutsrq
4 TINUELL, K.W, HANSSON, Id., and WELLINGS, AA: ‘Calculnting

zyxwvu
control and automation systems that use CAN protacol. cnn~rollerarea nctwork (CAN) inessagc rcsponse times’, Co,trml Etig
The bandwidth allocation schenic introduced in this study Arrcl., Ig95, 3, pp. 1163-1 1611
5 HONG, S.H.: ‘Sclietluliiig algorithm of data sampling times in the
is based on thc pre-run-time schcduling. For fulure work, itiicgrated caminuiiication and COlltrDl systems', i E E E Trarrr. Conrtnl.
the dynamic scheduling scheme needs to be investigated. Sys% Iechnoi., 1995, 3, (2), pp. 225-230
6 HIRAI. K.,and SATTOH, Y.:‘Stabilitv of il system with variablc time
delny’, I i X E TWJWA u k “ ConimL, 5980, AC-25, (6), pp, 552-554
7 ‘PROFIBUS-PA Plnfile for Pmccss Control Deviccs Class R. PROFI-
6 Acknowledgments BUS Technical Giiidclinc’ (PROFIBUS Nutzcrorgiinisfltion c.2, 1946)
8 “ E N (Train Communicatiua Network)’. IkC project 1375, refmencc 9/
This work was funded by the Korea Elcctric Power 4131FDIS. TEC. Gcncva. 1996
9 ItODD, h.i.G.,DrMYATl, K., and MOTUS, L.: ‘The design and analysis
Corporation and superintcndcd by the Eleclrical Bngineer- uflow-cost rcal-liinefieldbus systcmfi’,ConWdilnp, Pmcl,, 1985,6,(I),
ing and Science Research Iiistitute (no. 97-0851,to whom pp. 83-91
10 GERGLL61T, M.,mid STRMCH, H.: ‘Impleinciitinp il distributed high-
the authors are gratefully indebted. resolution rcal-time clock using thc CAN-Bus’, Intcmarioiinl CAN-
ConferenGe 94, Scptcmbcr 1994, Mninz
I 1 IBL, O.C., aiztl CAENG, X.: ‘Stability cotiditions for multiqueuc
7 References systems with cyclic scrvice’, I E W IFwrrs. Air/om. Conlid, 1918, 33,
pp. 102-103
1 CAN, International Siandard 11898, : ‘Road Vehicles -1nteitliangc of 12 BENDER, K.:‘PRONBIJS -The fieldbus Tor industrinl automation’
Digital Infn~nnation-ConlmllcrArcn Network for Iligli-Spccd Coniinu. (Carl Hanscr Verlug and Prcniice Hnll, 1993)
nicntion’ (KO,1993) 13 PEGDEN, C.G., SHANNON, R.E., and SADOWSKI, R.P.: ‘Introduc-
2 EUBERI, K.M,, and SIIIN, K.G.: ‘Schetluhog messagc on controller tion to simulatioii iising SIMAN’ (McGnw-I-Iill, 1995)

44

You might also like