Hardware-in-the-Loop Simulation: What it means for ECU testing

With rapid advancements in autonomous driving technologies and various convenience features, vehicles now offer a wide array of functionalities. However, as modern vehicles rely on an increasing number of ECUs, HILS ECU Testing has become essential for validating and optimizing software performance before deployment. By simulating real-world driving conditions, HILS ensures that ECUs function reliably before integration into actual vehicles.

This isn’t simply a braggart outfitting of a vehicle. The numerous features offered by modern-day vehicles simply cannot be managed by a single ECU. Multiple ECUs must work together using complex interconnections to delivery seamless, safe functionality

For example, an automatic climate control system operates with the collaboration of several ECUs; one may be managing temperature sensors, while another runs airconditioning, windows, and heaters, and so on. This is a simple example, but for more complex features, dozens of ECUs may be required to perform a single function in perfect unison.

 

Difficulties in Testing

When adding a new feature to a vehicle, it is essential to test and validate the software of the ECUs because unlike hardware defects, software defects often remain undetected during the product development stage, making them difficult to address. Unlike hardware issues, these defects can cause unpredictable and potentially life-threatening outcomes. However, directly testing functions on actual vehicles can be equally risky, so traditionally, prototypes resembling the network environment of a vehicle are used to test functions by combining the relevant ECUs.

However, testing in a network environment is costly due to the exponential increase in the complexity of ECUs and software in recent years.

For example, luxury models like the Mercedes-Benz S-Class, BMW 7 Series, and Hyundai Genesis can be equipped with hundreds of ECUs. Testing a single vehicle function requires assembling a prototype model, a process that is both costly and time-consuming. Instead, automakers increasingly rely on HILS ECU Testing to simulate real-world conditions before deploying physical prototypes. Moreover, luxury sedans often contain over 20 million lines of software code—approximately three times the amount of code found in a large aircraft.

Therefore, assembling and testing hundreds of ECUs for every new feature adds considerable cost and time for manufacturers and suppliers. Testing a single function could mean creating a unique testing environment for all related ECUs, which would vary by vehicle model.

 

HILS Testing

This is where HILS (Hardware-in-the-Loop Simulation) comes in. HILS is a testing technique used to verify the functionality of developed products by simulating their actual operational environment.

In vehicle testing, HILS serves as a simulation system for various ECU functionalities. HILS makes it possible to test everything from individual ECUs to integrated network systems for all driving scenarios before ever testing on an actual vehicle.

Instead of combining physical ECUs into a prototype, HILS testing uses simulations. The testing environment consists of three main components:

  1. Test Input Generator: Generates and provides input values for the test. Tools like fuzzers are included in this component
  2. Target ECU: The specific ECU to be tested
  3. HILS: A virtual controller that mathematically models the vehicle environment and simulates the actual movements of controllers. When needed, real actuators can be connected for experimentation.

In the example provided by below by AUTOCRYPT, you can see how the test process works. The Target ECU is connected to the HILS system, which receives test input values generated by the Fuzzer. The output from the HILS system verifies the functionality of the ECU, eliminating the need to physically assemble all related ECUs for testing. Only the ECU to be tested needs to be connected to the HILS environment.

HILS ECU Testing for Automotive Software - autocrypt

HILS Advantages

While it does not completely eliminate the need for prototype vehicles, simulated testing is generally more cost-effective than creating physical products. It reduces the number of prototype vehicles, and shortens the time and manpower spent on test benches.

HILS also provides a significant advantage in conducting dangerous tests, such as wire breaks, sensor failures, or crash simulations. It is equally effective during the development of control algorithms when the actual components for testing may not yet exist. Furthermore, the ability to conduct tests anytime, anywhere, adds a practical advantage.

HILS ECU testing is not simply at its conceptual stage. The automotive industry has already recognized the importance of HILS testing – in fact, ISO 26262, the international standard for functional safety in vehicles, outlines software validation stages throughout a vehicle’s lifecycle, and recommends HILS testing during unit and integration testing.

For instance, Hyundai Motor Group’s vehicle software development process emphasizes HILS testing in the fifth stage of their V-cycle process, highlighting the growing importance of integrated HILS testing in new vehicle development as automotive control software becomes increasingly complex.

According to Wards Auto, the word “software” was first mentioned in a recall in 1994, and since then attribution to software for recall incidents has risen to 15% by 2023. While, software defects are inevitable as automotive software becomes heavier and more complex, this means conducting comprehensive software testing in advance is that much more essential.

HILS plays a critical role in this process by enabling flexible, unrestricted testing, which also aids in rapid response to software defects. Unlike physical tests, which are hindered by the time and cost of prototype production, HILS allows for swift simulation-based defect analysis and response.

To learn more about how AUTOCRYPT utilizes HILS in its fuzz testing solution, click here.

To learn more about AUTOCRYPT’s use of HILS in its fuzz testing solution and other automotive testing services, contact global@autocrypt.io.

Related Articles