A Novel Control Strategy Based on an Adaptive Fuzzy Model Predictive Control for Frequency Regulation of a Microgrid with Uncertain and Time-Varying Parameters

The intermittent and uncertain behavior of renewable energy sources; moreover, the increase in penetration of these resources causes some drawbacks in power grids, particularly in low-inertia microgrids. In addition to supply-side challenges, changing load rate has a considerable negative effect on small-size microgrids. Therefore, according to these challenges, the lack of balance between generation and demand is a vital issue in microgrids. One way to face these challenges would be using a suitable control strategy. In this research, an adaptive fuzzy model predictive control has been proposed as a novel control approach and has been compared with conventional controllers such as an optimal PI, and an adaptive optimal model predictive control. It is important to mention that, various types of load changing and time-varying parameters have been considered for a new model of small size microgrids in this study. The comparison and simulation results obviously indicate the effectiveness of the proposed control strategy.

weights for manipulated variables rate s y scale factors for system outputs s u scale factors of manipulated variables rate J (k) Cost function

I. INTRODUCTION
Energy consumption has gradually increased over the past two decades and will significantly increase in the coming years [1]- [3].source of energy supply would be an adequate way to address this issue [4], [5].Although RESs are a clean and environmentally friendly way to generate power and energy, they suffer from some issues due to their intermittent and uncertain behavior [6].This challenge has more effect on the small size and low-inertia microgrids and could be created problems concerning the instability of microgrids.As an example, the lack of balance between load and generation would probably cause a greater frequency deviation in such a system.Frequency fluctuation is another crucial problem not only for a conventional type of microgrids but also for RESbased microgrids, as the new generation of microgrids are mainly dominated by power converters [7]- [9].One possible approach would be to manipulate the rate of generation quickly [10], [11].For manipulating and altering the rate of energy supply, a suitable and appropriate frequency control strategy is required.Accordingly, various types of controllers have been applied to control the frequency excursion of microgrids.
A diverse type of PI and PID controllers has been considerably utilized for control of frequency, especially in conventional load frequency strategies.Ref. [12] has employed particle swarm optimization-based PID for frequency control of multi-area frequency control systems.Also, this type of controller has been compared with hill climbing and genetic algorithm-based tuned controllers.PID-based controllers are classified as traditional control methods and suffer from some drawbacks such as slow dynamic responses to the system's nonlinearity and uncertainties.In [13] and [14], in order to achieve a better frequency regulation during uncertainities, the inverter topology is changed, and the virtual inertia concept is applied using conventional PI current controllers.
Fractional order PID controller as a novel type of PID controller has received special consideration from researchers.This type of controller has been introduced based on fractional calculus and also has been used for power grids' loadfrequency control.As an example, in [15] a fractional order PI controller has been applied for damping frequency in a onearea region.The effect of time delay and the stability analysis of the system has been evaluated in that work.Although Fractional-order controllers provide great efficiency, they are sophisticated and complex approaches for both simulation and practical implementation.
Fuzzy-based controllers are another common techniques that have been comprehensively employed for frequency control.In most cases, various types of fuzzy controllers have been applied through two main control strategies.It has been used as a gain tuner of the conventional controller such as PI controllers or has been utilized as the main controller.In [16] a teaching learning-based optimization (TLBO) based fuzzy system has been employed to tune a PID controller and then the efficiency of this strategy has been investigated under parametric uncertainties in a two-area interconnected power system.
Ref. [17] proposed an optimal fuzzy system that aided an improved gray wolf method for optimization and compared the proposed strategy with PSO and TLBO-based PID controllers.In [18], a spider monkey optimization (SMO) algorithm has optimized the parameters of a fuzzy controller to decline frequency deviation in a control frequency system.The performance of the proposed controller has been compared with TLBO and PSO-based fuzzy controllers, and the results confirmed the effectiveness of the proposed controller.
Neural networks have been regarded as an intelligent approach to the frequency control of microgrids.As an illustration in [19], a PSO-based artificial neural network (ANN) technique has established a tuning method for frequency PID controller in a microgrid with high penetration of electric vehicles.The combination of fuzzy system and neural network, called adaptive neuro-fuzzy inference system (ANFIS), can improve the performance of a neural network-based control strategy.Ref. [20] has suggested ANFIS as a controller of an isolated microgrid consisting of wind turbines, solar PV, and microturbines, and indicated that this controller has declined the rise and settling time of the microgrid's frequency response.Most AI-based control strategies like fuzzy and neural networks provide a great opportunity to deal with uncertainties, nonlinearities, disturbance, and attacks [21].Accordingly, one of which has been considered for improving the efficiency of the proposed control approach in this research.
The model predictive control has received special attention, as another possibility to deal with the microgrid frequency issues.Different types of optimal MPC have been presented to deal with the control and management of AC ship microgrids [22]- [24].Ref. [25] has suggested MPC for load frequency control of an interconnected power system located in Nordic and compared it with conventional proportionalintegral (PI) controllers to demonstrate the effectiveness of MPC controller.In [26] an MPC-based frequency control strategy is proposed to maintain the frequency stabilization of a grid-connected microgrid and then compared it with a PI controller.In [27], a distributed MPC has been proposed for load frequency control of a four-area power system consisting of wind farms, thermal plants, and hydro units.Ref. [28] has developed an economic MPC method for optimal frequency control in an interconnected large-scale power system.The combination of fuzzy controller and MPC-based estimator has been used for the primary model of an isolated microgrid [29].Ref. [30] has utilized an MPC along with a fuzzy-based governor limiter to control an automatic generator control (AGC) model of a power grid.Ref. [31] has employed fuzzy-based MPC to regulate the frequency of a simple model of an isolated microgrid.The order of systems is a challenging issue in control theory, and most of the mentioned works preferred to use a simple and low-order model of microgrid without great accuracy.
In this research, have been defined with first-order or second-order transfer functions, this research has explained the model of the microgrid with detailed equations and explanations.
• As a bright contribution of this work, a novel structure of adaptive fuzzy model predictive control (AFMPC) has been applied for the control of frequency in microgrids.
The effectiveness of the proposed control approach has been investigated by comparing it with previous controllers through various scenarios qualitatively and quantitatively.
• In these scenarios, diverse conditions of the microgrid have been developed so this feature of research can be considered a further novelty.In the rest of the paper, the second section pinpoints the model of a hybrid microgrid, particularly solar PV and wind turbine, models.Equations and details of the proposed control strategy are exactly defined in section 3. Section 4 is related to results and discussion, where a comprehensive discussion has been presented through four different scenarios to depict the effectiveness of the proposed controller and compare it with other controllers.Finally, the conclusion is given in the last section.

II. MODELING OF HYBRID MICROGRID
As mentioned previously, isolated hybrid microgrids could probably play a major role in generating energy for future modern energy systems [6].The proposed energy system includes micro-diesel turbine, solar PV, and wind turbine as generation resources, and Flywheel and battery as energy storage systems (FESS & BESS).A proportional feedback controller has been considered as a droop controller of this microgrid and the proposed controller has been employed as a secondary controller.The general outline and transfer function-based modeling of the microgrid has been depicted in Figure 1.The details of any component and system equations have been presented in the following subsections.It is important to mention that the proposed strategy for the secondary controller has been given in the third section, subsequently, the results of the controller have been discussed and compared with other types of the secondary controller through diverse scenarios in the fourth section of this research.In comparison to published work, this research presents a more comprehensive model and system description.The following subsections have been given to introduce any components and systems of this model.

A. PV PANELS MODELLING
According to the basic physical model of solar panels, the maximum power of PV (P MPPT PV ) is obtained through [32]: The current term (I ) of equation ( 1) can be divided into: The current of the diode (I D ) can be calculated as [33,34]: where R s is the PV resistor, V T is thermal voltage, and N is the number of cells in each series.In addition, the current of PV (I PV ) is given through: Therefore, the required MPPT output power can be expressed as: The small-signal output power of solar cells is given by: The interconnection component and inverter of PV panels should be considered through the following equations: where T id is the time constant of interconnection and device, and T inv is inverter time constant.According to the abovementioned equations, the model of PV has been presented in Figure 2. In contrast to previous works, this model presents more accurate results.The parameter values of PV are given in Table 1.

B. WIND TURBIN MODELING
The generated power of wind turbines is pretty sensitive to wind speed [35].The output mechanical power of wind turbine is gained by [36]: where ρ is the air density, A is the blade area, V W is wind speed, and C p is the coefficient of power which is calculated by: where β is pitch angle and λ is speed ratio that is presented by [37]:   Finally, the general model of the wind turbine can be achieved by: It is important to mention that the wind turbine can benefit from independent droop and PI controller: According to these equations, the general model of wind turbine has been given in Figure 3. Parameters of the wind turbine in this work are obtained in Table 2.

C. MICRO TURBINE AND ENERGY STORAGE SYSTEM
Microturbine has a fast response for altering the rate of supply as soon as load change occurs.Therefore, microturbine has   a great responsibility in such systems to control frequency.Figure 4 indicates the model of microturbine, where T g , and T t are given as the governor and generator time constant, respectively.The droop control of the microturbine is provided by a proportional (R) feedback controller [38].
Energy storage systems including battery and supercapacitor would be a great assistance for frequency control of such systems.The dynamic of flywheel and lithium-ion [39,40] type of battery energy storage systems have been introduced by the first-order transfer function and has been shown in Figure

III. CONTROL METHODOLOGY A. MODEL PREDICTIVE CONTROL (MPC)
A model predictive control (MPC) is a model-based advanced control method that acts based on predicting the future behavior of a system.In this strategy, the optimal control actions calculate by utilizing an optimization procedure over the prediction horizon at each sampling instant.Therefore, the outline of the MPC will be represented in this section.Consider a time-varying discrete-time system as follows: where, and y k ∈ R n y are system states, control inputs, disturbances, and outputs of the system, respectively [41].Also, A k ∈ R n×n and B k ∈ R n×n u are time-varying matrices.Furthermore, E ∈ R n×n d and C ∈ R n y ×n are constant matrices.In order to establish the receding horizon rule, the system must be strictly proper which means D = 0.By considering p and m as the prediction horizon and control horizon, respectively, the system's future states are given by [10]: Therefore, the prediction of the outputs the matrix form is obtained as follows: where: . . .
The goal of the MPC strategy is that the future outputs follow the desired reference trajectory over the prediction 57518 VOLUME 10, 2022 horizon while the control inputs are minimized.So, the cost function is defined as follows: where: where, w y , w u , s y , and s u are weights of system outputs, weights for manipulated variables rate, scale factors for system outputs, and scale factors of manipulated variables rate, respectively.The first term of the cost function (22) indicates our desire to reduce the errors of the future outputs and the second term demonstrates our tendency to decrease the energy of control actions, where, w y , w u , s y , and s u are weights of system weights for manipulated variables rate, factors for system outputs, and scale factors of manipulated variables rate, respectively.The first term of the cost function (22) indicates our desire to reduce the errors of the future outputs and the second term demonstrates our tendency to decrease the energy of control actions.By combining eq. ( 21) and eq.( 22), the matrix form of the cost function is given by: where: Flowchart of AMPC strategy.

B. ADAPTIVE MPC
In this paper, we design an adaptive MPC (AMPC) for a dynamic model with varying parameters that accomplish online identification of the parameters of the model at every sampling instant.Therefore, the AMPC has two elements: first the system model identifier, and second the model predictive control.As a result, the detailed structure of the AMPC strategy has been shown in Fig. 6. where, K max is the maximum number of samplings.This section presents tuning techniques that are used to obtain optimal design parameters of AMPC.In this paper, two different techniques have been regarded including tuning by using a metaheuristic algorithm (AOMPC), as well as online tuning of AMPC using fuzzy logic (AFMPC).
In AOMPC, parameters of AMPC including sampling time, prediction horizon, control horizon, weighting factors, and scaling factors can be optimized through a metaheuristic algorithm, namely an improved gray wolf optimization algorithm.For finding more detail about this optimization algorithm, it can be referred to [42], [43].
In AFMPC, a fuzzy system, which can play adaptive and learning behavior in many systems [44], [45], has been applied to tune the parameters of MPC, the error, and the derivative of the error.In other words, f , and ḟ have been considered as inputs of the fuzzy system which have 5 membership functions and Q λ has been selected as an output of this system.The rules of the fuzzy system, which play essential roles in the performance of each fuzzy system, have been given in Table 3 and also the general shape of inputs and output of the fuzzy system has been depicted in Figure 7.

IV. RESULTS AND DISCUSSION
For evaluating the proposed control strategy and comparing it with other methods, this section describes a comprehensive number of scenarios.These scenarios have been introduced to identify the performance of controllers during various situations in the system.Moreover, they show the robustness and tracking ability of each controller against diverse types of load changes.These scenarios have been categorized into four subsections: 1. Frequency response due to load changing 2. Frequency response due to load and supply changing 3. Adding measurement noise to the second case and considering the various type of load changing 4. Considering time-varying parameters and uncertainty  The performance of the proposed controller has been investigated and compared with four types of recommended controllers including OPI, LQR, H_infinity, and AOMPC.The comparison has been discussed through four scenarios presented in the following subsections.The nominal values of microgrid parameters have been provided in Table 4.
In addition to frequency response figures, some criteria have been introduced to make a better way for the comparison of controllers [46].
A. SCENARIO 1 As mentioned in previous sections, the balance between the supply side and demand side is a crucial matter, especially in low-inertia microgrids.Loads variations can unbalance the system, so if this issue occurs suddenly, it makes a large frequency deviation.In the first case study, the fluctuation of load included two increases and one decrease has been applied to the system.At first, 0.05 p.u. load raise has occurred and consequently, frequency has fallen.According to Figure 8, AFMPC shows best-damped behavior than others; moreover, this phenomenon is shown in a detailed and better way in the 5th second, where a sudden and great load changing with 0.25 p.u amplitude has taken place.

TABLE 5. Comparison criteria (Scenario 1).
In contrast to load growth, load reduction causes positive frequency deviation.At the 10th second, due to 0.1 p.u load reduction, the frequency has increased suddenly.Afterward, controllers helped the system to remain stable and get back to the steady-state condition as soon as possible.It is evident from Figure 8 that AFMPC plays control roles much better than other controllers.In other words, the mentioned advantage and inherent behavior of the AFMPC assist it to decrease the settling time and peak of deviation that both of which are important for the control of frequency.Furthermore, the value of the defined criteria has been presented in Table 5 to approve the proposed controller performance.The AFMPC has much less error than OPI, LQR, H_infinity, and AOMPC during load alteration.

B. SCENARIO 2
In the second scenario, in addition to load changes, the output power of solar PV and wind turbine have been changed.Due to the intermittent and uncertain behavior of PV and wind turbine, this situation can be considered a logical and likely phenomenon.According to Figure 9, it can be concluded that OPI as a traditional controller, has a weak and delayed reaction to the lack of balance between supply and demand, especially when both of supply and demand sides have changed simultaneously.As another fact is achieved  from Figure 9 MPC controllers, particularly AFMPC, have appropriate responses to frequency deviation and also criteria shown in Table 6 approved this claim quantitively.As an example, the error (ISE) of the proposed controller is one_fourth of the error of AOMPC which is the best controller among recommended controllers.

C. SCENARIO 3
Considering noisy conditions is a valuable factor for evaluating every control strategy.Therefore, the small signal of the load has accompanied by noise in this case study.Moreover, various types of changes have been selected to simulate diverse possible situations.Accordingly, the supply rate of PV and wind turbines has increased or decreased constantly during a period.Figure 10 illustrates that OPI and LQR have unacceptable responses to frequency deviations, especially in the 10th second, but on the other hand, AFMPC provides the best response to frequency excursion among all controllers.Table 7 reinforces this claim about the performance of AFMPC.

D. SCENARIO 4
In the last case, the flexibility of the control strategy has been evaluated by adding an uncertain situation which is made by time-varying parameters.This investigation could be considered a sensitivity analysis.At first, the parameter of T t has changed from the nominal value to T t +50%, T t −50%, and T t − 70% in the 1 st , 5 th , and 10 th seconds, respectively.According to Figure 11, it is obvious that AFMPC  has declined difference in frequency more appropriate than others.Additionally, OPI can not be able to ensure the stability of the system in such conditions.However, adaptive-based controllers particularly AFMPC can face this challenge suitably.Thanks to AFMPC performance, this type of controller provides the best value for evaluating criteria (Table 8).Secondly, another parameter (M ) has altered from the nominal value to M + 50%, M − 50%, and M − 70% in 1st, 5th, and 10th seconds, respectively.Figure 12 and Table 9 emphasize our claim that adaptive-based controllers, particularly AFMPC, give the best performance against the parametric uncertainties.Finally, both parameters have changed with mentioned conditions simultaneously.As mentioned previously, the result of this situation shows that responses of OPI, LQR, and H_infinity are not acceptable.By contrast, AFMPC has decreased the error (IAE) from 2.57 to 0.02 in this uncertain situation.Figure 13 and Table 10 depict the detail of the above-mentioned sentence.

V. CONCLUSION
Control of frequency is an essential issue in the nowadays isolated microgrid, especially microgrids with high penetration of renewable energy resources.This research has presented a detailed model of a hybrid microgrid including solar PV, micro and wind turbine, and energy storage systems.Afterward, a novel control strategy based on an adaptive fuzzy model predictive control has been suggested to control the deviations of frequency and has been compared with other controllers for approving the performance.The simulation results have been concluded from four various scenarios and indicated that the proposed control strategy provides better performance than the previous controller.As an illustration, The proposed controller error (IAE) is one-fourth and oneeighth of the AOMPC and H_infinity controllers during normal situation (first scenario), respectively.APPENDIX A) The system's designed parameters.

FIGURE 2 .
FIGURE 2. Model of hybrid solar PV.

FIGURE 3 .
FIGURE 3. Model of hybrid wind turbine.

TABLE 2 .
Parameters of used wind turbine.

FIGURE 5 .
FIGURE 5. Model flywheel and battery energy storage systems.

FIGURE 8 .
FIGURE 8. Multi-level load changes and frequency response of Scenario 1.

FIGURE 9 .
FIGURE 9. Load and supply changes and frequency response of Scenario 2.

TABLE 1 .
Parameters of solar PV.

TABLE 3 .
Rules of fuzzy system.

TABLE 7 .
Different types of supply changes, considering with noise and frequency response of Scenario 3. Comparison criteria (Scenario 3).