You are on page 1of 4

The Solution of Hybrid Electric Vehicle Information System by Modbus Protocol

Song Xuehua,Lu Min,Wu Hesheng


Academy of computer science and communication, Jiangsu University. Zhenjiang, 212013, China. 2000hllml@163.com AbstractThis paper introduces the hybrid electric vehicle information system, which is realized by modbus protocol. Using a remote terminal control unit (RTU) with EVEW touch-screen, the system achieves the communication between electronic control units (ECU) and the RTU by means of the modbus protocol at the baud rate 38400kb/s, and it finishes the task of human-machine exchange. Hybrid electric vehicle control unit uses dual-core processors: the host processor and the coprocessor XGATE. XGATE can reduce the load on the host processor, which makes the host processor timely response to a number of hybrid control tasks, and it improves the requirements of real-time in hybrid control system. In addition, because modbus protocol has opening characteristics, most of serial communication controllers support the protocol. Therefore, the system can be applied in the serial communication with modbus protocol.
Keywords- Modbus protocol, touch-screen, RS-485 bus, ECU.

Wang Hong,Liu Fei


Department of Research & Development Hents Technologies Inc. Zhenjiang, 212009, China. clocktree@hotmail.com application of modbus protocol that is used in the control of automotive. II. HARDWARE PLATFORM OF THE SYSTEM The Hardware platform of the system contains ECU, touchscreen, RS-485 bus, 24-volt DC power supply. To display and correct the running parameters, the system uses the touch screen of Shenzhen Human-machine Electronics Co., Ltd as the master. And the slave uses ECU of Zhenjiang Hents Technologies Inc., whose main chip is MC9S12XD256 of Freescale Semiconductor; MC9S12XD256 is used in the dedicated control technology of automotive. Compared to the other chips of 9S12, its cost is cheap, and it is a dual-core, 16bit Micro programmed Control Unit (MCU) .it has a main processor and a coprocessor named XGATE. The coprocessor is adapted to dispose communication so that it can reduce the load of the main processor. The system adopts dual-line RS485 owing to its preferable stability [2]. Towline RS-485 is used as the communication medium between touch screen and ECU. There is also a 24-volt DC power supply in order to supply power to the touch screen and ECU. Figure 1 shows the connection of hardware platform.

I.

INTRODUCTION

With the development of automotive industry, Hybrid electric vehicles need monitor and diagnose more and more information. And requirements of data transmission rate are increasing. The traditional meters can only show finite parameters such as the speed of automotives and the quantity of gasoline. Furthermore, the parameters correct are intractability, it is helpless to the real time data, whose number is often large. The hybrid electric vehicle information system in the paper, which is based on the modbus protocol, shows a new way to solve the problem. Furthermore, the system has been applied in actual control of hybrid electric bus. With its application and increasing products [1], Touch screen is the most commonly used human-machine interface, and it is much more intuitive at present. Widely used in the field of automotive control, ECU can form a good condition for human-machine interaction by combining with touch screen. Touch-screen displays the running state and parameters of the system. And the parameters can be corrected directly through the touch-screen, which provides good human-machine interaction. The system offers instructive significance on the

Figure1 The connection of hardware platform

978-1-4244-8039-5/11/$26.00 2011 IEEE

III.

SOFTWARE DESIGN OF THE SYSTEM


TABLE IV THE FORMAT OF THE RESPONSE FROM ECU

A. Introduction of modbus RTU communication format Modbus protocol is an open protocol at application layer. It, a master and slave protocol, finishes communication by using asynchronous serial interface. The function code of modbus protocol that the system realizes is provided by table I.
TABLE I. FUNCTION CODE REALIZED IN THE SYSTEM

Name of data segment


Address Function code the number of read byte The High bit of register

Data value
01 03 02 7B 1F DB 7C

Function code
0x01

name
Read switch quantity

function
Get the current status of output of a set of switch quantity Get the current status of output of a set of simulate quantity Force set the output of certain switch quantity Force set the output of several switch quantity of the slave Force set the output of several simulate quantity of the slave

The Low bit of register High bit of the CRC check code Low bit of the CRC check code

0x03

Read simulate quantity

0x05 0x15

Force single-way switch quantity Force multi-way switch quantity Force multi-way simulate quantity

0x16

In the system, the frame format of modbus protocol is RTU frame[3], which is showed in table II. Cycle redundancy check uses CRC for short in the table II.
TABLE II THE FORMAT OF RTU FRAME

Slave address
8 bits

Function code
8 bits

Data
N*8bits

CRC check sum


16 bits

The factual format of communication data between touch screen and ECU can be explained by testing the function code. Take function code 03 as a example, the address number of ECU is 0x01, and touch screen looks over the value of address 0x1019 that is in the register of ECU. The format of reception from touch screen is showed in table III. It is supposed that the data is 0x7B1F in the address 0x1019, and the format[4] of the response from ECU is showed in table IV.
TABLEIII THE FORMAT OF RECEPTION FROM TOUCH SCREEN

B. Design of touch screen module MT500 of EVEW touch screen has integrated modbus RTU communication protocol; therefore, the design is mainly to add several simulate elements and switch elements[5]. Building a window at first, setting the type and parameters of the window in the menu of system parameter. Then, adding data display elements to the window so as to realize the statuses and parameters that the system needs to display. such as the work current of importing controller, the voltage of the battery, speed of the automotive, current status of drive, current gear of the handle gear and current status of clutch. In the properties of each element, device address and device type should be set corresponding to the ECU. The device type of the system contains LW and 4x. LW indicates that the element reads the internal address of touch screen. 4x indicates the registers address of the read-write controller type. Both system diagnostics and parameter setting should use data input elements that can produce a small keyboard so as to realize entering and modifying data. It also needs to set addresses corresponding to the ECU. The system realizes: upper and lower saturation voltage settings, delay of neutral gear junction, Upper and lower peak voltage settings and so on. Figure 2 is the home page of the hybrid electric vehicle information system.

Name of data segment


Address Function code High bit of the read address Low bit of the read address High bit of the number of read data Low bit of the number of read data High bit of the CRC check code Low bit of the CRC check code

Data value
01 03 10 19 00 01 51 0D

Figure 2 Home page of the hybrid electric vehicle information system

C.

Design of ECU module Design of ECU module contains four parts: SCI module, data reception, dada process and data send. Figure 3 shows them.
st art

Enter data interrupt

Receive data false Y N SendFlag =1 Cleart flag N

BusClkInit () SCI0Init ()

Send data

Set upBaudrat e() Set upXGAT E()

T imerInit () SCI0_Int errupt ()

Send CompleteFlag =1 N N

Complete send data

Dat aReceive()

Receive Flag=1

Receive data

Dat aexcut e()

Figure 4 Flow charts of SCI interrupt

IV.
Dat aSend()

SYSTEM TEST

St opDat aSend()

Figure 3 Flow chart of ECU module

SCI (Serial communication interface) module contains timer module of the program, it takes charge of sending and receiving data of buffer, it realizes the data transmission between touch screen and ECU. Data reception is to perform CRC check and parse data that SCI received, Data having been parsed will be provided to data process part to perform instruction. Data process is to parse function code of received data, it take charge of processing data according to different function code. And, it realizes reading and writing switch quantity and simulates quantity by using its internal function. Data send is to send the result of data process part to the send buffer. In fact, it is part of data process part. SCI interrupt is the communication interface module which ECU uses, it needs to open coprocessor XGATE, the program uses SCI interrupt in XGATE. While data are transmitted between ECU and RS-485 bus, the program needs to use coprocessor XGATE to perform SCI interrupt. Figure 4 shows flow chart of SCI interrupt.

A. Test of communication instruction The When ECU is initialing, set an address in RAM, write a datum into the address, and use a data display element to read the datum. Then, connect ECU with PC by BDM (background debug), and in the background of C program, data in the register of the main chip of ECU can display on the PC. If they are the same to each other, it means the communication of ECU is successful, simultaneity, it makes out that function code that has the effect has realized. Otherwise, it means its failure. The function codes in the system have realized. B. Test of communication instruction The test of communication instruction is a crucial standard of measuring the stability of the system.

Figure 5 Waveform of oscillograph while baud rate is 19200kb/s

V.

CONCLUSIONS

Figure 6 Waveform of oscillograph while baud rate is 38400kb/s

When baud rate of ECU is initialing, the baud rate is 19200kb/s at first, and in the touch screen, Choose 19200kb/s in the list of baud rate setting of the system parameter. Then, connect to the oscillograph. Differential receiver makes output waveform much more stable, so RS-485 interface uses the combination of balanced driver and differential receiver. We can obtain the time of the frame by the oscillograph. Figure 5 shows that touch screen sends data to ECU, then, RS-485 receives data. The waveform displays on the oscillograph. Waveform 1 and waveform 2 are waveform of line A and line B in the dual-line RS-485, the middle one is the synthetic waveform of waveform 1 and waveform 2, which is the situation of sending and receiving data. There is the time of the frames waveform between the two tag lines. Then, the baud rate is set to 38400kb /s, Figure 6 shows the waveform. Compared figure 5 with figure 6, we can see that time cost in the latter is shorter than in the former, and the waveform still stable. In the control of automotive, the baud rate is generally set to 19200kb/s[5], it proves that the communication rate of the system is faster than the usual ones.

After the design of the hardware, we can see that the hardware connection of the system is simple, easy to achieve. The main chip of ECU uses MC9S12XD256, compared with other chips of 9S12 series; it is a cheap dual-core processor. And test proves the communication is still stable while baud rate is set to 38400kb/s.this shows the system is fast transmission rate, high communication reliability and low cost. Besides, XGATE coprocessor can reduce the load of main processor so that the main processor can better respond to some tasks of hybrid control and meet the requirement of real-time on the hybrid control system. It also achieves good monitoring to the system and corrects its operating parameters. And it has been used successfully in the Hybrid Electric Bus Control System. Its responsible for sampling and processing related data information of the inspection of vehicle systems, faults diagnosis and data collection. This information passes to touch screen through RS-485 bus, then, we can set various working conditions by the touch-screen interface. Under the modbus protocol, the system provides instructive significance for the application of human-machine interface technology. REFERENCES
[1] You Huifang. Communication Between Single Chip Microcomputer and Touch-Screen by MODBUS,.PC in industry control, September 2008,pp 63-65 Bruno Dutertre. Formal Modeling and Analysis of the Modbus Protocol, IFIP International Federation for Information Processing, 2007,Volume 253, Critical Infrastructure Protection, pp,189-204 Modbus.org, MODBUS over Serial Line Speci cation and Implementation Guide v1.0, North Grafton, Massachusetts (www. modbus.org/specs.php),February 12, 2002 Meng Hua, Wang Pengda, Li Mingwei. Implementation of Communication Between PIC Single Chip Processor and Touch-screen based on Modbus Protocol. Instrument Technique and Sensor, October 2009,pp 58-60 Shenzhen HCI Electronics Co., Ltd, EB500 user handbook. Shenzhen,2005

[2]

[3]

[4]

[5]

You might also like