Elektrotehniški vestnik 87(1-2): 23-30, 2020 Original scientific paper Selection of an appropriate interface algorithm for coupling two real-time simulators Janja Dolenc, Ambrož Božiček, Leopold Herman, Boštjan Blažič Univerza v Ljubljani, Fakulteta za elektrotehniko, Tržaška 25, 1000 Ljubljana, Slovenija E-pošta: janja. dolenc@fe. uni-lj. si, ambroz. bozicek@fe. uni-lj. si, leopold. herman@fe. uni-lj.si, bostjan. blazic@fe. uni-lj.si Abstract. Connection of two digital real-time simulators introduces some delay that is not present in a real network. This delay has to be accounted for by using an interface algorithm. The paper presents two interface algorithms for real-time digital simulations and proposes a method for the selection of the most appropriate one for a specific case. The first algorithm is the Ideal Transformer Model (ITM) algorithm which is a straightforward method that does not affect the system impedance characteristic. However, using certain ratio of the network and load impedance may to some extent result in an unstable operation of the coupled simulators system. In order to cope with this deficiency, the Transmission Line Model (TLM) algorithm is used as the second algorithm. In this way, the system stability is achieved. Compared to the ITM algorithm, the TLM algorithm accuracy is lower meaning that the interface algorithm should be selected depending on the system configuration. A method for choosing the most viable algorithm is proposed and cases of using the two algorithms are presented. Key words: real-time simulation, interface algorithm, HIL simulations, stability, accuracy Algoritma ITM in TLM za povezovanje dveh simulatorjev v realnem času Pri povezovanju dveh simulatorjev v realnem času se pojavi časovni zamik, ki v realnem sistemu ni prisoten. Za pravilno delovanje obravnavanega sistema je tako treba uporabiti povezovalni algoritem, znotraj katerega zajamemo omenjeni časovni zamik. V članku sta obravnavana dva povezovalna algoritma, predlagana pa je tudi metoda izbire najprimernejšega algoritma na praktičnem primeru. Prvi obravnavani algoritem je algoritem povezave z modelom idealnega transformatorja (ITM). ITM je najpreprostejši način povezave in ne vpliva na impedančno karakteristiko sistema. Kljub temu pa lahko določena sprememba impedance omrežja ali bremena povzroči nestabilnost sistema. Za reševanje težav s stabilnostjo zato uporabljamo drugi algoritem, in sicer algoritem povezave z nadzemnim vodom (TLM). Algoritem TLM je odpravil težave s stabilnostjo algoritma ITM, vendar se je izkazalo, da je bila točnost rezultatov slabša. Pomembno je, da izberemo najprimernejši algoritem glede na konfiguracijo posameznega obravnavanega sistema. V članku je predlagana metoda za izbiro najprimernejšega povezovalnega algoritma, poleg tega so v njem prikazani tudi primeri uporabe obeh obravnavanih algoritmov. 1 Introduction Real-time simulations are not new and are nowadays recognized as an effective method for testing hardware before conducting field tests [1], [2]. They provide a framework to test new control and protection concepts with the aim to detect, analyse and correct any potential problems [2]. Real-time simulations provide the calculation of the system so fast, that the output variables represent the real-time response of the actual system. This allows the exchange of signals with external hardware devices and, consequently, the use of the Hardware-in-the-Loop (HIL) simulations in various manufacturing processes of many industries, such as testing new components in a distribution power system, wind energy, relays, power electronics and drives, automotive, aerospace, etc. [3], [4], [5], [6], [7], [8], [9], [10], [11], [12] and also education [13]. The most prominent advantage of the HIL simulation is a timesaving, affordable and particularly safer and non-destructive testing of devices in power systems [14]. The HIL simulations are widely used, however, achieving a stable and accurate real-time simulation involves overcoming several challenges of hardware, software, modelling and numerical solvers [3]. The main issue related to the power-electronic system simulation is synchronization of switching signals with the discrete, non-synchronous time-step of the real-time simulator [15]. All HIL simulations contain errors caused by the non-ideal interface. Over the years, there have been several interface algorithms presented in the literature [15], [16]. However, they all face some kind of problems with the stability and accuracy of the HIL simulation. Moreover, except for the experimental results, neither work has provided an analytical explanation to the different behaviours of the interface algorithms [15]. Prejet 26November 2019 Odobren 6 January 2020 24 DOLENC, BOŽIČEK, HERMAN, BLAŽIČ There are two different methods for the HIL simulation accuracy evaluation proposed in the literature [17], [18]. However, they are both designed mainly on assumptions and are therefore irrelevant for complex systems. The mathematical model is designed as a nominal linear approximation of the real system. Normally, a complex system cannot be linearized while preserving all the characteristics. This is why both evaluation methods are showing good results for simple systems but are not yet appropriate for large, complex systems. To put it another way, only a limited research has been performed on the simulation accuracy issue and it remains an open research problem that needs better solutions [15]. Our work focuses on the stability and accuracy of the simulation when connecting two real-time simulators in the HIL simulation and therefore addresses the under-researched area. The paper analyses the stability and accuracy of two interface algorithms: the Ideal Transformer Model (ITM) algorithm and the Transmission Line Model (TLM) algorithm. Two simple examples are presented at the beginning, first a system with the implementation of an ITM algorithm and then a system with the implementation of a TLM algorithm. Finally, a slightly more complicated example of the system with a two-wire diode rectifier as a load is presented with the intent to define a method for choosing the most suitable interface algorithm. 2 Interface algorithms for the hil SIMULATION When connecting two real-time simulators in a HIL simulation, there are several factors that may affect the stability and accuracy of the simulation (time-delay, white noise, interface algorithm and others). As described in [16] and [19], for a system to be stable, the ratio of the source-output impedance to the load-input impedance must satisfy the Nyquist stability criterion [16], [19], [20]. Of course, a stable HIL system does not necessarily provide an accurate result [19]. The ITM and TLM interface algorithms are presented next. Both algorithms are implemented in the HIL simulation with two real-time (RT) simulators, i.e. RTDS [21] and Typhoon HIL. 2.1 The Ideal Transformer Model algorithm The Ideal Transformer Model (ITM) algorithm is one of the most simple and straightforward interface algorithms for the HIL simulation [19]. It can be performed in two ways, depending on the signal being exchanged between two simulators. In [19], ITM is categorized as a voltage type or as a current type circuit. Figure 1 presents a voltage type the ITM algorithm, used in the research of the stability and accuracy in this paper. The exchange of the signals between simulators goes as follows. First, the voltage signal (Vitm) is generated on RT simulator 1 (S1) and is measured behind the systems impedance. The generated voltage signal is sent to simulator 2 (S2). The voltage signal is received at the voltage-controlled voltage source on simulator 2. Finally, the load current (Iitm) is measured and is sent back to simulator 1. FEEDBACK INFORMATION OF CURRENT SIGNAL INFORMATION OF VOLTAGE SIGNAL Figure 1. Ideal Transformer Model Interface scheme for the HIL simulation. It is important to note that when using the ITM interface algorithm, the only error in a HIL simulation is the lumped time delay between the simulators. With that in mind, the equivalent transfer function of the ITM algorithm can be written and the stability criterion can be determined. The stability of the ITM algorithm depends on the ratio of the system and load impedances ^<1, (1) Zb where Zom and Zb are the equivalent impedances in the HIL simulation and the simulated network, respectively [19]. When the above ratio is less than 1, the system is considered stable. However, when the ratio is greater than one, the network is weak compared to the load and the system is unstable. 2.2 The Transmission Line Model algorithm The TLM algorithm takes the advantage of the equivalence of a linking inductor or capacitor to the transmission line equivalent. A transmission line is modelled with the Bergeron line model with the use of the Norton or Thevenin equivalent circuits (voltage-controlled voltage source and resistor R1k in Figure 2). At each simulator, there is an equivalent circuit that ensures that only one value (the last one) of the exchanged signal can be seen. This method is commonly applied to connect simulators for real-time simulations with the purpose of decoupling large systems for the convenience of parallel computation [19]. The implementation of a TLM algorithm is shown in Figure 2. SELECTION OF AN APPROPRIATE INTERFACE ALGORITHM FOR COUPLING TWO REAL-TIME SIMULATORS 25 JJ Ih Ub U„m@ Lb Lb Active filter <>Rb = =Cb f Lb Lb Active filter Figure 7. Frequency impedance characteristic of the load (three parallel RLC circuits on the load side) and the system side using the ITM interface algorithm (Matlab Simulink). Figure 7 shows the system and load impedance characteristics. In this case we get only one intersection point at the frequency of 91 Hz where the phase difference at that point is 176.72°. In other words, the operation state at the intersection is potentially unstable. The simulation on the RT simulators is implemented in a way that every five seconds the frequency value increases by 10 Hz, starting with 50 Hz. The system becomes unstable at the moment the frequency reaches the value of 91 Hz. Capturing the impedance characteristic of the system during its transitions to an unstable state is very complicated. However, the transition from a stable to an unstable state can be shown with voltage and current diagrams. When a system moves to an unstable state, the voltage and current increase greatly. Active filter Figure 8. Voltage and current of the system using the ITM interface algorithm with three parallel RLC circuits on the load side during the systems transition to an unstable state. r Figure 6. Topology of the second example for the HIL simulation using three parallel RLC load circuits. 3.2 Example 2: System using the Transmission Line Model interface algorithm In the second example, simulations are performed using the TLM interface algorithm in order to solve the ITM stability problem. Rom = 0.376 a Lom = 0.01198 H Rnrn L U C SELECTION OF AN APPROPRIATE INTERFACE ALGORITHM FOR COUPLING TWO REAL-TIME SIMULATORS 27 The tested systems are the same as in Example 1 (Figures 3 and 6). That is to say, that the intersection points and stability conditions at those points are the same and there is no need to analyse them again. 3.2.1 System with an LC filter as a load The first considered scenario is the system with an LC circuit as a load. As a coupling element, the reactor of the LC load is used and is replaced with a resistor and an ideal voltage source at each simulator. The system stability and simulation accuracy are observed. The load impedance characteristic with the (ZTLM) and without the (Zbrez) TLM algorithm are shown in Figure 9. Figure 9. Impedance characteristic of the load side (RLC load) of the system using the TLM interface algorithm compared to the impedance characteristic of the load (Matlab Simulink). 33.27 27.92 F -i-o 22.57 —- u 17.23 i ro 11.88 Q. h 6.53 1.18 — lJ Figure 11. Impedance characteristic of the load side (three parallel RLC circuits on the load side) of the system using the TLM interface algorithm compared to the impedance characteristic of the load (Matlab Simulink). Figure 11 presents the impedance characteristic of a load captured in Simulink. After the Simulink results are obtained, we wanted to achieve equality of the results on the RT simulators. Simulations made with the RT simulators are stable and the results are accurate (Figure 12). Their accuracy is evaluated by comparing the impedance values obtained at different frequencies with the RT simulation and the one performed in Simulink. The stability problems of the ITM algorithm are solved by using the TLM algorithm. 156.66 185 213.33 241.66 270 Frequency/Hz Figure 10. Impedance characteristic of the load side (RLC load) of the system (impedance of load, modelled on Typhoon HIL and observed from RTDS) using the TLM interface algorithm (RTDS). Figure 10 presents the load-impedance characteristic obtained from RTDS. The impedance values at each frequency are the same as the ones in Simulink. The TLM algorithm ensures a stable operation with accurate results. Frequency scanning on the RT simulator is a challenging task due to large differences in the current amplitudes in the vicinity of the resonant point compared to the normal operating state (50 Hz). This is the reason why the impedance characteristic (in Figures 10 and 12) is covered in a smaller range of frequencies. 3.2.2 System with three parallel LC filters as a load The ITM algorithm causes the system instability when there are three parallel LC filters as a load. That is why we use the TLM algorithm instead of the ITM one to eliminate the stability problems. Figure 12. Impedance characteristic of the load side (three parallel RLC circuits on the load side) of the system (load impedance modelled on Typhoon HIL and observed from RTDS) using the TLM interface algorithm (RTDS). 3.3 Method for selecting the most suitable algorithm On the basis of Examples 1 and 2, a method for choosing the most suitable algorithm is proposed. The process of choosing an algorithm needs to be performed individually for each system under consideration. The proposed method includes four steps: 1. determination of the network and load impedance characteristic, 2. modification of the load impedance characteristic (the impact of the algorithm on the impedance state is checked), 3. verification of impedance stability state (searching for potentially unstable operating points), 4. choosing the algorithm. 28 DOLENC, BOŽIČEK, HERMAN, BLAŽIČ Figure 13 shows the use of the proposed method on a practical case with a simple system, i.e. network with a two-wire diode rectifier on the load side. 1 i ¿k='CCI,IVA —- ----- - ..... : I'D H ct.- 'in: Ol H' • Figure 14. Impedance characteristic of the load side and impedance characteristic of the system. Three cases are simulated: one with no interface algorithm, one with an ITM interface algorithm and one with a TLM interface algorithm. The voltages and currents are presented in Figures 15-17. Figure 13. Topology of the network with a two-wire diode rectifier on the load side (Uom = 1 p.u. (50 Hz), Sk = 100/75 MVA, Str = l MVA, SLC = 0,1 MVA, fLC = 145 Hz, C1 = 100 |F, C2 = 100 |F, R = 50 ft). Figure 14 shows the load and the system impedance characteristic. Two operational states are presented. In the first state, the short-circuit power of the system is 100 MVA and a normal operation state is simulated. At the time of 0.2 s, the load is connected to the grid. Later on, at the time of 0.4 s, a transmission line outage is simulated, the grid power decrease from 100 MVA to 75 MVA. Prior to the simulation, the intersection points are checked to detect any potentially unstable point. As seen from Figure 14, there are two intersection points in both cases. When the grid power is 100 MVA, there is one potentially unstable operating point at the frequency of 110 Hz (phase difference of 171.02°) and one stable operating point at the frequency of 279 Hz (phase difference of 1.58°). Similarly, when the grid power is 75 MVA, there is one potentially unstable operating point at the frequency of 103 Hz (phase difference of 172.09°) and one stable operating point at the frequency of 652 Hz (phase difference of 1.23°). Impedance Figure 15. Simulation comparison of the voltages at a load connected to the system (t=0.2 s) and at a transmission line outage at the system power decreased from 100 MVA to 75 MVA. Figure 16. Simulation comparison of the currents at a load connected to the system (t=0.2 s) and at a transmission line outage at the system power decreased from 100 MVA to 75 MVA. In the first simulated case, the load is connected to the system at the time of 0.2 s. Using the two interface algorithms provides a stable system operation as shown in Figures 15 and 16. In case of a state needing to be simulated, the ITM algorithm is chosen. This is the most straightforward case and its implementation is quite simple. In the second case, a transmission line outage at the time of 0.4 s is simulated. Using the ITM algorithm, the system voltage and current increase greatly and the system becomes unstable. Using the TLM algorithm, the system remains stable. To sum up, the TLM algorithm provides a stable system operation which is not the case with the ITM algorithm. The accuracy of each algorithm is shown in Figure 17. Figure 17. Simulation comparison of the currents at the load connected to the grid. D SELECTION OF AN APPROPRIATE INTERFACE ALGORITHM FOR COUPLING TWO REAL-TIME SIMULATORS 29 Comparing the inaccuracies of the two interface algorithms shown in Figure 17 reveals that the system using the ITM algorithm assures a higher accuracy than the system using the TLM algorithm, this being one more reason to choose the ITM algorithm whenever applicable. 4 Conclusion Two different interface algorithms between two RT simulators are used in a test-case. The modelled network consists of a simple network with an LC filter as the load. The system with the two different interface algorithms is first modelled in Matlab Simulink and then with two real-time simulators. The network part of the system is modelled on an RTDS simulator and the load side is modelled on a Typhoon HIL simulator. In the first step, the stability conditions and the impact of the interface algorithm on the network and load impedance characteristic are analysed. In the second step, the system stability and the result accuracy are determined. In the third step, the method for choosing the most suitable algorithm is implemented on a system with a two-wire diode rectifier as the load. Based on the simulation results, the ITM interface algorithm is chosen to be used whenever applicable. It is most straightforward and simple to implement though it hardly satisfies the system stability condition. Namely, when a network is rather more complex, its stable operation can quickly turn into an unstable operation, meaning that for such network the TLM interface algorithm should be used rather than the ITM algorithm. Though the TLM accuracy is lower, it is highly stable. None of the two algorithms is absolutely accurate, meaning that their inaccuracy should be duly taken into account whenever their simulation results are evaluated. The efficiency of the ITM algorithm can be further improved by changing the impedance characteristic by using additional filters thus shifting the unstable operating points in the frequency range with no impact on the simulation stability. Being further optimized and improved, the TLM algorithm can be efficiently used in power system studies. References [1] S. Lentijo in A. Monti, „Comparing the Dynamic Perofmrances of Power Hardware-in-the-Loop Interfaces," IEEE Transactions on industrial electronics, Izv. 57, 2010. [2] V. Dinavahi, R. Iravani in R. Bonert, „Design of a real -time digital simulator for a D-STATCOM system," IEEE Transactions on Industrial Electronics, pp. 1001-1008, 04 October 2004. [3] R. Venugopal, W. Wang in J. Bleanger, „Advances in real-time simulation for power distribution systems," v 2011 International Conference on Energy, Automation and Signal, Bhubaneswar, Odisha, India, 2011. [4] H. Li, M. Steurer, K. L. Shi, S. Woodruff in D. Zhang, „Development of a Unified Design, Test, and Research Platform for Wind Energy Systems Based on Hardware-in-the-Loop real-Time Simulation," IEEE Transactions on Industrial Electronics, pp. 1144-1151, 07 August 2006. [5] M. S. Almas, R. Leelaruji in L. Vanfretti, „Over-current relay model implementation for real time simulation & Hardware-in-the-Loop (HIL) validation," v IECON 201238th Annual Conference on IEEE Industrial Electronics Society, Montreal, QC, Canada, 2012. [6] G. Parma in V. Dinavahi, „Real-Time Sigital Hardware Simulation of Power Electronics and Drives," v 2007 IEEE Power Engineering Society General Meeting, Tampa, FL, USA, 2007. [7] C. Graf, J. Maas, T. Schulte in J. Weise-Emden, „Realtime HIL-simulation of power electronics," v 2008 34th Annual Conference of IEEE Industrial Electronics, Orlando, FL, USA, 2009. [8] S. Abourida, J. Belanger in C. Dufour, „Real-time HIL simulation of a complete PMSM drive at 10us time step," v 2005 European Conference on Power Electronics and Applications, Dresden, Germany, 2005. [9] W. Li, G. Joos in J. Belanger, „Real-Time Simulation of a Wind Turbine Generator Coupled With a Battery Supercapacitor Energy Storage System," IEEE Transactions on Industrial Electronics, pp. 1137-1145, 01 December 2009. [10] X. Wu, H. Figueroa in A. Monti, „Testing of digital controllers using real-time hardware in the loop simulation," v 2004 IEEE 35th Anuual Power Electronics Specialists Conference, Aachen, Germany, 2004. [11] R. McNeal in M. Belkhayat, „Standard tools for hardware-in-the-loop (HIL) modeling and simulation," v IEEE Electric Ship Technologies Symposium, Arlington, VA, USA, 2007. [12] A. Viehweider, G. Lauss in L. Felix, „Stabilization of Power Hardware-in-the-Loop simulations of electric energy systems," Simulation Modelling Practice and Theory 19, 2011. [13] P. M. Menghal in A. Jaya Laxmi, „Real time simulation: A novel approach in engineering education," v 2011 3rd International Conference on Electronics Computer Technology, Kanyakumari, India, 2011. [14] J. Dolenc, „Analysis of simulations stability and accuracy when connecting real-time simulators," Ljubljana, 2018. [15] W. Ren, M. Sloderbeck, M. Steurer, V. Dinavahi, T. Noda, S. Filizadeh, A. R. Chevrefils, M. Matar, R. Iravani, C. Dofour, J. Belanger, M. O. Faruque, K. Strunz in J. A. Martinez, „Interfacing Issues in Real-Time Digital Simulators," IEEE Transactions on Power Delivery, pp. 1221-1230, 11 November 2010. [16] J. Sun, „Impedance-Based Stability Criterion for Grid-Connected Inverters," IEEE Transactions on power electronics, Izv. 26, 2011. [17] W. Ren, Accuracy Evaluation of Power Hardware-in-the-Loop (PHIL) Simulation, Florida: Florida State University Libraries, 2007. [18] M. MacDiarmid in M. Bacic, „Quantifying the Accuracy of Hardware-in-the-Loop Simulations," v 2007 American Control Conference, New York, USA, 2007. 30 DOLENC, BOŽIČEK, HERMAN, BLAŽIČ [19] W. Ren, M. Steurer in T. L. Baldwin, „Improve the Stability and the Accuracy of Power Hardware-in-the-Loop Simulation by Selecting Appropriate Interface Algorithms," IEEE Transactions on industry applications, Izv. 44, 2008. [20] R. Turner, S. Walton in R. Duke, „A Case Study on the Application of the Nyquist Stability Criterion as Applied to Interconnected Loads and Sources on Grids," IEEE Transactions on industrial electornics, Izv. 60, 2013. [21] R. Kuffel, J. Giesbrecht, T. Maguire, R. P. Wierckx in P. McLaren, „RTDS - A Fully Digital Power System Simulator Operating in Real Time," v ICDS'95 - First International Conference on Digital Power System Simulators, Texas, USA, 2002. Janja Dolenc received her B.Sc. and M.Sc. degrees in electrical engineering from the University of Ljubljana, Slovenia, in 2015 and 2018, respectively. She is a Ph.D. student and has been working as a researcher at the Faculty of Electrical Engineering in Ljubljana since 2018. Her research interests include power quality and real-time simulations. Ambrož Božiček received his B.Sc. and Ph.D. degrees in electrical engineering from the University of Ljubljana, Ljubljana, Slovenia, in 2006 and 2011, respectively. While 2018, he was a Teaching Assistant with the Faculty of Electrical Engineering, University of Ljubljana. Currently, he is working at HESS. His research interests include power quality, compensation devices, control of power converters, and real-time digital simulations. Leopold Herman received his B.Sc. and Ph.D. degrees in electrical engineering from the University of Ljubljana, Slovenia, in 2008 and 2014, respectively. Currently, he is a researcher at the Faculty of Electrical Engineering, University of Ljubljana. His research interests include power quality, power system simulations, distributed generation and smart grid technologies. Boštjan Blažič received his B.Sc., M.Sc. and Ph.D. degrees in electrical engineering from the University of Ljubljana, Slovenia, in 2000, 2003 and 2005, respectively. From 2000 to 2006 he worked as a researcher at the Faculty of Electrical Engineering in Ljubljana where he has been working as Teaching Assistant since 2007. His research interests include power quality and mathematical analysis and control of power converters.