Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2022 Nov 27;12:20409. doi: 10.1038/s41598-022-24758-6

Frequency control of the islanded microgrid including energy storage using soft computing

Masoud Dashtdar 1, Aymen Flah 2, Seyed Mohammad Sadegh Hosseinimoghadam 3, Attia El-Fergany 4,
PMCID: PMC9701778  PMID: 36437297

Abstract

Today, with the increasing penetration of microgrids, the degree of complexity and non-linearity 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 self-tuning proportional-integral (PI)-controller based on a soft computation of a combination of genetic algorithm (GA) and artificial neural network (ANN). The GA-ANN is used to control the frequency of a microgrid in an island mode to automatically adjust and optimize the coefficients of a PI-controller. The proposed PI-controller 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 PI-control 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.

Subject terms: Energy science and technology, Engineering

Introduction

Distributed generation (DG) is a source for producing electrical power with a capacity of less than 10 MW. It is frequently connected to distribution-side 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 control3,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 non-linearity of power networks to increase, and as a result, we do not see the proper response of conventional controllers as before. PI-controllers are most widely used in power systems because they have a simple structure and are cost-effective, 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 system57.

Numerous references have reviewed and presented various methods for frequency control of microgrids based on the optimization of controller coefficients with meta-heuristic algorithms. In8,9, controllers based on PI control and proportional-integral-derivative controller (PID) have been used. In10 the particle swarm optimization (PSO) algorithm and in9 the spider social behavior (SSO) algorithm is used to optimize the PID control parameters in the microgrid. In11, the harmonic search (HS) algorithm is used to control the load–frequency in the microgrid. In12 uses a fuzzy controller whose coefficients are optimized using the PSO algorithm. In13,14 the model predictive control (MPC) is used to control the load–frequency of the microgrid. In15, a fuzzy controller is used to control the frequency of a multi-microgrid. In16 two-level MPC control17, multiple MPC control, and18 MPC control-based method for coordinated control of wind turbine blades and electric hybrid vehicles to reduce power fluctuations and microgrid frequency are presented. In19 the Ziegler-Nichols-based PID method (ZN-PID), in20 the fractional-order-based PID method (FOPID), in21 the fuzzy control based fractional order PID (Fuzzy FOPID), In22 the kriging based surrogate fractional order PID method has been used.

The methods proposed for the adaptive PI-controller 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 self-tuning controllers to control nonlinear processes23. In2427, a PI-controller 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 PI-controller has not performed well due to the nonlinearity of the whole system. This is why, this paper presents an approach of a PI-controller 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 Multi-input 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 PI-controller is presented. “A proposed control strategy based on ANN-GA” 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 wide-ranging 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 (steady-state 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 steady-state 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.

Figure 1.

Figure 1

Primary and secondary control in the microgrid.

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 frequency-active power characteristic of a generator, this control loop operates according to Eq. (1) and this loop is installed on the generator itself.

f-f0=-kpP-P0 1

where f0 and P0 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.

Figure 2.

Figure 2

System frequency, (a) without a primary controller, (b) with a primary controller.

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 PI-controllers 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 proportional-integral-derivative (PID) controllers

The PID-controller 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 PID-controller 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 PID-controller. 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 PID-controller for specific applications to achieve the optimal response.

Figure 3.

Figure 3

PID controller structure.

The three operators of the PID-controller, 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 PID-controller.

outputt=kpet+kitoeτdτ+kdde(t)dtGc=kp+kis+kds 2

By combining three proportional-integral-derivative 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 (proportional-integral-derivative). 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 steady-state 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 steady-state error is important in controlling the microgrid frequency and the system is noisy, a PI-controller is usually used instead of a PID. Because the derivative mode of the PID-controller increases the effect of system noise and the performance of the controller will be different from the desired answer.

Figure 4.

Figure 4

Comparison of three modes P, PI, and PID.

In a microgrid, the total generation power of units (PGEN) 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).

ΔP=PGEN-PLoad 3

By controlling ΔP and Δf, the system can deliver good-quality 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):

Δf=ΔPKsys 4

where Ksys is the constant frequency characteristic of the system. In real and practical terms, there is a time delay (Tsys) in the frequency characteristic. Therefore, the function of converting system frequency changes to power changes (p.u.) is expressed as Eq. (5):

Gsys=ΔfΔP=1Ksys1+sTsys=1D+Ms 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 PI-controller 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.

Figure 5.

Figure 5

Microgrid frequency control based on PIcontroller.

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.

Figure 6.

Figure 6

Microgrid under study.

Figure 7.

Figure 7

Microgrid frequency response model.

Table 1.

The values of the parameters used in the microgrid frequency model.

Parameter Value Parameter Value
D (pu/HZ) 0.012 TWTG (s) 1.5
2H (pu.s) 0.1667 TAE (s) 0.5
TFESS (s) 0.1 KWTG 1
TBESS (s) 0.1 R (HZ/pu) 3
TFC (s) 4 Ka 0.6
KFC 1/100 KDEG 1/300
KAE 1/500 KFESS −1/100
KBESS −1/300 KPV 1
TDEG (s) 2 TPV 1.8

As you can see in Fig. 7, a PI-controller is designed to maintain microgrid stability, which is initially configured by the Ziegler-Nichols 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.

ΔPWTG=kakWTGΔPWTWTG-ΔPWTGTWTGGWTGs=kakWTG1+sTWTG=ΔPWTG(s)ΔPW(s) 6
ΔPPV=kPVΔTPV-ΔPPVTPVGPVs=kPV1+sTPV=ΔPPV(s)Δ(s) 7
ΔPDEG=kDEGΔPCTDEG-kDEGΔFRTDEG-ΔPDEGTDEGGDEGs=kDEG1+sTDEG=ΔPDEG(s)ΔUDEG(s)ΔUDEGs=ΔPCs-ΔF(s)R 8
ΔPAE=kAE1-kaΔPWTGTAE-ΔPAETAEGAEs=kAE1+sTAE=ΔPAE(s)ΔPt(s)ΔPts=1-KtΔPWTGs,Kt=0.6 9
ΔPFC=kFCΔPAETFC-ΔPFCTFCGFCs=kFC1+sTFC=ΔPFCsΔPAEs 10
ΔPBESS=kBESSΔUBESSTBESS-ΔPBESSTBESSΔPFESS=kFESSΔUFESSTFESS-ΔPFESSTFESS 11
GBESSs=kBESS1+sTBESS=ΔPBESSsΔFBESSsGFESSs=kFESS1+sTFESS=ΔPFESSsΔFFESSs 12
Δf×1R=ΔP,Δf=f-f0,ΔP=P-P0, 13

A proposed control strategy based on ANN-GA

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).

yk=fj=1nwjxjk+w0θ 14

Figure 8.

Figure 8

A simple mathematical model of neurons in ANN.

Figure 9 shows the control framework for the online tuning of a PI-controller used in the microgrid frequency secondary control process. To obtain the best performance of the PI-controller and determine the relevant coefficients, there are various practice methods. In this article, we have used the combined ANN-GA method to optimize PI coefficients. The structure for ANN to tune the PI-controller 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, w1 and w2 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.

Figure 9.

Figure 9

Proposed control structure for self-tuning PI-controller.

Figure 10.

Figure 10

ANN structure for the online tuning of a PI-controller.

Weight update based on error Back-Propagation algorithm

This section introduces the usual method for updating weights in ANN. The Back-Propagation 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 yd refers to the output of the output layers.

yE=0.5y-yd2 15

In this method, according to Fig. 10, the weights are updated to achieve the optimal values of the control coefficients (ki, kp) through Eq. (16). 28

w2k+1=w2k+Δw2=w2k+ησHw1k+1=w1k+Δw1=w1k+ηδx 16

where Δw1 and Δw2 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 Δw1 and Δw2, such as σj, δk, and Hj, netj can be seen in Fig. 10, and η = [0 1] was the learning rate.

Δw2=-ηEw2Ew2=Ey·yu·unetk·netkw2unetk=fnetk,netkw2=HjEy·yu·unetk=δkΔw2=ηδkHj 17
Δw1=-ηEw1Ew1=Ey·yu·unetk·netkHj·Hjnetj·netjw1unetk=fnetk,netkHj=w2,Hjnetj=fnetjnetjwj=xΔw1=ηδkfnetkw2fnetjx=ησjx 18

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 back-propagation 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 self-modifying 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.

F=α·OS+(1-α)·STAssumingα=0.5,F=0.5(OS+ST) 19

By adding Eq. (19) to Eq. (15), a new objective function can be defined by Eq. (20) to improve the performance of the PI-controller in OS and ST control of microgrid frequency with better accuracy.

E=0.5y-yd2+F 20

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 w1 to wm genes represent the weights of the first layer and the w2 to wn genes represent the weights of the second layer of ANN, and the genes b1 to bm and b2 to bn 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 PI-controller from the combination of ANN and GA algorithms as a flowchart.

Figure 11.

Figure 11

Structure of a chromosome for the proposed ANN training.

Figure 12.

Figure 12

Flowchart of the proposed controller design.

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 PI-controller. 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 non-linear block, according to what is shown in Fig. 13.

Figure 13.

Figure 13

Microgrid frequency model considering physical constraints.

In Scenario 1, a step overload of 0.1 pu is applied to the microgrid. Simulation for normal states and worst-case uncertainty in parameters, ie uncertainty ± 30% of the nominal value, are considered and compared with the performance of conventional PID and PI-controllers 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 PID-controller to control frequency fluctuations does not perform as well as the PI-controller. However, the proposed controller, due to the nonlinear behavior of the microgrid at any time, applies the appropriate correction coefficients to the PI-controller 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.

Figure 14.

Figure 14

Scenario 1- Microgrid frequency response to step load perturbation for (a) normal state, (b) with + 30% uncertainty, (c) with -30% 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 PI-controllers in damping microgrid frequency fluctuations is well observed.

Figure 15.

Figure 15

Scenario 2- Disturbances applied to wind speed and solar irradiation and related output powers.

Figure 16.

Figure 16

Scenario 2- The microgrid frequency response to changes in wind speed and solar irradiation.

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.

Figure 17.

Figure 17

Scenario 3- Load perturbation applied to the microgrid as an irregular pulse train.

Figure 18.

Figure 18

Scenario 3- Microgrid frequency response to an irregular pulse train.

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.

Figure 19.

Figure 19

Scenario 4- Disturbances applied to solar irradiation, wind speed, and grid load.

Figure 20.

Figure 20

Scenario 4- Microgrid frequency response to solar irradiation, wind speed, and grid load under + 30% uncertainty.

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 PI-controller is shown in Fig. 22. As can be seen in this case, the designed intelligent controller has a much better performance.

Figure 21.

Figure 21

Scenario 5- White noise.

Figure 22.

Figure 22

Scenario 5- Microgrid frequency response to white noise.

In this section, the performance of the ANN-GA 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.

Table 2.

Total data generated.

Scenarios Number of data
Scenario 1 (load range(pu) × uncertainty) 10 × 4 = 40
Scenario 2 (power range(pu) + time of disturbances) 24 + 24 = 48
Scenario 3 (Load range(pu) × time of disturbances) 10 × 5 = 50
Scenario 4 10 + 48 = 58
Scenario 5 (Noise on output power) 9
Total 205

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.364e-05 in 190 iterations.

Figure 23.

Figure 23

ANN training process by GA algorithm.

Figure 24.

Figure 24

Performance diagram of the ANN.

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 25.

Figure 25

Error histogram diagram of the ANN.

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 26.

Figure 26

ROC diagram of the ANN.

Figure 27 shows the confusion matrix of the ANN network. In this matrix, diagonal cells are related to correctly classified observations and non-diagonal cells are related to incorrectly classified observations with a percentage of performance. Here, the overall accuracy of the ANN network is 96.6%.

Figure 27.

Figure 27

Confusion matrix of the ANN.

Finally, in scenarios, to implement the proposed controller adjusted with ANN-GA, the system is first set in the desired zero states, and then by introducing disturbances to the system, ANN-GA 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 ANN-GA are presented in Table 3. By comparing the coefficients obtained with the ANN-GA method and the coefficients of the Ziegler-Nichols method, it can be seen that the ANN-GA 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.

Table 3.

Optimal coefficients of the PI-controller.

Methods PI-controller coefficients
Kp Ki
Ziegler–nichols 5 22
ANN-GA 4.09 20.42

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 PI-controller, conventional PID-controller, and ANN-GA method are shown in Table 4. As it can be seen, the proposed method has performed better.

Table 4.

Percentage improvement of RMS (Δf) and max (|Δf|) indexes.

Methods Indexes
RMS (Δf) (%) Max (|Δf|) (%)
Conventional PI-controller 17 15
Conventional PID-controller 32 34
ANN-GA 46 47

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 ANN-based PI-controller is proposed to control the microgrid frequency in the island mode. The proposed PI-controller 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 PID-controllers 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.

Author contributions

The authors contributed to each part of this paper equally. The authors read and approved the final manuscript.

Funding

Open access funding provided by The Science, Technology & Innovation Funding Authority (STDF) in cooperation with The Egyptian Knowledge Bank (EKB).

Data availability

The data that support the findings of this study are available from the corresponding author upon reasonable request.

Competing interests

The authors declare no competing interests.

Footnotes

Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.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ā. 2020;45(1):1–9. doi: 10.1007/s12046-020-01335-z. [DOI] [Google Scholar]
  • 2.Hosseinimoghadam SMS, Dashtdar M, Dashtdar M, Roghanian H. Security control of islanded micro-grid based on adaptive neuro-fuzzy inference system. Sci. Bull.: Ser. C Electr. Eng. Comput. Sci. 2020;1:189–204. [Google Scholar]
  • 3.Nasr-Azadani E, Peter S, Zheng W, Rajda J, Cañizares C, Kazerani M, Veneman E, et al. The Canadian renewable energy laboratory: A testbed for microgrids. IEEE Electrific. Mag. 2020;8(1):49–60. doi: 10.1109/MELE.2019.2962889. [DOI] [Google Scholar]
  • 4.Hosseinimoghadam, S. M. S., Roghanian, H., Dashtdar, M., & Razavi, S. M. Power-sharing control in an islanded microgrid using virtual impedance. In 2020 8th International Conference on Smart Grid (icSmartGrid), pp. 73–77 (IEEE, 2020).
  • 5.Dashtdar M, Nazir MS, Hosseinimoghadam SMS, Bajaj M. Improving the sharing of active and reactive power of the islanded microgrid based on load voltage control. Smart Science. 2021;1:1–16. [Google Scholar]
  • 6.Chowdhury, S. Microgrids and Active Distribution Networks (2021).
  • 7.Hosseinimoghadam SMS, 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. 2021;55(2):155–166. doi: 10.3103/S0146411621020061. [DOI] [Google Scholar]
  • 8.Garces A. Small-signal stability in island residential microgrids considering droop controls and multiple scenarios of generation. Electr. Power Syst. Res. 2020;185:106371. doi: 10.1016/j.epsr.2020.106371. [DOI] [Google Scholar]
  • 9.Annamraju, A., & Nandiraju, S. Frequency control in an autonomous two-area hybrid microgrid using grasshopper optimization-based robust PID controller. In 2018 8th IEEE India International Conference on Power Electronics (IICPE), pp. 1–6 (IEEE, 2018).
  • 10.Mishra, D., Nayak, P. C., & Prusty, R. C. PSO optimized PIDF controller for Load-frequency control of AC Multi-Islanded-Micro 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).
  • 11.Abdulwahab I, Faskari SA, Belgore TA, Babaita TA. An improved hybrid micro-grid load frequency control scheme for an autonomous system. FUOYE J. Eng. Technol. 2021;6(4):1. doi: 10.46792/fuoyejet.v6i4.698. [DOI] [Google Scholar]
  • 12.Abazari, A., Dozein, M. G., & Monsef, H. A new load frequency control strategy for an AC micro-grid: PSO-based Fuzzy logic controlling approach. In 2018 Smart Grid Conference (SGC), pp. 1–7 (IEEE, 2018).
  • 13.Ranga VPSRV, Sesha S, Kesanakurthy SS. Model predictive control approach for frequency and voltage control of standalone micro-grid. IET Gen. Transm. Distrib. 2018;12(14):3405–3413. doi: 10.1049/iet-gtd.2017.0804. [DOI] [Google Scholar]
  • 14.Abadi SAGK, Habibi SI, Khalili T, Bidram A. A model predictive control strategy for performance improvement of hybrid energy storage systems in DC microgrids. IEEE Access. 2022;1:1. [Google Scholar]
  • 15.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 micro-grid. Int. J. Electr. Power Energy Syst. 2019;109:535–547. doi: 10.1016/j.ijepes.2019.02.029. [DOI] [Google Scholar]
  • 16.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).
  • 17.Yang H, Li T, Long Y, Philip CL, Xiao Y. Distributed virtual inertia implementation of multiple electric springs based on model predictive control in DC microgrids. IEEE Trans. Ind. Electron. 2021;1:1. [Google Scholar]
  • 18.Zhang, J., Shao, X., Li, Y., Lin, J., Li, F., & Zhang, Z. Research on frequency regulation strategy based on model predictive control for wind-hydro-storage complementary microgrid. In 2020 4th International Conference on HVDC (HVDC), pp. 1031–1036 (IEEE, 2020).
  • 19.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).
  • 20.Zaheeruddin, & Singh, K. Intelligent fractional-order-based centralized frequency controller for microgrid. IETE J. Res. 1–15 (2020).
  • 21.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).
  • 22.Khosravi S, Beheshti MTH, Rastegar H. Robust control of islanded microgrid frequency using fractional-order PID. Iran. J. Sci. Technol. Trans. Electr. Eng. 2020;44(3):1207–1220. doi: 10.1007/s40998-019-00303-6. [DOI] [Google Scholar]
  • 23.Shakeel FM, Malik OP. On-line self-tuning adaptive control of an inverter in a grid-tied micro-grid. Electric Power Syst. Res. 2020;178:106045. doi: 10.1016/j.epsr.2019.106045. [DOI] [Google Scholar]
  • 24.Safari A, Babaei F, Farrokhifar M. A load frequency control using a PSO-based ANN for micro-grids in the presence of electric vehicles. Int. J. Ambient Energy. 2021;42(6):688–700. doi: 10.1080/01430750.2018.1563811. [DOI] [Google Scholar]
  • 25.Mahrouch A, Ouassaid M. Primary frequency regulation based on deloaded control, ANN, and 3D-fuzzy logic controller for hybrid autonomous microgrid. Technol. Econ. Smart Grids Sustain. Energy. 2022;7(1):1–12. doi: 10.1007/s40866-022-00125-2. [DOI] [Google Scholar]
  • 26.Patowary M, Panda G, Naidu BR, Deka BC. ANN-based adaptive current controller for on-grid DG system to meet frequency deviation and transient load challenges with hardware implementation. IET Renew. Power Gen. 2018;12(1):61–71. doi: 10.1049/iet-rpg.2017.0142. [DOI] [Google Scholar]
  • 27.Padhi JR, Debnath MK, Kar SK. Self-tuning Fuzzy-PI-controller for load frequency control analysis with the integration of wind energy. Energy Sources Part A Recov. Util. Environ. Effects. 2022;44(1):613–631. doi: 10.1080/15567036.2022.2049928. [DOI] [Google Scholar]
  • 28.Habibi F, Bevrani H, Moshtag J. Designing a self-tuning frequency controller based on ANNs for an isolated microgrid. Iran. J. Electr. Comput. Eng. 2012;10(2):88–95. [Google Scholar]
  • 29.Dashtdar M, Flah A, El-Bayeh CZ, Tostado-Véliz M, Durra AA, Aleem SHEA, Ali ZM. Frequency control of the islanded microgrid based on optimised model predictive control by PSO. IET Renew. Power Gen. 2022;1:1. [Google Scholar]
  • 30.Dashtdar M, Flah A, Hosseinimoghadam SMS, Reddy CHR, Kotb H, AboRas KM, Edson CB. Improving the power quality of island microgrid with voltage and frequency control based on a hybrid genetic algorithm and PSO. IEEE Access. 2022;1:1. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.


Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES