Verifying ECUs With Hardware-in-the-Loop Testing

Agile controller testing can support short turnaround times and ensure high quality.

Nadja Müller, Author and Journalist

July 23, 2024

7 Min Read
electronic control units hardware-in-the-loop testing
Speedgoat solutions allow customers to continuously verify and validate their designs along a complete model-based design workflow.Speedgoat

At a Glance

  • Electronic control units receive sensor inputs, drive actuators, monitor signals, & interface with other embedded systems
  • Hardware-in-the-loop (HIL) testing allows engineers to test ECUs, software, & hardware against real-world inputs & conditions
  • HIL testing eases the process & reduces costs, avoiding costly prototypes & providing automated, 24/7 testing

Electronic control units (ECUs) are vital embedded systems in vehicles; as such they impact numerous functions in a car and therefore must undergo rigorous testing. In any test workflow, hardware-in-the-loop testing (HIL) is imperative, because it allows engineers to test ECUs under real-world conditions using digital twins of the various systems in the car instead of actual hardware. For successful HIL testing, companies require a flexible and integrated platform for creating the digital twins through simulation all the way to continuous and automated testing. HIL testing accelerates development, increases safety, and is cost effective when implemented well.

As embedded controllers, ECUs manage various tasks. They receive sensor inputs, drive actuators, monitor signals, and interface with other embedded systems. ECUs need to provide precise and deterministic control feedback quickly. For instance, an ECU must provide control signals for highly dynamic subsystems such as high-performance racecar powertrains.

Electronic Control Unit (ECU) Testing

The ECU is a safety-critical component, and its optimal functional robustness can only be achieved by rigorous testing in an iterative process. Therefore, the risk of potential malfunctions is minimized.

Testing ensures safe operation under all conditions, including extreme ones. By testing continuously, bugs can be detected early in the development process when they are still easy to catch. Such testing avoids delays and reduces costs.

In the context of high-performance racecars, short turnaround times and agility are key for updating controller functions. McLaren Applied for example—which will be providing all F1 teams with the essential ECU from 2026 onwards—tests and develops with Speedgoat.

"McLaren Applied is proud to have been selected to provide the new Standard ECU (SECU) to FIA Formula 1 in the 2026, 2027, 2028, 2029, and 2030 seasons. Speedgoat test systems enable us to rigorously, continuously, and efficiently test all involved systems, both during the development phase of the products and for continued testing of software developments throughout the life of the products," according to Max Smith, program manager at McLaren Applied.

Furthermore, ECUs are embedded components in a complex system of actuators and other ECUs, and testing ensures they interact flawlessly. It ensures joint operation and helps detect and resolve common communication issues. In essence, testing enables meeting quality standards, ensures customer satisfaction, and may prevent iterations late in the process. 

The development process can involve various testing methodologies and different levels of testing. The early ECU design is tested using model-in-the-loop (MIL), software functionalities are validated with software-in-the-loop (SIL), and HIL testing allows engineers to test ECUs, software, and hardware against real-world inputs and conditions. In the testing process, the ECU undergoes verification against defined requirements through meticulous test plans that include various sets of inputs and accepted ranges for the results. It also undergoes system-level integration tests involving other controllers and emulated or real plant components.

ECU Testing Challenges  

ECU testing is a complex task. As an ECU can handle many control functions, the whole system needs to be comprehensively tested to ensure that all functions and their dependencies are validated. System-level testing of ECUs can be tricky because different suppliers are involved. Communication issues and unexpected system behavior may occur. Another challenge is safety. Tests, including all operating scenarios and faulty conditions, must be conducted without endangering people or damaging hardware. 

On the other hand, short turnaround times and agility are key for innovation and a fast distribution of updates. Teams need to be able to squeeze out every bit of performance during testing and still comply with the rules and standards. The latter typically requires traceability of the test results.

Speedgoat_HIL_Automotive_02.jpg

Hardware-in-the-Loop (HIL) Testing

HIL testing is a key part of a testing workflow to validate control systems and ECUs, during which the device under test (the ECU) is connected to the HIL test system through real I/O connectivity and communication protocols.

An HIL test setup comprises three main components:

  • The device under test (ECU) and additional components like domain controllers, sensors, and actuators.

  • An HIL test system with a real-time capable processor that runs the emulated plant components (also called digital twin) and includes I/O connectivity and protocols to emulate signals for communication with the ECU and to acquire data.

  • A workstation-running application software that supports running the HIL tests and enables test automation.

Why HIL Testing Is Necessary

Let's imagine you are testing an electric drive controller and connecting it to the physical plant, like a power inverter and electric motor. Once the system is energized, it becomes dangerous. Testing the controller with a virtual HIL setup ensures safety and minimizes the risk of damaging equipment. Edge cases and tests under faulty conditions can be conducted with high reliability and without endangering people or damaging hardware. HIL testing facilitates the process and reduces costs, because costly prototypes and time spent on the test track can be avoided. Engineers are also less dependent on hardware lead times. Tests can be automated, run 24/7, and be triggered continuously upon every control design update. When testing is perceived as easy, and when test results are available quickly, engineers are more innovative. They get instant feedback on their designs and don't have to wait until their novel algorithms run on the ECU and get tested.

Establishing a HIL setup is complex, and companies may face problems. Firstly, some don't have the know-how to set up an HIL test system. Trivialities like implementing protocols and interfaces may introduce bottlenecks. Also, connecting to third-party software and hardware may sometimes lead to substantial integration efforts. Companies may overlook the need for additional I/O or have trouble getting support, or the models don't run in real-time. They are busy setting up the tests and lose a lot of time. Also, system complexity increases, and power efficiency and safety requirements become stricter, demanding traceability and certification.

As the competition is tough and technology is advancing, it can be challenging to keep pace. Companies need to manage many software variants and HIL setups. At the same time, development cycles get shorter and shorter. Trends like software-defined vehicles (SDV) make it necessary to upgrade ECUs during their entire lifecycle: Testing never ends, meaning testing continuously becomes a requirement.

combination_view2_marmot.png

An Integrated Platform for HIL Tests 

To develop, manage, and execute HIL test campaigns, companies need a flexible and integrated solution and tools that support these challenges. Speedgoat test systems, together with MATLAB and Simulink (from MathWorks), form a powerful and unified test platform that enables engineers to work in one integrated system. Engineers use the same environment to design controls and perform HIL tests. Software and hardware are designed for one another, so there are no interoperability issues. Updated models can be deployed with a few clicks, and engineers can switch between desktop and real-time execution flawlessly. 

Such a platform must be scalable—the test system can scale with the models' complexity or evolving I/O. Setting up the interface from the model to the controller hardware takes a few clicks. Simulink dashboard components and MATLAB apps allow engineers to administrate and automate testing tasks efficiently. 24/7 HIL testing with continuous integration becomes the default.

The Speedgoat/MathWorks solution supports ASAM XIL-compliant third-party tools for test automation. Furthermore, the solution supports all major standards, networks, and protocols, such as ISO 26262 for ASIL-A to -D, CAN, and Automotive Ethernet or AUTOSAR. 

As a fully serviced solution, Speedgoat also offers engineering services that help integrate complex and custom rack-based HIL test systems, including signal conditioning and cabling as well as training and consulting services. Hardware repair and software maintenance offerings ensure that downtimes are avoided (or kept to a minimum) and that the system remains up to date.

Conclusion  

HIL testing allows engineers to vet ECUs before testing them with the real system. The virtual setup also creates a safe testing environment for edge cases without the risk of harming people or damaging hardware. It makes testing more accessible and faster while reducing costs and pushing innovation. The key to success is a unified design and testing environment. It allows for fast setups as well as continuous integration and automation. 

About the Author

Nadja Müller

Author and Journalist, Wordfinder

Nadja Müller was born in 1984 in Weinheim, Germany. She studied Art History at the University of Heidelberg, interned at the local Rhein-Neckar-Zeitung, and worked as an editor for six years.

Today, Müller works as an author, content manager, and freelance journalist specializing in digitalization, economics, and social media. She authored the article, "Verifying ECUs with Hardware-in-the-Loop Testing," on behalf of Speedgoat.

Sign up for Design News newsletters

You May Also Like