Test activities are necessary for any system but it is vital for embedded systems, many of which are life critical. Engineers will be working with software that has to operate with mechanical parts or various components of sub-systems.
Design engineers live in an increasingly software centric world and developing reliable code doesn't happen by accident. But while it is a painstaking process, there are a number of techniques that are available to support the development of reliable embedded systems.
The performance of embedded devices is driven by the software they run and modern devices often rely on sophisticated embedded software, which is continually becoming more advanced in order to incorporate new features or added functionality.
The market for embedded applications is fragmented and dynamic, which means companies face a growing challenge to drive innovation in their products and often find testing the deployed code is a major roadblock. The degree to which companies can introduce new technology into their embedded products is often limited by the associated development and testing costs.
According to Aaron Edgcumbe, regional marketing engineer, automated test, with National Instruments: "Manufacturers need to eliminate software bugs and make products as safe as possible, whilst integrating the latest technology."
For example, the software deployed in a modern car typically contains more than 10million lines of code and, during development, there are usually 10 to 20 defects per 1000 lines of code. That equates to more than 100,000 defects that need to be found, tested and rectified.
"When testing such large amounts of code, the traditional approach, such as functional or end of line testing, is simply not feasible," Edgcumbe explained. "Having the ability to scale the testing using hardware in the loop simulation has, as a result, become essential."
Hardware in the Loop (HIL) simulation is a technique that is used in the development and testing of complex real time embedded systems. HIL simulation works by adding a mathematical representation of dynamic systems to the test platform.
An HIL test system comprises three components: a real time processor; I/O interfaces' and an operator interface. The real time processor is at the core of the system, providing the deterministic execution of most of the HIL test system components. It will provide an accurate simulation of the parts of the system that will not be physically present as part of the test.
I/O interfaces are analogue, digital and bus signals that interact with the unit under test, while the operator interface communicates with the real-time processor to provide test commands and visualisation.
HIL simulation will provide electrical emulation of sensors and actuators which will act as the interface between the product simulation and the embedded system that is being tested. The value of each electrically emulated sensor is controlled by the product simulation and is read by the embedded system being tested.
One automotive manufacturer that has successfully employed this technique is Subaru. By using National Instruments' FlexRIO platform, it could execute test patterns automatically, replicating the most severe testing environments.
According to Edgcumbe: "Hybrid electric vehicles require the ability to manage power control between an internal combustion chamber and an electric motor. This requires advances in the complexity and functionality of the code running on the electronic control units (ECUs).
"When Subaru was designing its first hybrid electric vehicle – the Subaru XV Crosstrek – engineers needed to implement a system for complete test coverage of this new technology. Testing newly developed firmware using a real vehicle or physical machinery would have not only been expensive, but also potentially very dangerous. In addition, the sheer amount of code requiring testing would have made traditional testing approaches impossible."
The HIL system can represent any operating condition of the motor by setting physical parameters or resistances. By simply changing a parameter in the middle of the test, the HIL system can simulate complex test scenarios. When the operator requests a test pattern, the HIL system will respond like a real motor and the overall system response can then be cross-referenced with expectations to validate that the controller handled the test case safely.
"A user programmable FPGA … provides a more open and flexible approach to measurements." Aaron Edgcumbe |
Subaru engineers found that traditional HIL processors could not simulate accurately the fidelity and speed required by the new electric motor model – this is not an uncommon challenge faced by manufacturing companies, where HIL simulations are pushing the capabilities of real time processors. As a result, the team used core system hardware based on NI's FlexRIO FPGA modules, which are PXI based controllers equipped with FPGAs.
More companies are now using FPGA based instruments to accelerate processing, allowing more demanding simulation loop rate requirements to be met.
"Implementing this technology allowed Subaru to achieve a 20x reduction in test time, ensuring the company could bring its technology to market, whilst still maintaining the same high quality and – more importantly – safe software," Edgcumbe noted.
"More manufacturers are beginning to adopt FPGA based technologies and, as a result, are establishing an advantage over their competitors in that they can bring the latest technology to market whilst maintaining high quality products and stable development costs."
Cost, duration and safety are the key requirements that need to be taken into account when it comes to deploying HIL simulation. Specific conditions that may warrant the use of HIL simulation can include limited development schedules, which is of particular concern when it comes to new developments in the automotive, aerospace and defence sectors.
In most cases, HIL simulation will be used in parallel with the development of the actual product. 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.
Test engineers are always under pressure to lower the cost of test and maintain high quality levels allowing the introduction of new technology into their products.
"Engineers are finding FPGAs can be used as an enabling technology, allowing them to improve their HIL simulations to capture more quality issues faster," suggested Edgcumbe.
"Off the shelf instrumentation has typically been fixed in its capability. The introduction of a software designed instruments incorporating a user programmable FPGA directly into the instrument, provides a more open and flexible approach to measurements. This allows users to customise the instruments to their own needs, with capabilities for inline signal processing, closed loop control and custom algorithm deployment."
The result allows users manufacturers to reduce test time significantly, provide more accurate model simulations and reduce the cost whilst, more critically, maintaining quality and safety.