Control strategies for seamless transfer between the grid-connected and islanded modes of a microgrid system

Design of control strategies for Distributed generation systems is very important to achieve smoother transition between the grid connected and islanding modes of operation. The transition between these two modes of operation should be seamless, without any severe transients during the changeover. In this paper, two different control strategies namely inverter output current control and indirect grid current control for the seamless transfer between the modes of operation has been explored for the suitability. The design and analysis of the cascaded control loops based on Proportional Integral (PI) controller has been dealt in detail for both inverter output current control and indirect grid current control strategy. Control parameters are designed using the control system toolbox in MATLAB. A 10kW grid connected microgrid system has been designed and simulated in MATLAB/Simulink and the results are presented under grid connected operation, islanding operation and the transition between the modes considering fault condition in the grid side. The simulation studies are carried out using both the control strategies and the results are presented to validate the design methodology.


INTRODUCTION
As the conventional energy resources are fast depleting and are of polluting nature, renewable energy resources are being harnessed in meeting the ever increasing demands [1]. Recently, Distributed Generators which are mainly based on the resources such as Wind, Solar PV, hydro, natural gas, biogas, fuel cells etc., has gained lot of interest due to the increase in demand for the reliable and quality power [2]. Distributed Energy Resources (DER) can either be coupled straightaway to the distribution network at the point of common coupling (PCC) or can be interconnected to form a Microgrid (MG) [3]. Power electronics play a major role in integrating the renewable energy sources (RES) into the utility grid [4][5][6]. A microgrid is a collection of energy sources which are of smaller capacity, energy storage schemes and a group of loads which are being operated at distribution voltage levels [7]. Generally microgrids are associated with the main grid at PCC and are operated as grid connected system. But under certain circumstances, microgrids can be moved to the islanded mode of operation either intentionally or unintentionally [8]. The interfacing inverter is to be controlled in such a manner that the microgrid works in asscociation with the main grid , independently as islanded case when needed , and also while moving from one mode to other mode seamlessly [9][10][11].
In the case of grid connected operation, the interfacing power electronic converter is being controlled so as to supply the main grid with the preset / stated power while the load voltage is being maintained by the utility [12]. Under islanded mode, control of the inverter is mainly focussed to provide critical/non-critical loads and it is coupled to the main grid via an inductor Lg called grid-side inductor. The static transfer switch Si, present in the inverter side is being actuated by the inverter side controller and the switch Sg present in the grid side is being actuated by the grid. Under normal working conditions of the utility, both the switches Si and Sg are in the closed position and hence the three-phase DG inverter is operated in the grid connected manner. In case of any faulty conditions or operations in the grid, the switch Sg is opened which makes the DG system islanded. Figure 1. Power stage of a three phase MG system After the islanding detection, the inverter side switch Si is also opened and DG enters in to standalone mode. Once the fault is cleared, the switch Sg is being closed. The DG side switch Si is closed to make the system to be operated in association with the utility only after the resynchronization process takes place.

Modelling of the power stage
The average mathematical model of a three phase inverter system is given by (1) and (2).
In synchronous reference frame modelling, the equations governing the system shown in   Where and are the duty cycles of three phase inverter system in synchronous reference frame, represents the resistance of filter inductor , and represents the currents through the inductor , and represents the load currents in 'd q' frames respectively and indicates the resistance of the grid side inductor . Figure 2 represents the block diagram of power stage modelling of MG system in Synchronous reference frame (SRF).

CONTROL STRATEGIES FOR THE SEAMLESS TRANSFER 3.1. Inverter output current based seamless transfer
The current fed to the grid can be regulated by controlling the inverter output current. The inductor current , and the capacitor voltage , are sensed and are transformed to dq components using Park's transformation. The basic structural diagram of the output current control scheme is shown in Figure 3. The control includes three loops viz., output current loop, inner voltage control loop, innermost inductor current loop and a phase locked loop (PLL) for phase detection. The output current controller is being realized with the help of a proportional-integral (PI) controller. The output of the current controller generates the reference values for the capacitor (load voltage) voltage loop i.e., vCrefd and vCrefq. A PI controller based inner voltage control loop regulates the capacitor voltage vCd and vCq to follow the reference voltages generated by the outer loop. The innermost current controller is mainly intended to maintain the required output current from the inverter which comprises of the current that is to be fed to the utility as well as the current required by the load. Hence the grid current is controlled with the help of inverter output current control. PLL used in the system is based on SRF to measure the utility frequency and phase angle, which mainly includes a PI controller and a magnitude limiter to maintain the frequency of the local load within the acceptable limits especially during islanding mode of operation.

Indirect current control based seamless transfer
The structural diagram of the indirect grid current control scheme is shown in Figure 4. Seamless transfer based on this control scheme involves grid current control by regulating the load voltage (capacitor voltage) when operating under grid connected mode. Control scheme comprises of three control loops viz., outer grid current control loop, inner capacitor voltage loop and the innermost filter inductor current loop. The outer grid current controller along with a limiter sets the reference voltage during the islanding condition. Under grid connected condition, the voltage is going to be within the limits. The inner capacitor voltage loop is a PI controller which generates the reference currents in d and q axis for the innermost filter inductor current loop. The inductor current loop is a PI controller which produces the reference signal in dq frame. The reference signal is transformed into 'abc' frame using dq-abc transformation and then given to PWM generator for generating the firing pulses for the inverter switches. When the main grid is working without any faults, the MG is treated as current source so as to feed in the required active and reactive power to the grid. The reference currents in d and q axis can be calculated based on the complex power that is to be fed to the grid. The grid current is controlled using a PI controller. The coupling introduced due to the grid side inductor Lg is being attenuated by decoupling in the current control loop. When any fault occurs in the grid side, the utility side switch, Sg opens and the MG is moving to islanding mode of operation. The inverter switch Si is still in the closed position as the MG has to confirm the occurrence of islanding. The switch Si opens, once the islanding is confirmed by the islanding detection method. The active and reactive power injected into the grid is given by (6) and (7).
In islanding mode of operation, the switches Si and Sg are open and PLL cannot track the grid phase angle. Under this condition, the MG is operated as a voltage source and therefore voltage fixed by the limiter acts as the reference voltage. PLL consists of a PI controller and a limiter, which is used to regulate the frequency within allowable limits.

ANALYSIS AND DESIGN OF CONTROL PARAMETERS OF OUTPUT CURRENT BASED SEAMLESS TRANSFER 4.1. Design of voltage magnitude limiter
The voltage limiter present in the Figure 3 and in Figure 4 is used to provide a stabilized voltage without any deviation when the system gets transferred from grid connected mode to islanded mode. As per the IEEE standard 1547_2018 [29], the voltage limiter in d and q axis can be represented by (8) and (9).
where, , and , represents the maximum and minimum values of the voltage magnitude in the d axis, is the nominal per phase grid voltage. When the MG transfers from grid connected mode to islanded mode, the voltage limiter in the q axis is to be designed based on (10) and (11), so that the load voltage is within the normal range.
where, , and , represents the maximum and minimum values of voltage in q axis.

Design of frequency / phase limiter
The frequency and phase of the grid voltage can be obtained with the synchronous reference frame based PLL, when the MG system is operating in grid connected mode. When the fault occurs in the grid side, the frequency and phase may get deviated. In order to limit the deviations beyond a level, a limiter is being introduced to restrict the frequency and phase deviations during islanding. The basic block diagram of SRF-PLL is shown in Figure 5.

Design of filter and control loops
The specification of the parameters used in the DG system considered is given in Table 1. The filter and the control loop parameters are designed based on the DG specifications.

Design of LCL filter
The output from the three phase inverter is filtered with the help of LCL filter [30] to suppress the harmonics introduced due to the presence of power electronic interface. The base impedance and the base capacitance are obtained based on the (12) and (13).
As the maximum power factor variation seen by the grid is 5%, the filter capacitance can be designed based on (14).
The maximum ripple allowable can be considered as 10% of the maximum rated current and the ripple is given by (15), where is given by (16).
The inverter side filter inductor, is given by (17) and the grid side inductor, is given by (18), where, represents dc link voltage, , the switching frequency of the inverter switches and r is the ratio between and and the value of r is to be considered based on the nominal grid impedance and the resonant frequency from the transfer function of the filter. The resonant frequency and the frequency constraint are given by (19) and (20). Figure 6 represents the basic structure of the innermost inductor current control loop. From the Figure 6, the open loop transfer function of current control loop is given by (21).

Design of innermost inductor current control loop
Where, the digital delay is considered to be of 1.5 times the switching period Ts, is the gain of the converter and is considered as 1 for simplicity. The controllers are designed in MATLAB using control system designer tool box. The bode diagram of the innermost inductor current loop with and without PI controller is shown in Figure 7, where G represents Transfer function without controller and LTF represents Loop transfer function with PI controller. The controller is designed to attain cut off frequency of around 1200 Hz and phase margin of 60 ⸰ . The 1 and 1 values of the PI controller are about 27.014 and 8371.

Design of inner capacitor voltage control loop
The basic structural diagram of capacitor voltage control loop is presented in Figure 8. From the Figure 8, the open loop transfer function of the voltage control loop is given by (22).
Where, the digital delay is considered to be of 1.5 times the switching period Ts and . ( ) is the closed loop transfer function of the innermost inductor current loop.

Design of outer current control loop
The block diagram of outer current controller is given in Figure 10.

ANALYSIS AND DESIGN OF CONTROL PARAMETERS OF INDIRECT CURRENT CONTROL BASED SEAMLESS TRANSFER 5.1. Design of innermost inductor current control loop
The block diagram of innermost inductor current loop is same as shown in Figure 6. The innermost inductor current loop is designed using control system designer tool box in MATLAB by considering a cut off frequency of 2000 Hz with a phase margin of around 41 ⸰ . The bode plot of the system with and without the PI controller is shown in Figure 12

Design of inner capacitor voltage control loop
The block diagram of inner capacitor voltage loop is same as that shown in Figure 8. The voltage loop is designed by considering a cut off frequency of 1000 Hz with a phase margin of around 21 ⸰ . The bode plot of the system with and without the PI controller is shown in Figure 13.

Design of external grid current control loop
The block diagram of external grid current control loop is illustrated in Figure 14. The grid current is controlled by considering the gain of the inner loops as unity as the bandwidth of the inner voltage control loop is high. Design of the grid current controller is carried out by considering the cut off frequency to be 150 Hz and a phase margin of around 28 ⸰ . The bode plot of the system with and without the PI controller is shown in Figure 15. The values of 3 and 3 are found to be 0.89949 and 2802.

RESULTS AND DISCUSSION
The simulation studies have been carried out in MATLAB Simulink for the system shown in Figure 1. The parameters considered for the simulation studies are shown in Table 1 and Table 2.

Simulation results of output current based seamless transfer
Initially, MG operates under grid connected mode by considering the grid is working normally without any faults. MG is supplying the local load as well as the grid until the grid connected switch (Sg) is in closed position. Once fault occurs, at 0.2s, the grid connected switch is opened. Then switch in the inverter side (Si) opens after detecting the islanding condition. At around 0.225 s, utility gets disconnected and the MG enters into islanding mode and feeds the local load within the specified voltage / frequency limits. The controllers that are designed ensures the reference current tracking and hence the inverter output (inductor) current keeps track of the reference ( and ). The currents are drawn from the inverter for providing power to the load as well as the grid under grid connected condition. As the islanding happens at 0.225s, the grid current drops to zero and hence the inverter output current drops to a current which is demanded by the load. The simulation results of seamless transfer from grid connected to islanding mode are shown from Figure 16 to Figure 22. The inverter current in d axis is shown Figure 16, which is tracking the reference currents. At 0.225 s, the inductor current drops to 11 A, to supply the local loads. The inverter voltage and current waveforms are shown in Figure 17. The grid voltage and grid current waveforms are shown in Figure 18. The dq components of the capacitor voltage, waveforms of capacitor voltage and currents are shown in Figure 19 and Figure 20 respectively. The voltage across the load and the current drawn by the load are shown in Figure 21. Active and reactive power drawn by the load is shown in Figure 22. From the Figure 17, it is clear that during islanding, the voltage magnitude is within the limit and quality of voltage waveform is also good without any big transients and settles down quickly within a cycle time period.
The dynamic performance of the control strategy has been verified by changing the reference currents and the results are shown in Figure 23 and Figure 24. The inductor reference currents are set as 15 A from 0 to 0.1s and changes to 18A at 0.1s and to 20 A at 0.15s. At 0.225 s, the MG enters in to islanding mode and hence the inverter current drops and the inverter supplies the local load current of 11A.

Simulation results of indirect grid current control based seamless transfer
Simulation studies have been carried out by considering that the system is initially grid connected and supplying power to the local load as well as feeding power to the utility grid. MG is moving to islanded mode when fault occurs in the grid side. The parameters of the system under study are same as shown in Table 1 and Table 2. At 0.35s fault occurs in the grid side and hence the grid connected system changes to standalone mode. The grid current reference considered is 10 A and the results are shown in Figure 25 to Figure 30. The tracking of the grid reference current is shown in Figure 25.
Comparing the results of the control strategies, the output current control strategy gives better dynamic response. From Figure 23 and Figure 25, it is very clear that the output current control strategy tracks the reference current faster within half cycle and without any transients whereas in the grid current control, transients takes place when the reference changes and also it takes around 2 to 3 cycles to settle down to the reference value.

CONCLUSION
This paper discusses about the control strategies for attaining seamless transfer between the grid connected and islanding modes of operation of a Microgrid system. Simulation studies have been carried out using both indirect current control strategy and output current control strategy for a grid connected microgrid system to achieve seamless transfer. The Simulation results demonstrate that the smooth transition is achieved from grid connected to islanding mode when the switch in the grid side is opened under faulty conditions. The design of control loop is also validated from the simulation results by considering the settling time and steady state error as the performance parameters. Simulation results demonstrate that when the changeover takes from grid connected to islanded mode, the transients in load voltage, inverter output current settle within 10ms.