6 min read

Simulation and HIL Testing for Rapid Development

Simulation and HIL Testing for Rapid Development
Simulation and HIL Testing for Rapid Development
12:02

Simulation and HIL Testing for Rapid Development

Hardware-in-the-loop (HIL) testing is a necessary tool for any automotive manufacturer or supplier in this era of software-defined vehicles. One reason for this is that, compared to the software in vehicles of even a generation or two ago, a modern vehicle presents challenges due to its software’s complexity, the volume of its software, and the interconnected nature of its systems. The number of embedded controllers and the quantity of code installed on them are both increasing every year. Powerplants of every kind, their power-transmitting components, and sensors to monitor events inside and outside of the vehicle are all connected to embedded controllers. Any time the software is updated on any of these, a new round of tests must be initiated.

Simulation testing is a valuable tool for performing regression testing (the repetitive “iterative” testing required to confirm that a code change is working properly and hasn’t adversely affected any desired existing function or adjacent component). These are often performed in an environment where test loops are required, but the timeframe is also quite compressed. Does this sound like an automotive manufacturing scenario, especially with the verification and validation demands of functional safety? It absolutely does! HIL simulation and testing are the way to prove code quickly and accurately. Historically, as the controller software was written, it could be tested in a test vehicle and proven to work in situ. With millions of lines of code now in a modern vehicle, this is no longer practical, especially given the time constraints of manufacturing. There is added difficulty in testing components or systems that are adjacent to or connected to the one for which the code was written – for example, a brake controller that is also linked to the operation of smart cruise control, which can use the brakes in emergencies. If the code for one of those changes, both of these systems need to be verified correctly. This is where HIL testing comes in.


New call-to-action

What is HIL testing?

Hardware-in-the-Loop, in general, is a testing discipline for developing and improving embedded software systems. The usefulness of HIL is not limited to motor controls, by any means. Many, if not all, of the electronic control units (ECUs) found on a modern vehicle can be tested using HIL, including controllers for anti-lock brakes, multimedia and navigation systems, and various advanced driver assist systems (ADAS). This is necessary to prove out thousands (or more) of lines of code at a time, embedded in a single controller, against multiple use cases within a compressed time frame.

As stated, HIL can be effective and is invaluable for testing embedded electronic control units (ECUs), especially those for hybrid and electric vehicle (EV) motors. HIL testing can help prevent accidents, for example, by reducing the exposure of test technicians, engineers, and valuable controller hardware to environments with live batteries and motors until it’s absolutely necessary. While live testing is also useful and necessary, any opportunity to lessen the inherent risks is likely worthwhile. At the power levels modern EV batteries produce, arc flashing (electric current traveling through the air between two conductors) is possible, depending on proximity and other factors. This could cause injury or damage to components. Arc flash and other risks make decreasing exposure through simulation desirable. Also, part of testing is to discover errors in code, and it’s far more efficient to find them in a simulated environment than in a live motor or a vehicle on a test track, whether the controller is for a traction motor or windshield wipers.

HIL for automotive motor controllers is a method for simulating the hardware (whether an ADAS HIL testing solution for components, a motor, or even a single battery cell) that the embedded controller is designed to control. This is done by connecting the controller to a test system that includes a computing platform with modeling (or simulation) software, and specific test equipment with analog and/or digital connectors for the controller. Connecting the controller electrically to the rack of test equipment, and correctly modeling the component it is intended to control (an electric motor, in this case) fulfills the requirements for the controller to behave exactly as if it were installed in a vehicle with all systems working. Every input and output that the controller interacts with is accounted for and simulated. This allows test personnel to place the controller in any situation required (for example, multiple simulated motor loads and input scenarios), to fulfill the use case test requirements.

Special skills for HIL motor control testing

Test engineers and technicians certainly need familiarity with the job to be done, the familiar “V” model of verification and validation. They must know the components to be tested and the test equipment, which is currently at LHP, including hardware sourced from the partner organization National Instruments (NI) and the Swedish test systems company ALIARO.

For the modeling or “plant” simulation side, if the testing will be done in NI’s VeriStand test application software, there may not be much strict programming required. VeriStand is a more “finished product” dedicated to this type of testing. Therefore, the learning curve can be easier overall, and the setup time for individual tests is generally shorter.

If a test is conducted using NI’s LabVIEW systems engineering software, there will likely be programming involved, since LabVIEW is a programming language with a wide variety of plug-in libraries. This makes it more versatile, able to control anything from a chemical reaction to, well, a motor for an electric vehicle. However, its setup time can be longer due to its complexity, variability, and the need to program it for individual-specific tasks.

Once the HIL test bench is set up and operating, extensive additional programming will be required to automate testing; however, this can bring your test setup to a multi-threaded state in which the bench can simultaneously process multiple tests. This function greatly speeds development once the setup is complete.

white paper: how to adapt to new engine testing needs- a guide for testing electric, hybrid, and autonomous vehicles

What components are used in HIL testing?

To flesh out software and verify that it works as intended, the test equipment must provide the same interfaces as the end product or application (an EV motor, in our case). This includes sensor-type and actuator-type interfaces, as well as whatever is needed to provide the full-function virtual model of the end product.

LHP has been partnered with National Instruments Corp (NI) for some time. NI produces the VeriStand and LabVIEW software, as well as a full line of test equipment to connect components to the main computing platform. NI’s partner corporation, ALIARO, also offers custom HIL testing tools and equipment, as well as highly configurable test bench hardware. We can break out components by supplier for convenience.

NI

These software components are two options for interfaces that reside on the software side and feed the test bench to the controller. In the best case, simulation parameters for a component might be available in the manufacturer’s data sheet or directly in a manufacturer-provided model file. In other scenarios, a model may have to be constructed from known parameters and specs. Once this model is constructed, it needs to be run on software that can simulate its behavior in communication with the controller during testing

LabVIEW

LabVIEW is a software development environment for lab test software. It’s incredibly flexible and adaptable for numerous types of laboratory tests, not limited to automotive. LabVIEW has been used to run models of nearly every imaginable end application for LHP.

VeriStand

NI also developed VeriStand, which removes some of the programming burden from using LabVIEW for HIL testing. VeriStand is dedicated to real-time HIL test software. It’s been specifically designed to facilitate the configuration and deployment of end-product models and to make interface mapping through test bench hardware rapid, accurate, and as streamlined a process as possible, resulting in shorter setups overall and enabling test personnel to validate their embedded controllers much faster.

Hardware

So we have now touched on two required components, the controller to be tested and the software to simulate its end application. What remains? The test bench in the middle mates the electronic controller to a software model via electrical connections.

In addition to its software testing environments, NI also supplies hardware to build the test bench itself. One example is their “workhorse” PXI system. This system is the mainstay of many test labs. The PXI is essentially a PCI (Peripheral Component Interconnect) backplane or a circuit board with parallel-wired pin connectors. The pin of each connector is linked to the same relative pin of all the other connectors, forming a bus, the basic computer mechanism to transfer data between components. In NI’s PXI system, this specialty backplane is fitted with specialty cards and slots for additional components, all in a compact chassis. This bench component can be customized heavily to tailor its operation to any testing needs.

ALIARO

Hardware

NI’s partner ALIARO also offers unique, innovative hardware that works well with NI test software. Some of the most interesting ones are their multifunction cards, which allow analog and digital input and output from, for example, another NI component on the same card. The ALIARO X Move Configurator features a graphical interface that enables rapid signal mapping of individual pins and cables from the hardware to the software side. The ALIARO interface then exports a map file to VeriStand. This makes setting up for each test much faster, and switching between setups can be quite rapid. ALIARO offers an array of hardware solutions, but these two components could save immense time and expense in testing and developing embedded software on ECUs across a vehicle, vastly speeding development. These components offer much more than their innovative technology; they also work so well with the other components already in the field.

New call-to-action

Conclusion

When performing vital hardware-in-the-loop tests to verify and validate embedded controllers, the right test bench components and software can put an organization miles ahead of competitors. A complete understanding of HIL testing is one way to ensure end products are not only functional safety compliant but also that they have not been held up in development for too long.

Automated HIL is a necessity for rapidly bringing high-quality modern automotive embedded controllers to market. There is no way to test every required scenario without automation, especially when considering the pressure of functional safety-based controls on verification and design. LHP’s expertise in both functional safety and hardware-in-the-loop testing will help your organization meet development deadlines with high-quality embedded controls.

Additional Content

Testing Requirements of Autonomous Features with National Instruments Powertrain Control Modules

Testing Requirements of Autonomous Features with National Instruments Powertrain Control Modules

NI Drivven Powertrain Modules, Exclusively sold by LHPTS, an LHP division.

Read More
What Does the Foreseeable Future of an AUTOSAR Engineer Look Like?

What Does the Foreseeable Future of an AUTOSAR Engineer Look Like?

What Does the Foreseeable Future of an AUTOSAR Engineer Look Like?

Read More
How to Control Rail Pressure in a Gasoline Direct Injection Fuel System

How to Control Rail Pressure in a Gasoline Direct Injection Fuel System

As automobiles continue to become cleaner, higher performing, and more reliable, their designs evolve. One critical system undergoing dramatic change...

Read More
A New Platform For Testing Complex Control Systems - Part 3

A New Platform For Testing Complex Control Systems - Part 3

LHP is releasing a new product into our model-based design and test workflow at the Automotive Testing Expo in Novi, MI on 10/20. The LHP...

Read More
Improving H/Ev Motor Control Using Simulation in LabVIEW

Improving H/Ev Motor Control Using Simulation in LabVIEW

How to evaluate H/EV technology to improve motor control using simulation in LabVIEW One of the most integral elements of the Hybrid and Electrical...

Read More
What is HIL Testing?

What is HIL Testing?

What is HIL Testing? Introduction Hardware-In-the-Loop (HIL) refers to the process of testing a vehicle’s hardware by integrating it into a software...

Read More