Switching function based inverter modeling for a grid-connected SOFC system in real time

This paper presents a switching function based modeling of a three-phase voltage source inverter along with hysteresis current control loop, which uses two-axis synchronously rotating reference frame for a grid-connected solid oxide fuel cell, SOFC system. In comparison to detailed inverter model, this inverter model gives the reduced simulation time while keeping the total harmonic distortion within limit as per the latest grid code and at the same time it maintains the required accuracy. All this is accomplished using MATLAB/SIMULINK environment. Further, a one stage ahead has been developed for the researchers by transforming this inverter model into real time model using OPAL-RT’s simulator with hardware-in-loop technology for its implementation in actual power system.


Introduction
In modern power system, the forms of power generation are renewable, non-polluting and efficient that are abundantly available [1,2]. Among these renewable sources, gas-fed solid oxide fuel cell (SOFC) technology is emerging very fast in the field of distribution generation in contrast to its competitor distribution generation system technologies due to its advantages like reliability and fuel flexibility [3][4][5]. In addition to this, it does not have any rotating part requiring less maintenance [6]. However, challenge arises due to its inherent characteristics, when it has to be connected to AC utility grid. Firstly, conversion of hydrogen into usable fuel during any step change makes it a slow responding device. Secondly, it produces electrical energy which is DC in nature [7].
While connecting it to the grid, it is vital to match the rate of power generation with the traditional power system's frequency through the voltage source converter, VSC in order to synchronize it with the system [8,9]. This VSC is the main interfacing system between the renewable source of power and the network, thus nowadays they find a large number of applications [10,11]. It helps in converting the DC power produced by the renewable energies to AC power. Therefore, VSC solves the above problems, but it produces harmonics depending upon the modulation strategy used. As per latest grid code, the electrical energy generated by any distributed generation system should produce minimum harmonics. It has been shown that the harmonics can be reduced by increasing the number of levels of the inverter i.e. two-level, three-level and multi-level, but at the cost of increased switching losses [12]. It has been shown that three-level inverter provides good results by making a compromise between the two [13].
At the same time, it is required to develop the model for accurate assessment of harmonics. In recent past lot of research has been done in the field of modelling of inverter [14][15][16][17][18][19]. Detailed modelling of inverter includes the modelling of IGBT, making it an accurate modelling technique for representing the harmonics. But, it uses small integration time step for accurate representation of fast  [20]. Thus, there is a need for some simplified model for representing the harmonics that should be equivalent to detailed model. A switching function based inverter model can be advantageous as it helps in reducing the simulation time and allows incorporation of total harmonic distortion (THD) of current signals appropriately [21].
Another issue related to inverter is its complicated dynamic control. Especially for a grid-connected system, its aim is to deliver controllable power with the set voltage for the network. The controlled output power generates a reference current for the current controller that makes sure that the output current tracks well the reference value of it. This current controller maintains the power quality of the inverters output and it is majorly responsible for the dynamics of the inverter in either of the modes [18]. This control is complex, as it has lot of variables, which have to be transformed accurately for grid synchronization during any load change. Broadly, there are three types of transformations i.e. stator reference frame, rotor reference frame and synchronously rotating reference frame. Generally, the selection of reference frame of inverter depends upon the machine or the system that is connected with it. Since, for a synchronous machine and the permanent magnet-based drive system, the reference frame of inverter is rotor reference frame, whereas, any reference frame of inverter can be chosen for induction machine based drive system as per the application [22,23].
Although the switching function based inverter model helps in reducing the simulation time still there is a need for adopting a realistic simulation study that can illustrate the inverter control system in real time. Since most of the work reported above has been accomplished using offline environment such as MATLAB/SIMULINK. In this environment, the total simulation time is composed of build time and elapsed simulation time. The former is the time taken by the solver to analyze the system and plan its strategy to solve the model correctly before the compilation. The later is the time taken by the simulating tool in actually solving the model [24,25]. For practical implementation of any developed control circuit, it is required that the elapsed simulation time must exactly match with real time clock.
Generally, it does not match in offline environment though a number of amendments for the mode of simulations such as normal, accelerator and rapid accelerator have been done to match the elapsed simulation time and real time clock. But the required results cannot be obtained. This matching can be provided by the online environment using real time simulation since it gives the ease of demonstrating the system with real time conditions and easy implementation onto the actual power system [26,27]. Real time simulators such as OPAL-RT and dSPACE provide features for analyzing the power system as per real time scenarios [28][29][30][31]. Among these, OPAL-RT's real time simulator is a platform that provides the validation of the work as per real conditions in the most secured manner, as it uses a software RT-LAB which is user-friendly. In addition, it ensures the accurate solutions of the work through monitoring tool during real time execution. Therefore, in this work, a switching-function based model for a three-level voltage source inverter has been implemented on a grid-tied slow responding SOFC based stationary power system. The purpose of this model is accurate assessment of harmonics of this power system. This is accomplished using synchronously rotating reference frame theory in MATLAB/SIMULINK environment. The comparison responses of this simplified model with detailed model show that it has nearly approximated the detailed model from harmonics point of view. Then, these models have been simulated in all the modes of offline environment i.e. normal, accelerator and rapid accelerator. At last, these two models have been developed, simulated and compared in online environment. Comparison justifies that why online environment is preferred in contrast to offline environment?

System Details
The system under investigation consists of a grid-connected SOFC system as shown with the help of a block diagram in figure 1. In this figure, a DC power-generating source, SOFC is connected with the link capacitor, C to an inverter. The inverter circuit is a three-level configuration which further connects to the AC utility grid. In this figure, a series reactor, between the converter and the grid is controlling the active and reactive powers. It is also limiting the short-circuit currents [32]. Single-line diagram of a grid-connected SOFC system

SOFC
The SOFC is an electro-chemical based power source that generates DC voltage, as given in (1), where, is a reaction-free voltage, R is the gas constant, T is an operating temperature, F is Faraday's constant and and are the effective partial pressures of , and gas [33]. The value of all these parameters that are utilized during simulation are given in table 1 [34,35]. The discussion of this fuel cell is beyond the scope of this paper, for further studies the reader is advised to refer [36][37][38].

DC-link Capacitor
This link capacitor, C assists in balancing the power difference between the DC power source and VSC. It also provides a path of low impedance for the turned-off current and it acts as an energy storage device as well [39]. Further it reduces the ripple on the DC voltage, [32].

Inverter and its control
The output of the SOFC is DC-type and has to be converted to AC in order to provide sustainability to SOFC through a grid connection. Thus, the system is connected to the AC utility grid through a switching function based three-level VSC as shown in figure 2.

Figure 2. Three-level configuration of VSC
This three-level configuration of the inverter is controlling its output voltages , and by the switching functions [13] as given in (2).
The corresponding average value of the output voltages , and are expressed in where, p = a, b, c is the phase. The output line currents, , and are given in (4)   (4) where, X= . The input DC current, is a dependent variable which is expressed in (5) To generate these switching functions, a control is required for the inverter. Therefore, a hysteresis current control loop is utilized as an inverter control as shown in figure 3. In this figure, when input active demand power, is applied to the system, the control processes the change in power, as given in (6), (6) Whenever, the corresponding SOFC power, does not match then, the change in power, is processed so that the inverter waits for the SOFC's response. It is necessary to balance the response time of inverter and SOFC because the time-constant of inverter is very low, making it a very fast responding component for any load change [40].
The inverter control regulates the change in power, into a reference current signal, as depicted in figure 3. The reference current signals for the three phases are generated from using parks transformation by utilising the angle, which is essential for transformation from 'dq0' to 'abc'. The reference frame of inverter selected here is 'synchronously rotating reference frame' as the inverter is connected to the AC utility grid [41]. The grid is working at angular frequency, = 2πf where f is the rated frequency of the system. Therefore, the angular frequency, is being fed to the park's transformation block. Thereafter, the reference current signal, is compared with the measured values of grid currents, and the error, Δi is being controlled with the help of hysteresis current control loop to get the required gate signals, g for the inverter to operate. The switching gate signals for inverter are generated [22] as per the switching functions, given in (7), where, n = 1, 2, 3, 4, 5, 6 is the number of switch, and and are measured and reference currents, and hb is the hysteresis band. Similarly, the switching function for other phases can be obtained.

Real time simulations
To validate the performance of switching function-based inverter, OPAL-RT's real time simulator, OP4510 is utilized. It has Intel processors, FPGAs [42,43] and it utilizes RT-LAB software for model preparation. It performs the execution in hardware-in-loop (HIL) that involves basic six steps i.e. model preparation, compilation, building, loading, execution and monitoring. In RT-LAB the power system models are prepared in real time operating mode in the following way: Once the model is successfully edited for real time execution, the hardware connections are done as shown in figure 4. In this figure, the experimental set-up of the system execution in real time is shown, where RT-LAB is present in the host computer, which is connected to the OPAL-RT's real time simulator through Ethernet cable. With this, the complete grid-connected SOFC system is build on to the simulator. The model is solved by the simulator based on state-space nodal, SSN analysis that helps in reducing the computation burden of simulation. It is a powerful approach for modeling PECs [20]. Thereafter

Results and Discussion
The work represents a switching function-based inverter modeling, which is simulated for a 100 KW grid-connected SOFC system. The simulation time is 1 second and a comparison has been made with the detailed model based on power quality. The discussion elaborates for the model comparisons on the basis of computation time analysis in two environments i.e. offline and online. The former environment simulates the model with ode23tb simulink solver and time-step of 10e−5 sec in MATLAB 2015a. The later environment simulates the model with state space nodal (SSN) method and time-step of 10e−5 sec i.e. a sampling rate of 0.1MHz over one period using OPAL-RT's real time simulator.

Offline environment
In this environment, both the models are simulated to investigate their performance in terms of the inverter control system. The simulation parameters are given in table 2. When the system is simulated the SOFC output voltage and current produced by the models are depicted in figure 5. It can be seen from the figure 5 (a) and (c) that with the increase in reference power at 0.4 second, the SOFC voltage, has been reduced slightly whereas the current, has IOP Publishing doi:10.1088/1757-899X/1033/1/012023 7 been increased significantly. The reason for this decrease in voltage can be understood by referring (1). As per this, with the increase in power, the current will increase, which results into increase in ohmic loss. This will ultimately leads to the reduction in voltage, .  In other words during steady-state, the total power is being generated by SOFC, whereas the grid power is zero. And, during transient period the power balance is being maintained by SOFC and grid simultaneously. It is also to be noted that SOFC power, is the product of SOFC voltage,

Figure 7. The reference current signals for the detailed and switching function model of inverters in a grid-connected system
It can be observed from figure 7, that the reference current on direct-axis, which is obtained from the comparator and integral control, is also increasing at 0.4 second. Whereas, quadrature-axis current, is zero for keeping unity power factor at grid and zero sequence current, is kept zero as the system is assumed to be balanced. Therefore, are zero. Hence, it can be observed from the figures 5, 6 and 7 that there is no effect of the inverter modeling used on the input variables and control dynamics of the inverter. for phase 'a' in a detailed model Figures 8 and 9 illustrate the waveform responses of the voltage on inverter-side, and switching functions, and for phase 'a' using detailed and switching function-based modeling. It can be observed from figure 8 (a), that the for phase 'a' has been obtained by multiplying switching functions, and with as per (2). This is nearly same as that of the voltage on inverter-side, of phase 'a' obtained using true or detailed model. This effectiveness of the proposed inverter model can be observed by comparing the average values (sinusoidal) of from the zoomed views of the two models (refer figure 8 (zoom-1) and figure  9(zoom-2)). These average values of the two models are nearly same. Similar pattern will be there for the other two phases, but all the phases are 120˚ apart. It is also to be noted that a small change introduced due to step change in the input SOFC voltage, is being handled properly by this proposed model. The THD of ph ' ' n th line current, is performed for 1 cycle from 0.95 second to 0.965 second using MATLAB/SIMULINK as shown in figure 11. It is observed that the THD is less than 5% with both the models as per latest grid code.
Further, in offline environment three modes of simulations have been considered, i.e. normal, accelerator, and rapid accelerator for evaluating the computation time of the proposed model as shown in figure 12. As discussed in section 3, the total simulation time is composed of build and elapsed simulation times. In this figure, it is observed that the offline environment does not involve the build time for pre-computing the model during normal mode of simulation in either of the models. As a result, this elapse the largest amount of time during simulations. Since, higher the build time, lower is the elapsed simulation time or visa-versa. Similarly, it is observed for any other mode of simulation that with the rise in build time, the simulation time falls.

Online environment
In this environment, the models become compatible for the actual implementation. Although, the switching function based inverter modeling is effective in comparison to detailed modeling in offline studies, its accuracy in real time is vital. Here the complexities like frequency fluctuations and other electrical phenomena's have been avoided to focus on the computation time analysis of the proposed model. This analysis gives the difference in the two environments under consideration. It solves the models only in one mode of simulation i.e. online using real time simulator and RT-LAB. As discussed in section 3, this mode utilizes the fast computing processors such as FPGA-based real time simulator and solves the models using SSN approach. It is seen that the correctness of simulation is achieved with the help of online simulation only as shown in figure 13. In this figure, it is observed that the online environment has build time for pre-computing the models. As a result, this reduces the elapsed simulation time and matches the desired simulation time of one second for both the models.  It is noteworthy that the offline environment for any mode of simulation consumes more elapsed simulation time (50.19, 27.10, and 23.33) seconds for detailed model in comparison to the time (48.13, 15.72, and 15.35) seconds consumed by switching function model. While the online mode during real time execution takes exactly one second that is same as expected elapsed simulation time.

Conclusions
In this paper, a switching function based model of inverter has been implemented on a grid connected SOFC power system in all the modes of offline environment i.e. normal, accelerator and rapid accelerator as well as in online mode using synchronously rotating reference frame. The comparison of these two inverter models results into following useful conclusions:  The proposed inverter model nearly approximates the detailed inverter model in terms of power quality i.e. total harmonic distortion, which is one of the major concerns as per latest grid code. At the same time, input variables and control dynamics of inverter with both the inverter models are same.  From offline simulations in all the modes, it is found that the elapsed time is not matching with real time clock/expected elapsed time, showing the inferior performance of this environment. In contrast to this, these two timings are matching in online environment, showing the superior performance of this environment. Therefore, less effort is required to practically implement this developed model using online environment in comparison to offline environment.  Critical observation of the two inverter models in online environment reveals that for such a small simulation time of the order of one second considered in this paper, build time is less using switched function based model in comparison to detailed inverter model. Therefore, it can be concluded that computation burden has been appreciably reduced using proposed inverter model. And, this burden will keep on increasing with the increased simulation time, strengthening the need for using this model which is essential for complete dynamic behavior of such a slow responding device based distribution generating power system.