Presentation 02
Presentation 02
Presentation 02
Outlines
The data rate and signal level of K-Line Data frame and packet structures of ISO 9141-2
The Mode and PID Definitions The DTC Definitions Application: In-Vehicle Data Logger
Outlines
J1939 on OBDII
The PGN (Parameter Group Number) Definitions Transport Protocols The DTC (Diagnostic Trouble Code) Definitions Application: Parameters and Trouble Codes Monitoring and Display
3
OBDII Introduction
OBDII is the latest industry standard (introduced on 1996 vehicle models) It provides monitoring of nearly all engine controls, and also some other parts of the vehicle (chassis, body, etc.) The most useful part of OBD is the ability to read information and trouble codes from the vehicle
OBDII Introduction
OBD-III
Complexity
OBD-II
OBD-I OBD
80 82 84 86 88 90 92 94 96 98 00 02 04 06 08
Model Year
5
OBDII Introduction
Pin 2 - J1850 Bus+ Pin 4 - Chassis Ground Pin 5 - Signal Ground Pin 6 - CAN High (J-2284) Pin 7 - ISO 9141-2 K Line Pin 10 - J1850 Bus Pin 14 - CAN Low (J-2284) Pin 15 - ISO 9141-2 L Line Pin 16 - Battery Power
6
ISO9141-2 on OBDII
It specifies the requirements for setting up the interchange of digital information between an on board ECU and a suitable diagnostic tester to facilitate inspection, test, diagnosis and adjustment of vehicles ECUs
ISO9141-2 on OBDII
The ECU must have one (K) or two ( K and L) communication connections Connecting lines K or L from one or more ECUs together results in a bus system Line K is defined as the line that provides information in a serial digital form from the ECU to the diagnostic tester
Line K may also be bi-directional, in which case it may carry commands or data form the diagnostic tester to the ECU
ISO9141-2 on OBDII
Line K may also be used to initialize the serial communication The standard K-line is ISO9141 compatible for baud rates up to 250kbps
It may be used to initialize the serial communication and/or to carry commands and/or data
ISO9141-2 on OBDII
ECU2
OBDII Connector
K-Line
unidirectional
L-Line
ECU3
ECUn
10
ISO9141-2 on OBDII
CAN Bus(J1939)
250k/500k/1Mbps Differential: 0 ~ 5V Twist wire
J1708/J1587
9600bps Differential: 0 ~ 5V Twist wire
11
ISO9141-2 on OBDII
It specifies the requirements for setting-up the interchange of digital information between onboard emission-related ECUs or road vehicles and the SAE OBDII scan tool It is limited to vehicles with nominal 12 V supply voltage
12
ISO9141-2 on OBDII
No arbitration 5 baud initialization NRZ @ 10.4kbps K-Line or K&L-Line 12V systems only
Physical Layer
13
ISO9141-2 on OBDII
Transmitter
Logic 1
Receiver
Logic 1
Ambiguous
noise margin
Logic 0
Logic 0
Devices
14
ISO9141-2 on OBDII
1 2
J1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 OBDII
7 80 5
GND
Vin
Vo ut
+ C1 4 7u F
C3 C2 0 .1 u F 4 7u F
C7
+ +
C5 R1 4 .7 K R2 1 0K Q1 9 01 3 R4 1 0K R3 5K
+
4 .7 u F
J2 1 6 2 7 3 8 4 9 5 DB9
C9 CAP
15
ISO9141-2 on OBDII
Data rates
16
ISO9141-2 on OBDII
Initialization
ISO-9141
0x33 (5bps) Initialization Phase
0x55 (10.4kbps)
0x08 0x08 ~(0x08) ~(0x33) = 0xCC
0x55 (10.4kbps)
0x08 0x08
successfully initialized
request
request response
Negotiation Phase
response
Negotiation Transactions
Tester
ECU
Tester
ECU
17
ISO9141-2 on OBDII
Transaction timing
5 bps INI 0x33
ISO-9141
Reader-to-ECU ECU-to-Reader
request
response
ISO-9141-2
Reader-to-ECU ECU-to-Reader
5 bps INI
0x33
KW2
~0x8 =0xf7
response
18
ISO9141-2 on OBDII
Negotiation phase
19
ISO9141-2 on OBDII
CHKSUM
response packet
0x48 0x6B 0x40 0x41 0x0C 0x0C 0x97 0xE3
CHKSUM
20
ISO9141-2 on OBDII
Show current data Show freeze frame data Show stored Diagnostic Trouble Codes Clear Diagnostic Trouble Codes and stored values
21
ISO9141-2 on OBDII
5. 6. 7. 8. 9.
Test results, oxygen sensor monitoring Test results, other component/system monitoring Show pending Diagnostic Trouble Codes Control operation of on-board component/system Request vehicle information
Vehicle manufactures are not required to support all modes Each manufacturer may define additional modes above mode-9
22
ISO9141-2 on OBDII
The PID gives access to the real time operational parameters as well as flagged DTCs The specific PID in Mode 1 was to request the currently expected vehicle parameters The specific PID in Mode 2 requests a snapshot of vehicle parameters taken at the point when the last DTC (Diagnostic Trouble Code) is set
23
ISO9141-2 on OBDII
Each PID was translated into meaningful parameter the predefined formula
e.g., Engine RPM PID = 0x0C, 2 bytes (A and B) are returned The predefined formula is ((A * 256) + B) / 4 Units : rpm
24
ISO9141-2 on OBDII
e.g., in Chrysler Voyager, the response of PID=0 is 0xBF 0xBE 0xB9 0x91 1011 1111 1011 1110 1011 1001 1001 0001
25
ISO9141-2 on OBDII
Example: Supported PIDs on Chrysler Voyager
Mode (hex) PID (hex) Data bytes returned Description Min value
(http://en.wikipedia.org/wiki/OBD-II_PIDs)
Units Formula
Max value
01
00
PIDs supported Number of trouble codes and I/M info Freeze DTC Fuel system status Calculated engine load value Engine coolant temperature 0 -40 100 215 99.22 (Lean) 99.22 (Lean) 99.22 (Lean) 99.22 (Lean) 765 % C
01 01 01 01 01
01 02 03 04 05
4 8 2 1 1
01
01 01 01 01
06
07 08 09 0A
1
1 1 1 1
-100 (Rich)
-100 (Rich) -100 (Rich) -100 (Rich) 0
%
% % % kPa (gauge) kPa (absolute)
0.7812 * (A-128)
0.7812 * (A-128) 0.7812 * (A-128) 0.7812 * (A-128) A*3
01
0B
255
26
ISO9141-2 on OBDII
01
01 01 01 01 01 01
0C
0D 0E 0F 10 11 12
2
1 1 1 2 1 1
Engine RPM
Vehicle speed Timing advance Intake air temperature MAF air flow rate Throttle position Sec.(?) air status
0
0 -64 -40 0 0
16,383.75
255 63.5 215 655.35 100
rpm
km/h relative to #1 cylinder C g/s %
((A*256)+B)/4
A A/2 - 64 A-40 ((256*A)+B) / 100 A*100/255 Bit encoded. See below.
01
13
Oxygen sensors present Bank 1, Sensor 1: Oxygen sensor voltage, Short term fuel trim Bank 1, Sensor 2: Oxygen sensor voltage, Short term fuel trim Bank 1, Sensor 3: Oxygen sensor voltage, Short term fuel trim Bank 1, Sensor 4: Oxygen sensor voltage, Short term fuel trim
01
14
0 0 0 0
Volts % Volts %
A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc) A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc)
01
15
01
16
0 0
0 0
1.275 99.2
1.275 99.2
Volts %
Volts %
A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc)
A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc)
01
17
27
ISO9141-2 on OBDII
Bank 2, Sensor 1: Oxygen sensor voltage, Short term fuel trim Bank 2, Sensor 2: Oxygen sensor voltage, Short term fuel trim Bank 2, Sensor 3: Oxygen sensor voltage, Short term fuel trim Bank 2, Sensor 4: Oxygen sensor voltage, Short term fuel trim OBD standards this vehicle conforms to Oxygen sensors present Auxiliary input status Run time since engine start PIDs supported 21-40 0 65,535 seconds
01
18
0 0 0 0 0 0 0 0
A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc) A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc) A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc) A * 0.005 (B-128) * 0.7812 (if B==0xFF, sensor is not used in trim calc) Bit encoded. See below.
01
19
01
1A
01
1B
01 01 01 01 01
1C 1D 1E 1F 20
1 1 1 2 4
Similar to PID 13, but [A0..A7] == [B1S1, B1S2, B2S1, B2S2, B3S1, B3S2, B4S1, B4S2]
A0 == Power Take Off (PTO) status (1 == active) [A1..A7] not used (A*256)+B Bit encoded [A7..D0] == [PID 0x21..PID 0x40]
28
ISO9141-2 on OBDII
Mode 3 (no PID required) requests the DTCs that have been set The response will be an integer number of packets each containing 6 data bytes (A, B, C, D, E, F)
29
ISO9141-2 on OBDII
Each trouble code requires 2 bytes to describe (AB, CD, EF) A trouble code can be decoded from each pair of data bytes
30
ISO9141-2 on OBDII
A DTC is made up of 5 digits The figure below demonstrates the composition of a DTC
31
ISO9141-2 on OBDII
Each DTC consists of five parts within a pair of data bytes (AB, CD, EF)
First Character System First DTC character P - Powertrain C - Chassis B - Body U - Network
A7 A6 0 0 0 1 1 0 1 1
32
ISO9141-2 on OBDII
Second Digit Code Type Second DTC digit Generic Enhanced (manufacturer specific) undefined undefined
A5 A4 0 0 0 1 1 0 1 1
33
ISO9141-2 on OBDII
A3 A2 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 0 1 0
ISO9141-2 on OBDII
Fourth and Fifth Digits are variable, and relate to a particular problem
e.g., the response of Mode 3 request 0x04 0x20 0x00 0x00 0x00 0x00
A B C D E F
35
ISO9141-2 on OBDII
P0093
P0094
36
ISO9141-2 on OBDII
Application
ISO9141-2:K-Line
Vehicle Diagnostic
GPRS/ RS323
ECU Test
37
ISO9141-2 on OBDII
Test1 Test2
1200
Load Summation
800
400
Time (sec)
ISO9141-2 on OBDII
80
Velocity (km/h)
60
40
20
0 10 20 30 40 50
Time (sec)
20
Acceleration
Test1 Test2 Test3 Test4 Test5 Test6 Test7 Test8
10
Acceleration (kph/s)
-10
-20
-30 0 10 20 30 40 50
Time (sec)
39
ISO9141-2 on OBDII
80
Velocity (km/h)
60
40
20
0 10 20 30 40 50
Time (sec)
20
Acceleration
Test1 Test2 Test3 Test4 Test5 Test6 Test7
10
Acceleration (kph/s)
-10
-20
-30 0 10 20 30 40 50
Time (sec)
40
J1939 on OBDII
J1939 protocol
SAE J1939 is the open standard for networking and communication in the commercial vehicle sector, e.g.; power train, chassis, OBD J1939 is the use of CAN technology for networking and communication as well as manufacturer-spanning interoperability
41
J1939 on OBDII
The J1939 protocol comes from the Society of Automotive Engineers (SAE) and works on the physical layer with CAN-high speed according to ISO11898 (CAN2.0B)
42
J1939 on OBDII
from http://www.vector-worldwide.com/portal/medien/cmc/press/PON/CANimNfz_CiA_200509_PressArticle_EN.pdf
43
J1939 on OBDII
Engine Engine
Caterpillar C7 ECU
Transmission Transmission
Allison MD/HD/B Series Transmissions
44
J1939 on OBDII
45
J1939 on OBDII
46
J1939 on OBDII
29-bit identifier (extended-identifier message) Peer-to-peer and broadcast communication Transport protocols for up to 1785 data bytes (255 packets) Network management Definition of parameter groups
47
J1939 on OBDII
J1939
Presentation
J1939/31 J1939/21
J1939/11 J1939
J1939 on OBDII
SAE J1939 - Recommended Practice for a Serial Control & Communications SAE J1939/11 - Physical Layer SAE J1939/21 - Data Link Layer SAE J1939/31 - Network Layer SAE J1939/71 - Vehicle Application Layer SAE J1939/73 - Application Layer Diagnostics OBD SAE J1939/81 - Network management Protocol
49
J1939 on OBDII
Signal levels
5V VCAN_H 3.0V
2.5V
VCAN_L 1.5V 0V 5V 3.6V VCAN_H 3.0V 2.5V 2.2V 5V
Recessive
Dominant
Dominant
Dominant
Recessive
Fault Tolerant
50
J1939 on OBDII
Interface circuit
51
J1939 on OBDII
DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 3-bit 8-bit 8-bit 8-bit
0
Reserved
0
Data Page
0xFE
0xEE
0x0
Priority
J1939 on OBDII
In the specification SAE J1939-71 the parameter groups are defined with the signals they contain
53
J1939 on OBDII
For this number, a 16-bit value is used that is composed of the PDU format and PDU specific
54
J1939 on OBDII
Global PGNs for parameter groups that are sent to all (broadcast)
Specific PGNs for the parameter groups that are sent to particular devices (peer-to-peer)
With these PGNs, only the higher-value 8-bit (PDU format) are valid and the value must be smaller than 240 ( < 0xF0) The lower value byte (PDU specific) is always 0
55
J1939 on OBDII
Name: Transmission rate: Data length: Data page: PDU format: PDU specific: Default priority: 6 PGN number: Description of data: Byte: 1 2 3,4 5,6 7 8
56
J1939 on OBDII
5.2.5.5 Engine coolant temperature Temperature of liquid found in engine cooling system Data length: Resolution: Data range: Type: Suspect parameter number: Reference: 1 byte 1 oC/bit gain, 40oC offset 40 to +210 oC (40 to 410 oF) Measured 110 5.3.28
57
J1939 on OBDII
case 0xf004: // Actual engine percent torque and Engine speed Actual_Engine_Torque = receivedata[rx_head].MsgData.Data[2]; Engine_Speed = receivedata[rx_head].MsgData.Data[4] * 0x100 + receivedata[rx_head].MsgData.Data[3];
58
J1939 on OBDII
59
J1939 on OBDII
Parameter groups that contain more than 8 data bytes are transmitted with a transport protocol There are two special parameter groups available
TP.CM for connection management TP.DT for the transmission of the data
60
J1939 on OBDII
61
J1939 on OBDII
Broadcast transmission
For broadcast transmission, the BAM (Broadcast Announce Message) protocol (TP.CM_BAM) is used Here, after a BAM-PGN (0xEC00) the transmitter sends all data PGs at a minimum interval of 50ms
62
J1939 on OBDII
t t
63
J1939 on OBDII
Peer-to-peer transmission
With the peer-to-peer transmission, the transmitter initiates the connection with a request to send (TP.RTS) message The receiver then controls the transport protocol with clear to send (TP.CTS) and end of message acknowledge (TP.EoMA)
64
J1939 on OBDII
65
J1939 on OBDII
Suspect Parameter Number (SPN) Failure Mode Identifier (FMI) Occurrence Count (OC) SPN Conversion Method (CM)
66
J1939 on OBDII
DTC
Byte 3 (Least Significant Byte of SPN) Byte 4 (Second Byte of SPN) SPN 8 7 6 5 4 3 2 1 8 7 6 5 4 3 2 1 8 7 6 5 4 Byte 5 (3 Most Significant Bits of SPN) FMI 3 2 1 C M 8 7 6 5 Byte 6 OC 4 3 2 1
SPN 1208 : Pre-filter oil pressure SPN = 000 00000100 10111000 = 0x0040B8 = 1208 FMI = 00011 = 0x3 = 3 OC = 0001010 = 0xA = 10 CM = 0 tmp = spn = fmi = oc = (BAM[i+2] >> 5); tmp * 0x10000 + BAM[i+1] * 0x100 + BAM[i]; BAM[i+2] & 0x1f; BAM[i+3] & 0x7f;
67
J1939 on OBDII
J1939 on OBDII
Multiple DTCs
69
J1939 on OBDII
70
J1939 on OBDII
SPN-FMI
71
J1939 on OBDII
Application:
ODM
Registered J1939
Engine Engine
Caterpillar C7 ECU
Transmission Transmission
Allison MD/HD/B Series Transmissions
72
J1939 on OBDII
System architecture
LCD Display Panel Push Buttons Flash ROM Vcc
LCD Interface
I/O Port
Lamps
UART Controller
UART Transceiver
RS-232
73
74