Fuzzy logic control of hybrid systems including renewable energy in microgrids

Received Jan 21, 2020 Revised Mar 31, 2020 Accepted May 2, 2020 With a growing demand for more energy from subscribers, a traditional electric grid is unable to meet new challenges, in the remote areas remains the extension of the conventional electric network very hard to do make prohibitively expensive. Therefore, a new advanced generation of traditional electrical is inevitable and indispensable to move toward an effective, economical, green, clean and self-correcting power system. The most well-known term used to define this next generation power system is micro grid (MG) based on renewable energy sources (RES). Since, the energy produced by RES are not constant at all times, a wide range of energy control techniques must be involved to provide a reliable power to consumers. To solve this problem in this paper we present a fuzzy logic control of isolated hybrid systems (HRES) including renewable energy in micro-grids to maintain a stability in voltage and frequency output especially in the standalone application. The considered HRES combine a wind turbine (WT) and photovoltaic (PV) panels as primary energy sources and an energy storage system (ESS) based on battery as a backup solution. Simulation results obtained from MATLAB/Simulink environment demonstrate the effectiveness of the proposed algorithm in decreasing the electricity bill of customer.


INTRODUCTION
With the problem of global warming and the reduction of non-renewable sources, many are looking for renewable energy solutions to guarantee a clean life on earth [1]. Environmental concerns grown after Kyoto Protocol and the Copenhagen summit have focused work on developing renewable resources [2], to reach a target of reducing annual CO2 emissions by 2030 [3]. In the last few years, the renewable power plants have drawn greater global attention of most scientific research because of their positive influence in finding solutions to environmental problems and their capacity to meet the increasing energy requirements over time [4,5]. These renewable energy technologies mainly installed in remote areas because they cover a large area on the ground. Rural areas are in most cases far from the energy distribution network, where the extension of the network is difficult and more expensive. The main disadvantage of these sources is that they are generally of an intermittent nature, which varies over time. [6]. As in an extended period of overcast sky or in the case of a decrease in wind speed for several days. As a result, wind power production is variable and unpredictable [1,2,4,7].
The concept of Micro-grid (MG) is proposed as effective solution to challenge such as growing energy demand for electrification of remote rural areas [3][4][5]. Nowadays, MG is the essential infrastructure for a smart grid architecture. Another vision is to use HRES effectively to ensure reliability and continuity of power supply in remote areas, reducing the impact of uncertainty on the network, uninterruptible service and cost savings [5,8]. Such a system based on RES combines between several sources of energy such as photovoltaic solar, wind energy, micro-hydraulics, fuel cells and also conventional generators for the assurance of having energy on time [7,9].
The basic components of the HRES include energy sources power electronic converters, energy management system and loads as shown in Figure 1. There are different types of AC/DC, DC/DC converters, but most commonly used are voltage source inverter and boost converter. The supervisory and control system is responsible for finding the basic power that must be generated or stored in the battery. In the following, the electronic power converter connected to RES and EES is controlled, so that the energy sources operate as required by the monitoring control system [8].
In the recent years, the hybrid systems including renewable energy in MGs attracted a lot of attention because of their benefits. Especially in their application to the small standalone and grid-connected mode [10,11]. Several studies are presented for optimization of HRES, the evaluation and the design usually are two important factors for the researches, as the system connected to the grid or disconnected from it [12,13]. HOMER software (hybrid optimization model for electric renewables) is the most used program for this purpose. The optimization of a HRES by HOMER software is presented in [14][15][16].
In the literature, many other studies related to the power energy management (PEM) of HRES. In [17] a comparative evaluation of different power management strategies presented. The same study showed in [18], authors used adaptive passively based control for PEM fuel cell battery in hybrid power system. Another concept of energy management using Maximum Point Power Tracking controller (MPPTC) for each power source of the HRES. In [19] authors propose a peturb and observ (P&O) control for PV panel and a filed oriented control (FOC) of wind system in order to extract maximum power. Same thing in [20] where authors propose a classic (P&O) method to extract maximum power from PV and a new rectifier stage topology for wind system. In [21] Xiao et al., present a coordinated power control based in a robust nonlinear controller for wind generator and a P&O for PV.
The intelligent control integrated largely in the management and control of HRES in order to achieve maximum power, in [20] a hybrid power system consisting of PV, WT and diesel engine proposed, an improved neural network controller integrated to PV panel and for controlling the pitch angle of WT. In either autonomous mode or connected to the network, the MG suffers from dynamic and transient stability problems during and after the various major deregulations. Another different studies focused in the control of different converters to maintain a stability in voltage and frequency output especially in the standalone system; where the variation in load demand and weather conditions play a role in the perturbation of voltage forms. The classical control techniques are based in their work on an exact mathematical model of the concept and are very sensitive to adequate variations in the input quantities. Intelligent control techniques are more cost-effective and efficient than conventional techniques, since they do not require a concrete model to function. Therefore, in this paper, we present a fuzzy logic controller (FLC) of isolated HRES in micro-grids to maintain a stability in voltage and frequency output especially in the standalone system. The considered HRES combine a wind turbine (WT) and photovoltaic (PV) panels as primary energy sources and an energy storage system (ESS) based on battery. The simulation results obtained from MATLAB software confirm the efficiency of the proposed algorithm to ensuring continuity in stable power supply.

STRUCTURE OF ISOLATED MICRO GRID
The configuration of the study hybrid system system is illustrated in Figure 2. The hybrid power system composed of PV station of 9,5 kW rating, WT of 7 kW and ESS of 9 kW. The system is integrated via CC-bus for a voltage source inverter (VSI) to ensure the continuous delivering power generated from PV array and WT for improved system performance, the WT is integrated via AC-DC converter. The power in the output of VSI used to feed the load. The PV array is equipped with the DC/DC boost converter to step up array output voltage. A battery controller used to maintain firstly the management power in the hybrid system by combining between the different sources of power production, the charge and discharge of battery and secondary the control of the DC/DC converter to maintain a desirable voltage DC-bus in the input of VSI.
To maintain a constant frequency and sinusoidal AC voltage in AC loads, a FLC proposed to control VSI. The principle of the FLC consists in generating three control signals for pulse with modulation (PWM) of VSI. Energy management system (EMS) for HRES used to meet the load demand in varying weather conditions and to manage the flow of power while ensuring efficient operation of the various sources of electrical energy production. In general, the EMS must mainly use wind and photovoltaic energy to meet the demand of power [22], in this case the battery is in charging mode, when the power required by the load is greater than power generation; the battery is start to discharge. In the test of simulation, we analyze under different power input scenarios the quality of active power delivered by HRES.

MODELING OF THE MICROGRID COMPONENTS 3.1. Modeling the wind system generator
The permanent magnet synchronous generator (PMSG) is very interesting for generating wind power; in comparison with other electrical machines, it has several advantages, (good dynamic performance, high efficiency, high massive torque, good power factor ... etc) [23]. to model a dynamic PMSG system which would be useful for designing the control diagram, the PMSG equations are transformed into a given synchronous reference system in Figure 3. The dynamic model of the generator based on permanent magnet mounted on the surface in a synchronous reference is indicated below [23]. The stator flux where m  is the constant power in the projection of excitation flux in the reference d-qo. The voltage equations of the PMSG used in the modelling model is given by the following equations [22].
where Vd and Vq are respectively d axis and q axis voltages, id and iq are respectively d axis and q axis currents, Ld Lq, Rs are respectively d axis and q axis inductance and resistance, ω is generator speed. The electromagnetic torque given by: The mechanical dynamic equation is shown below where J is the inertia of the rotor, fv is the friction constant and Tl is the torque of the wind turbine.
In the literature, several works have been concentrated on the modeling of different components of a wind energy production architecture. We considered in this paper a wind turbine (WT) with horizontal axis driven directly a permanent magnet synchronous generator (PMSG), so we can say that a wind turbine converts the wind power into mechanical power by means of producing torque shown in Figure 4. Since the energy supplied by the wind is in form of kinetic energy, its magnitude depends mainly on the air density and wind speed [24,25]. The wind energy produced is given by (5). where Cp is a performance coefficient of WT, V is wind speed with a unit m/s, ρ and S are the air density in kg/m3 and the WT swept the area in m 2 respectively. The tip speed ratio is defined as the ratio of turbine blade linear speed and the wind speed, is written as follows: where R is the wind speed with a unit of m/s and R is the radius of the wind turbine rotor (m). Substituting (6) in (5), we have: The torque of the wind turbine is calculated by: The power coefficient Cp has a maximum value of 0.59, it is called the Betz limit which determines the maximum power that can be deduced from the wind speed [26].

Modeling of the photovoltaic source
A solar cell, which is the basic element of the photovoltaic panel, is a PN junction diode operating in reverse polarization condition. The electromagnetic radiation resulting from the sun breaks the covalent bond and releases free electrons producing a photovoltaic current (Ipv) under an external voltage (Vpv) [27]. The mathematical projection that models the solar cell has been studied over the last twenty years. Sun irradiances, solar cellule temperature and the zone of implementation are the factors, which affect the production of electric energy extracted from PV panels [28]. Different techniques of the modeling procedure have been shown before; in our study, we consider the schema of a single diode model for the simulation of PV [29]. The model is illustrated in Figure 5.
where Rs and Rp are equivalent series/ parallel resistance of PV pannel. Iph and Id are respectively the photocurrent and the junction diode current, I0 is the reverse saturation current. Vt=Ns kT/q is the thermical voltage of the array with Ns cells connected in series. a is the diode ideality constant, k is the Boltzmann's constant, T[K]: Temperature of the p-n junction. k [J/K]: Boltzmann constant, q [C]: Electron charge.

Modeling of battery storage and DC/DC converter
The mathematical modeling of the Li-Ion type battery used in our simulation block is shown in this part. The applied open voltage source is calculated with a non-linear relation based on SOC value of the energy saving bank [28]. The controlled voltage source is described by (11), where E = no-load voltage (V). Eo = battery constant voltage (V). K = polarisation voltage (V). Q = battery capacity (Ah). I= actual battery charge (Ah). A = exponential zone amplitude (V). B = exponential zone time constant inverse (Ah)−1. Vbatt = battery voltage (V), R = internal resistance (Ω). The charging and discharging efficiency are nonlinear functions of current and state of charge (SOC). The SOC is defined as the percentage of the remaining capacity of a battery. SOC can be expressed by the (12) (12) where, Q and Qrated are remaining capacity and rated capacity of the battery respectively, both in ampere-hour (Ah).
In the system control diagram, the battery controller operates in double play to regulate the DC bus voltage via a bidirectional DC/DC converter. it operates in buck mode to charge the battery when there is a surplus of the power produced and in boost mode to discharge it when there is a significant charge demand. This manages the flow of energy between the production and consumption of electricity. The control of the bidirectional converter and the battery storage system is achieved by using a PI controller [30].

Modeling of the DC-DC boost converte
In the recent year, DC-DC converters are currently in the estimation of great economic importance. The DC-DC Boost Converter is the most elementary structure of the power electronic converter. A Boost Converter is widely used in photovoltaic panel to increased there reliability, efficiency, and controllability and it can reduce such problems like manufacturing cost, efficiency and production [31]. The circuit diagrams as well as the related electrical elements of the boost converters concerning this study are shown in Figure 6. It contains one commutation cell made up by transistor type and a diode in series with load [27,31]. Using the concept of the DC / DC boost converter, the input-output voltage ratio f is given by: where α is the duty cycle of the DC/DC converter.

FUZZY LOGIC CONTROLLER FOR THE DC/AC VSI
The architecture of the fuzzy logic controller (FLC) applied in this study is shown in Figure 7. The three blocks are used to define the FLC controller are: Fuzzification block, Inference block, Defuzzification block and knowledge base (rule base). Fuzzification allows that real values are taken as fuzzy block inputs and then control the output variable [32]. The energy generated by the RES collected in the DC bus supplies the AC loads through a single-phase voltage source inverter. The 3-level, 3-phase VSI controlled by the PWM technique based on FLC mode to ensure voltage amplitude in sine wave form. The switching sequence of the VSI varies depending on the feedback signal detected from the voltage applied to the load; it is therefore compared to a sinusoidal reference signal. The error enters an FLC, which then supplies unipolar PWM for a reference control signal. Figure 8 describes the control schemes for DC/AC of three level VSI topology. Fuzzy logicbased voltage and current controller has been designed to control the non-linear applications, in this case, the FLC is the most appropriate solution. The error e (k) which can be calculated as the subtraction of the measured phase voltage and the reference voltage (Vref) with the change of error from (k) will be the inputs of the fuzzy logic controller at the sampling instant k.  The role of the triangular membership functions is to link the input and output variables. The range of variation for the two values is defined between [- 1 1]. The control rules for this FLC controller is shown in Table 1.

SIMULATION AND RESULTS
The proposed HRES model was implemented using simulink environment by matlab software. This simulation results are used to demonstrate the effectiveness of the proposed FLC in order to maintain a stability in voltage output by the use of a standalone system battery/Wind/PV power. Results are shown in next figures. The powers of HRES is given by: Pl=Pw+Ppv+Pbat (14) s is solar power, W is wind power, Batt is battery power and PL represent power of load demand.
Between 0 and 1.5 second, a wind speed as shown in Figure 11 is insufficient to give a wind power as shown in Figure 12 the solar radiation vary between 600 to 1000 W/M 2 as shown in Figure 13 then Ps_max equal to 9.5 kW as shown in Figure 14. Pl is 5 kW as shown in Figure 15, in this case PHRES > 0, the load is supplied only by the PV source. There is a surplus power between the supply and demand; then the battery operates in charging mode (SOC indication) as shown in Figure 16.  Figure 16. SOC of battery Between 1.5 and 6.4 second, the wind speed varies from 9.5 to 12 m/s and decreasing again as shown in Figure 11, Pw_max is 7 kW as shown in Figure 12. In this period solar power tumble down from 9.5 kW to 4.8 kW as shown in Figure 14. Pl-max is 8 kW as shown in Figure 15, in this case PHRES is superior then zero. The load supplied by the PV and wind sources, there is a surplus power and again the battery is in charging mode. Between 6.4 and 8 sec, solar radiation continue to decrease from 240 to zero W/M 2 as shown in Figure 13 generating no power from PV panel as shown in Figure 14. PL is 5 kW as shown in Figure 15. In this case the response for load demand came from the Pbatt and W as shown in Figure 17.
From 8 to 9.7 sec the wind speed as shown in Figure 11 decrease to a point where no generation of wind power is realized as shown in Figure 14, the response for all power demand 8 kW is assured by the battery discharge cycle as shown in Figure 17. From 9.7 to 12.5 solar radiation raise again to a maximum of 370 kW/M 2 as shown in Figure 13 generating solar power as shown in Figure 14. The response for load power accomplished by s and Batt as shown in Figure 18.
Between 12.5 and 15 sec, PL became 3 kW as shown in Figure 15, solar radiation and solar power continue to increase and answer to the majority of load demand as shown in Figure 17. In the other side the battery, discharge less to less, finally entering in the charge cycle exactly in the 13.6 second. Frequency as shown in Figure 18 is maintained stable at 50 Hz.  Figure 18 to Figure 20 shows frequency and the three load voltage, It can be seen that voltage and frequency fuzzy logic controller have the capability of maintaining the system stability, even with a presence of wind and PV power fluctuations. From these simulation results, we remark a good tracking performance for proposed FLC and a good management of power.

CONCLUSION
The major drawback of a hybrid renewable energy system (HRES) results in the production of electrical energy varing over time, which can have a negative impact on the functioning of the smart network. In order to find a solution to this problem, the system uses several renewable sources, along with a battery energy storage bank. For this kind of complex system, control strategies must be developed to distribute energy in an efficiency way. Therefore, a control of Wind/PV/Battery system using FLC is proposed in this paper, a FLC which is designed to smoothing the output fluctuation of the wind power and PV power. Simulation for different scenarios under variable weather conditions, the designed controller tracks the reference generated by the proposed FLC with constant DC-Link voltage.