Driven by governmental regulations and market demand for better fuel economy and greater performance, the design of modern automobiles and the process of developing them have changed. Pushed by these challenges, the automobile has evolved from a mostly mechanical-hydraulic system to include complex automotive electronics and software algorithms implemented on electronic control units (ECUs, as represented below).
The techniques and tools that engineers use to develop automobiles have evolved as well. A result of this evolution, Hardware-in-the-Loop (HIL) simulation is a test technique that helps reduce development cost and increase the quality of a vehicle. Here we will examine the what, how, and why of HIL simulation and provide guidance on considerations that should be made when selecting a HIL system.
What is HIL simulation?
HIL simulation is a dynamic test technique that simulates the I/O behavior of a physical system that interfaces to an ECU in real-time. It is dynamic because the values of stimulus signals generated by a simulator are a function of an ECU's response from the previous cycle. Other variables such as test profiles and in-line analysis results may also influence the calculation of stimulus values, but it is dependence of signal values on the response from a unit under test that differentiates HIL simulation from other test techniques.
How does HIL simulation work?
In a closed-loop control system, the current state of the system being controlled is fed back to the controller through sensor measurements. The ECU uses these measurements to help determine the appropriate actuator values in order to attain a desired operating condition (see below).
To control wheel slippage while braking, for example, an antilock braking system (ABS) uses an ECU to provide closed-loop control of the vehicle's brakes. The ECU receives information regarding individual wheel speed, vehicle speed, brake position, and other conditions necessary to determine the appropriate brake actuator command for each wheel to maintain maximum traction while stopping in adverse conditions. Physical testing of the ABS ECU ultimately requires a vehicle and test track; however, engineers can thoroughly test the ECU without a vehicle or even a brake system using HIL simulation.
To understand how this is accomplished, let's first consider what an ECU "knows" about the world around it. A typical ECU consists of an embedded computer system with integrated electronics for sensor and actuator signal conditioning and digital communication protocols. Taking the ECU point of view, an accurate representation of the voltage, current, impedance, and timing characteristics of the physical system being controlled is indistinguishable from the actual system.
However, a HIL simulator must meet certain requirements in order to accurately represent a physical system.
A HIL simulator must be able to generate and acquire signals at the same amplitude and rate of change that a physical system would produce. To accurately represent how different operating conditions affect an ECU electrically, a HIL simulator must create the impedances that an ECU experiences. The impedance seen by ECU outputs determines the amount of current drawn from the device.
Although ECU hardware may meet all design requirements, faults external to an ECU or unexpected control algorithm results can produce ECU outputs states outside of the ECU hardware specification. In order to identify such issues, the impedance characteristics of a system must also be simulated in order to produce an accurate simulation. Finally, as vehicle technology advances, there are a growing number of communication buses, such as CAN and FlexRay, as well as custom digital protocols integrated into ECUs that require specialized interfaces.
In addition to being able to interface electrically with an ECU, a HIL simulator must determine the correct values to be produced relative to the signals it receives from an ECU. State charts, programming languages, and dynamic models are commonly used to represent the I/O behavior (dynamic response) of a physical system. However, it is critical that a HIL simulator also be able to produce these values with accurate timing characteristics. This typically requires a real-time operating system (RTOS) to ensure all signals can be updated at a rate that will preserve the realistic representation of a physical system in time.
Depending on the complexity of a system being simulated and the fidelity of its representation, parallel processing techniques such as FPGAs, multicore processors, and deterministic distributed processing interfaces may be necessary to complete output response calculations while maintaining timing accuracy.