ArticleslgStudy

science

Hardware-in-the-loop simulation

Hardware-in-the-loop simulation is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hardware-in-the-loop simulation rather than just read about it. In short: Hardware-in-the-loop (HIL) simulation, also known by various acronyms such as HiL, HITL, and HWIL, is a technique that is used in the development and testing of complex real-time embedded systems. HIL simulation provides an effective testing platform by adding the complexity of the process-actuator system, known as a plant, to the test platform.

Key takeaways

  • Hardware-in-the-loop simulation belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hardware-in-the-loop simulation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hardware-in-the-loop simulation from memory before moving on to harder problems.

Reference excerpt

Hardware-in-the-loop (HIL) simulation, also known by various acronyms such as HiL, HITL, and HWIL, is a technique that is used in the development and testing of complex real-time embedded systems. HIL simulation provides an effective testing platform by adding the complexity of the process-actuator system, known as a plant, to the test platform. The complexity of the plant under control is included in testing and development by adding a mathematical representation of all related dynamic systems. These mathematical representations are referred to as the "plant simulation". The embedded system to be tested interacts with this plant simulation.

How HIL works HIL simulation must include electrical emulation of sensors and actuators. These electrical emulations act as the interface between the plant simulation and the embedded system under test. The value of each electrically emulated sensor is controlled by the plant simulation and is read by the embedded system under test (feedback). Likewise, the embedded system under test implements its control algorithms by outputting actuator control signals. Changes in the control signals result in changes to variable values in the plant simulation. For example, a HIL simulation platform for the development of automotive anti-lock braking systems may have mathematical representations for each of the following subsystems in the plant simulation:

Vehicle dynamics, such as suspension, wheels, tires, roll, pitch and yaw; Dynamics of the brake system's hydraulic components; Road characteristics.

Operating System Performance A HIL environment needs to be deterministic. The operating system performance is a critical part of the HIL environment. The operating system has to be able to monitor and control the hardware in real-time. The operating system provides the control of stimulus used for simulation as well as recording the responses of the system to that stimulus. There are several parameters to consider in an operating system for a HIL system. One primary OS parameter is latency. For HIL applications operating system latency can be defined as a measure of the time from the request for some action by a program to the physical beginning of the action. For a real time OS to drive a HIL system, OS latency of 10µS or less would be considered reasonable. Jitter is another primary OS parameter to consider. There are a couple of forms of jitter to consider. One form of jitter to consider is operating system jitter which, for a HIL system, is the variation in the period execution time of a periodic task. This may be considered as jitter you might observe using the C function usleep() repeatedly. Another form of jitter is operating system execution time jitter. For HIL this is considered to be the variation in execution time of a particular task when called repeatedly. Low jitter is important for HIL system.

Uses In many cases, the most effective way to develop an embedded system is to connect the embedded system to the real plant. In other cases, HIL simulation is more efficient. The metric of development and testing efficiency is typically a formula that includes the following factors: 1. Cost 2. Duration 3. Safety 4. Feasibility The cost of the approach should be a measure of the cost of all tools and effort. The duration of development and testing affects the time-to-market for a planned product. Safety factor and development duration are typically equated to a cost measure. Specific conditions that warrant the use of HIL simulation include the following:

Enhancing the quality of testing Tight development schedules High-burden-rate plant Early process human factor development

Enhancing the quality of testing Usage of HILs enhances the quality of the testing by increasing the scope of the testing. Ideally, an embedded system would be tested against the real plant, but most of the time the real plant itself imposes limitations in terms of the scope of the testing. For example, testing an engine control unit as a real plant can create the following dangerous conditions for the test engineer:

Testing at or beyond the range of the certain ECU parameters (e.g. Engine parameters etc.) Testing and verification of the system at failure conditions In the above-mentioned test scenarios, HIL provides the efficient control and safe environment where test or application engineer can focus on the functionality of the controller.

Tight development schedules The tight development schedules associated with most new automotive, aerospace and defense programs do not allow embedded system testing to wait for a prototype to be available. In fact, most new development schedules assume that HIL simulation will be used in parallel with the development of the plant. For example, by the time a new automobile engine prototype is made available for control system testing, 95% of the engine controller testing will have been completed using HIL simulation. The aerospace and defense industries are even more likely to impose a tight development schedule. Aircraft and land vehicle development programs are using desktop and HIL simulation to perform design, test, and integration in parallel.

High-burden-rate plant In many cases, the plant is more expensive than a high fidelity, real-time simulator and therefore has a higher-burden rate. Therefore, it is more economical to develop and test while connected to a HIL simulator than the real plant. For jet engine manufacturers, HIL simulation is a fundamental part of engine development. The development of Full Authority Digital Engine Controllers (FADEC) for aircraft jet engines is an extreme example of a high-burden-rate plant. Each jet engine can cost millions of dollars. In contrast, a HIL simulator designed to test a jet engine manufacturer's complete line of engines may demand merely a tenth of the cost of a single engine.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Hardware-in-the-loop simulation

Start with the simplest possible case. Write down what Hardware-in-the-loop simulation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hardware-in-the-loop simulation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hardware-in-the-loop simulation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hardware-in-the-loop simulation

In research
Hardware-in-the-loop simulation appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hardware-in-the-loop simulation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hardware-in-the-loop simulation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Embedded systems, so understanding it makes those chapters shorter.
In everyday life
Look for Hardware-in-the-loop simulation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hardware-in-the-loop simulation” →

How to study Hardware-in-the-loop simulation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hardware-in-the-loop simulation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hardware-in-the-loop simulation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hardware-in-the-loop simulation in simple terms?

Hardware-in-the-loop (HIL) simulation, also known by various acronyms such as HiL, HITL, and HWIL, is a technique that is used in the development and testing of complex real-time embedded systems. HIL simulation provides an effective testing platform by adding the complexity of the process-actuator…

Why does Hardware-in-the-loop simulation matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hardware-in-the-loop simulation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hardware-in-the-loop simulation.

Tags

  • Embedded systems

Keep exploring