*Article* **Robust Control for Optimized Islanded and Grid-Connected Operation of Solar/Wind/Battery Hybrid Energy**

**Muhammad Maaruf 1,2, Khalid Khan <sup>3</sup> and Muhammad Khalid 2,3,4,\***


**Abstract:** Wind and solar energy systems are among the most promising renewable energy technologies for electric power generations. Hybrid renewable energy systems (HRES) enable the incorporation of more than one renewable technology, allowing increased reliability and efficiency. Nevertheless, the introduction of variable generation sources in concurrence with the existing system load demand necessitates maintaining the power balance between the components of the HRES. Additionally, the efficiency of the hybrid power supply system is drastically affected by the number of converters interfacing its components. Therefore, to improve the performance of the HRES, this paper proposes a robust sliding mode control strategy for both standalone and grid-connected operation. The control strategy achieves maximum power point tracking for both the renewable energy sources and stabilizes the DC-bus and load voltages irrespective of the disturbances, change in load demand, variations of irradiance level, temperature, and wind speed ensuring an efficient energy management. Furthermore, the solar PV system is directly linked to the DC-bus obviating the need for redundant interfacing boost converters with decreased costs and reduced system losses. Lyapunov candidate function is used to prove the asymptotic stability and the convergence of the entire system. The robustness of the proposed control strategy is tested and validated under various conditions of HRES, demonstrating its efficacy and performance under various conditions of the HRES.

**Keywords:** energy storage system; hybrid microgrid; nonlinear control; power management; solar PV generation; wind power generation

#### **1. Introduction**

The need of renewable energy sources (RESs) in energy sector has progressively increased due to the global concern over environmental preservation and ever-increasing electric power demand. Therefore, RES technologies such as solar photovoltaics (PV), wind, hydro, geothermal, etc., are progressively utilized in electric power generation as they prove to be a more efficient and cheaper solution than conventional fuel-based generators, especially solar and wind energy sources, in terms of Levelized cost of energy [1,2]. Solar and wind energy sources are among the prominent RES technologies [3], attributable to their low cost, availability, modularity, and technological maturity [4]. In addition, recent advancements in power electronics technology enable a more flexible as well as desirable operational control and integration of RES to the power grid with reduced cost [5]. Nevertheless, large-scale RES integration is significantly limited due to their intermittent nature and geographical dependency, that is, they are highly dependent on ambient conditions such as wind speed, temperature, and degree of irradiance [6]. Such

**Citation:** Maaruf, M.; Khan, K.; Khalid, M. Robust Control for Optimized Islanded and Grid-Connected Operation of Solar/Wind/Battery Hybrid Energy. *Sustainability* **2022**, *14*, 5673. https://doi.org/10.3390/su14095673

Academic Editors: Akbar Maleki and Alberto-Jesus Perea-Moreno

Received: 17 February 2022 Accepted: 13 April 2022 Published: 8 May 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

dependencies have a severely detrimental impact on the reliability and power quality of the system [7–9].

Realization of hybrid renewable energy system (HRES) includes incorporation of two or more power generation technologies [10]. Such HRES mitigates the intermittency of individual RESs enhancing the overall operational efficiency [11], and optimizing the capital investments through appropriate utilization of the available natural resources [12]. Wind and solar based HRESs have the dynamic capability to support the utility grid due to the availability of moment of inertia in the wind generation system [13], and the reliability of the power supply is increased due to the availability of multiple energy sources [14]. Besides, the complementary relationship between PV and wind energy sources ensures a high probability of continuous power supply, i.e., the output from the PV panel is high and the wind turbine power generation is low during the day. Accordingly, the PV production is negligible, whereas the wind turbine output increases at night [15].

The PV-wind HRES system deals with the intermittency of both energy sources. Concurrently, maximum power point tracking (MPPT) is vital for harnessing peak energy [16]. Energy storage systems (ESSs) store/supply the excess/deficient power generated by the RESs [17]. This enables a degree of controllability over the intermittency introduced by the variable RES and the loads. Seemingly, ESSs are proved to facilitate a multi-faced solution in RES-based power systems in the form of bulk energy services, transmission infrastructure services, customer energy management services, ancillary services, and offgrid operations [18–20]. However, HRESs that are designed to operate in both standalone and grid-connected modes needs to be meticulously operated to enable harnessing of maximum power from the RESs while maintaining acceptable power quality standards in terms of mitigating the impact of system uncertainties and maintaining acceptable voltage levels across the grid [21–23].

This paper presents a non-linear, multi-input–multi-output (MIMO) robust sliding mode control (SMC) for HRES consisting of wind/solar/battery. The control design facilitates a unified single controller for a safe, reliable and seamless operation for both standalone and grid-connected microgrid operation. A cost-efficient methodology is also achieved by connecting the PV array directly to the DC-bus without the interfacing DC-DC boost converter [24]. This approach facilities insights on the integration of hybrid renewable energy sources into the grid for power system designers and operators to not only minimize the cost of installation, but also to improve the efficiency of the PV output power in terms of practical applications. Besides, the proposed approach does not require an islanding detection system [25,26]. Thus, the drawbacks of islanding detection such as deviation in current and voltage due to mismatch in frequency, phase, and amplitude [27–29], during the switching between the islanded and grid modes are avoided. The outline and contribution of this paper is summarized as follows:


sources; and (iii) maintaining the power balance of the HRES during both on-grid and off-grid operations.

The remainder of the paper is organized as follows: Section 2 presents the literature review. The mathematical models of the HRES components are derived in Section 3. The proposed power management architecture and MIMO sliding mode control scheme are presented in Sections 4 and 5, respectively. The simulation results are discussed in Section 6, followed by the conclusion in Section 7.

#### **2. Related Works**

The integration of HRES imposes numerous technical challenges on the utility grid such as voltage regulation, management of active and reactive power flow, and introduction of harmonics due to the integration of power electronic devices [30]. The variability of renewable energy requires innovative solutions that lead to the incorporation of auxiliary support systems such as energy storage systems. The power generated by the solar and wind energy sources are sporadically higher/lower to the load demand, and curtailment/injection of power is required inevitably to maintain the power balance of the grid [31]. Accordingly, a coordinated control framework is pertinent not only to mitigate the impact of but to assure a unified operation between RES, grid, and auxiliary systems while maintaining the power quality of the grid [32].

A novel and cost-effective technique based on fuzzy-PI methodology for energy management in HRES is presented in [24]. The wind energy conversion system (WECS) is integrated using a RSC and GSC architecture, and the PV is incorporated into the DC-bus via a DC-DC converter. The rotor and stator currents are regulated through the proposed fuzzy logic control (FLC). The corresponding PI gains are auto-tuned by the FLC, and the DC-DC link is controlled to maintain the active power flow during normal operating conditions and regulate the DC-bus during grid fault conditions. Therefore, the efficacy of the proposed framework is validated to achieve minimized rotor over-currents, enhance converter performance, protect wind/PV HRES during voltage disturbance, and minimize torque and rotor variations.

Furthermore, a vector control method is presented in [33], for wind-PV grid-connected B2B converters. This study proposes a separate MPPT algorithm for PV and WECS through the RSC and GSC, respectively. The control vector approach utilizes the GSC to regulate the DC-bus voltage under different operational modes. An adaptive least mean mixed norm control technique [34], is proposed to reduce the impact of the stochastic components in the HRES. The proposed control enables exclusive MPPT operation for PV/wind and regulates the RSC and GSC to reduce the impact of the varying solar irradiance, wind speed, and loads. The DC-bus voltage is regulated using a PI controller. This study presents an experimental validation that improves the power quality by reducing the disturbances and harmonic content. Nonetheless, the above studies did not utilize and collaborate their control theories considering ESSs.

A dynamic modeling and operational control strategy for wind/solar RES is presented in [35]. A multi-input current-source-interface DC-DC converter topology is proposed for a sustainable power network that mitigates the impact of parametric variations of solar irradiance and wind speed. The MPP for the wind and solar are achieved through variable speed control and incremental conductance control methods, respectively. The ESS is locally utilized as an energy buffer to reduce the effect of RES intermittency and support the islanded microgrid operations in extreme grid conditions of blackouts and natural disasters. The research in [36] developed an optimal fuel consumption technique for HRES that consists of solar/wind/battery/diesel generation systems. The control framework proposes a modified P&O MPPT technique for PV and ESS control that is incorporated through the DC-DC converter. The RSC is designed to extract maximum power from the WECS using field-oriented vector control [37]. The GSC is designed to perform load compensation, reactive power compensation, harmonics compensation, and optimal utilization and control of the diesel generators.

An MPPT algorithm is developed based on a sensorless approach for HRES consisting of a doubly-fed induction motor (DFIG) and solar PV [38]. This proposition posits the utilization of B2B converters to interconnect the standalone HRES. The system architecture and control logic presented in the study obviates the need for additional sensing devices ensuring an enhanced operation of PV-DFIG hybrid system with minimal errors that is almost equal to zero. The P&O method is widely used for MPPT due to its simplicity and ease of implementation [39–41]. Furthermore, the P&O technique can be sensorless that additionally reduces the complexity and error, but requires intensive expertise of the system parameters [42].

In [43], a robust fractional-order SMC is proposed for a variable speed wind turbine to attain MPPT. A non-linear control approach is used to develop the SMC algorithm. In comparison to the conventional SMC control algorithm, the authors postulated an improved performance through the suppression of external disturbances and reduction of overshoot. Similarly, an adaptive integral derivative SMC control theory is proposed for MPPT operation for PV system [44]. The authors combined the traditional perturb and observe (P&O) MPPT method with an SMC framework. The presented MPPT control theory is demonstrated to successfully obviate the overshoot during abrupt fluctuation of solar irradiance and reduce steady-state variations. Moreover, the controller gains are adjusted using an adaptive mechanism to ensure appropriate operation under numerous different irradiation levels.

In recent years, few results considering energy systems for grid-connected/on-grid and standalone/off-grid operations have been published. A review of optimization techniques for power generating systems operating standalone and grid-connected is presented in [45]. The on-grid and off-grid operation of permanent magnet synchronous generator (PMSG) driven wind turbine system is presented in [46]. The study posits a centralized control strategy for RGC-GSC of the WECS and the bidirectional DC-DC converter of ESS. Accordingly, a PI-fuzzy based power management scheme for wind/solar/battery HRES is presented in [47]. The control unit operated based on supervisory control theory ensures an enhanced efficiency performance both in off-grid and on-grid operations.

#### **3. Mathematical Modeling**

The hybrid renewable microgrid system consists of a PMSG wind turbine, solar PV, battery energy storage system, and load. The microgrid is connected to the utility grid through switch *S*<sup>1</sup> that is placed between the load and the utility network as shown in Figure 1. When the switch *S*<sup>1</sup> between the load and the utility grid is opened, the system is operating in standalone mode and is supplying to the load only. When the switch is closed, the system is in grid-connected mode. The PMSG wind turbine is integrated into the microgrid through the RSC of the B2B converter. The solar PV is directly connected to the DC-bus. A diode is connected in series with the PV array to avert destruction as a result of the reverse flow of current. Similarly, the battery energy storage system is tied to the system at the DC bus and controlled through a DC-DC buck–boost converter.

**Figure 1.** PV/wind/battery hybrid renewable energy system.

#### *3.1. Wind Turbine Model*

The mechanical power (*Pw*) captured by the wind turbine from the wind is given by [48]:

$$P\_w = \frac{1}{2} \rho \pi R^2 \mathbb{C}\_p(\lambda, \beta) V\_w^3 \tag{1}$$

$$C\_p(\lambda, \beta) = 0.5176(\frac{116}{\lambda\_i} - 0.4\beta - 5)e^{\frac{-21}{\lambda\_i}} + 0.0068\lambda\tag{2}$$

$$\frac{1}{\lambda\_i} = \frac{1}{\lambda + 0.08\beta} - \frac{0.035}{\beta^3 + 1} \tag{3}$$

$$
\lambda = \frac{R\omega\_r}{V\_w} \tag{4}
$$

$$\frac{d\omega\_{\rm r}}{dt} = J^{-1}P[T\_{\rm m} - T\_{\rm e}] \tag{5}$$

where, *Vw* is the wind speed, *Cp* is the power coefficient, *ρ* is the air density, *R* is the radius of the wind turbine, *ω<sup>r</sup>* is the angular speed of the wind turbine, the tip-speed ratio is represented by *λ*, *β* is the pitch angle, *J* is the inertia of the mechanical shaft, *Te* and *Tm* are the electrical and mechanical torque, respectively.

#### *3.2. PMSG Model*

The AC signals from the wind generation system are converted to DC using the RSC. The model of the PMSG is formulated in the d-q reference frame considering the dynamics of the RSC as follows [49]:

$$V\_{ds} = L\_d \frac{dI\_{ds}}{dt} - \omega\_{\tau} L\_{\eta} I\_{\eta^{\varsigma}} + R\_s I\_{ds} \tag{6}$$

$$V\_{q\text{s}} = L\_q \frac{dI\_{q\text{s}}}{dt} + \omega\_r L\_d I\_{d\text{s}} + \omega\_r \Lambda\_r + R\_s I\_{q\text{s}} \tag{7}$$

$$T\_{\varepsilon} = \frac{3P}{2} [(L\_d - L\_q)I\_{ds}I\_{qs} + \Lambda\_r I\_{qs}] \tag{8}$$

where, *Vds* is the *d*-axis stator voltage, Λ*<sup>r</sup>* is the rotor flux, *Rs* is the stator resistance, *Vqs* is the *q*-axis stator voltage, *Ld* is the *d*-axis self-inducatnce, *Ids* is the *q*-axis stator current, *Iqs* is the *q*-axis stator current, *Lq* is the *q*-axis self inductance, and *Rs* is the stator resistance. For nonsalient PMSG, *Ld* = *Lq*.

#### *3.3. Modeling of Solar PV Module*

The series and parallel connected PV cells formulate the solar PV module that utilizes the solar radiation to generate the DC voltage. In this respect, the equivalent circuit of the PV cell comprises of a series resistor, parallel resistor, diode, and current source. The current output of the solar PV is expressed as [33,50]:

$$I\_{pv} = N\_p \left( I\_{ph} - I\_s \left[ \exp\left(\frac{qV\_D}{N\_s AK\_B T}\right) - 1 \right] - \frac{V\_D}{R\_{sh}} \right) \tag{9}$$

$$V\_D = \frac{V\_{pv} + I\_{pv}\frac{N\_s}{N\_p}R\_{sc}}{N\_s} \tag{10}$$

$$I\_{ph} = \left[I\_{sc} + \psi\_i (T - T\_r)\right] \frac{S}{1000} \tag{11}$$

$$I\_s = I\_{rs} \left(\frac{T}{T\_r}\right)^3 \exp\left(\frac{qE\_\%}{AK\_BT} \left[\frac{1}{T\_I} - \frac{1}{T}\right]\right) \tag{12}$$

where, *Iph* is the photo-generated current, *Ipv* is the PV output current, the leakage or reverse saturated current of the diode is denoted by *Is*, *Irs* is the saturated current at the operating temperature of the PV module, *Ns* and *Np* are the number of series and parallel connected PV cells, *q* is the electron charge, *VD* is the diode voltage, *A* is the p-n junction factor, *Eg* is the band gap energy of the semiconductor material used in the cell, *KB* represents the Boltzmann constant, *Isc* is short circuit current of the PV module, *T* is the ambient temperature, *ψ<sup>i</sup>* is the temperature coefficient, *S* is the solar irradiance level, *Tr* is the operating temperature of the PV module, *Rse* and *Rsh* are the equivalent series resistance and shunt resistance of the PV cell, respectively.

**Remark 1.** *A number of PV modules are used to obtain a considerable power. The desired reference voltage of the DC-bus (V*∗ *dc), is obtained from the MPP voltage (Vmax pv ) of the PV system. When the irradiance is not available, the Vmax pv is replaced by the nominal value of the DC-bus voltage.*

#### *3.4. DC-DC Converter and Battery Modelling*

In this study, a Lithium-ion (li-ion) battery is considered as the ESS component in the hybrid renewable microgrid. The ESS is incorporated into the DC-bus of the HRES via a buck/boost converter, as depicted in Figure 2. The converter allows bi-directional operation of the ESS, i.e., during ESS charging it operates as a buck converter and as a boost converter during ESS discharging (13). The converter operates as a buck converter during charging and as boost converter during discharging of the battery. Mathematically, the converter dynamics during the charging mode of the battery is formulated as [51]:

$$B\_{mode} = \begin{cases} 0, & \text{if } I\_b < 0 \text{ (buck)}\\ 1, & \text{if } I\_b > 0 \text{ (bootstrap)} \end{cases} \tag{13}$$

$$L\_b \frac{dI\_b}{dt} = V\_b - I\_b R\_b - (1 - D\_1) V\_{dc} \tag{14}$$

$$\mathcal{C}\_{d\varepsilon} \frac{dV\_{d\varepsilon}}{dt} = (1 - D\_1)I\_b - I\_{\mathbb{g}dc} \tag{15}$$

where, *Lb* is the battery inductance, *Ib* is the battery current, *Vb* is the battery voltage, *Rb* is the internal resistance, *D*<sup>1</sup> is the generated control signal during the charging mode of the battery, *Vdc* is the DC-bus voltage, *Cdc* is the capacitance of the DC-bus, and *Igdc* is the DC current of the GSC converter. Similarly, converter dynamics during the discharging (boost) mode of the battery is expressed as:

$$L\_b \frac{dI\_b}{dt} = V\_b - I\_b R\_b - D\_2 V\_{dc} \tag{16}$$

$$C\_{d\varepsilon} \frac{dV\_{d\varepsilon}}{dt} = D\_2 I\_b - I\_{\text{g.d\varepsilon}} \tag{17}$$

where, *D*<sup>2</sup> is the generated control signal during the discharging mode of the battery. Accordingly, standardization can be made to reduce the complexity of the battery model to achieve general formulation using a virtual control (18). Hence, the overall generalized model of the of the battery model (14)–(17) is achieved, that is expressed as:

$$D\_{12} = \left[B\_{mode}(1 - D\_1) + (1 - B\_{mode})D\_2\right] \tag{18}$$

$$L\_b \frac{dI\_b}{dt} = V\_b - I\_b R\_b - D\_{12} V\_{dc} \tag{19}$$

$$C\_{dc}\frac{dV\_{dc}}{dt} = D\_{12}I\_b - I\_{\text{gdc}}\tag{20}$$

$$\frac{d(So\mathbb{C})}{dt} = -\frac{\eta\_b}{Q\_b}I\_b\tag{21}$$

**Figure 2.** Buck/boost converter associated with ESS.

The state-of-charge (SoC) of the battery (21) is derived using the battery capacity (*Qb*) and the battery efficiency (*ηb*) [52]. The SoC of the battery is constrained by the lower (*SoCmin*) and upper (*SoCmax*) limit of the battery capacity, as follows:

$$So\mathbb{C}^{\min} < SoC < SoC^{\max} \tag{22}$$

**Remark 2.** *The solution of* (21) *is SoC*(*t*) = *SoC*(0) <sup>−</sup> *<sup>η</sup><sup>b</sup>* " *Ibdt Qb , where SoC*(0) *is the initial charge of the battery. When the battery is charging, Ib is negative, and the SoC*(*t*) *is increasing. On the other hand, when the battery is discharging, Ib is positive, and SoC*(*t*) *is decreasing.*

#### *3.5. GSC Modeling*

The GSC is utilized to convert the DC signals to three-phase AC signals. Accordingly, GSC facilitates the power flow between the ESS and grid enabling the controllability over the load voltage, that is formulated in the d-q reference frame as [53]:

$$V\_{di} = \mathcal{U}\_{dl} - L\_f \omega\_{\mathcal{S}} I\_{qi} + L\_f \frac{dI\_{di}}{dt} \tag{23}$$

$$V\_{qi} = \mathcal{U}\_{ql} + L\_f \omega\_{\mathcal{S}} I\_{di} + L\_f \frac{dI\_{qi}}{dt} \tag{24}$$

where, *Vdi* and *Vqi* denotes the *d*-axis and *q*-axis output voltage of the GSC, respectively, *Lf* and *ω<sup>g</sup>* are the line filter inductance and grid electrical angular speed, respectively, *Udl* and *Uql* are the *d*-axis and *q*-axis load voltages, respectively, *Idi* and *Uqi* are the *d*-axis and *q*-axis GSC ouput currents.

#### *3.6. Grid Side Modeling*

The grid circuit consists of *Lf* , line inductance (*Lg*), RL load, switch (*S*1), and the grid voltage. The leakage inductance of the transformer is included in *Lg* to simplify the circuit. In order to obtain the expression of the load voltage in terms of the grid voltage, the grid-side circuit is converted to the Thevenin's equivalent [46].

If the load impedance (*Zl*) and the grid voltage (*Ug*) are given by *Zl* = *Rl* + *jωgLl* and *Ug* = *Udg* + *jUqg*, respectively, then the Thevenin's impedance (*Zth*) and voltage (*Eth*) are, respectively, expressed as:

$$Z\_{th} = \frac{j\omega\_{\mathcal{S}}L\_{\mathcal{S}}(R\_I + j\omega\_{\mathcal{S}}L\_I)}{R\_I + j\omega\_{\mathcal{S}}(L\_{\mathcal{S}} + L\_I)}\tag{25}$$

$$E\_{th} = \frac{(\mathcal{U}\_{d\text{g}} + j\mathcal{U}\_{\text{fl}\text{g}})(R\_I + j\omega\_{\text{g}}L\_I)}{R\_I + j\omega\_{\text{g}}(L\_{\text{g}} + L\_I)}\tag{26}$$

where, *Udg* and *Uqg* are the *d*-axis and *q*-axis grid voltages *Rl* is the load resistance, and *Ll* is the load inductance. The *Rl* and *Ll* are calculated from the power supplied to the load as follows:

$$R\_{l} = \frac{3}{2} \frac{\mathcal{U}\_{ll}^{2} P\_{l}}{P\_{l}^{2} + \mathcal{Q}\_{l}^{2}}; \quad L\_{l} = \frac{3}{2\omega\_{\mathcal{S}}} \frac{\mathcal{U}\_{ll}^{2} \mathcal{Q}\_{l}}{P\_{l}^{2} + \mathcal{Q}\_{l}^{2}};\tag{27}$$

where, *Ull* is the line-to-line root-mean-square voltage. The active power (*Pl*) and the reactive power (*Ql*) of the load are computed using its relationship with the *d*-axis load voltage (*Udl*) and current (*Idl*) as well as the *q*-axis load voltage (*Uql*) and current(*Iql*), as:

$$P\_l = \frac{3}{2}(\mathcal{U}\_{\rm dl}I\_{\rm dl} + \mathcal{U}\_{\rm ql}I\_{\rm ql});\quad Q\_l = \frac{3}{2}(\mathcal{U}\_{\rm ql}I\_{\rm dl} - \mathcal{U}\_{\rm dl}I\_{\rm ql})\tag{28}$$

The following equations are the d-*q*-axis representation of the grid side load voltages [46].

$$
\hbar L\_{dl} = R\_{th}I\_{di} - \omega\_{\mathcal{g}}L\_{th}I\_{qi} + E\_{thd} \tag{29}
$$

$$
\omega L\_{ql} = R\_{th}I\_{qi} + \omega\_{\mathcal{S}}L\_{th}I\_{di} + E\_{thq} \tag{30}
$$

where, *Rth* represents the Thevenin's resistance, *Lth* is the Thevenin's inductance, *Ethd* and *Ethq* are the Thevenin's voltage in the *d*-axis and *q*-axis, respectively.

**Remark 3.** *When the hybrid microgrid is in standalone mode, Eth* = 0 *and Zth* = *ZL. A robust control law is essential to stabilized the load voltage when the hybrid microgrid is switching between the standalone mode and the grid-connected mode.*

#### *3.7. Overall Model of the Hybrid Microgrid*

To design a controller that can operate in both standalone and grid-connected modes, the dynamic equations of the components of the hybrid microgrid are expressed in state-space form. The system to be controlled is described by (5)–(7), (19)–(21), (23) and (24). It is an eight-order nonlinear MIMO system that has six control inputs and six controlled outputs. The state variables' vector, the inputs' vector, and the controlled outputs' vector are, respectively, defined as *x* = [*ωr*, *Iqs*, *Ids*, *Idi*, *Iqi*, *Ib*, *Vdc*, *SoC*] *T*, *V* = [*Vqs*, *Vds*, *Vdi*, *Vqi*, *D*12, *Igdc*] *<sup>T</sup>*, and *y* = *h*(*x*)=[*ωr*, *Ids*, *Udl*, *Uql*, *Ib*, *Vdc*] *<sup>T</sup>*. The dynamic equations of the hybrid microgrid system can be transformed to state-space model as follows [54]:

$$
\begin{aligned}
\dot{x} &= f(x) + g(x)V \\
y &= h(x)
\end{aligned}
\tag{31}
$$

where

$$f(x) = \begin{bmatrix} f^{-1}P[T\_{\overline{m}} - T\_{\overline{c}}] \\ [\omega\_r L\_d I\_{\overline{s}s} - R\_s I\_{\overline{s}s}] / L\_d \\ [-\omega\_r L\_d I\_{\overline{s}s} - \omega\_r r\_h - R\_s I\_{\overline{s}s}] / L\_q \\ \hline \\ \Pi\_{\text{eff}} / L\_f - \omega\_g I\_{\overline{u}l} \\ \Pi\_{\text{eff}} / L\_f + \omega\_g I\_{\overline{d}l} \\ \hline \\ D\_{12} I\_b / L\_p \\ \eta\_b / Q\_b \end{bmatrix}$$
 
$$g(x) = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 \\ \frac{1}{L\_d} & 0 & 0 & 0 & 0 & 0 \\ 0 & \frac{1}{L\_f} & 0 & 0 & 0 & 0 \\ 0 & 0 & \frac{1}{L\_f} & 0 & 0 & 0 \\ 0 & 0 & 0 & \frac{1}{L\_f} & 0 & 0 \\ 0 & 0 & 0 & 0 & -\frac{V\_{dc}}{L\_f} & 0 \\ 0 & 0 & 0 & 0 & 0 & -\frac{1}{L\_d} \end{bmatrix}$$

The input–output dynamics of the system is obtained by differentiating each output element of *y* with respect to time until at least one control input emerges. It is worth noting that *ω<sup>r</sup>* has been differentiated twice before the input appears, while each of the remaining controlled outputs has been differentiated once. The input–output dynamics is thus:

$$
\begin{bmatrix}
\dot{\boldsymbol{u}}\_{7} \\
\dot{I}\_{ds} \\
\dot{\boldsymbol{U}}\_{dl} \\
\dot{\boldsymbol{U}}\_{dl} \\
\dot{\boldsymbol{I}}\_{b} \\
\dot{\boldsymbol{V}}\_{dc}
\end{bmatrix} = \begin{bmatrix}
\boldsymbol{F}\_{1} \\
\boldsymbol{F}\_{2} \\
\boldsymbol{F}\_{3} \\
\boldsymbol{F}\_{4} \\
\dot{\boldsymbol{V}}\_{dc}
\end{bmatrix} + \begin{bmatrix}
\frac{3\dot{\boldsymbol{p}}^{2}\lambda\_{r}}{2L\_{l}} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} \\
\boldsymbol{0} & \frac{1}{L\_{d}} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} \\
\boldsymbol{0} & \boldsymbol{0} & \frac{R\_{db}}{L\_{f}} & -\frac{\omega\_{p}L\_{db}}{L\_{f}} & \boldsymbol{0} & \boldsymbol{0} \\
\boldsymbol{0} & \boldsymbol{0} & \frac{\omega\_{b}L\_{db}}{L\_{f}} & \frac{R\_{db}}{L\_{f}} & \boldsymbol{0} & \boldsymbol{0} \\
\boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & -\frac{V\_{dc}}{L\_{b}} & \boldsymbol{0} \\
\boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0} & -\frac{1}{L\_{d}}
\end{bmatrix} \begin{bmatrix}
V\_{qs} \\
V\_{ds} \\
V\_{di} \\
V\_{qi} \\
\boldsymbol{I}\_{q1} \\
\boldsymbol{I}\_{q2}
\end{bmatrix} \\
$$

$$= F(\mathbf{x}) + G(\mathbf{x})V \tag{32}$$

where,

$$F\_1 = -\frac{3P^2\Lambda\_r}{2f} [\omega\_r L\_q I\_{qs} - R\_s I\_{ds}] / L\_d \tag{33}$$

$$F\_2 = \left[ -\omega\_r L\_d I\_{ds} - \omega\_r \Lambda\_r - R\_s I\_{qs} \right] / L\_q \tag{34}$$

$$F\_3 = R\_{th}(\omega\_\mathcal{g} I\_{q\bar{q}} - \frac{\mathcal{U}\_{dl}}{L\_f}) - \omega\_\mathcal{g} L\_{th}(-\omega\_\mathcal{g} I\_{di} - \frac{\mathcal{U}\_{q\bar{l}}}{L\_f}) + \mathcal{E}\_{thd} \tag{35}$$

$$F\_4 = R\_{th}(-\omega\_\mathcal{J} I\_{di} - \frac{\mathcal{U}\_{ql}}{L\_f}) - \omega\_\mathcal{J} L\_{th}(\omega\_\mathcal{J} I\_{qi} - \frac{\mathcal{U}\_{dl}}{L\_f}) + \mathcal{E}\_{thq} \tag{36}$$

$$F\_5 = \frac{D\_{12} V\_b}{L\_b} \tag{37}$$

$$F\_{\delta} = \frac{I\_b}{C\_{dc}}\tag{38}$$

The number of differentiation of each output is the relative degree of the output with respect to its input. Therefore, the total relative degree of (32) is 8.

#### *3.8. MPPT Derivation*

#### 3.8.1. Wind Turbine MPPT

AP&O scheme is employed for the MPPT operation of the wind turbine. The maximum power point of the wind turbine (*Ppw*) can be computed as follows [55]:

$$\frac{dP\_w}{d\omega\_r} = 0.5\rho V\_w^3 \frac{dC\_p(\lambda,\beta)}{d\omega\_r} = 0\tag{39}$$

By setting *<sup>β</sup>* <sup>=</sup> 0, *Cp* becomes a function of *<sup>λ</sup>* only. Therefore, *dCp*(*λ*,0) *<sup>d</sup>ω<sup>r</sup>* is obtained as:

$$\frac{d\mathbb{C}\_p}{d\omega\_r} = \frac{d\mathbb{C}\_p}{d\lambda\_i} \times \frac{d\lambda\_i}{d\omega\_r} \tag{40}$$

Equation (39) can be rewritten as:

$$\frac{d\mathbb{C}\_p}{d\omega\_r} = 0.5\rho V\_w^3 \left(\frac{1260}{\lambda\_i^3} - \frac{114.39}{\lambda\_i^2}\right) e^{\frac{-21}{\lambda\_i}} \times \frac{V\_W R}{(V\_w - 0.035 R \omega\_r)^2} \tag{41}$$

From (41), the condition for maximum power is (*Vw* − 0.035*Rωr*) = 0, then the optimal value of the power coefficient (*Cmax <sup>p</sup>* ) and optimum tip speed ratio (*λopt*) are 0.48 and 8.1, respectively.

#### 3.8.2. PV MPPT

A P & O scheme is employed for the MPPT operation of the PV module. The output power from the PV module (*Ppv*) is expressed as:

$$P\_{pv} = I\_{pv} V\_{pv} \tag{42}$$

At MPP, we have [44]:

$$\frac{dP\_{pv}}{dV\_{pv}} = I\_{pv} + V\_{pv}\frac{dI\_{pv}}{dV\_{pv}} = 0\tag{43}$$

Maximum power is extracted from the PV using the formulated MPP, that determines the corresponding DC-link voltage of the PVs. Similarly, the current enhanced centralized power converters enable direct integration of PVs ensuring power quality standard of operation [33].

#### **4. Power Management**

To prevent power shortage and damage of the microgrid components due to excess power, an energy management system is designed to coordinate the power flow between the grid power (*Pb*), *Ppv*, *Pw*, battery power (*Pb*), and the active load demand (*Pl*). The power balance equation for the hybrid microgrid is written as:

$$\text{Grid connected}:\ P\_b + P\_w + P\_{pv} = P\_l + P\_\mathcal{g} \tag{44}$$

$$Standard\ alone:\ P\_b + P\_{w} + P\_{pv} = P\_l\tag{45}$$

It is worth noting that

$$P\_{\mathcal{S}} = \begin{cases} P\_{\mathcal{S}}^{-} < 0 & \text{when receiving power} \\ P\_{\mathcal{S}}^{+} < 0 & \text{when sending power} \end{cases} \tag{46}$$

The net power in the system (*Pnet*) can be computed as:

$$P\_{net} = P\_l + P\_\% - (P\_w + P\_{pv}) \tag{47}$$

The charging and discharging modes of the battery depend on *Pnet*. When *Pnet* < 0, the excess power generated is transferred to the battery (charging mode) provided that *SoC* < *SoCmax*. When *Pnet* > 0, the power shortage is compensated by discharging battery power to the load provided that *SoC* > *SoCmin*, otherwise load shedding is needed to maintain power balance.

#### **5. Control Design**

In this section, the nonlinear MIMO robust control of the hybrid microgrid system is designed. The presented control scheme works satisfactorily even under changing solar irradiation and varying wind speed. The control objectives are outlined as follows:


#### *Calculation of the Reference Signals*

The reference variables for *ωr*, *Ids*, *Udl*, *Uql*, *Ib*, and *Vdc* are set as *ω*<sup>∗</sup> *<sup>r</sup>* , *I*<sup>∗</sup> *ds*, *U*<sup>∗</sup> *dl*, *U*<sup>∗</sup> *ql*, *I*<sup>∗</sup> *b* , and *V*∗ *dc*, respectively. The reference values are calculated as follows [55]:

1. The *ω*∗ *<sup>r</sup>* is computed as follows:

$$
\omega\_r^\* = \frac{\lambda\_{opt} V\_w}{R} \tag{48}
$$

2. The *I*∗ *ds* can be generated as follows: The stator's power factor angle (Θ*s*) must remain zero in order to obtain unity power factor. The PMSG's stator current angle (Θ*I*) and voltage phase angle (Θ*V*) are expressed by the following equations [56]:

$$\Theta\_I = \tan^{-1} \left( \frac{I\_{qs}}{I\_{ds}} \right) \tag{49}$$

$$\Theta\_V = \tan^{-1} \left( \frac{V\_{qs}}{V\_{ds}} \right) = \tan^{-1} \frac{\omega\_r \Lambda\_r - \omega\_r L\_d I\_{ds}}{\omega\_r L\_q I\_{qs}} \tag{50}$$

Subsequently, *I*∗ *ds* is computed such that the following condition is satisfied.

$$
\Theta\_s = \Theta\_V - \Theta\_I = 0 \tag{51}
$$

The value of *I*∗ *ds* is thus:

$$I\_{ds}^{\*} = \frac{\Lambda\_r - \sqrt{\Lambda\_r^2 - 4L\_d L\_q I\_{qs}^2}}{2L\_d} \tag{52}$$


Assuming the GSC is ideal, then the active power along the two sides of the GSC are equal.

$$\begin{split} I\_{\rm gdc} V\_{dc} &= P\_l + P\_\mathcal{g}^- \\ &= \mathcal{U}\_{\rm dl}^\* I\_{\rm dl} + \mathcal{U}\_{\rm ql}^\* I\_{\rm ql} + P\_\mathcal{g}^- \end{split} \tag{53}$$

**Remark 4.** *Note that P*− *<sup>g</sup> is the power received by the grid from the GSC as explained in* (46) *and Igdc is the control input of Vdc.*

From (53), *U*∗ *ql* can be derived as follows:

$$
\Delta I\_{ql}^\* = \frac{I\_{\text{gdc}} V\_{dc} - \mathcal{U}\_{dl}^\* I\_{dl} - P\_{\text{g}}^-}{I\_{ql}} \tag{54}
$$

5. *I*∗ *<sup>b</sup>* is calculated by dividing *Pnet* in (47) with *Vb* as follows:

$$I\_b^\* = \frac{P\_{\text{net}}}{V\_b} \tag{55}$$

6. *V*∗ *dc* is set as the MPPT voltage of the PV module (*V*<sup>∗</sup> *dc* = *<sup>V</sup>max pv* ). However, when the solar irradiance is low, *V*∗ *dc* is set as the nominal voltage of the DC-bus. The nominal value of the DC-bus voltage is calculated as [57]:

$$V\_{dc}^{\*} \geq \frac{1.6\sqrt{2}\,\mathrm{L}\_{II}}{\sqrt{3}m\_{i}}\tag{56}$$

where *mi* is the modulation index.

The tracking errors are given as follows:

$$
\omega\_1 = \omega\_r - \omega\_r^\* \tag{57}
$$

$$c\_2 = I\_{ds} - I\_{ds}^\* \tag{58}$$

$$
\omega\_3 = \mathcal{U}\_{dl} - \mathcal{U}\_{dl}^\* \tag{59}
$$

$$e\_4 = \mathcal{U}\_{ql} - \mathcal{U}\_{ql}^\* \tag{60}$$

$$e\_5 = I\_b - I\_b^\* \tag{61}$$

$$e\_6 = V\_{dc} - V\_{dc}^\* \tag{62}$$

The sliding mode surfaces are defined as:

$$\begin{cases} \zeta\_1 = \mathfrak{e}\_1 + k\_1 \int \mathfrak{e}\_1 dt + \gamma \mathfrak{e}\_1\\ \zeta\_i = \mathfrak{e}\_i + k\_i \int \mathfrak{e}\_i dt, \ \mathfrak{i} = 2, 3, 4, 5, 6 \end{cases} \tag{63}$$

where *ki*, *α<sup>i</sup>* (*i* = 1, 2, ... , 6), and *γ* are positive constants. The time derivative of (63) yields:

$$\begin{cases} \dot{\zeta}\_1 = \ddot{e}\_1 + k\_1 e\_1 dt + \gamma \dot{e}\_1\\ \zeta\_i = \dot{e}\_i + k\_i e\_i dt, \ i = 2, 3, 4, 5, 6 \end{cases} \tag{64}$$

Define the vector *ζ* = [*ζ*1, *ζ*2, *ζ*3, *ζ*4, *ζ*5, *ζ*6] *<sup>T</sup>*. Then, (64) can be evaluated as follows:

$$
\dot{\zeta} = F + GV + \begin{bmatrix}
\end{bmatrix} \tag{65}
$$

The output variables will converge toward their respective sliding mode surfaces and provide the desired steady-state performance by staying on the surfaces provided that

*ζ<sup>i</sup>* = ˙ *ζ<sup>i</sup>* = 0 (*i* = 1, 2, ... , 6). The equivalent control input vector (*Veqv*) can be obtained by canceling the terms on the right-hand side of (65).

$$V\_{\text{cylv}} = -G^{-1}F - G^{-1} \begin{bmatrix} -\bar{\omega}\_r^\* + k\_1\varepsilon\_1 + \gamma\varepsilon\_1\\ -I\_{ds}^\* + k\_2\varepsilon\_2\\ -\bar{\iota}I\_{dl}^\* + k\_3\varepsilon\_3\\ -\bar{\iota}I\_{ql}^\* + k\_4\varepsilon\_4\\ -I\_b^\* + k\_5\varepsilon\_5\\ -\bar{V}\_{dc}^\* + k\_6\varepsilon\_6 \end{bmatrix} \tag{66}$$

Since *det*(*G*(*x*)) = 0, (66) is well defined. In order to compensate the external disturbances and parametric uncertainties, a switching control input vector is given by:

$$V\_{sw} = -G^{-1}a\operatorname{Sign}(a)\tag{67}$$

where *α* = *diag*(*α*1, *α*2, *α*3, *α*4, *α*5, *α*6) is a positive definite diagonal matrix, and *Sign*(*ζ*) = *sign*(*ζ*1), *sign*(*ζ*2), *sign*(*ζ*3), *sign*(*ζ*4), *sign*(*ζ*5), *sign*(*ζ*6) *T* .

The robust control input vector is given by:

$$\begin{split} V &= V\_{\text{cpv}} + V\_{\text{sw}} \\ &= V\_{\text{cpv}} - G^{-1} \alpha \operatorname{Sign}(\alpha) \end{split} \tag{68}$$

Figure 3 illustrates the RSC control for MPPT performance of the wind turbine and wind power transfer with unity power factor. The GSC control scheme has a cascaded control structure as shown in Figure 4. It consists of an outer DC-bus voltage controller and an inner loop *Uql* controller to provide the pulse width modulation signals to the GSC. Additionally, *Udl* is controlled through the GSC. Figure 5 depicts the control scheme for the ESS buck/boost converter. The controller adjusts the duty cycle of the buck/boost converter for charging/discharging operation of the ESS to balance the power.

**Figure 3.** Control diagram of the RSC.

**Figure 4.** Control diagram of the GSC.

**Figure 5.** Control diagram of the buck/boost converter.

The state trajectories of the hybrid microgrid system achieves asymptotic convergence based on the sliding mode surfaces (63) and the robust control inputs (68).

**Proof.** Consider the following candidate Lyapunov function:

$$L = \frac{1}{2} \zeta^T \mathbb{S} \tag{69}$$

The time derivative of *L* yields:

$$L = \mathbb{S}^{T}\mathbb{S}\tag{70}$$

By substituting (65) and (68) into (70), the following equation is obtained.

$$L = -\mathbb{J}^T \mathfrak{a} \dot{\mathfrak{S}} \mathfrak{g} n(\mathbb{Q}) \tag{71}$$

Taking the norm of (71) gives:

$$L \le -||a||.||\zeta||\tag{72}$$

Therefore, the closed-loop system is asymptotically stable.

#### **6. Simulation Results**

The hybrid microgrid system was developed on Matlab/Simulink environment using a time-domain simulation model. The harmonic effects of the converter have not been considered in this study. The system comprises of a number of PV module arranged in series and parallel to obtain a considerable output power of 1.2 MW, a nonsalient pole variable speed PMSG with rated power of 2.45 MW is deployed as the generator, and a li-ion battery is employed as the ESS. A discharging constraint of 10% < *SoC* and charging constraint of *SoC* < 90% is employed to restrict ESS degradation [58,59]. The parameters of the renewable generators and ESS are given in Tables 1 and 2, respectively.

**Table 1.** Parameters of the renewable generation system [44,60].


The performance of the proposed controller is evaluated based on external and internal disturbances experienced in the HRES. The variations in renewable power and load demand are considered as the external disturbances and the internal disturbances includes a parametric uncertainty of ±40% that is introduced into the nominal parameters of the HRES components namely, on *J*, Λ*r*, *Rb*, *Cdc*, and *Lf* . The controller gains are chosen as

*K*<sup>1</sup> = *K*<sup>2</sup> = 10, *K*<sup>3</sup> = 8, *K*<sup>4</sup> = 20, *K*<sup>5</sup> = 12 and *K*<sup>6</sup> = 50, *α*<sup>1</sup> = 2, *α*<sup>2</sup> = 3, *α*<sup>3</sup> = *α*<sup>4</sup> = 5, and *α*<sup>6</sup> = 15.


**Table 2.** Grid and energy storage parameters.

Two case studies have been investigated. In case 1, a random wind speed profile, a constant solar irradiation level and load variation are considered. In case 2, step changing wind speed profile, varying solar irradiation, and load variation are considered.

#### *6.1. Case 1: Random Wind and Fixed Solar with Varying Load*

The wind speed comprises of a random profile (Figure 6), 1000 W/m2 solar irradiance is fixed (Figure 7). Figure 8 depicts the optimal tracking performance of the rotor speed. It can be seen that the proposed controller closely tracks the optimal rotor speed calculated by the MPPT so that maximum power is produced by the PMSG. The response of the *d*-axis stator current for unity power factor operation is depicted in Figure 9. The DC-bus is receiving contribution from the solar PV, the wind power generator, and the ESS. The response of the DC-bus voltage together with the reference value which is the same as the MPPT voltage of the solar PV is shown in Figure 10. The controller can keep the DC-bus voltage stable and very close to the reference value despite the variation of the wind power, the ESS power, and the load demand.

As shown in Figure 11, an increment in the load demand at *t* = 10 s is experienced that rises from 2 MW to 2.8 MW, and further decreases to 1.9 MW at *t* = 20 s. The grid is receiving and sending power at 0 s < *t* ≤ 9 s and 30 s < *t* ≤ 40 s, respectively, and the hybrid microgrid is off-grid at 9 s < *t* ≤ 30 s. In order to maintain the power flow, the battery is charging to store the excess power at 0 < *t* ≤ 10 s and 20 s < *t* ≤ 30 s. Similarly, the battery is discharging to the load at 10 s < *t* ≤ 20 s and 30 s < *t* ≤ 40 s. Figure 12 indicates that the battery is charging/discharging according to the desired level to balance the power in the microgrid within the acceptable SoC limit. An increment in load voltage is experienced at *t* = 9 s due to off-grid operation of the HRES during power receiving mode and at *t* = 20 s due decrease in load demand. Similarly, the load voltage decreases at *t* = 10 s due to the increase in the load demand and at *t* = 30 s due to connection of the grid to the HRES during the power transferring mode (Figures 13 and 14).

**Figure 6.** Case 1: Random wind speed profile.

**Figure 7.** Case 1: Constant solar irradiation.

**Figure 8.** Case 1: Rotor speed.

**Figure 9.** Case 1: *d*-axis stator current.

**Figure 10.** Case 1: DC-bus voltage.

It can be observed that the controller can restore the load voltage to the desired level regardless of the load demand variations and at the transition intervals of the HRES between the standalone and grid-connected modes. Moreover, the controller keeps *Uql* close to zero to minimize the reactive power. The transition of the system from islanded to grid-connected mode and vice-versa are smooth due to the robustness and accuracy of the proposed controller.

**Figure 11.** Case 1: Power flow.

**Figure 12.** Case 1: The battery current (**above**) and the SoC (**below**).

**Figure 13.** Case 1: *d*-axis load voltage.

**Figure 14.** Case 1: *q*-axis load voltages.

#### *6.2. Case 2: Step Change in Wind and Solar with Varying Load*

In this case, a step changing wind speed profile and solar irradiance level are considered. As depicted in Figure 15, the wind speed rises from 7.7 m/s to 9.2 m/s, 11 m/s and finally decreases to 10.1 m/s at *t* = 8, 15 and 22 s, respectively. The solar irradiance level decreases from 1000 W/m<sup>2</sup> to 965 W/m2, 933 W/m2 and finally increases to 1000 W/m<sup>2</sup> at *t* = 10 s, 15 s and 20 s, respectively (Figure 16). The rotor speed follows the desired speed under varying wind conditions (Figure 17), which indicates that the PMSG is rotating at the optimal speed computed by the MPPT algorithm ensuring maximum power generation under variable wind speed. The *d*-axis stator current tracks the desired current accurately as depicted in Figure 18, that allows wind power transfer with a unity power factor. Furthermore, results obtained using PI controller is also presented in this section. The comparative analysis highlights the performance between the proposed controller and benchmark PI control technique [33] based on the calculated optimal values of *ωr*, *Ids*, *Vdc*, *Ib*, *Udl*, and *Uql*.

**Figure 15.** Case 2: Random wind speed profile.

**Figure 16.** Case 2: Varying solar irradiation.

**Figure 17.** Case 2: Rotor speed.

**Figure 18.** Case 2: *d*-axis stator current.

The irradiance level falls to 965 W/m2 and 933 W/m<sup>2</sup> at 10 <sup>s</sup> < *<sup>t</sup>* ≤ <sup>20</sup> s. During this interval, the PV MPPT voltage also falls, and thus the reference DC-bus voltage is set as the nominal value instead of the PV MPPT voltage to maintain a constant DC-bus voltage. It can be observed that the proposed controller keeps the DC-bus voltage stable and constant value under varying PV power, wind power, and load demand as depicted in Figure 19. The load demand profile is similar to case 1 as shown in Figure 20. The utility grid is receiving power at 0 < *t* ≤ 9 s and sending power at 9 s < *t* ≤ 20 s and 30 s < *t* ≤ 40 s. The HRES is off-grid at 20 s < *t* ≤ 30 s. When 0 s < *t* ≤ 9 s and 20 s < *t* ≤ 30 s, the surplus power is transferred to the battery. When 9 s < *t* ≤ 20 s, the battery is unable to cover the power deficit as the maximum power it can safely deliver is 1 MW. As a result, 0.9 MW of the load demand is shedded for protecting the battery and maintain the power balance of the HRES.

Figure 21 describes that the ESS is charging/discharging in accordance with the demand to balance the microgrid. Accordingly, the power flow is balanced and no power is transferred into or out of the battery and its SoC remains constant (60%) at 30 s < *t* ≤ 40 s. The load voltage is kept at a constant level by the proposed controller as depicted in Figures 22 and 23. In addition, *Uql* converges to zero, thereby minimizing the reactive power. It can be observed that the effects of varying load demand, grid transition from power receiving mode to power transferring mode, and grid transition from islanded mode to grid-connected mode and vice versa are mitigated by the proposed controller.

The performance of the benchmark PI controller proves to have an acceptable performance under external disturbances. The performance of the PI controller in this condition is compared with that of the proposed robust sliding mode controller. The analytical results are depicted in Figures 17–23. It can be observed that the responses of the proposed controller in following the reference signals are quite satisfactory as they reach them in 0.90 s, 0.63 s, 1.02 s, 0.04 s, 0.88 s, and 0.63 s for *ωr*, *Ids*, *Vdc*, *Ib*, *Udl*, and *Uql*, respectively. However, the responses under PI controller have comparatively higher overshoots, undershoots, and longer settling time highlighting the effectiveness of the proposed controller.

**Figure 19.** Case 2: DC-bus voltage.

**Figure 20.** Case 2: Power flow.

**Figure 21.** Case 2: Battery current.

**Figure 22.** Case 2: *d*-axis load voltage.

**Figure 23.** Case 2: *q*-axis load voltage.

#### **7. Conclusions**

This paper presented an integrated control and power management of a hybrid renewable energy system (HRES) under different external generation/load disturbances and internal parameter uncertainties for both standalone and grid-connected operational modes. The HRES consists of solar PV, wind energy source, and battery. The proposed robust sliding mode control successfully achieves maximum power point tracking (MPPT) for both the solar PV and wind energy sources while regulating the load voltages and maintaining the DC-bus voltage at 1.5 kV. The stability and convergence of the closedloop system have been guaranteed using the Lyapunov candidate function. Furthermore, a comparative analysis is presented with a conventional PI-based controller. The results obtained highlight a significantly improved robustness and better power management in terms of overshoot and settling time with enhanced tracking capability towards the calculated optimal operation of the HRES. Furthermore, as the control theory has low complexity it can be extended to include different types of renewable energy sources and the power quality of the HRES can be further enhanced by including the hybrid energy storage systems as auxiliary support.

**Author Contributions:** Conceptualization, M.M., K.K. and M.K.; data curation, M.M.; formal analysis, M.M., K.K. and M.K.; funding acquisition, M.K.; investigation, M.M. and K.K.; methodology, M.M. and K.K.; project administration, M.K.; resources, M.K.; software, K.K.; supervision, M.K.; validation, M.M., K.K. and M.K.; visualization, M.K.; writing—original draft, M.M. and M.K.; writing review and editing, K.K. and M.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Deanship of Research Oversight and Coordination (DROC) at King Fahd University of Petroleum and Minerals (KFUPM) through project No. DF191011. The authors would also like to acknowledge the support provided by the King Abdullah City for Atomic and Renewable Energy (K.A. CARE).

**Acknowledgments:** The authors would like to acknowledge the support provided by the Deanship of Research Oversight and Coordination (DROC) at King Fahd University of Petroleum and Minerals (KFUPM) for funding this work through project No. DF191011. In addition, we would like to acknowledge the funding support provided by the King Abdullah City for Atomic and Renewable Energy (K.A.CARE).

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Abbreviations**

The following abbreviations are used in this manuscript:




#### **References**

