Modelling, Design and Control of a Standalone Hybrid PV-Wind Micro-Grid System

: The problem of electrical power delivery is a common problem, especially in remote areas where electrical networks are difﬁcult to reach. One of the ways that is used to overcome this problem is the use of networks separated from the electrical system through which it is possible to supply electrical energy to remote areas. These networks are called standalone microgrid systems. In this paper, a standalone micro-grid system consisting of a Photovoltaic (PV) and Wind Energy Conversion System (WECS) based Permanent Magnet Synchronous Generator (PMSG) is being designed and controlled. Fuzzy logic-based Maximum Power Point Tracking (MPPT) is being applied to a boost converter to control and extract the maximum power available for the PV system. The control system is designed to deliver the required energy to a speciﬁc load, in all scenarios. The excess energy generated by the PV panel is used to charge the batteries when the energy generated by the PV panel exceeds the energy required by the load. When the electricity generated by the PV panels is insufﬁcient to meet the load’s demands, the extra power is extracted from the charged batteries. In addition, the controller protects the battery banks in all conditions, including normal, overcharging, and overdischarging conditions. The controller should handle each case correctly. Under normal operation conditions (20% < State of Charge (SOC) < 80%), the controller functions as expected, regardless of the battery’s state of charge. When the SOC reaches 80%, a speciﬁc command is delivered, which shuts off the PV panel and the wind turbine. The PV panel and wind turbine cannot be connected until the SOC falls below a safe margin value of 75% in this controller. When the SOC goes below 20%, other commands are sent out to turn off the inverter and disconnect the loads. The electricity to the inverter is turned off until the batteries are charged again to a suitable value. Author Contributions: Conceptualization, A.A.-Q.; methodology, A.A.-Q. and M.A.-Q.; software, M.A.-Q.; validation, A.A.-Q. and M.A.-Q.; formal analysis, M.A.-Q.; investigation, A.A.-Q.; resources, A.A.-Q.; data curation, M.A.-Q.; writing—original draft preparation, M.A.-Q.; writing—review and editing, A.A.-Q.; visualization, A.A.-Q. supervision, A.A.-Q.; project administration,


Introduction
The use of renewable energy resources has rapidly increased in the last few years because of the global lack of conventional energy sources. Several factors are affecting the use of these resources such as the large capital cost and the uncontrollable parameters of the environment like variation of wind speed and sun irradiance. Therefore, an intelligent energy control system should be applied to switch the supply from one source to another according to load variations, ambient environment, and the State of Charge (SoC) of the energy storage systems.
A microgrid system is the most efficient system used to adapt the variation of the previous parameters in a multi-sources renewable energy system which is called a Hybrid Renewable Energy System (HRES). In the literature, several articles are mainly focused on various methodologies of optimal sizing, configurations, power management strategies and controllers used in the context of HRES [1][2][3][4][5]. In [2], the use of a photovoltaic (PV) and wind turbine (WT) generator hybrid microgrid architecture was constructed. Bidirectional control mechanisms were created, with an AC system integrating with a PMSG-based WT and a DC system integrating with a sliding mode algorithm. For steady-state conditions, the wind and PV interconnected microgrid system was mathematically modeled. The The rest of this paper is organized as follows: Section 2 describes the configuration of the micro-grid system, which includes the PV system and the WECS based PMSG integrated with a battery energy storage system. The control system for the proposed microgrid is discussed in detail in Section 3. In Section 4, the used control strategy is verified and validated using several conditions and scenarios. Finally, conclusions are presented in Section 5.

Micro-Grid System Configuration
The system under study consists of three main parts: PV system, Wind Energy Conversion System based Permanent Magnet Synchronous Generator (WECS-PMSG), and power electronic devices that connect AC and DC sides of the micro-grid system. Several controllers are required for each power electronic device. Figure 1 shows a schematic diagram and the system configuration for the suggested microgrid. The configuration of each part will be discussed individually in the following subsections.

PV System
The voltage-current (V-I) characteristics of the used PV model are given by [16]: I pv = I ph − I s e ( q(Vpv +Rs Ipv ) nkT −1) − V pv + R s I pv R sh (1) where I ph is the photo-current, I s is the diode saturation current, q is the electron charge, T is the temperature in (K), n is P-N junction ideality factor, and R s and R sh are intrinsic series and shunt resistances of PV cell, respectively. A schematic diagram of this PV model is given by Figure 2. The connected PV system is a PV array that consists of three series and six parallel strings to generate about 3.84 kW at full irradiance of 1000 W/m 2 . Figure 3 shows the relationship between voltage-current and voltage-power of PV modules, respectively. It is clear from this figure that the maximum power occurs close to open circuit voltage of the PV panel. The rating power of this panel at STC condition is 215 W. The open circuit voltage and the voltage at the maximum power are 36.6 Volts and 29 Volts, respectively. The short circuit current and the current at the maximum point are: 7.84 A and 7.35 A, respectively. More details and specifications about this panel can be found in [17,18].

PMSG-Based Wind Energy System
Wind Turbines are required in any wind system. They operate as prime movers of electric generators which are connected to their shafts. They can be classified based on direction of their rotation: Horizontal Axis Wind Turbines (HAWT) and Vertical Axis Wind turbines (VAWT). Another classification is based on their mode of operations: fixed speed and variable speed types. The characteristics of the wind turbine and the types of the wind generator used in the wind system are the main factors that affect the mode of operation of the WECS.

Wind Turbine Characteristics
The output power generated by the wind turbine can be given in terms of the turbine aerodynamic power coefficient (C p ), as follows [18,19]: The aerodynamic power coefficient of a wind turbine is a performance indicator, which is influenced by the blade pitch angle (β) and the tip-speed ratio (λ). A generic equation of C p based on the turbine characteristics is given by (2) [20][21][22][23][24][25][26][27][28][29]: where the coefficients C 1 to C 6 are: C 1 = 0.5176, C 2 = 116, C 3 = 0.4, C 4 = 5, C 5 = 21, and C 6 = 0.0068, and R is the turbine radius in (m), V w is the wind speed in (m/s), and ω is the turbine angular speed in (rad/s). Figure 4 shows power characteristics of a typical wind turbine with β = zero and variable speed operation [30][31][32][33].  Figure 5 shows the variation of C p versus λ with different values of β as described by (2). It can be observed from Figure 5 that λ needs to be maintained at an optimal value for all wind speeds-to run the WECS with maximum C p value [34][35][36][37][38][39][40]. This can be done only using variable speed operation with DFIG or PMSG where the rotor speed of the turbine can be adjusted at variable wind speed [9,[41][42][43][44][45]. Pitch angle control is usually used in large scale wind systems to fix the output power of the wind turbines at a specific limit, especially at high wind speed [28,46].

Permanent Magnet Synchronous Generators
PMSG is usually built with several numbers of poles in WECS. Thus, it can run at a low speed that corresponds to the wind turbine's spinning speed. As a result, the wind turbine's rotor shaft can be directly connected to PMSG. The direct-drive operation, which does not require any additional gearbox setups, is one example of this form of operation [10]. Removal of gearboxes reduces the installation and maintenance costs and gives the system an advantage over DFIG-based systems that need the use of a gearbox. For variable speed operation, the PMSG can accommodate a wide variety of rotor speeds. The output voltage received at the stator terminals of a PMSG varies in frequency and amplitude according to the wind speed.
Power electronic converters are used to link the stator to the grid. A typical PMSGbased wind energy conversion system is shown in Figure 6. The utilized power converters are rated at full capacity because there is no additional rotor control, ensuring maximum wind energy conversion efficiency for a wide range of wind speeds. Furthermore, power converters with full capacity ratings help to meet various grid regulations and do not require additional equipment for fault ride-through scenarios [11].

Power Electronic Devices
The power converters used are three-phase diode rectifiers, DC-DC converters to achieve the desired DC voltage level, and inverters to obtain an AC output voltage with a specific power frequency from the generated DC voltage. As a result, the PMSG's variablefrequency output voltage is transformed to a grid-frequency sinusoidal AC voltage.
A boost converter in the WECS is used to raise the output voltage of the three-phase diode rectifier to achieve a specific value of DC voltage. The switching signal of this boost converter is generated by a specific control algorithm which will be discussed later. The PV system uses a DC-DC converter, and the switching signal is designed for generating a proper voltage and power.

Three-Phase Diode Rectifier of PMSGs
The diode rectifier is used in this work to convert the three-phase output voltage of the PMSG into a DC voltage. The rectified DC voltage (V rec ) is given by [12]: where V urms is the rms voltage applied to the three-phase rectifier. Figure 7 depicts the circuit diagram of a three-phase diode rectifier. Although the diode rectifier's output voltage is uncontrolled, there are no additional losses due to the switching of any power electronic components. If diode losses are ignored, it can be assumed that the whole power obtained by PMSG is completely converted from AC to DC.

Boost Converter
A circuit diagram of a boost converter is shown in Figure 8. The output voltage of the boost converter (V o ) is higher than the input voltage (V in ). Under continuous current mode (CCM) of operation, V o is given by [12]: where D is the switch's duty cycle. In comparison to the buck converter, the boost converter requires a larger inductor (L) and output filter capacitor (C). By carefully selecting their values, the input current may be kept constant.  The PMSG's variable DC rectified voltage is boosted to a constant voltage of 700 V by the boost converter. Equations (7)-(9) are used to design the component parameters of the boost converter [13]: where: and ∆i L is the inductor current ripple which is assumed to be 5% of the output current, ∆v is the output DC voltage ripple which is assumed to be 1% of the output DC voltage, and f s is the switching frequency. In the PV system, the MPPT algorithm using Fuzzy logic provides a control signal for a proper gating of the boost converter.

Inverters
Different topologies and configurations of grid-connected PV system inverters are discussed in detail in [9]. The authors in [10] use a two-level Neutral Point Coupling (NPC) inverter for a hybrid PV/battery system. In this paper, the work has been extended by considering a three-phase three-level NPC. This topology provides three output voltage levels: (+V DC /2), zero and (−V DC /2), which is better than two-level inverter topology in terms of THD. Furthermore, because the voltage stress is decreased to half of the DC voltage, lower switching frequency and rating IGBT modules can be used. In the linear modulation area, the peak amplitude of the line-to-line voltage at the output is given by (10): where m a is the amplitude modulation index. The circuit diagram for a multi-level inverter is shown in Figure 9: LC-filter is being used to get the final form that is close to sinusoidal waveform. The values of L and C have to be selected based on (11) and (12), respectively [14]:

Bidirectional DC-DC Converter with a Battery Storage System
In most PV power systems, lead-acid batteries are employed. The charging and discharging of these batteries are handled by a bidirectional DC-DC converter. The authors in [15,16] describe several topologies and configurations of bidirectional DC-DC converters used in PV systems. For charging and discharging operations, a buck-boost DC-DC converter is used in this research.
The usual configuration of the bidirectional converter employed in this paper is shown in Figure 10. The bidirectional converter is operated as a buck converter with the gate signal applied to the switch S1. This mode of operation occurs to charge the battery system when PV output is high. When the PV system's power is low or the grid is down, the bidirectional converter acts as a boost converter, sending a gate signal to switch S2. As a result, the battery is discharged, and energy is supplied to the load. Parameters of bidirectional converters are designed using (13)- (15).
For buck mode of operation: where R L and R H are the load resistance at buck and boost sides, respectively. C H is the capacitance value at the boost side. L b,min is the minimum value of the inductance and f s is the switching frequency. Other specifications of this microgrid are shown in Table 1.

Control System
The new control system of this microgrid is divided into four subsystems: fuzzy logic-based MPPT for controlling the PV system, WECS controllers, battery unit controllers, and inverter controllers. The main purpose of the control system is to maintain serving power to load and protect batteries' health from overcharge or over discharge which harm them and shorten their lifetime. Therefore, the controller keeps the SOC of the batteries within the safe limits. The following subsections discuss the subsystems of each controller individually:

Bidirectional DC-DC Converter with Battery Storage System
The inputs of FLC are the error (E) and the change in error (dE) signals, which are generated using the power and the current of the PV module. E and dE signals are defined by (16) and (17), respectively: where P pv (k) and I pv (k) are the power and the current of the PV module, respectively. The duty cycle change is the output of FLC. Fuzzification, rule base, inference engine, and defuzzification are the four main elements of fuzzy logic control operation which will be discussed individually in the following subsections.

Fuzzification
Five fuzzy subsets are used to assign membership function values to linguistic variables: Negative Big (NB), Negative Small (NS), Zero (ZE), Positive Small (PS), and Positive Big (PB). Figure 11 depicts the partition of fuzzy subsets and the shape of membership functions that can adapt and implement a given system.

Inference Method
The fuzzy rule base and fuzzy implication sub-blocks make up the majority of the inference engine. The inference engine receives the fuzzified inputs, and the rule base is then applied. The fuzzy output set is identified using a Min-Max fuzzy implication method [28]. The twenty-five fuzzy rules, used in this controller, are listed in Table 2. These rules describe the relation between the two input variables (E and dE) and the output variable (dD), see Figure 12. This figure shows all cases that can be true to a certain degree, and the suitable change in the duty cycle.  The main purpose of the controller is to keep the slope equal to zero and achieve the MPP. This can be done by applying the fuzzy rules that process the possibilities of the operation point on the P-I curve of the PV array to maintain MPP and control the change in the duty cycle. The output of fuzzy logic control has been controlled through PWM which generated pulses to control the MOSFET switch in a DC-DC converter. The configuration of the MPPT topology is presented in Figure 13, where the inputs are voltage and current of the PV panel, and the output is the duty cycle of the DC-DC boost converter.

WECS Controllers
As discussed before, the PMSG is connected to a three-phase bridge rectifier to convert the variable AC voltage into a DC voltage. Then, a boost converter is used to increase the DC bus voltage and fix it at 700 V. The gating of the boost converter is generated through a basic PI controller which generates the duty cycle to provide the boost converter with a proper gating signal. Figures 14 and 15 show the boost converter and its control circuit.

Bidirectional DC-DC Converter Control
The overall control system is designed to satisfy the load in all scenarios [19]. When the power generated by the PV panel is greater than the power consumption by the load, the surplus power goes for charging batteries. When the power generated by the PV panel is not enough to supply the load, the extra power needed by the load is drawn from the charged batteries.
A bidirectional DC-DC converter control system converter consists of two loops, outer and inner voltage and current loops, see Figure 16. The outer loop is in charge of keeping the DC-link voltage constant, while the inner loop is in charge of keeping the battery energy storage units charging and discharging.

Inverter Unit Control
A three-level inverter with the levels (−V DC , 0, +V DC ) is being used. An SPWM method is used to get a proper gating signal for the inverter. The controller is designed to generate a modulation index to keep 220 V rms with 50 Hz AC voltage.
The controller measures the phase voltage of the output inverter (V an , V bn , V cn ). Phase-Locked Loop (PLL) is used to extract the phase angle of the fundamental voltage component of phase A. The extracted phase angle is used to convert the voltages V abc into V dq0 . The converted voltages V dq0 are compared with preset reference values to feed error signals to the PI controllers. Finally, the modulation index, which varies between 0 and 1, is used to generate a 3-phase SPWM and control the inverter. Figure 17 shows a schematic diagram for the inverter SPWM.

Battery Protection Controller
Batteries can get overcharged or over-discharged, which usually leads to damaging the batteries. Thus, limiting the batteries' State of Charge (SOC) within (20-80%) will help to keep the batteries safe and well maintained long enough. Based on the SOC range, operation of batteries can be classified into three main conditions: (1) Normal condition where the batteries SOC is running between 20% and 80%.
The controller should deal with each condition in a proper way to protect batteries from either overcharging or over-discharging. In normal operation conditions (20% < SOC < 80%), the controllers described above operate as expected without any regard to the SOC of the batteries. However, once the SOC exceeds 80%, certain commands that turned off the PV panel and the wind turbine are issued. The PV panel and the wind turbine are not allowed to be connected unless the SOC drops to a safe margin, which is 75% in the case of our controller. Similarly, when SOC drops below 20%, other commands are issued to turn off the inverter and disconnect the loads. The power from the inverter is kept off until the batteries are charged enough, which is 25% in the case of our controller.
This control strategy is applied using a microcontroller that takes battery SOC as input and generates proper signals based on the previous scenarios.
The microcontroller is implemented in MATLAB/SIMULINK using the "MATLAB function" block which allows us to access the coding process to address the purposes of our controller; see Figure 18 for input and output of this block function. Controlling the power flow in the system is being done through a "circuit breaker/contactor" block to get the circuit closed/open as required. The circuit breakers can be installed before or after the converter. In WECS, the circuit breaker is installed just before the converter. When the battery SOC hits 80% of the full battery charge, the microcontroller sends a tripping command to the breaker to interrupt the power flow to the load. Instead, another breaker is installed before the main breaker to change the power flow direction to a dummy load that can be used for useful applications as shown in Figure 19. Wind power flow is kept interrupted, and the load is completely fed from the batteries unit, fading away from the upper SOC limit of 80%. PV power flow is also interrupted as a discharging batteries unit is required in this scenario. The breaker of the PV system is connected right after the boost converter, and no dummy load is used in the PV system. On the AC side, after the inverter, the three-phase load is switched off by a circuit breaker connected right after the inverter as shown in Figure 20.

Simulation and Results
The results below verify the validity of the used control method. The controller has been tested, as previously mentioned, using three main conditions: normal condition, overcharging state, and over-discharging state.

Normal Condition
The simulation shown in Figure 21 shows the system performance in three different scenarios as follows: (1) In the period between t = (0 to 4 s), the effect of the PV system is examined under variable irradiance and fixed wind speed. The irradiance is changed between (0-1200) W/m 2 with a constant wind speed of 16 m/s. (2) The effect of the wind system is examined under variable wind speed and fixed irradiance in the period between t = (4 s to 8 s). The irradiance has been fixed at 1000 W/m 2 , so the effect of the wind controller is simply observed. (3) In the remaining simulation time, the system is examined under variable irradiance and variable wind speed for (t > 8 s). For the first scenario of the simulation t = (0-4) s, the irradiance is intended to simulate a clear day irradiance as the sun shines with minimum values of irradiance, then increases till its peak for that day, and then drops again with some clouds randomly passing by. Therefore, the irradiance is selected to start from 0 to 1200 (W/m 2 ) and then 0 again; it also drops at random times during this interval as a simulation of clouds may block the irradiance. Meanwhile, for this interval, wind speed is kept constant at 16 m/s, since this scenario is designed to test and validate the controller of the solar energy part alone.
For the second scenario t = (4 s to 8), the main purpose is to clearly observe the effect of the wind turbine controller in the simulation. To obtain such observability, the irradiance is kept constant, and the wind speed changes randomly between some limits (8-25) m/s. For the third scenario t > 8 s, a variable and random irradiance and wind speed is being simulated to validate the ability of the control algorithm to keep up with these two random inputs. Figure 22 shows the corresponding PMSG rectified voltage, PV voltage, and battery voltage, respectively. As seen in this figure, the MPPT is working well, since the PV voltage always reaches V max for irradiance greater than 0.  Figure 23 shows the DC bus voltage with a small ripple under variable irradiance and variable wind speed conditions. The three-phase voltages and currents driven through the inverter are shown in this figure. THD for both voltages and currents are 3% and 5%, respectively. Figure 24 illustrates the power flow in the system, where the power fed to the inverter is constant at around 2080 W. The load is only consuming 2 kW, and the remaining are losses in the LC filter and power electronic devices as well.

Overcharging Condition
The power required by the load is 2 kW, and the power coming from the solar and wind sources are 4.8 kW and 4.9 kW, respectively. In addition, 2 kW feeds load and the excess power, which is 7.7 kW, is being driven to the batteries to charge them up. This process will keep going until the upper limit of the SOC is reached, which is set to 80%. At this moment, two circuit breakers are switched off and solar and wind sources are disconnected. Therefore, the total power provided by these sources is zero, and the load is fully fed by the charged batteries, causing the SOC to decrease. The batteries' SOC continues decreasing until it reaches a predefined SOC limit, which is 75% in our controller. Figure 25 shows the behavior of the controller during overcharging process. SOC follows the sequence (80-79.93-80-79.93%) until the power coming from the sources is dropped to lower values.

Overdischarging Condition
To keep batteries from getting damaged due to over discharging conditions, the load gets disconnected as batteries' SOC hits 20%. They are kept in the off state until a safe margin of SOC is reached. In this work, this safety limit is set to be 20.025%. Figure 26 shows that batteries are being discharged due to low power fed from the PV system and WECS. Therefore, batteries' SOC hits 20%, and the circuit breaker is opened. The power generated by the PV system and WECS feeds the batteries and gets them charged. The load circuit breaker remains open until the safety limit SOC level is reached, where the load circuit breaker gets closed again.

Discussion
Several studies have looked into the issue of energy management; differences were found in the types of sources used, the storage systems considered, and whether or not the grid was connected. The authors in [47] compared the intuitive solution to the optimal control. According to findings, the ideal method reduced the cost of electricity more than the predictive system. This is due to the fact that the intuitive approach did not take into consideration the cost constraint or the price per time slot.
In [48], Zupancic et al. suggested a tree-based control mechanism as an Energy Management System (EMS) solution for GCHES with PV and battery systems. After examining historical data for the specific area, including electric load, electricity pricing, and solar irradiance, this method creates a decision tree for power flow by executing a multiobjective optimization using the Non-dominated Sorting Genetic Algorithm II (NSGA-II) considering operational cost and green factor. The optimization of decision trees required access to a huge quantity of historical data and a computationally expensive optimization methodology, despite the fact that the control mechanism itself is computationally cheap. In addition, if electricity costs and/or solar irradiance patterns change, this strategy will necessitate control model upgrades. Predictive control approaches update the control parameters of EMS by maximizing the EMS objectives using predicted HES variables, in contrast to flowchart and tree-based control methods where the controlled parameters are fixed.
Guichi et al. in [49] sized the solar system to power the load and charge the battery using a flowchart method. This system adapts to changes in grid demand. The limited power point mode was used to compensate for the excess power generated by the panels as a result of the installation's oversizing. Indeed, before sizing, the authors must consider the maximum power that can be pumped into the system. Otherwise, by using 85% of the battery's total capacity, their management system puts the battery's health at risk.
Aghajani et al. in [50] introduced an EMS technique that uses artificial neural networks (ANN) to forecast future load, wind turbine power, and PV array power. Using the Multi-Objective Particle Swarm Optimization (MOPSO) algorithm, the anticipated values are employed for multi-objective optimization of operating cost and CO 2 emission goals. The free-flow of energy between the HES and the grid was also demonstrated in this study to result in higher cost savings and CO 2 emission reduction goals. The previous discussions about the related work are summarized in Table 3.
For our case, we studied the energy shared between sources of a stand-alone hybrid PV/Wind/battery system to meet the load. Our energy management control forces the batteries to be considered as an emergency source of energy. The energy coming from the PV and wind system is initially supplied the load. If these two sources cannot support the load, the energy will be drawn from the batteries. Moreover, the designed controller in our proposed system protects the batteries in all conditions, including normal, overcharging, and overdischarging. The controller should handle each case properly. Under normal working conditions (20% < SOC < 80%), the controller functions as expected, regardless of the battery's state of charge. When the SOC reaches 80%, the PV panel and the wind turbine are turned off, and a specified order is delivered. This controller's SOC must drop to a safe margin of 75% before the PV panel and wind turbine can be linked. When the inverter's SOC goes below 20%, other commands are sent out to switch it off and disconnect the loads. The inverter's power is turned off until the batteries have been recharged to a suitable level. Table 3. Comparative study with related work [45,46].

Conclusions
Design and control of a standalone micro-grid system with a PV system and WECS were proposed in this work. To control and harvest the most power possible from the PV system, fuzzy logic-based MPPT was used for a boost converter. The PV system's output provided a constant DC bus voltage to a battery storage system that was regulated by two PI voltage and current control loops. The control system is intended to achieve the load in all cases. When the energy generated by the PV panel exceeds the energy required by the load, the excess energy is used to charge the batteries. When the PV panel's electricity is inadequate to fulfill the load's demands, the extra power is drawn from the charged batteries. Furthermore, the controller is employed to protect the battery banks in all scenarios, including normal, overcharging, and overdischarging scenarios. Each case should be handled appropriately by the controller. Regardless of the battery's state of charge, the controller performs as expected under normal operating conditions (20% < SOC < 80%). A specific order is delivered when the SOC hits 80%, which turns off the PV panel and the wind turbine. The PV panel and wind turbine cannot be connected until the SOC drops to a safe margin of 75% in this controller. Other commands are sent out to turn off the inverter and disconnect the loads when SOC falls below 20%. The inverter's power is switched off until the batteries are charged again to a suitable value. The designed stand-alone microgrid system and their controllers solved the problem of supplying the electric energy to remote areas where the electrical grid does not exist.