Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009
REAL-TIME PLATFORM FOR THE CONTROL PROTOTYPING AND SIMULATION OF POWER ELECTRONICS AND MOTOR DRIVES Simon Abourida, Jean Belanger Opal-RT Technologies Inc. 1751 Richardson #2525 Montreal, J4P 1G6, Quebec, Canada
[email protected] sectors: electromechanical systems, aerospace, power systems, electric drives, railway systems, etc
ABSTRACT The paper presents state-of-the-art technologies and platform for real-time simulation and control of motor drives, power converters and power systems. Through its support for Model-Based Design method with Simulink®, its powerful hardware (multi-core processors and FPGAs), and its specialized model libraries and solvers, this realtime simulator (RT-LAB™) enables the engineer and researcher to efficiently implement advanced control strategies on embedded hardware, or to conduct extensive testing of complex power electronics and real-time transient simulation of large power systems. 1.
INTRODUCTION
Over the years, it has been increasingly acknowledged how important and essential the tools of real-time simulation and testing in all industries are. These tools are no longer a luxury in modern system design, especially in electric motor drives and power electronics, whose applications are found in an ever increasing number in all sectors. As for power systems, it was the sector that pioneered the use of real-time simulators tens of years ago, starting with analog simulator, before the advent of computers and the development of hybrid then fully digital realtime simulators. On other hand, commercial simulation packages such as MATLAB/Simulink™ are now widely used in the industry, education, and research institutions alike. They have become the modeling tools of choice because the many advantages they offer: increase in engineering productivity and efficiency, and accelerated design cycle by relying on the Model Based Design (MBD) methodology, making it possible to go from concept to simulation without ever having to write code, and producing a working prototype very early in the design process. Because of its advantages, the MBD approach has renewed the importance and interest in real-time simulation and its many applications and spread the usage of RT simulation to new fields, because it had greatly facilitated the development of real-time applications and accelerated their design. Before and after the establishment of this MBD process, several real-simulation time tools has been developed, in different
Many such tools were proprietary systems or mere research projects that failed to get into maturity. The few others that made it to maturity and had many applications and users have restrained their applications solely to the real-time simulation of the complex electric power systems (RTDS, Hypersim [1]) resulting in high cost for simpler systems like electric drives and industrial power converters; others failed, despite their success in small applications or complex but slow dynamic systems, to address the needs and requirements of real-time simulation of the fast electromagnetic transients of power systems, and the fast dynamics of today’s power converters and electric motor drives, and therefore, their applications stayed confined to systems with relatively slow dynamics (mechanical, hydraulic, aerodynamic systems, etc). A powerful platform for real-time simulation and control of electromechanical and power systems alike that is based on the MBD approach has been developed (RT-LAB) in the mid nineties, pioneering the use of commercial PC processor as the base platform and using Simulink as the visual design environment. In addition to its scalable, distributed processing hardware, RT-LAB integrates on the software level many solvers and model libraries that were designed to solve the problems and challenges of the real-time control and simulation of fast dynamics like those found in electric motor drives, power converters, power grid, renewable energy systems, and other applications. The present paper describes this real-time platform and its architecture, and presents some of its typical applications. It is organized as follows: first an introduction to the methodology of model-based design and its applications is given in section 2; then the RT-LAB platform, its hardware architecture and its software are presented thoroughly in section 3, and some applicationdriven real-time simulators are presented in section 4; typical applications are shown and discussed in section 5, before concluding. 2.
MODEL-BASED DESIGN AND REAL-TIME SIMULATION
In traditional design and test methods of control systems, the actual product or even its prototype become available very late in the design process; and it is only then, as system integration is done toward the end of the design that the designers were able to
ICMSAO’09-1
Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009 find out if the system work well and behave as it was intended to, or to uncover eventual errors in the design, implementation or integration of the system and its components. Model-Based Design process (illustrated on Figure 1) addresses these shortcomings of the traditional development method; it consists of building a mathematical model of the system in a graphical block-diagram environment (like Simulink ™). The entire system model can then be simulated to accurately predict, validate and optimize its performance, and to iteratively refine it until it meets the requirements; this is the model design stage.
The major elements integrated in this real-time platform are: distributed processing architecture; powerful processors, high precision and very fast input/output interface, hard real-time scheduler, and modeling libraries and solvers specifically designed for the highly non-linear motor drives, power electronics, and power systems. 3.1. Architecture of RT-LAB platform The general architecture of RT-LAB is shown on Figure 2. In this host-target architecture, the host is used to develop the model at the design stage, and during runtime, as the user interface, communicating with the target by Ethernet. The target where the real-time computation done, is a PC and has therefore the standard architecture of a PC; one or two processors are dedicated to the simulation of the Simulink model; a PCI (or PCI-Express) bus connects the processors to the rest of the system, and to inputs/outputs (I/O) through an FPGA board; the I/O’s are modular and their number can be configured according to the application needs.
Figure 1: The process of Model Based Design This system model becomes then a specification from which realtime software code is automatically generated for prototyping and implementation, thus avoiding hand coding and reducing the potential for errors (automatic software generation). The software automatically generated from the system-level, graphical block diagram is then uploaded to a real-time platform, and is ready for testing. In fact, verification and validation are conducted throughout the development of the product by integrating tests into the models at any stage. This continuous verification and simulation helps identify errors early, when they are easier and less expensive to fix. This model based design process is more and more used in the development of dynamic systems including motor drives and power electronics systems. In educational institutions, this process is becoming the preferred approach for both research and teaching, because it enables the researchers, engineers and students to focus on their design, algorithms, system topologies and different innovative ideas, rather than dedicating a significant part of their effort and time to the intricacies of writing the realtime code and implementing the software on the real-time platform (microcontroller, DSP, FPGA, etc). 3.
RT-LAB REAL-TIME PLATFORM
RT-LAB is a powerful, modular, distributed, real-time platform that lets the engineer and researcher to quickly implement block diagram Simulink models on PC platform, supporting thus the model-based design method by the use of rapid prototyping and hardware-in-the-loop simulation of complex dynamic systems.
Figure 2: The architecture of RT-LAB based simulator In addition, several targets can be interconnected with FireWire or PCI Express real-time communication links and switches, making the complete system a super-computer of high computational capacity, ideal for the real-time simulation of complex systems (power grids, wind farms, distributed generation systems in large ships, and others) 3.1.1.
Processor
RT-LAB uses Intel™ or AMD™ processors as real-time targets; there can be a single or two processors in one target; each processor can be single, dual or quad core, so that a single target box can hold as much as 8 processing cores, communicating by shared memory; and each core simulates a Simulink subsystem; this makes such an RT-LAB target box a very powerful distributed processing simulator that can handle very complex simulation applications. In addition, for applications requiring very small simulation step in the microsecond range, RT-LAB uses Xilinx FPGA as real-
ICMSAO’09-2
Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009 time target; and while this target requires some extra handling in the model by the designer, the design itself is done equally in the form of block diagram in the same Simulink graphical environment by using the Xilinx Blockset, and the VHDL code is then automatically generated from the block diagram, compiled and uploaded to the FPGA; the engineer can then design extremely fast control algorithms or model extremely fast sampling plant models and target them to FPGA without hand coding and without the need of programmable logic chip expertise. 3.1.2.
Simulink solver toolbox to simulate line- or loadcommutated drives and AC circuits; it is used to run SimPowerSystems models in real-time.
RTeGRID
Bundle of ARTEMIS and other models and functionalities optimized for the simulation of power systems
RTeGRIDpro
Bundle of S/W tools to simulate large power grids with power electronic systems; it includes RTeGRID, RTeDRIVE and RT-Events
RT-LAB.XSG
Development and run-time tools to design models with Xilinx Blockset and run them on Xilinx FPGA
XSGeDRIVE
Simulink blockset designed with Xilinx blocks to simulate power electronic drives on FPGA
RT-LAB.JMAG
Interface of RT-LAB to JMAG-RT finite element suite from the Japanese Research Institute Solutions, to run high fidelity motor model on CPU target
RT-LAB.JMAGFPGA
JMAG-RT implemented on FPGA target (1 us)
Inputs and Outputs
In order to connect the real-time system with real world hardware devices, (controller or physical plant), input/output (I/O) interface is configured through custom blocks, supplied with RT-LAB as a Simulink toolbox (analog, digital, PWM, encoder, serial communication, etc). The engineer drags and drops the I/O blocks to the graphic model, without worrying about low-level driver programming. RT-LAB manages the automatic code generation so to direct the model’s data flow onto the physical I/O cards. RT-LAB platform supports several commercial PCI I/boards; in addition, in order to meet the stringent I/O speed and accuracy requirements of power electronics and drives, it uses digital I/O boards controlled by a 100 MHz FPGA chip yielding a PWM and encoder resolution of ±10 ns, and 16-bits simultaneous fast analog-digital converters. 3.1.3.
ARTEMIS
Software and Modeling Libraries
RT-LAB runs either on QNX or RT-Linux real-time operating system; at the heart of the software, there is a hard real-time scheduler that ensures a strict real-time execution of the system code. RT-LAB software automatically handles the real-time communication between processing cores, and processors on different target boxes, as well as the communication with the host station, and it handles the interface between the model code (user actual simulated application) and the I/O devices. On the top of the real-time software, modeling toolboxes and solvers for Simulink has been developed to handle the intricate simulation needs of fast transients found in switching power converters, electromagnetic transients in power grids, and to interface with commercial blocksets designed by third parties addressing special needs for the simulation of motor drives and other electrical related systems. The table given below lists the most important of these toolboxes. Table 1: Model and Solver Libraries for RT-LAB Module
Description
RT-Events
Simulink Blockset of control blocks with real-time interpolation for power electronics & hybrid systems (dynamic systems with events).
RTeDRIVE
Simulink Blockset of converter and motor models to simulate motor drives in real-time; it includes voltage-source power converters with real-time interpolation techniques.
3.2. RT-LAB Based Real-Time Simulators 3.2.1.
eDRIVEsim
eDRIVEsim is an advanced real-time, hardware-in-the-loop (HIL) simulator and control prototyping platform that integrates different libraries in the RT-LAB platform; it is intended for designing advanced control systems or for performing HIL testing of controllers used in high-speed electric motors, power electronics, and other electromechanical systems. Blocks from specialized modeling libraries like RTeDrive™, RTEvents™ and ARTEMIS (with SimPowerSystems®) blocksets can be included by the engineer in the Simulink model to run on the processor target. In addition, eDRIVEsim lets the user incorporate subsystems designed with blocks from the Xilinx Blockset for Simulink into the model. This allows that part of the model to be executed on the eDRIVEsim FPGA allowing testing of fast controllers and protection systems, and achieving a low level of latency unprecedented in the simulation of high speed motors and high switching frequency converters. This is illustrated in Figure 3. In this test, a 3-phase AC motor drive is emulated on the FPGA (with Xilinx blockset for Simulink), and the PWM gate signals of the simulated inverter comes from an external controller. The graph shows the total delay (latency) from the PWM input sent to the FPGA-based simulator to the currents that come out on the digital-to-analog outputs. The test shows a total latency in the order of 1.5 µs; this demonstrates the very high simulation speed of the motor drive emulated on the FPGA.
ICMSAO’09-3
Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009 4.
RT-LAB APPLICATIONS
RT-LAB is used in various projects in industries and institutions, spread among different types of applications. Depending on the part of the system that is simulated (controller or plant), the applications of real-time simulation and of RT-LAB real-time system can be grouped in three major categories. These are explained briefly in the following sections. 4.1. Full Real-Time Simulation A control system, is usually made of a controller and a plant connected in closed loop by the means of sensors sending feedback signals from the plant to the controller and actuators to level the signals sent from the controller to the plant (to power switches, breakers, etc). Full real-time simulation consists of converting the Simulink model of the complete system (plant and controller) to real-time software that is uploaded to RT-LAB real-time platform (simulator) to conduct fully digital real-time simulation of the complete system.
Figure 3: Very small latency & time step with the FPGA real-time target of RT-LAB simulator 3.2.2.
eMEGAsim
To answer the real-time electromagnetic simulation needs of power systems, the real-time digital simulator eMEGAsim™ was also developed on the RT-LAB platform. In eMEGAsim, the user develops controller models with Simulink and electrical circuit models with SimPowerSystem [2]. SimPowerSystem is a Simulink toolbox which provides multiple integrated models, all based on electromechanical and electromagnetic equations, for the simulation of power grids and machine drives. ARTEMIS enables SimPowerSystems models to be implemented and run in real-time. With the combination of other Simulink mathematical and physical-domain toolboxes, it is possible to easily model any power system components interconnected with complex mechanical subsystems and associated controls. An EMTP-RV™ [3] interface is also available to facilitate circuit diagram capture and validation of large circuits. The resulting model can be simulated offline using variable-step or fixed step solvers in Simulink and with ARTEMIS third- and fifth-order fixed-step solver, optimized for real-time parallel simulation of models made with SimPowerSystems.
As an example, the paper in [5][7] describes the use of RT-LAB for the real-time simulation of an induction motor drive with field-oriented speed controller, where [8] presents the use of RTLAB PC-cluster simulator for real-time simulation of an All Electric Ship integrated power system analysis and optimization. The project described in [9] explains the hardware and software details of RT-LAB real-time digital simulator and its use for power engineering research. It describes its application for the study of 3-level induction motor drive with vector-control and compares the real-time simulation results to offline results from PSCAD/EMTDC. 4.2. Rapid Control Prototyping Rapid Control Prototyping or RCP consists of quickly generating a functioning prototype of the controller, and to test and iterate this control algorithm on a real-time platform with real input/output devices. Rapid control prototyping differs from HIL in that the control strategy is simulated in real-time and the “plant,” or system under control, is real. The applications of RT-LAB real-time system for rapid control prototyping are numerous; it is found in the development of a biped locomotor applicable to medical and welfare fields [10]; in autonomous control to maneuver a ship along desired paths at different velocities [11], where RT-Lab is used for rapid prototyping of the ship real-time feedback controller; in real-time control of a multilevel converter using the mathematical theory of resultants [12]; and in several research and teaching labs for the control of electric motors; a typical setup using the DriveLab™ experimental kit is shown on Figure 4.
With the integration of the above tools, eMEGAsim becomes a powerful real-time digital simulator for the study of FACTS [4][5], in-land and electric ship power grid, wind farm interconnection with the power grid [6], etc.
ICMSAO’09-4
Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009 model based on Finite Element Analysis that includes the nonlinearities of the motor.
Figure 5: Hardware-in-the-loop simulation setup of an AC motor drive driven by a diode converter
Figure 4: RT-LAB motor control prototyping used in DriveLab™ 4.3. Hardware-In-the-Loop Simulation Hardware-In-the-Loop or HILS differs from pure real-time simulation by the use of the “real” controller in the loop (motor drive controller, electronic control unit for automotive, FADEC for aerospace, etc); this controller is connected to the rest of the system that is simulated by input/outputs devices. So unlike RCP, in HILS, it is the plant that is simulated and the controller is real. Hardware-in-the-Loop simulation permits repetition and variation of tests on the actual or prototyped hardware without any risk for people or system. Tests can be performed under realistic and reproducible conditions. They can also be programmed and automatically executed. Several applications in the field of motor drive HIL simulation has taken place in various fields (robotics, industrial, automotive and others). The paper in [13] described the use of RT-LAB simulator of Permanent Magnet Synchronous Motor (PMSM) drive in industrial application (Figure 5), and reported the shortest realtime simulation time step (10 µs) for electric drives with this level of details in modeling the drive circuit, enabling to get very precise drive waveforms compared to actual measurements (Figure 6). The application reported in [14] describes the setup and the results of closed-loop control experiments using a permanent magnet synchronous motor (PMSM) drive emulated on RT-LAB FPGA card connected in a closed loop with a controller implemented on another RT-LAB target computer. The FPGAbased PMSM motor drive is implemented on eDRIVEsim simulator. The simulator implements 2 types of motor drive models: Park (d-q) motor model and another more accurate motor
Figure 6: Simulated PMSM drive currents in RT-LAB HIL setup, compared to real currents measured in the lab
5.
CONCLUSIONS
The paper presented the RT-LAB platform for real-time simulation of motor drives, power converters and power systems, and for real-time control of electric motors and mechatronic systems, and described state-of-the-art design methods and technologies used in this platform. Different types of applications in control prototyping and hardware-in-the-loop simulation were portrayed with reference to typical projects. What makes this real-time platform particularly advanced is its powerful hardware (parallel processing, multi-core processors, fast I/O devices, support of FPGA-based computation), and software (scalability, model-driven libraries targeting electric and power electronic systems, real-time interpolation of device switching, and other solver techniques), making it a very useful tool for research, testing and innovation. 6.
REFERENCES
[1] Larose C. ; Guerette S.; Guay F.; Nolet A.; Yamamoto T.; Enomoto H.; Kono Y.; Hasegawa Y.; Taoka H., “A fully digital real-time power system simulator based on PC-
ICMSAO’09-5
Proceedings of the Third International Conference on Modeling, Simulation and Applied Optimization Sharjah,U.A.E January 20-22 2009
[2]
[3] [4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
cluster”, ELECTRIMACS 2002 International Conference No7, Montréal , Canada, vol. 63, no 3-5 Louis-A. Dessaint, Kamal Al-Haddad, Hoang Le-Huy, Gilbert Sybille, and Patrice Brunelle, “A Power System Simulation Tool Based on Simulink”, IEEE Transactions on Industrial Electronics, Vol. 46, No. 6, December 1999 http://www.emtp.com Majumber R., Pal B.C., Dufour C., Korba P., “Design and Real-Time Implementation of Robust FACTS Controller for Damping Inter-Area Oscillation”, IEEE Transactions on Power Systems, Vol. 21, No. 2, pp. 809-816, May 2006. Dufour C., Bélanger J., "Real-time Simulation of a 48-Pulse GTO STATCOM Compensated Power System on a DualXeon PC using RT-LAB," Proceedings of the International Conference on Power Systems Transients (IPST 2005), Montréal, Canada, June 19-23, 2005. J.-N. Paquin J.-N., Moyen J., Dumur G., and Lapointe V., "Real-Time and Offline Simulation of a Detailed Wind Farm Model Connected to a Multi-Bus Network," Proceedings of the 2007 IEEE Electrical Power Conference, 8 pp. Ouhrouche M., Beguenane R., Tzynadlowski A.M., Thongam J.S., Dubé-Dallaire M., “A PC-Cluster-based Fully Digital Real-Time Simulation of a Field-Oriented Speed Controller for an Induction Motor”, International Journal of Modeling & Simulation, Vol. 26, Number 3, 2006 Xie Y., Seenumani G., Sun J., Liu Y., and Li Z., “A PCCluster Based Real-Time Simulator for All-Electric Ship Integrated Power Systems Analysis and Optimization”, Electric Ship Technologies Symposium, 2007. IEEE Volume , Issue , 21-23 May 2007 Page(s):396 - 401 Pak, L.-F., Faruque, M. O., Nie, X., and Dinavahi, V., “A Versatile Cluster-Based Real-Time Digital Simulator for Power Engineering Research”, IEEE Transactions on Power Systems, Vol. 21, No. 2, May 2006 Hun-ok Lim, Yusuke Sugahara and Atsuo Takanishi, “Development of a Biped Locomotor Applicable to Medical and Welfare Fields”, Proceedings of the 2003 IEEE/ASME International Conference on Advanced Intelligent Mechatronics (AIM 2003) Skjetne R., Smogeli Ø.N. and Fossen T.I., “A Nonlinear Ship Manoeuvering Model: Identification and adaptive control with experiments for a model ship”. Journal of Modeling, Identification and Control, 2004, Vol. 25, No. 1, 3–27 Chiasson, J., Tolbert, L., McKenzie, K., and Du, Z., “RealTime Computer Control of a Multilevel Converter using the Mathematical Theory of Resultants”, Proceedings of Electrimacs, 2002, Montreal, Canada. Harakawa M., Yamasaki H., Nagano, T., Abourida S., Christian Dufour C., Bélanger J., “Real-Time Simulation of a Complete PMSM Drive at 10 µs Time Step”, The 2005 International Power Electronics Conference Dufour C., Lapointe V., Bélanger J., and Abourida S., “Hardware-in-the-Loop Closed-Loop Experiments with an FPGA-based Permanent Magnet Synchronous Motor Drive System and a Rapidly Prototyped Controller”. The 2008 IEEE International Symposium on Industrial Electronics, Cambridge, UK, June 30, July 2, 2008.
ICMSAO’09-6