Understanding J1939 and CANbus doesn’t have to be complicated even though it is such an important aspect of communication in heavy-duty vehicles. Here we intend to demystify these systems for you.
Starting at the beginning, SAE J1939 is essentially a set of standards that define how electronic control units (ECU) or electronic control modules communicate via a CANbus network in heavy-duty vehicles.
The SAE J1939 has been in operation since 1994 (J1939-11, J1939-21, J1939-31) but it wasn’t until 2000 that CAN was officially included as part of the standard.
CANbus is like the nervous system of a vehicle, connecting all the ECUs and enabling them to communicate vital data to each other. It is a central piece of equipment which facilitates smooth operation of the vehicle, can aid with maintenance and can monitor and solve issues before they occur. It is commonly used in most vehicles. However, it must be realised that the CANbus is itself only a tool rather than a communication language and therefore it needs to run alongside other systems.
For many heavy-duty vehicles the mode of communication – which is carried by the CANbus is the SAE J1939 standard. J1939 takes advantage of CAN features such as:
- Maximum reliability
- Excellent error detection and fault confinement
- Collision-free bus arbitration
Higher Level Protocols
The CANbus runs on two layers – the lower levels and the higher levels. The higher layer protocols make it easier to add extra network management features using extension software.
For example, SAE J1939 provides a higher-level protocol (HLP) based on CAN as the ‘physical layer’ which provides a form of communication across control units and across manufacturers.
Another example is NMEA 2000, which is compatible with CANbus used on road vehicles and engines. This higher-level protocol format is based on J1939 with specific messages for marine environments. NMEA 2000 is essentially a ‘plug & play’ standard often abbreviated to NMEA2k or N2K and standardised as IEC 61162-3 and is used for connecting marine displays within boats and ships providing a similar function as the J1939 on road vehicles.
Tier 4 is another aspect of the J1939 protocol more specifically an emission regulation for non‐road diesel engines.
It was introduced by the Environmental Protection Agency (US) and is aimed at reducing the amount of particulate matter, black soot or nitrogen oxides (NOx) emitted by a diesel engine by 95%. Tier 4 are the strictest of the EPA protocols and were introduced between 2008 and 2015 and have already had a great impact on reducing levels.
Meeting Tier 4 protocols can be monitored using an Engine Control System (ECU) which communicates through the CANbus reporting on pressure, temperatures, regeneration requirements, and engine faults.
SAE J1939 characteristics
The J1939 protocol has a set of defining characteristics which include:
- Higher Layer Protocol using CAN as the physical layer
- Shielded twisted pair wire
- network length of 40 metres (~120 ft.)
- Standard baud rate of 250 kBit/sec
- Maximum 30 nodes (ECUs) in a network
- Maximum 253 controller applications (CA) where one ECU can manage several CAs
- Peer-to-peer and broadcast communication – most messages are broadcast on the CANbus although some is only available if requested
- Support for message length up to 1785 bytes
- Definition of Parameter Groups (Predefined vehicle parameters)
- Network Management (includes address claiming procedure).
- Address Claim procedure which automatically assigns addresses to each Controller Application
- Suspect Parameter Numbers (SPN) which define the data type and use for each parameter in a parameter group. The Parameter Group Number is embedded in the 29-Bit CAN message identifier
There are however some restrictions to SAE J1939 which were self-inflicted by the SAE (SAE International, formally the Society of Automotive Engineers) which include:
- Maximum network length of 40 m (roughly 120 ft.)
- Baud rate of 250 kBit/sec
- Maximum number of nodes (30)
CAN was designed to be as close to real-time applications as possible, but this level of performance is not required for J1939 so instead running at 1 Mbit/sec, J1939 limits itself to 250 kbit/sec. These restrictions were put in place with the intention of adding extra security as well as maximising runtime capabilities by not working the system to capacity.
PGNs and SPNs
J1939 messages are identified by 18-bit Parameter Group Numbers (PGNs) whereas the J1939 signals are called Suspect Parameter Numbers (SPNs). PGNs with up to 1785 bytes are supported by the J1939 transport protocol.
The PGN acts as a unique frame identifier within the J1939 standard. So, if you need to decode a frame you will need to look up the 18-bit PGN not the 29-bit CAN ID. This can then be referenced with the SAE J1938-71 document which will show what the code refers to, as well as priority, transmission rate, and associated SPNs.
SPNs are grouped by the PGNs and are described by their bit start, bit length, scale and offset which is required to decode the J1939 parameters. To do this manually is tedious and open to human error which is where data logging comes in.
Once a CAN logger is connected it starts recording all the raw CAN frame data on the bus onto an SD card. This can then be opened in a software tool (e.g. asammdf). This will bring up all the raw data which can then be decoded using a CAN database or DBC file. Most CAN bus software is compatible with DBC files. This will then change the raw data into a file of all the SPNs which were matched by the DBC. This can include engine speed, wheel speed, fuel rates, GPS positions, and oil temperatures.
The Value of J1939
On trucks, buses or tractors the J1939 standard could be invaluable for fleet management to reduce running costs or improve safety. Some Internet of Things devices also use J1939 and this can be used in predictive maintenance. Using trouble codes, it is possible to predict issues and therefore reduce down time and save money.
These data loggers are coming down in price and as they can record historical data they are often being used in ‘black boxes’ to diagnose issues or warranty disputes.
At Veethree Technologies our range of displays are all capable of running to J1939, Tier 4, and NMEA 2000 standards with sample libraries in our SDK to assist you with bespoke development and compatible hardware. You can find out more about our range of displays here.