Control of the Hybrid Renewable Energy System with Wind Turbine, Photovoltaic Panels and Battery Energy Storage

: The aim of the paper is the study of the Hybrid Renewable Energy System, which is consisted of two types of renewable energy systems (wind and sun) and is combined with storage energy system (battery). The paper presents the classiﬁcation and review of architectures of Hybrid Renewable Energy Systems. The considered Hybrid Renewable Energy System was designed as a multi-converter system with gearless Wind Turbine driven Permanent Magnet Synchronous Generator and with a Photovoltaic Array and Battery Energy System. The mathematical models of individual elements of a complex Hybrid Renewable Energy System were described. In the control of both systems of Wind Turbine with Permanent Magnet Synchronous Generator and Photovoltaic array, the algorithms of Maximum Power Point Tracking have been implemented for higher efﬁciency of energy conversion. The energy storage in the battery has been managed by the control system of a bidirectional DC/DC converter. For the control of the Machine Side Converter and Wind Turbine with Permanent Magnet Synchronous Generator, the vector control method has been implemented. In the control system of the Grid Side Converter, the advanced method of Direct Power Control has been applied. The energy management strategies for optimal ﬂows of electrical energy between individual systems of considered hybrid renewable energy system are developed and described. In order to determine the operation of proposed control systems, the simulation studies have been performed for different conditions of operation of individual elements of the complex hybrid system. The considered control methods and energy management strategies were tested thorough simulation studies for different wind speed variations, different sun irradiations, and different local load demands. The performed simulations are of practical importance in terms of proper operation requirements, design selection of components and energy management of Hybrid Renewable Energy Systems.


Introduction
In recent years, the penetration of renewable energy resources in power systems is increasing rapidly, especially for Wind Energy Conversion Systems (WECS) and Photovoltaic Systems (PV) [1,2]. The WECS energy and PV energy are naturally vary volatile and weather dependent. In such cases, the simultaneous use of combined wind and solar sources of energy instead of using just one source of energy (wind energy or solar energy) provides a more profitable and reliable system. Moreover, the joint operation of both such systems can supply a higher number of loads if required.
A Hybrid Renewable Energy System (HRES) is considered as a complex integrated system, involving two or more types of renewable energy sources. Hybrid Renewable Energy Systems are now becoming popular for power generation applications due to advances in renewable energy technologies. These systems are attractive because the individual sources could complement one another to provide more reliable power to the customer than a single-source system. In order to ensure the better conditions for continuity of power delivery to the local loads, it is essential to make WECS and PV systems compatible with additional energy storage systems [3,4]. In this case, the battery bank, flywheel, super capacitor, or fuel cell may be used as the energy storage devices [5].
The following general definition has been formulated and considered in this paper: Hybrid Renewable Energy System (HRES) is the system, which consists of two or more energy sources, with at least one of them renewable and integrated with power control equipment and an optional storage system. The HRES systems can be designed for two modes: One is grid-assisted mode and the other is stand-alone mode. In the grid-assisted mode, when the hybrid system is unable to feed the required power to the loads, it takes the missing part of the power from the AC grid. In the stand-alone mode, which is usually used to supply customers in remote areas, the required power is delivered only by hybrid wind-solar-storage energy system. The stand-alone mode can be considered as the special operation case of grid-assisted mode, when the grid energy is temporarily not available. The HRES systems are usually optimized for Maximum Power Point Tracking (MPPT) to extract the maximum power from the wind and the solar energy sources. This problem can be solved by using appropriate power electronics converters and suitable control strategies.
So far, HRES systems have been the subject of scientific research presented in a certain number of the published papers. However, the analysis presented in the most of the articles was concerned with the operating states of HRES systems of simple topology. The studies were performed for the limited number of operation modes and with consideration for not complex control algorithms. The classification and the architectures of HRES systems were presented in [6][7][8]. The optimization methods of sizing of HRES components were presented in [1,7,8]. In [9], the wind/PV/super capacitors/battery systems were studied. In [4,7], the authors studied the HRES systems in stand-alone mode with DC loads, and in [3,10], the HRES systems with AC loads. Many articles deal with the work of the HRES system only in the stand-alone mode [4,5,10] and do not include the issues of energy management strategies [2,3,5,7,[10][11][12][13][14]. In most articles, the studies of the system with simple topology of machine side converter connected to Permanent Magnet Synchronous Generator (PMSG) were performed [3,7,[9][10][11][12][13]. The machine side converter is analyzed in the form of a three-phase diode rectifier in cascade operation with DC/DC boost controller. In the systems with grid mode operation for the grid side converter, the simple hysteresis control of converter was applied [3,11]. The hysteresis control of the grid converter is not precise and can have an unfavorable impact on the supply network. Some authors were studied HRES operation with complex energy storage systems with fuel cells, supercapacitors, hydrogen technologies, and bioreactors [5,9,10,15,16]. Although, as presented above, there is a certain amount of literature regarding HRES systems and their applications, the issues of HRES systems can be still considered as an unmatured technology, which requires further research.
The objective of the article is the review and the study of the performance of the complex HRES system and its control. The analyzed HRES system was modelled mathematically and implemented in a simulation program, developed in Matlab/Simulink environment. The simulation studies have been performed for different conditions of operation of individual elements of the complex hybrid system. The performed studies of the combined operation of the hybrid system are far more complex than known studies of operating them separately. In the hybrid system, with wind and solar energy, both energy sources should be controlled simultaneously, depending upon the operating conditions and energy demands of the system. The energy management strategies for optimal flows of electrical energy between individual parts of considered HRES have been developed. The energy management strategies were developed for grid mode of operation and standalone mode of operation. In the management strategies the different conditions of produced power distribution, the load demands, the battery state of the charge, and the battery power limitation during charging and discharging process were included. The considered control methods and energy management strategies were tested during different wind speed variations, different sun irradiations, different local load demands, and different states of charge of battery. The performed simulation studies should have suitable practical meaning in terms of operation, design selection, and energy management of Hybrid Renewable Energy Systems.
In opinion of the authors, the key contributions of this paper include: The combined analysis and simulation studies of complex HRES system with wind source of energy, photovoltaic source of energy and battery storage system; taking into account the modern multi-converter system of power electronics converters for conversion and storage of electrical energy; application of modern and advanced vector control methods for precise control of machine converter and grid converter; application of MPPT algorithms for high-efficiency conversion of renewable energy obtained from wind turbine and PV array and the development of energy management strategies applied in HRES for grid-mode and stand-alone mode of operation with limitation of battery power and control of its state of charge.
The paper is organized as follows. In Section 2, the classification of architectures of HRES systems is presented. In Section 3, the mathematical models of the main components of the HRES system are described and discussed. In Section 4, the control algorithms for individual energy conversion systems are considered. In Section 5 the issues of energy management strategies applied in HRES are presented. The performed simulation results have been discussed in Section 6, and Section 7 includes the conclusions from the performed studies.

The Architectures of Converter Hybrid Renewable Energy Systems
In the literature, the schemes of converter hybrid renewable energy systems are classified into following general types of architecture: DC-coupled HRES, AC-coupled HRES, and HRES of mixed structure [12][13][14].
The form of DC-coupled architecture is presented in Figure 1. This architecture implies the connection of all converter systems through a common DC bus [7,14,17]. The considered system consists of: Wind Energy Conversion System (WECS), Photovoltaic (PV) panels, and Battery Energy Storage (BES). The DC sides of individual converter systems of PV converter, wind turbine WT and PMSG converter, battery bank BES converter and grid converter are connected to the one common DC bus. A single common DC/AC grid converter is used in this system. HRES is a combination of many components. The WECS includes the Wind Turbine (WT) and the Permanent Magnet Synchronous Generator (PMSG). The stator phase winding of PMSG is connected to the AC/DC converter, which is specified as the Machine Side Converter (MSC). In order to obtain the maximum power conversion from the wind, the Maximum Power Point Algorithm (MPPT) has been applied in the control of PMSG and MSC. The PV panel system is connected to the DC/DC boost converter. In the control of this converter system, the MPPT algorithm is also applied in order to achieve the maximum power from PV source of energy. The battery bank is connected to the DC bus through bidirectional DC/DC converter. In the control of this converter the proper charging and discharging strategies of the battery bank are implemented. In Figure 2, the AC-coupled architecture of a grid-connected hybrid renewable energy system with a common AC bus has been presented [14]. In this architecture, several individual DC/AC converters are applied instead of one common DC/AC converter. It means that each individual energy system uses a separated converter system, where all AC sides of these converters are connected to the common AC bus. In the control of wind and PV sources of energy, the systems of MPPT are also applied. In addition to both architectures presented above, the mixed HRES structures are also applied, in which the advantages of DC-coupled and AC-coupled architecture are jointly used.
The detailed analysis of the individual subsystems should be performed in order to define the principles of selection and control algorithms of the entire system. In this paper, the detailed investigation of the DC-coupled architecture has been chosen for particular studies. This is due to the fact that this architecture is the most widely used because of its flexibility, extensibility, and free choice of the types of connected energy sources.
The extended form of the considered DC-coupled architecture has been presented in Figure 3. This hybrid renewable system is composed of: Wind turbine system with PMSG and Machine Side Converter MSC, PV arrays with a DC/DC boost converter system, and a battery energy system BES with bidirectional DC/DC converter. All DC sides of the individual converters are connected to the common DC bus of Grid Side Converter GSC.

Wind Tubine Aerodynamic Model
The wind turbine converts the wind kinetic energy into mechanical rotational energy of turbine blades. The mechanical power P t produced by the wind turbine can be described with the following Equation [6,18]: where: R-radius of the turbine blades; A = πR 2 -area swept by the rotor blades; ρ-air density; λ-tip speed ratio; β-blade pitch angle; C p -power coefficient of the wind turbine; v w -wind speed. The tip speed ratio λ of wind turbine is defined as: where ω m is the mechanical angular speed of the turbine rotor. The turbine power coefficient C p is expressed as a complex dependence on two factors: Tip speed ratio λ and blade pitch angle β. In the literature [6,8,18,19], the approximation of power coefficient C p by the following equations is introduced: where: c 1 to c 6 represent coefficients of wind turbine characteristics (c 1 = 0.5176, c 2 = 116, c 3 = 0.4, c 4 = 5, c 5 = 21, c 6 = 0.0068), and β is blade pitch angle expressed in degrees. The relation between power coefficient C p and tip speed ratio λ for different blade pitch angle β is presented in Figure 4. The characteristics presented in Figure 4 show that for each value of the blade pitch angle β, there is a certain optimal value of tip speed ratio λ opt for which the power coefficient C p reaches its maximum value C pmax . For the wind system with usual operation of wind turbine at blade pitch angle β = 0 deg, the optimal tip speed ratio is equal to λ opt =8.1, at which C pmax = 0.48.

Model of Permanent Magnet Synchronous Generator
The mathematical model of the PMSG for the analysis is based on the following basic assumptions: The three-phase stator windings are symmetrical and distributed sinusoidally along the machine air-gap; magnetic hysteresis and saturation effects are neglected; and damping windings are not present and considered. The rotor of PMSG is directly driven by a wind turbine without a gearbox. In the developed model of the PMSG, the variables have been expressed in the synchronous rotating reference frame dq, where the d-axis is aligned with the direction of the flux vector of permanent magnet rotor.
The mathematical equations of the PMSG are expressed in the common dq-reference frame, rotating with the electrical angular rotor speed. The final form can be described as follows [20,21]: The dq components of stator flux vector in the dq reference frame are given by: where: v sd , v sq -dq components of the stator voltage vector; i sd , i sq -dq components of the stator current vector; ψ sd , ψ sq -dq components of the stator flux vector; ψ PM -flux established by the permanent magnets ω e , ω m -electrical and mechanical angular speed of the PMSG rotor; R s -stator phase resistance; L d , L q -direct and quadrature stator inductances; n p -number of pole pairs of PMSG. The electromagnetic torque of PMSG is expressed as follows: The equation of mechanical motion of wind turbine system is given by: where: T t -the mechanical torque of wind turbine; T e -the electromagnetic torque of PMSG; J-the total inertia of the system; B f -coefficient of viscous friction in WECS mechanical system.

Mathematical Models of PV Systems
Solar cell is a device that can transform sunlight energy directly into electrical energy by photovoltaic effect. The photovoltaic effect is apparent to the effect in P-N junction of semiconductors. In this work, the proposed model of PV cell is based on the static behavior of a conventional P-N junction diode. The equivalent circuit of a PV cell is shown in Figure 5a. This model consists of a direct current source I ph in parallel with a diode D and shunt resistor R p and series resistor R s [22][23][24].
The typical photovoltaic array is formed by Np parallel PV strings and each string contains Ns PV cells connected in series. A series-parallel combination of appropriate solar cells and panels is applied in order to provide the required voltages and currents. The equivalent electrical circuit for photovoltaic array is shown in Figure 5b. The cell output current I PVc can be calculated by [25]: where: I o -the reverse saturation current of diode; V PVc -the cell output voltage; q-electron charge; A-diode ideality factor; K-Boltzmann's constant; T-temperature of the PV cell (in K). The current I ph is proportional to the value of solar irradiation G r and is linear with respect to the PV cell temperature T: where: I sc -the short circuit current of PV cell; K i -the temperature coefficient of the short-circuit current [A/K]; G r -solar irradiation [W/m 2 ]. The PV cells are connected in series and in parallel and form the array. The output current I PV of the PV array can be expressed in the form [24,26]: The electrical power P PV of the PV array can be described by the following equation: The computed current-voltage characteristics and power-voltage characteristics of PV array for different levels of irradiation and constant module temperature have been presented in Figure 6. It can be stated, that the power of PV array is a non-linear function of the operating voltage and this function has a maximum power point (MPP). From these characteristics, it can be stated that the voltage and power of the PV array is decreasing with the decrease of the level of irradiation.

Mathematical Models of Battery Energy System
Rechargeable electrical batteries are electrochemical devices which convert electrical energy to chemical energy during charging and convert chemical energy to electrical energy during discharging. The Battery Energy Storage (BES) system is the important component of the considered HRES system. The application of the BES system allows it to store surplus energy in case of when the energy generated by the wind turbine or photovoltaic array exceeds the demands of energy loads. The BES system can also provide energy to HRES in cases when the renewable sources are working with low efficiency or are out of operation or in cases of any grid faults [7,17,27].
A variety of battery models exist that predict battery behavior. The battery models can be divided into analytical, electrochemical, and electrical circuit models or a combination of the model types. Electrical circuit models are the most widely used because they are able to describe the battery behavior with the help of electric elements. The common used representatives of electric equivalent circuit models of batteries are presented in Figure 7 [28,29]. The parameters of these circuit models are determined by the producers at the assumptions of normal states of battery operation. For the abnormal operation of the batteries, the modified set of parameters or the special modified battery models should be applied. The circuit model of the battery in Figure 7a is defined as dynamic. It consists of two separate circuits, linked by a voltage controlled voltage source v OC and a current controlled current source i Bat . The left circuit is operated as energy balanced circuit and it is used for modelling the capacity and State of Charge (SOC) of the battery. It includes the capacitance C Cap in parallel with the resistance R Sd . The capacitance C Cap represents the overall capacitance of the battery, the resistance R Sd is used for modeling the process of battery self-discharging. The right circuit is operated as voltage response circuit and it is used for modelling the steady-state and transient behavior of the battery. It includes the controlled voltage source v OC , series resistance R s , and two elements connected in series: Resistance R s1 in parallel with capacitance C s1 and resistance R s2 in parallel with capacitance C s2 . The controlled voltage source v OC represents a voltage open circuit (VOC) of the battery. Series resistance R s is used for modelling steady-state operation and power losses in the battery. Resistance R s1 with parallel capacitance C s1 represent the circuit for modelling the transients of short time constant, resistance R s2 with parallel capacitance C s2 represent the circuit for modelling the transients of long time constant. It is possible to add more RC networks to the battery model for improving model's accuracy, but it causes the increase of model complexity. In improved models, a dependence of the network elements on the SOC value was also proposed to achieve higher accuracy [29].
During analysis and in battery operations, the State of Charge (SOC) of the battery should be controlled. The SOC is defined as: where: SOC 0 -initial state of battery charge; Q N -nominal capacity of the battery; i Bat -the battery current (positive by discharging and negative by charging); it-the charge supplied or drawn by battery; t-time.
The dynamic model of battery is described by the following system of state equations: The circuit model of the battery in Figure 7b is defined as nonlinear. It is simple and consists only of a controlled voltage source v OC in series with resistance R in . The circuit model of battery directly describes the behavior of a battery with using only terminal voltage, open circuit voltage, internal resistance, dis/charge current, and state of charge. This battery model is described by the following equations [29]: where: v OC0 -no load battery voltage; K-polarization voltage; Q-battery capacity; Aexponential component amplitude; B-time constant inverse; R in -battery internal resistance. The above nonlinear model of battery is not suitable for using in simulations of closedloop systems because it introduces an algebraic loop problem and instability in simulations. Because of this, the simulation studies of HRES performed in this paper were based on a dynamic model of battery.

Control of DC/DC Converter for PV Array
For conversion of the electrical energy obtained from the PV array, the converter of topology of the DC/DC Boost Converter is applied. The scheme of this type of converter is presented in Figure 8. The DC/DC converter is comprised of controlled switch S, diode D b , boost inductor L d , and filter capacitor C d . In order to improve the operation and the efficiency of the PV array, the MPPT algorithm has been used for the operation control of the PV converter. In this paper, the Perturb and Observe (P&O) algorithm has been implemented [30][31][32]. Figure 9 presents the principle of control strategy, which is based on the flow chart for the P&O algorithm. In the operation of the P&O algorithm, the principle of incremental increasing/decreasing of the array voltage is applied in order to find the maximum point of output array power [31]. The PV array voltage is periodically perturbed, and then the output power of PV is compared with that of the previous cycle of perturbation. According to the presented flow chart, when the PV power and PV voltage are increased at the same time, the perturbation step size ∆D will be added to the duty cycle D of DC/DC boost converter [23,25,30,33,34]. However, when the PV power increases and PV voltage decreases, the perturbation step size ∆D will be subtracted from the duty cycle D for the next cycle of perturbation. This process of searching will be repeated until MPP point will be reached. The P&O MPPT algorithm is suitable for use in PV control systems, because of its simple structure and because it requires only two parameters of PV array: Photovoltaic voltage V PV and photovoltaic current I PV . The certain disadvantage of the P&O algorithm is the possibility of power oscillation at the state, when the algorithm is almost reaching the MPP. To avoid power oscillations, the right choice of step size for the next time cycle is very important. In the literature, many other improvements of P&O algorithm are also considered [23,31].

Control of Bidirectional DC/DC Converter for Battery System
For the conversion of energy in the BES system, the bidirectional flow of electrical energy is required. For this aim, in the control system, the DC/DC current reversible chopper has been applied. The scheme of the considered converter is presented in Figure 10. The DC/DC converter is comprised of two controlled switches, S a and S b , inductor L d , and filter capacitor C d . The converter can be treated as the combination of two basic chopper circuits, the step-down chopper and the step-up chopper. The bidirectional DC/DC converter enables the operation in the power mode with charging the battery and the operation in the regenerative mode with discharging the battery. It is obtained by the suitable control system, which generates two control signals for two controlled transistor switches of the converter.
In Figure 11, the control scheme of switches of bidirectional DC/DC converter for the BES system has been presented [11]. For the control of switches, the adequate control loop has been applied. The reference value of the required battery power P Bat * is calculated as the difference of the current demand of load power P Load , the wind turbine generated power P WT , and photovoltaic generated power P PV . The obtained value of the reference battery power P Bat * is then divided by battery voltage V Bat . In this way, the reference battery current I Bat * is determined. In the control system, the reference battery current I Bat * is compared with the measured battery current I Bat . The error signal is given to the PI controller. The reference signal of duty cycle D1 of DC/DC bidirectional converter is determined as the output value from the PI controller. In the realized control system, the additional limited block was introduced in order to protect the battery against the flow of power greater than the maximum allowable power. Moreover, in the realized control system, the additional algorithm for battery protection from excessive overcharging and excessive deep discharging has been implemented. The State of Charge (SOC) of the battery has the important role in increasing the battery lifetime [17,28]. When the SOC values of the battery are not in the proper range, the switching signals of the converter are blocked, and the bidirectional DC/DC converter is out of operation.

Control of Wind Turbine with MPPT and PMSG with Machine Side Converter
In order to achieve the wind turbine operation at the conversion of maximum mechanical power from the wind, the algorithm of Maximum Power Point Tracking (MPPT) should be included in the control system. In the literature, several methods of MPPT have been considered [6,8]. These MPPT methods are based on calculation algorithms or on search algorithms techniques. The search algorithms are precise, but they need quite a long period of time in order to find final solution. In study of complex HRES systems the calculation algorithms of MPPT are preferable. The very often used in simulations calculation algorithm is based on using the MPPT method with optimal Tip Speed Ratio (TSR).
In the TSR control, the turbine should be operated at optimum value of rotational speed ω opt . It is realized by controlling the turbine speed in order to follow the optimum speed ω opt . On the base of Equation (2) and Figure 4, the reference value of rotational speed ω ref is determined by the choice of optimal tip-speed ratio λ opt. The reference rotational speed ω ref of the wind turbine rotor is equal to an optimal value of the rotational speed ω opt of the wind turbine rotor, which is specified as follows: The above equation determines the principle of TSR control for tracking the peak power points of wind turbine. While maintaining the constant optimal value of λ opt , the reference turbine rotational speed ω ref should be changed proportionally to the current wind speed v w .
In this paper, the MPPT algorithm based on the choice of optimal value of TSR has been implemented. The TSR control of MPPT for the wind turbine is presented in Figure 12. In the control systems, the optimal turbine rotational speed is calculated through TSR block and as the reference speed ω ref is compared with the measured rotational speed ω m of the turbine rotor. The obtained error signal is given to the PI controller. The output control signal of the speed control loop is the reference signal i sq * of q-component of stator current vector, which determines the electromagnetic torque of the PMSG. The presented TSR algorithm of MPPT is simple, precise, and useful for analytical and simulation studies. However, the practical applications of this algorithm are limited because of the difficulty of accurate measurement of the wind speeds acting on the turbine blades.
The considered Machine Side Converter (MSC) in the system is the three-phase AC/DC converter of the conventional topology of two-level voltage inverter. The control of PMSG with MSC is based on vector control with application of Rotor Field Oriented Control (RFOC). Figure 13 shows the detailed scheme of RFOC control with application Space Vector Modulation (SVM) for MSC [6,18]. In the presented control scheme, there are three control loops. The aim of the outer control loop is the control of generator rotational speed. Two inner control loops are designed for control of individual components of the stator current vector.
The PI controller in the outer control loop provides by control, that the generator speed is following the reference course of optimal speed ω opt of the wind turbine, at which the maximum power of wind turbine is produced. The reference signal i sq * of the q-component of stator current vector is generated as the output control signal of the speed control loop. The reference signal i sq * determines the desired electromagnetic torque of PMSG.
Both stator current vector components: i sd and i sq are regulated thorough two inner control loops with PI controllers. In the control system, the method of zero d-axis stator current control is realized, and for this reason, the reference component i sd * of stator current vector is set to zero value. As a result of this, the stator current vector will be equal only to its q-axis component i sq . With i sd = 0, the generator electromagnetic torque is proportional to the q-axis current component i sq . The stator current reference i sq * is achieved in the control system by using the operation of the MPPT block. The reference dq-axis components i sd * and i sq * of stator current vector are compared with the real current components i sd and i sq , obtained from measurement and transformation of real stator phase currents. As the result of the comparison operation, the error control signals are generated and sent to the individual PI controllers. In the control system, the decoupling blocks have also been implemented in order to assure high control performance. The output signal from each decoupling block is added to the output signal of the corresponding controller. In this way, the resultant control signals that form the dq-axis reference components v pd * and v pq * of the stator voltage vector are obtained. These reference voltages are then transformed from the rotating d-q-system to the stationary α-β-system, and are sent to the block of Space Vector Modulation (SVM) of the MSC.

Control of Grid Side Converter
The Grid Side Converter (GSC) is the three-phase DC/AC converter of the conventional topology of two-level voltage inverter. For the control of GSC the modern control method based on Direct Power Control (DPC) with SVM modulation has been implemented. The main aim of the GSC is to perform the basic control tasks in the system. These tasks include the control of DC link voltage of the GSC and control of the instantaneous active and reactive power delivered to the AC grid. The detailed control scheme of DPC-SVM system has been presented in Figure 14 [6,20]. There are three control loops with PI controllers applied in the control scheme of DPC-SVM for the GSC. The outer control loop regulates DC link voltage of the GSC and DC bus of HRES. Two inner control loops regulate the active and reactive power transferred to the loads and to the AC grid. The measured values of active and reactive power are estimated in special blocks and compared next with the reference values. In the common operation of the control system, the reference of reactive grid power q g * is set to zero in order to perform the system operation at the unity power factor. The reference of active grid power p g * is calculated on the base of multiplication of the measured DC voltage v dc of the converter and the reference value of grid current vector component i gd *. The reference value of grid current vector component i gd * is obtained from the outer control loop. The output signals from the inner PI controllers determine the reference grid voltage vector components v gcd * and v gcq * for the control of GSC. After transformation of these reference voltages from rotating d-q-system to the stationary α-β-system, the control signals are obtained, which are sent to the block of SVM of GSC. For the determining the angle θ g used for the transformation of reference voltages v gcd * and v gcq * from d-q-system to the α-β-system, the grid voltages are measured. For the determination of the angle θ g of grid voltage vector v g , the PLL method and control circuit have been implemented.

General Conditions of Energy Management
In the HRES system, the conditions for adequate flow of the electrical energy should be fulfilled. Therefore, the adopting of special energy management strategy (EMS) is essential to ensure proper operation of the system and reduce the costs of its operation. The aim of the energy management system is to maintain the balance between the energy produced by the energy sources and the energy demanded by the electrical loads and energy storage, while protecting the storage units from excessive charge or discharge, and including the possible exchange of energy with the electrical grid. The energy management strategy can be also integrated with special optimization system in order to ensure the continuity of load supply and to decrease the cost of energy production. Various approaches and techniques have been used to develop a successful energy management strategy. Several studies discussing the issues connected with energy management in HRES are presented in [15,16,35]. In [15], a DC-coupled wind/hydrogen/supercapacitor hybrid power system is studied. A novel special HRES system, designed to sustainably meet a dynamic electricity demand of a membrane bioreactor, is considered in [16].
In the developed approach to energy management, the grid-connected hybrid renewable systems and the stand-alone hybrid renewable energy systems were included. For this aim, the special power management algorithm (PMA) was developed to operate both the photovoltaic energy system and the wind energy system at the maximum power they can generate under various environmental conditions. Therefore the energy management strategy includes the MPPT systems of wind and PV energy, battery energy storage, utility connection, and load switching. In order to maintain a long life-time of the battery, the State of Charging (SOC) of the battery is also controlled in the developed energy management strategy. The operational value of SOC is kept between the minimum value SOC min (about 20%) and the maximum value SOC max (usually about 80-90%). In addition, in the energy management strategy, it was concluded that during battery charging and discharging processes, the maximum permissible power load of the battery may not be exceeded.
On the base of the system architecture presented in Figure 3, the equation of power balance of HRES used in energy management strategy can be described in the following form: where: P WT -output power of WT and PMSG; P PV -the power delivered by PV system; P Bat -the battery power; P Grid -the grid power; and P Load -the electrical load power. Equation (22) is the algebraic equation, in which some power components can have various signs, depending on the condition, whether the considered power component is delivered or taken away from the common DC bus. The equation was formulated at the assumption of neglecting of power losses in the system and for the condition of operation in steady-states. The equation has a general form and can be used for the analysis of both grid-connected HRES and stand-alone HRES. For stand-alone HRES, the component of grid power P Grid in this equation should be omitted.
The conditions of energy management strategy were mathematically modelled in the program block of the Power Control Unit (PCU) and were implemented in Matlab-Simulink software. The developed management strategy ensures the power balance between the energy sources and loads, and protects the storage battery from overcharge or deep discharge. In the PCU the presented below power-balancing algorithms for different architectures of HRES were implemented. In the algorithms the possible operating states of HRES were included and considered.

Energy Management Strategy for Grid-Connected HRES
The total generated power from the renewable energy sources: the wind turbine power P WT and the PV power P PV is treated as the primary supply power, that has the priority in satisfying the load demand over that provided by utility grid. It was assumed, that the energy consumption from the grid should be avoided because it requires additional payment and costs. For this reason, the using of energy from the utility grid is put at the end of the list of priorities.
If the total power generated by WT and PV systems (P WT + P PV ) is greater than the load demand P Load , the surplus power P Sur = P WT + P PV − P Load has the priority in charging the battery with the power P Bat . The battery can be charged until it will be fully charged. The whole surplus power can be delivered to the grid only in the case when the battery was fully charged P Grid = P Sur . Because the battery can be charged only with the limited maximal power P Batmax , when the surplus power is greater than P Batmax , then the battery is charging with its maximal power, and only the rest of surplus power is returned to the utility grid P Grid = P Sur − P Batmax .
If the total power generated by WT and PV systems (P WT + P PV ) is lower than the load demand P Load , then deficit power P Def = P Load − (P WT + P PV ) will occur in HRES. The battery has the priority, and at discharging is able to deliver the addition to the power demand of the load. However, when the battery is fully discharged, the deficit power must be completely delivered from the grid. Because the battery can be discharged only with the limited maximal power P Batmax , then when the deficit power is greater than P Batmax , the battery is used at discharging with maximal power, and the rest of deficit power must be received from the utility grid P Grid = P Def − P Batmax .
The general block diagram presenting the developed power management strategy for grid-connected HRES is presented in Figure 15.

Energy Management Strategy for Stand-Alone HRES
The energy management strategy for stand-alone HRES is similar to the strategy applied in the grid-connected HRES. A significant difference is the lack of access to the utility grid and not the possibility to draw power from the grid and no feed-in power to the grid.
If the total power generated by WT and PV systems (P WT + P PV ) is greater than the load demand P Load , the surplus power P Sur will charge the battery when the condition is fulfilled P Sur ≤ P Batmax . The battery can be charged until it will be fully charged. After the battery is fully charged or P Sur > P Batmax , the excess power P Sur cannot be stored, and because of this, it should be limited. It can be obtained by decreasing the generation of renewable energy by throwing control systems from keeping operation at maximum power points or simply by switching off selected sources of renewable energy generation. Excess power can be also dumped in some additional energy loads specially connected to the system in this case.
If the total power generated by WT and PV systems (P WT + P PV ) is lower than the load demand P Load , than there will be deficit power P Def in HRES. The battery will be discharged in order to reduce or compensate for the power deficit. This state is possible only in the determined period of time because of the limited battery capacitance. The battery capacitance should be designed for the projected period of no energy production or a reduced value of generated energy. It is also recommended to divide the used power loads into critical loads, which cannot be turned off and into non-critical ones, which can be turned off when the amount of generated energy in the system is insufficient. Another possible solution in this case is to use an additional energy source, e.g., an electric generator system driven by an internal combustion engine.

Simulation Results
The mathematical models of individual parts of the hybrid renewable energy system (HRES) and the applied control systems have been implemented in the simulation program, which was formulated in a MATLAB/Simulink environment. Digital simulation studies were performed for the converter systems with a wind turbine, PMSG, PV panels, and battery bank. The data and parameters used in the simulation studies are presented below: Many simulation studies were conducted to show performance of the HRES system under various conditions. The chosen simulation results are presented in  For the purpose of shortening the simulation times, it was assumed that the changes of considered consecutive operation states in the system are quite fast and are performed in short time intervals.        In Figures 16-19, the simulation results of selected operation states of the wind turbine system with PMSG and MSC have been presented. In Figure 16, the assumed wind speed variation during the simulation time period of 24 s is shown. In Figure 17, the waveforms of optimal reference angular speed ω opt = ω ref and measured angular speed ω m of the wind turbine rotor and the rotor of PMSG are presented. The performed studies confirm, that the waveform of turbine angular speed ω m is accurately adjusted to the waveform of optimal referenced speed ω opt . The applied MPPT algorithm ensures the determination of the reference speed ω opt . For these assumed conditions of realization of MPPT, the wind turbine should be in the operation at a constant optimal value of tip speed ratio λ opt and at a constant maximum value of turbine power coefficient C pmax . The obtained courses of tip speed ratio λ and turbine power coefficient C p at various wind speeds have been presented in Figure 18 and in Figure 19, respectively. On the base of these figures, the proper operation of MPPT algorithm of the wind turbine can be confirmed. Even, if there are large changes of wind speeds, the optimal and constant values of tip speed ratio λ and power coefficient C p have been reached. In Figures 20 and 21, the selected simulation results of studies of PMSG and MSC with the control system, based on the RFOC method are presented, respectively.
The courses of components i sd , i sq of stator current vector of PMSG have been presented in Figure 20. On the base of these courses, it can be stated that the component i sd of stator current vector is almost exactly set by the control system to zero value i sd = 0. This condition is optimal and required for the proper operation of PMSG and for RFOC control of PMSG. On the base of the course, it can be stated that the component i sq of stator current vector is changing according to the waveforms of wind speed variations. The component i sq is responsible for the generation of electromagnetic torque T e of the PMSG generator.
The runs of electromagnetic torque T e of PMSG generator and mechanical torque T t of wind turbine have been presented in Figure 21. On the base of comparison with Figure 20, it can be confirmed that at RFOC control, the electromagnetic torque T e of PMSG generator is proportional to the stator current vector component i sq .
The selected results of simulation studies of the DPC control system of GSC converter are presented in Figures 22 and 23, respectively.
The courses of components i gd , i gq of grid current vector for GSC have been presented in Figure 22. The component i gd represents the flow of the active power at the AC side of GSC. The power flow between the grid and the GSC converter can be bidirectional: Power can be transferred from the grid to the GSC or delivered from the GSC converter to the grid. At i gd > 0, the active power is transferred to the GSC and at i gd < 0 the active power is delivered to the grid. At i gq = 0, the reactive power is equal to zero, and the optimal operation of unity grid power factor is obtained. These conditions are properly met by the GSC control system, as shown in the Figure 22.
The Figure 23 presents the course of the voltage v dc in the common DC link of the considered system of converters. It can be stated that the course of instantaneous voltage v dc is kept practically on the constant level despite variations of wind speeds and changes of the power flows in the system. This is a confirmation of the high accuracy and quick operation of the control system.
In the Figure 24, the simulation runs of the power flows between particular parts of the considered Hybrid Renewable Energy System are presented. In the simulation, the complex HRES system presented in Figure 3 and the simulation data given in Section 6 have been included. For the simulation purposes, the operation time of the hybrid system was divided into four separate states: State 1, 2, 3, and 4. For individual states, different values of the load power consumptions as well as different levels of solar radiation and wind conditions were assumed, respectively.
In State 1, it is assumed that the PV system is out of operation (P PV = 0) and the load power consumption P Load is high. Because the power of the wind system is smaller than the demand of load power (P WT < P Load ), the power shortage is supplemented by the battery, which operates at the rated power output in the discharging mode (P Bat > 0). Despite these conditions, there is still a power shortage, which can only be eliminated by taking additional power from the grid (P Grid > 0).
In State 2, it is assumed that the PV system is in operation (P PV > 0), the wind system is in operation (P WT > 0), and the load power consumption P Load is high. Because the sum of the power of the wind system and the power of the PV system is greater or equal to the load power (P WT + P PV ≥ P Load ), there is no need to take power from the grid (P Grid = 0). In the time intervals, when there is a surplus of generator and PV power over the load power, the battery works in the charging mode, i.e., with power consumption (P Bat < 0). The system operation in this state is similar to the operation of the stand-alone system.
In State 3, it is assumed that the PV system is in operation (P PV > 0), the wind system is in operation (P WT > 0), and the load power consumption P Load is small or equal to zero. Because the sum of the power of the wind system and the power of the PV system is greater than the demanded load power (P WT + P PV > P Load ), the part of surplus of generator and PV power over the load power is used for charging the battery with rated power (P Bat < 0). The remaining part of the surplus power is the power recovered to the grid (P Grid < 0). State 4 is similar to State 2, with the exception that the battery is operating in the discharging mode (P Bat > 0).
The conducted simulation tests confirmed the purposefulness of using HRES systems and good operational properties of its subsystems. The overall structure of the hybrid energy system, consisting of a wind/PV/battery energy system, provides a good and reliable energy system. All sources of energy in the system can supply the power, and if any decrease in power occurs, it can be compensated through other sources. When the generated power is in excess, it can be stored in a battery or transferred to the AC grid. The considered renewable hybrid system can provide a continuous power supply to the load even in the case of low wind speeds or low value of solar irradiations.

Conclusions
In this paper, analysis and simulation studies of complex hybrid renewable energy system (HRES) have been performed. The considered system consists of wind turbine system with PMSG generator, photovoltaic panels system, and battery energy storage system. The multi-converter DC-coupled architecture of HRES was investigated.
The system is capable of ensuring the desired power flow to the loads under various operating conditions of renewable energy sources. The combined analysis of the considered HRES system is far more complex than separate study of individual components of the system, usually presented in the literature. The performed studies of the combined system can be treated as some original contributions of the authors.
The considered control algorithm of PMSG with machine side converter was based on Rotor Field Oriented Control with including TSR algorithm of MPPT. For control of the grid side converter, the Direct Power Control method has been applied. The applied DPC control is able to accurately maintain the DC link voltage value in accordance with the reference value and to adjust the desired power flows between the grid and the system. In the control of operation of the PV system, the MPPT algorithm based on P&O algorithm has been implemented. This algorithm allows us to obtain the maximum value of PV produced power for different levels of solar irradiation and ambient temperature.
The developed energy management strategies enable the proper operation of both the wind energy system and photovoltaic energy system under various environmental conditions while maintaining power supply demand of the load side at the required amount. In order to store the surplus power, the converter system with battery energy storage has been included and connected to the common DC link. This system accurately supports the wind and solar system in the case of high demand or low demand of the load power. The results of the performed simulations confirmed that the studied hybrid renewable energy system has appropriate technical and energetic properties and performances. The considered renewable hybrid system can provide a continuous power supply to the load even in the case of low wind speeds or low value of solar irradiations. In the case of surplus power from the wind turbine system or photovoltaic panels system, the excess power will be stored in the battery system. If the battery is fully charged, the excess power is fed back to the AC grid. Simulation results confirmed the good of the control system for the wind turbine with direct-driven PMSG, PV panels, and battery energy system. Author Contributions: Conceptualization, P.G. and K.P.; methodology, P.G. and K.P.; software, P.G.; validation, P.G. and K.P.; formal analysis, K.P.; investigation, P.G.; resources, P.G.; data curation, P.G.; writing-original draft preparation, P.G.; writing-review and editing, K.P.; visualization, K.P.; supervision, K.P.; project administration, K.P.; funding acquisition, P.G. All authors have read and agreed to the published version of the manuscript.