Sunteți pe pagina 1din 4

2010 2nd International Conference on Industrial Mechatronics and Automation

Design of CAN Bus Application Layer Protocol for


Aerocraft Control System

Hongwei Zhang, Hongguang Jia, Yue Zhang Wenjuan Zhang


Changchun institute of optics, fine mechanics and physics, Department of Physics
Chinese Academy of Sciences Northeast Normal University
Changchun, Jilin Changchun, Jilin
E-mail: Zhanghw135@163.com E-mail: Zhangwj979@163.com

Abstract-A special Controller Area Network (CAN) bus CAN bus specification which ensure correct data transmission
application layer protocol is designed for the highly reliable among nodes on the bus [4], [5]. However, in addition to the
communication of microcomputer-based systems in aerocraft basic two services, supports of more services are needed in
control system by analyzing the practical time sequence of data actual multi-node data communication application situation,
transmission, data priority, data type and data function etc in which can be defmed in an application protocol.
this paper. Identifier distribution, data storage form, data type,
data exchange method and fault handling mechanism of the The application protocol can be self-defined or choose a
application layer protocol are specified in detail in the standard protocol of international organizations such as
background of a real aerocraft control system. At last a CANopen or CANaerospace. Considering the complex
simulation platform based on CAN bus for aerocraft control structure of international standard protocol, the special working
system is built to validate the design. Experimental results show environment and the security of aerocraft, a self-designed
that this application layer protocol meets the requirements of application layer protocol is chosen in this paper.
data transmission reliability, real-time and high efficiency. The
bus load rate is low and there is great room for expansion. II. AEROCRAFT CONTROL SYSTEM VIA CAN
Taken a real aerocraft control system based on CAN bus as
Index Terms-C AN Bus, Application Layer Protocol,
Aerocraft Control System, Identifier, priority, Fault Handling
an example, the internal structure is shown in Fig. 1. The CAN
bus network consists of a ground test node and 12 subsystem
I. INTRODUCTION nodes which are connected together by shielded twisted pair.
When the bus is idle, any connected node may start to transmit
The Controller Area Network (CAN) bus originated in the
a message, and then the other nodes are able to decide whether
20th century early 80s. which is widely applied in automotive the data are to be acted upon or not by message filtering.
and industrial fields [1], [2], becomes a focus in aerocraft field
depending on high reliability, hard real-time, high bus The bus topology of the CAN network should be adopt, the
utilization ratio and simple hardware connection mechanism length of branch line should be less than 30cm and the distance
etc [3]. between two adjacent nodes should be more than 10cm in the
practical networking process, which may reduce the branch
Only data link layer and physical layer are defined in the signal reflection. Two 120n resistances are needed on the
Airborne Inertia l Navigation Yaw Yaw Aileron Aileron
Computer Computer At
c ua tor 2 c ua tor 4
At At
c ua tor 2 At
c ua tor 4
PC/104 DSP2812 DSP2812 DSP2812 DSP2812 DSP281 2
System System System System System System
CAN CAN CAN CAN CAN CAN

CAN Bu s I I I I I I CANH
� Rl R2

I I I I I I I
CANL

CAN CAN CAN CAN CAN CAN CAN


DSP2812 DSP2812 DSP2812 DSP2812 DSP2812 DSP2812
Computer
System System System System System System
Data Pltchmg Pltchmg Aileron Aileron Grou nd Test
Seeker
Rec order Actuator 1 Ac tua tor 3 Actuator 1 Actuator 3 System
Figure 1. The internal structure of the aerocraft control system.

164
978-1-4244-7656-5/10/$26.00 mOlO IEEE ICIMA2010
TABLEr. MESSAGE IDENTIFIER ALLOCATION SCHEME TABLE III. TARGET NODE DEFINITION

1024 1024
Distributiou 10 Meanings Target Node Target Node
-1020 -1020

lO28 to lO25 Message Type 00000 All Nodes 1000 1 Yaw Actuator 4
lO24 to lO20 Target Node 00 100 Aerocraft computer 100 1 1 Aileron Actuator I
lOI9 to lO 13 Message Function 00 1 1 1 Inertial Navigation Computer 10 100 Aileron Actuator 2
lOI2 to lOlO Frame Type 0 1000 Seeker 10 10 1 Aileron Actuator 3
lO9 to lOO Reserved 0 1 1 10 Pitching Actuator I 10 1 10 Aileron Actuator 4
RTR Remote Frame 01111 Pitching Actuator 3 1 100 1 Data Recorder
DO to D7 Data Field 10000 Yaw Actuator 2 1 1 1 10 Ground Test System

terminal of the bus which can reduce the signal refection and of the bus performance and efficiency.
increase anti-interference ability and reliability.
According to the bit arbitration mechanism of CAN bus, it
Data transmission among the subsystems of the aerocraft is known that the smaller value of the message identifier the
control system may be monitored easily by adopting CAN bus higher priority it has. Extended frame format containing 29-bit
technology. All the data transmitted on the bus will be stored identifier is adopted in this protocol. The allocation scheme of
only by a data recorder which can provide experimental data the message identifier is shown in Table I:
for the post-processing and a basis to fmd the causes of fault in
Four bits of the identifier from ID28 to ID25 are used to
future. It is also beneficial to test and analyze the current state
defme the message type. The defmition is shown in Table II:
of the aerocraft control system on the ground. The ground test
node is connected to the CAN bus network simply by a CAN As shown in Table II, Broadcast command frame is
repeater which is used for extending the distance of CAN accepted by all nodes and command frame is accepted by one
communication, and then all the subsystems of the aerocraft node. Acknowledgment of command Frame is the response of
can be remotely tested [6]. the receiving node which accepts the command frame. Notice
frame is used to transmit data and remote frame is used to
III. THE DESIGN OF ApPLICATION LAYER PROTOCOL
request another node to send the relevant data. Test command
CAN bus can be divided into physical layer and data link frame is transmitted to one node with a test instruction and
layer according to the ISO reference standard model for open acknowledgment of test command frame is the response. Start
systems interconnection (OSI). But only basic two services in notice frame is sent by the node which has started completely.
practical application are not enough, such as, sending more
The priority of the broadcast command frame is the highest
than eight bytes data block and establishing a key message
and the start notice frame is the lowest in this protocol.
response mechanism. Therefore, an application layer protocol
is needed to support other services. A self-made CAN bus Five bits of the identifier from ID24 to ID20 are used to
application layer protocol for aerocraft control system is define target node that shows the aim to which the message is
designed in this paper for the special requirements of sent. According to different priorities of the subsystems, the
confidentiality and pertinence. Due to fixed-priority scheduling detailed defmition of target node for aerocraft control system is
algorithm adopted in data transmission of CAN bus, the signal shown in Table III:
transmission is unpredictable. A reasonable application layer
Seven bits of the identifier from ID19 to ID13 are used to
protocol must ensure the correct time sequence of data
defme the specific functions of the message frame.
transmission and a short waiting delay time for each message.
It is known that eight bytes data may be sent at most in one
Identifier distribution, data storage form, data type, data
message frame on CAN bus. But for more than eight bytes data
exchange method and fault handling mechanism are introduced
block, a multi-frame transmission mode is designed in this
in the application layer protocol [7].
protocol. Three bits from ID12 to IDlO are used to define
A. Message identifier distribution frame type which is shown in Table IV. By encoding these
The CAN message identifier is used to define the meanings three bits, a single frame mode or multi-frame mode may be
and priority of data. Establishing a reasonable and efficient chosen.
identifier distribution scheme is a precondition to make full use

TABLE II. MESSAGE TYPE DEFINITION TABLE IV. FRAME TYPE DEFINITION

1028-1025 Message Type 1012-1010 Explanations

0000 Broadcast Command Frame 000 Single frame


00 1 1 Command Frame 00 1 The First frame of the data block
0 100 Acknowledgment Of Command Frame 0 10 The Second frame of the data block
1000 Notice Frame or Remote Frame 011 The Third frame o f the data block
1 100 Test Command Frame 100 The Fourth frame of the data block
1 10 1 Acknowledgment Of Test Command Frame 10 1 The Fifth frame of the data block
1111 Start Notice Frame 1 10 The Sixth frame of the data block
III The End frame of the data block

165
unsuccessfully may be retransmitted automatically twice
TABLE V. DATA ENCODING FORMAT DEFINITION
at most so that the other lower priority message frames are

I�I�I� I I I
D D D D D able to be transmitted with short delay time.
Data Field
0 4 5 6 7
2) Key frame time monitoring mechanism is defined for the
Float Data (4 byte s ) N one
receiving node. Key frame is a message containing
Intege r Data (4l>yte s ) N one
Data Type important data which are directly related to aerocraft
Dou ble Data (8 byte s )
And Location working process. For example, an actuator deflexion
I
Byte Data N one
command frame is sent by aercraft computer to aileron
(l byte)
actuator at each system control period during the flight
B. Data storage form and data type definition process of the aerocraft. The timer of aileron actuator
system, which is restarted after receiving an
CAN bus is a multi-master network. When the bus is free,
acknowledgement frame sent by aerocraft computer, is set
any node can send a message and other nodes may accept the
to two system control periods. The aileron actuator
correlative message depending on the message filtering
maintains the current status if not receiving the command
mechanism. In order to ensure data decoding correctly by all
frame after two system control periods. When the
nodes, an uniform format of data encoding should be adopted.
deflexion command frame is received again, it switches
According to various data types used in the aerocraft into the normal instruction tracing mode.
control system, the data encoding format are defmed in
Table V: IV. EXPERIMENTS

To validate the correctness of the application layer protocol,


C. Data Exchange Methods
a simulation platform for aerocraft control system via CAN bus
In order to ensure the accuracy and high efficiency of data is built.
transmission, the following three data exchange methods are
used in the protocol: The platform mainly consists of three DSP2812
experimental boards which simulate inertial navigation
I) Production / consumption mode computer, seeker and data recorder respectively, a PC/104
A producer that is sending data node and one or more embedded system which simulates aerocraft computer, eight
consumers that are receiving data nodes are included in this DSP2812 experiment boards and eight actuator mechanical
mode. It is the default mode of CAN bus that a message is sent models which simulate four aileron actuators, two Pitching
to CAN bus by a node and all the other nodes decide to accept Actuators and two jaw actuators, a CANOE software platform
or not by message filtering mechanism. which is used to record and analyze the transmission message
on bus and a special CAN bus cable which is produced by
2) Remote request mode (master/slave mode)
LAPP GROUP in Germany. Bus baud rate in the experiment is
Remote frame is supported in this protocol for master/slave
IMbps and the control period of the aerocraft control system is
actions. The slave node responses a message frame containing
IOms.
remote request data with the same ID of the remote request
frame which is sent by a master node. This mode is mainly In a single control period, Firstly, aerocraft computer sends
used for information acquisition. For example, aerocraft a remote frame to inertial navigation computer which feeds
computer sends a remote frame to request information from back six message frames containing aerocraft state information
inertial navigation computer which returns aerocraft flight state data. Secondly, aerocraft computer sends a remote frame to
information. Seeker which responses six message frames containing seeker
state information data. Thirdly, aerocraft computer sends a
3) Point-to-point communication mode
broadcast actuator deflexion command frame containing a float
The data field of a single message on CAN bus only
actuator deflexion angle data to four aileron actuators, and then
contains up to 8 bytes data. The point-to-point communication
every aileron actuator sends an acknowledgment frame
mode is used to transmit more than 8 bytes data block. In the
containing a float actual actuator deflexion angle data. Finally,
protocol, a special identifier segment from 1012 to 1010 is
the aerocraft computer sends a broadcast actuator deflexion
provided for point-to-point communication, which marks the
command frame containing a float actuator deflexion angle
data transmission working in a single frame mode or multi­
data to two yaw actuators and a float actuator deflexion angle
frame mode. The frame number is obtained by decoding the 10
data to two pitching actuators, and then four message frames
segment in the point-to-point communication mode [8], [9].
which contain the actual actuator deflexion angle are sent by
D. Fault handling mechanism two yaw actuators and two pitching actuators. All the message
Aerocraft control system has the following features that are frames transmitted on CAN bus are saved by the data recorder.
short working time, high real-time communication and large This experiment runs five minutes, the final experimental
data transmission etc. A fast fault handling mechanism is results are shown in Table VI provided by CANoe software,
needed to ensure the normal operation of the aerocraft control and the contrast curve between the command actuator deflexion
system. The rules in the protocol are specified as follow: angle and the actual actuator deflexion angle of Aileron
I) Three times sending mechanism is adopted in the Actuator I (AAI) is shown in Fig. 2:
protocol for the sending node. Any message which is sent

166
TABLE VI. STATISTICS OF THE Bus

Inertial Navigation Single Aileron Single Front


Subsystem Name Aerocraft computer Seeker Data Recorder
Computer Actuator System Actuator System

Send Frame 120000 180000 180000 30000 30000 0

Receive Frame 600000 30000 30000 30000 30000 720000

Command Anr;le Of HI [Der;] Actual Antle Of AAI [De!d


built to validate the design. The experimental results indicate
that it is practically feasible to this application layer protocol
which meets the requirements of data transmission reliability,
1.0
real-time and high efficiency, etc. The research in aerocraft
control system has a referenced significance to the engineering
practice.

ACKNOWLEDGMENT
o.0 .--�
All the authors would like to thank the sponsors and the
colleagues who give us good suggestions and helps during the
-0. 5
experiment.

REFERENCES
1""1 ""1''''1''''1''''1'"'1""1 ""I'" '1''''1'' "1""1'"'1''''1''''1'''
110.25 110.35 110.45 110.55 110.&5 110.75 110.85 110.95
[,]
[ 1] H. F. Othman, Y. R. Aji, F. T. Fakhreddin, and A. R. AI-Ali, "Controller
Figure 2. Contrast curve of the command and actual actuator deflexion angle. area networks: Evolution and applications," in Proc. 2nd IEEE Int. Conf.
ICTTA, Apr. 2003, PP.3088-3093.
[2] W. Lawrenz, CAN System Engineering Theory to Practical Applications,
Springer, 1997.
CONCLUSIONS
[3] Rao Yuntao, Zou Jijun, Wang Jinhong, Theory and Application of CAN
In the experiment, firstly, all messages are transmitted Fieldbus Technology., 2nd ed. Beijing: Beijing University of
accurately in accordance with the self-made application layer Aeronautics and Astronautics Press, 2007.8, pp. 1-35.
protocol. The whole experimental platform works well without [4] BOSCH-CAN Specification Version 2.0, Robert Bosch GmbH, Stuttgart,
appearing the phenomenon of error frame or dropping frame. Germany, 1991. [Online]. Available: http://www.bosch.com

Secondly, the CAN bus load rate is 28%. Although the bus has [5] ISO 1 1898, Road Vehicles-Controller Area Network (CAN),
International Organization for Standardization, 2003. [Online]. Available:
low utilization rate, it possesses high reliability. Thirdly, the http://www.iso.org
time sequence, number and contents of the practical massages
[6] Xiao Longlong, Cheng Mousen, Zhang Weihua, "Simulation and
on the bus are absolutely consistent to the theory. By Evaluation on Data Transmission of Launch Vehicle Control System
contrasting the detailed messages appearance time recorded in Based on CAN Bus," Journal of Projectiles, Rockets, Missiles and
CANoe software, the conclusion is that the signal transmission Guidance, China, 2009, vo1.29, No.2, pp. 256-260.
delay time is very short which indicates the scheduling [7] Wang Junqiang, Zhong Min, "Application of CAN BUS and Its Upper
algorithm is reasonable and the system is reliable. Therefore, Layer Network Protocol In Avionics System for Unpiloted Vehicle,"
MICROCOMPUTER APPLICATIONS, China, 2008, vo1.29, No.ll, pp.
the protocol can ensure the correct data transmission among the
48-52.
subsystems, and it has a large margin expansion to improve the
[8] Hui Yanan, Leng Wenhao, Liu Peilin, "Design and implementation of
data throughput of the bus in future. application layer communication protocol for CAN bus network,"
Computer Engineering and Design, China, 2008, vo1.29, No.3, pp. 669-
The application Layer Protocol for Aerocraft Control
67 1.
System based on CAN bus is designed and introduced in this
[9] Ma Xin, Lu Yajuan, "Constituted Method about CAN Application-Layer
paper. The protocol targeted for the data transmission of the Protocol of Torpedo Guiding System," Armament Automation, China,
aerocraft control system provides more comprehensive services. 2006, vo1.25, No. 1 1, pp. 1-5.
Finally a simulation platform for aerocraft control system is

167

S-ar putea să vă placă și