Thursday 7 April 2011

Introduction and Overview of SAE J1939

This article is intended to give engineers a brief overview of the SAE J1939 protocol and how J1939 networks operate. For additional information, including source code, CPU benchmarks, protocol specifications and a presentation on J1939, visit our link at the bottom of this article.

SAE J1939 is the standard communications network for sharing control and diagnostic information between electronic control units (ECUs) which reside on heavy duty and commercial vehicles. Examples of such vehicles are school busses, cement mixers, military vehicles, and semi-tractors. Due to its popularity and success, it has been adopted by the agricultural (ISO 11789) and marine industries (NMEA2000).

SAE J1939 has been used for 18 years and is replacing, SAE J1587/J1708, which is the previous standard communication network for heavy duty and commercial vehicles. J1587/J1708 has been used for 27 years, and as of the year 2011, some OEMs are still using both J1587/J1708 and J1939 networks.

J1939 Overview:

SAE J1939 is a high level communications protocol, which operates on a Controller Area Network (CAN) bus. J1939 specifies exactly how information (e.g. engine RPM) is exchanged between electronic control units on a vehicle.

It defines the data's priority, size, scaling, offset, and transmission rate. For example, J1939 specifies wheel speed to have a default priority of 2, a size of 16-bits, a resolution of 1/256 km/h, an offset of 0, and a transmission rate of 20 ms.

The standard goes on to define additional aspects, including how large messages are fragmented and reassembled, message timeouts, network speed, the physical layer, and how applications, not ECUs, acquire network source addresses.

J1939 Messages:

J1939 messages are defined and identified by their Parameter Group Number (PGN), which is a unique number assigned to every message. The PGN serves to identify the message and its data. Typically a message will contain a group of parameters, which is where the name Parameter Group Number came from. However, sometimes a message will contain a single parameter. An example of a single parameter is the Vehicle Identification Number, or VIN, which is sent in a single message fragmented over multiple CAN data frames.

The vast majority of messages contain a group of parameters. A good example of this, is PGN 65,134 which is the "High Resolution Wheel Speed" message. This message contains 4 parameters: "Front Axle - Left Wheel Speed", "Front Axle - Right Wheel Speed", "Rear Axle - Left Wheel Speed", and "Rear Axle - Right Wheel Speed".

Altogether in the standard there is a total of 8,672 PGNs. And because there is still an unused reserved bit, future expansion is still possible.

J1939 Parameters:

J1939 parameters are defined and identified by their Suspect Parameter Number (SPN), which is a unique number assigned to every parameter. For example, the above mentioned parameter "Front Axle - Left Wheel Speed", has a SPN of 1,592. The purpose of the SPN is to identify a certain parameter without having to use its text representation of "Front Axle - Left Wheel Speed".

One use of the SPN is when a failure occurs and a fault messages is transmitted, the data portion of the fault message will contain the SPN of 1,592. This method allows the receiving controller application to know exactly what failed, without having to send the text representation. It is important to note, and a common misconception, that the SPN is not used under normal operating conditions.

J1939 Message Sizes:

J1939 has three different allowed message sizes, they are: 3 bytes, 8 bytes, and variable length. The vast majority of J1939 messages are 8 bytes long. The 8 byte length comes from the fact that the largest single CAN data frame holds 8 bytes of data. Fully packing single CAN data frames increases the efficiency of the network bandwidth by minimizing the number of messages. To understand the associated overhead of CAN data frames in detail, refer to the CAN specification which can be found on our J1939 Software page.

Variable length messages are messages with a length from 9 to 1,785 bytes. These messages are too large to fit in a single CAN data frame and must be fragmented by the transmitter and reassembled by the receiver. This process of fragmenting and reassembling messages is known as the "Transport Protocol" and is layer four in the OSI seven layer model. The "Transport Protocol" is defined by the J1939-21 document.

There is only one message which is three bytes in length, and that is PGN 59,904 which is the "Request" message. The "Request" message is used to request PGNs which have a transmission rate of 'on request'. For example, the Vehicle Identification Number (VIN), has a transmission rate of 'on request'. Therefore, the VIN is never present on the J1939 network unless an ECU sends a "Request" message containing the PGN for the VIN message.

J1939 Physical Layers:

There are two defined physical layers, J1939-11 and J1939-15, with a third physical layer, J1939-14, drafted. These physical layer specifications detail a large amount of information. The most common points of interest for engineers are: maximum backbone length, maximum stub length, maximum number of ECUs, minimum and maximum voltage levels for the network, minimum and maximum bit time, and minimum and maximum slew rate for signal transitions.

J1939-11 specifies a shielded twisted pair of wires with a maximum backbone length of 40 meters. It uses a three pin connector and allows for up to 30 nodes. It has a bit time of 4.00 us with a tolerance of 0.05%.

J1939-14 is a new physical layer which is currently in the draft process. The primary purpose for this specification is to double the network speed from 250 Kbps to 500 Kbps. Although this specification is still a draft, as of 2010 there were heavy duty vehicle OEMs implementing it on their vehicles.

J1939-15 specifies a reduced physical layer which is a lower cost version of the -11 layer. It uses an unshielded twisted pair of wires with a maximum backbone length of 40 meters. It uses a two pin connector, as opposed to three pins for -11, and allows for up to 10 nodes. It also has a bit time of 4.00 us with a tolerance of 0.05%.

J1939 Specifications:

J1939 Serial Control and Communications Vehicle Network
J1939-01 Control And Communications Network for On-Highway Equipment
J1939-02 Agricultural and Forestry Off-Road Machinery Control and Communication
J1939-03 On Board Diagnostics Implementation Guide
J1939-05 Marine Stern Driveand Inboard Spark-Ignition Engine On-Board Diagnostics
J1939-11 Physical Layer - 250k bits/s, Twisted Shielded Pair
J1939-13 Off-Board Diagnostic Connector
J1939-14 Physical Layer, 500K bits/s
J1939-15 Reduced Physical Layer, 250K bits/s, Un-Shielded Twisted Pair (UTP)
J1939-21 Data Link Layer
J1939-31 Network Layer
J1939-71 Vehicle Application Layer
J1939-73 Application Layer - Diagnostics
J1939-74 Application - Configurable Messaging
J1939-75 Application Layer - Generator Sets and Industrial
J1939-81 Network Management
J1939-82 Compliance - Truck and Bus
J1939-84 OBD Communications Compliance Tests - Heavy Duty Vehicles

JR Simma is founder and president of Simma Software, Inc., which specializes in highly optimized real-time communications software for the automotive industry. JR Simma earned his Computer Engineering degree from Purdue University and has led or assisted with more than 100 embedded systems including software for the Mir space station. To learn more about J1939 Software, visit http://www.simmasoftware.com/

Article Source: http://EzineArticles.com/?expert=JR_Simma

No comments:

Post a Comment