On-board Diagnostic(OBD)

转载:http://www.obddiag.net/adapter.html

OBD-II
If your car manufactured for sale in the U.S. after 1996, it is equipped with on-board diagnostics (OBD-II) and has OBD connector somewhere in the passenger compartment. The OBD-II connector enables a scan tool to read diagnostic data from the engine computer. By law, the OBD diagnostic should supply a number of key parameters relating to the on-board monitoring of emissions from vehicles, including data such as engine speed, coolant temperature, and oxygen sensor readings. EOBD is a version of OBD-II required in Europe starting year 2004 for diesel vehicles and 2001 for gasoline vehicles. The table below shows the kinds of real-time data that you can read from your car’s engine computer using OBD-II Mode 0x01 PIDs. This is a small subset of the data that is available from your vehicle’s OBD-II bus.
在这里插入图片描述
The Data Link Connector (DLC) for connecting the diagnostic equipment is standard as well. The pinout of DLC connector is shown below as defined by SAE J1962 spec.
在这里插入图片描述
The OBD-II standard, ISO 15031-5/SAE J1979 provides five distinct electrical interfaces:
SAE J1850 VPW
SAE J1850 PWM
ISO 9141-2
ISO 14230-2 KWP2000
ISO 15765-4 CAN
All cars manufactured after year 2008 should use only CAN (ISO 15765-4) protocol. However, that is rather wishful thinking as some manufactured were using the legacy OBD protocols even after year 2008. Tables below show the protocols that used for OBD services.
在这里插入图片描述
ISO 9141-2
ISO 9141-2 was the most used protocol by vehicle manufactures before the introduction of CAN. The original ISO document goes back to year 1994 with bidirectional serial communication on a single wire called the K-line. In addition, there is an optional L-line for connection initialization. The communication started by sending the distinct signal pattern on K-line and L-line and the all communication is performed over K-line. According to the specification, the L-line is only used to initiate the communication and remains inactive (high-level) afterward, seldom being used for diagnostic purposes. The maximum data length is limited to 255 bytes.

ISO 14230-2
The ISO 14230-2 protocol is similar to ISO 9141-2, with the initialization mechanism can use either slow signal pattern 5 bit/s like ISO9141 or fast init (short 50us pulse).

SAE J1850
It is a Class B Data Communication Network Interface employs media access layer (MAC) based on priority. The J1850 bus takes two forms, 41.6Kbps Pulse Width Modulated (PWM) two wires differential approach, or a 10.4Kbps Variable Pulse Width (VPW) single wire approach. The PWM flavor was used in Ford vehicles when VPW attributed to Chrysler/GM. Both variants are CSMA/CR protocols with collisions handled by arbitration. This contention bus is inherited from an open architecture that lets node be added or removed from a network without much impact on the rest of the system, which is called non-destructive contention resolution. The latest protocol revision, SAE J1850_201510 includes High Speed Mode (83.3 Kbps) for PWM as well as 4x Speed Mode (41.6 Kbps) and Block Mode (unlimited data length) for VPW.

ISO 15765-4
The Controller Area Network (CAN) was introduced by Bosch at the SAE Congress in Detroit In February 1996. It based on a non-destructive arbitration mechanism, which grants bus access to the message with the highest priority without any delays. There was no central bus master. The CAN standard is capable of sending data frames containing between 1 and 8 bytes of data. The standard defines a method for segmenting data consisting of up to 4095 bytes and 4 different types of frames: SingleFrame, FirstFrame, ConsecutiveFrame and FlowControl. The type of frame encoded in the first 4 bits (the high nibble) of the first data byte in each frame. Each frame contains Protocol Control Information (PCI) data.
在这里插入图片描述
CAN-FD
CAN with Flexible Data Rate (CAN-FD) is the latest variant of CAN. In CAN 2.0 the maximum achievable bit rate is 1 Mbps, a limit that is largely imposed by the arbitration method. Because arbitration is not needed during the transmission of other parts of a frame, it is possible to increase the bit rate during the control, payload and CRC sections. CAN-FD maintains the 1 Mbps speed during arbitration, and then sends these other parts of the frame at up to 8 Mbps. Another limitation of original CAN is its 8-byte frame size, which is not adequate for modern networks. Bosch reformulated the CRC calculation so that the payload can increase from 8 bytes to 64 while maintaining CAN 2.0’s error detection robustness.

ISO 13400-3
The ISO 13400-3 - diagnostic communication over Internet Protocol (DoIP). Note, that standart is not part of OBD (ISO 15031-5/SAE J1979) but WWH-OBD. The intent of ISO 13400 is to describe a standardized vehicle interface which:

Separates in-vehicle network technology from the external test equipment Utilizes existing industry standards to define a long-term stable state-of-the-art communication standard usable for legislated diagnostic communication as well as for manufacturer-specific use cases Can easily be adapted to new Physical and Data Link Layers, including wired and wireless connections, by using existing adaptation layers.
To achieve this goals, the standard is based on the Open Systems Interconnection (OSI) Basic Reference Model specified in ISO/IEC 7498-1 and ISO/IEC 10731, which structures communication systems into seven layers. When mapped on this model, the services specified by ISO 14229-1, ISO 14229-2 and ISO 14229-5 are divided into:
在这里插入图片描述
ISO 14229 – Unified diagnostic services (UDS)
The ISO 14229 standard defines the actual diagnostic services used in automotive ECUs. These services can be used to upload and download software and data to the ECU, read and erase the fault codes and etc. Note, that the standard does not depend on a specific type of data link, but rather rely on application layer protocol functionality to send and receive the data. In reality, the underlying communication protocol imposes the actual limitation on the maximum data length. The ISO14229 standard consists of the following parts:
在这里插入图片描述