Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating Flexible Engine Simulators with LabVIEW 7 FPGA Module

  Print

Author(s):
Matthew Viele - Woodward Governor

Industry:
Automotive, Machines/Mechanics, Industrial Controls/ Devices/ Systems, Electromechanics/ Electrotechnics

Products:
Data Acquisition, Real-Time Module, Digital I/O, PXI/CompactPCI, Distributed I/O, LabVIEW, FPGA Module

The Challenge:
Developing an engine simulator for hardware-in-the-loop (HIL) testing of engine controller modules.

The Solution:
Using National Instruments LabVIEW 7 Express, LabVIEW 7 Real-Time Module, LabVIEW 7 FPGA Module, and PXI-7831R reconfigurable I/O boards to provide real-time simulation with precise, flexible timing and synchronization of I/O signals.

"By using the LabVIEW 7 FPGA Module to program the FPGA on the NI PXI-7831R reconfigurable I/O board, we exceeded our specifications and saved 90 percent of the cost of building our own hardware."

HIL Simulation Demands
As the worldwide leader in industrial energy control technologies, we at Woodward Industrial Controls work closely with engine and turbine original equipment manufacturers to develop efficient control solutions. Woodward technologies provide not only speed and load controls, but also emission, generator, compressor, turbocharger, and ignition controls for diesel and natural gas engines, gas and steam turbines, electric power generation systems, and microturbines and fuel cells. To test a new line of engine controllers, we needed to create a system capable of simulating all inputs and outputs of a running engine.

The engine controller we tested continually adjusts the ignition, fuel injectors, and other outputs responsible for engine performance. The test system must make these adjustments in a real-time, closed-loop fashion to respond to engine parameters such as manifold pressure, mass air flow, engine speed, and engine temperature. The test system also must detect engine knock, control the waste gate for the turbo charger, and achieve the desired levels of engine speed and torque set by the operator through the throttle.

Testing the controller with a real engine is dangerous and expensive. A controller with flaws in the code could introduce faults such as knock, overspeed, and excess temperatures that destroy the test engine or cause a dangerous accident in the test cell. Engines are used typically only for final calibration.

By simulating the outputs of an engine in response to inputs from the controller, we accomplish HIL testing of the controller without an engine present. It also helps us simulate conditions that may be difficult to achieve with a real engine in a test cell, such as running at the limits of expected use. In addition to simulating normal operating conditions, the test system simulates fault conditions by shorting and opening signal paths. By using an HIL simulator for controller testing, we can verify that changes made in the controller code for a new engine do not introduce problems with engines previously tested with the older code. We perform this regression testing by using simulated data from the previously tested engines, rather than testing the new control scheme with a matrix of real engines.

Simulating the Engine in Real Time
Over the years, we have used a number of engine controller test systems, including an electric motor-driven method, a complex programmable logic device, and a turnkey system designed specifically for control module testing. Though these systems fulfilled many of our requirements, they did not provide the flexibility and efficiency of a fully-automated solution that we could modify to meet our future testing needs.

For our newest line of engine controllers, we needed to build our own system. For the simulation, we selected the LabVIEW 7 Real-Time Module because we required the deterministic operation that only a real-time operating system could deliver. For the I/O signals, we wanted to use an FPGA board to meet our timing and synchronization requirements. To generate output waveforms and pulse trains, we needed the FPGA to run at speeds much higher than the main simulation loop.

Before we learned of the NI LabVIEW 7 FPGA Module and reconfigurable I/O hardware, we scoped building our own FPGA-based hardware. We also searched for a board with an FPGA and integrated I/O. By using the LabVIEW 7 FPGA Module to program the FPGA on the NI PXI-7831R reconfigurable I/O board, we exceeded our specifications and saved 90 percent of the cost of building our own hardware. Part of this cost savings resulted from productivity gains. With the LabVIEW 7 FPGA Module, we can configure the FPGA by easily programming in LabVIEW 7 Express without assigning an expensive and hard-to-find VHDL designer to the project. By using LabVIEW 7 Express to configure the FPGA, our software developers completed the project without the help of our hardware engineers.

Synchronization and Generation of Signals
To accurately represent an engine, we must synchronize many of the signals to the crank angle, which represents the engine position. To test the controller properly, we must also synchronize the sampling of the controller outputs with the crank signal that our system generates. We used an analog output on the PXI-7831R reconfigurable I/O board to simulate the variable reluctance crank sensor. We track engine position at a resolution of one crank angle degree. For example, if the engine operates at 4,000 rpm, the rate of the engine-position tracker is 24 kHz. By using the LabVIEW 7 FPGA Module to configure the FPGA on the PXI-7831R, we synchronize the generation of simulated signals, such as the crank angle, knock, and manifold pressure, with the measurements from the controller with a resolution of 25 nanoseconds.

Generating the simulated outputs requires the ability to control the output channels of the I/O board at a much faster rate than the main engine simulation loop. Our simulation runs under LabVIEW Real-Time at 1 kHz, the rate of decision making. Once a decision is made, the system must quickly generate I/O to execute the control instruction. For example, the engine controller under test may command the engine to run in a state that would cause a knock event. The model running under LabVIEW Real-Time determines that it needs to generate a knock event of a certain magnitude for a particular cylinder. The FPGA on the PXI-7831R board then generates this output signal. Between the start and end of the crank angle-based “knock window,” the system must generate the correct fequency and amplitude of the output signal to the controller under test. Together, the LabVIEW 7 FPGA Module and the PXI-7831R reconfigurable I/O board form the missing piece that previously prevented us from using a complete National Instruments system for HIL simulation.

We also generate signals from the simulation that we do not have to synchronize to crank angle, including switches, temperatures, pedal position, throttle position, and vehicle speed. We generate these on separate output channels of the PXI-7831R reconfigurable I/O board. Each analog input and output has a dedicated ADC or DAC, respectively. With the architecture of the FPGA, we can simultaneously run parallel processes. Though there is no operating system on the FPGA, it functions as if there were multiple, independent processors on the chip that were custom designed for specific tasks.

Extending the NI Automotive Test Platform
The LabVIEW 7 FPGA Module and reconfigurable I/O hardware have extended the National Instruments automotive test platform into HIL simulation for engine controller testing. The increased control of I/O timing and synchronization combined with rapid onboard decision making for output generation are vital to simulating an engine in real time. We can now build and modify a test system that best meets all of our ECU testing needs.

For more information, contact
Matthew Viele,
Woodward Governor
1000 E Drake,
Fort Collins, CO 80525

Browse All Case Studies »

  Print