Keywords

1 Introduction

The microgrid based renewable energy sources offer a major possibility of electricity production independently of conventional sources in condition to accept the natural fluctuation [1]. During the last decades, the limit of fossil fuel enforces the use of renewable energy sources which consist an alternative the hybrid system with diesel engine generator, photovoltaic, wind and energy storage system is popularly used for lament rural isolated [2]. The use of hybrid energy system with various renewable energy sources is economical technique optimal solution of electrical production problem. The advantage of hybrid energy system based renewable energy sources such as wind and photovoltaic with a conventional source is the satisfaction of energy demand every time although the intermittent nature of primary sources such as wind and solar on the one hand, the non-correlation of the load that fluctuates over the year and the resources. These same sources of energy can be combined with other sources such as the fuel cell using hydrogen produced by an electrolyzer connected to a renewable energy source. The autonomy of this system will be ensured by an efficient storage system for the continuity of the service. The energy storage system plays an important role in the hybrid system through its efficient storage and release of energy in a short time. For stand-alone energy systems the cost of storage represents the greatest constraints of the overall system cost for large power installations. Minimizing the cost of storage and maximizing capacity is the key reason for combining wind and PV systems with a storage system [3]. This hybrid system uses conventional (DG) and another renewable (PV, WTG) sources with a storage system (BESS, BFSS) to compensate for energy when the demand exceeds the capacity of the renewable source. A hybrid system uses static converters (AC-DC-AC) for the exchange of energy between different sources. As a result, the electric power produced has significant fluctuations which make the stability of the microgrid difficult. One of the important control issues associated with a microgrid is the frequency regulation [4]. Several meta-heuristic optimization techniques are often applied for the determination of control system parameters. This article consists of the use of genetic algorithms to optimize the parameters of the PID regulator in order to control the frequency of this hybrid microgrid. AGs as an intelligent optimization method can give a robust response [5]. The principle of genetic algorithms is presented in [6]. Control by the PID controller (proportional, integral and derivative) is often used for several controls scheme, it is efficient and simple to be implemented [7].

2 Configuration Proposed Hybrid System

Figure 1 illustrates the configuration of the studied proposed hybrid system [8]. This system consists of three wind turbine generators (WTG), a photovoltaic (PV), a diesel generator (DEG), two fuel cells (FC), an aqua electrolyzer (AE), an electrochemical battery (BESS), a battery electromechanical (FESS) and static converters (DC and AC). Table 1 present the different parameters of the proposed system.

Fig. 1.
figure 1

Proposed configuration of the hybrid energy system.

Table 1. Parameters of hybrid system offers

The use of the storage system is required for the autonomous microgrid. In this system using an electrochemical battery and the electromechanical battery, which is a flywheel storing energy in kinetic form. PV, AE, CF, BESS and FESS require power converters to exchange energy with the AC system studied. Assume that the BESS FESS and have sufficient capacity to store excess energy generated by the generators subsystems. When the power demand increases, the storage system (BESS and/or FESS) can release enough energy to the load connected in a very short time. The diversity of sources and storage system requires the use of electronic converters powers for connecting the various devices of the hybrid system [8].

2.1 Wind Generators

The wind generation system is based on the conversion of wind energy into electrical energy. This conversion occurs in two steps: The turbine extracts a part of the kinetic energy of wind to convert it into electricity. The generator receives the mechanical energy and energy transforms to be sent to the microgrid. The output of the wind generator depends on wind speed. The wind system can be simplified by a first-order system. The WTG transfer function is represented as [9]:

$$ G_{WTG} \left( s \right) = \frac{{K_{WTG} }}{{1 + s.T_{WTG} }} $$
(1)

2.2 Photovoltaic System

The effect PV is a physical process base through which the solar radiation is converted directly into electrical energy. The PV system produces a DC voltage which is converted to alternative using DC-AC converters. For the low-frequency domain analysis, it is represented by a first-order model for a given transfer function as [9].

$$ G_{PV} = \frac{{K_{PV} }}{{1 + ST_{PV} }} $$
(2)

2.3 Fuel Cell

The fuel cell has become a promising solution to the distributed generation of electrical energy. It allows the conversion of chemical energy into electricity through the chemical reaction between hydrogen and oxygen. Fuel cells provide energy with advantages of high efficiency, low pollution and the heat exhaust reusability and water [8]. The fuel cell generator is a higher-order model and a non-linearity. In the field of low-frequency analysis, it is represented by a first-order transfer function given as follows [9]:

$$ {\text{G}}_{\text{FC}} = \frac{{{\text{K}}_{\text{FC}} }}{{1 + {\text{ST}}_{\text{FC}} }}\;\;\;{\text{or}}\;\;\;\frac{{\Delta {\text{P}}_{\text{FCK}} }}{{\Delta {\text{P}}_{\text{AE}} }} $$
(3)

2.4 Diesel Generator

To ensure continuity of production of electrical energy in an autonomous network it is necessary to add one or more diesel generators. In the system studied classical generator consists of a diesel engine which is coupled to a synchronous generator. The normal operation of the generator is as follows: the torque supplied to the alternator by the motor rotates the rotor of the alternator, which generates phase currents [10] stator. A diesel generator can be simplified by a first-order model as follows:

$$ {\text{G}}_{\text{DEG}} = \frac{{{\text{K}}_{\text{DEG}} }}{{1 + {\text{ST}}_{\text{DEG}} }}\;\;\;{\text{or}}\;\;\;\frac{{\Delta {\text{P}}_{\text{DEG}} }}{{\Delta {\text{f}}}} $$
(4)

2.5 Aqua Electrolyzer

Part of the power generated by PV or WTG is absorbed by AE to produce hydrogen for use by the fuel cell. The hydrogen decomposition of water is ensured by the passage of an electric run between two electrodes separated by an electrolyte. The model of the transfer function of an electrolyzer is shown below [2].

$$ \varvec{G}_{{\varvec{AE}}} = \frac{{{\mathbf{K}}_{{{\mathbf{AE}}}} }}{{1 + {\mathbf{ST}}_{{{\mathbf{AE}}}} }} = \frac{{\Delta {\mathbf{P}}_{{{\mathbf{AE}}}} }}{{\Delta {\mathbf{P}}_{{{\mathbf{WTG}}}} \left( {1 - {\mathbf{Kn}}} \right) }}\;\;\; {\mathbf{or}}\;\;\;\frac{{\Delta {\mathbf{P}}_{{{\mathbf{AE}}}} }}{{\Delta {\mathbf{P}}_{{{\mathbf{PV}}}} \left( {1 - {\mathbf{Kn}}} \right) }} $$
(5)

2.6 Energy Storage Systems

In order to minimize the operation of the diesel generator and therefore the emissions of gas, it is necessary to use an energy storage system. This enables us to use renewable resources to the maximum possible recharging the batteries by the surplus energy produced by PV and/or WTG. Finally, in the case of a sudden demand for power, storage fills the source function (buffer) until the engine starts and takes the role of the supply of energy [12]. The storage system is constituted by two different types of battery; fuel battery (BESS) and battery flywheel (FESS). Both linear models are presented by the following first-order transfer functions [8]:

$$ {\mathbf{G}}_{{{\mathbf{BESS}}}} = \frac{{{\mathbf{K}}_{{{\mathbf{BESS}}}} }}{{ 1\, + \,{\mathbf{s}}.{\mathbf{T}}_{{{\mathbf{BESS}}}} }} $$
(6)
$$ {\mathbf{G}}_{{{\mathbf{FESS}}}} = \frac{{{\mathbf{K}}_{{{\mathbf{FESS}}}} }}{{1\, + \,{\mathbf{s}}.{\mathbf{T}}_{{{\mathbf{FESS}}}} }} $$
(7)

2.7 Characteristic of Power Generated and Asked

The power generated by renewable sources depends on solar radiation and wind speed, which is intermittent in nature. The power required by the load also takes the same from the generated power. It can be represented by the following mathematical equation [6]:

$$ P = \left( {\frac{{\varphi \eta \sqrt \beta \left( {1 - {\text{G}}\left( {\text{s}} \right)} \right) + \beta }}{\beta }} \right).\Gamma $$
(8)

On the other hand \( P =\Gamma .\, \chi \)

  • P: Represents the solar power, wind or model of the load.

  • \( \upvarphi \): Is the stochastic component of power.

  • β: Contributes to the average value of the power.

  • G(s): Is a low passing filter.

  • η: Is a constant normalizing the generated power or the one requested.

  • χ: constant for Correspondence per unit [pu].

  • Γ: Is a switching signal depends on the time with the gain which causes the sudden fluctuation of the average value for the stochastic power.

For wind power settings (8).

$$ \begin{array}{*{20}l} {{\upvarphi }\sim {\text{U}}\left( { - 1,1} \right),\;\;\;\;\upeta = 0.8,\;\;\;\;\upbeta = 10,\;\;\;\;{\text{G}}\left( {\text{s}} \right) = \frac{1}{{10^{4} .{\text{s}} + 1}}} \hfill \\ {\Gamma = 0.24{\text{h}}\left( {\text{t}} \right) - 0.04{\text{h}}\left( {{\text{t}} - 140} \right)} \hfill \\ \end{array} $$
(9)

Where h(t) is the Heaviside step function. For the generated solar power settings (8) are:

$$ \begin{array}{*{20}l} {{\upvarphi }\sim {\text{U}}\left( { - 1,1} \right),\;\;\;\;\upeta = 0.9,\;\;\;\;\upbeta = 10,\;\;\;\;{\text{G}}\left( {\text{s}} \right) = \frac{1}{{10^{4} .{\text{s}} + 1}}} \hfill \\ {\Gamma = 0.05{\text{h}}\left( {\text{t}} \right) + 0.02{\text{h}}\left( {{\text{t}} - 180} \right) } \hfill \\ \end{array} $$
(10)

For the power, required settings (8) are:

$$ \begin{array}{*{20}c} {{\upvarphi }\sim {\text{U}}\left( { - 1,1} \right),\upeta = 0.8,\upbeta = 10,} \\ {{\text{G}}\left( {\text{s}} \right) = \frac{300}{{300.{\text{s}} + 1}} + \frac{1}{{1800.{\text{s}} + 1}} } \\ {\Gamma = \frac{1}{\chi } [0.9h\left( t \right) + 0.03h\left( {t - 110} \right) + 0.03h\left( {t - 130} \right) + 0.03h\left( {t - 150} \right)} \\ { -\, 0.15h\left( {t - 170} \right) + 0.1h\left( {t - 190} \right)] + 0.02h\left( t \right)} \\ \end{array} $$
(11)

3 Optimization of PID Parameters by Genetic Algorithm

Genetic algorithms are evolutionary optimization methods inspired by Darwinian natural selection [11]. They are widely used to solve complex optimization problems. Figure 2 shows the flowchart of the implementation of Genetic Algorithms. A Genetic Algorithm evolved a set of known solutions (individual people) that presents a possible solution to the problem. Each individual assigns an adaptation function (fitness function). This function has the function to be optimized. A genetic algorithm starts with an initial population of solutions. Then it creates a sequence of new generations; The best solutions are more likely to be selected, creating a new generation of solutions. The selected individuals are then improved through the application of three basic operators such as selection, crossover and mutation. The algorithm is repeated for a given number of generations and stop when the criteria stop is reached. The optimization of an objective function with a PID based genetic algorithm is as follows:

Fig. 2.
figure 2

Flowchart of genetic algorithm

Step 1::

Creation of a population of initial parameters solutions. Each parameter called as a nuisance. A chromosome consists of genes and thus each chromosome has a solution to the problem. KP, KI and KD.

Step 2::

Evaluate the objective function (fitness) for each solution of individuals.

Step 3::

Remember the best solution for stopping rule verification. If so, finish.

Step 4::

Generation “offspring”: Offspring is a new chromosome obtained through the selection steps, crossover and mutation.

Step 5::

Putting people products in the new population.

Step 6::

Replace the old population of individuals by the news.

Step 7::

Terminate the program when the termination criterion is reached; otherwise go to step 2.

Figure 2 shows the chart of Algorithms Genetics:

By following the steps of this algorithm we can get Matlab code of Genetic Algorithms to optimize the parameters of a PID controller using an objective function. This code consists of several sub-files (initialization, encoding, decoding, mutation, selection, fitness function, outcome) have the body of the main program. The parameters of Genetic Algorithms are presented in the Table 2.

Table 2. Parameters of AG

In order to obtain good performance monitoring frequency of a microgrid, the variation of frequency (.DELTA.f) and the change of the control signal (Δu) to the output of the PID controller should be minimized. Proportional-integral-Derivative (PID) plays an important role in industrial processes have since been introduced. Many control systems use the PID controller for its simplicity and it is proved satisfactory. He still has a wide application in industrial control [12]. There are two popular structures for the implementation of the PID controller; parallel or series. This controller has three parameters (,) which must now be optimized to adjust system control laws while maintaining some control objectives incorporated as performance indices in the time domain. KP KI and KD. In this study, the integral performance index (J) to minimize by appropriate genetic algorithms is the weighted sum of ISTSE (Integral of Squared Time Squared Error Multiplied) And ISDCO (Integral of Squared Deviation of the Output Controller) Given as follows [6].

$$ \varvec{J}_{{\_\varvec{opt}}} = \mathop \smallint \limits_{{\varvec{T}_{{\varvec{min}}} }}^{{\varvec{T}_{{\varvec{max}}} }} [\varvec{w}(\varvec{\varDelta f})^{2} + \left( {\frac{{1 - \varvec{w}}}{{\varvec{Kn}}}} \right)\left( {\varvec{\varDelta u}} \right)^{2} ]\varvec{dt} $$
(12)

4 Results and Discussion

This section presents the simulation results in the time domain of the frequency control by a PID controller for a microgrid. In this study, the three parameters of the PID controller (KP, KI and KD) Are optimized by the application of Genetic Algorithms. Table 3 shows the optimum values of these parameters (Fig. 3).

Table 3. Optimal Parameters PID
Fig. 3.
figure 3

(a) Evolution of the objective function based on the number of iteration, (b) Changing PID control parameters based on simulation time.

The results show that the objective function used is stochastic in nature. The same PID parameter values give different values for the same objective function.

Figure 4 illustrates the profile of the required load and the PV output power and WTG under varying conditions randomly. The power generated by renewable sources of random and intermittent nature. What influences the control of the frequency and power of the microgrid. These results show that the generated power is independent of the controller (Fig. 5).

Fig. 4.
figure 4

(a), (b) and (c) Stochastic Realization power generated and applied independently of the PID structure

Fig. 5.
figure 5

(a), (b), (c) and (d) Variation of the frequency and power for microgrid with the optimal parameters of the PID controller

During the first phase of simulation time the value of the total power produced by PV and reached 0.89 WTG been following the value of solar radiation and wind speed. These resources (wind, sun) are stochastic in nature, have local characteristics and are difficult to predict. It is obvious that this power is not sufficient to cover the demand for the required load. The diesel generator starts producing the rest of the required power. As soon as the renewable source generator can fulfil the demand, the surplus of this power is stored in batteries and/or sent to the electrolyser produces hydrogen absorbed by the fuel cell. The stored power will be used in case of failure of the generated power.

Disruption of power and noticed the frequency is due to the change from solar radiation and wind. Control of the PID controller using frequency parameters optimized by genetic algorithms is robust and responsible to reduce the fluctuations in the frequency and power due to random changes in solar radiation and wind speed.

5 Conclusion

This item is to develop an optimal control synthesis of the frequency of a hybrid system. The configuration of the proposed system is discussed, the characteristics of major system components such as WTG, PV, FC, DEG, AF, BESS and FESS are presented. The control strategy shows the reliability and efficiency of the proposed system by the simulation of configuration. This strategy is based on the use of the PID controller whose parameters are evaluated by the application of genetic algorithms. The AGs provide good system performance in terms of solution quality and speed of convergence. The proposed PID controller is given a favourable performance as show the illustrated results. The obtained results show the high efficiency of the used method and a robust PID controller. The obtained results show that the proposed method is efficient and robust.