Hardware-in-the-Loop Testing (HiL Testing)
Simulation systems for testing under realistic conditions
What is Hardware-in-the-Loop testing (HiL testing)?
In Hardware-in-the-Loop testing (HiL testing), electronic controls or mechatronic components (devices under test, DUTs) are evaluated by a realistic real-time simulation model.
The Hardware-in-the-Loop simulator imitates a variety of application scenarios, also taking the particularities of the future operating environment into account. For instance, this includes maintaining response times of the real system or applying realistic noise levels to the signals. All in all, the HiL simulator tricks the DUT into “thinking” that it is integrated in the fully assembled product during test runtime.
With the help of Hardware-in-the-Loop simulations, DUTs can be tested for correct functionality quickly, cost-efficient and realistically. The repeatability of HiL simulations under exactly the same conditions allows for an objective comparison of the DUT with other prototypes or so-called “golden samples” (devices that are considered good) in the development phase.
Fig.: The National Instruments PXI platform is perfectly suitable as HiL system.
Procedure of a Hardware-in-the-Loop simulation (HiL simulation)
The system controlled or regulated by the DUT (e. g., chassis, flight control or production line) is replicated as accurately as possible by the HiL simulation model. Nowadays, this imitation of the operating environment is predominantly virtual. However, real environment hardware can also be integrated into the Hardware-in-the-Loop simulator if absolutely necessary.
The DUT is connected to the HiL simulator through its various inputs and outputs. Then, the HiL system starts with the real-time simulation. The simulation model processes the signals sent by the DUT and reacts with appropriate replies (e. g., simulated sensor or camera data). The data flow is comprehensively logged, allowing the behaviour of the DUT to be analysed in thousands of application settings in a short amount of time. Hardware-in-the-Loop systems also make it possible to examine scenarios that would be difficult if not impossible to evaluate in reality (e. g. collisions, stalls).
Differentiation from related testing methods
Hardware-in-the-Loop vs Software-in-the-Loop (HiL vs SiL)
Software-in-the-Loop (SiL) refers to evaluating the software of a DUT, also using realistic simulation models. In contrast to HiL, the software is not run on the actual hardware of the DUT.
SiL allows validating the firmware of embedded systems in early development phases, for example when the real hardware is not yet available and, thus, HiL is not yet possible. While SiL is cheaper and more flexible, HiL validation provides the necessary robustness for real-world applications.
Usually, both testing methods are used in the product development cycle.
Real-world tests
Hardware-in-the-Loop tests can only imitate the operating environment in a limited and reduced manner. Particularly when it comes to human interaction, HiL simulation models quickly reach their limits. Therefore, HiL can significantly reduce the number of real-world tests with the final product but cannot completely replace them.
On the other hand, HiL tests can be carried out faster and more cost-efficiently. Thus, HiL test benches allow product designers to increase the number of tests and to shorten the development period at the same time. Hardware-in-the-Loop simulations can be performed even before the operating environment is finalised. Furthermore, different test runs are much more comparable. In addition, HiL allows the simulation of borderline or incident cases and system failures that cannot be carried out in reality for safety or system availability reasons.
At first glance, Hardware-in-the-Loop testing seems to have similarities with functional testing since both methods involve sending signals to the inputs of a DUT and evaluating its response. However, functional tests primarily focus on testing against a specification in which the desired reactions to a list of individual input states are documented.
HiL testing on the other hand means performing complex, realistic simulations. Consequently, Hardware-in-the-Loop simulators can be found mostly in research and development departments, while functional tests predominantly serve as quality assurance step in the manufacturing process. Finally, functional tests can also be performed for lower-level DUTs than controls (e. g. printed circuit boards).
Examples for Hardware-in-the-Loop applications
HiL is particularly important when complex or distributed control systems are used, meaning multiple controls are handling a large amount of interdependent processes. In such systems, even small deviations from the control target can have devastating consequences. Thus, comprehensive testing is a crucial step in the research and development phase for concerned industries, such as:
- Aerospace (e. g. flight simulations and flight dynamics control)
- Automotive (e. g. vehicle dynamics and control)
- Power generation (e. g. generator or turbine control)
- Industrial automation (e. g. assembly line control)
In addition to testing, HiL simulators can also be used for the early commissioning of an embedded system. Especially if the future operating environment is hard to access or only available for a limited time, HiL systems are a convenient solution for setting up the DUT by taking advantage of the HiL environment simulation. This is the case for offshore or high-availability systems.
What are the requirements for an HiL system?
Hardware-in-the-Loop test benches require a platform that can perform real-time simulations, offers the same interfaces as the later operating environment of the DUT, and is capable of replicating the associated loads and “noise”. An HiL simulator typically consists of the following components:
- At least one real-time processor as the heart of the Hardware-in-the-Loop simulator (e. g. PXI by National Instruments). Its duties are executing the test steps deterministically and logging results. For HiL systems with high demands on processing performance, multiple, synchronised processors are used.
- Simulation software (e. g. VeriStand by National Instruments) and user interface allow communication with the real-time processor, configuration management, test automation, display of test instructions and presentation of test results.
- Digital, bus or analogue signals are exchanged between the Hardware-in-the-Loop system and the DUT using I/O interfaces. From the perspective of the DUT, there is no difference between the HiL test bench and the real operating environment.
- Substitute loads give the DUT the illusion of being connected to its later target hardware. If required, real environmental hardware can be integrated in the Hardware-in-the-Loop simulation. In this case, the real-time processor initiates interactions with the hardware, which then sends its real signals to the DUT.
Fig.: Architecture of an HiL test bench without real environmental hardware
Fig.: Architecture of an HiL test bench with real environmental hardware
The growing technical importance of distributed systems can also be observed in control technology. Many processes are no longer controlled by a single control but by several, digitally connected units. Hardware-in-the-Loop test benches meet these requirements by being able to test different types of DUTs together. If necessary, several HiL simulators can be linked.
When choosing a Hardware-in-the-Loop system, you should aim for a good balance between versatile application possibilities, low costs and high usability. Also, the HiL simulator should have interchangeable components and expansion possibilities, so you are prepared for the future requirements of HiL testing.
Do you need help with Hardware-in-the-Loop testing?
Our competent and creative team gladly provides help and advice. As National Instruments Partner, we have expert knowledge about the HiL simulation portfolio of one of the industry leaders. We can assist you – from simple integration tasks to turnkey HiL systems. We are looking forward to your contact enquiry!