Sensor Fault-Tolerant Control of Microgrid Using Robust Sliding-Mode Observer

This work investigates sensor fault diagnostics and fault-tolerant control for a voltage source converter based microgrid (model) using a sliding-mode observer. It aims to provide a diagnosis of multiple faults (i.e., magnitude, phase, and harmonics) occurring simultaneously or individually in current/potential transformers. A modified algorithm based on convex optimization is used to determine the gains of the sliding-mode observer, which utilizes the feasibility optimization or trace minimization of a Ricatti equation-based modification of H-Infinity (H∞) constrained linear matrix inequalities. The fault and disturbance estimation method is modified and improved with some corrections in previous works. The stability and finite-time reachability of the observers are also presented for the considered faulty and perturbed microgrid system. A proportional-integral (PI) based control is utilized for the conventional regulations required for frequency and voltage sags occurring in a microgrid. However, the same control block features fault-tolerant control (FTC) functionality. It is attained by incorporating a sliding-mode observer to reconstruct the faults of sensors (transformers), which are fed to the control block after correction. Simulation-based analysis is performed by presenting the results of state/output estimation, state/output estimation errors, fault reconstruction, estimated disturbances, and fault-tolerant control performance. Simulations are performed for sinusoidal, constant, linearly increasing, intermittent, sawtooth, and random sort of often occurring sensor faults. However, this paper includes results for the sinusoidal nature voltage/current sensor (transformer) fault and a linearly increasing type of fault, whereas the remaining results are part of the supplementary data file. The comparison analysis is performed in terms of observer gains being estimated by previously used techniques as compared to the proposed modified approach. It also includes the comparison of the voltage-frequency control implemented with and without the incorporation of the used observer based fault estimation and corrections, in the control block. The faults here are considered for voltage/current sensor transformers, but the approach works for a wide range of sensors.


Introduction
Distributed electrical power generation by various renewable and non-conventional micro-sources provides diverse options for configuring modern electrical grids. A microgrid (MG) consists of a cluster of loads and distributed generators (DG) that operate as a single controllable system [1]. The interconnection of DGs to the utility grid through power electronic converters has raised concerns about safe operation and protection of equipment, as power management is required at micro levels as well as for large unified networks. MGs may operate in both autonomous and grid-connected modes, whereas stability and effective control are issues of concern for both modes of operation of dynamic microgrids [2]. A properly simulated and experimentally tested small-signal linearized MG model is required for reliable testing of the observer-based FTC techniques used in this work. The FTC approach enhances the safety and reliability of the entire system by generating alarms for fault magnitudes within certain thresholds. Moreover, it will maintain the operation close to normal instead of immediate shutdowns and prevent possible losses, along with providing maintenance opportunities by shifting the power switches to redundant generator sources using the hierarchical MG control strategy [3,4]. This work is specifically focused on the FTC of microgrids, particularly with reference to sensor faults, as the control of power systems relies on sensor measurements. If the sensors fail, have bad or broken connectivity, cause communication malfunction, etc., they will not only fail the control mechanism but also the power system. In general terms, the reliability enhancement, local voltage support, correction of voltage/frequency sags, and uninterruptible power supply (UPS) are major issues of focus in this work [5]. The small-signal modeling of MGs can be studied in detail in [4,[6][7][8][9][10][11][12][13].
Sliding-mode observer (SMO), is different from ordinary Luenberger observers because of the nonlinear switch discontinuous term, which is properly processed for fault diagnostics (detection, isolation, and estimation). They are used for both linear/nonlinear systems with additive faults and are capable of handling a large class of perturbations, parametric variations, uncertainties, and unmodeled dynamics. Moreover, it provides compensation for observer mismatches while replicating the system, along with ensuring stability and reachability in finite time [14,15].
Walcot and Zak [16] used feedback output error linearly in observers, along with a Lyapunov-based stability analysis. The faults can be determined from the deviation of the system trajectory from the sliding surface, but it cannot determine which sensor or actuator is faulty. The basic requirement of fault detection is to detect faults, along with location identification, as mentioned in [17,18]. The difference between the system and observer outputs generates residual signals, which are processed further with static and dynamic thresholds for better diagnostics, reconfiguration of the system/observer, and fault reconstruction. Residual based methods were reviewed by [19,20]. SMO-based methods have also been proposed by [21,22]. Utkin [23] in his proposed observer used a discontinuous term with a suitably scaled gain, which requires software to solve the synthesis problem.
Edwards [24] extended the work by using both discontinuous and linear terms as feedback in SMO, which is transformed into canonical forms by suitable transformations constrained by conditions on invariant zeros of the system. The methods for computing the required gains of the observer are given, which provides an explicit solution, but all degrees of freedom are not exploited. The work was carried out by [25] using an output term injected with an appropriate gain for fault magnitude determination in the localized sensor/actuator while maintaining the sliding motion. Tan [26] used sliding-mode observer (SMO) with linear matrix inequality (LMI) based convex optimization algorithms to exploit more degrees of freedom for observer gains and establish a relationship between the suboptimal observer and the linear part of the SMO using the linear quadratic Gaussian (LQG) theory. The paper also presented a modified algorithm for pole placement and clustering to place eigenvalues of the linear SMO part in a certain region to attain improved observer performance. The algorithms also involve some design matrices inherent in procedures that can modify the dynamics of the sliding motion. Tan [27] applied the SMO theory to find additive sensor faults by transforming them suitably to act as actuator faults. This work was further extended by [28] for localized additive sensor/actuator fault reconstruction with additive uncertainty in the system. It uses the minimization of the L 2 gain of uncertainty and reconstructed fault, scaling of the output injection signal, and application of LMIs for more design freedom. Although the sliding mode is often not retained in most cases in a very ideal sense in the presence of faults, the estimation is shown to be made possible in these works.
Ref. [29] also used the idea of correcting the sensor/actuator faults by using the estimated fault, but the technique could not be termed as strictly active or passive. An observer-based approach for online fault estimation was used to correct the sensor faults but was not active in the sense of updating the control law, which was investigated by Edwards in [30]. Yan [31] imposed some conditions on the fault and disturbance distribution matrices to achieve a specific fault reconstruction. Aldeen [32] estimated the states, faults, and disturbances/unknown inputs for nonlinear systems by designing an SMO.
Dhahri [33] initially presented a fault reconstruction methodology for matched faults and uncertainties, which is not very practical because of the very nature of uncertainties; hence, the method is not valid for a good range of practical systems. They further extended the work by determining the SMO gains by feasibility optimization of LMIs attained through Lyapunov stability criteria. It minimizes the H∞ criteria (ratio of residual to disturbance), and the reduced effect of disturbance on fault reconstruction improves the fault estimation, along with validation of the work for unmatched uncertainties/ faults. This study proved the stability and reachability of the sliding-mode observer and evaluated the reachability time by using a suitable mathematical estimation.
Shi [34] presents H∞ based FTC for actuator and sensor faults occurring in a wind energy system. It considers variable wind speed being modeled with stochastic affine models and uses linear quadratic regulator (LQR)-based state feedback control. This paper discusses various intelligent methods for designing and controlling small-and large-scale MGs operating in parallel or in isolation. The increasing complexity of MG systems with various combinations of active and passive elements requires individual converter units to act in a fault-tolerant manner for better efficiency and reliability in generation, distribution, and transmission [35].
In [36], SMO was applied to sensor faults, that is, for current transformer (C.T) magnitude faults and used an estimated fault for correction of sensor (C.T) fault. It also uses feedback pole placement control to track the real and complex powers, and in this way, a compensating sensor (C.T) fault without even replacement or alarm, which can be better termed as a method to design a software-based sensor. An adaptive-fuzzy-PID robust sliding control is proposed for an uncertain class of nonlinear systems, particularly focusing on aircraft flight control, is referred to in [37].
The work in [38] designed a sliding control with adaptive gains and an integral surface for robustness against actuator faults of a wind turbine system to maintain the rotor speed, with simulation results. Recent approaches are moving towards consensus/distributed controls of MGs along with trending applications of fuzzy control. A distributed adaptive fuzzy-based control is presented for large-scale systems with sensor and actuator faults [39].
Kangdi Lu [40] proposed robust PI control for load-frequency control (LFC) of multi area interconnected scenerio, where its parameters are estimated by constrained population extremal optimization. It uses H∞ determined from LMIs as one constraint whereas the integral based time absolute error as another constraint. The papers showed effectiveness of scheme by its comparison with other PI control methods and an optimized model predictive control (MPC). Kang-Di Lu [41] developed adaptive, resilient event triggered PI-based LFC which works with energy constraint. Lyapunov theory to derive criterion of stability which is tested for various case studies, and is proved to be defeating denial of service attacks and reducing the communication burdens.
Damiano Rotando [42] developed LMI-based observer/controller to be employed for dynamic cost estimation and control for a saturated-actuator class of non-linear systems to maintain the cost below an upper bound. The scheme is tested by simulation results on rotational single-arm-inverted pendulum.
This study focuses on designing a sensor FTC mechanism applicable at both the primary and secondary levels with reference to hierarchical MG control [3] strategy. The FTC strategy uses the robust sliding-mode observer (RSMO) theory to be utilized for the detection and estimation of sensor faults of a distributed MG unit operating in autonomous mode of operation, using a reliably simulated and experimentally verified mathematical model of the MG. The considered system has one current transformer (C.T) and potential transformer (P.T), but it is easily scalable for multiple and redundant sensor sources (transformers), which can be utilized for enhanced security and reliability. The online fault estimation-based fault tolerance approach is quite general and can be extended to many types of systems by choosing the suitable observer/controller parameters discussed in this paper. The main contributions of this study are:.

•
We have presented an improved method, as it is capable of dealing with either one or both faulty sensors (transformers) with sinusoidal additive faults (composite of magnitude, phase, and harmonics). Earlier work was performed only for magnitude faults in the current transformer in [36]. • Algorithm for determination of SMO gains is modified and improved by using Ricatti-equation-based modification of H∞ enhanced LMIs, i.e., the combination of approaches represented by Edwards [26,33], which enhances robustness of SMO in fault diagnosis and reconstruction. The method for the mentioned approach is discussed in Theorem 2. The comparisons for results produced with SMO gains determined by proposed technique to those determined by earlier/base works (being used in this study), are also presented. • Fault estimation procedure is modified and contains some factors which were mistakenly missing in reduced order state error equations of earlier works such as [30]. The method also incorporates numerical solution of the DE for reduced order state error estimation. The mentioned approach is worked in Corollary 1. • Disturbances being unknown inputs are also accurately estimated for all fault types considered in the system. The modified fault estimation method gives very accurate disturbance/unknown inputs estimation as shown in Corollary 1. • Lyapunov stability analysis of SMO with considered additive faults and disturbances for the considered microgrid system is presented, as shown in Proposition 1. • Reachability of sliding mode in finite time is proved along with determination of reachability time, for the considered faulty and perturbed microgrid system, as shown in Theorem 3. • Along with voltage-frequency regulation using PI control and SVPWM in earlier studies, FTC is an additional feature in the same control mechanism by using the corrections in faulty sensor outputs achieved through the estimated faults and disturbances by using SMO.

•
The system is simulated for various fault types of practical importance particularly with reference to C.T/P.T and generally for any type of sensors, i.e., sinusoidal, linearly increasing, constant, square pulse, and random type faults with additive sinusoidal harmonics in the form of disturbances.
This paper is organized with an introduction, literature review, and brief discussion of the proposed scheme in Section 1, current/voltage transformer faults model and MG system model in Section 2, preliminaries of SMO based detection and estimation theory in Section 3, determination of H∞ optimized SMO gains in Section 4, reduced-order sliding motion dynamics for fault estimation along with stability and reachability proofs in Section 5, voltage-frequency regulation enhanced with FTC in Section 6, results and discussions on various fault cases in Section 7, and concluding remarks and some possible future directions in Section 8. An Appendix A section is also added after the mention of funding and references. A simplified block diagram illustration of this study is presented in Figure 1.

Modelling of Current and Voltage Transformer Faults
The actual problem in C.T/P.T is saturation, which causes an increased core magnetization current and reduces secondary current compared to that required by relays and switches. The CT saturation on the primary side is caused by DC offset of the fault current preceding to the additional effects caused by the remnant flux of fault. The relay coils and even wires causing the cumulative impedance burden of the secondary side also plays its role in CT saturation. Hence, protection schemes require several C.Ts connected in parallel [43][44][45]. The inaccuracies of P.T/C.T, their output will result in incorrect signals generated by space-vector-pulse-width-modulation (SVPWM) for voltage source converter (VSC). The VSC will generate consequently the inaccurate voltages/currents, which will not track the required reactive and active powers. The errors of P.T/C.T are sinusoidal in nature inclusive of magnitude, harmonics and phase, whereas the previous studies have considered only magnitude faults for the sake of simplicity [36]. The additive faults/disturbances are considered in the system, such that the sensor output is added up with different sinusoidal faults/disturbances, which compositely form the complete mathematical model of the faults actually occurring in the C.Ts/P.Ts.

Mathematical Model of Microgrid System
A small-signal MG model is used in this study to determine the workability of the proposed FTC scheme. The MG model is properly simulated, experimentally verified, and able to be used as a block in large grid networks [6].
The mathematical model of a VSC-based microgrid includes non-linear equations; however, its linearized version at the operating point is used in this study. The microgrid model, as proposed by [6] includes inverter equations, voltage source representing grid, LCL filter, PLL, current controller, droop control equations, voltage controller, SVPWM, and reactive and real power calculations, all connected in a cascade to give a non-linear model that needs linearization at the operating point. The LCL filters are connected as passive filters with the VSI, to manage the voltage/current spikes. The line/stray inductances, capacitances, and resistances are also modeled as being considered with LCL filters, i.e., r c and r f are the inductive parasitic resistances, whereas the damping resistor R d is serially connected to the filter capacitor. However, ESR of the capacitor is not considered explicitly instead its lumped into R d . The C.T/P.T are mounted on LCL filter to read the instantaneous voltage/current readings, which are used to determine the instantaneous values of reactive and real (Q c , P r ) powers. The detailed inverter model as provided in Simulink is considered in this work, i.e., without any major erroneous behavior, it is assumed that the voltage being commanded appears at the input of the filter inductor i.e., V idq * = V idq . The losses in the diodes and IGBTs are neglected. The LCL part of the system modeled with KVL/KCL along with average VSI model and grid source taken together is considered as the required part of the mathematical model to design the SMO. Therefore, if there are no sensor faults in (P.T/C.T) of the system, the actual system states/outputs and those of model are in compromise, showing no difference. The considered MG system model is a continuous time LTI system, which follows the separable principle, i.e., the observer and controller can work in combination, and the control action can be performed on the the unknown system states being determined by an observer. The Simulink based model is shown in Figure 2.
Definition 1 (Principle of Separation of Estimation and Control). Considering deterministic linear systems, if state observer based estimated states are used to design a state feedback control for a LTI system, then the observer and feedback controller in combination are stable.
The linearized state space MG model is given as:  The simulink based microgrid schemetic diagram (SLD) is given in Figure 2. The abc-dq0 transformation is a combination of the Park and Clark transformation for three-phase current/voltage, which is defined for any signal s(t) as The frequency of the system is determined using PLL while working with dq frame voltages. The grid side angle of voltage is measured by PLL in the considered system, which is then used for all abc-dq/ dq-abc transformations, needed by the system. The dq transformed system model in Equation (2) is The dq-axis output current and voltage measurements are used to determine the instantaneous reactive power (Q c ) and active power (P r ) generated by the inverter.
where I od , I oq , V od , V oq are the dq and components of sensor (P.T/C.T) output currents/voltages. Instantaneous powers are low pass filtered using the corner frequency ω c to obtain the output power filtered with high frequency effects. The single line diagram (SLD) of the considered VSI-based MG is given Figure 2.
The generalized state-space model of system is: In general form, the dimensions of vectors are x s ∈ R n * 1 , x h ∈ R p * 1 , w ∈ R m * 1 , u ∈ R m * 1 , f ∈ R q * 1 , ξ ∈ R q * 1 , y s ∈ R p * 1 , whereas the dimensions of system matrix, matrix of grid side dynamics, actuator matrix, and output matrix respectively, are A s ∈ R n * n , B g ∈ R n * m , B s ∈ R n * m , and C s ∈ R p * n , i.e., [0 p * (n−p) , I p * p ]; whereas dimensions of disturbance and fault distribution matrices with full column and row rank are D s ∈ R q * q = I q * q , E s ∈ R q * q = I q * q respectively, where n ≥ p ≥ q.
The Euclidean norm of any vector y is defined by The boundedness of the disturbance and fault magnitudes in terms of the Eucledian norm is given by f ≤ α and ξ < ξ o , which are design requirements, along with the above-mentioned matrix dimensions.

Stable Filtering and Augmented System
A stable filter is used to make the sensor outputs least depending on faults and to magnify the small/ insignificant faults [30]. The system and stable filtered output state vectors are augmented, where the state vector also includes the unscaled actual output variables. In this way, the stable filtered scaled augmented states also provides the isolation of faulty sensors, that is required for proper diagnosis process. A stable filter in some cases may be is a positive definite (PD) scaled identity matrix or a stable matrix with eigenvalues in the left half plane or a high-frequency noise suppressing first-order filter for the output signal in some applications. The state space form of stable filter equation iṡ The states and stable filtered outputs are augmented for easy handling in a compact form. The system in augmented form is where y c ∈ R p * 1 where D c ∈ R n c * q c and E c ∈ R n c * q c , are disturbance and fault distribution matrices, respectively, in augmented system such that D c = E c = 0 n * p I p * p and for the MG system under consideration p c = p = 4, [30], so the system (A c , E c , C c ) will be minimum phase if the open loop system is stable. In other words, if the system has less inputs than outputs, that is, q ≤ p, then it is expected that the system will not have any invariant zeros.

Fault Diagnosis SMO Filtering
In the literature the phrase 'fault diagnosis' refers to three main objectives: detection, isolation, and estimation of faults occurring in the system [46]. The fault detection is often not sufficient in most of the cases, instead it also requires isolation of the fault location along with estimation of faults so that the corrective mechanism can be managed to ensure protection of the systems. These objectives are achieved using the methods which can be categorized into four main classes: model-based, signal-based, observer-based and parameter-estimation-based approaches of fault diagnosis [47][48][49][50]. The observer-based approach for fault detection/ estimation is used in this study, and more particularly it uses SMO for these tasks.
In the next subsection, the basis of the SMOs used for fault detection, isolation, and reconstruction, as shown in earlier works, is briefly discussed.

Fault Detection (FD) SMO Filtering
Fault diagnostics is performed using the SMO, that is, detection and isolation of faults by estimation of states/outputs for the MG application under consideration. In literal sense the isolation functions localization of the faulty sensors of the system; however, the fault estimation SMO is functioning for both the isolation/ estimation of faults. The first-order SMO as proposed by [23,24,30], gives the estimated states of the considered MG system. where ∈ R n c * 1 is the estimated state vector which augments estimated system states x * s ∈ R n * 1 and estimated stable filtered output states x * h ∈ R p * 1 . The matrix G o ∈ R n c * p c is the Luenberger gain of the output estimation error e o ∈ R p * 1 term in SMO, which also ensures the stability of the term where the constant gain factor (γ) is being appropriately chosen depending on the application under consideration. The proposed form of the discontinuous term gain G m = −LT T T T , where the orthogonal matrix T ∈ R q * q is determined by using QR factorization. The matrices P o and L are sub parts of a PD Lyapunov matrix P > 0, which is proposed to be of the form P = P 1 P 1 L L T P 1 T T P o T + L T P 1 L > 0, where the matrices P ∈ R n c * n c , P 1 ∈ R n * n , P o ∈ R p * p , T ∈ R p * p , L ∈ R n * p are to be determined ( [26]). The Luenberger gain G o is also determined from the Lyapunov matrix P, which is explained in detail in the next section. The output estimated states of the system are given by The output estimation error of the system is given by and As e o is not the actual output error, instead it is the (scaled) stable filtered output error, so it is suggested empirically to use the form of ψ in Equation (13) instead of its normalized form for the considered MG application.
Remark 2. The observer as mentioned in Equation (14) is insensitive to faults ( f ) completely if: The System triple (A c , E c , C c ) has the invariant zeros which lie in Left Half Plane (LHP) [30].

State Estimation Error SMO Filtering
The state estimation error is determined by taking the difference of SMO-based estimated states in Equation (14) and system states (being determined) from the mathe-matical model in (11), being discussed in the previous sections. The difference between Equations (11) and (14) gives the state estimation error.
The state estimation error SMO iṡ where The residual signal (i.e. the output estimation error) in terms of the augmented error vector e is given as Equation (20) is also a standard form of SMO [23], which is applied to the error system for augmented state error estimation. The state error is further also used for fault/disturbance estimations by attaining the sliding mode, where the state error surface is the considered sliding surface. The next section discusses the stability analysis and determination of gains of the fault detection/estimation SMO observers proposed for the MG system.

Determination of Sliding Mode Observer Gains through Stability Analysis
A lemma for the existence of the sliding mode is given, before the Lyapunov-based stability analysis of the proposed fault detection/ estimation SMOs for the considered MG system.
in the neighborhood of surface σ(e) = 0 andσ Remark 3. The Lemma discussed above can be studied in detail in [50], as it is the pivotal concept of SMO based FTC techniques used in this work.
and P is a PD matrix, i.e., (P > 0) of the form , then the estimation error e(t) stays bounded and hence asymptotically stable.
Proof. Let V define the Lyapunov function for an augmented error system. The stability of the equilibrium requires the Lyapunov function to be positive definite, and its time derivative to be negative or semi-negative-definite.
Usingė from Equation (19) V Using the definition of G m as given in the statement of the proposition, and dropping the negative definite Lyapunov term because , the remaining terms are still negative, and the time derivative of the Lyapunov function becomes an inequality, which is always easier to handle in terms of parametric independence.
Using the definitions of (ψ, G m , Taking norm and upper bounds Using the constraint on γ from Equation (30) in Equation (29) V Because the Thau inequality ( [51]) for the Lyapunov equation for any PD matrix P o is defined for any vector x as [33,50].
The Lyapunov function in terms of the error function can be represented in the inequality form as: (e T Ze > λ min (Z) e 2 ). Using the Thau inequality and Equation (31), the inequality version of Equation (26) becomes: which proves stability (i.e., negative definiteness) of time derivative of Lyapunov function. Since x > λ min (P −1 ) x 2 and can be seen in [50], [33].
The Equation (31) and its representation in terms of (34) show the asymptotic stability of the considered observer system. Remark 4. Proposition 1 is analytical proof, particularly for the considered microgrid system with faulty and perturbed sensors using the same steps as performed by Yuri and Edwards in Proposition 3.1 [50], whereas the Thau inequality and observer can be studied in more detail in [51]. Theorem 1. Let Z = A o P + PA o < 0 such that P > 0 and the constant gain of the discontinuous switch term γ is constrained by γ ≥ η o − E o α , then the augmented error system (state error and stable filtered output error) dynamics defined by Equation (19) remains bounded, such that the error magnitude remains bounded within the set X = {e| e ≤ 2ξ o PD c λ min (Z) }, and the Lyapunov function in vector form gives the constraint in the form of , and the iterative feasibility optimization or minimization of linear objective (i.e., trace) under LMI constraint L i2 gives the SMO gain for output estimation error term to be Proof. Considering the Lyapunov function from Equation (26) V Considering switch and fault terms from above equation, i.e., Equation (26) Let Taking the norm, we use the Cauchy-Schwartz inequality and bounded fault with Because it is desired that the above term stays more negative T s f < 0, for the negative definiteness of the time derivative of Lyapunov function in Equation (26), which is satisfied if , so dropping the negative T s f terms, the Lyapunov function is still negativė To show stability in terms of viable set forṁ If ( e 2 > 2ξ o PD c λ min (Z) ), we obtainV < 0, which ensures that the error magnitude remains bounded for the set Using Equation (36) and expressing in terms of the vector quadratic function, LMIs can be determined.V The constraint is true if the matrix in the vector quadratic function is negative definite.
The LMI in Equation (40) can be solved for the trace minimization-based algorithm given by [26] to determine the optimized gains of the SMO. However, for the LMIs to be optimized with trace minimization without the H∞ constraint for the determination of traditional SMO gains, it needs some modification. Applying the Schur complement to the LMI in Equation (40) ( Because the LMI is not feasible in the actual form mentioned by L i1 in Equation (40) Parameters such as the Lyapunov matrix P and matrix F are missing and need to be determined. Using the constraint C c − F 1 Y T = 0, Equation (43) becomes: Applying Schur complement on LMI in Equation (45), and the constraint F −1 Remark 5. The LMI L i2 is optimized by using iterative convex feasibility optimization or alternatively trace minimization, as explained by an algorithm in ( [26]), to determine the unknown parameters such as Lyapunov matrix P and matrix F, which are used to determine Luenberger gain G o of SMO. Moreover, the discontinuous term gain, G m = −LT T T T as discussed in Proposition 1 can also be determined, as the parameter matrix L is also determined from the part P 12 of Lyapunov matrix P by the relation (L = P −1 11 P 12 ), where the orthogonal matrix T is can be determined by QR factorization.
The next subsection discusses the H∞ enhanced trace minimization of LMIs to attain the robustness of the SMO for fault estimation with disturbance rejection.

H∞ Optimized Robust Sliding Mode Observer Gains (Using LMIs)
H∞ is a robust control criterion that may have several meanings with reference to context; however, in this work, it is desired that the fault detection and estimation be ensured with robustness against disturbances, whereas the H∞ gain will ensure an upper bound of the disturbance voltage/current that will be suppressed to ensure the fault detection/estimation task. The method of incorporating H∞ criteria may also have different approaches; however, this study uses a game-theoretic basis [46]. The criteria are incorporated in the Lyapunov function to derive the LMIs that are convex optimized (using the LMI-optimization toolbox in Matlab) for determination of the SMO gains. Definition 2. H∞ based disturbance attenuation problem can be put into formulation as a twoplayer-zero-sum differential game with disturbance ξ and Luenberger observer gain G o are two players, respectively, where the SMO gains G o , G m are required to be designed to minimize the game /cost functional.

Lemma 2. The maximum robustness attenuation problem
for the system given in Equation (7), is satisfied if the cost functional is smaller than or equal to zero for any possible disturbance, where (µ) is the (H∞) parameter and (r H = Hr(t) = He o = HC c e) is the output estimation error. The problem is now viewed as a two-player-zero-sum differential game with the above defined cost function in Equation (48), where the minimizing player minimizes the functional through (G o , G m ) and the maximizing player tries to maximize the function through ξ. The details can be seen in Problem 3.1 in [46].
where P > 0, and if (H > 0), then the augmented error system dynamics defined by Equation (19) remain asymptotically stable, and if the Lyapunov function in vector form is enhanced with H∞ constraint, the disturbance attenuation gives the constraint in the form of LMI which is further modified by Riccati equation with additional control parameters to give constraint LMI and the iterative minimization of linear objective (i.e., trace) under LMI constraint L i4 gives the Luenberger gain of output error estimation term as Proof. Because V is a PD Lyapunov function, the negative definiteness of its derivative determines the stability of the system. If the H∞ criterion is used to enhance the robustness of the traditional SMO, the criterion in terms of the norm is defined by Because the LMI solver constraints for feasible optimization require the residual to be of the form r H (t) Hr(t) where the output estimation error, i.e., residual is defined by and H is a scaling matrix. The Lyapunov function in inequality form in Equation (36) is added with the H∞ criterion according to Lemma 2 as follows: where The matrix F ∈ R p * p is a sub part of matrix H, which provides a control on the residual signal for stability purposes. However, as discussed above, in the definition of r H (t), it is suggested by the LMI solver to meet the conditions of feasible optimization. and if where H ∈ R n c * p c , H 1 ∈ R n * p , The LMI, which can be solved for feasibility or trace minimization-based optimization, to determine the optimized parameters of the matrix is The Schur complement can be applied to convert any bi-linearity to linearity.Applying Schur complement on LMI in Equation (56) Using (Y = PG o ) and adding subtracting the term (YF −1 Y T ) and the inequality reduces to where W = PDP Using Schur complement on inequality and C T = YF −1

Remark 6. Trace minimization based optimization of Ricatti equation-motivated modification of
LMIs, for determination of SMO gains is presented by [26], and H∞ based feasibility optimization of LMIs for determination of SMO gains is used by [33]. However, this work combines the application of both, i.e., to carry out the feasibility or the linear objective (i.e., trace) minimization-based iterative convex optimization of Ricatti equation-based modification of H∞ enhanced LMIs, which can work or may be tested on generally any system, and particularly here being applied on MG under consideration.

Reduced Order Sliding Motion
The error system augments state/ stable filtered output error vectors that is, The generalized dimensions of matrices and vectors are e o ∈ R p * 1 , e s ∈ R n * 1 , ξ ∈ R q * 1 , ψ ∈ R q * 1 , f ∈ R q * 1 , A 11 ∈ R n * n , A 12 ∈ R n * p , A 21 ∈ R p * n , A 22 ∈ R p * p , E o ∈ R q * q , D o ∈ R q * q , G o ∈ R n c * p , G 1 ∈ R n * p , G 2 ∈ R p * p , L ∈ R n * p , T ∈ R q * q whereas for the MG system considered p = 4, n = 6, m c = m = 2, m = 2, m c = m = 2, n c = n + p = 10, p c = p = 4, q c = q = 4.
A transformation is used to make the state error part of the error system least dependent on faults to retain the sliding motion, along with the attainment of reduced-order sliding motion for fault estimation. Ideally, the fault term in the state error part of the system and the state error term in the output error part should be eliminated; however, such a transformation cannot be designed. Thus, practically and very strictly, the sliding motion may not be retained owing to faults and disturbances, but the transformation not only provides control over the state error part through the gain matrix (L) but also reduces the effect of the state error part in the fault term to a negligible order in terms of magnitude for the considered MG system. However, the reduced-order state estimation error increases with the passage of time, which can be controlled by scalar (δ) and (β) parameters. Applying Transformation where its inverse, which explains the form of the discontinuous term gain of the SMO, is given by The transformation obtains the system to attain a reduced-order sliding surface along with fault estimation. The transformation and its inverse also explain the sense of the considered form of the switching term gain G m in the SMO. The orthogonal matrix T was determined using the QR transformation method. wherē A reduced-order error system is needed for fault and disturbance estimation if the observer mechanism remains stable along with reachability of the sliding surface in the finite time. The scalar gain (γ) to be used with he output estimation error term (e o ) in the discontinuous control law defined by term (ψ) is also determined from the analytical work of the stability analysis.

Reachability and Stability Analysis
The complete stability analysis of SMOs used for fault detection and estimation is shown in terms of the estimation error as a sliding surface. The error vector comprises of the state estimation error and the stable filtered output estimation error in the augmented vector form. A transformation is used in the above section for reduced-order error dynamics, which is particularly needed for fault and disturbance estimations. Therefore, considering the state error stability from the earlier section in Proposition 1, the Lyapunov stability of only the stable filtered output estimation error part is performed again to show the reachability of the sliding surface and hence ensures the estimation of the fault in finite time. The reachability is directly related to stability, and its analytical work is also used to determine the sliding surface reachability time. Before detailed analytical work, a Lemma for the stability and reachability conditions is provided.

Lemma 3.
If the sliding mode for the surface σ(e) is attained in finite time, that is, σ(e) = 0, then the time derivative of the Lyapunov function dV/dt may follow the inequality must be bounded more strongly, somewhat away from zero. That is, the attraction to the sliding mode will only be asymptotic, if it vanishes too quickly. The solution of inequality in Equation (65) is given by Because √ V ≥ 0, then the inequality in Equation (71) states that V must reach V = 0 in finite time. In addition, because V is proportional to the Euclidean norm of the sliding surface σ(e o ), that is, σ(e o ) , the rate of reaching the sliding surface is bounded away from zero [24,50].
Proof. Let the Lyapunov function for the error system be V e , where the error vector is augmented by the state estimation error and stable filtered output error for the considered system. Thus, the complete Lyapunov function can be represented as: Taking the time derivative of the Lyapunov function to prove the stability of the error system based on its negative definiteness.
Substituting the values forė s from Equation (63) V e s = e T sĀ T The stability of the sliding motion in reduced-order is proved by considering the Lyapunov function on the output part of the error vector only.
If designed suitably Dropping the negative definite term, the inequality version of Equation (78) iṡ Taking norm of above equation, and using the Cauchy-Schwartz inequalitẏ Since Furthermore, since magnitudes of fault and disturbance are bounded: The derivative of Lyapunov function is negative definite if where η is a positive constant that ensures Lyapunov stability in terms ofV e o . Using the bound for γ from Equation (84) in Equation (83), If P is a positive definite matrix, then Using Equation (86) The reachability time (T R ) is given by Because the stability and finite-time reachability of the sliding-mode observers is shown and the gain of the output error injection term is determined, the estimation of faults and disturbances can proceed with the results determined in previous sections.

Reconstructed Fault and Estimated Disturbance
This subsection describes the analytical work of faults and disturbance reconstruction based on the results obtained in the previous sections. (11) and (14) respectively, if the SMO gains are determined by solving the LMI optimization problem described in Theorem 2, the transformed error system is defined by Equations (68) and (69), and if (γ) being constant gain of output error estimation term is constrained to satisfy (84) to ensure the stability of observers, i.e., γ ≥ TĀ 21 e s − TE o α − TD o ξ o + η, then sliding surface attained in reduced order gives the estimated sensor fault ( f * )/ disturbance (ξ * ) to be:

Corollary 1. Considering the MG system/ observer in Equations
A 21 e s where β serves as a scaling constant.
Proof. When observers enter the sliding mode, that is, the sliding surface is reached, the condition in terms of the error surface ideally is (Ce = 0); however, for the considered perturbed and faulty sensor MG systems, the sliding mode/surface is reached only for the output error term (e o =ė o = 0) and not for the state estimation error term(e s ). However, if there is no disturbance term, then (e s → 0;ė s → 0) are also approached in finite time.
From above Equation (92) Using the fault estimate equation (93) in the state error Equation (94) yields the reduced-order state error equatioṅ This DE needs to be solved linearly at every instant of time to be back-substituted in the fault estimation Equation (93) to obtain a closer fault estimate. As evident from Equation (94), the solution to DE also requires a run time evaluation of factor (ψ eq ), because the aforementioned approach is necessary for disturbance estimation. Considering the terms in the fault estimate Equation (93), because the state error term e s in the fault equation cannot be removed or isolated by the transformation (T L ) applied to system (62), but its magnitude becomes insignificant for the considered MG application, whereas the disturbance term in the equation is known to be an undesired and diverging term, the reconstructed fault should be approximated equivalently by (ψ) term only, which is based on the output estimation error (e o ) term, design matrices (E o , T), and gamma (γ) parameter.
So from Equation (93) the reconstructed fault is The equivalent switched control in sliding mode is ψ eq is where the term ψ eq is meant to maintain the sliding motion in reduced-order motion in the presence of disturbances and faults, and δ is a constant control parameter for this purpose.

Remark 7.
(γ) is constant gain factor of discontinuous control term (ψ eq ) whereas (δ) is its additional constant control parameter. The (ψ eq ) term controls the gradually increasing reducedorder state error (e s ) and the value of (γ) being in a closed loop, which, if not controlled properly, causes a rapidly increasing reduced-order state error (e s ) and hence the total divergence of the whole process. It is empirically suggested that, for the considered MG application, the reconstructed fault is where β is a constant magnitude scaling parameter that is required to adjust the attenuation achieved by stable filtering on the output error term. (97) in Equation (93), the estimated disturbance in the system is given by Remark 8. The values of parameters (δ, β, γ) are considered in this paper intuitively by hit and trial, however setting the parameters sub optimally can be addressed in future work, which would also provide generic applicability of observer based fault-tolerant approach for many other applications with different fault/disturbance magnitudes and sensitivity requirements.

Remark 9.
The presence of disturbances and faults result that the sliding motion is not attained in a strict sense; however the effect of disturbances and faults on fault estimation can be minimized using (H∞) norm as presented in Theorem 2 which is ratio of L 2 norms of residual (r(t) = e o (t)) and disturbance (ξ), respectively.

Remark 10.
The state error term (e s ) in output error term and fault term in state error term are undesired in terms of fault estimation. Although the transformation (T L ) cannot ideally achieve the desired elimination of undesired terms, it provides control through the gain matrix (L), which is determined by the LMIs.

Remark 11.
Moreover the transformation (T L ) reduces the effect of state error part (e s )in estimated fault to quite negligible order in terms of magnitude for the considered system which is almost zero in the case of micro-grids. The results were verified through simulations.

Fault Tolerant Control
The estimated faults in C.T/P.T are used for corrections in the faulty sensors' (transformers) readings to avoid the wrong current/voltage readings to calculate the instantaneous powers and correspondingly generation of wrong PWM signals. The corrected dq-currents/voltages of current/potential transformers are given by the vector The corrected sensor voltages/currents are given to voltage-frequency control block for proper tracking of reference reactive and real powers.
The control block mainly utilizes PI control-based current/voltage controllers and uses droop control and a PLL block to regulate real and complex power in relation to frequency and quadrature voltage, respectively. In other words it is said that, the same P − f and Q − V control mechanisms are enhanced as FTC by using observer-based fault estimates for the correction of sensor outputs. The control block is not discussed in detail except for a brief continuation, as it is taken from the work of [6], from which the model of the MG is considered in Section 2. All the system parameters and PI constants are considered to be the same as those given in the aforementioned paper and detailed PhD thesis.

DROOP CONTROL
The voltage and frequency references for the standalone mode of operation of the microgrids must be internally generated.
where P r = 3/2 * (V oq I oq + V od I od ) and Q c = 3/2 * (V oq I od˘− V od I oq ) Because the values are accepted directly from the grid and low-pass filtered output power is processed, the high-frequency current and voltage spikes must be neglected.
The value of m = n = 1/1000 is used for the simulation, which can be varied for different grid ratings and other applications.

PLL BLOCK
The block computes the grid angle by using the phase-locked loop (PLL) at the instant that is then used for all dq conversions, SVPWM block, and other required computations.
For f = 60 Hz ⇒ ω PLL = 377 rad/s and ω c,PLL = 7853.98, The values of constants and gains used in simulations are: k p = 0.25, k i = 2, w c = 377 rad/s.

VOLTAGE CONTROLLER
The PI-based control equations managing integral-based control serve as a voltage controller and generate the corresponding references of the dq components of the current.

CURRENT CONTROLLER
The block uses the desired current values generated by the above block and generates the corresponding voltage values.
The values of constants and gains used in simulations are w n = 377, k pcd = 1, k pcq = 1, k icd = 100, k icq = 100.

SVPWM CONTROL
The SVPWM control uses a 10,000 Hz frequency for the considered MG operation. The desired voltage values generated by current controllers are transformed back to a three-phase voltage representation and provided to the SVPWM block, which manages the switching sequences and times of inverter switches to generate the desired values of current and voltage by VSC. These current/voltage values correspondingly manage the real power vs. frequency and complex power vs. voltage sags. The converter model used was a detailed model provided in MATLAB (Simulink) instead of the average model.
The complete procedure for the proposed observer-based FTC approach is explained in Algorithm 1. 1: Linearized system model in Equation (2) is d-q-0 transformed using Equation (3); 2: Acquisition of grid/converter voltages (u, w) from microgrid in Figure 2 are given to system model (ẋ s = A s x s + B s u + B g w), Equation (6) 3: Sensor/C.T/P.T faults/disturbances ( f (t) = f o * sin(ω 1 t + φ 1 )), (ξ o * sin(ω 2 t + φ 2 )) are generated to be added in system output (y s = C s x s + E s f + D s ξ), Equation (7) 4: Faulty system output is stable filtered using (ẋ h = A h y s − A h x h ) Equation (8); 5: Augment system states with stable filtered outputs, Equations (10) and (11); 6: Determine the SMO gains G o , G m ) using convex (feasibility and trace minimization) optimization performed on system parameters according to methods explained in Theorems 1 and 2; < (i) Perform convex feasibility optimization on the LMI constrained with Lyapunov stability given in Equation (46) (to be used for trace optimization), (ii) Lyapunov stability and H∞ constrained LMI in Equation (56) (to be feasibility optimized), and (iii) Ricatti equation-based modification of H∞ constrained LMI in Equation (61) (to be feasibility optimized), to find the respective optimal gains G * o , G m . > 7: Augmented system state is given to state estimator (SMO) (14); 8: Difference between system and observer states/outputs (e d = e = x o − x c ) as defined in Equation (18) gives Augmented state estimation error; 9: Augmented system state is given to state error estimator SMO

Results and Discussions
According to the literature [46][47][48], the most commonly occurring faults in sensors are impulsive (incipient), occurring at regular intervals (intermittent), linearly increasing, constant measurement error, and random faults. However, for current and potential transformers in saturation, the faults occurring are mainly sinusoidal magnitude, phase, and harmonic faults. The simulations are performed for state/output estimation, stable filtered state/output estimation, state estimation error, stable filtered output estimation error, state estimation filter error, reduced order state estimation error, disturbance estimation, fault reconstruction, and fault tolerant control (FTC) performance. All these are performed for six fault cases: constant, ramp, sawtooth, square sinusoidal, and random types of additive faults along with additive sinusoidal disturbances of the first, second, and third harmonics. The same types of faults are considered for both voltage and current sensors simultaneously with sinusoidal additive disturbances of different and same frequencies; however, the proposed FD and FTC mechanisms are quite robust against the cross options as well. To avoid unnecessary details and length of paper, the reduced order errors and stable filtered states/outputs are not given for any case, whereas the FTC performance is given for worst-case sinusoidal faults (among the considered ones). The behavior of the system and the results for all simulations were consistent, and no statistical analysis was required for a deterministic system and simulation platform.
After detailed testing of the system, the results are quite good in terms of accuracy, except for the fault and disturbance signals in the near frequency range of 60 o , which produced scaled current fault estimation in some cases and delayed current fault estimation results in some cases; however, the voltage faults are accurately estimated in all cases. Moreover, there is an occurrence of time delay problem, which needs discrete time compensation for the phase. Some fault estimation errors and less accurate FTC performance of current is due to the very reason. However the problem is not corrected here, instead will be considered for future works.
A Simulink-based detailed three-phased inverter model was considered in the simulation. The grid/ DC source voltage both operate at 600 V. the phase of the grid voltage is used for PLL block and all abc-dq transformations; SVPWM operates at a frequency of 10,000 Hz with sampling time of 0.0001. The discontinuities are caused by greater sampling times, which can be reduced to improve accuracy at the cost of lesser ability of online working due to the increased response time. Because the continuous time simulations move at very low speeds, which are not viable for real-time online performance; therefore, fixed-step solvers are used for simulation in Simulink (MATLAB) with single task handling to avoid complexities with very minor compromises on accuracy.
Regarding some other simulation constants, since the residual magnitude if considered peak to peak is 0.2 for the (dq) currents/voltages for the considered time of simulation; whereas the (max(ξ) = 6.32; so the H∞ norm µ in this case has the numerical value 0.01.
The value of η is a small positive constant considered η = 10 to ensure the constraint in inequality (90), whereas the upper bounds for the current and voltage are α = 1A/10V, respectively. However, for the worst cases and increased magnitudes, it is considered up to 10 A/100 V for I/V, whereas the upper bounds of ξ are normally considered as 0.2 A/2 V for I/V, and for the worst case with increased magnitudes in simulations 3 A/10 V for I/V. The microgrid system model parameters are listed in Table 1, and the controller parameters are listed in Table 2. Simulations were performed for randomly considered different frequencies and phases for both faults and disturbances and quite high fault/disturbance magnitudes, and they provided quite good performance. The voltage and current fault magnitudes are 100 V and 10 A, the frequencies are 120 Hz and 180 Hz, and the phases are 75 • and 240 • , respectively, whereas the disturbance magnitudes are 10 V and 3 A, the frequencies are 75 Hz and 300 Hz, and the phases are 45 • and 310 • , respectively. The results are shown for the state/output estimation in Figures 4-6, the state/output estimation errors in Figure 7, which are performed with modified H∞ constrained SMO gains only. The results in Figure 8 presents voltage fault reconstruction, whereas the current fault reconstruction is presented in Figure 9, voltage fault estimation error in Figure 10, current fault estimation error in Figure 11, current disturbance estimation in Figure 12, FTC performance for q-component of output current in Figure 13, FTC performance for d-component of output voltage in Figure 14 and current and voltage faults reconstruction for ramp/linearly increasing faults in Figure 15. The above mentioned results are compared for SMO gains which optimized for Trace minimization algorithm proposed by Edwards in [25], feasibility optimization of H-infinity enhanced SMO, and Riccatti equation based modification of H-infinity enhanced feasibility optimized gains. Voltage fault reconstruction has a deformation of the lesser grade; however, the current fault reconstruction and fault estimation error increases due to time delay issue, which can be dealt with separately in future works .
An important Remark on Results: The trace minimization of Ricatti-equation-based modification of H∞-enhanced LMI may not be feasible for some forms of LMIs; however the feasibility optimization of the LMI works well nearly in all cases. The minimization of trace is a linear objective for convex optimization, which can work well on some forms of LMIs or some systems depending upon its parameters. However, the trace minimization of Ricatti equation based modification of LMIs not enhanced with H∞ criterion presented by Edwards in [25] also works well nearly in all cases, but its not giving the accuracy of results in the considered microgrid system, which is included in comparisons. This particular aspect still requires much of rigorous testing to comment in a more deterministic way. The feasibility optimized H∞-enhanced-LMIs also have a phase lag effect particularly in current signal, which needs to be compensated, but compensation of phase is not considered in this study.            Figure 12 is showing the current disturbances estimation/reconstruction using SMO using gains with the above three methods to lead towards a comparison analysis with the proposed work. The results for all three methods are in compromise and no one method can apparently be said to be better than the others. This accuracy is achieved due to the modified and corrected disturbance estimation procedure mentioned in Corollary 1.  Figures 13 and 14 give the FTC analysis shown for q-components of output voltage. The faulty q-components being corrected by SM observer based fault estimation. The fault estimate and correction using the above mentioned techniques of SMO is taken as comparison, because the accuracy of fault/disturbance estimation ensures the reliable FTC working. The FTC achieved through proposed SMO observer is better as shown by graphical result.

Case II-Ramp Faults and Sinusoidal Disturbances
Simulations are performed in this case for current/voltage injected linearly increasing faults with gradients 4 and 1, respectively, and third-harmonic sinusoidal disturbance, that is, 180 Hz for both V/I. The results for current/voltage fault reconstruction in Figure 15 are given.

Conclusions and Future Directions
The study uses SMO theory for detection, isolation, estimation, and correction of faults as a scheme of fault-tolerant control, for faults occurring in sensors (current/potential transformers) mounted on microgrid, by using aVSI-based microgrid model. The work is generally applicable for a wide range of sensor/actuator faults and systems. The estimation and correction of faults using SMOs is like providing software based sensors (transformers) replacing the real ones at the time of occurrence of faults. The SMO-based estimated faults are used to correct the faulty readings of the dq-currents/voltages, to be supplied to PI-based conventional voltage-frequency control block, to determine the actual instantaneous values of reactive and real powers, and hence providing the correct SVPWM pulses provided to VSI. The gains of SMOs are determined using convex optimization of Lyapunov stability ensured LMIs. The comparisons for results produced with SMO gains determined by proposed technique to those determined by earlier/base works used in this study, are also presented, which shows the improvements. The comparison of ordinary voltage-frequency control without the proposed SMO-observer-based corrective mechanism is also shown. The state and fault estimation errors are considered as indices to show the effectiveness of the proposed method. The finite-time reachability of detection/estimation SMOs are also presented to show the real-time applicability of the study in VSI-based microgrids. The work sums up various previous works along with modifications in fault estimation and LMI optimization algorithm for determination of SMO gains. The method is transformable to provide fault detection/estimation/tolerance in various types of systems by selecting the suitable parameters.The work is intended to be enhanced for networked microgrids using the approaches of distributed controls while managing the optimal power flow.

Data Availability Statement:
The data including Simulink-based simlation files, Matlab based optimization m-files, supplementary result file and some necessarily required documents will be uploaded as the article gets published.

Acknowledgments:
The authors would like to acknowledge the support from Taif University Researchers Supporting Project Number (TURSP-2020/331), Taif University, Taif, Saudi Arabia.

Conflicts of Interest:
The authors declare no conflict of interest. For the form of the Lyapunov matrix P as used in [23,26], for the complete Lyapunov function in Equation (73)

Nomenclature
and Considering P = P 11 P 12 P 21 P 22 > 0 (and) Ā 11Ā12 A 21Ā22 in term (A c − GC c ) T P + P(A − GC) + C T c C c and comparing with concerning part of matrix given in vector Lyapunov equation in (104) impliesP Because the form ofP is determined from the T L transformed system, applying the inverse transformation T −1 LP T L gives Applying the transformation T L T PT L onP gives: P = P 1 P 1 L L T P 1 T T P o T + L T PL > 0 (A4)