You are on page 1of 4

ICSP2008 Proceedings

Design and Application of Train-CAN protocol on Train Communication


Shen Ping, Wang Sujing, Wang Lide ,Liu Bin Department of Electrical Engineering, University of Beijing jiaotong pshen@bjtu.edu.cn
function of using the data. The definition makes the elements of the message have their specific function and meaning. Train-CAN message structure design which is fundamental of Train-CAN protocol includes two aspects: message ID and the distribution of the data of the message [3].

Abstract
The field bus application in a train control system has its own specialty. There has been no special CAN bus application layer standard protocol faced to railway application up to now. In this paper, a new CAN bus application layer protocol is introduced that named Train-CAN that make reference to TCN(IEC61375-1) and other CAN application layer protocol. The protocol at the assignment of message, the transmission rules of message, and the network management is described. A typical application in the train control and fault detecting system is introduced. The real application of the system proved that the Train-CAN protocol is rationality.

2.1. The distribution of Train-CAN message identifier (ID)


In Train-CAN protocol, we assign the source node MAC ID and target node MAC ID in the data communication, and instruct the function and the resource we need to visit. The message ID is divided into seven parts as in the table below: priority (PRI), segment transmission flag (segFlag), functional ID (FUNC ID), destination MAC (DMAC), source MAC (SMAC), source ID (SID), and Acknowledge bit. Table 1: Train-CAN message ID definition ID28 ID27 ID26 ID25 ID24 ID23 ID22 ID21 TX1/RX1
PRI SegFlag FCODE ID20 ID19 ID18 ID17 ID16 ID15 ID14 TX2/RX2 DMAC ID12 ID11 ID10 ID9 ID8 ID7 ID6 TX3/RX3 SMAC ID4 ID3 ID2 ID1 ID0 TX4/RX4 SID ACK

1. Introduction
With the development of computer technology and industrial field-bus technology and the communication based on field-bus being used more and more widely on the rolling stocks, CAN bus is subject to a number favored with its simple structure, low-cost, good features and high reliability, the scene anti-interference capability, and the opening up of the characteristics of the development. Nowadays, there are mainly two kinds of Commercial protocols based on CAN bus: device NET and CAN open. While these two protocols are developed for general purposes, they are not fit for the railway rolling stock occasions which require high reliability due to the complicated structure. By reference to the train network communication protocol TCN (Train Communication Network), application norms of TCN faced to railway locomotives are proposed. The detecting and recording system of locomotive instant fault is used for its object to show the application process [1][2].

ID13 ID5

2.Injection control algorithm design


______________________________________ 978-1-4244-2179-4/08/$25.00 2008 IEEE
This protocol message pattern defines the ID of CAN massages, and also defines the principle and

Since the CAN message is based on the priority competition, we change the priority competition mode faced to nodes to that faced to messages as to the Train-CAN protocol. Message Priority engaged 3 bits: ID28-26, using 000 to 111 to present 8 priorities of all the data in the communication net. In the application system of Train-CAN protocol, the design of message priority takes the importance, frequency of transmission, length of data, the real time requirement of the messages into account. Segment transmission flag engages 1 bit: ID25, illustrating whether the message needs to be divided into segments. And the receipt node will decide whether to cope with segments receiving according to this sign. It is effective when set, and the first byte of

2782

data will corporate with this bit which we will talk about later. FUNC ID is assigned 4 bits: ID24-21, to indicate the function the message is designed to work out. The node to receive messages will deal with the message according to the FUNC ID. DMAC and SMAC which indicate the address of the nodes that receive and transmit data each engage 8 bits. In Train-CAN protocol the maxim nodes capacity of one single communication net is 256 in theory, while in practice application, the number of nodes is limited by the electrical properties of net hardware. For example, when Philips P82C250 is used for CAN transceivers, one single net can only hold 110 nodes. SID takes 4 bits: ID4 to ID1, indicating the inside units of nodes that will be operated. Operation is being taken of units inside device according to the SID in the messages. Not all the messages need to be acknowledged in the CAN protocol, and not all the messages need not to be acknowledged. In practical application, users can choose to fill the ACK or not according to the nature of message.

DMAC are local. SID is 0X0E. The length of data is 0. The format of the message is shown in table 4 as below: Table 4: format of MAC ID detecting messages
PRI 0x00 FCODE 0x07 DMAC Own MAC SMAC Own MAC SID 0x0E ACK 1 DATA NULL

3. Main title communication mode of Train-CAN


Flexible communication mode is adapted in TrainCAN protocol, supporting both master-slave communication mode and event-triggering communication mode. In order to save bandwidth, event-triggering transmission combined with periodical polling is adapted to update network nodes resource port. So called event-triggering transmission mode is that only when its own state being changed, the network node will establish an updating signal to the network actively. In the meanwhile, prohibiting some node failure in the network, one node is assigned to act as the master device of the whole network which not only has the same characteristics with other devices but also shall send polling frame to the network periodically. Master-slave mode is also called commandresponse mode, in which communication is established by the master device in the network, and the slave device who receives the command frame sends a response frame. The master-slave mode is divided into point to point mode, multicast mode and broadcast mode. Point to point mode is that the master device communicates with a slave device. And the slave device deals with the command after the reception and then response to the master device by a response message. In this mode, one entire communication includes the masters request and the slaves response. Each master device must has its own address, in order to differ from other devices. And the slave device will not send any data until it receives the request frame. Being relative to the point to point mode, there is no response frame in the multicast and broadcast mode. These two modes are very suitable for the sharing of data in the network. In the event-triggering communication mode, the device sends data to the network timing circularly. Device in the network will transmit data to the master device, on some certain status which can be determined by user in advance or the state changes.

2.2.Frame data format design of Train-CAN


In Train-CAN protocol, the data part of the messages is defined as different parameters based on different FUNC ID. The specific parameters includes polling resource, resource output, inquiry port, segment data transmission, connection establishing, connection deleting, device reset and MAC ID detecting. The design of data format is illustrated mainly on the aspect of polling resource, segment data transmission and MAC ID detecting. When the master device is polling, only correct priority, FUNC ID, MAC and corresponding number of resource node is needed. The data length is set to zero, data part is undefined. The format of polling frame is shown below in table 2: Table2: the format of polling frame
PRI 0x04 FCODE 0x00 DMAC Destination device SMAC Master device SID Polling resource ACK 1 DATA NULL

When the network data is longer than 8 bytes, the segFlag is needed to be set and used combined with the data bytes. In the segment transmission mode, the maxim length of data is 7 bytes, in which the first byte is defined as below: Table3: segment transmission mode
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 SegPolo SegNum

MAC detecting command is aimed to accomplish network managements, in which the SMAC and

4. The network management of Train-CAN

2783

To protect the normality of communication, monitoring should be taken on each device in the network and proper actions should be taken to deal with communication abnormality [5]. Since there is an independent connection between each master and slave device in Train-CAN network, it is possible to monitor every connection. Consequently, the monitoring being charged on the communication in Train-CAN network is based on the monitoring of the connections. The network management mainly includes node management and communication management. The node management in Train-CAN network is realized by defining the access mechanism of network status of Train-CAN devices. The access mechanism of Train-CAN network regulates a status graph that is needed when nodes in the network is supposed to start, regulates the rules that how nodes change their status in detail, and can master the nodes by specific messages. The initialization process of devices in the Train-CAN is shown as below:

the cyclic transfer timer is overtime in one connection, the device will send a message. The cyclic parameters are set according to its own data requirements. The procedure of cyclic transfer timer is shown as below:
Connection established

Initial the cyclic transfer timer

Start the cyclic transfer timer


No

Cyclic transfer timer overtime


Yes

Reset the timer and send message

 Figure 2: design process of cyclic transfer timer

5. Second and following pages Example of application


Train-CAN protocol is now successfully applied on the No. 0641 SS3-4000 series electric locomotive. Since Jan, 14, 2007, the Train-CAN protocol was equipped on the locomotive; the protocol is improved time and time again. Until now, the locomotive has been operated safely near a year. The early version of Train-CAN protocol has been tested comprehensively, through the installation and debugging of this system. According to the rules of Train-CAN protocol, the node MAC on the network ranges from 0X00 to 0XFF. There are practically 7 nodes hitching on the network, including 2 display screens of drivers ventricular, 2 digital data collection modules, 2 logical control modules and 1 detecting and recording system of instant fault. Furthermore, to reduce the burden of CPU of net nodes and meet the demand of huge data sharing, we made full use of the message acceptance filtering function of CAN controller and list each nodes MAC as table 3: Table 3: addressing of system MAC
Digital Digital Control Control Detectin Display data data Node Display g module module 2 collection collection name 1 machine 2 1 module 1 module 2 Short DIS1 LCM1 LCM2 JCY COL1 COL2 DIS2 name MAC 0x80 0x40 0x20 0x10 0x08 0x04 0x02

Figure1: The initialization process of devices in the Train-CAN The control of communication is used to monitor the messages in the network, ensuring that when abnormal communication occurred, proper method can be taken to recover normal communication. The control of communication is depended on the communication interval between the master device and the slave device. So in the Train-CAN network, whether the communication is abnormal is determined by overtime mechanism. To control the communication, cyclic transfer timer is defined in Train-CAN protocol: Cyclic transfer timer is used to realize the time triggered transmission of Train-CAN devices. When

2784

With the help of acceptance filter, only when the ACK bit is equal to the value acceptance filter defined can the CAN controller store the information to RXFIFO. The acceptance filter is defined with the acceptance code register and acceptance masking register and single filtering mode is adapted in this system. When the bit corresponding to acceptance masking register AMR.x is 0, filtering is effective. Or the result is opposite. Therefore, when the system is initialization, ACR1 should be set the MAC address corresponding to its own node, while AMR1 should be filled with the value reverse to its own. From the definition above we can see that binding the system devices of Train-CAN we can conveniently control the direction of data flow when data is transmitted. We can realize point to point, multicast and broadcast mode communication just by fill 1 to the bit of receiving node corresponding to the 8-bit SMAC of the message being transmitted. Figure 4 shows the analogy interface of the display screen of the detecting and recording system of locomotive instant fault. 

3) The bus polling referenced by MVB definition makes effective monitoring of network status, and good management of data transmission. The network management mechanism provides controllable communication maintenance, node maintenance, and fault recovering function. 4) The combined mode based on master-slave communication mode and production/consumption multicast and broadcast mode, effectively improves the reliability and efficiency of communication. The features above are designed for the train bus application. Train-CAN as one CAN application layer protocol special for the railway, applied in the detecting and recording system of locomotive instant fault with its simplicity and effective feature. By verification of practical application, its reliability, real time performance, flexibility, extensibility and standardization are all meet the demand of general train bus network. Popularization of this protocol will be taken in the later detecting and recording system of locomotive instant fault.

7. References
[1] IEC61375-1-1999, Part 1 Train Communication Network [2] Jaime Jimnez, Jos L.Martin, Carlos Cuadrado, Jagoba Arias and Jess Lzaro A Top-down Design for the Train Communication Network2003 IEEE [3] Rao Yun-tao, Zou Ji-jun and Zheng Yong-yun. Principal and application CAN field-bus, Press of Beijing University of Aeronautics and Astronautics, 2003

Figure 4: showing the analogy value from detecting system.

[4] Ma Chen-pu, A CAN protocol development suitable for railway locomotives, Electric locomotives and urban rail vehicles, 2005, No. 4,Volume 28pp.17-19 [5] Zhang Da-yong, The research of application of CAN bus used in fault detecting system of locomotives, master degree thesis, 2004

6. Conclusion
Through the analysis of MVB bus protocol we have participated in development, a simplified and practical CAN application layer protocol Train-CAN is proposed, combined the structure specialty of CAN bus model and control of rolling stocks. This protocol has characters as below: 1) The combined use of message ID and data makes the possibility that the CAN frame ID and data being defined specifically and used flexibly. 2) Time and event-triggering transmission mode provide the transmitting ability of periodical procedure data and nonperiodic information data. Meanwhile, event-triggering mode can make full use of the band width.

2785

You might also like