Does the World Need yet Another HIL Simulation Platform?
In the past couple of months since we introduced the RT Box as our new real-time simulation platform, many of our customers and interested users have asked me these two questions:
- Why did you develop your own hardware platform?
- How is the RT Box different from existing offerings?
Indeed, if you look around and compare the technical specifications of the RT Box with competitive products, you may find quite a few similarities. The same processor is employed in other offerings, the number of analog and digital I/Os appears familiar and even the form factor does not come as a surprise. The only obvious difference might be its competitive price. However, the Plexim HIL simulation platform, consisting of specialized hardware and software, is unique and innovative in multiple not immediately apparent ways. In fact, it has been designed from the ground up to be the most versatile and easy to use real-time simulator for power electronics on the market. Let me explain how.
From mainframe to personal real-time simulator
Up to now, real-time HIL testing of control devices has been a pretty expensive and time-consuming endeavor:
Real-time simulation systems can easily cost $100k or more. For this amount of money the customer typically receives a turnkey solution with software and hardware components tailored to a specific project. The type and number of inputs and outputs and the processing unit are designed according to the requirements of the intended device under test.
However, these tailor-made solutions suffer from a drawback: If the requirements change, which is typical for agile development processes, the simulation hardware might need to be modified or upgraded. After the project is finished, it is often impossible to reuse the existing hardware for a completely new application. The required modifications could be as expensive as a new system.
Today, HIL testing is still in the hands of relatively few dedicated experts in a company. The cost and complexity of the real-time simulators prevent regular development engineers from using real-time simulators. This situation reminds me of the use of offline simulation on mainframe computers a couple of decades ago, when simulation tools were either very expensive or so complicated to operate that they required specially trained engineers.
We therefore set out to develop a platform that is accessible by all hardware and software engineers, even if they have little or no HIL experience. The result is an affordable and multi-purpose device. Engineers who only casually use simulation tools can be up and running with the RT Box in no time. No expert knowledge or training is required to successfully model a power electronic system and run the simulation. All configurations are made directly within the PLECS schematic, which also serves as the principle interface to the RT Box when the real-time simulation is running.
Our solution does not rely on any third-party tools. Consequently, the installation and configuration of the software and hardware components is straightforward and uncomplicated, allowing the user to quickly and effectively customize and adapt the HIL platform to the actual project needs by simply editing the PLECS schematic.
Seamless transition between offline and real-time simulation
What really sets the RT Box apart from other offerings is the way it is integrated with the established software package PLECS for offline simulation. The fact that Plexim develops both hardware and the software results in a unique user experience when setting up and operating the RT Box:
Upon a single click in PLECS, real-time code for the corresponding model is generated, compiled and uploaded to the RT Box. Via the External Mode the offline PLECS model then connects to the real-time simulation. When connected, the scopes and display blocks inside the PLECS model are populated with simulation results from the RT Box. Any simulated signal can serve as a trigger for manual or automatic data acquisition.
If the user changes the value of a tunable component parameter such as a controller gain in the PLECS model the real-time simulation will be updated immediately with the new value. As many important parameters can be changed on the fly the code does not need to be generated again for every small modification in the model.
In a typical engineering workflow, the circuit model is first developed and tested with offline simulation in PLECS. Before generating code and deploying the model to the RT Box, the user has the opportunity to verify the fidelity of the discrete-time simulation by running the model with different fixed and variable-step solvers. As PLECS permits to save and overlay simulation results, the discrepancies introduced by time discretization can be visualized easily.
Usually, not the whole PLECS model but only a part of it shall be simulated in real-time. If used for HIL testing, the RT Box simulates only the power stage while the controls in the model are replaced by real control hardware. To still use a single model for offline simulation and real-time testing, the power stage can be placed in a subsystem and the real-time code can be generated just for this subsystem.
In a PLECS schematic, special peripheral blocks represent the functionality of the various analog and digital I/Os of the RT Box. These blocks can be assigned to individual hardware channels and configured for their intended purpose. Each of these peripheral blocks has two different implementations: One implementation is used to access the RT Box hardware from the generated real-time code. The other one resembles the behavior of the hardware I/Os in an offline simulation. This duality enables the user to seamlessly transition between offline simulations of the complete model and real-time simulations of a subsystem.
Optimized combination of hardware and software
The key ingredients to pushing the envelope of real-time simulation are code generation and specialized hardware on which the generated code executes. We control both of these aspects and have made sure that the Coder is generating optimal code for our hardware, while our hardware, in turn, has been optimized for the generated code. Furthermore, we have added specialized components to the PLECS library permitting high-fidelity real-time simulation of high switching-frequency converters.
The brain inside the RT Box is a Zynq SoC from Xilinx that embeds two CPU cores on an FPGA. The real-time simulation is performed on one of the cores while the other runs an embedded Linux for communication and ancillary services. The FPGA fabric is used to control the ADCs and DACs of the analog channels and to perform PWM generation and capture on the digital channels.
The big advantage of using a SoC is the low latency of less than 1 μs when moving data between the external I/Os and the CPU core. Low roundtrip latency is important when performing HIL testing in order to minimize the delays added into the control loops. Such low latencies cannot be reached with traditional CPU-based simulators where the I/Os are connected to the processor via PCI Express.
Performing the real-time simulation on a CPU gives the user the full flexibility to execute any type of C code representing the model. This would not be possible if the computation was solely performed on an FPGA. In the future, the tight integration between the CPU and the FPGA on the SoC will allow us to split the model into slow and fast tasks and compute parts of the model on the CPU cores and other parts in the FPGA fabric.
The RT Box is equipped with 16 analog input and 16 analog output channels. All analog I/Os feature 16 bit resolution and up to 2 MHz sampling frequency. In addition, the box has 32 digital input and 32 output channels. The digital I/Os can either be used for PWM capture and PWM generation with a time resolution of 7.5 ns or as simple general purpose I/Os. The symmetry in number and performance of inputs and outputs makes the RT Box equally well suited for both HIL testing and rapid control prototyping.
For larger systems such as multi-level inverters, multiple RT Boxes can be connected together via high-speed serial communication links. The RT Box has four such high-speed bi-directional links, each of them supporting data rates of up to 6.25 Gbit/s. Multiple RT Boxes can communicate in a master-slave fashion or as independent workers.
Vision: HIL testing being part of controller development
Our vision is to turn real-time HIL testing from an expensive and demanding application for the few into an everyday tool for all power electronic engineers developing controls. Continuous HIL testing of controllers during the whole development cycle enables more agile development processes without costly iterations. As HIL testing ensures product quality and safety it should become an integral part of every release cycle.
The RT Box is the result of a ground-up development aimed at making power-electronics HIL simulation substantially more accessible and easy to use. All software and hardware components have been designed in house to obtain an overall optimized solution, both in terms of performance and user friendliness. Priced at around $10k the RT Box does not cost more than a typical software package for offline simulation.
The Plexim approach is an important contribution to more wide-spread HIL testing as it enables any development engineer to successfully utilize and apply real-time simulations of power electronic systems.
Furthermore, our customers are backed-up by highly skilled technical staff at Plexim, who understand how to tweak every bit of performance out of a real-time system to minimize latency and maximize accuracy.
Stay tuned for the next article which will provide tips and tricks on how to optimize power electronic systems modeled in PLECS for real-time simulation.
Principal Engineer @ EcoJoule Energy
8 年Great decision of not using "third-party tools", the learning experience is so much better this way. Another big plus of the RT Box is making use of that awesome scope from PLECS.