*Article* **Resilient Networked Control of Inverter-Based Microgrids against False Data Injections**

**Mohammad Reza Khalghani 1,\*, Vishal Verma <sup>2</sup> , Sarika Khushalani Solanki <sup>2</sup> and Jignesh M. Solanki <sup>2</sup>**


**Abstract:** Inverter-based energy resource is a fast emerging technology for microgrids. Operation of micorgrids with integration of these resources, especially in an islanded operation mode, is challenging. To effectively capture microgrid dynamics and also control these resources in islanded microgrids, a heavy cyber and communication infrastructure is required. This high reliance of microgrids on cyber interfaces makes these systems prone to cyber-disruptions. Hence, the hierarchical control of microgrids, including primary, secondary, and tertiary control, needs to be developed to operate resiliently. This paper shows the vulnerability of microgrid control in the presence of False Data Injection (FDI) attack, which is one type of cyber-disruption. Then, this paper focuses on designing a resilient secondary control based on Unknown Input Observer (UIO) against FDI. The simulation results show the superior performance of the proposed controller over other standard controllers.

**Keywords:** inverter-based energy resources; islanded microgrids; networked control systems; resilient control design; secondary control; false data injection

#### **1. Introduction**

Due to the environmentally friendly characteristics of renewable energies and distributed energy resources, integrating these energy resources into distribution grids is growing significantly. There is an ongoing shift of system configuration from traditional distribution grids to small distributed and controllable microgrids. Microgrids can locally supply loads through distributed energy resources that include renewable energy resources and operate in grid-connected and islanded modes. Islanded mode of operation allows the microgrid to provide energy without the support of the main grid, which is critically important when the main grid cannot exchange energy with other local microgrids, such as during natural hazards and extreme weather events.

Sustaining the islanded operation of microgrids is challenging since the grid relies on a limited number of energy resources. This challenging task can be addressed by utilizing hierarchical control methods comprised of primary, secondary, and tertiary controls [1]. The primary control response is the immediate regulation of power output by the governor or electronic controller in response to changes in the grid frequency. Considering the limited capability of the primary control loop to address frequency changes, it is necessary to design the secondary control to control the grid dynamics [2]. Secondary control is a supervisory control that utilizes measurements communicated through cyber systems to capture and control fast microgrid dynamics. Hierarchical control can coordinate inverter-based energy resources to effectively track the sudden load changes and nondispatchable generators. Tertiary control focuses on optimal power flow between the main grid and microgrids, which is not within the scope of this paper.

**Citation:** Khalghani, M.R.; Verma, V.; Khushalani Solanki S.; Solanki, J.M. Resilient Networked Control of Inverter-Based Microgrids against False Data Injections. *Electronics* **2022**, *11*, 780. https://doi.org/10.3390/ electronics11050780

Academic Editor: Carlos Andrés García-Vázquez

Received: 31 January 2022 Accepted: 15 February 2022 Published: 3 March 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/).

Since the secondary control heavily relies on communications and cyber infrastructures in a closed control loop, it can be labeled as a networked control system [3]. Similar to all networked control systems, the secondary control of microgrids is vulnerable to cyber threats. Although there is a wide variety of cyberattacks, more common types are Denial-of-Service (DoS) and False Data Injection (FDI). The DoS targets the availability of machines or networks to temporarily or indefinitely distort the service to its intended users. The FDI manipulates the data exchanges throughout the network, which misleads the control center and disturbs the system operation [3,4].

Many researchers proposed a secure secondary control for microgrids. In [5], the authors review cybersecurity threats and introduce cyber attack prevention, detection, and response measures for the integration of inverter-based resources to grids. Researchers in [6] focus on the security of distributed secondary control of microgrids by proposing a Weighted Mean Subsequence Reduced algorithm at each inverter-based resource. A distributed secondary control based on a consensus algorithm is proposed to control the frequency of an islanded microgrid in [7]. Another distributed control strategy was developed in [8] where the authors designed a resilient control against cyber attacks on communication links, local controllers, and master controllers of microgrids. Also, researchers in [9] proposed a distributed control strategy based on blockchain to enhance cyber vulnerability of microgrids equipped with distributed energy resources. [10] constructs an attack detector based on the stable kernel representation of an islanded microgrid. A resilient secondary control method is proposed in [11] that mitigates Denial-of-Service (DoS) attacks from inverter-based microgrids. This proposed control method is mode-dependent and assumes that the random DoS attack follows a homogeneous Markov process. Another distributed control method is developed for islanded microgrids in [12] to secure the system from malicious attacks on the communication network, including links and nodes. The authors in [13] present secondary control for energy storage systems to control the frequency and voltage of an islanded microgrid. This control strategy uses an event-trigger scheme to lower the communication burden in the network. Most research work does not focus on inverter-based microgrids and additionally does not focus on a resilient controller that considers fast dynamics, especially under cyber disruptions.

This paper focuses on designing a resilient secondary controller against false data injection for an islanded microgrid equipped with inverter-based energy resources. The rest of the paper is organized as follows. Section 2 presents a general model for inverter-based microgrid model. The proposed secondary controller based on Unknown Input Observer (UIO) is described in Section 3. A vulnerability analysis of the islanded microgrid against FDI is elaborated in Section 4. Simulation and results are demonstrated in Section 5, and the conclusion is presented in Section 6.

#### **2. Model of Inverter-Based Microgrids**

This section introduces the inverter-based microgrid model equipped with primary control. Also, this section proposes the optimal resilient secondary control for the islanded microgrid.

#### *2.1. The Microgrid State-Space Representation*

This islanded microgrid model includes three major elements of inverters, grid topology, and loads. Inverters dynamics cover output filter, coupling inductor, power-sharing controller, and current and voltage controllers. Each inverter has a separate reference frame, e.g., axis (*d* − *q*)*<sup>i</sup>* for *i*th inverter, whose rotating frequency *ω<sup>i</sup>* is tuned by its powersharing controller. Rotating frequency *ωcom* denotes the reference frame of one of the microgrid inverters. A common reference frame with axis (*d* − *q*)*<sup>i</sup>* and rotating frequency *ωcom* characterize the loads and the network's dynamic equations. Through the following transformation matrix, other inverters' reference frames are translated to the common reference frame [14]:

$$\left[f\_{DQ}\right] = \left[T\_i\right]\left[f\_{dq}\right] \tag{1}$$

$$\begin{bmatrix} T\_i \end{bmatrix} = \begin{bmatrix} \cos(\delta\_i) & -\sin(\delta\_i) \\ \sin(\delta\_i) & \cos(\delta\_i) \end{bmatrix} \tag{2}$$

where *δ<sup>i</sup>* is the angle of the reference frame of *i*th inverter with respect to the common reference frame. In this paper, all inverters are Voltage Source Inverters (VSI) which are usually applied to interface distributed generators (DGs) to grids.

#### 2.1.1. VSI State-Space Model

Figure 1 shows that the DG inverter control process has three different parts, such as voltage, current, and power control loops. The power control loop regulates the magnitude and frequency for the fundamental component of the inverter's voltage according to the droop characteristic set for the active and reactive powers. Voltage and current controllers are utilized to eliminate high-frequency disturbances and obtain proper damping for the output *LC* filter [14,15]. Since frequency control of this islanded microgrid is within the scope of this paper, we only describe the VSI power controller (not voltage and current controllers). The detailed model can be learned from [14,16].

**Figure 1.** General diagram of DG inverter connected to Microgrids [14].

Utilizing the droop control for DG inverters, we mimic the governor behavior of synchronous generators in power systems. When there is a load rise, the microgrid frequency is reduced. Besides, when there is a voltage decrease, the reactive power is regulated proportionally. The power control diagram of VSIs is shown in Figure 2. Examining Figure 2, instantaneous active *p*˜ and reactive power *q*˜ are provided from the measured current and voltage in (*d* − *q*) frame as in (3) and (4):

$$
\mathfrak{p} = \upsilon\_{od} i\_{od} + \upsilon\_{oq} i\_{oq} \tag{3}
$$

$$
\mathfrak{q} = \upsilon\_{od} i\_{oq} + \upsilon\_{oq} i\_{od} \tag{4}
$$

Also, these instantaneous power elements are passed through low-pass filters with *ω<sup>c</sup>* cut-off frequency to obtain the fundamental real and reactive power as in (5) and (6):

$$P = \frac{\omega\_c}{s + \omega\_c} \not p \tag{5}$$

$$Q = \frac{\omega\_c}{s + \omega\_c} \tilde{q} \tag{6}$$

**Figure 2.** External power controller diagram of DG inverter [14].

The artificial droop can share active and reactive powers in the inverter frequency. As seen in (7), the frequency *ω* is set based on the droop coefficient *mp*, and the phase *θ* is set by the frequency integration. *ω<sup>n</sup>* indicates the nominal frequency set-point, and *α* indicates the inverter reference frame angle with nominal rotating frequency *ω<sup>n</sup>* [14]:

$$\begin{aligned} \omega &= \omega\_{\text{ll}} - m\_p P \\ \dot{\theta} &= \omega\_{\text{\prime}} \qquad \theta = \omega\_{\text{\prime}} t - \int m\_p P dt \\ \dot{\kappa} &= -\int m\_p P dt \qquad \dot{\kappa} = -m\_p P \end{aligned} \tag{7}$$

Similar to active power, an artificial droop is used to share reactive power through specifying the output voltage magnitude, which is set to the *d*-axis of the inverter reference frame (the *q*-axis reference is set to zero) as in (8):

$$
v\_{od}^{\*} = V\_{\text{n}} - \eta\_{q} Q\_{\text{\prime}} \qquad v\_{oq}^{\*} = 0 \tag{8}$$

The droop coefficients *m<sup>p</sup>* and *n<sup>q</sup>* are provided using the maximum and minimum limits of frequency and voltage magnitude as :

$$m\_p = \frac{\omega\_{\text{max}} - \omega\_{\text{min}}}{P\_{\text{max}}}, \qquad n\_q = \frac{V\_{\text{odmax}} - V\_{\text{odmin}}}{Q\_{\text{max}}} \tag{9}$$

As expressed earlier, one of the inverters' reference frames is picked as the common frame to build-up the complete model on a common reference frame. An angle *δ* is specified for each inverter as in (10) to transfer the variables of other inverters into the common reference frame:

$$
\delta\_{\dot{i}} = \int (\omega\_{\dot{i}} - \omega\_{\text{com}}) \qquad \Delta \delta\_{\dot{i}} = \Delta \omega\_{\dot{i}} - \Delta \omega\_{\text{com}} = \Delta \omega\_{\text{nil}} - \Delta \omega\_{n1} - \left(m\_{i}\Delta \mathbf{P}\_{i} - m\_{1}\Delta \mathbf{P}\_{1}\right) \tag{10}
$$

where *ωni* denotes the rated frequency set-point for each inverter [17]. As seen in (10), all inverter angle dynamics ∆˙*δ<sup>i</sup>* are a function of the first inverter active power ∆*P*1. After considering dynamics of voltage and current controllers and reorganizing all equations, the combined small-signal model for "*s*" number of DG inverters on a common reference frame is as in (11) and (12):

$$\left[\Delta\dot{\mathbf{x}}\_{INV}\right] = A\_{INV}\left[\Delta\mathbf{x}\_{INV}\right] + B\_{INV}\left[\Delta\mathbf{v}\_{bDQ}\right] + B\_{com}\left[\Delta\omega\_{com}\right] + B\_n\left[\Delta\omega\_n\right] \tag{11}$$

$$\begin{bmatrix} \Delta i\_{oDQ} \end{bmatrix} = \mathbf{C}\_{INVn} \begin{bmatrix} \Delta \mathfrak{x}\_{INV} \end{bmatrix} \tag{12}$$

where [∆*xINV*] = [∆*xinv*<sup>1</sup> ∆*xinv*<sup>2</sup> ... ∆*xinvs*] and [∆*ωn*] = [∆*ωn*<sup>1</sup> ∆*ωn*<sup>2</sup> ... ∆*ωn*3].

#### 2.1.2. Network Model

It is assumed that the islanded microgrid here has *n* lines, *m* nodes, *s* inverters, and *p* loads, as shown in Figure 3. The dynamic equations of line current of *i*th line connected between nodes *j* and *k* on the common reference frame are obtained as (13) and (14) [14]:

$$\frac{d\mathbf{i}\_{\rm line\,Di}}{dt} = \frac{-r\_{\rm line\,i}}{L\_{\rm line\,i}}\mathbf{i}\_{\rm line\,Di} + \omega\mathbf{i}\_{\rm line\,Q\,i} + \frac{1}{L\_{\rm line\,i}}v\_{b\,D\,j} - \frac{1}{L\_{\rm line\,i}}v\_{b\,D\,k} \tag{13}$$

$$\frac{d\dot{l}\_{\rm lineQi}}{dt} = \frac{-r\_{\rm linei}}{L\_{\rm linei}}\dot{i}\_{\rm lineQi} - \omega \dot{v}\_{\rm lineDi} + \frac{1}{L\_{\rm linei}}v\_{b\rm Qj} - \frac{1}{L\_{\rm linei}}v\_{b\rm Qk} \tag{14}$$

Therefore, the small-signal state-space representation of the microgrid is obtained as in (15):

$$\left[\Delta \dot{i}\_{lineDQ}\right] = A\_{NET}\left[\Delta \dot{i}\_{lineDQ}\right] + B\_{1NET}\left[\Delta v\_{bDQ}\right] + B\_{2NET}\Delta \omega \tag{15}$$

**Figure 3.** Network topology of inverter-based microgrid model [14].

#### 2.1.3. Load Model

The dynamic equation for the resistive and inductive load connected at the *i*th node is obtained in (16):

$$\frac{d\mathbf{i}\_{load\text{Di}}}{dt} = \frac{-\mathbf{R}\_{load\text{Di}}}{L\_{load\text{Di}}}\mathbf{i}\_{load\text{Di}} + \omega\mathbf{i}\_{load\text{Qi}} + \frac{1}{L\_{load\text{Di}}}\mathbf{v}\_{b\text{Di}}\tag{16}$$

$$\frac{d\mathbf{i}\_{load\mathbf{Q}i}}{dt} = \frac{-\mathbf{R}\_{load\mathbf{i}}}{L\_{load\mathbf{i}}}\mathbf{i}\_{load\mathbf{Q}i} - \omega\mathbf{i}\_{load\mathbf{D}i} + \frac{1}{L\_{load\mathbf{i}}}v\_{b\mathbf{Q}i} \tag{17}$$

Therefore, the small-signal state-space representation of loads is generally obtained as in (18):

$$\mathbf{A} \left[ \dot{\Delta i}\_{loadDQ} \right] = A\_{load} \left[ \Delta i\_{loadDQ} \right] + B\_{1LOAD} \left[ \Delta v\_{bDQ} \right] + B\_{2LOAD} \Delta \omega \tag{18}$$

#### 2.1.4. Complete Microgrid Model

The microgrid model is obtained by augmenting all these modules of VSI inverters, network lines, and loads together as in (19):

$$\begin{cases} \begin{bmatrix} \Delta \mathbf{x}\_{INV} \\ \Delta \mathbf{x}\_{Net} \\ \Delta \mathbf{x}\_{Load} \end{bmatrix} = A \begin{bmatrix} \Delta \mathbf{x}\_{INV} \\ \Delta \mathbf{x}\_{Net} \\ \Delta \mathbf{x}\_{Load} \end{bmatrix} + B[\Delta \boldsymbol{\omega}\_{\boldsymbol{n}}] + Dd(t) = A\mathbf{x}(t) + Bu(t) = Dd(t) \\ y = \mathbf{C}\mathbf{x}(t) + v(t) \end{cases} \tag{19}$$

where *A*, *B* are microgrid characteristic matrices and [17] can be referred for more information. With this microgrid's state-space model, we can design an optimal secondary control for this system and enhance the primary control performance.

#### *2.2. Secondary Control of the Inverter-Based Microgrid*

To apply an optimal control based on Linear Quadratic Regulator (LQR), we need to ensure the pair (*A*, *B*) is controllable; otherwise, designing such controllers for this system is not possible. However, this system is not controllable since the small-signal transient, and the steady-state responses obtained from the first state <sup>∆</sup>*δ*<sup>1</sup> is zero (∆˙*δ*<sup>1</sup> <sup>=</sup> <sup>∆</sup>*ω*<sup>1</sup> <sup>−</sup> <sup>∆</sup>*ωcom* <sup>=</sup> 0) [18]. Therefore, this state must be skipped by removing the corresponding row and column in *A* and *B* or using the minimum realization technique for this system. After making the reduced-order model, we can utilize the LQR controller on the microgrid model. The microgrid eigenvalues with and without the state corresponding to ∆*δ*<sup>1</sup> are shown in Table 1.


**Table 1.** Eigenvalues of the microgrid (*A* matrix).

#### **3. The Proposed Control Method**

Standard controllers based on observes apply the entire grid states for the estimation and control procedure. Frequency deviation ∆*f* , which is one of the states in microgrid model, reflects frequency distortion because of intermittent behavior of renewable energy sources, loads, and any cyber anomalies in the system. Secondary controllers are often designed to guarantee the frequency stability of grids. We utilize a combined UIO and LQR controllers formed in two layers to control the microgrid . The first layer estimates the microgrid states and detects the UIs using (19). The second layer decreases the frequency discrepancy using (30)–(32).

#### *3.1. Design of Unknown Input Observer*

In UIO, the states *x*(*k*) = - *x*<sup>1</sup> *x*<sup>2</sup> *T* are separated into two groups of states: states corresponding to known inputs, *x*1(*k*) and states corresponding to unknown inputs, *x*2(*k*) [19]. Here, *x*2(*k*) state indicates the frequency discrepancy ∆*f*(*k*) subject to the UI. Now, we can independently estimate both groups of states, including *x*1(*k*) and *x*2(*k*) = ∆*f* , and ultimately and identify the UI. In this case, the frequency deviation ∆*f*(*k*) does not distort the state estimation as well as the frequency regulation of the microgrid. For separating the states to two groups, a nonsingular matrix Ψ = - *N D* is determined where *<sup>N</sup>* is the arbitrary matrix selected such that <sup>Ψ</sup> is cannot be singular (*<sup>N</sup>* <sup>∈</sup> <sup>R</sup>*n*(*n*−*q*) ) [20]. This transition matrix Ψ is multiplied to both sides of (19) to obtain its equivalent representation (20). Using this representation, we obtain another model representation *x* = - *x*<sup>1</sup> *x*<sup>2</sup> *<sup>T</sup>* = Ψ−1*x* = Ψ−<sup>1</sup> - *x*<sup>1</sup> *x*<sup>2</sup> *<sup>T</sup>* with *<sup>x</sup>*<sup>1</sup> <sup>∈</sup> <sup>R</sup>*n*−*<sup>q</sup>* and *<sup>x</sup>*<sup>2</sup> <sup>∈</sup> <sup>R</sup>*<sup>q</sup>* , and new constant characteristic matrices specified in (21):

$$\begin{cases} \overline{\mathfrak{x}}(k+1) = \overline{A}\overline{\mathfrak{x}}(k) + \overline{B}u(k) + \overline{D}d(k) + w(k) \\ y(k) = \overline{C}\overline{\mathfrak{x}}(k) + v(k) \end{cases} \tag{20}$$

$$
\overline{A} = \begin{bmatrix} \overline{A}\_{11} & \overline{A}\_{12} \\ \overline{A}\_{21} & \overline{A}\_{22} \end{bmatrix} = \Psi^{-1} A \Psi, \quad \overline{B} = \begin{bmatrix} \overline{B}\_{1} & \overline{B}\_{2} \end{bmatrix}^{T} = \Psi^{-1} B,\tag{21}
$$

$$
\overline{D} = \Psi^{-1} D, \qquad \overline{\mathbb{C}} = \mathbb{C} \Psi = \begin{bmatrix} \mathbb{CN} & \mathbb{CD} \end{bmatrix}
$$

Further, the states *x*2(*k*) subject to the UI are eliminated to find microgrid model free from unknown input as in (22) [20]:

$$\begin{cases} \begin{bmatrix} I\_{n-q} & 0 \end{bmatrix} \overline{\boldsymbol{x}}(k+1) = \begin{bmatrix} \overline{A}\_{11} & \overline{A}\_{12} \end{bmatrix} \overline{\boldsymbol{x}}(k) + \overline{B}\_{1} \boldsymbol{u}(k) \\ \boldsymbol{y}(k) = \begin{bmatrix} \boldsymbol{CN} & \boldsymbol{CD} \end{bmatrix} \overline{\boldsymbol{x}}(k) + \boldsymbol{\upsilon}(k) \end{cases} \tag{22}$$

Assuming *x*2(*k*) can be attained from the measurement output *y*(*k*), (22) can be reorganized to a linear representation. The transfer matrix *U* = [*CD* Γ] is comprised of *CD*, which is a full-column rank matrix, and <sup>Γ</sup> <sup>∈</sup> <sup>R</sup>*m*×(*m*−*q*) , which is an arbitrary matrix defined such that *U* is a nonsingular matrix. Therefore, we have *U*−<sup>1</sup> = [*U*<sup>1</sup> *<sup>U</sup>*2] *<sup>T</sup>* with *<sup>U</sup>*<sup>1</sup> <sup>∈</sup> <sup>R</sup>*q*×*<sup>m</sup>* and *<sup>U</sup>*<sup>2</sup> <sup>∈</sup> <sup>R</sup>(*m*−*q*)×*m*. If the measurement equations in (22) is multiplied by *<sup>U</sup>*−<sup>1</sup> , we obtain (23) and (24):

$$\mathcal{U}\_1 y(k) = \mathcal{U}\_1 \text{CN} \overline{\mathbf{x}}\_1(k) + \overline{\mathbf{x}}\_2(k) \tag{23}$$

$$\mathcal{U}\_2 \mathcal{Y}(k) = \mathcal{U}\_2 \text{CN} \mathbb{F}\_1(k) \tag{24}$$

Substituting (23) in (22) and merging it with (24), we obtain (25) with revised state matrix of *A*e = *A*<sup>11</sup> − *A*12*U*1*CN*, modified measurement matrix *C*e = *U*2*CN*, modified measurement vector *y*(*k*) = *U*2*y*(*k*), and *E* = *A*12*U*1:

$$\begin{cases} \overline{\mathbf{x}}\_1(k+1) = \widetilde{A}\overline{\mathbf{x}}\_1(k) + \overline{B}\_1 u(k) + E y(k) + w\_1(k) \\ \overline{y}(k) = \widetilde{C}\overline{\mathbf{x}}\_1(k) + v\_1(k) \end{cases} \tag{25}$$

A Luenberger observer can be developed for this microgrid, in case the pair (*A*e, *C*e) is observable. The observability conditions of this microgrid is reviewed in [20]. The

Luenberger observer with *<sup>L</sup>* <sup>∈</sup> <sup>R</sup>(*n*−*q*)×(*m*−*q*) for *x*1(*k*) is designed as in (26) to estimate *x*1(*k*) with *x*ˆ <sup>1</sup> <sup>∈</sup> <sup>R</sup>*n*−*<sup>q</sup>* :

$$
\hat{\mathfrak{X}}\_1(k+1|k) = (\widetilde{A} - L\widetilde{\mathbb{C}})\hat{\mathfrak{X}}\_1(k|k-1) + \overline{B}u(k) + L^\*\overline{\mathfrak{y}}(k) \tag{26}
$$

where *L* <sup>∗</sup> = *LU*<sup>2</sup> + *E* and the Luenberger observer coefficient matrix *L* is calculated from solving the discrete Riccati equation *L* = (*AP*1*C T* )(*CP*1*C <sup>T</sup>* + *Q*<sup>1</sup> + *R*1). Also, *P*<sup>1</sup> solves the algebraic Riccati equation that reduces the steady-state error covariance *P*<sup>1</sup> = lim *k*→∞ *<sup>E</sup>*[(*x*<sup>1</sup> <sup>−</sup> *<sup>x</sup>*<sup>ˆ</sup> <sup>1</sup>)(*x*<sup>1</sup> <sup>−</sup> *<sup>x</sup>*<sup>ˆ</sup> 1) *T* ]. Now, all estimated states can be found in (27) using (23) and (26):

$$
\hat{\mathfrak{X}}(k|k) = \Psi \hat{\mathfrak{X}} = \Psi \begin{bmatrix} \hat{\mathfrak{X}}\_1(k|k) \\ \mathbb{A}\_2(k|k) \end{bmatrix} \tag{27}
$$

where *x*ˆ <sup>2</sup>(*k*|*k*) = *<sup>U</sup>*1*y*(*k*) <sup>−</sup> *<sup>U</sup>*1*CNx*<sup>ˆ</sup> <sup>1</sup>(*k*|*k*). This indicates that the frequency discrepancy *x*2(*k*) = ∆*f*(*k*) is estimated from measured data *y*(*k*) and remaining estimated states *x*1(*k*) . To identify the unknown input *d*(*k*), including false data injection to the microgrid actuators, (27) is replaced in (20) to obtain (28):

$$\begin{aligned} \begin{bmatrix} \hat{\mathbf{x}}\_1(k+1|k) \\ \boldsymbol{\iota}\_1 \mathbf{y}(k+1) - \boldsymbol{\iota}\_1 \mathbf{CN} \boldsymbol{\mathfrak{X}}\_1(k+1|k) \end{bmatrix} &= \\ \begin{bmatrix} A\_{11} & A\_{12} \\ A\_{21} & A\_{22} \end{bmatrix} \begin{bmatrix} \hat{\mathbf{x}}\_1(k|k) \\ \boldsymbol{\iota}\_1 \mathbf{y}(k) - \boldsymbol{\iota}\_1 \mathbf{CN} \boldsymbol{\mathfrak{X}}\_1(k|k) \end{bmatrix} + \begin{bmatrix} \overline{\boldsymbol{B}}\_1 \\ \overline{\boldsymbol{B}}\_2 \end{bmatrix} u(k) + \begin{bmatrix} 0 \\ I\_q \end{bmatrix} \delta(k) \end{aligned} \tag{28}$$

Simplifying (28), the UI can be identified as ˆ*d*(*k*) = *U*1*y*(*k* + 1) + *U*1*CNx*ˆ <sup>1</sup>(*k* + 1|*k*) − *A*12*x*ˆ <sup>1</sup>(*k*|*k*) <sup>−</sup> *<sup>A</sup>*22(*U*1*y*(*k*) <sup>−</sup> *<sup>U</sup>*1*CNx*<sup>ˆ</sup> <sup>1</sup>(*k*|*k*)) − *B*2*u*(*k*). Equation (29) shows the detected UI:

$$\hat{d}(k) = F\_1 \overline{y}(k+1) + F\_2 \hat{\overline{x}}\_1(k|k) + F\_3 y(k) + F\_4 u(k) \tag{29}$$

where *F*<sup>1</sup> = *U*1, *F*<sup>2</sup> = *U*1*CNLU*2*CN* + *U*1*CNA*12*U*1*CN* − *U*1*CNA*<sup>11</sup> − *A*<sup>21</sup> + *A*22*U*1*CN*, *F*<sup>3</sup> = −*U*1*CNLU*<sup>2</sup> − *U*1*CNA*12*U*<sup>1</sup> − *A*22*U*1, and *F*<sup>4</sup> = −*U*1*CNB*<sup>1</sup> − *B*2, *y* is a filtered measurement signal of *y*. These estimated states *x*ˆ(*k*) of the microgrid and the detected UIs ˆ*d*(*k*) are applied in the second control layer to compensate the frequency deviation.

#### *3.2. Unknown Input Compensator Design*

The UI compensator is developed by *u*ˆ(*k*) = *G*1*x*ˆ(*k*), which is utilized in the closedloop control of the microgrid matrix *A* − *BG*1. *G*<sup>1</sup> is an optimized state feedback coefficient designed to guarantee that the Eigenvalues of *A* − *BG*<sup>1</sup> fall within stable control region of the microgrid . To design this compensator coefficient, the pair (*A*, *B*) must be controllable that means the rank of the controlability matrix is equal to the rank of microgrid model, or *rank*[*B AB A*2*B A*3*B A*4*B*] = *rank A*. In the second layer, the optimal compensator coefficient *G*<sup>1</sup> is obtained using input *u*(*k*) and the estimated microgrid states *x*ˆ(*k*) in (27) to minimize the performance index *J* in (30). *Q*<sup>2</sup> and *R*<sup>2</sup> are weight matrices for control performance and input energy respectively, in (30). If ∆*fre f* = 0, we have the proposed control law *u* ∗ (*k*) = −*u*ˆ(*k*) − *G*<sup>2</sup> ˆ*d*(*k*), which is a linear combination of the detected unknown inputs ˆ*d*(*k*) with *G*<sup>2</sup> = *D*, and the compensator coefficient *G*<sup>1</sup> in (31). The first term of the proposed control law *G*<sup>1</sup> is obtained from (32) to optimize the performance index *J*. In Equation (32), *P*<sup>2</sup> implies the unique positive-definite solution of discrete-time algebraic Riccati equation in (30) specified as *P*<sup>2</sup> = *A <sup>T</sup>P*2*<sup>A</sup>* <sup>−</sup> *<sup>A</sup> <sup>T</sup>P*2*B*(*R*<sup>2</sup> + *B <sup>T</sup>P*2*B*) <sup>−</sup>1*B <sup>T</sup>P*2*A* + *Q*2. The second term of the proposed control law is the detected unknown inputs ˆ*d*(*k*) subtracted from the first term of the proposed control law to eliminate the UI. The diagram of the proposed control strategy is shown in Figure 4 :

$$\text{Minimize } J = \sum\_{n=1}^{\infty} \left( \mathbf{x}(k)^T Q\_2 \mathbf{x}(k) + \boldsymbol{\mu}(k)^T R\_2 \boldsymbol{\mu}(k) \right) \tag{30}$$

$$\text{Subject to. } \ge (k+1) = A\ge(k) + Bu(k)$$

$$
\mu^\*(k) = -\left(\mathcal{G}\_1 \mathfrak{X}(k) + \mathcal{G}\_2 \mathfrak{d}(k)\right) \tag{31}
$$

$$G\_1 = (R\_2 + B^T P\_2 B)^{-1} B^T P\_2 A \tag{32}$$

**Figure 4.** The proposed control strategy for islanded microgrid.

#### **4. Vulnerability Analysis of Microgrids with Inverter-Based Resources**

This section shows the vulnerability of microgrid control based on the secondary control design of the microgrid model obtained in Section 2. According to Equation (10), all inverter angle dynamics ∆˙*δ<sup>i</sup>* are direct functions of the first inverter active power ∆*P*<sup>1</sup> in this model, which is introduced as (desired) reference frequency of inverters in some papers [21]. All droop gains, also called the active power sharing gains, including *m*1, are selected based on the microgrid's power rating of energy resources. Typically, these active power sharing gains are chosen as the inverse proportion of the nominal power to guarantee the accuracy of active power-sharing, i.e., *<sup>P</sup><sup>i</sup> P*1 = *mi m*<sup>1</sup> . If this proportion ratio is distorted, it may destabilize the microgrid.

Disclosing and injecting the data packets of the first inverter active power ∆*P*<sup>1</sup> can enormously distort the stability and performance of the entire grid for three critical reasons:


Stealthy FDI of this information *m*<sup>1</sup> *<sup>f</sup>* ∆*P*<sup>1</sup> can target the droop gain of the first inverter *m*1∆*P*<sup>1</sup> and change it as follows:

$$\begin{aligned} \Delta \dot{\delta}\_{l} &= \Delta \omega\_{nl} - \Delta \omega\_{n1} - \left( m\_{i} \Delta P\_{l} - m\_{1} \Delta P\_{1} \right) + \left( m\_{1f} \Delta P\_{1} \right) = \\ \Delta \omega\_{nl} &- \Delta \omega\_{n1} - \left( m\_{i} \Delta P\_{l} - \left( m\_{1} + m\_{1f} \right) \Delta P\_{1} \right) \end{aligned} \tag{33}$$

Disclosed data exchanges of the first inverter's active power (reference active power) can be injected by adversaries into the actuators of inverters' control inputs. This imposed change is not visible since these injected data are a part of the microgrid data. This data manipulation also can devastate the control mechanism of inverter-based resources in microgrids since standard secondary controls rely on all data packets of actuators. The Simulation and Results section shows that standard controllers cannot address this type of FDI to the microgrid since they need all actuators' data in their control procedure.

#### **5. Simulation and Results**

This section implements our proposed UIO-based control technique on the secondary control of an islanded inverter-based microgrid model that was introduced in [14]. We show that the effect of the false data injected to the inverter angle dynamic of this system is well compensated using our proposed control methodology. This microgrid model consists of three main modules of inverters, network (line topology), and loads. Inverters dynamics comprises power-sharing controller, output filter, coupling inductor, and current and voltage controller. Each inverter has its own reference frame whose rotation frequency is adjusted by its power sharing controller. This case study is a 220 V (per phase Root Mean Square), 60 Hz microgrid equipped with three inverters of equal rating (10 kVA), supplying two loads as shown in Figure 5. Figure 5 illustrates the microgrid topology. In this figure, the inverters supply two loads connected to the microgrid through lines 1 and 2. More information about the microgrid parameters and initial microgrid conditions are provided in Tables 2 and 3.

**Figure 5.** Case study: microgrid topology.



**Table 3.** Microgrid initial conditions


To show the efficacy of the proposed UIO based secondary control, in particular, and secondary control, in general, three simulation cases for this model are shown as follows. In these simulation cases, the secondary control based on our proposed UIO is compared with the secondary control equipped with Linear Quadratic Gaussian (LQG), Luenberger-based control, and the microgrid without secondary control (just primary control response).

#### *5.1. Case 1*

In this case, the effect of a step load change is investigated. The step load change occurs for load3 at *t* = 1 s. The angles of inverters 2 and 3 for the microgrid with only primary control and with three secondary controllers are demonstrated in Figures 6 and 7. As Figures 6 and 7 displays, the primary control only is not enough to appropriately control microgrid. These results determine that the proposed UIO controller performs significantly better than the other two secondary controllers. Also, the inverters' frequencies presented in Figures 8 and 9 show that the proposed UIO controller compensates the inverters' frequencies better than other secondary controllers.

**Figure 6.** Second inverter angle *δ*<sup>2</sup> in scenario 1 (Step load change).

**Figure 7.** Third inverter angle *δ*<sup>3</sup> in scenario 1 (Step load change).

**Figure 8.** Second inverter frequency dynamic ∆*f*<sup>2</sup> in scenario 1 (Step load change).

**Figure 9.** Third inverter frequency dynamic ∆*f*<sup>3</sup> in scenario 1 (Step load change).

#### *5.2. Case 2*

In this case, the FDI effect to one inverter angle is investigated. The FDI consisting of sinusoid functions is added to the actuator of inverter angle 2 at *t* = 1.2 s as:

$$d(t) = 2\sin(t) + 1.25\sin(0.75t) \qquad t \ge 1.2 \text{ s}$$

The angles of inverters 2 and 3 for the microgrid with only primary control and with three secondary controllers are demonstrated in Figures 10 and 11. These results determine that the proposed UIO controller performs significantly better than the other two secondary controllers. Also, the inverters' frequencies shown in Figures 12 and 13 prove that the proposed UIO controller compensates the inverters' frequencies better than other secondary controllers.

**Figure 10.** Second inverter angle *δ*<sup>2</sup> in scenario 2 (False Data Injection (FDI) into second inverter's actuator).

**Figure 11.** Third inverter angle *δ*<sup>3</sup> in scenario 2 (FDI into second inverter's actuator).

**Figure 12.** Second inverter frequency dynamic ∆*f*<sup>2</sup> in scenario 2 (FDI into second inverter's actuator).

**Figure 13.** Third inverter frequency dynamic ∆*f*<sup>3</sup> in scenario 2 (FDI into second inverter's actuator).

#### *5.3. Case 3*

In this case, the stealthy FDI effect to one inverter angle is investigated. As seen in 10, all inverter angle dynamics ∆˙*δ<sup>i</sup>* are a function of the first inverter active power ∆*P*1. Thus, one destructive FDI can be launched once ∆*P*<sup>1</sup> is stealthily disclosed and used in the data injection. The FDI is added to the actuator of inverter angle 2 at *t* = 1.4 s as:

$$d(t) = 0.5 \Delta P\_1(t) \qquad t \ge 1.4 \text{ s}$$

The angles of inverters 2 and 3 for the microgrid with only primary control and with three secondary controllers are demonstrated in Figures 14 and 15. Considering the results, the proposed UIO controller can still resiliently control the microgrid; however, this stealthy FDI can destabilize the microgrid equipped with LQG and Luenberger-based secondary control. The Luenberger-based secondary controller operates significantly more unstable compared to the LQG-based controller. Also, the inverters' frequencies shown in Figures 16 and 17 prove that the proposed UIO controller, unlike the other secondary controllers, compensates the inverters' frequencies. In fact, this simulation case verifies that the proposed UIO-based controller properly maintains the microgrid resiliency.

**Figure 14.** Second inverter angle *δ*<sup>2</sup> in scenario 3 (Stealthy FDI to second inverter's actuator).

**Figure 15.** Third inverter angle *δ*<sup>3</sup> in scenario 3 (Stealthy FDI to second inverter's actuator).

**Figure 16.** Second inverter frequency dynamic ∆*f*<sup>2</sup> in scenario 3 (Stealthy FDI to second inverter's actuator).

**Figure 17.** Third inverter frequency dynamic ∆*f*<sup>3</sup> in scenario 3 (Stealthy FDI to second inverter's actuator).

#### **6. Conclusions**

This paper shows a procedure to develop a secondary control for an islanded microgrid. This islanded microgrid model includes inverter-based energy resources. To design a secure microgrid, the secondary control needs to operate resiliently against cyber anomalies, e.g., False Data Injection (FDI). In this paper, we show that the inverter-based microgrid can be tremendously vulnerable to stealthy FDI, and this type of cyber-disruption can make the microgrid unstable. We develop a secondary control based on Unknown Input Observer (UIO) and optimal compensator to regulate frequency of an islanded microgrid. The proposed secondary control can be effective against different types of FDIs.

**Author Contributions:** Methodology, M.R.K.; Writing, M.R.K., S.K.S. and J.M.S.; Validation, M.R.K., V.V. All authors have read and agreed to the published version of the manuscript.

**Funding:** Partial support of this research was provided by the Woodrow W. Everett, Jr. SCEEE Development Fund in cooperation with the Southeastern Association of Electrical Engineering Department Heads and National Science Foundation's Division Of Electrical, Communication & Cyber System Grant # 1351201. Any opinions, findings, and conclusions, or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the sponsoring agency.

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

#### **References**

