Einführungsaktion

Until Dec 31 only: 25 % introductory discount for new customers

Noch
00Days
00Hrs
00Min
00Sec
Claim the deal
Magazin
·
Grundlagen

Hardware-in-the-Loop (HiL): Definition, Setup, and Limits

ECU software must function on real hardware long before a prototype vehicle is on the road. This article explains how a Hardware-in-the-Loop (HiL) test works, what a HiL test bench consists of, and when it becomes a bottleneck for your release.

Hardware-in-the-Loop (HiL): Definition, Setup, and Limits

At a glance:

  • In HiL testing, the actual ECU is the device under test, while the environment is simulated.
  • A HiL test bench consists of the ECU(s), a real-time simulator, I/O interfaces, communication interfaces (bus, network), residual bus simulation, and test automation.
  • In the development process, HiL typically follows Model-in-the-Loop (MiL) and Software-in-the-Loop (SiL).
  • Real hardware is both a strength and a weakness: HiL maps actual hardware and real-time behavior, but logical negative tests are often difficult to perform on production hardware, and capacity is limited by the serial nature of the tests.
  • Up to 75% of all errors can be found virtually before a test even needs to reach the HiL test bench.

Every ECU software must prove that it works on real hardware—long before a prototype vehicle is on the road. That is exactly what Hardware-in-the-Loop is for. This article explains how a HiL test works, what a HiL test bench consists of, and at what point hardware becomes a bottleneck for your release.

Hardware-in-the-Loop (HiL) is a testing method in which a real ECU is connected to a real-time simulator that replicates the vehicle, sensors, actuators, and environment. This allows ECU software to be tested under real electrical conditions—reproducibly, safely, and before a prototype vehicle even exists.

‍

HiL tests real hardware in a simulated world

Hardware-in-the-Loop integrates one or more real ECUs into a closed loop with a simulation. The ECU receives simulated sensor signals, calculates its response, and outputs control signals. The simulator reads these signals and uses them to calculate the next state of the virtual vehicle—in real time, millisecond by millisecond.

Definition
Hardware-in-the-Loop (HiL) refers to a testing method in which a real ECU is connected via electrical interfaces to a real-time simulator that replicates the rest of the vehicle environment.

For the ECU, there is no discernible difference from a real vehicle. That is exactly where the value lies: the software runs on production-grade hardware, with real timing, real voltage levels, and real communication via CAN, LIN, or Automotive Ethernet.

‍

A HiL test bench consists of six components

A HiL test bench combines hardware, simulation, and test automation into one system. An overview of the components:

  • ECU(s) (Device under Test): One or more real ECUs with the software to be tested—referred to in technical jargon as the Device under Test.
  • Real-time simulator: A computer that calculates the environment model in hard real time, thereby simulating vehicle dynamics, the engine, battery, or surroundings.
  • I/O interfaces: Convert simulated values into real electrical signals and read the ECU's outputs.
  • Communication interfaces (bus, network): Connect the device under test and the simulator via CAN, LIN, FlexRay, or Automotive Ethernet and transmit bus communication.
  • Residual bus simulation: Replicates the messages of all ECUs that are not physically connected to the test bench, so that the device under test "sees" a complete vehicle network.
  • Test automation: Software that executes test cases, evaluates results, and generates reports—complemented by electrical fault simulation, which is part of most classic HiL test benches, for example to simulate cable breaks or short circuits.

Residual bus simulation is often the most underestimated effort: the more networked a system is, the more messages must be simulated consistently.

‍

HiL is typically late in the XiL chain

HiL is typically one of the later stages of the X-in-the-Loop (XiL) methodology. This is followed by Vehicle-in-the-Loop (ViL), where a real vehicle is tested against a simulated environment, and finally, vehicle testing. The sequence is not mandatory: frameworks like ASPICE define integration stages in which HiL makes sense after SiL. The stages differ in how much is real and how much is simulated.

Stufe Was ist real? Was ist simuliert? Typischer Einsatz
Model-in-the-Loop (MiL) nichts – nur das Funktionsmodell Modell und Umgebung Frühe Funktionsentwicklung
Software-in-the-Loop (SiL) der Seriencode Umgebung und Hardware Code-Tests, Regression, CI/CD
Hardware-in-the-Loop (HiL) Steuergerät(e) inkl. Software Fahrzeug und Umgebung Hardwarenahe Integration, Freigabe
Vehicle-in-the-Loop (ViL) Fahrzeug inkl. Steuergeräte Umgebung, Verkehr, Szenarien Fahrfunktionen im Gesamtfahrzeug
Fahrzeugtest alles nichts Erprobung, Homologation

We explain exactly how the preceding virtual stage behaves in our article on Software-in-the-Loop (SiL).

‍

HiL makes dangerous scenarios safe and reproducible

The biggest advantage of HiL: critical situations can be tested as often as desired without any risk. An airbag control unit can "experience" a thousand crashes, and a battery management system can undergo a thousand overheating events—without any vehicle or person coming to harm.

Other strengths at a glance:

  • Real hardware behavior: Real-time behavior, electrical levels, and bus communication correspond to the production standard.
  • Reproducibility: Every test can be repeated under identical conditions.
  • Early start: Testing begins before a prototype vehicle is available.
  • Compliance: For safety-critical systems according to ISO 26262 for functional safety, hardware-level verification is an integral part of the process.
  • Positive and electrical negative tests: Confirmatory positive tests for acceptance are easy to implement. Furthermore, electrical fault simulation allows for targeted disconnection or short-circuiting of connections between real ECUs.
Hardware-in-the-Loop (HiL) proves its value where the actual electrical behavior of the control unit is the deciding factor – functional logic can usually be verified virtually earlier and more cost-effectively.

Where HiL reaches its limits: test depth and capacity

The first limit is test depth. Logical negative cases can only be injected into a HiL setup if the corresponding hardware interface is accessible. This is often not the case with production hardware, and not always with B- and C-samples. In such cases, components must be soldered on or switching mechanisms installed, and sometimes it is simply not possible. HiL tests are therefore predominantly black-box or grey-box tests. With Software-in-the-Loop, the lack of hardware reality becomes a strength: internal states are accessible, making grey-box and white-box tests possible. The earlier this happens in the V-model, the more valuable it is.

The second limit is capacity. A HiL test bench executes tests serially: one test after another, one team after another. With every software variant and every release, the number of test cases grows, but the number of test benches does not.

Test teams are familiar with the consequences in their daily work:

  • Waiting times: Developers wait for free slots instead of continuing development.
  • Late bug detection: Errors only appear when changes are already expensive.
  • Linear costs: More testing requirements mean more hardware, more maintenance, and more lab space.
  • Variant effort: Every hardware variant requires its own setup and maintenance.

An example from our "Passenger Car Exterior Lighting System" test scenario shows the scale: 15 involved control units, over 1,800 test combinations per release, and an average of 7 minutes per test. Executed serially on a HiL test bench, this results in more than 210 hours of pure test time – per release.

‍

Virtual testing relieves the HiL test bench instead of replacing it

The solution to the HiL bottleneck is not more hardware, but a division of labor: everything that can be tested virtually runs virtually and in parallel. The HiL test bench focuses on what only real hardware can do.

With violis, control units are integrated as virtual ECUs (vECUs), and test jobs are automatically orchestrated and executed in parallel in the cloud. In the "Exterior Lighting System" test scenario, 100 tests run simultaneously. This turns 210 hours into 2.1 hours – with results available overnight. Up to 75% of all errors are found purely virtually. Anything that reaches the HiL test bench afterward has already passed the quality gate.

Existing tools are retained: violis integrates with Vector CANoe4SW, dSPACE VEOS, tracetronic ecu.test, Synopsys Silver, and MATLAB/Simulink, among others, bridging virtual and physical testing environments. In our experience, many existing HiL test cases can be reused rather than rewritten from scratch. The platform originated in our own HiL labs at Bertrandt—developed directly from the hands-on practice of real OEM projects. To learn how this integrates into an end-to-end approach, explore our guide to Software-Defined Testing.

30 Minuten, ein Experte, eine ehrliche Einschätzung
Wir schauen gemeinsam auf Ihren Testablauf und zeigen, welcher Anteil sich heute virtualisieren ließe.
Check buchen

Checkliste: Ist Ihr HiL-Prüfstand ein Engpass?

‍

Conclusion: HiL is here to stay – but not for every test

Hardware-in-the-Loop is and remains the standard for hardware-related verification of control unit software. However, anyone who sends every test through the test bench turns HiL into the bottleneck of the release. The strength lies in the division of labor: virtual for breadth, HiL for the final quality check.

FAQ

Frequently asked questions about Hardware-in-the-Loop

Was bedeutet Hardware-in-the-Loop?

Hardware-in-the-Loop bedeutet, dass reale Hardware – in der Regel ein Steuergerät – Teil eines geschlossenen Regelkreises mit einer Simulation ist. Das Steuergerät reagiert auf simulierte Signale, und die Simulation reagiert in Echtzeit auf die Ausgaben des Steuergeräts.

Was ist der Unterschied zwischen HiL und SiL?

Beim Hardware-in-the-Loop-Test (HiL) läuft die Software auf dem realen Steuergerät, beim Software-in-the-Loop-Test (SiL) läuft sie rein virtuell ohne spezielle Embedded-Hardware, sondern simuliert auf gängiger Computer-Hardware. SiL skaliert parallel und kostengünstig in der Cloud, HiL bleibt für hardwarenahe Tests und die finale Absicherung nötig.

Was kostet ein HiL-Prüfstand?

Die Kosten eines HiL-Prüfstands hängen von Echtzeit-Hardware, I/O-Umfang, Lizenzen, Modellen und Wartung ab und steigen mit jedem zusätzlichen Prüfstand linear. Virtuelles Testing verschiebt diesen Aufwand von Investitionen hin zu nutzungsabhängigen Kosten, etwa im Pay-per-Use-Modell.

Wann reicht ein virtueller Test statt HiL?

Ein virtueller Test reicht, wenn Funktionslogik, die Kommunikation zwischen Softwarekomponenten oder die korrekte Protokoll-Implementierung geprüft werden. Das gilt auch für Regressionstests, sofern die betroffene Funktion nicht hardwarerelevant ist. Hardware-in-the-Loop bleibt nötig, wenn reales elektrisches Verhalten, exaktes Echtzeitverhalten der seriennahen Hardware oder das End-to-End-Kommunikationsverhalten über alle ISO/OSI-Schichten nachgewiesen werden müssen.

Kann man HiL-Testfälle virtuell wiederverwenden?

Ja, bestehende HiL-Testfälle lassen sich mit einer geeigneten Plattform in vielen Fällen für virtuelle Tests weiterverwenden. Voraussetzung ist, dass das Steuergerät als virtuelles Steuergerät (vECU) oder als SiL-Simulation vorliegt und die Testautomatisierung über Schnittstellen angebunden ist.

Magazin

Weitere Beiträge

Alle Beiträge ansehen ›