Abstract
Today, with the increasing penetration of microgrids, the degree of complexity and nonlinearity of power systems has increased, causing conventional and inflexible controllers not to perform well in a wide range of operating points. In this paper, a selftuning proportionalintegral (PI)controller based on a soft computation of a combination of genetic algorithm (GA) and artificial neural network (ANN). The GAANN is used to control the frequency of a microgrid in an island mode to automatically adjust and optimize the coefficients of a PIcontroller. The proposed PIcontroller is located in the frequency control secondary loop of an island microgrid. Since the ANN is a local search algorithm and can be located in local minimum points and on the other hand improving its performance requires a lot of training data. The ANN parameters are optimized using the GA algorithm's proposed controller. Train ANN online to adapt to the system and change the PIcontrol coefficients without a lot of training data, in addition to avoiding being in the local minimum points.The microgrid tested included various distributed generation units including battery energy storage that tried to create a more realistic frequency response for the microgrid by considering nonlinear factors on the model of these resources. Finally, the simulation results with different perturbations indicate the proper performance of the proposed controller.
Introduction
Distributed generation (DG) is a source for producing electrical power with a capacity of less than 10 MW. It is frequently connected to distributionside power systems and aids in power supply. For the purpose of power systems, the principal energy in these sources is clean and renewable energy from sources like wind, solar, and geothermal energy, which is utilized in the construction of wind turbines, solar cells, gas microturbines, fuel cells, etc.^{1,2}. With the advent of DG, several problems appeared, including the maintenance and protection of resources. The issue relates to how these resources can help manage the grid's fundamental elements, such as frequency and voltage, and how electricity is transferred between the grid and DGs. The idea of microgrids was established in contemporary power systems to address these issues and take these resources and local demands into account in an integrated manner. This introduction defines microgrids as compact power grids made up of a number of DG sources and local loads. The microgrids are normally connected to the grid, but in case of an emergency brought on by the occurrence of severe disruptions, they are cut off and can provide the local loads on their own. When connected to the grid, the microgrid's frequency and power are functions of the main grid and only need to be controlled for the power of the units, but on islands, the microgrid's frequency and voltage fluctuate need an independent control^{3,4}.
Frequency control for microgirs in the litterature
Increasing the number of microgrids in power systems has changed the fundamental rules in these systems and caused the generation of resources to be distributed throughout the system. This causes the complexity and nonlinearity of power networks to increase, and as a result, we do not see the proper response of conventional controllers as before. PIcontrollers are most widely used in power systems because they have a simple structure and are costeffective, and in power systems, these controllers are trusted more than any other controller. But the problem with these controllers is that the control coefficients based on the linear conditions and the operating point of the system are adjusted by the technicians based on their knowledge and experience, and are placed in the system at once. If the nominal operating conditions change or the linear conditions of the system change due to disturbances, the values intended for these controllers will no longer be optimal and will not have the same proper response as before. The possible solution, both to use these conventional and reliable controllers and to somehow solve their problem, is to update and optimize the control coefficients depending on the changes in the system^{5,6,7}.
Numerous references have reviewed and presented various methods for frequency control of microgrids based on the optimization of controller coefficients with metaheuristic algorithms. In^{8,9}, controllers based on PI control and proportionalintegralderivative controller (PID) have been used. In^{10} the particle swarm optimization (PSO) algorithm and in^{9} the spider social behavior (SSO) algorithm is used to optimize the PID control parameters in the microgrid. In^{11}, the harmonic search (HS) algorithm is used to control the load–frequency in the microgrid. In^{12} uses a fuzzy controller whose coefficients are optimized using the PSO algorithm. In^{13,14} the model predictive control (MPC) is used to control the load–frequency of the microgrid. In^{15}, a fuzzy controller is used to control the frequency of a multimicrogrid. In^{16} twolevel MPC control^{17}, multiple MPC control, and^{18} MPC controlbased method for coordinated control of wind turbine blades and electric hybrid vehicles to reduce power fluctuations and microgrid frequency are presented. In^{19} the ZieglerNicholsbased PID method (ZNPID), in^{20} the fractionalorderbased PID method (FOPID), in^{21} the fuzzy control based fractional order PID (Fuzzy FOPID), In^{22} the kriging based surrogate fractional order PID method has been used.
The methods proposed for the adaptive PIcontroller are generally limited to linear processes. In other words, a controller with a linear model operates in a linear range, but due to the capabilities of ANN in solving problems with high mathematical complexity and the high power of these networks in estimating functions, designers are encouraged to use these networks in the design of selftuning controllers to control nonlinear processes^{23}. In^{24,25,26,27}, a PIcontroller with a hybrid ANN form is used as a direct adaptive controller to control the microgrid frequency, in which PSO and fuzzy algorithms are used to optimize ANN coefficients and their rapid training.
Paper contribution
According to several studies done on the subject's state of the art, the typical PIcontroller has not performed well due to the nonlinearity of the whole system. This is why, this paper presents an approach of a PIcontroller self tuning. It is evident that a number of methods, including PSO and others, were suggested to aid in the automatic adjustment of the PI values. However, each of these approaches have their weakness and limitation, in relation the number of parameters that must be fixed at the beginning of the algorithm start. Therefore, this paper have merge two algorithms for making this automatic tuning touch and for compensate the weaknesses on the neural network offline learn. These two algorithms, compensate their limitations and present together a usuful solution for this Multiinput system. These two algorithms, which use the genetic algorithm approach (GA) and the neural network (NN) concept, respectively, have the advantages of training from the current state and optimal calculation specification, and this can be done online while the system is running, which makes it an advantage specification.This combination of the PI, NN and GA have given a best performances for this complex system stability in relation to the RMS (Δf) and max (Δf) of microgrid frequency changes..
Paper structure
The following is the sections of the article. In “General microgrid structure and conventional control strategy” section, the microgrid structure with the conventional PIcontroller is presented. “A proposed control strategy based on ANNGA” section announces the proposed control strategy based on the combination of ANN and GA algorithms. In “Simulation results” section, the simulation results of the proposed method are exposed and discussed and finally, a conclusion will be presented in “Conclusions” section.
General microgrid structure and conventional control strategy
Microgrids are a set of mainly renewable generators that are jointly formed to feed loads. The nature of microgrids is a wideranging distributed generation that itself has distributed generation resources. In a microgrid, we mainly deal with distributed generation sources such as solar cells, wind turbines (microturbines), fuel cells, batteries (energy storage systems), hybrid generators such as CHP, as well as synchronous generators. As it is known, the power output of these sources, except for synchronous and CHP generators, is DC. For this reason, we encounter two AC and DC links in a microgrid. This concept is called a hybrid microgrid. In addition to these sources, to benefit from the output power of each, control systems are needed, which are used to control the microgrid. The control strategies in microgrids should be such that they provide the basic purpose of these networks to continue to operate in both connection and disconnection from the main grid. For this purpose, two general control structures have been considered depending on the operating conditions of the microgrid. In case the microgrid is connected to the main grid, the stability of the basic parameters of the network such as voltage and frequency is provided by the main grid and the microgrid is considered an auxiliary element in providing common loads. This mode of operation is called PQ, which means that the microgrid is controlled for the delivery of fixed active and reactive power. In the event of a disconnection, the basic parameters of the system are set by the microgrid and it must otherwise supply its loads or at least critical loads. This mode of operation is called VSI. Therefore, to apply these control methods, a series of controllers are needed on each of the microgrid sources.
Types of microgrid control
In a general sense, microgrid resources are divided into two parts: probabilistic and controllable generation. probability DG sources based on probabilistic (uncontrollable) inputs produce the desired output. These sources include solar cells, wind turbines, and even some fuel cells. These sources use sunlight, wind speed, and hydrogen, respectively, to generate power. Given that these inputs have probabilistic properties, these sources are also probability DG. Specifically, in controlling probability DG sources, we are faced with the problem of current control. In these sources, the output current (output power) of the system is controlled as CCS (controlled current source). But the important issue is the need for microgrid control over controllable resources. These sources can be such as the battery, CHP, or synchronous generator. What is required is the presence of at least one of these resources in a microgrid (in terms of microgrid stability and reliability). Controllable microgrid resources play an essential role in controlling microgrids and thus achieving microgrid stability in terms of voltage/frequency. In general, and in a specific definition, an unstable microgrid is a microgrid in which voltage/frequency collapse occurs. Voltage/frequency collapse in a microgrid means continuous increase or continuous decrease of the desired variable. On the other hand, in the microgrid, we also face the phenomenon of drop. At the opposite point of drop, there is also drop control. In the drop phenomenon, we encounter a voltage/frequency error (steadystate error).
The basis of stability in the microgrid was based on controllable resources. In these sources, the more accurate, robust, and practical the control process used, the more it improves the stability of the microgrid. For this purpose, different control levels are used sequentially in a microgrid. Each of these control levels is responsible for part of the microgrid stability tasks. In a microgrid, these levels are divided into three parts:

Primary control level: In this control, the initial stability of frequency/frequency angle is considered. This type of control is responsible for preventing voltage/frequency collapse. One of the most common methods for this purpose is frequency drop control.

Microgrid secondary control level: In this frequency/voltage drop control, the goal is stability. In the sense that events such as islanding or load change and even the occurrence of an error can cause a steadystate error in the underlying microgrid variables. This type of control is used for this purpose.
Figure 1 shows a view of the primary and secondary controls in the microgrid. In this control, the goal is to establish stability for voltage and frequency. In the presence of secondary control, this will also be the case when it becomes an island from the upstream network. This means that the frequency and voltage drop are compensated. But in addition to these two levels of control, optional controllers are also used. These controllers are responsible for improving the control process as much as possible. These controllers can be operated in parallel at any of the control levels. These types of controllers include fuzzy logic controllers, nonlinear, robust, adaptive controllers, etc. Each of these controllers according to their characteristics improve the microgrid status in terms of reliability, improving time characteristics (such as microgrid fluctuations), robustness to microgrid uncertainty, adaptation to variable parameters, etc. used.
If there is a disturbance in the power system and it disturbs the balance between generation and consumption, the frequency will fluctuate. For example, if the load increases suddenly, the frequency will drop from the nominal value, which if not controlled and limited, will see frequency instability. Here, the primary control loop is the first control loop to limit the frequency drop after disturbance. Based on the frequencyactive power characteristic of a generator, this control loop operates according to Eq. (1) and this loop is installed on the generator itself.
where f_{0} and P_{0} are the rated frequency and power of the network, respectively. The status of the frequency change in the presence and absence of the primary controller is shown in Fig. 2.
The primary control loop limits the dropped frequency but is unable to return the frequency to the nominal value hence the secondary control loop is used. In this control loop, conventional PIcontrollers are often used to return the frequency to the initial value. Adjusting these controllers will be more based on classic methods and trial and error. The problems of these methods were mentioned in the introduction, and based on these reasons, in this article, while using these controllers, we have tried to solve their problems by using an intelligent method based on ANN.
Structure of proportionalintegralderivative (PID) controllers
The PIDcontroller is a control system based on feedback, the main purpose of which is to bring the final result of the process closer to the desired value. The goal of a PIDcontroller is to steer the system toward a level, position, or whatever value we specify. According to the structure presented in Fig. 3, the two definitions "error" and "SetPoint" is of great importance in the PIDcontroller. Setpoint here means the target point (level, position, quantity, or whatever we want to reach in the control system) and on the other hand, the error is the amount of deviation (difference) between the target point and the final output value. Needless to say, the lower the error, the better, which means that we have been able to match the final value of the system exactly to our intended value. To reach this target point (error = zero, system output value = SetPoint), the PID control system uses three operators: Proportional, Integral, and Derivative. These three basic coefficients are variable in each PIDcontroller for specific applications to achieve the optimal response.
The three operators of the PIDcontroller, each of which receives the error signal as input and performs an operation on it, and finally their output is aggregated. The output of this set according to Eq. (2) is the same as the output of the PIDcontroller.
By combining three proportionalintegralderivative operators differently, we will have a different response to the error. The amount of response produced by each control mode can be optimized by changing its coefficient (k) and finally by combining these three main control modes to achieve an optimal PID system. Figure 4 compares the results of combining these three control modes (proportionalintegralderivative). P mode is usually used when the presence of offset in the system is not important and tolerable or when the process is naturally integral. PI mode is used when offset is not tolerable and there should be no steadystate error. PID is our choice when it is important to compensate for some natural inertia throughout the system and the process signals are relative without noise. According to the mentioned features, since the absence of steadystate error is important in controlling the microgrid frequency and the system is noisy, a PIcontroller is usually used instead of a PID. Because the derivative mode of the PIDcontroller increases the effect of system noise and the performance of the controller will be different from the desired answer.
In a microgrid, the total generation power of units (P_{GEN}) must be carefully controlled based on the load requirements so that a balance of generation power and consumption is established. The difference between the generated power and the load consumption can be expressed as Eq. (3).
By controlling ΔP and Δf, the system can deliver goodquality power to the load. The frequency changes Δf can be calculated from the net power changes ΔP and are expressed in ideal conditions of Eq. (4):
where K_{sys} is the constant frequency characteristic of the system. In real and practical terms, there is a time delay (T_{sys}) in the frequency characteristic. Therefore, the function of converting system frequency changes to power changes (p.u.) is expressed as Eq. (5):
Here M and D are equivalent to the inertia and damping constants of the system, respectively. Frequency deviation is detected using the 1/D + Ms, which is characteristic of the system.
According to Fig. 1, the block diagram of the frequency control method using the PIcontroller can be shown in Fig. 5. Where proportional to the frequency deviation, each unit must change its output power so that the frequency deviation Δf has its lowest value. Determining the reference power of each unit is the responsibility of the integral controller, the output of which is determined based on the frequency deviation input.
Dynamic modeling of microgrids under study
In this paper, a microgrid separate from the main grid is considered as the system under study, which is shown in Fig. 6. The microgrid consists of units including a diesel energy generator (DEG), a photovoltaic (PV), a wind turbine generator (WTG), a fuel cell (FC), an aqua electrolyzer (AE), a battery energy storage system (BESS), and a flywheel energy storage system (FESS). Given the focus of this paper on system frequency stability, a simplified model of the system frequency response is provided in Fig. 7 for a simpler analysis of how it behaves in the encounter of various disturbances. The values of the parameters used are presented in Table 1.
As you can see in Fig. 7, a PIcontroller is designed to maintain microgrid stability, which is initially configured by the ZieglerNichols method, which is one of the strongest classical methods for adjusting control coefficients, and then optimized and configured online by the proposed method based on ANN. According to Fig. 7, the characteristic function of production units is expressed through Eq. (6) to Eq. (13). ^{29}.
A proposed control strategy based on ANNGA
ANN is one of the most powerful tools in optimization processes because these networks have a wide ability to process and learn in parallel. Based on the structure of these networks and how the processing elements are combined, several important and basic applications such as mind modeling, financial modeling, time series prediction, control systems, and optimization for them are envisaged. To use ANN networks in the mentioned processes, it is necessary to consider a mathematical model of them. A simple mathematical model for analyzing their behavior is shown in Fig. 8. The vectors x, w, θ, and f(net) are input and weight vectors, bias values, and functions (linear or nonlinear) for neurons, respectively. The output of this model will be by Eq. (14).
Figure 9 shows the control framework for the online tuning of a PIcontroller used in the microgrid frequency secondary control process. To obtain the best performance of the PIcontroller and determine the relevant coefficients, there are various practice methods. In this article, we have used the combined ANNGA method to optimize PI coefficients. The structure for ANN to tune the PIcontroller online is shown in Fig. 10. The considered network is a multilayer network in which 20 neurons are considered as the input layer (power changes and frequency deviations of units, etc.) and 2 neurons are considered as the output layer (according to the number of control coefficients to be adjusted). In Fig. 10 x, w_{1} and w_{2} are the input vectors and the weight vectors of the first and second layers, respectively. The functions considered in Fig. 10 will be linear for the first layer and nonlinear for the second and output layers. ANN first learns from training data how to change the coefficients to keep the system frequency constant, and then updates these coefficients optimally with the GA algorithm so that the controller is always set to the best values.
Weight update based on error BackPropagation algorithm
This section introduces the usual method for updating weights in ANN. The BackPropagation method tries to have the minimum value of the performance function given in Eq. (15) in each weight update. y is the reference signal and y_{d} refers to the output of the output layers.
In this method, according to Fig. 10, the weights are updated to achieve the optimal values of the control coefficients (k_{i}, k_{p}) through Eq. (16). ^{28}
where Δw_{1} and Δw_{2} according to Eq. (17) and Eq. (18) are the vector of changes given in the initial values of the weights of the first and second layers so that the function is given in Eq. (15) to the smallest value, during the multi update. This operation tries to change the control coefficients so that the system frequency returns to its final value with the least fluctuation. All the parameters used in the calculation of Δw_{1} and Δw_{2}, such as σ_{j}, δ_{k}, and H_{j}, net_{j} can be seen in Fig. 10, and η = [0 1] was the learning rate.
Weight update based on GA algorithm
One of the most important issues when implementing ANN is choosing the right training algorithm. The most common ANN training algorithm is the error backpropagation algorithm. The problem with this algorithm is slow convergence and stopping at optimal local points. One approach to ANN training is to use metaheuristic algorithms such as GA. In each cycle of this training, the weighting of the parameters is done by the GA algorithm. In the training method in this section, the GA algorithm first calculates the value of the cost function for the system response by selecting a random population as the ANN weights and changes the ANN weights accordingly to improve the ANN performance and minimize the value of the cost function. Here the process of this training method is called the selfmodifying method. In this method, ANN weights are quantified as separate sections, each weight changes the ANN performance change, and the effect of each weight on ANN performance is determined, by using the intelligent GA algorithm, these changes are directed towards optimizing the ANN performance. Finally, the ANN weight coefficients are adjusted by optimizing the system efficiency. Therefore, in this method, there is no need to produce a lot of training data for ANN training, and by saving computational resources, higher accuracy can be achieved with less repetition.
The mathematical logic of the GA algorithm tries to optimize the output of the control system by minimizing an objective function. The aim here is to minimize Eq. (15) and considering that in this paper the goal is to improve the PI coefficients to control the microgrid frequency, two factors can be defined as the maximum overshoot (OS) rate and settling time (ST) of the frequency signal as Eq. (19)^{30.}
By adding Eq. (19) to Eq. (15), a new objective function can be defined by Eq. (20) to improve the performance of the PIcontroller in OS and ST control of microgrid frequency with better accuracy.
In this study, the purpose of the GA algorithm is to determine the optimal biases and weights of ANN so that Eq. (20) is minimized. In evolutionary algorithms such as GA, the interface between the algorithm and the problem is how the chromosomes (solutions) are encoded and displayed. In the proposed GA algorithm, each chromosome represents the values of the weights and bias of the ANN network, so that the w_{1} to w_{m} genes represent the weights of the first layer and the w_{2} to w_{n} genes represent the weights of the second layer of ANN, and the genes b_{1} to b_{m} and b_{2} to b_{n} represent the bias values of first and second layer neurons. Each gene can produce a real value in the range of 1 to 1. Figure 11 shows the structure of a chromosome proposed for ANN training. Finally, Fig. 12 shows the whole design process of the PIcontroller from the combination of ANN and GA algorithms as a flowchart.
Simulation results
As you know, various factors such as load changes, uncertainty, units power, nonlinear elements, noise, etc. have a direct impact on the microgrid frequency. In this section, to evaluate the performance of the proposed control method, several different disturbances are applied to the studied microgrid through MATLAB software and the performance results of the proposed method are compared with the conventional PIcontroller. To improve the model and get closer to the actual microgrid response, a series of nonlinear elements, limiters, and time delays are added to the original frequency model, which is shown in Fig. 13. One of the most important physical limitations is related to the diesel generator, which due to mechanical and thermal limitations, is not able to respond to disturbances at the same time and there is always a delay between the occurrence of disturbances and the response to it. Also, due to the existence of different filters and telecommunication channels, there is a delay in transferring the measured parameters to the control systems. Therefore, due to the mentioned reasons, delay blocks have been added to the system model. For delayed cases, a time delay of one cycle (20 ms) is provided. Control signals can also be increased or decreased to a certain extent, and the production sources have a dead band that will not be activated until the control input signal to these sources reaches a certain level. The rate of increase or decrease in generator output is also limited. Therefore, according to these cases, the model intended for the diesel generator has been made more accurate by adding a nonlinear block, according to what is shown in Fig. 13.
In Scenario 1, a step overload of 0.1 pu is applied to the microgrid. Simulation for normal states and worstcase uncertainty in parameters, ie uncertainty ± 30% of the nominal value, are considered and compared with the performance of conventional PID and PIcontrollers and the proposed intelligent controller, the results of which are shown in Fig. 14. The presence of nonlinear factors in the model of some microgrid components causes the microgrid structure to become more complex and the PIDcontroller to control frequency fluctuations does not perform as well as the PIcontroller. However, the proposed controller, due to the nonlinear behavior of the microgrid at any time, applies the appropriate correction coefficients to the PIcontroller and causes the PI coefficients to be adjusted adaptively and to control the fluctuations of the microgrid frequency well. In the simulation results of this scenario, it is observed that the proposed controller has significantly reduced the maximum overshoot and settling time of the microgrid frequency, especially when the system has uncertainty.
In Scenario 2, a perturbation according to Fig. 15 is applied to the wind speed and solar irradiation, which also shows the power changes of the respective units. The perturbation of the solar irradiation is such that at t = 10 s the solar irradiation decreases from the initial value of 0.15 pu to 0.1 pu and increases at t = 50 s to the value of 0.2 pu. The perturbation at the wind speed is such that at t = 90 s, the wind speed decreases from 7.5 m/s to 4.5 m/s and increases to 10 m/s at t = 130 s. The microgrid frequency response by applying these perturbations is shown in Fig. 16. In this scenario, the superiority of the proposed controller performance over PID and PIcontrollers in damping microgrid frequency fluctuations is well observed.
In Scenario 3, to model instantaneous load changes, the load perturbation is applied to the microgrid in the form of an irregular pulse train shown in Fig. 17. The performance of the proposed controller and how to track the load is shown in Fig. 18. Load changes are always noticed by the microgrids and the microgrid controller must be able to quickly dampen the frequency fluctuations caused by the imbalance of production and power consumption in the shortest possible time and with the least fluctuations. In this scenario, the superiority of the ANN controller over conventional PID and PI can be seen. Using the proposed controller, after each load change, the system frequency changes return to normal with the least fluctuation and in the shortest settling time, while with other controllers, the frequency has more fluctuations and returns to normal later.
In Scenario 4, the perturbations of the first and second scenarios are applied simultaneously. Also, to test the robustness of the controller in the worst case, perturbations are applied under + 30% uncertainty. The perturbations according to Fig. 19 are applied to the wind speed and solar irradiation as well as the load of the step. As shown in Fig. 20, the microgrid frequency response under these conditions is very favorable and has a relative advantage over other controllers.
In scenario 5, to finally test the stability of the system with the proposed controller and show its better performance, white noise according to Fig. 21 is applied to this model and the microgrid frequency status in both modes of use of the proposed controller and the conventional PIcontroller is shown in Fig. 22. As can be seen in this case, the designed intelligent controller has a much better performance.
In this section, the performance of the ANNGA controller was evaluated in different scenarios and the results showed its superiority over conventional controllers in controlling the microgrid frequency under various disturbances. So far, most of the results shown were related to the performance of the proposed controller, the following results will be related to the performance of the artificial neural network itself will be presented. As you can see, most of the disturbances in the microgrid will involve the same five scenarios presented in this paper with some changes in production power, load changes, etc. Therefore, to evaluate the accuracy of the ANN proposed in this paper, the total data considered for evaluation was 205 cases, which were considered separately for each scenario according to Table 2.
According to the data generated in Table 2, the ANN network is trained by the GA algorithm. Figure 23 shows the performance of the GA algorithm in optimizing ANN weights and biases. In MATLAB, there are various diagrams to examine and show the performance of ANN networks. Figure 24 shows the ANN performance diagram. This diagram shows the number of iterations on the one hand and the mean square error (mse) of the ANN on the other hand, which in this design has reached 1.364e05 in 190 iterations.
Figure 25 shows the error histogram diagram for the ANN network. In this diagram, the degree of belonging of each data category for different errors is examined.
Figure 26 shows the ROC diagram of the ANN network. In this diagram, the closer the points are to the top and left, the more appropriate it is, and the closer the forecast model is to its ideal state. The coordinates of the point (0,1) are ideal states. This point indicates that what the forecast model offers is fully consistent with the actual model. The opposite point has coordinates (1,0), which means that whatever prediction model is presented is the opposite of the actual model.
Figure 27 shows the confusion matrix of the ANN network. In this matrix, diagonal cells are related to correctly classified observations and nondiagonal cells are related to incorrectly classified observations with a percentage of performance. Here, the overall accuracy of the ANN network is 96.6%.
Finally, in scenarios, to implement the proposed controller adjusted with ANNGA, the system is first set in the desired zero states, and then by introducing disturbances to the system, ANNGA adjusts the parameters of the proposed controller so that it can move the system towards the optimal response. The optimal coefficients for this system obtained by ANNGA are presented in Table 3. By comparing the coefficients obtained with the ANNGA method and the coefficients of the ZieglerNichols method, it can be seen that the ANNGA has been able to accurately perform this operation without the need for any predetermined data, and by choosing the correct control coefficients, the response of the system is towards the output to deliver the desired.
A quantitative comparison of the performance of the proposed control method has been made with two indicators: RMS (Δf) (root mean square of frequency changes) and max (Δf) (maximum overshoot and undershoot). The improvement percentage of these two indicators in scenario 5 for a conventional PIcontroller, conventional PIDcontroller, and ANNGA method are shown in Table 4. As it can be seen, the proposed method has performed better.
Conclusions
The balance between the production and consumption of active power is the main factor in ensuring the frequency stability of the microgrid. In this paper, an ANNbased PIcontroller is proposed to control the microgrid frequency in the island mode. The proposed PIcontroller structure is such that its coefficients are adjusted by ANN at any time according to system frequency changes. Since ANN design for frequency control required a lot of training data on ANN training, in this study, the GA algorithm was used to set and train ANN. The performance of the proposed controller was such that it could perform well for various types of disturbances under different scenarios and could be easily implemented due to the nonlinear and complex structure of microgrids. Also, to increase the efficiency of the controller in different operating points, the controller was designed by considering uncertainties in some microgrid parameters so that the proposed controller is robust to changes in the working points. Finally, the performance of the proposed controller was compared with conventional PI and PIDcontrollers for different scenarios, which showed the appropriate accuracy of the proposed controller.
Even the good obtained results, this approach have some weaknesses and limitations. Basiacly, each control approach which is based on a neural network algorithm, will need a large database for having an optimal comoprtment. This is can be of the weaknesses of this part; it is hard for a standard calculator to manage a mega information. So, this is will force using a high resolution processor, which can be defficult in some positions and which increase the cost of the global control loop. In this same way, the integration of a two complex optimization algorithm, will make decision calculation hard and maybe can cause some delays on the system. Actually, this risk is low, but it can be happen in such cases. This caused delay, can make a risk to not detect a micro variation and not having the optimal decision on time.
From the other side, this work, have a potential ti be extended and ameliorated by testing more optimization solution, for testing the global comportment. Sliding mode control loop can be designed for controlling the frequency perturation and verify if it is more easy and rapid to have a stable performances after the coming perturbation on the grid side or from the different sources types. Also, testing this approch on a practical case, can be interesting to have a real result on this proposed approach. Maybe, it is better to test the execution rapidity of this control loop on this complex system and see if it is able to apply it really or not.
Human and animal rights
This article does not contain any studies with animals performed by any of the authors.
Data availability
The data that support the findings of this study are available from the corresponding author upon reasonable request.
References
Dashtdar, M., Najafi, M. & Esmaeilbeig, M. Probabilistic planning for participation of virtual power plants in the presence of the thermal power plants in energy and reserve markets. Sādhanā 45(1), 1–9 (2020).
Hosseinimoghadam, S. M. S., Dashtdar, M., Dashtdar, M. & Roghanian, H. Security control of islanded microgrid based on adaptive neurofuzzy inference system. Sci. Bull.: Ser. C Electr. Eng. Comput. Sci. 1, 189–204 (2020).
NasrAzadani, E. et al. The Canadian renewable energy laboratory: A testbed for microgrids. IEEE Electrific. Mag. 8(1), 49–60 (2020).
Hosseinimoghadam, S. M. S., Roghanian, H., Dashtdar, M., & Razavi, S. M. Powersharing control in an islanded microgrid using virtual impedance. In 2020 8th International Conference on Smart Grid (icSmartGrid), pp. 73–77 (IEEE, 2020).
Dashtdar, M., Nazir, M. S., Hosseinimoghadam, S. M. S. & Bajaj, M. Improving the sharing of active and reactive power of the islanded microgrid based on load voltage control. Smart Science 1, 1–16 (2021).
Chowdhury, S. Microgrids and Active Distribution Networks (2021).
Hosseinimoghadam, S. M. S., Dashtdar, M. & Dashtdar, M. Improving the sharing of reactive power in an islanded microgrid based on adaptive droop control with virtual impedance. Autom. Control Comput. Sci. 55(2), 155–166 (2021).
Garces, A. Smallsignal stability in island residential microgrids considering droop controls and multiple scenarios of generation. Electr. Power Syst. Res. 185, 106371 (2020).
Annamraju, A., & Nandiraju, S. Frequency control in an autonomous twoarea hybrid microgrid using grasshopper optimizationbased robust PID controller. In 2018 8th IEEE India International Conference on Power Electronics (IICPE), pp. 1–6 (IEEE, 2018).
Mishra, D., Nayak, P. C., & Prusty, R. C. PSO optimized PIDF controller for Loadfrequency control of AC MultiIslandedMicro grid system. In 2020 International Conference on Renewable Energy Integration into Smart Grids: A Multidisciplinary Approach to Technology Modelling and Simulation (ICREISG), pp. 116–121 (IEEE, 2020).
Abdulwahab, I., Faskari, S. A., Belgore, T. A. & Babaita, T. A. An improved hybrid microgrid load frequency control scheme for an autonomous system. FUOYE J. Eng. Technol. 6(4), 1 (2021).
Abazari, A., Dozein, M. G., & Monsef, H. A new load frequency control strategy for an AC microgrid: PSObased Fuzzy logic controlling approach. In 2018 Smart Grid Conference (SGC), pp. 1–7 (IEEE, 2018).
Ranga, V. P. S. R. V., Sesha, S. & Kesanakurthy, S. S. Model predictive control approach for frequency and voltage control of standalone microgrid. IET Gen. Transm. Distrib. 12(14), 3405–3413 (2018).
Abadi, S. A. G. K., Habibi, S. I., Khalili, T. & Bidram, A. A model predictive control strategy for performance improvement of hybrid energy storage systems in DC microgrids. IEEE Access 1, 1 (2022).
Abazari, A., Monsef, H. & Bin, Wu. Coordination strategies of distributed energy resources including FESS, DEG, FC and WTG in load frequency control (LFC) scheme of hybrid isolated microgrid. Int. J. Electr. Power Energy Syst. 109, 535–547 (2019).
Leng, M., Zheng, C., Dragicevic, T., Zhou, G., Blaabjerg, F., & Rodriguez, J. Modulated Model Predictive Control for Dynamic Stabilization of DC Microgrid. In 2020 IEEE 11th International Symposium on Power Electronics for Distributed Generation Systems (PEDG), pp. 527–530 (IEEE, 2020).
Yang, H., Li, T., Long, Y., Philip, C. L. & Xiao, Y. Distributed virtual inertia implementation of multiple electric springs based on model predictive control in DC microgrids. IEEE Trans. Ind. Electron. 1, 1 (2021).
Zhang, J., Shao, X., Li, Y., Lin, J., Li, F., & Zhang, Z. Research on frequency regulation strategy based on model predictive control for windhydrostorage complementary microgrid. In 2020 4th International Conference on HVDC (HVDC), pp. 1031–1036 (IEEE, 2020).
Khodja, M. A., Tadjine, M., Boucherit, M. S., & Benzaoui, M. Experimental dynamics identification and control of a quadcopter. In 2017 6th International Conference on Systems and Control (ICSC), pp. 498–502 (IEEE, 2017).
Zaheeruddin, & Singh, K. Intelligent fractionalorderbased centralized frequency controller for microgrid. IETE J. Res. 1–15 (2020).
Oshnoei, S., Aghamohammadi, M., & Oshnoei, S. A novel fractional order controller based on fuzzy logic for regulating the frequency of an islanded microgrid. In 2019 International Power System Conference (PSC), pp. 320–326 (IEEE, 2019).
Khosravi, S., Beheshti, M. T. H. & Rastegar, H. Robust control of islanded microgrid frequency using fractionalorder PID. Iran. J. Sci. Technol. Trans. Electr. Eng. 44(3), 1207–1220 (2020).
Shakeel, F. M. & Malik, O. P. Online selftuning adaptive control of an inverter in a gridtied microgrid. Electric Power Syst. Res. 178, 106045 (2020).
Safari, A., Babaei, F. & Farrokhifar, M. A load frequency control using a PSObased ANN for microgrids in the presence of electric vehicles. Int. J. Ambient Energy 42(6), 688–700 (2021).
Mahrouch, A. & Ouassaid, M. Primary frequency regulation based on deloaded control, ANN, and 3Dfuzzy logic controller for hybrid autonomous microgrid. Technol. Econ. Smart Grids Sustain. Energy 7(1), 1–12 (2022).
Patowary, M., Panda, G., Naidu, B. R. & Deka, B. C. ANNbased adaptive current controller for ongrid DG system to meet frequency deviation and transient load challenges with hardware implementation. IET Renew. Power Gen. 12(1), 61–71 (2018).
Padhi, J. R., Debnath, M. K. & Kar, S. K. Selftuning FuzzyPIcontroller for load frequency control analysis with the integration of wind energy. Energy Sources Part A Recov. Util. Environ. Effects 44(1), 613–631 (2022).
Habibi, F., Bevrani, H. & Moshtag, J. Designing a selftuning frequency controller based on ANNs for an isolated microgrid. Iran. J. Electr. Comput. Eng. 10(2), 88–95 (2012).
Dashtdar, M. et al. Frequency control of the islanded microgrid based on optimised model predictive control by PSO. IET Renew. Power Gen. 1, 1 (2022).
Dashtdar, M. et al. Improving the power quality of island microgrid with voltage and frequency control based on a hybrid genetic algorithm and PSO. IEEE Access 1, 1 (2022).
Funding
Open access funding provided by The Science, Technology & Innovation Funding Authority (STDF) in cooperation with The Egyptian Knowledge Bank (EKB).
Author information
Authors and Affiliations
Contributions
The authors contributed to each part of this paper equally. The authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Dashtdar, M., Flah, A., Hosseinimoghadam, S.M.S. et al. Frequency control of the islanded microgrid including energy storage using soft computing. Sci Rep 12, 20409 (2022). https://doi.org/10.1038/s41598022247586
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598022247586
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.