development platform early in the program after an earlier
prototype ECU developed in a conventional manner proved
unable to meet the full gamut of safety and performance
requirements expected of a production vehicle.
Subaru engineers used HILS to begin software development
and verification early in the design process, long before a
prototype or pre-production vehicle became available. They
connected the ECU to a real-time electric motor simulation that
would methodically test and verify its operation under a carefully
defined set of conditions. The conditions included extreme
corner case events that had the potential to break the system if
a traditional mechanical testing regime was employed. In order
to make sure the software-based approach would accurately
model the real-world drivetrain, Subaru developed a set of three
primary goals for their test program:
• The tests should verify ECU functionality across the widest
possible range of conditions, including extreme environments
not easily created or replicated.
• Create a detailed matrix for mapping test cases to
requirements, and a methodical test plan to ensure complete
• The test platform should allow design iterations to be
quickly validated using regression testing.
To achieve these goals, they used a phased methodology
for embedded software design and deployment validation. The
plan included test points at each stage where the team could
use the HIL system to verify the motor ECU’s behavior against
a real-time simulation of the actual vehicle motor. They also
wanted to use the HIL System to meet traceability requirements
by recording test results automatically and performing
automated regression tests whenever a change was made to
the ECU software.
Subaru’s verification system consists of a real motor ECU
and a HIL system from National Instruments that simulates
motor operations (Figure 6). It can represent any operating
condition of the motor by setting physical parameters such as
inductances or resistances. The simulator can also represent
the characteristics of the drivetrain’s power electronics for test
scenarios involving nearly any combination of load torque and
desired rotating speed, including fault conditions.
By simply changing a parameter in the middle of the test, the
HIL system can easily simulate complex test scenarios like the
previous loss of traction example or even a power electronics
fault in the inverter that would destroy physical hardware.
Because the computational performance required to simulate
some drivetrain elements was so high, they employed a mix of
software and hardware simulation. The core system is based on
NI’s FlexRIO FPGA modules, which are PXI-based controllers
with FPGA chips. The modules executed a model representing
the simulated operation of the motors, with all deployed
programs using NI LabVIEW system design software.
To insure the software was exercised across the full range
of simulated operating conditions, Subaru’s test engineers
created a chronological test matrix using an Excel spreadsheet.
The matrix described how the test conditions (torque, rotating
speed, etc.) would vary at each 1 millisecond interval. During
the test, the motor ECU would react to those conditions,
sending out signals, such as a pulse-width modulation signal, to
the HIL system that it used to as inputs for the motor simulation
algorithm. The resulting signals representing the motor’s torque
and tri-phase current were returned to the motor ECU.
The test engineers wrote a program in Visual Basic that
would read and run each test scenario by stepping through its
associated matrix of test conditions and writing the test results
into an Excel spreadsheet. By automating the test procedures,
Subaru was able to cut test and verification cycles dramatically
while insuring that the ECU software was thoroughly exercised
under every possible operating scenario.
HILS ACCELERATES THE DESIGN CYCLE
By providing the controller with high-fidelity models of a
drivetrain, robotic component, or other mechatronic system,
HILS enables software engineers to begin debugging their
control algorithms and evaluating hardware designs long before
the physical hardware required to perform actual end-to-end
testing becomes available.
HILS was originally used late in the design flow of automotive
systems, where software developers would finish their ECU
firmware and pass it to the test department to perform HIL
testing. Now, however, HILS role is expanding, according
to Marcus Monroe, Senior Technical Marketing Specialist at
National Instruments. Monroe explains, “The exponential growth
of embedded software and the extreme technical challenges
of EV/HEV testing are driving test earlier into the development
process. If firmware developers can test their algorithms on the
desktop before they pass their code on to the test teams, they
can eliminate bugs earlier and reduce the overall cost to test.”
“Real-Time Simulation Technologies to Improve the
Development of Electric Motor Drives” - Opal-RT, http://www.
“HIL Testing for Power Electronics Systems” National
“Advancing Subaru Hybrid Vehicle Testing Through
Hardware-in-the-Loop Simulation” – National Instruments,
Figure 6 – Subaru’s verification environment. Source: National Instruments