Microgrid Stability Controller Based on Adaptive Robust Total SMC

: This paper presents a microgrid stability controller (MSC) in order to provide existing DGs the additional functionality of working in islanding mode without changing their control strategies in grid-connected mode and to enhance the stability of the microgrid. Microgrid operating characteristics and mathematical models of the MSC indicate that the system is inherently nonlinear and time-variable. Therefore, this paper proposes an adaptive robust total sliding-mode control (ARTSMC) system for the MSC. It is proved that the ARTSMC system is insensitive to parametric uncertainties and external disturbances. The MSC provides fast dynamic response and robustness to the microgrid. When the system is operating in grid-connected mode, it is able to improve the controllability of the exchanged power between the microgrid and the utility grid, while smoothing DG’s output power. When the microgrid is operating in islanded mode, it provides voltage and frequency support, while guaranteeing seamless transition between the two operation modes. Simulation and experimental results show the effectiveness of the proposed approach.


Introduction
Features such as low investment, environmental friendly, high reliability and flexibility make distributed generation (DG) systems an interesting and promising technological option [1][2][3].As power systems are having an increasing DG penetration level, beside the aforementioned advantages, DG units may also bring problems to the utility grid like bidirectional power flow, voltage deviations, and voltage fluctuations.In this sense, a microgrid, which consists on a cluster of loads and parallel-connected DG units in a local area [4][5] is a suitable solution to problems caused by the high DG penetration, thus making possible large-scale DG penetration [6][7].A microgrid can be connected to the utility grid at the point of common coupling (PCC), being able to flexibly import/export energy from/to the grid by controlling active and reactive power flows [8][9].When there is a fault in the utility grid or during maintenance, according to IEEE standard 1547.4[10], the microgrid must be disconnected from the utility grid, thus operating in islanded mode in order to guarantee the electrical power supply to the critical loads [11][12].
In general, the normal DG operation mode is performed connected to the grid-connected, since in this case maximum produced power can be injected into the grid [13][14].The control algorithms for gridconnected DGs have been developed and refined along years [15][16].Reference [17] presents an overview of different control and synchronization techniques for DG systems.Different control strategies for DG systems under unbalanced condition are given [18][19].References [20][21][22] propose different controllers for DG systems to compensate harmonic components.References [23][24][25] depict control schemes for parallel connected DGs and hierarchical control is discussed in references [26][27].Nowadays these control schemes are mature technologies that are available in the market.Therefore, a real microgrid plant often uses commercial DG systems and add extra customized equipment to provide extra functionalities.
This paper proposes a "microgrid stability controller" (MSC) based on energy storage equipment, which provides for islanding operation functionality to conventional DG systems without changing their gridconnected control strategies.In addition, in grid-connected mode, the MSC can smooth the exchanged power at the PCC, thus avoiding voltage fluctuations and other power quality issues in the main grid.This feature is important when prime movers are renewable energy sources which are characterized by having a stochastic and intermittent behavior.
The MSC is expected to operate with high efficiency, low output current total harmonics distortion, and sinusoidal output voltage with a specified frequency and amplitude in all operation modes.In addition to this requirement, the MSC must be robust against disturbances, having good voltage regulation and fast dynamic response.In that sense, many control techniques have been proposed for pulse width modulation (PWM) converters to achieve good dynamic response under different types of loads, including proportionalintegral-derivative control, model-based linear control, robust control, and internal model principle based control [28][29][30][31].However, uncertainties caused by the operation mode transitions and DG disturbances make the MSC a nonlinear, time-variable system.Therefore, it is difficult to reach ideal control objectives with conventional control techniques due to their multivariable structure and highly coupled nonlinearity of the system.Most of the conventional control techniques only guarantee the desired closed-loop response at the expected operating point, thus degrading their performances outside this point.Hence, it seems natural to explore other nonlinear controls that can overcome the uncertainties problem, and to achieve better compensation and global stability in large-signal sense [32].
For instance, sliding mode control (SMC) is one of the most effective nonlinear robust control approaches, since it provides to the system a dynamics with an invariance property to uncertainties once the system dynamics is controlled in the sliding mode [33][34][35][36][37]. Reference [38] applies SMC scheme to a threephase AC-to-DC voltage source boost converter to provide a constant level output voltage while keeping unity power factor.Reference [39] applies SMC in a single phase inverter and designs different control schemes in stand-alone and grid connected modes.Reference [40] uses SMC in the voltage control loop of a voltage-sourced rectifier, which provides quasi unity power factor operation, low harmonic content and fast dynamic response.While ， hysteretic control is applied in the current control loop, so that the switching frequency is variable, also named chattering.
In practical control systems, parameter variation, uncertainties, external disturbances and the limitation of detection make it difficult to acquire an accurate mathematical model.Consequently, the traditional SMC can hardly achieve outstanding results.Therefore, this work proposes an adaptive robust total sliding-mode control (ARTSMC) system for the MSC, which colligates the advantages of adaptive control and SMC.The total sliding surface eliminates the control error and gets a sliding motion through the whole state trajectory [41][42].Furthermore, the use of PWM avoids variable switching frequency.
This paper is organized as follows.In Section 2 the configuration of a microgrid including the proposed MSC is presented.In Section 3 the model of the proposed MSC is derived for the system operating in both islanded and grid-connected modes.Section 4 presents the ARTSMC system for both voltage control and current control used in islanded and grid-connected modes respectively.Section 5 validates the proposed approach by means of simulation results, and Section 6 present the experimental results extracted by an AERTSMC-controlled MSC of 3 kVA.Finally, Section 7 concludes the paper.

Proposed MSC-based Microgrid
Fig. 1 shows the circuit topology of a microgrid including photovoltaic (PV) based DG unit and critical loads connected to an AC bus.The microgrid is connected to the electrical distribution network through a circuit breaker QF.The MSC, which consists of an energy storage system, a bidirectional DC-to-AC converter with an inductor-capacitor (LC) filter, is connected to the AC bus together with the DG unit and the critical load inside the microgrid.As the MSC is based on an energy storage system (ESS) and full controlled converter, it can flexibly import/export power from/to the grid.When the microgrid operates in grid-connected mode, the MSC can compensate the power variations or reduce the power fluctuations caused by the DG unit or the critical loads inside the microgrid.When microgrid is disconnected from the main grid, thus operating in islanded mode, the MSC fixes the microgrid output voltage and frequency, which are the references to be used by the DG.Note that when the microgrid operates in islanded mode, it is a weak AC power system, consequently, the DG output power variations or load disturbances are more likely to cause voltage fluctuations or voltage sags.These problems may enforce DG units and/or sensitive load disconnection from the AC line.Therefore, it is necessary to use the MSC to balance active and reactive in the microgrid in order to maintain voltage and power quality.

MSC Modeling
Fig. 2 shows the power stage of the MSC when the microgrid operates in islanded mode.In this figure, v 0a , v 0b , v 0c are the AC bus voltages (per phase) and i 0a , i 0b , i 0c are the AC currents (per phase) of the MSC; L a , L b , L c and C fa , C fb , C fc are the filter inductor and capacitor values, respectively; r a , r b , r c represent the equivalent series resistor (ESR) of the converter, inductor, and power line; r fa , r fb ,r fc represent the ESR of the filter capacitor; and i ma , i mb , i mc represent the aforementioned disturbances in the microgrid.

Figure 2.Power stage of the MSC
The states of the switches of the n-th leg (n=1, 2, 3) can be represented by the time-dependent variable S n , defined as

if T is on and T is off S n if T is on and T is off
This switching strategy, together with a small dead-time generator, will avoid internal shorts between the two switches of each bridge leg, as the switches will always be in complementary states.Assuming that the switching frequency is high enough compared to the modulation and natural frequencies, the equivalent dynamic model of Fig. 2 can be obtained as shown in Fig. 3, where s is the Laplace operator, the power gain can be defined as k PWM = V d /v tri , and v tri is the amplitude of a triangular carrier signal.

System modeling in islanding mode
When the microgrid operates in islanded mode, the dynamic equation of the MSC during the positivehalf period can be represented as where According to the aforementioned discussion, the microgrid is a nonlinear, time-variable system and there are uncertainties in the MSC system, which are caused by parametric variations or external disturbances.Therefore, equation ( 2) should be modified as follows ∆A k , ∆B k , ∆D k represent the system parameter variations and they satisfy the matching condition which is Thus, rearranging equation (4) as 0 ( ) The bound of the uncertainty is assumed to meet the following inequality where q 1k and q 2k are unknown positive constants and e k is the voltage control error, which is defined as where v refk is the output voltage reference, which is set to the nominal value.

Microgrid
When the microgrid operates in grid-connected mode, it is connected to the utility grid at the PCC.In order to provide the desired power to the grid, we propose use the MSC to compensate power variations and to reduce power fluctuations caused by the DGs and/or loads in the microgrid.The dynamic equation of the MSC during the positive-half period is represented as Equation ( 8) can be rearranged as follows where ) the control signal; L ga , L gb , L gc and R ga , R gb , R gc represent inductors and their respective ESRs;v 0a , v 0b , v 0c and i 0a , i 0b , i 0c are the AC voltage and current (per phase) respectively; and v ma , v mb , v mc represent disturbances or uncertainties in the microgrid.Equation ( 9) can be rearranged as Due to the parametric variations or external disturbances, equation ( 10) should be modified as ∆a, ∆b, ∆c represent the system parameter variations and they satisfy the matching condition which is ∆a=bf, ∆b=bm, ∆c=bn, v m /L g =bg.In order to analyze conveniently, define where w is the uncertainty.Therefore equation ( 11) is modified as The bound of the uncertainty is assumed to meet the following inequality ≤ w q (14) Being q=diag(q a , q b , q c ) an unknown positive constant.

ARTSMC System
The proposed ARTSMC is insensitive to parametric uncertainties and external disturbances.The total sliding surface ensures stability and robustness through the entire state trajectory.Hence, the system dynamics in the reaching phase is not influenced by uncertainties.The control law encompasses a state feedback term, a robust control term, and an adaptive compensation term.The state feedback term takes advantage of the pole assignment and state feedback, while simplifying the sliding surface design.The robust control term decides the basic structure of the uncertain nonlinear system.Uncertainties in the MSC system do not have a fixed value, so that it is difficult and impractical to measure real-time uncertainties.Thus, a logical solution is to apply an adaptive strategy.Instead of fixing a boundary of uncertainties, an adaptive compensation term is introduced in order to adjust the uncertainties in real-time.According to the difference between the nominal nonlinear system and the uncertain nonlinear system, the sliding surface and other parameters compose the adaptive law which satisfies the global Lyapunov stability condition.
The proposed ARTSMC system is divided into two main parts, as illustrated in Fig. 5.The first part is the ARTSMC based voltage control loop, which produces the control signals u control1a , u control1b and u control1c .The second part is the ARTSMC based current control loop, which produces the control signals u control2a , u control2b , and u control2c .When the microgrid operates in grid-connected mode, the current control loop determines the output power of the MSC by controlling its output current.In this scenario, its output voltage v 0a , v 0b , and v 0c is equal to the grid voltage (v ga , v gb , v gc ), which is assumed to be the nominal value, meaning that v 0a , v 0b , v 0c equal to v refa , v refb , v refc , thus the voltage control loop is automatically disabled.When the microgrid operates in islanded mode, the voltage control loop enforces the output voltage of the MSC to track the reference value v refa , v refb , v refc and to keep the microgrid voltage constant.The output power of the MSC is determined by the power balance among DGs, loads, and losses in the microgrid.Under this circumstance, the current control loop is not necessary; therefore the switch S is open.

ARTSMC based current control loop
The main task of the ARTSMC-based current control loop is to control the output power of the MSC by regulating its AC current.Specifically, it has to enforce i 0a , i 0b , i 0c to track the output current reference i refa , i refb , i refc .Thus, a PLL structure is applied in order to generate the output current reference i refa , i refb , i refc , to achieve unity power factor.It is important to notice that the power factor can be adjusted by modifying θ PLL .The current control loop is synthesized as follows.The first step is to define a sliding surface [35][36] 0 0 ( ) where e i =diag(i 0a -i refa , i 0b -i refb ,i 0c -i refc ), s=diag(s a , s b , s c ) andβ is the state feedback coefficient.eio is the initial state of e i .The second step is to design the control to enforce the system state trajectories to go toward the sliding surface (15) and to stay on it: where: Being u 1 the state feedback term, u 2 the robust control term, and u 3 the adaptive compensation term; ε is a small positive constant number; sign(s)=diag(sign(s a ), sign(s b ), sign(s b )) and sign(•) is the sign function; abs(•) is the absolute value function; q ˆis the estimated value of q; the parameter deviation is defined as q q q -= ˆ;and the adaptive law is ( ) Proof: the existence condition of the sliding mode can be derived by using Lyapunov stability analysis, by consider the Lyapunov function candidate as By taking the derivative of equation ( 15) along ( 13) and substituting ( 16) and ( 20) into (22), it yields .It implies that the asymptotically stable behavior for the sliding mode system on the sliding surface ( 15) can be ensured.
Once the system trajectory reaches the sliding surface, = = Then, the equivalent control can be obtained from the following equation ( 1) By substituting equation ( 24) into equation ( 13), it yields ( ) It implies that by properly selecting the state feedback coefficient β, the robustness of sliding mode (25) can be guaranteed, and the main dynamics features of the MSC such as rising time and maximum overshoot can easily be designed.

ARTSMC based for voltage control loop
The main function of the ARTSMC-based voltage control loop is to force the MSC output voltage to track its reference value v refa , v refb , v refc , thus keeping the microgrid voltage constant when the microgrid operates in islanded mode.In order to eliminate the control error and to get a sliding motion through the entire state trajectory, let us define a sliding surface as 0 0 ( ) where C is a full rank constant matrix, CB is nonsingular, and β is state feedback control coefficient matrix, e ko is the initial value of e k .The system state trajectories are forced toward the sliding surface (26) and stay on it, by designing the control scheme as follows such that where: CB e (30) where u 1k is the state feedback term, u 2k is the robust control term, u 3k is the adaptive compensation term; T ; ε is a small positive constant and sign (•) is the sign function; k q 1 ˆ, k q 2 ˆare estimated values of k q 1 , k q 2 .The parameter deviations are Proof: by considering a Lyapunov function candidate as Taking the derivative of equation ( 31) V s s q q q q s sign s u q q q q s sign s s q q e e Substituting equation ( 27) into (32), it yields Consequently, the asymptotically stable behavior for the sliding mode system on the sliding surface ( 26) can be guaranteed.
Once the system trajectory reaches the sliding surface, Therefore, the equivalent control can be obtained from equation (34) which is Substituting equation (34) into equation ( 5), it yields ( ) It implies that with probably designed state feedback coefficient β, the robustness of sliding mode (35) can be determined.
The strictly logical and rigorous proof illustrates the ARTSMC system is insensitive to parametric uncertainties and external disturbances.

Simulation Results
A simulation platform under PSCAD/EMTDC environment is developed based on Fig. 1 to study the performance of the MSC and to verify the proposed ARTSMC system.Table 1 shows the electrical parameters of MSC under study.The AC output voltage reference v ref is set to 220V at 50Hz, and the AC output current reference i ref is set according to the desired power exchange value at the PCC.Based on the sliding surface ( 15) and ( 26), the state feedback coefficients are designed to guarantee the robustness of the sliding mode (25) and (35), while determining the control performance and system stability, the parameters are given as: β=30,β= [0.002 70].The DG PV system in Fig. 1 is connected to the same AC bus with the MSC through a DC-to-AC inverter, which is in phase with the grid voltage, and injecting power to the microgrid.The microgrid operates in grid-connected mode and delivers 30 kW to the power grid.The output power of DG PV is set to 40kW and the critical load inside the microgrid is 30kW.At 0.5s, the output power of DG PV increases to 50kW and at 1s the microgrid disconnects from the utility, thus operating in islanded mode.At 1.5s the output power of DG PV decreases to 20kW, and at 1.75s the 30kW critical load is connected to the microgrid.Fig. 6 presents output power of the MSC, which is 20 kW at the beginning, and then it goes down to 10 kW at 0.5s.The MSC switches to charge mode at 1s as there is 20 kW excess of power when the microgrid operates in islanded mode from 1s.When the output power of DG PV decreases to 20kW at 1.5s, the MSC starts injecting 10 kW of active power to the microgrid, and its output power raise to 40 kW as the critical load in the microgrid increases to 60 kW at 1.75s, while the output power of the DG PV remains constant.The voltage and current waveforms of the MSC at its AC side are shown in Figs.7 and 8.The output current of the MSC does not have any inrush spikes during the entire transition period.Furthermore, there is no voltage perturbation along the operation.Due to the parallel connection of the MSC, the critical load and the DG PV , the microgrid voltage remains stable in all situations.(c) (d) Fig. 9 gives the output power of the DG PV .Figs.10 and 11 present the output voltage and current waveforms of the DG PV .Their output voltage keep steady, while the output current increases at 0.5s and reduces at 1.5s with no inrush current.The simulation results indicate smooth transaction and stable operation of the DG system.It shows that MSC provides DG PV additional islanded operation functionality without changing their inner control strategies conceived for grid-connected mode.(c) (d)

Experimental Results
A 3kVA experimental setup of MSC is shown in Fig. 12.The converter used in MSC is built based on IGBTs and the proposed control strategy is carried out by using a digital signal processor (DSP) TMS320F28335 produced by Texas Instruments Inc.The switching frequency of the PWM gating signal is 12 kHz, and the main circuit devices have the same value as in the simulation model.Figs. 13 and 14 give experimental results of the MSC under different conditions.The upper waveform is the voltage waveform of the MSC at the AC side and the lower one is the current waveform of phase A. The experimental results of MSC when the microgrid transfers between the two operation modes are shown in Fig. 13.In Fig. 13 (a), the microgrid operates in grid-connected mode and transfers to islanded mode, while in Fig. 13(b) the microgrid operates in islanded mode and reconnects to the utility.The output power reference of the MSC is set at 2kW when the microgrid operates in grid-connected mode.If it is disconnected from the utility grid, the MSC supplies a 3kW load.It can be seen that in Fig. 13 the output power is controlled to be follow the reference value, and the voltage is controlled to track the voltage reference (220V, 50Hz).Note that the output voltage and current of the MSC do not have any inrush spikes during the entire transition period, thus indicating a smooth transition.Fig. 14 (a) presents the experimental results when the microgrid operates in grid-connected mode, the output power reference value of MSC is set at 2.5kW at first and then increases to 3kW.Note that its output current is increased and the output voltage is stable.During islanded mode, the MSC feed a 1.5kW load, and then another 1.5kW load is connected to the microgrid.The experimental results are given in Fig. 14 (b), showing clearly that the voltage keeps stable during the whole period.

Conclusions
As the MSC in a microgrid is inherently nonlinear, time-variable, the authors proposed to employ ARTSMC scheme in order to ensure its stability and dynamics.The ARTSMC system is developed after analyzing the microgrid operating characteristics and the mathematical models of the MSC.The rigorous proof illustrates the ARTSMC system is insensitive to parametric uncertainties and external disturbances.Simulation and experimental results have shown the fast dynamic response and robustness performance of the MSC, while guaranteeing stable operation of the microgrid in grid-connected and islanded modes, as well as automatic and seamless transition between these two operation modes.The MSC improves the reliability and power quality of the microgrid, thus providing additional islanded mode functionality without changing DG inner control strategies.The MSC is suitable for existing DGs to extend their function and to form a microgrid to supply critical loads.The proposed solution is quite independent from the use of third-party commercial DG units, such as PV inverters, so that no specific customized DGs are necessary.

Figure 4 .
Figure 4.Block diagram of the grid-connected microgrid

Figure 6 .
Figure 6.Output active and reactive powers of the MSC.

Figure 9 .
Figure 9. Output power of the MSC.

Figure 12 .
Figure 12.Laboratory setup to test the controller performance

Table 1 .
Parameters of MSC Figs.10 and 11 present the output voltage and current waveforms of DG PV .Figure10.(a) Output voltage waveforms of DG PV between 0.35s~0.65s.(b) Output voltage waveforms of DG PV between 0.85s~1.15s.(c) Output voltage waveforms of DG PV between 1.35s~1.65s.(d) Output voltage waveforms of DG PV between 1.6s~1.9s.