Efficient Real-Time Controller Design Test Bench for Power Converter Applications

In order to evaluate and validate the latest trends of power-hardware-in-loop (PHIL) test setup, the dc-dc buck converter is modelled within a real-time system where the simulation model of the converter is exported to FPGA NI PXIe with a time step of 250 ns. PHIL setup allows high flexibility, the benefit of graphical programming, and advanced investigation of the control system for a converter without any safety concern and with the possibility of testing against situations that rarely occur in the field. The LabVIEW-FPGA has been used as a prototyping environment for a digital controller with the help of OPAL-RT eHS software and NI hardware. Such collaboration enables other software such as MATLAB/Simulink, Multisim, PLECS, PSIM, and LabVIEW Co-simulation for accelerating innovative research and development. This research work presents a more efficient and effectual NI PXIE platform with at least ten times more FPGA capability. This paper highlights the hardware-software toolset’s performance and the proposed methodology by addressing regulation issues in dc-dc converters. For more satisfactory and reliable operation real-time simulation study of a dc-dc buck converter is evaluated at different parametric variations under the closed-loop PI controller. Finally, the executed model’s effectiveness for a closed loop buck converter with real DC loads is validated through the hardware-in-loop (HIL) laboratory setup.


I. INTRODUCTION
Traditionally offline simulation has been used extensively to investigate the performance of an electrical system because of its minimal effort and low cost. But, due to the computational resources and run time restrictions, the emulation precision and reliability suffer from various levels of model reductions [1]. So offline simulation does not replicate the real behavior of the electrical system.
HIL simulation is acknowledged as a commercial and competent industrial prototyping system for modeling power system controllers [2]. Digital real-time simulation (DRTS) The associate editor coordinating the review of this manuscript and approving it for publication was Meng Huang . of the electrical system is the replication of output (voltage/ currents), with the required precision, which symbolizes the response of the real system being modeled [3]. The technology of power electronics is developing complex and multi-disciplinary field of electrical engineering. The primary reason behind this is an advancement in power semiconductor devices. This development trend in power electronics makes new challenges to the conventional power system and power electronic engineers [4]. Power electronic engineers are progressively interested in the modeling control system for power electronics designs. A real-time simulation platform allows engineers to investigate their control strategies by importing the controller model into a real-time platform. PHIL simulations enable researchers to test plants under dangerous conditions, such as faults, that could otherwise damage expensive equipment [5]. Moreover, HIL investigation permits the model of a novel device to be examined under a broad scope of realistic conditions repeatedly, securely, and economically.
The main contribution of this paper is to present an FPGA-based HIL/RCP simulation where a simulated plant is connected to a physical controller, which can be implemented on a real-time emulator without the implementation of an actual hardware plant. Rapid Control Prototyping (RCP) emulator is utilized to employ plant controller model and connect to a physical framework via HIL. This RCP application gives numerous advantages that are quicker to implement, progressively adaptable, and simpler to debug [6]. The RCP includes hardware, software, and equipment essential to model and examine different HIL implementation controllers [7]. HIL/RCP provides complete access to system variations and gives adaptability in regenerating several test conditions by using the same hardware setup. The buck converter is simulated on the FPGA board using the electric-Hardware Solver eHS from OPAL-RT. The method used in eHS is based on a discrete-time switch model that consists of a constant conductance Gs in parallel with a current source [8]. To ensure reliability and examine the power electronic topology challenges with the high switching frequency, a sizable simulation step (nanoseconds) is mostly needed for Power electronics system real-time emulation [9]. These low time-steps are necessary to properly simulate transient and harmonic effects and minimize the latency between controller firing pulses and simulator currents fed back to the controller [10]. As compared to power systems, in which a 50 µs time-step is adequate for the emulation of electrical substation components, a precise and consistent power electronic system simulation with a PWM control approach must be under 1 µs [11]. FPGA-based emulation solves this problem by permitting very low time-steps to be reached [12]. Now-a-days, power converters and their control strategy are developing towards complexity in execution time because of high switching frequencies in the 10 − 200 kHz range [13]. Such frequencies need time-steps in Nanoseconds where Microcontroller and Microprocessor are not suitable in such conditions due to their less processing and execution time [14], [15]. FPGA-based emulation solves this problem by permitting very low time-steps to be reached. The true parallelism supported by FPGAs and its capability to achieve real-time emulation within nanosecond enables FPGAs as an emerging technology for real-time emulation of a complex power electronic topology [16]. So, FPGA is the most reliable and preferred computational engine for the digital hardware investigation of power electronics converter due to its high execution time [17].
Moreover, FPGA has gained a crucial role in the HIL emulation and rapid control prototyping of electrical systems and their controllers in industrial applications due to its high speed and true parallelism [18], [19]. Real-Time Laboratory established by Opal-RT is extensively used in HIL emulation for system integration, prototyping, and investigation [2]. RT-Lab has made it easy to implement the FPGA power converter model without writing any code such as HDL and VHDL [20]. Finally, RT co-simulation is made possible between MATLAB/Simulink and LabVIEW with the collaboration of OPAL-RT eHS software and NI hardware. It should also be noted that four-quadrant amplifiers are compulsory if a bidirectional flow of power is needed. An arrangement of power amplifiers, considering their working, is discussed in [21], so the four amplifiers are employed to test the power electronics system.
Besides research, increasing HIL simulation utilization has attracted considerable attention from academic scholars in different disciplines [22]. PHIL platform is used in modern academic research for several laboratory control tests. Real-time HIL emulation has been used several times for educational purposes in power electronic and machine drives [23]. It is compulsory for academic research that the theoretical assessment and designing of new control approaches must be validated with accurate measurements [18]. Power hardware in loop offers a platform to conduct high-quality research in the education and industrial control domain. Real-time HIL simulation testing has been acknowledged as an advanced approach for investigating and testing power electronic topologies [18]. HIL testing of high switching frequency power electronics converters using FPGA based platform is presented in [24]. Also, HIL has a historical background in aerospace industries, NASA, automobile industry, power systems, robotics, marine system, etc. [25].
DC-DC converters are power electronic devices implemented to adjust the voltage and current levels among the sources and loads while keeping a minimum power loss and high efficiency in the conversion process [26]. DC-DC converters exhibit non-linearity, time varying in nature, and are subject to fluctuating line voltages and ambiguous load changes. Due to these situations, the converter's overall efficiency declines significantly [27]. For reliable operation, regulation must be sustained regardless of variations in input voltage, output load, and load resistance [28]. PI controller is implemented to achieve robust output voltage despites of parametric variations. Ziegler Nichol's method is used for tuning of PI Controller gains. The PI-based controller has many advantages like fast control, favorable cost, and simplified structure with robust regulation [29]. The control is carried out by varying the duty ratio of an external fixed frequency through the PWM technique [30].
The Real-time simulation of modular multilevel converters for controller HIL testing is given in [31]. Where MMC is exported to the FPGA and system-level controllers of MMC are employed on a NI-cRIO. To enable communication between FPGA and NI-cRIO, an RTDS MMC simulator is used. The paper validates that FPGA is the best fit where high-throughput, low-latency, and high computational and parallel processing speed are required. In this paper, the converter model is exported to NI-PXIe, and the controller model is implemented on NI-cRIO. Also, the OPAL-RT simulator is used for the communication between LabVIEW FPGA and MATLAB/ Simulink. In [32], a novel approach to real-time modelling of the district heating grid station system using LabVIEW is presented. The heating substation real-time model is deployed on the NI sbRIO-9636 device, and the controller is implemented on the Schneider Electric controller. Communication between the host computer and RCP is accomplished via the LonTalk adapter for the Lon-Works communication protocol. However, our research work presents a more efficient and effectual NI PXIE platform with at least ten times more FPGA capability. It delivers high throughput, thus interpreting all mentioned complications presented in the paper [31], [32].

II. RESEARCH METHODOLOGY
In recent years, the advancement in integrated circuits technology such as microprocessors, microcontrollers, or FPGAs has allowed real-time digital emulation, such as RTDS or Opal-RT [33]. The HIL simulation system is known as a feasible arrangement for reducing computational burden [34]. RT-LAB and RTDS are FPGA-based mainframes that provide RCP environment to investigate the robustness of dc-dc converters on digital high-speed processor cores. The special and unique features of highly recognized hardware-software collaboration follow high throughput, affordable cost, ease of use, affirmed, off the shelf accessibility, and extensive use in other manufacturing and academic fields. The most popular real-time simulators are OPAL-RT, RTDS-Tech, Typhoon HIL, NI-PXIe and dSPACE [46]. All of them are used to perform power systems and power electronics simulations. A summary of the aforementioned RT simulators is presented in Table 1. considering OS compatibility and simulation software compatibility.
A. LABVIEW FPGA AND LABVIEW REAL-TIME Nowadays, National Instruments R (NI) LabVIEW TM has been recognized as the most professional integrated software/ Hardware platform [35]. In this paper, LabVIEW-RT is used for the development of NI Reconfigurable I/O PHIL Hardware targets for control algorithms without prior knowledge of hardware description language coding [36]. LabVIEW library includes programming environment, signal generation, digital signal processing (DSP), measurement, mathematical methods, instrument control, control systems, neural network, and fuzzy logic [37]. It implements multiple tasks instantaneously. In the same context, RT Unit permits scheming, prototyping, and deployment of Real-Time regulators. Using LabVIEW graphical programming, which is extremely user-friendly, it becomes easy for undergraduates and scientists to learn. LabVIEW FPGA unit with its graphical programming language and predefined library tools for fast prototyping of FPGA solutions [38]. LabVIEW graphical programming is perfect for any assessment or control context and the core of the NI framework stage. Synchronizing all the devices that experts and scholars want to accumulate for a wide variety of uses in drastically less time [39]. LabVIEW supports multithreading and multicore programming, which are suitable for real-time applications. On the other hand, LabVIEW FPGA offers adaptable and economical hardware implementation in the domain of ultra-high-speed control implementations with complex timing synchronization [40]. Besides, the FPGA circuit's addition to a DAQ platform affiliated with the NI LabVIEW allows access to achieve signal preprocessing and supports valuable capabilities like reconfigurability [41].

B. POWER HARDWARE-IN-LOOP
Finally, through the collaboration of software and hardware, we can investigate the real-time (RT) simulations of the closed-loop dc-dc converter under a parametric variation test. PHIL needs the accessibility of two hardware platforms where one is employed to analyze the converter electrical behavior of the plant and the other to permits control of software under test. This setup allows scholars to implement the controller without a real plant. In such a way, several errors can be avoided in the design process of software and hardware as well as their interconnections. The simulation model of the buck converter is deployed on PXIE using MATLAB/Simulink, and its controller is burnt on CRIO/MyRIO using the LabVIEW module, as shown in Fig. 1. The proportional-integral (P-I) controller is a closed-loop controller which are extremely used due to its fast control, favorable cost and simplified structure with robust regulation. The proportional-integral (PI) controller is the most extensive controller in industrial control applications [42]. The error signal in the PI controller is calculated by the difference between the actual value desired values. Fig. 2 shows a block diagram of prosed HIL setup under closed-loop PI controller. The PI controller has two gains K p and K i . These two gains can take any real value, and finding these values by different methods is collectively called PI tuning. Ziegler-Nichols presented two methods, where one technique is based on step response and another approach is based on a frequency response for the tuning of P, PI, and PID controllers [43]. Through Ziegler-Nichols method the load disturbances can be reduced very effectively [44]. This paper focuses on the technique of step response tuning for PI controllers VOLUME 9, 2021 Real time simulators are typically used in three different application categories such as RCP with physical plant, HIL and Software in-the-Loop (SIL) [45]. The controller is implemented in real time simulator and tested against physical plant in RCP application. The controller implemented using RCP application category is more flexible, faster to implement and easier to debug. However, performing controller tests against physical plant can be sometimes risky and dangerous. Therefore, early testing of controllers against simulated plants is performed in HIL setup to avoid any contingency. The proposed HIL setup enable researchers to design, control, and test power converters without the fear of component failure. As compared to RCP with physical plant, HIL setup allows researchers to directly validate the physical controller without the need of real power converter. This enables researchers for more repeatable results and extreme digital controller testing of power converters, that is otherwise not possible on real hardware. SIL is ideal platform for accelerated simulation, where both controller and converter run on the real-time simulator as shown in Fig. 3. In SIL, simulation runs faster than real-time, allowing for large number of tests to be performed in a short period. However, SIL approach has compromised accuracy as compared to HIL.

C. TRANSFER FUNCTION OF PI CONTROLLER
In PI controller, integral and proportional approaches are combined, where these approaches are used to eliminate the error in steady-state conditions without disturbing the system stability. The final mathematical form of the controller is expressed below.
The PI controller equation can be expressed as the following P = k p e p (t) + k i e p (t)dt (2) Here k p and k i are proportional integral constants. Using Laplace transformation on both sides, Here P(s) e(s) is representing the transfer function.
where T = Equation (7) represents the transfer function of the PI controller.
If the error is zero, the controller output is fixed at the value that the integral term had, when the error reduced to zero. This output is given by pt(0). If the error is not zero, the proportional term contributes a correction and the integral term begins to increase or decrease the accumulated value [initial pt(0)], depending on the sign of the error and its direct or reverse direction. The integral term cannot become negative; thus, it will saturate at zero, If the error and the action, try to drive the area to a net negative value. The transfer function is represented by Equation (5).
The integral action adjustment is the integral time T1 (=KI). For a step deviation 'e', the integral time or reset time is the time for proportional action. 'Reset rate' is defined as the number of times per minute that the proportional part of the response is duplicated. Reset Rate is therefore called 'repeats per minute 'and is the inverse of integral type.
During the design of the PI controller for the buck converter, a closed loop operation is performed. The open loop operation is insensitive to load and line disturbances. Therefore, the closed loop operation is selected. The closed loop control uses a feedback signal from the process, a desired value or set point (output voltage) and a control system that compares the two and derives an error signal. The error signal is then processed and used to control the converter to try to reduce the error. The error signal processing can be very complex because of delays in the system. The error signal is usually processed using a Proportional -Integral (PI) controller whose parameters can be adjusted to optimize the performance and stability of the system. Once a system is set up and is stable, very efficient and accurate control can be achieved. Input is the voltage error (reference voltage subtracted from the actual voltage) and output is the incremental duty ratio. The controller specifications of a converter are minimum steady state error and less settling time.

III. EXPERIMENTAL RESULTS AND DISCUSSION
To investigate and model the electrical system, it essential to design the plant in both analog and digital domains, but a conventional simulator does not offer such capability for both the domains because of such issues as the researchers face many complications. So, co-simulation has become scholars' attention, which provides a platform for evaluating the system in both analog and digital domains. It also offers interoperability and reusability of the prototype to improve the performance of the model. This research area implements the buck converter model using a co-simulation platform between MATLAB/Simulink and LabVIEW, two different simulation environments. The actual controller is exported to compact RIO (cRIO), and the converter model is deployed on the PXIe platform. Finally, through the OPAL-RT Electrical Hardware Solver software environment, the co-simulation is accomplished between the converter and controller model. Fig. 4 demonstrates the real-time digital controller implementation on cRIO.
To evaluate the robustness and adaptive performance of methodology, a case study is proposed to investigate the regulation of Buck converter by introducing the variations in modes of controller, input source voltage, output terminal voltage, and switching frequency under the PI controller. The values of a parameter used for examining the performance of buck converter are given in Table 2.
The effectiveness of the digital controller has been assessed at various values of PI controller modes in the buck converter.    The efficacy of the converter has been illustrated that how rapidly converter can go to steady state condition from transient state at different gain values. Converter becomes stable in 6 seconds at a proportional and integral gain of 0.008 and 0.005, respectively, as shown in Fig. 5(a). It should be noted that the best possible performance of the converter has been observed at the proportional gain of 0.046, where the system entered into the steady-state condition within 1.25 seconds,   as shown in Fig. 6(a). Besides, Fig. 7(a) represents a disturbance in the form of overshoot as the proportional gain is increased to 0.5. Similarly, Fig. 7(b) depicts the converter's entire disturbed behavior at a high proportional gain of 0.15. Hence, we can conclude that increasing the value of proportional gain beyond the limit can introduce overshoots in the system. Overshoot must be avoided in converter response to protect it from any physical damage.
Moreover, the behavior of the system has been investigated by introducing the fluctuation in reference voltage, input source voltage, and load resistance. Variation in reference voltage from 150 volts to 130 volts is introduced, which triggered the digital controller to alter the duty cycle from 0.78 to 0.67 for stabilizing the system within 0.3 seconds, as observed in Fig. 8. Again, the robustness of the digital controller is verified by varying the input source voltage from 200 volts to 180 volts, which triggered the digital controller to vary the duty cycle from 0.76 to 0.84 to stabilize the system in 0.7 seconds observed in Fig. 9. Finally, the load resistance has been varied from 12.5 to 25 . It has been observed that the system becomes stable within 0.4 seconds due to variation in load resistance, as shown in Fig. 10.   To build trust in proposed HIL simulation platform, a validation test is performed against a physical test setup. The actual controller is kept same as previous, however the simulated buck converter is replaced with actual (physical) circuit as shown in Fig. 11. In this setup, all the parameters are kept same as that of Table. 1. Digital output signal from the cRIO is forwarded to the Power MOSFET switch of the actual circuit and the output load voltage is fed back to the closed loop controller. The real-time behavior of buck converter is compared with the physical test setup at various switching frequencies as shown in Fig. 12 (a)-(b) to Fig. 13 (a)-(b). The output voltage ripples are investigated and examined at various switching frequencies for both HIL setup and physical setup. The graphs show that a reduction in output voltage  ripples can be noted with the rise of switching frequency. Therefore, using higher frequencies for the PWM signal, the ripple of the output voltage can be reduced up to the desired limit. The percentage ripples of output load voltage of buck converter at various switching frequencies are compared for HIL and physical setup in Table 3. It is noted that results of actual physical system on osilloscope and HIL testbench are very similar for different switching frequencies.
Fully Digital Simulation, also referred to as SIL is one of the category of real time simulators. Unlike physical setup, actual converter and control are converted into the simulated converter and simulated control respectively. Both the controller and the converter run on the PXIe simulator. The results of HIL setup are compared with the SIL setup, keeping all the parameters same as previous. In SIL setup, it is observed that converter becomes stable in 7 seconds at at a proportional and integral gain of 0.008 and 0.005, respectively, as shown in Fig. 5(b). There is slight difference of only 1 second in achieving steady state as compared to HIL setup as shown in Fig. 5 (a). Moreover, the behavior of the converter is improved at the proportional gain of 0.046, where the system entered into the steady-state condition within 1.5 seconds, as shown in Fig. 6(b). In this case, there is a slight difference of 0.25 seconds in attaining steady state as VOLUME 9, 2021   compared to HIL setup as shown in Fig. 6 (a). It is observed that results of both approaches HIL and SIL are similar.
In choppers, ripples' problem must be assessed while designing since it can cause the undesired deviations in the system, particularly in dc-dc converters used for supervising output voltage thoroughly. So, voltage regulator modules must have the voltage regulation within the desired limit.
Finally, the virtual resistive load is exchanged with real DC loads. The presented model's effectiveness is validated through the laboratory setup of the PHIL system, as shown in Fig. 13.

IV. CONCLUSION
This paper illustrates the implementation of a real-time FPGA-based HIL simulation test bench applied to closed loop buck converter under different parametric variations with Lab-VIEW FPGA and OPAL-RT collaboration. It has been highlighted that the proposed hardware solutions are ideally fit as they possess high control performance, favorable cost, reliability, and low power consumption. Employing the benefits of two distinct platforms through HIL RT simulation, proper tuning and debugging of the controller is achieved. The hardware mechanisms considered in this paper are PXIe, cRIO, 4-quadrant amplifier, and phase measurement unit from National Instruments for more accurate, effective, and well-regulated results. In the control approach theme, it has been revealed that FPGA-based regulator can be an effective choice for both the high challenging demands and the constrained switching frequency demands. Graphical programming languages are proven best for FPGA development due to their intrinsic sense of parallelism and compatibility that naturally maps to hardware design. For illustrating the efficacy and application of HIL real-time simulation, the complete system model has been designed in MATLAB/Simulink and LabVIEW, which are exported to PXIe and cRIO correspondingly. The results obtained verify the flexibility and the robustness of the proposed approach. Finally, the virtual resistive load is exchanged with actual DC loads, and the effectiveness of the proposed model is validated through the research laboratory setup of the PHIL system JAHANGEER BADAR received the B.E. degree in electronics engineering and the M.E. degree in electrical power systems from Mehran UET, Jamshoro, Sindh, Pakistan. Currently, he is pursuing the Ph.D. degree in electrical engineering with Sukkur IBA University, Pakistan. He is also currently an Assistant Professor and the Principle Investigator of the Power Hardware in Loop Laboratory, Electrical Department, Sukkur IBA University. His research interests include power quality analysis of power converters, PWM techniques to control power converters, PWM inverters, and real time simulation of power converters.
FAHEEM AKHTER (Member, IEEE) received the master's degree in electrical and electronics engineering, with entrepreneurship, from the University of Nottingham, U.K., in 2011, and the Ph.D. degree in energy systems from The University of Edinburgh, U.K. He joined Sukkur IBA University in February 2010, before that he worked as a Trainee Engineer at Universal Cables Industries Ltd. He has published paper in international Springer journal and also presented papers in international conferences. He has also been presenting and participated in international seminars. His research interest includes integration of offshore wind farms to onshore AC grid through VSC-HVDC technology. His research interests include the analysis and optimal design of next-generation electrical machines using smart materials, such as electromagnet, piezoelectric, and magnetic shape memory alloy.