Analysis of the SAE J1708 Protocol Raine Saastamoinen
Total Page:16
File Type:pdf, Size:1020Kb
Volvo Construction Equipment AB Component Division Analysis of the SAE J1708 protocol Raine Saastamoinen Bachelor thesis report May - Juli 2008 School of Innovation Design and Engineering Mälardalen University, Västerås, Sweden Supervisor and Examiner: Johan Stärner Supervisors at company: Nils-Erik Bånkestad and Jarmo Talvén “ Engineers does’nt buy solutions they create them” LeCroy comersial 2 Abstract Component Division at Volvo Construction Equipment, develops electronic control units (ECU) to be used in entrepreneur machines. In an operating vehicle there are several ECU’s communicating with each other to make everything work as a complete. There are two main network protocols in use to solve different communication needs. One of them is using the SAE J1708 physical layer protocol in transmitting of the actual bits when exchanging information. Manufacturing of the units are made by external suppliers.Up to date, there is a lack of good tools, to verify that delivered components conforms to the J1708 specifications. WaveRunner 104 MXi, is an advanced digital oscilloscope with scripting possibilities. It has been used in this thesis work to find out, whether suitable or not to solve this problem. This thesis shows that analysis is possible and most important of all, in future potential of being a great tool for verification. 3 Acknowledgements Thanks to my supervisors Nils-Erik Bånkestad and Jarmo Talvén at VCE Component Division for professional guidance. Pushing me in the right direction when stumbeling into difficulties (especially after that important meeting the very first week). My supervisor at Mälardalen University, Johan Stärner, a friendly professional for support and important advices. Despite having summer vacation, taking time to read and comment my report. Annika Nerén and Peter Sävström for aid and patience shown in the laboratory environment. Magnus Åkesson, always giving a helping hand when needed and for having many good ideás. Also special thanks to Mikael Back, making this opportunity possible, to finish my studies at this interesting and challenging company. Toni Riutta for being a god friend with the heart at right place, I wish you all the best. A special thought to my family and belowed ones. Being there, listening, supporting, encouraging and all to help me to the finishing line. And last but not the least to all the people at location, showing that, despite all serious work dealt with, there is always room for laughter. Surrounded by a great atmosphere it has been a delightful experince to work here. Thank you all! Raine Saastamoinen 4 Contents 1 Introduction …….….….…………………………………………………….……………..6 2 Background ...……………………………………………………………….……………..6 3 Problem formulation.……………………………………………………….…………..….7 4 Thesis outline……………………………………………………………….…………..….8 5 The SAE J1708 protocol………………………………………………….…………..……8 6 TheWaveRunner 104 MXi DSO ..……………………………………….…………..…….8 6.1 WaveScan, an advanced search and analysis tool……. .………….…………..……..11 6.2 LabNotebook ..………………………………………………………………..……..12 6.3 Custom DSO…. ……………………………………………………………….……13 7 Requirements on analysis…….……………………………………………………….…..13 7.1 Voltage levels on the bus..………….………………………………………………...14 7.1.1 Bus state levels..……....………………………………………………………….14 7.1.2 Bits and voltage differences ……………………………………………………..15 7.2 Single bits………………………………………………………………………….…15 7.2.1 Verify bit time….…………………………………………………………….…..15 7.2.2 Low-to-high delay…. ……………………………………………………….…..15 7.2.3 High-to-low delay .. ….. ………………………………………….....……….…..15 7.2.4 Higher frequecies………………………………………...……………………….15 7.3 Characters……………….……………………………………………… ……….…..16 7.3.1 Interpretation………………. …………………………………… ………….…..16 7.3.2 Character time duration………………………………………….………….……16 7.4 Messages………………………….…………………………………………….……16 7.4.1 Idle state…………………………………………………………………….……16 7.4.2 Inter byte delays…………………………………………………………….……16 7.4.3 Message lengths ………………. ………………………………………….…….17 7.5 Further analysis……………………. .……………………………………….………17 7.5.1 Unknown-zone…………………..……………………………………….………17 7.5.2 Traffic load on bus………………… ………………..….….….………….. ……17 7.5.3 Count collisions………………………………………………………………….17 7.5.4 Monitor communication………………….……………………….. ……………17 7.5.5 Decode messages……………………………………………….. ………………17 8 Method ………………………………………..………. .. ………….. …………………18 8.1 Workplace simulation equipment……….……………. ………….. ………………..18 8.2 Laboratory simulation equipment……….………………. …….. …………………..18 8.3 Measurement to be done for voltage levels. ………... ….. .. …….. ………………..18 8.4 Measurement to be done for single bits .…….…….….……..... ……………………19 8.5 Measurement to be done for characters .……….……..……. ………………………20 8.6 Measurement to be done for messages..…………..………….. ……………………..20 8.7 Measurement to be done for further analysis ………. .….….……………………….20 9 Results…………………………………………………….. .……………………………..20 9.1 Analysis of results …..……………………….. ……………………………………..22 10 Future work/recommendations.. …………….. ………………....………………....……34 11 Summary and conclusions ……..………..…...…..………………………………………36 References…………………………….….…….……………..…...………..……………37 Appendix A… …….…….…….…………………………………………………………38 Technical data……..…………………………………………………………………38 Sample code………………………….….….………………………………………..39 5 1. Introduction Volvo Construction Equipment (VCE) is one of the leading manufacturers of construction machines on the world market. Wheel-, and backhoe loaders, excavators and articulated haulers are some of the products (see fig.1). This big company is divided into several divisions responsible for specific areas. One of them, Component Division has the global responsibility for developing and manufacturing powertrains and electronic systems. This thesis work is made at a department, within Component Division in Eskilstuna. In here development take place in making new hardware and software solutions for the electronic control units (ECU), used by the machines. Software is developed on both platform and application level. The hardware is devoloped together with external suppliers, which by the end makes the actual manufacturing of the ECU’s. Figure 1. Wheel-, and backhoe loaders, excavators, articulated haulers, motor graders and road machinery are products developed by VCE. 2. Background First of all, a very brief explanation to what an ECU is doing. An ECU, electronic control unit, is a small embedded computer that has specific behaviour implemented in it to take care of certain parts of a vehicle. Engine, transmission, hydraulics, cabin, instrument and so on have their own ECU’s. A real-time operating system is in use to schedule and decide on which task (a small piece of program), may execute what and when. Different tasks read sensor values, others make decisions upon that and some make actuators to react accordingly. The beaty of this is having the possibility to tune in some small specific details or change of characteristics and behaviour of a vehicle with changes in software (of cource with limitations). The trend is with increasing count of modules per vehicle. In an operating vehicle there are several ECU’s communicating with each other to make everything work as a complete. Communication between these autonomous nodes that the ECU’s represent, make the use of network protocols a necessity. There are two main protocols in use to solve different communication needs. First there is the CAN (Controller Area Network) according to J1939 standard in use for most of the data communication [8],[9]. With CAN being the primary bus, it allows critical interchange at high speeds among the connected modules. The second alternative in use is a protocol following the SAE (Society of Automotive Engineers) J1587 standard [12],[14]. A rather old standard, yet offering the advantages of a proven by use, reliable but rather slow communication service, used mainly for secondary or less urgent data exchange in the form of… • loading new software to the platform • dataset loading • on-vehicle test • diagnosis / faultcodes 6 Figure 2: The electronic system J1587 describes the application level in a protocol suite according to the OSI Model1. It defines format of the messages and data to be sent that is of general value. It describes a standard to use for... “ electronic data interchange between microcomputer systems in heavy-duty vehicle applications” [12]. This application layer protocol is to be used together with the SAE J1708 standard [13][15]. In a protocol suite, this one defines the data link-, and physical layer. 3. Problem formulation How well does the ECU’s implement the recommended practice when data interchanged? The main objective of this thesis work is to make measurements and analysis of the SAE J1708 physical layer protocol in use. Up to date there has been a lack of good supporting tools to verify such things easily.VCE having a vision, invested in an advanced digital signal oscilloscope with scripting possibilities. LeCroy’s WaveRunner 104 MXi has been used in this thesis work to find out, whether suitable or not to solve the aforementioned problem. 1 The OSI Model describes a layered, abstract description for communications and computer network protocol design 7 4. Thesis outline To solve this thesis work, a logical work flow has been identified. 1. First of all getting deeper knowledge of the SAE J1708 protocol. 2. Studying the WaveRunner 104 MXi oscilloscope with focus on sorting out different alternatives for measurement and analysis. 3. Establish a specification of requirements on what to analyse. 4. Do the required measurement needed for analysis. 5. Make analysis