Lably
Skip to content

Hardware-in-the-loop simulation

Technique used in the development and testing of complex real-time embedded systems

  • 9 min read
  • 3 chapters

Related on Lably

Through Simulation, Representation (mathematics) and Dynamical system

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.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication