Simcenter Testing Solutions CAN Bus Measurements

2020-07-30T11:16:02.000-0400
Simcenter Testlab

Summary


Details


Direct YouTube link: https://youtu.be/01mN-nFBQSM

 

CAN Bus Measurements

User-added imageCAN is short for Controller Area Network. It is a serial digital bus used to connect different electronic control units found in motor vehicles. These electronic control units monitor thousands of embedded sensors in key components: engines, transmissions, anti-lock brakes, power steering, etc.

CAN bus is found in most modern cars, light trucks, off-highway, and heavy trucks. Some modern vehicles have up to 70 electronic control units. Signals are exchanged between the different components to help optimize fuel economy, ensure safe driving via traction control, etc.

When performing analog noise, vibration, or durability measurements, it is useful to also record the digitized signals of the embedded sensors present on the CAN bus simultaneously with other analog channels:

  • Saves Time – Instrumentation time can be reduced as embedded sensors replace manually installed sensors. For example, rather than instrumenting a tachometer on an engine, the engine rpm can be read directly over the CAN network without installing an extra device.
  • Gain Insight – Comparing the analog measurements to the CAN signals, issues can be diagnosed. For example, when an unwanted vibration occurs during a specific riding maneuver, the CAN signals may show that the transmission is not in the expected gear.

With each passing year, the CAN networks of modern vehicles grow in size, and more signals are broadcast.

This article covers:

  • A history and background about CAN bus
  • Discussion of related CAN protocols including OBD, CCP, Flexray
  • How to measure CAN signals simultaneously with analog channels in Simcenter Testlab (formerly called LMS Test.Lab)
  • Comparison of CAN based versus equivalent analog measurements

History of CAN Bus

CAN bus was developed by Robert Bosch corporation during the 1980s. It was formally introduced at the Society of Automotive Engineers (SAE) Congress In February of 1986.

At that time, electronic controls of various components were becoming popular in motor vehicles. Before CAN bus, the communication between different electronic components in motor vehicles was carried over a wiring harness, as shown in Figure 1.

wiring_harness.png
Figure 1: Wiring harnesses were used to carry electronic signals between different components before CAN bus

Every signal that was being passed back and forth required a dedicated wire and connectors. As electronic controls became more popular, wiring harnesses grew in size, with many wires carrying the signals. This was adding significant weight to vehicles, and also created reliability issues as the number of connections multiplied.

By switching from a wiring harness to CAN bus (Figure 2), the reliability of communication between electronic controllers was greatly improved: multiple digital signals shared a common wire, reducing the number of connectors and wires used in the electronic communications within vehicles.

canbus_network.png
Figure 2: In CAN bus, digital signals are carried on a common wire between different electronic control units

Significant weight savings were also realized. In the late 80s, vehicles that switched from wiring harnesses to CAN bus communication had weight savings on the order of 110 lbs (50 kg) in subsequent models.

Performing CAN Bus Measurements

In many vehicles, there is an OnBoard Diagnostic (OBD) connector. This connector is used to read electronic error codes during vehicle maintenance. Quite often, the OBD connector is also connected to the CAN bus. Not only error codes can be read, but all the CAN signals as well.

When acquiring data over the CAN bus, a DBC file (*.dbc) is used to decode the signals. The DBC file (Figure 3) contains:

  • List of all Electronic Controls Units (ECUs)
  • List of all input and output Signals broadcast between ECUs
  • Scale factor, offset, and default values for each CAN signal

A DBC file is specific to particular vehicle model year and powertrain. It is an ASCII file that can be edited with tools like Notepad. An example of a DBC file’s content is shown in Figure 3.

dbc_file.pngFigure 3: Contents of a DBC file showing the signals carried by two different Electronic Control Units (ECUs)
 

On a typical motor vehicle, there are over 1000 signals broadcast on the CAN bus between the 70 or so Electronic Control Units. Examples of Electronic Control Units include Engine Control Modules (ECMs), Powertrain Control Modules (PCMs), and Transmission Control Modules (TCMs).

With Simcenter Testlab and SCADAS, both CAN protocol 2.0A (11-bit) and protocol 2.0B (the 29-bit version) are supported.

Instructions on how to acquire CAN bus signals with Simcenter Testlab measurements are included at the end of this article.

First some other uses of CAN are covered. The function of CAN bus has expanded since its inception. CAN bus is used in diagnostics, emissions management, and calibration of ECUs.

Legislated OBD Signals

Due to worldwide standards for emissions, there are several legislated signals that are available on most vehicles. These are accessible thru the On-Board Diagnostic (OBD) connection, the same connection that CAN bus signals are typically accessed over.

These legislated OBD signals differ from the CAN bus signals in the following ways:

  • No DBC file required – A DBC file for the specific vehicle is not required to read engine rpm, vehicle speed, and other signals. The signals are standardized, making it possible to record the signals of any vehicle using the same information. ISO 27145 contains the list of “standard” signals which an individual vehicle may carry.
  • Sample Rate - The legislated signals have a slower update rate than normal CAN bus channels.
  • Active vs Passive - These signals are not broadcast by default, and need to be requested by the measurement device. This requires setting the ‘CAN Acknowledge’ mode to ‘Active’ rather than ‘Passive’ in Simcenter Testlab CAN settings.

To utilize the OBD diagnostic messages, see the Knowledge Base article No more tach! Use OBD to get Engine and Vehicle Speed.

CAN bus Calibration Protocol (CCP)

There are many embedded sensor signals that are not broadcast on CAN bus. Some signals are kept internal to particular electronic control unit as shown in Figure 4.

broadcast_vs_nonbroadcast.png
Figure 4: The CCP protocol can be used to request and measure the internal signals of electronic control units

For example, consider a transmission. Some embedded sensor signals are broadcast, some signals are known only to the transmission:

  • Broadcast on CAN - The input shaft speed, output shaft speed, and the transmission gear are normally broadcast to the ECUs in the rest of the vehicle. The engine and other Electronic Control Units need this information.
  • Internal Signals - Other transmission signals, like clutch slip, shiftfork drum position, or intermediate shaft speeds may not be broadcast, as no other component needs this information except for the transmission itself.

Over a CAN bus connection, these internal only signals can be requested and recorded using the CAN bus Calibration Protocol (CCP). In this protocol, an ECU is addressed directly to read or write internal signals over the CAN bus. The address requests are on top of all the existing CAN bus traffic. If enough additional signals are requested, the bus could become overloaded. ISO 22000 contains documentation on how the CCP protocol works.

To request and access signals over CAN bus with the CCP protocol, an A2L (*.a2l) file is required. An A2L file is specific to model year, powertrain configuration, and electronic firmware version of the vehicle.

To utilize CCP with Simcenter Testlab, a gateway device is used to translate the CCP signals to standard CAN bus signals. The gateway device is setup with the A2L file and outputs the requested signals onto as CAN bus signals. The gateway device also produces a DBC file. The DBC file and translated CAN bus signals are read by the standard CAN bus interface on the SCADAS.

FlexRay and CAN FD

Flexray and CAN FD are both successors to the original CAN bus that was developed in the 1980s.

Flexray was developed starting in 2000. It was designed to be faster and more reliable than CAN bus, but is more expensive to incorporate in a vehicle design:

  • CAN bus speeds are on the order of 1 Megabit per second versus 10 Megabit per second for Flexray.
  • Flexray has replaced CAN bus primarily in high-end automobiles, starting around 2007.
  • To utilize Flexray, a file with extension *.fibex is required.

Flexray is supported by Simcenter Testlab and SCADAS. A specific Flexray input card is required for the SCADAS.

CAN FD is also a successor to CAN bus, started around 2012:

  • FD is an acronym for Flexible Datarate. Data can be transmitted faster than the original CAN speeds.
  • File extension is *.autosar or *.dbc. Simcenter Testlab supports CAN FD with *.dbc with Release 18. Support for the *.autosar is planned for Simcenter Testlab release 2020.1.
  • Starting to appear in commercial vehicles around 2019.

CAN FD is supported with Simcenter Testlab Revision 18 and with the following hardware:

  • SYSCON4 controller (the communication card that comes as part of Simcenter SCADAS hardware):
User-added image
  • Latest CN4-II card:
User-added image
 
The CN-II module is backward compatible with older controller cards, and either hardware mentioned above can acquired CAN FD independently of the other.  In other words, no need to upgrade to a SYSCON4 in case a CN4-II is being used or vice versa.

CAN bus in Simcenter Testlab

First connect the SCADAS to the CAN bus. All SCADAS units equipped with CAN bus have either a direct 9-pin connector or 9-pin adaptor cable as shown in Figure 5.

scadas_can_connection.png
Figure 5: CAN bus connectors on SCADAS hardware

The SCADAS then needs to be connected to the vehicle via an Onboard Diagnostics (OBD) connector cable. The OBD connector is located beneath the dashboard on many vehicles. To connect to the 9 pin connector of the SCADAS, an OBD to 9 pin cable is needed. Cables and OBD location are pictured in Figure 6.

obd_cable_and_connector.png
Figure 6: Right - Typical location for OBD connector on vehicle under dashboard, Left - A 9 pin to OBDII cable connects a SCADAS to a vehicle

To acquire CAN bus based signals simultaneously with analog measurements, turn on “Vehicle Bus” add-in of Simcenter Testlab Signature as shown in Figure 7. The add-in menu is located under “Tools -> Add-ins” from the main Simcenter Testlab (formerly called LMS Test.Lab) menu.

addins.png
Figure 7: Turn on "Vehicle Bus" from "Tools -> Add-ins" in the main Simcenter Testlab menu

Go to the ‘Channel Setup’ worksheet. In the upper right corner, select ’CAN Settings’ from the drop down menu (Figure 8).

can_settings.png
Figure 8: In the upper right of the 'Channel Setup' worksheet, select 'CAN Settings'

In the CAN settings menu, select a DBC file by clicking on the “DB Path” cell as shown in Figure 9. This makes the CAN channel information available inside of Simcenter Testlab for selection. Later, if the DBC file is changed or modified, it needs to be reselected thru the DB path menu.

db_path.png
Figure 9: Click on the “DB Path” cell and select the DBC file

After selecting the DBC file, change the baud rate, CAN device, and CAN Acknowledge mode (Figure 10).

can_sig_settings.png

Figure 10: Select the baud rate, CAN device, and CAN Acknowledge mode

The following should be selected:

  1. View in Can Overview – Check this box ON to see CAN channels.
  2. Baud Rate – Baud rate in bits per second. Possible rates are 125000 bit/s, 250000 bit/s, 500,000 bit/s and 1,000,000 bit/s. For most vehicles this is “500000”.
  3. CAN Device – This is the physical card in the SCADAS. For example, on a SCADAS Mobile, there are built-in CAN ports and optional CAN cards. This field allows the proper CAN input to be selected. "XS 1" is the built-in CAN port on a ScadasXS.
  4. CAN ACK – Set the CAN acknowledge mode to ‘Passive’. Because CAN signals are already broadcast, the ‘Active’ mode is not required.

Individual channels can be selected for viewing and recording from the CAN bus DBC file as shown in Figure 11.

can_sig_channel_selection.png

Figure 11: Selecting individual CAN channels for recording and viewing


To view and record individual CAN channels:

  1. “Show All” button – Press the “Show All” button and all CAN channels will be listed.
  2. Filter – There can be over a thousand channels in a CAN DBC file. To find an individual channel, enter all or part of the CAN name and press return. For example, to find engine rpm, try typing “rpm” and pressing return.
  3. Selection – Click ON the Selected field to view/record desired channels.
  4. “Apply” button – Press Apply to make the selected CAN channels active.

After pressing “Apply”, the CAN channels should be listed in the Channel Setup (Figure 12). Switch to the channel setup view by using the toggle in the upper right of the worksheet.

can_sig_channel_setup.png

Figure 12: Channel Setup with analog (top) and CAN bus channels (bottom)

In the Channel setup mode, do the following:

  1. Channel Setup – In the upper right, toggle from CAN Settings to Channel Setup.
  2. Upper/Lower – The analog channels listed at top. The CAN channels are listed in the lower right.
  3. Raw CAN bus – In the lower left, there is a CHECKBOX which is on by default to record the entire raw CAN bus signal. The raw CAN signal can be decoded with a DBC after the measurement is performed.

In the ‘Measure’ worksheet, the CAN bus channels can be displayed while measuring as shown in Figure 13.

can_display.png

Figure 13: Select channels to display from the ‘Data Explorer’ and drag and drop them in displays

To display CAN bus data in the Measure worksheet:

  1. Open Display – Click on one of the icons to create a display for viewing data.
  2. Data Explorer – To select the data to view in the display, navigate into the “Online Data -> Fixed sampling -> Monitor -> Time History” folder.
  3. Drag and Drop – Any data with a blue icon and be dragged and dropped into the display.

Comparison of CAN and Analog Measurements

How does the RPM from CAN bus compare to an analog measured rpm? A comparison of a tachometer and CAN based rpm is shown in Figure 14.

comparison.png

Figure 14: Comparison of CAN bus engine RPM to tachometer based RPM

Reading the engine rpm from CAN bus directly can save the time of instrumenting a tachometer.

Any CAN based signal can be used for tracking in Simcenter Testlab Signature. For example, an engine runup can be tracked versus the engine rpm from CAN as shown in Figure 15.

tracking_on_can_channel.png

Figure 15: In Simcenter Testlab Signature, a CAN channel can be used for tracking

In the ‘Tracking Setup’ worksheet, set ‘Tracking Method’ to ‘Static’ to use the CAN bus channel for tracking rather than the tachometer.

 

Questions? Email peter.schaldenbrand@siemens.com or contact Siemens Support Center.  Also see the knowledge article: Simcenter Testlab: Tips for Trouble-free CAN Bus Operation.

 

Standards

CAN and its various evolutions started with industry consortiums, and then evolved into ISO standards:

  • ISO 11898 CAN bus
  • ISO 27145 – OnBoard Diagnostics OBDII
  • ISO 17458 – FlexRay standard
  • ISO 22000 – CAN bus Calibration Protocol CCP/XCP

Related Links:

KB Article ID# KB000043063_EN_US

Contents

SummaryDetails

Associated Components

Simcenter Testlab Digital Image Correlation Testlab Environmental Testlab Acoustics Testlab Data Management Testlab Desktop Testlab Durability Testlab General Acquisition Testlab General Processing & Reporting Testlab Rotating Machinery & Engine Testlab Sound Designer Testlab Structural Dynamics Testlab Turbine