How the J1939 protocol works
How the J1939 protocol works
Are you familiar with the J1939 communication protocol?
This standard operates over CAN-type serial networks and is prevalent in the automotive market for communication among the various devices found in large vehicles, such as agricultural machinery, forklifts, backhoes, cranes, and more.
In today`s article, we will provide a brief introduction to the Controller Area Network (CAN) and explore the details of how the J1939 communication protocol operates and its utility in vehicular communication networks.
Understanding the CAN-type communication
Controller Area Network (CAN) is a serial network technology originally designed for the automotive industry but has since become popular in other industrial automation applications. The CAN bus is primarily used in embedded systems and, as the name suggests, is a network technology that provides rapid communication between microcontrollers with real-time interaction requirements.
The CAN serial standard employs a high-speed half-duplex system, which gives it superior performance compared to conventional serial technologies like RS-232. This functionality of the standard eliminates the need to use a dual-port RAM, which has higher costs and complexity for implementation.
When it comes to short reaction times, error detection, and fast recovery, CAN outperforms even the TCP/IP standard. While TCP/IP is designed for the transport of large amounts of data, the CAN model uses smaller packets and has real-time requirements with a transmission rate of 1 Mbit per second. This performance can easily surpass a 100 Mbit per second TCP/IP connection.
In addition to being used as an embedded communication system for microcontrollers, the CAN communication standard can also be applied as an open communication system for intelligent devices. Today, for example, this technology is found in robotic solutions for medical engineering, a field that uses CAN due to its ability to meet stringent safety requirements.
The greatest advantage of CAN technology lies in the reduced cabling volume required and its well-developed collision prevention standard, ensuring that no data is lost during message transmission.
Now that you have some understanding of CAN technology, let`s discuss the J1939 protocol, a communication standard widely used in construction vehicles, material handling, industrial transportation, agricultural machinery, and many other applications.
Introduction to the J1939 Communication Protocol
Launched in 1994 by the Society of Automotive Engineers (SAE), J1939 is a high-level protocol that operates based on the CAN standard. It provides serial-type communications between microprocessors in heavy-duty vehicles with diesel engines. Communication networks operating on this protocol are typically used for exchanging messages regarding various variables, such as vehicle speed, transmission torque control to the engine, oil temperature, and much more.
To effectively carry out this communication, J1939 establishes a standard procedure, determining how Electronic Control Units (ECUs) should interact with each other or with embedded electronic systems. These units and systems can, for example, be used for the collection, processing, and sharing of diagnostic data, such as GPS positioning.
The use of J1939 as a standard protocol brings numerous benefits, the first of which is the creation of a universally shared "language" for resource interaction. This allows heavy-duty vehicles to be equipped with devices from different manufacturers without compatibility issues between equipment.
How the J1939 protocol operates
The J1939 protocol operates based on message distribution via broadcast, meaning that they do not have a specific recipient. This allows any device to use the data without requiring additional request messages.
When a message needs to be directed to a specific recipient, a destination address can be included in the message identifier. This type of directed message can be used, for example, to request a specific engine torque value. It is advisable to make this directed request to avoid overloading other devices.
The J1939 protocol uses a 29-bit identifier defined by the CAN 2.0B model. The identifier is used slightly differently in a message with a destination address compared to a broadcast message.
This message identifier includes a field called PF, which determines whether the packet should be transmitted to a specific destination address or if it is a broadcast.
If the PF value is between 0 and 239, the message is addressable, and the next field, called PS, contains the destination address. If the PF value is between 240 and 255, the message is a broadcast, and the PS field contains a Group Extension, which expands the number of possible transmission parameters represented by the identifier.
Each device in a CAN network operating on J1939 has a Name, a unique 8-byte identifier. The main purpose of the Name is to describe an ECU. When claiming an address, the Name is used to determine which element in the network has higher priority and, therefore, will obtain the claimed address.
Each device on the network must be associated with at least one Name and one address. However, different names and addresses can coexist in a single ECU. For example, an engine and an engine brake can be part of the same device and share its physical bus. In this case, the device`s address defines the message`s origin or destination, while the Name identifies the functionality and adds a unique instance number to it.
The importance of J1939 in vehicular communication networks
The J1939 protocol facilitates the process of collecting, processing, and distributing data from ECUs and other diagnostic resources to the vehicle`s control and supervisory systems. This enables operators and fleet management teams to analyze vehicle performance and make decisions based on real-time updated information.
The information generated through the data collected and transmitted to the control and supervisory systems provides a comprehensive view of the fleet. This feature allows managers to schedule maintenance monitor and address safety and driver performance issues, streamline process compliance with market standards, and enhance system performance.
Ultimately, implementing a system with communication network based on the J1939 protocol can result in fewer unscheduled downtime, reducing maintenance costs and increasing operational efficiency.
See also: The Impact of Hot-Swap Technology on Control Systems
Company develops engine control system with the XP340 PLC
As we have seen so far, the J1939 communication protocol can be an extremely valuable resource in control applications for diesel engines. Recently, one of our partners in Canada utilized the technology of the NextoXpress PLC, Altus line ofcompact PLCs with support forthe protocol, to develop a new control solution for the diesel engine of the pressurization pump used in the flexible pipeline responsible for the correct distribution of fertilizers in the field.
Using the technology of the Nexto Xpress programmable controllers, the solution controls various engine processes, including acceleration, starting and stopping, idling, and shutdown in case of critical failure, such as high coolant temperature, increased outlet pressure, or critical errors in peripheral sensors.
The designed architecture includes a XP340 PLC as the main component. The equipment monitors variables related to different process sensors, including fuel level, inlet pressure, outlet pressure and flow, volume pulse counter (from the flow meter), and engine shutdown.
In the developed application, the Nexto Xpress PLC communicates directly with the engine via the J1939 communication protocol and uses discrete control to drive hydraulic valves, the hydraulic pump, and the primer pump.
More details here: Canadian agribusiness uses CLP Xpress to automate partof its production
Our Nexto Xpress PLC offers support for J1939
Designed to meet the demands of an increasingly connected market, the compact PLCs from the Nexto Xpress line feature a wide variety of communication interfaces and resources. This embedded high technology enables them to be applied in the most diverse solutions in the industrial automation market.
With an integrated CAN interface, Nexto Xpress PLCs natively offer support for the J1939 protocol, qualifying them as a control solution for the agricultural machinery market, onshore oil exploration mobile units, generators and energy systems, mining equipment, among other applications.
In addition to CAN technology, Altus compact controllers also feature Ethernet, RS-232/485, and USB interfaces, enabling support for a wide range of communication protocols, such as MODBUS, PROFINET, EtherNet/IP, CANopen, OPC UA, MQTT, among others. These resources also allow the controller to communicate directly with major cloud hosting services.
Among their many functionalities, Xpress products can be used as IoT gateways for small applications. The family of PLCs can, for example, collect production data in the field via a MODBUS TCP network and send it via OPC UA or MQTT to a supervisory system hosted in the cloud.
Learn more about the Nexto Xpress PLCs and how theycan be your gateway to the world of Industry 4.0.