Hardware In the Loop (HIL) testing for hybrid systems

This article explores the role of Hardware In the Loop (HIL) testing for Hybrid Embedded/Cloud systems. If you're unfamiliar with the concept of hybrid systems, you might find it helpful to start with this previous article, Hybrid Embedded/Cloud systems, which provides an introduction and practical examples.

HIL testing offers a way to validate embedded systems early in the development process by simulating real-world conditions. It’s particularly useful even for hybrid systems, where the embedded components interact with external platforms, such as cloud services.

Using Adaptive Cruise Control (ACC) as an example, described in the linked article, let’s explore how HIL testing works in this context.


What is Hardware In the Loop (HIL) testing?

HIL testing creates a virtual environment that mimics the operational conditions of an embedded system. This setup allows engineers to test an ECU (Electronic Control Unit) as if it were operating in a real-world scenario. The simulated environment can replicate:

  • Vehicle conditions (e.g., engine speed, temperature).

  • Environmental factors (e.g., weather conditions).

  • Application-specific situations (e.g., referring to the ACC example, road and traffic conditions).

With this setup, the ECU receives inputs and outputs through the HIL system as if it were integrated into an actual vehicle. This method enables developers to identify issues and verify functionality early in the development cycle without requiring a physical vehicle.


Benefits of HIL testing for hybrid systems

HIL testing is a versatile tool, offering several key advantages for Hybrid Embedded/Cloud systems:

  1. Early ECU validation: HIL testing allows testers to evaluate the ECU in isolation, confirming whether it can correctly interpret sensor data and make real-time decisions. For example, in the case of Adaptive Cruise Control (ACC), it ensures the ECU can adjust vehicle speed or trigger emergency braking based on sensor inputs.

  2. Testing edge cases and safety-critical scenarios: simulated environments make it possible to test situations that are difficult, risky, or impractical to replicate in a real vehicle. For instance, using the ACC example, engineers can simulate sensor faults, such as a radar giving incorrect distance readings or a camera temporarily losing visibility, to ensure the system remains robust under these conditions.

  3. Mocking cloud interactions: hybrid systems often rely on cloud platforms for tasks like data aggregation or model updates. During HIL testing, before testing the real interaction with the cloud, cloud interactions can be mocked to simulate these operations. For instance, if the ECU communicates with the cloud via REST APIs, the HIL setup can simulate API responses to verify proper integration.

  4. Support for automated and manual testing: HIL testing supports both automated and manual exploratory testing. In manual testing, the tester can create simulated drive scenarios that mirror real-world situations. This approach ensures comprehensive testing of system behavior under a wide range of conditions.


HIL testing setup for hybrid systems

In a typical HIL setup, the signals from simulated sensors, such as cameras, LiDARs, and radars for the ACC example, are generated by the HIL system and sent to the ECU using various types of communication protocols, such as:

  • CAN bus: a popular serial connection in vehicles for transmitting data between ECUs.

  • Ethernet: used for higher bandwidth requirements, particularly in systems that need to handle large amounts of data.

  • Physical devices (I/Os): depending on the application, the system may also need to simulate analog and digital inputs and outputs that connect to physical components like temperature sensors, digital switches, potentiometers, motors, and other actuators. These sensors and actuators are also simulated by the HIL system to ensure the ECU interacts with realistic inputs and can respond appropriately. To facilitate this interaction, a dedicated wiring harness, which can include numerous cables, is used to physically connect the ECU to the HIL system.

The tester interacts with the HIL system using a host PC, typically connected to the HIL simulator via Ethernet. This PC allows the tester to configure the HIL system, create test scenarios, and monitor the ECU's behavior during testing.

Final thoughts

For hybrid systems, HIL testing bridges the gap between the embedded and cloud components by enabling thorough validation of each system's role:

  • ECU reliability: ensures that real-time operations, such as processing sensor data and making real-time decisions, work seamlessly.

  • Cloud interactions: verifies proper communication and response handling, even in edge cases or failure scenarios.

  • Risk-free edge case testing: allows testing under extreme conditions or fault scenarios without endangering people or vehicles.

HIL testing accelerates development cycles by allowing engineers to identify and resolve issues early. It’s an effective and safe way to evaluate complex systems before full vehicle integration.

Previous
Previous

Integration challenges for hybrid systems

Next
Next

Hybrid Embedded/Cloud systems: bridging real-time and resource-intensive tasks