Agile Controller Testing Shortens Turnaround Times and Ensures High Quality
What you’ll learn:
- Hardware-in-the-loop (HIL) testing enhances the verification of ECUs by simulating real-world conditions using digital twins.
- The key benefits of an integrated HIL testing platform include accelerated development cycles, improved safety, and cost reductions.
- Continuous and automated testing maintains high-quality standards and assures seamless operation in complex automotive systems.
As vital embedded systems, electronic control units (ECUs) impact numerous functions in a car and thus must undergo rigorous testing. Hardware-in-the-loop testing (HIL) is imperative in any test workflow because it enables engineers to test ECUs under real-world conditions using digital twins of the various systems in the car instead of actual hardware (Fig. 1).
For successful HIL testing, companies need a flexible and integrated platform that handles everything from 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.
ECUs are embedded controllers managing various tasks. They receive sensor inputs, drive actuators, monitor signals, and interface with other embedded systems. ECUs need to quickly deliver precise and deterministic control feedback. For example, an ECU must provide control signals for highly dynamic subsystems such as high-performance racecar powertrains.
Electronic Control Unit Testing
The ECU is a safety-critical component, and its optimal functional robustness can only be achieved by rigorous testing in an iterative process. This will minimize the risk of potential malfunctions.
Testing ensures safe operation under all conditions, including extreme ones. By testing continuously, bugs can be detected early in the development process when they’re still easy to catch, ultimately avoiding delays and reducing costs.
In the context of high-performance racecars, short turnaround times and agility are key for updating controller functions.
McLaren Applied are 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. — 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 assures joint operation and helps detect and resolve common communication issues. In essence, testing enables meeting quality standards, builds 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 hardware-in-the-loop (HIL) testing lets engineers 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.
Electronic Control Unit Testing Challenges
ECU testing is a complex task. Because 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.
Hardware-in-the-Loop Test Components
HIL testing is a key part of a testing workflow to validate control systems and ECUs, where the device under test (here, the ECU) is connected to the HIL test system through real I/O connectivity and communication protocols.
A HIL test setup is comprised of three main components:
- The device under test (ECU) and additional components like domain controllers, sensors, and actuators.
- A HIL test system with a real-time capable processor that runs the emulated plant components (also called digital twins) and includes I/O connectivity and protocols to emulate signals for communication with the ECU as well as acquire data.
- A workstation running application software that supports running the HIL tests and enables test automation.
Why Hardware-in-the-Loop Testing is Necessary
Let's imagine you’re 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—expensive 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 for 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 long until their novel algorithms run on the ECU and get tested.
Hardware-in-the-Loop Trends and Problems
Establishing a HIL setup is complex, and companies may face problems. First, some don't have the know-how to set up a HIL test system. Trivialities like implementing protocols and interfaces may introduce bottlenecks.
Second, connecting to third-party software and hardware may sometimes lead to substantial integration efforts: Companies overlook the need for additional I/O, have trouble getting support, or the models don't run in real-time. They’re busy setting up the tests and lose lots of time. Third, 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 continue to shrink. Trends like software-defined vehicles (SDVs) make it necessary to upgrade ECUs during their entire lifecycle. Testing never ends, meaning testing continuously becomes a requirement.
An Integrated Platform for Hardware-in-the-Loop Tests
To develop, manage, and execute HIL test campaigns, companies need a flexible and integrated solution as well as tools that support these challenges: Speedgoat test systems, together with MATLAB and Simulink (MathWorks), form a 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, avoiding 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 (Fig. 2). Furthermore, the solution supports all major standards, networks, and protocols, such as ISO 26262 for ASIL A to D, CAN, 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.
Safer Testing with HIL
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.