How is hardware-in-the-loop (HIL) testing used in automotive engineering?

HIL testing enables faster, safer and more cost-effective development through real-time simulation of complex vehicle systems.

Numerous industries have been using hardware-in-the-loop (HIL) testing to simulate real-world conditions by replacing a physical system with a virtual representation of that system. By connecting a controller to a system simulating the operation of a physical product, manufacturing and engineering teams can test products in a controlled environment before deploying them. The automotive industry has been a leading adopter of HIL testing.

Why is HIL testing important in automotive engineering?

In recent years, the number of electronic control units (ECUs) in automobiles has grown dramatically. These ECUs have replaced many mechanical components and handle various functions and input/output, making them prime candidates for HIL testing. By simulating the operation of ECU-guided automotive products, teams can test virtual representations of products instead of physically testing finished prototypes.

HIL testing offers numerous benefits to automotive engineers. By testing virtual models of products, teams can save significant time and expense. HIL testing can also identify potential flaws earlier in the workflow, when the flaws can be fixed more affordably and efficiently. And, with virtual models replacing physical models, HIL testing can consider numerous scenarios without the time and expense required for physical tests. It also offers safety benefits, enabling teams to simulate conditions without exposing humans to dangerous situations.


Examples of automotive HIL testing

A wide variety of automotive products and systems can benefit from HIL testing. While some systems include interaction with the user and others are controlled automatically by sensors and computer-aided devices. If over-the-air (OTA) updates are provided to update software, HIL testing can also incorporate these updates and modify testing accordingly. Here are some examples:

Engines: One or more engine ECUs govern engine operation, converting sensor measurements into actions such as adjusting air intake. HIL testing simulates engine operation and interaction with real I/O devices such as acceleration pedals. For internal combustion engines, this might include testing controllers that handle fuel consumption and emission control. For electric vehicles (EVs), HIL testing might simulate a motor-generator, battery and connections to direct-drive transmission.

Powertrains: Transmission systems, power electronics and battery management systems can be tested with real-time simulations. HIL testing simulates the operation of various components such as converters, relays, onboard power system components and charging systems. With the growth of EVs, battery management is a key design consideration.

Chassis and vehicle dynamics: This can include steering, braking, suspension and traction control systems. For example, a steering system can be tested using HIL techniques to model  vehicle handling behavior based on digital input that simulates steering wheel actions. The testing can aid development of steering controls and electro-mechanical actuators. Similarly, brake hydraulics can be simulated with HIL testing to model braking maneuvers and vehicle responses.

Advanced driver assistance systems (ADAS): Cameras, sensors and other devices can help alert drivers of potential collisions with other vehicles, detect pedestrian and roadside obstacles, and in the case of autonomous vehicles (AVs), take over driving under certain conditions. HIL testing can simulate real-life situations in developing and validating these systems.

Interior features: Seating, lighting, heating, air conditioning and other systems now rely heavily on ECUs. HIL testing can be used to test scenarios such as power-seat operation and climate-control systems, which may include heat exchangers, compressors, sensors, actuators, ductwork and other devices. HIL testing can simulate the functionality of various components and ECUs and their connection to the centralized ECU.

Entertainment and information systems: These systems connect the driver and passengers to a wide variety of information sources, including mobile devices, conventional and satellite radio, cloud resources, dashboard display systems and diagnostics. They also play a key role in coordinating OTA updates. HIL simulation can test various instrument clusters, displays and warning systems, with a real-time target machine running a virtual vehicle and direct interfaces using analog and digital signals or standard communication protocols.

HIL testing is finding many applications related to electric vehicles (EVs), such as battery management. (Image source: Adobe Stock.)

What other types of testing are used with embedded systems?

In addition to HIL testing, various other types of testing are used in embedded automotive systems:

  • Model-in-the-loop (MIL) testing simulates both the controller and the physical systems with virtual models instead of physical hardware. MIL testing is often used in early development stages to verify design assumptions and control algorithms.
  • Software-in-the-loop (SIL) testing runs the software in a simulated environment to verify that the control algorithms are operating correctly, providing a bridge between model simulations and real-world applications.
  • Processor-in-the-loop (PIL) testing executes the control algorithms on the actual processor or other device connected to the simulated environment. This technique checks for potential issues related to code generation, execution timing and processor-specific behavior, confirming that the software will perform as intended.

Several variations of HIL have also been developed. Power hardware-in-the-loop (P-HIL) testing introduces power amplifiers or other power equipment to convert low-voltage signals from a real-time system into the higher voltages of the emulated device. This approach enables teams to test power components of the control system in a framework similar to actual operating conditions.

Virtual HIL (vHIL) testing enables creation and execution of tests before the actual ECU hardware is available. With the vHIL approach, testing can begin earlier and be automated to guide subsequent testing.

What standards are applicable to HIL testing?

A variety of standards and guidelines apply to automotive HIL testing. The International Organization for Standardization (ISO) established ISO 26262 (road vehicles functional safety) as an international standard for functional safety of electrical and/or electronic systems. ISO 26262 includes requirements for HIL development processes and documentation of these processes, as well as qualification and validation. Other ISO standards applicable to automotive testing include ISO 21448 (road vehicles — safety of the intended functionality or SOTIF) and ISO 21434 (road vehicles cybersecurity engineering), which was developed in conjunction with SAE International.

The Association for Standardization for Automation and Measuring Systems published ASAM XIL, an API standard that covers multiple types of in-the-loop testing, HIL, MIL and SIL. The standard provides guidance on communication between test automation tools and test benches, facilitating the integration of HIL technology from different vendors.    

Various communication protocols apply to HIL testing. Protocols such as Ethernet, controller area network (CAN) and local interconnect network (LIN) define connections between the real-time test system and the actual embedded controller. Actuator interfaces that connect the test equipment to the simulated system use these communication protocols to accurately capture hardware responses and feed them back into the simulation for real-time analysis.

Future applications of automotive HIL testing will likely incorporate artificial intelligence (AI), automation and digital twins. AI and automation can help improve efficiency, simulating driver behavior, traffic conditions, and other complex situations. Digital twins — virtual representations of physical systems — can enhance the realism of HIL simulations, allowing for real-time synchronization between virtual and physical components.

HIL testing is also likely to become more modular and scalable, allowing for testing of different vehicle types. This enables testing to be adapted to a wide range of vehicles, ranging from compact cars to luxury sedans and commercial vehicles.