1. Testing Challenges
Control inputs and outputs for electric drive engine control units (ECUs) must run much faster than those of a power train ECU for an internal combustion engine. The higher speed digital switching signals used to control the electric motor system make the traditional approach to HIL test inadequate. Figure 1 shows the rise in relative error of the simulated response to a 2kHz and 8kHz pulse-width modulated (PWM) signal as simulation time step increases.
Figure 1. Relative simulation error of a power electronics system in response to a PWM signal with a base frequency of 2kHz or 8kHz
From the graph, you can see that for a simulation loop with a 25 µs period, the simulated response to an 8kHz PWM has as much as 20% relative error induced by the time resolution of the simulation. The smaller graph shows an enlarged view of the error in the sub-microsecond range and shows that the same simulation running at 1 µs has only 0.75% error in the PWM measurement.
To add extra complexity, electric motors exhibit complex non-linear behavior like magnetic saturation and cogging torque that can be difficult to model directly. An ECU can be effectively tested for basic functionality using a linear model, but the more complex behavior needs to be modeled for more stringent testing, tuning and optimization.
Figure 2 shows three stages of power system test; signal level test where the entire system is simulated to test the control electronics, power level test where a motor emulator is used to fully exercise both the control system and the power electronics, and mechanical or dynamometer test. Traditional simulation systems have limited the test capabilities of control system designers and forced them to rely heavily on costly dynamometer or field testing. However improving simulation speed and fidelity allows more testing to be done at the signal and power level, reducing the time and cost of the physical test stage.
Figure 2. An outline of the three different phases of control system test for electric motors, signal level testing, power level testing and mechanical testing
Reaching the 1 µs range for simulation periods has required a paradigm shift in the design of electric motor and power electronics HIL test systems. The key enabling technology in being able to simulate systems at such fast rates has been the shift from traditional processor-based HIL systems to field-programmable gate array (FPGAs) based simulators.
Traditional processor-based HIL systems reach maximum speeds of around 50kHz due to the fact that the processor and the I/O node are separated by a communication bus. During a single time step of the simulation, the inputs are sampled, that data is transferred to the processor, the result is transferred back to the I/O node, and the outputs are updated. On a PCI or PXI bus, the latency of the communication can typically take up to three quarters of the overall simulation period. Moving the calculations to an FGPA increases the speed of the calculation itself, but the big boost in speed comes from colocating the processing node and the I/O node on the single device, leading to negligible communication latency.
The next challenge engineers face when conducting real-time simulation of advanced motor drives is how to attain an adequate combination of model fidelity and simulation speed. While a simple constant parameter or linear model may be sufficient to conduct functional-level HIL tests, increased model fidelity is often necessary for more robust testing and optimization of advanced motor drives. An effective way to increase the simulation fidelity without adding to the complexity of the calculations is to replace the model parameters with lookup tables and update those parameters on every simulation iteration.
Using finite-element analysis (FEA) results or experimentally derived tables, you can simulate complex non-idea and non-linear behavior, such as cogging torque or magnetic saturation, and design a controller responds appropriately to the complex phenomena. In each of these cases the lookup table captures the complex behavior without modeling it directly in the simulation, an example of which can be seen clearly in Figure 3 where the motor inductance varies from 4.5-12mH over its operating range.
Figure 3. A surface plot of the D-Q inductance values of a motor over its operating range.
National Instruments has combined hardware and software tools to provide an industry-leading platform for power electronics and electric motor real-time test. The NI Electric Motor Simulation Toolkit contains models of electrical machines and inverters that allow a control engineer to quickly set up test systems that tie into the greater ecosystem of NI's tools for real-time test.
NI Electric Motor Simulation Toolkit
The NI Electric Motor Simulation Toolkit provides the modeling elements to develop both desktop and hardware-in-the-loop (HIL) simulations of electric motor systems. The toolkit adds a LabVIEW project template for electric simulation, control and HIL as well as VeriStand add-ons for the various motor types. The models can be executed on a host computer for software-only simulation, on NI Real-Time targets for traditional HIL or on NI FPGA targets for high-speed HIL.
Figure 4. This setup shows a typical hardware and software combination for an electric motor ECU HIL test. The PXI-based high-fidelity simulator is using a FlexRIO FPGA board along with the front-end adapter module from KGC and data is being logged and displayed with NI VeriStand.
The toolkit contains models of Switched Reluctance (SR) and Permanent Magnet Syncronous Machine (PMSM) motor types in a simple linear approximation or in a high-fidelity representation that integrates with JSOL's JMAG-RT models. The interface with the finite-element analysis (FEA) based JMAG-RT models provides the ability to accurately simulate highly non-linear behavior such as cogging torque and magnetic saturation.
Supported Motor Types:
- Permanent Magnet Synchronous Machine (PMSM)
- Constant parameter model
- JMAG-RT FEA-based model
- Switched Reluctance Motors (SRM)
- Linear model
- JMAG-RT FEA-based model
Partnership with JSOL Corporation for HIL using JMAG-RT Models
National Instruments has partnered with JSOL Corporation to use its FEA tools, JMAG and JMAG-RT, to generate high-fidelity models that you can use with NI LabVIEW system design software and NI VeriStand software for configuring real-time testing applications. With this partnership, NI is addressing key requirements for electric motor testing and simulation. Now you can run FEA-based motor models with microsecond timing by using LabVIEW FPGA and NI RIO FPGA-based hardware. The models use FEA generated lookup table to parameterize the models in real time based on the current state of the motor. This combination of linear math and non-linear lookup tables provide a very fast but very accurate simulation
Figure 5. Torque calculations obtained with a constant parameter D-Q model, an offline JMAG FEA model, and JMAG-RT model running in LabVIEW FPGA. Note that the D-Q model simulates the average value of the torque while the JMAG and JMAG-RT models simulate the torque ripple with greater accuracy.
NI VeriStand is a configuration-based software environment for creating real-time testing applications. Out of the box, it helps you perform real-time target-to-host communication, data logging, stimulus generation, and alarm detection and response. NI VeriStand also transitions quickly from simulation-only testing to HIL testing, which helps you reuse test components such as test profiles, alarms, procedures, and analysis routines. You can easily remap parameters from models to hardware channels to facilitate real-world I/O. This easy transition saves you time when performing regression testing and helps you automate tests using test executive software such as NI TestStand.
NI VeriStand features an open framework that you can use to create application-specific functionality via real-time plug-ins. This provides maximum flexibility in your test system. The NI Electric Motor Simulation Toolkit adds motor modeling features to the configuration-based environment and allows an engineer to perform desktop simulation and test, real-time simulation and test on a traditional real-time hardware platform or high speed simulation on an FPGA.
Figure 6. Using NI VeriStand, you can deploy models from different environments across a variety of simulation targets.
Field-programmable gate arrays (FPGAs) are reprogrammable silicon chips. In contrast to processors that you find in your PC, programming an FPGA rewires the chip itself to implement your functionality rather than run a software application. Ross Freeman, the cofounder of Xilinx, invented the first FPGA in 1985. NI has partnered with Xilinx to offer their cutting-edge FPGA technology in a variety of hardware platforms and has opened them up to graphical programming and floating-point math using LabVIEW FPGA.
4. Additional Resources
To inquire about an NI Electric Motor HIL System, email email@example.com