Professional Documents
Culture Documents
The Challenge:
Merging the J1939 protocol into the CAN bus communication platform design.
Read
the
Using NI LabVIEW system design software and an NI PXI CAN communication module to design a method to filter J1939 protocol Full
Case
IDs to receive and send multiple frames according to protocol format and construct a CAN communication platform. We also
Study
implemented a complete vehicle hardware-in-the-loop (HIL) electrical environment simulation, and constructed an engine bench
test platform that includes CAN bus message sending and receiving, storage, and real-time display.
The Solution:
Author(s):
- Dongfeng Motor Corporation
All commercial vehicles meeting Chinese National III through National IV emission standards use the CAN bus to communicate
between electronic control units (ECU), including the vehicle ECU (VECU), engine ECU (EECU), automatic transmission box
ECU, instrument ECU, and antilock braking system ECU. The vehicle control network has implemented the commercial vehicle
CAN bus based on the J1939 protocol, combined with the multipoint control unit (MCU), CAN controller, and MCU node CAN
transceiver structure. Existing solutions for road tests, engine bench tests, and vehicle electrical environment HIL simulation
tests that include a PC, CAN communication module, and software are extremely costly.
1/4
www.ni.com
Module Interface
The module interface consists of an NI PXI-CAN dualport transceiver, an SJA1000T CAN controller, a TJA1041T high-speed
CAN transceiver, and a TJA1054AT low-speed CAN transceiver. The J1939 protocol data link layer packs messages according
to PDU format, and performs CAN data frame synchronization, sequential control, error control, and flow control.
According to the J1939 physical layer protocol, each network segment can include
Up to 30 ECUs
A CAN bus communication rate of 250 kB/s
Bus voltage that includes dominant and recessive levels
A differential voltage of 3.5 V or 1.5 V
Additionally, the CAN bus transceiver converts the voltage level between the CAN bus and the MCU.
Software Design
As shown in Figure 3, the CAN bus message based on the J1939 protocol multitask processing flow uses a producer and
consumer loop structure. The producer loop uses the elements enqueue function to add data to the message cluster queue, and
the consumer loop uses the element dequeue function to move data out of the message cluster queue. The queue
communicates between loops to avoid conflicts between multiple tasks. When data production is faster than data consumption,
the queue buffers avoid message data loss.
Figure 3. CAN Bus Multitask Message Transceiver Based on LabVIEW and the J1939 Protocol
Implementation
As shown in Figure 4, we implemented the CAN bus communication platform based on LabVIEW and the J1939 protocol in an
HIL vehicle electrical environment simulation for a message receiving test. We simultaneously compared it against the Vector
CANoe module. Figure 7 shows the EECU message received from a steadily running engine. In one second, the system can
receive a 526-frame message from the EECU without losing a message.
The engine fuel consumption message reveals engine fuel efficiency in real time. The VECU receives the message in the CAN
bus network according to commercial vehicle J1939 protocol to control the automatic gearbox vehicle shifting. The combined
instrument ECU receives and displays this message in real time to remind the driver of good driving habits and manipulate the
vehicle to achieve the best fuel efficiency. For optimal engine performance, efficiency, and emissions standards, we calibrate
the EECU to obtain the best injection pulse-width calibration parameters. After calibration, we conduct a comparative test to
verify EECU calibration effects.
An engine steady state test can reveal vehicle performance at a constant speed. An engine transient test in variable working
conditions simulates engine state in actual road conditions. By comparing the real-time fuel consumption message and the
actual instantaneous fuel consumption measurement, we determine the EECU control performance.
2/4
www.ni.com
Figure 6. CAN Bus Communication Platform Based on LabVIEW and the J1939 Protocol Implementation
3/4
www.ni.com
Figure 8 shows a comparison measuring the engine transient fuel consumption bench test curve in 10 working conditions. The
EECU fuel consumption message data received and parsed by the CAN bus according to the J1939 protocol is markedly
different when the engine is running under low load, compared with the test and bench fuel consumption meter. Thus, actual
fuel injecting is low when the engine is running under low load. Target and actual fuel injection amount varies greatly due to
common rail pressure fluctuation when the engine is running under low load, causing fuel quantity fluctuation. The two curves
are generally consistent: Engine fuel injection target values received through the CAN bus are very similar to actual measured
values, and the trend and timing are synchronized. This means that EECU calibration obtained the best injection pulse width
target value.
CAN Bus Communication Platform Based on LabVIEW and the J1939 Protocol Implementation
Legal
This case study (this "case study") was developed by a National Instruments ("NI") customer. THIS CASE STUDY IS PROVIDED "AS IS"
WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN
NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
4/4
www.ni.com