Intelligent Control of a Distributed Energy Generation System Based on Renewable Sources

The control of low power systems, which include renewable energy sources, a local network, an electrochemical storage subsystem and a grid connection, is inherently hierarchical. The lower level consists of the wind energy sources (power limitation at rated value in full load regime and energy optimization in partial load regime) and photovoltaic (energy conversion optimization) control systems. The present paper deals with control problem at the higher level and aims at generating the control solution for the energetic transfer between the system components, given that the powers of the renewable energy sources and the power in the local network have random characteristics. For the higher level, the paper proposes a mixed performance criterion, which includes an energy sub-criterion concerning the costs of electricity supplied to local consumers, and a sub-criterion related to the lifetime of the battery. Three variants were defined for the control algorithm implemented by using fuzzy logic techniques, in order to control the energy transfer in the system. Particular attention was given to developing the models used for the simulation of the distributed energy system components and to the whole control system, given that the objective is not the real-time optimization of the criterion, but to establish by numerical simulation in the design stage the “proper” parameters of the control system. This is done by taking into account the multi-criteria performance objective when the power of renewable energy sources and the load have random characteristics.


Introduction
Distributed systems for the generation and use of electrical energy based on renewable sources is a topic that has been widely treated in the literature, given their involvement in the development of smart grids [1,2].In this context, an important category is represented by low power systems (up to 5 kW), which provide electricity for local users, predominantly from renewable energy sources.In this case, there is an electrical energy storage system (a battery) and a connection to the national grid to transfer the surplus/deficit of energy from the power flow [3][4][5].These distributed systems, which will be addressed in our paper, imply various issues, such as choosing renewable energy sources to simultaneously satisfy the requirements of cost and performance for the energy conversion, ensuring a long lifetime for the battery; ensuring the quality requirements for the electrical energy and, finally, designing a control structure covering a multi-criteria performance indicator.
Regarding the renewable energy sources (solar and wind), a key issue is to find the control solutions to ensure the optimal operation in relation with an efficiency criterion given the randomness of these primary energy resources [5][6][7][8].For small power wind energy systems, the permanent magnet synchronous generator (PMSG) is preferred, as it allows the direct coupling to the wind turbine.The control solution ensures in this case the optimal regimes for the wind turbine (in terms of energy criterion), i.e., to ensure the maximum power conversion in the operating region corresponding to a partial load regime as well as power limitation in full load operating region [9,10].In the full load operating region, the "stall speed regulation" strategy is used, which limits the shaft power by bringing the turbine in stall mode, based on shaft rotational speed reduction.On the other hand, control solution for solar energy systems ensures the operation on the optimal regimes characteristics, based on a mathematical model of the photovoltaic panel [11].
A crucial problem, insufficiently solved in the multisource systems with renewable energy conversion, is to ensure a long lifetime of the battery.Naturally, lifetime depends on the type of the adopted battery, which corresponds to the investment cost.When the battery has already been chosen on the basis of the quality/cost tradeoff, the question is to ensure the longest possible battery lifetime.What will be referred to in this paper is the fact that such an issue as the battery lifetime can be addressed on the basis of the control of the sources from the system, also taking into account that the power output of the renewable energy sources and the power required by the local network are random variables.
Compliance with the supplied electrical energy quality, as imposed by technical rules authorizing the coupling of energy distributed system to the grid, implies the use of active power filters which by means of its control systems should provide a good performance/cost ratio [12,13].
The control of the distributed energy system with renewable sources was extensively approached in the literature.One of the first papers was published in 2001 and concerns intelligent energy management considering energy sources like photovoltaic, wind and conventional power plants, and dealing with the optimization of the system using energetic, ecological and economical criteria [14].One of the approaches used in the following years was the supervisory control, considering different structures for the distributed energy systems: stand-alone system, including wind and solar energy sources [15], or grid-connected system [16], also including wind and solar energy sources, where multiple supervisory control strategies are considered.The efficient use of the storage capacities prove to be an efficient solution in increasing the performances of these distributed systems which are deeply influenced by the randomness of the energy provided by the renewable sources.Thus, in [17] a micro-wind energy system uses the battery unit as buffer for high demand periods, and also and to maintain the power quality norms, and in [18] the energy management systems minimize the power outage to critical loads, and maximize the utilization of renewable energy sources.Other applications include the use of SCADA systems to implement the management system for the Distributed Energy Systems [19].However, the most widely used approach in the past few years is the optimal control of these systems: in [20] an optimal control strategy for an isolated system is proposed to coordinate energy storage and diesel generators to maximize wind penetration while maintaining system economics and normal operation performance; in [21] an Economic Model Predictive Control scheme is proposed in order to achieve the optimal economic performance in the operational costs of the micro-grid, but without considering the lifetime of the battery; in [22] a novel dissipativity-based distributed economic model prediction control approach is proposed to allow micro-grid users to optimize their own benefits, but the application only considers solar energy sources.
This paper deals with the hierarchical control of distributed systems for the generation and use of electrical energy based on renewable sources based on artificial intelligence techniques.The proposed structure of the control system distinguishes itself from the proposals in the literature [14][15][16][17][18][19][20][21][22] by the following features: ‚ using a mixed performance criterion, which includes both the cost of the electricity supplied to the local consumers and a component expressing the battery lifetime; ‚ establishing a fuzzy based solution for the higher level control of the distributed system, which will correspond to the requirements imposed by the use of the mixed performance criterion; and ‚ obtaining the control solution and the parameters of the appropriate fuzzy controller based on numerical simulation of the hybrid system using plausible scenarios regarding the random evolution of the renewable energy sources and the local network.Within each scenario, the controller parameters are established in order to satisfy the designer requirements regarding the performance criterion components.The final values of the controller parameters are determined on the basis of the values obtained in all scenarios considered in the simulation.Therefore, the controller parameters are not obtained through a real time optimization procedure of the mixed performance criterion because they would be suitable only for a given instance of the mentioned random powers, used in the optimization procedure.
The rest of the article is organized as follows: Section 2 presents the structure of the proposed distributed energy system, the models of the renewable energy sources (wind and solar energy) and of the load, and the intelligent control algorithms used for the control of the system under consideration.In the same section, a performance criterion is introduced, including both the cost of electricity supplied to local consumers and the battery lifetime.Section 3 deals with the results obtained when using the intelligent control algorithms shown previously and, based on the obtained results, proposes an improved version of the control algorithm.The last section is dedicated to conclusions.

The Structure of the Distributed Electrical Energy Generation System Based on Renewable Sources
The simplified block scheme, illustrating the structure of energy distributed system and highlighting the proposed higher control level, is shown in Figure 1.


establishing a fuzzy based solution for the higher level control of the distributed system, which will correspond to the requirements imposed by the use of the mixed performance criterion; and  obtaining the control solution and the parameters of the appropriate fuzzy controller based on numerical simulation of the hybrid system using plausible scenarios regarding the random evolution of the renewable energy sources and the local network.Within each scenario, the controller parameters are established in order to satisfy the designer requirements regarding the performance criterion components.The final values of the controller parameters are determined on the basis of the values obtained in all scenarios considered in the simulation.Therefore, the controller parameters are not obtained through a real time optimization procedure of the mixed performance criterion because they would be suitable only for a given instance of the mentioned random powers, used in the optimization procedure.
The rest of the article is organized as follows: Section 2 presents the structure of the proposed distributed energy system, the models of the renewable energy sources (wind and solar energy) and of the load, and the intelligent control algorithms used for the control of the system under consideration.In the same section, a performance criterion is introduced, including both the cost of electricity supplied to local consumers and the battery lifetime.Section 3 deals with the results obtained when using the intelligent control algorithms shown previously and, based on the obtained results, proposes an improved version of the control algorithm.The last section is dedicated to conclusions.

The Structure of the Distributed Electrical Energy Generation System Based on Renewable Sources
The simplified block scheme, illustrating the structure of energy distributed system and highlighting the proposed higher control level, is shown in Figure 1.The system includes two power sources based on the conversion of renewable energies: wind turbine and photovoltaic panels.These sources inject the currents IWT and IPV into the DC The system includes two power sources based on the conversion of renewable energies: wind turbine and photovoltaic panels.These sources inject the currents I WT and I PV into the DC intermediate circuit, and from here the energy flow can be transferred either to the local network or, eventually, to the grid or to the battery.
In the first case, as long as the national grid is connected and available, the block labeled "Inverter/APF" has enabled the active power filter function and can achieve a bidirectional energy transfer, ensuring the power quality requirements for grid connection.If the renewable sources produce more energy than the one required to satisfy the local consumers as well as the charging battery requirements, a transfer of energy to the grid is ordered based on the energy balance.However, if the energy provided from the renewable sources is insufficient and there is a need to ensure a power flow from the grid for charging the battery then the "Inverter/APF" works in a rectifier PWM mode.If the national grid is not available, the block "Inverter/APF" only works as a voltage inverter, supplying the local consumers based on available energy in the battery and from the renewable sources.
The second case refers to the transfer to/from the battery.An important condition imposed on the system by the performance criterion is to ensure a regularly charging/discharging regime of the battery (to the extent possible, given that both the renewable sources and the load have random characteristics) and at a low frequency, so that it results in a longer battery lifetime.This requirement is imposed through the control of the bidirectional converter "C dc-dc ", simultaneously with another concurrent requirement: reducing the energy transfer from the grid to the local network.
The hierarchical control system contains two levels: the lower control level which refers to the control systems related to the system components and the higher level which refers to the management of the energy flows, taking into account a mixed criterion which considers energy cost as well as battery lifetime.The implemented lower level for the wind energy system ensures the optimal regimes for wind turbine (in terms of energy criterion), i.e., ensures the maximum power conversion in region 2 (partial load regime) and power limitation in region 3 (full load operating region) [9,10].The control solution for solar energy system ensures operation on the optimal regimes characteristics, based on a mathematical model of the photovoltaic panel [11].The control system for the "Inverter/APF" performs the regime inverter/rectifier PWM providing the output voltage level and the power quality requirements imposed to the active power filter.The control system of the "C dc-dc " converter provides direction and intensity of the transfer energy.The higher control level is implemented in the "Intelligent Management and Operation Control Block" and its design and implementation will be shown in the next sections.

Modeling the Random Energetic Flows
In the energy balance of the distributed system the following energetic flows with random evolution take place: power is generated by renewable energy sources (wind and solar) and power is consumed in the local network (the load).

Modeling of the Power Generated by the Wind Source
The electrical power provided by the wind source, P we , is modeled as: P we " η g P wm " η g ¨0.5πρR 2 C P pλqv 3  (1) where P wm is the mechanical power, η g is the efficiency of the electric generator, ρ is the air density, R is the turbine blade length, v is the wind speed, and C P pλq is the turbine power coefficient, which depends on the tip speed ratio λ " RΩ{v.In the partial load region, the control system of the wind source ensures the operation of the turbine on the optimal regimes characteristics by maintaining the tip speed ratio at the optimal value, λ opt .The dependence of electric power on the wind speed is of the form: P we " K Pe ¨v3 , in which K Pe " η g ¨0.5πρR 2 C Pmax is obtained from knowing the nominal value of electrical power and wind speed: K Pe " P we,r {v 3 r .In the full load region, when v ą v r , the turbine control system should keep the power at the nominal value.
The wind speed is a non-stationary random variable that can be presented as: where v ptq is the medium-and long-term component and v t ptq is the turbulence component.
For the time scale corresponding to the turbulence component, v ptq may be considered as the constant average of the wind speed.Both components are important in distributed systems for electricity production from renewable sources.The medium-and long-term component is particularly important for medium and high power wind systems.They have slow dynamics and react to low frequency variations of the wind speed, which determines the sequence of situations regarding the wind energy potential (high, medium, low).Small turbines, as the one considered in this paper, have fast dynamics and also react to the turbulence component of the wind speed.
For modeling the wind speed the starting point was the generic broadband model of Van der Hoven [23], valid for the temperate zone, which provides information on the power spectral density of wind speed, S vv pωq, for both components on the medium-and long-term, as well for the turbulence component.To generate the time series which represents the component v ptq a shaping filter has been used.The gain characteristics of such filter Gpωq " a S vv pωq have been obtained on the basis of the Van der Hoven power spectral density, S vv pωq, taking into account only the region corresponding to the low frequencies ω P t1e ´6, 1e ´3u (rad/s).It has been found that, in this region, the nonparametric Bode characteristics can be parameterized by the asymptotic characteristic of a first order filter, G f dB pωq.This filter was used as a shaping filter for the medium-and long-term components.
The turbulence properties at a given time when the value of medium-and long-term components is considered to be constant, v, depend on the mean value of the wind speed through two parameters: ‚ turbulence intensity, I, defined by the equation: where σ is the turbulence standard deviation, ‚ turbulence length, L t , which influences the spectral bandwidth of the time series, v t ptq.
These parameters depend on the average wind speed, surface roughness and the height from the ground.They are calculated by relations given in [23,24], in accordance with various standards (e.g., IEC Standard, DS 472 Danish Standard, etc.).The usual spectral models of fixed point turbulence are those of von Karman and Kaimal [25].In this paper, the first model has been adopted as it is simpler to use.Therefore, based on the von Karman spectral model, the transfer function of the shaping filter for generating a turbulence, w f ptq, with unitary standard deviation is obtained as a fractional model: where T v " L t {v, and K v is chosen in order for the filter output, w f ptq, to have a standard deviation equal to one.In these conditions, for a given turbulence intensity, I, the standard deviation is computed as, σ " I ¨v, and the fixed point turbulence is: with m 1 = 0.4 and m 2 = 0.25.The scheme for numerical generation of the wind speed is given in Figure 2 [26].Figure 3a shows a fragment of the wind speed variation obtained using the scheme from Figure 2, when the turbulence intensity is I = 0.12.The medium-and long-term component of the wind speed is shown in red.For the wind power generation, a source with the nominal power of 1.5 kW, obtained at a nominal wind speed 11 source and taking into account that the power generated by the wind source varies with the cube of the wind speed, the resulting distribution of the wind power is sensibly different from the one of the wind speed (Figure 3b).

Modeling the Power Generated by the Solar Energy Source
In order to conduct the numerical simulation analysis of the distributed system, the summer regime was considered when the solar energy source can generate electricity from 6.00 a.m.till 9.00 p.m. [27].The calculated and adopted values for the optical and electrical power during a summer day are shown in Table 1.It has been considered that the photovoltaic cells have a conversion efficiency of about 12%.Due to the fact that the irradiance may be affected by the movement of clouds, irradiance was considered as a random variable with slow evolution which is subtracted from the electrical power corrected with temperature.A sample of daytime evolution of the power provided by the solar energy source is shown in Figure 4.  Figure 3a shows a fragment of the wind speed variation obtained using the scheme from Figure 2, when the turbulence intensity is I = 0.12.The medium-and long-term component of the wind speed is shown in red.For the wind power generation, a source with the nominal power of 1.5 kW, obtained at a nominal wind speed v r " 11 m/s, was considered.The source begins to produce energy at the turbine cut-in speed v d " 3.5 m/s.By neglecting the dynamics of the low power wind source and taking into account that the power generated by the wind source varies with the cube of the wind speed, the resulting distribution of the wind power is sensibly different from the one of the wind speed (Figure 3b).( 1 ) ( 1)( 1) Figure 3a shows a fragment of the wind speed variation obtained using the scheme from Figure 2, when the turbulence intensity is I = 0.12.The medium-and long-term component of the wind speed is shown in red.For the wind power generation, a source with the nominal power of 1.5 kW, obtained at a nominal wind speed 11 source and taking into account that the power generated by the wind source varies with the cube of the wind speed, the resulting distribution of the wind power is sensibly different from the one of the wind speed (Figure 3b).

Modeling the Power Generated by the Solar Energy Source
In order to conduct the numerical simulation analysis of the distributed system, the summer regime was considered when the solar energy source can generate electricity from 6.00 a.m.till 9.00 p.m. [27].The calculated and adopted values for the optical and electrical power during a summer day are shown in Table 1.It has been considered that the photovoltaic cells have a conversion efficiency of about 12%.Due to the fact that the irradiance may be affected by the movement of clouds, irradiance was considered as a random variable with slow evolution which is subtracted from the electrical power corrected with temperature.A sample of daytime evolution of the power provided by the solar energy source is shown in Figure 4.

Modeling the Power Generated by the Solar Energy Source
In order to conduct the numerical simulation analysis of the distributed system, the summer regime was considered when the solar energy source can generate electricity from 6.00 a.m.till 9.00 p.m. [27].The calculated and adopted values for the optical and electrical power during a summer day are shown in Table 1.It has been considered that the photovoltaic cells have a conversion efficiency of about 12%.Due to the fact that the irradiance may be affected by the movement of clouds, irradiance was considered as a random variable with slow evolution which is subtracted from the electrical power corrected with temperature.A sample of daytime evolution of the power provided by the solar energy source is shown in Figure 4.

Modeling the Power Consumed by the Load
The representative electrical loads for the distributed systems can be a house, a small farm, a hostel, etc.In the local network, there may be consumers, such as a fridge, freezer, microwave, washing machine, small machines, etc., as well as the lighting installation.Coupling these units to the local network is determined by the daytime activities and can have a significant variability [3].Most important aspect of the diurnal distribution of the consumed electrical power is the possibility of having significant variations of power relative to the average power.Figure 5 shows a diurnal variation profile in the local network considered in the analysis by numerical simulation of the distributed system.

Modeling the Power Consumed by the Load
The representative electrical loads for the distributed systems can be a house, a small farm, a hostel, etc.In the local network, there may be consumers, such as a fridge, freezer, microwave, washing machine, small machines, etc., as well as the lighting installation.Coupling these units to the local network is determined by the daytime activities and can have a significant variability [3].Most important aspect of the diurnal distribution of the consumed electrical power is the possibility of having significant variations of power relative to the average power.Figure 5 shows a diurnal variation profile in the local network considered in the analysis by numerical simulation of the distributed system.

Modeling the Power Consumed by the Load
The representative electrical loads for the distributed systems can be a house, a small farm, a hostel, etc.In the local network, there may be consumers, such as a fridge, freezer, microwave, washing machine, small machines, etc., as well as the lighting installation.Coupling these units to the local network is determined by the daytime activities and can have a significant variability [3].Most important aspect of the diurnal distribution of the consumed electrical power is the possibility of having significant variations of power relative to the average power.Figure 5 shows a diurnal variation profile in the local network considered in the analysis by numerical simulation of the distributed system.

Approaches in the Intelligent Control of the Distributed Energy System
The higher level control of the system relates to the design of the control algorithm that is in charge of transferring the electrical energy between the system components: renewable energy sources, public grid, energy storage unit (battery) and the local network (the load).The algorithm in question refers to two aspects: (a) energy transfer direction; and (b) the magnitude of the energy transfer, i.e., the transferred power.
The fact that the power required by the load and power output from the renewable energy sources are random variables determines a variety of the control situations.The presence of the battery is very important, not only as a storage unit for the energy excess from the renewable sources (which contributes to the supply to the load during the energy deficit), but also as a "sensor" for the level of the system energy.The evolution of the battery voltage, which is directly correlated to stored energy, largely reflects the energy context of the distributed system.This context can be characterized by a set of "states" in which the integrated system can be found.The "states" vector can be defined by: the current value of the battery voltage, V b , which is considered proportional with the accumulated energy in the system, by the variation of the accumulated energy, ∆V, and by the predicted values of the power for the renewable energy sources and for the load, de p .Using predictions for each one of the three powers is unreasonable and excessive; what matters is the deficit/surplus prediction of energy in the distributed system, i.e., the difference between the power for the renewable energy sources and for the load.Therefore, the "states" which reflects the context of the system energy, may be defined by the vector: x s " rV b ∆V de p s T Based on these states, the control system establishes the direction and the magnitude of the electrical energy transfer between the distributed system and the grid.
The control algorithm can consider two approaches, as follows: (1) Crisp type approach, which uses a simple algorithm for "control situations" recognition.Let us consider the following discrete commands: C 1 : important transfer from the grid to the distributed system (P gs " 100%); C 2 : medium transfer from the grid to the distributed system (P gs " 50%); C 3 : null transfer between the grid to the distributed system (P gs " 0%); C 4 : medium transfer from the distributed system to the grid (P sg " 50%); and C 5 : important transfer from the distributed system to the grid (P sg " 100%).
In the above, P gs ptq and P sg ptq are the transferred powers from the grid to the distributed system, and from the distributed system to the grid, respectively.
These discrete commands are put in correspondence and adopted as "prototype states" set by the designer.Let us denote x piq s , i " 1, 5 as these states.They are numerically defined in accordance with Equation (7), by imposing values for the variables V b , ∆V and de p .For example, for the "prototype state" x p1q s the numeric value of V b should reflect a reduced accumulation of power in the battery, ∆V should be negative (i.e., there is an energy deficit in the system) and the prediction de p still indicates energy deficit.Obviously, in this case, an important command for energy transfer from the grid to distributed system (P gs " 100%) is justified.
For any current "state" x s , the discrete command is determined by the following algorithm: where dpx s , x piq s q is a function that reflects the degree of proximity between x s and x piq s .This function can be the Euclidean distance between the two vectors.Obviously, the components of the state vectors must be normalized before assessing this distance.The decision rule given by Equation ( 10) is very simple: determine which "prototype state" is closest to the current state vector and adopt the command corresponding to that "prototype state".
(2) Fuzzy type approach, in which the energy state of the system is evaluated in linguistic terms.
In this case, the control principle shown above is preserved, but all the variables involved in the system, including the command setting the direction and the magnitude of the energy transfers, are obtained by fuzzy evaluation, and the control law is obtained by means of fuzzy inference.
An assessment of the two approaches reveals that the fuzzy approach allows a more nuanced control of energy transfers.The method based on crisp variables may be presented as a special case of the fuzzy techniques, when in the implementation makes use of special membership functions, thus avoiding the calculation of the distance between vectors.
The design and testing of the higher level control system is performed by taking into account several working regime scenarios.Generating these scenarios is in relation to the following requirements: testing the system operation in different situations regarding the renewable energy sources.For the distributed system design it is necessary to consider at least two regimes: summer and winter; and ‚ testing the system operation in two operating modes of the battery: buffer regime-considered as the standard one-and periodic regime, in which the charging and discharging cycles are taking place during the normal operation of the distributed system.These cycles are recommended to increase the battery lifetime.

Prediction of the Random Variables from the Distributed Energy System
Prediction of power from the renewable energy sources is an important challenge [28][29][30].The prediction algorithms were implemented based on the linear AR and ARMA time series models.The results obtained with these classical algorithms were very different, depending on the physical nature of the predicted time series.Thus, the medium-and long-term components of the wind speed have an autocorrelation function with a very slow decreasing variation, offering a good opportunity for prediction.The good results obtained in this case are illustrated by the sample shown in Figure 6 where different values of the prediction horizon where considered when using an ARMA type model.The turbulence component prediction has more modest results, the prediction can be acceptable only for a few sampling steps (T s " 1 psq was used).The explanation is very simple: the turbulence properties are very close to those of a white noise, since the shaping filter for the turbulence component is of second order with unitary pole excess (see Equation ( 6)).In these conditions, the autocorrelation function has a fast decreasing variation and consequently the prediction is very difficult (especially when using very simple approaches, such as linear predictors).However, for low power wind systems, as considered in this paper, even a prediction on a very short horizon time (a few seconds) can avoid some switching of the type discharging-charging-discharging from the operating regime of the battery.As mentioned, the predicted variable in the system is the difference between the sum of powers of the renewable energy sources and the consumed power by load.In the case of this variable, there are two components that severely limit the prediction performances.One is the turbulence component of the wind speed.The other is the random variation of the load power (local network).As the average value of this load is lower, the percentage random variations of the power are more important (when coupling and uncoupling different consumers) and the prediction of the power surplus/deficit is more difficult.Two versions of the fuzzy control algorithm of the distributed system, shown in the next sub-section, are using information provided by the predictor with a short time horizon.The transfer function of this predictor is: Hpz ´1q " 6.558 ´5.959z ´1 `0.04215 z ´2 `0.2391 z ´3 `0.01096 z ´40 .2945z´5 ´0.5238z ´6 `0.02858z ´7 `1.281z ´8 ´1.024z

Fuzzy Controllers for the Distributed Energy System
Based on the previous sections, the control algorithm for transferring the electrical energy between the system components is implemented as a battery voltage feedback control system, using fuzzy techniques.The controller of this loop was designed in two variants, as follows: (1) Variant 1 of the control algorithms is illustrated in the scheme given in Figure 7.The controller inputs are the components of the s x vector defined by Equation (7).These variables are scaled using the coefficients 1 1.3 k  , 2 4 k  and 3 0.8 k  .The battery voltage, Vb(t), reflects the accumulated energy at the current time t and is calculated in accordance with the simplified model [3] on the basis of the following equation: where W(t) is the energy fed to the input, and VM and Vm are the voltage value for the maximum energy, WM, and the minimum energy, Wm, accumulated into the battery, respectively.In the simulation program, a battery with the nominal voltage of 48 V was considered.In Equation ( 9), the following values were adopted: VM = 49.5 V and Vm = 47 V. Assuming a battery capacity of 800 Ah, it results that WM = 138.24MJ.The minimum value of the stored energy, when the battery is practically discharged, is Wm = 17.28 MJ.With the value WM = 138.24MJ for the maximum stored energy, the battery can supply an electrical load of 1.6 kW for 24 h.The energy transferred into the battery at the current time t is: where is the power fed into the battery, which has the following components: power produced from sources wind and solar, we P and PV P , respectively, and the power transferred from the grid, gs P .
 o P is the power extracted from the battery, equal with the sum of the consumed power into the local network, l P , and the power transferred into the grid, sg P .

Fuzzy Controllers for the Distributed Energy System
Based on the previous sections, the control algorithm for transferring the electrical energy between the system components is implemented as a battery voltage feedback control system, using fuzzy techniques.The controller of this loop was designed in two variants, as follows: (1) Variant 1 of the control algorithms is illustrated in the scheme given in Figure 7.The controller inputs are the components of the x s vector defined by Equation (7).These variables are scaled using the coefficients k 1 " 1.3, k 2 " 4 and k 3 " 0.8.The battery voltage, V b (t), reflects the accumulated energy at the current time t and is calculated in accordance with the simplified model [3] on the basis of the following equation: where W(t) is the energy fed to the input, and V M and V m are the voltage value for the maximum energy, W M , and the minimum energy, W m , accumulated into the battery, respectively.In the simulation program, a battery with the nominal voltage of 48 V was considered.In Equation ( 9), the following values were adopted: V M = 49.5 V and V m = 47 V. Assuming a battery capacity of 800 Ah, it results that W M = 138.24MJ.The minimum value of the stored energy, when the battery is practically discharged, is W m = 17.28 MJ.With the value W M = 138.24MJ for the maximum stored energy, the battery can supply an electrical load of 1.6 kW for 24 h.The energy transferred into the battery at the current time t is: Wptq " ż t 0 rP i pτq ´Po pτqs dτ (10) where ‚ P i is the power fed into the battery, which has the following components: power produced from sources wind and solar, P we and P PV , respectively, and the power transferred from the grid, P gs .‚ P o is the power extracted from the battery, equal with the sum of the consumed power into the local network, P l , and the power transferred into the grid, P sg .Given the effect of noise amplification when performing numerical derivation, at the input V  , after the derivative element a filter with static amplification equal with 1 was inserted (see Figure 7).
The transfer function of this filter is , with a = 0.0005.The positive command action, obtained after scaling, with the factor 1 u k  , is used to control the energy flow from the grid to the distributed system, and the negative component is used to control the energy flow from the distributed system to the grid.The fuzzification of the voltage input was performed considering three linguistic terms with triangular membership functions.The value of 48.5 V was considered as the center of the linguistic value "M" = medium.With respect to this value, the linguistic values: "S"= small and "B"= Big were considered.For the fuzzification of the inputs V  and p de , two linguistic values ("N" = negative and "P" = positive) with Gaussian membership functions were used.
Regarding the controller output, u, five linguistic values with singleton type membership functions, positive big (PB), positive medium (PM), zero (Z), negative medium (NM), and negative big (NB), were adopted.The fuzzy controller rules are given in Table 2. Table 2 also shows the correspondence between the fuzzy commands and the commands from the crisp strategy.(2) Variant 2 of the control algorithms is implemented using a voltage controller whose scheme is given in Figure 8.The voltage setpoint, which is explicitly provided, may be imposed either at a fixed value, for example 48.5 V, or from a signal generator, which provides a periodically varying ramp with an average value of 48.5 V.Both controllers (Variant 1 and Variant 2) are equivalent to a pseudo Proportional-Derivative type control law with anticipation with respect to the disturbance deficit/surplus energy.The integrative component that is missing is not an important impediment, since in practice the system is always working in a dynamic regime and Given the effect of noise amplification when performing numerical derivation, at the input ∆V, after the derivative element a filter with static amplification equal with 1 was inserted (see Figure 7).The transfer function of this filter is a 1´p1´aqz ´1 , with a = 0.0005.The positive command action, obtained after scaling, with the factor k u " 1, is used to control the energy flow from the grid to the distributed system, and the negative component is used to control the energy flow from the distributed system to the grid.The fuzzification of the voltage input was performed considering three linguistic terms with triangular membership functions.The value of 48.5 V was considered as the center of the linguistic value "M" = medium.With respect to this value, the linguistic values: "S"= small and "B"= Big were considered.For the fuzzification of the inputs ∆V and de p , two linguistic values ("N" = negative and "P" = positive) with Gaussian membership functions were used.Regarding the controller output, u, five linguistic values with singleton type membership functions, positive big (PB), positive medium (PM), zero (Z), negative medium (NM), and negative big (NB), were adopted.The fuzzy controller rules are given in Table 2. Table 2 also shows the correspondence between the fuzzy commands and the commands from the crisp strategy.(2) Variant 2 of the control algorithms is implemented using a voltage controller whose scheme is given in Figure 8.The voltage setpoint, which is explicitly provided, may be imposed either at a fixed value, for example 48.5 V, or from a signal generator, which provides a periodically varying ramp with an average value of 48.5 V.Both controllers (Variant 1 and Variant 2) are equivalent to a pseudo Proportional-Derivative type control law with anticipation with respect to the disturbance deficit/surplus energy.The integrative component that is missing is not an important impediment, since in practice the system is always working in a dynamic regime and the battery voltage must be in the vicinity of a value corresponding to the "charged" regime of the battery.The fuzzification of the control error was carried out considering three linguistic terms, with triangular membership functions.The other two inputs and the controller command maintain the same fuzzification as in Variant 1.In addition, the rule table is similar to the previous controller.
the battery.The fuzzification of the control error was carried out considering three linguistic terms, with triangular membership functions.The other two inputs and the controller command maintain the same fuzzification as in Variant 1.In addition, the rule table is similar to the previous controller.

The Performance Criterion for the Distributed Energy System
Out of the scenario described above, it becomes clear that, in the distributed system, the power consumption with the load (the local network) is a random variable and the two electrical energy sources (wind and solar) are also random variables.The third energy source is the grid, which is the backup source.In order to regulate the energy transfer between the sources and the load, a battery is used.Its role is to use the stored energy in such a way that the energy transfer from the grid to the load to be as low as possible.So the first constraint to be imposed is to reduce the cost of the consumed electrical energy from the grid.The energy bills for the consumer in a predetermined interval [0 T] are represented as: where sg  and gs  are coefficients that represents the price for the electricity flow to and from the grid, respectively.These prices vary depending on the legislation in each country.Our application considered that: At the load level the energy flow from the grid is ( ) , where gs  is the efficiency of the transfer circuit from grid to load.Similarly, the energy flow transferred to the grid from the sources and, eventually, from the battery is ( ) , where sg  is the efficiency of the transfer circuit from load to grid.The energy transfer in a circuit that includes the battery is also affected by the battery efficiency, b  .
An important variable, which is not "visible" in Equation (11), is the variation of the stored energy into the battery.The control system of the distributed system can influence the powers ( ) gs P t or ( ) sg P t in Equation ( 11) by acting on such stored energy.In essence, the variable E is affected by three factors: the power produced by the renewable energy sources; the load; and the command given by the control system, which determines the variation of the energy stored in the battery.To exemplify the evaluation of Equation ( 11), a distributed system was considered with a diurnal variation given by the power consumption in the local network.The distributed system battery has 800 Ah and the solar and wind sources have nominal powers of 1.5 kW.It has been assumed that the wind source works with a given wind speed profile and for the solar energy source a variation of the solar irradiance specific for a summer day was considered.In these conditions, the results shown in Figure 9 were obtained by numerical simulation of the distributed system: energy transferred from the grid to the distributed system, energy transferred from the distributed system

The Performance Criterion for the Distributed Energy System
Out of the scenario described above, it becomes clear that, in the distributed system, the power consumption with the load (the local network) is a random variable the two electrical energy sources (wind and solar) are also random variables.The third energy source is the grid, which is the backup source.In order to regulate the energy transfer between the sources and the load, a battery is used.Its role is to use the stored energy in such a way that the energy transfer from the grid to the load to be as low as possible.So the first constraint to be imposed is to reduce the cost of the consumed electrical energy from the grid.The energy bills for the consumer in a predetermined interval [0 T] are represented as: E " T ż 0 `αgs P gs ptq ´αsg P sg ptq ˘dt (11) where α sg and α gs are coefficients that represents the price for the electricity flow to and from the grid, respectively.These prices vary depending on the legislation in each country.Our application considered that: α sg " α gs " 1.
At the load level the energy flow from the grid is η gs ¨Pgs ptq, where η gs is the efficiency of the transfer circuit from grid to load.Similarly, the energy flow transferred to the grid from the sources and, eventually, from the battery is η sg P sg ptq, where η sg is the efficiency of the transfer circuit from load to grid.The energy transfer in a circuit that includes the battery is also affected by the battery efficiency, η b .
An important variable, which is not "visible" in Equation (11), is the variation of the stored energy into the battery.The control system of the distributed system can influence the powers P gs ptq or P sg ptq in Equation (11) by acting on such stored energy.In essence, the variable E is affected by three factors: the power produced by the renewable energy sources; the load; and the command given by the control system, which determines the variation of the energy stored in the battery.To exemplify the evaluation of Equation ( 11), a distributed system was considered with a diurnal variation given by the power consumption in the local network.The distributed system battery has 800 Ah and the solar and wind sources have nominal powers of 1.5 kW.It has been assumed that the wind source works with a given wind speed profile and for the solar energy source a variation of the solar irradiance specific for a summer day was considered.In these conditions, the results shown in Figure 9 were obtained by numerical simulation of the distributed system: energy transferred from the grid to the distributed system, energy transferred from the distributed system to the grid and the energy bills.Another important criterion considered for the control of the distributed system is to increase the battery lifetime and thus increasing the system sustainability.The high cost of the battery and the fact that its lifetime is dependent on the operating conditions justify the requirement imposed to the control system to make sure that the battery lifetime is as long as possible.A first option can be to ensure a cycle of charging and discharging at a nominal rate.Because the power produced by the renewable energy sources and the consumption in the local network are random variables, this approach may lead to high energy bills because of Equation (11).A second option can be to impose a regime that reduces the cost of the energy bills.However, this approach may lead to a high frequency in the switches for charging-discharging the battery, thus negatively affecting the battery lifetime.To extend the battery lifetime, the charging/discharging rate must be at a low level.In addition, in order to protect the battery, it is important to avoid deep discharges, the battery must be kept near the nominal load condition.Let ε T N be the number of charge/discharge switches that take place in the interval [0 T], while the battery is kept charged at the nominal value, with a tolerance given by ε.Maintaining the battery voltage into a region of the nominal load state can be performed by means of a control system which ensures the energy flows into the distributed system in an adequate manner (given the randomness of the load and of the renewable energies), according to the requirements imposed by the performance criterion.This criterion, which takes into account two conflicting requirements, reducing the energy bills, E, and the number of charge/discharge switches, ε T N , takes the form: where  is the factor that weights the two terms of the performance criterion.This factor depends on the price of the electricity flow to and from the grid, the efficiency of the transfer between the sources and the grid, and also on the properties of the storage unit.An important particularity of the energy distributed systems is given by the high frequency fluctuations in the power supplied by the wind source (due to the turbulence component of the wind speed) and sometimes in the load power consumption.These fluctuations can induce frequent switches between the charging/discharging regimes in the control loop of the battery voltage, with a negative effect on battery lifetime.Figure 10a illustrates the charge/discharge commutations within 24 h for the distributed system operation under the conditions mentioned above.The simulation model of the system has been provided with units for processing jumps of the type shown in Figure 10a.This was done so at every commutation Another important criterion considered for the control of the distributed system is to increase the battery lifetime and thus increasing the system sustainability.The high cost of the battery and the fact that its lifetime is dependent on the operating conditions justify the requirement imposed to the control system to make sure that the battery lifetime is as long as possible.A first option can be to ensure a cycle of charging and discharging at a nominal rate.Because the power produced by the renewable energy sources and the consumption in the local network are random variables, this approach may lead to high energy bills because of Equation (11).A second option can be to impose a regime that reduces the cost of the energy bills.However, this approach may lead to a high frequency in the switches for charging-discharging the battery, thus negatively affecting the battery lifetime.To extend the battery lifetime, the charging/discharging rate must be at a low level.In addition, in order to protect the battery, it is important to avoid deep discharges, the battery must be kept near the nominal load condition.Let N ε T be the number of charge/discharge switches that take place in the interval [0 T], while the battery is kept charged at the nominal value, with a tolerance given by ε.Maintaining the battery voltage into a region of the nominal load state can be performed by means of a control system which ensures the energy flows into the distributed system in an adequate manner (given the randomness of the load and of the renewable energies), according to the requirements imposed by the performance criterion.This criterion, which takes into account two conflicting requirements, reducing the energy bills, E, and the number of charge/discharge switches, N ε T , takes the form: `αgs P gs ptq ´αsg P sg ptq ˘dt `γ ¨Nε where γ is the factor that weights the two terms of the performance criterion.This factor depends on the price of the electricity flow to and from the grid, the efficiency of the transfer between the sources and the grid, and also on the properties of the storage unit.An important particularity of the energy distributed systems is given by the high frequency fluctuations in the power supplied by the wind source (due to the turbulence component of the wind speed) and sometimes in the load power consumption.These fluctuations can induce frequent switches between the charging/discharging regimes in the control loop of the battery voltage, with a negative effect on battery lifetime.Figure 10a illustrates the charge/discharge commutations within 24 h for the distributed system operation under the conditions mentioned above.The simulation model of the system has been provided with units for processing jumps of the type shown in Figure 10a.This was done so at every commutation charging-discharging-charging the variable N ε T increases with a constant value.In these conditions, the evolution of the second term of the criterion given by Equation ( 12), which assesses the number of charge/discharge switches, is shown in Figure 10b.conditions, the evolution of the second term of the criterion given by Equation ( 12), which assesses the number of charge/discharge switches, is shown in Figure 10b.Unlike the performance criteria of the lower level of the hierarchical control structure, which is optimized in real-time trough the automatic control systems, Equation ( 12) is used off-line in the design stage in order to establish the parameters of the control system at the higher level.This solution is determined by the fact that the minimization of Equation ( 12) is valid only for a given profile (considered in a particular instance) of the evolution curves of power for the renewable energy sources and load, both variables having random evolutions.In another instance in which those variables have a different evolution the parameters of the control system that would minimize the Equation ( 12) would be different.In these conditions, establishing the parameters involved in the control algorithm at the higher level of the distributed system can be performed by numerical simulation, i.e., analyzing the system performance in different situations related to the exogenous random variables.Choosing the "proper" parameters based on this analysis should take into account in particular the summer and winter regimes in the operation of the renewable energy sources.When using Equation ( 12) one must take into account the different nature of the two sub-criteria (a normalization of the sub-criteria being necessary) and also the appropriate choice of the weighting factor,  .If in the considered interval [0 T] there is a surplus of energy from the renewable sources in relation to the load, the first term in the Equation (12) results negative.In general, both the overall assessment of Equation (12), which is intended to be as low as possible, and the evaluation of each distinct term within this criterion are useful.

The Multi-Criteria Performance Indicator Evaluation
The objective of this subsection is to illustrate the energy flows from the considered distributed system and, especially, to make a comparative analysis of the performances of the two implemented variants of the control algorithm at the higher level.To enable the comparative analysis of the two variants the same powers generated by the solar and wind sources, and the same power consumed in the local network were used.Out of the multitude of possible situations regarding the renewable energy sources and the power consumption in the local network, the case considered was the total Unlike the performance criteria of the lower level of the hierarchical control structure, which is optimized in real-time trough the automatic control systems, Equation ( 12) is used off-line in the design stage in order to establish the parameters of the control system at the higher level.This solution is determined by the fact that the minimization of Equation ( 12) is valid only for a given profile (considered in a particular instance) of the evolution curves of power for the renewable energy sources and load, both variables having random evolutions.In another instance in which those variables have a different evolution the parameters of the control system that would minimize the Equation ( 12) would be different.In these conditions, establishing the parameters involved in the control algorithm at the higher level of the distributed system can be performed by numerical simulation, i.e., analyzing the system performance in different situations related to the exogenous random variables.Choosing the "proper" parameters based on this analysis should take into account in particular the summer and winter regimes in the operation of the renewable energy sources.When using Equation ( 12) one must take into account the different nature of the two sub-criteria (a normalization of the sub-criteria being necessary) and also the appropriate choice of the weighting factor, γ.If in the considered interval [0 T] there is a surplus of energy from the renewable sources in relation to the load, the first term in the Equation (12) results negative.In general, both the overall assessment of Equation ( 12), which is intended to be as low as possible, and the evaluation of each distinct term within this criterion are useful.

The Multi-Criteria Performance Indicator Evaluation
The objective of this subsection is to illustrate the energy flows from the considered distributed system and, especially, to make a comparative analysis of the performances of the two implemented variants of the control algorithm at the higher level.To enable the comparative analysis of the two variants the same powers generated by the solar and wind sources, and the same power consumed in the local network were used.Out of the multitude of possible situations regarding the renewable energy sources and the power consumption in the local network, the case considered was the total energy generated by the renewable sources is larger than the energy consumed by the load during the adopted time interval of a day (i.e., T = 86,400 s).
A preliminary testing of the fuzzy controller that implements this variant of the control algorithm was performed considering the renewable energy sources and the load described in Section 2. Figure 11 shows the battery voltage, which varies in the vicinity of 48.5 V, value imposed by the fuzzification of the input V.The command variable generated by the fuzzy controller is given in Figure 12, where the blue color represents the power transferred from the distributed system to the grid, and the red color shows the transferred power from the grid to the distributed system.One can notice that there is always an energy transfer between the grid and distributed system, in one way or the other.
Sustainability 2016, 8, 748 15 of 22 Section 2. Figure 11 shows the battery voltage, which varies in the vicinity of 48.5 V, value imposed by the fuzzification of the input V.The command variable generated by the fuzzy controller is given in Figure 12, where the blue color represents the power transferred from the distributed system to the grid, and the red color shows the transferred power from the grid to the distributed system.One can notice that there is always an energy transfer between the grid and distributed system, in one way or the other.In the first case (Variant 1) of the control algorithm, the evolution of the power received by the system, we PV gs P P P   , the power transferred to the load and to the grid, l s g P P  , and the power deficit/surplus are presented in Figure 13.In Figure 14, in correlation with Figure 13, it can be noticed that there occurs a high number of charge/discharge switches for the battery.This is caused mainly by the turbulence fluctuations of the wind speed.The evolution of the energy consumed from the grid, transferred to the grid, and the energy bills are given in Figure 15.For the evaluation of the multi-criteria performance indicator, given by Equation ( 12), it was necessary to use the  factor that weights the two terms of the performance criteria in order to have the same scale for the Section 2. Figure 11 shows the battery voltage, which varies in the vicinity of 48.5 V, value imposed by the fuzzification of the input V.The command variable generated by the fuzzy controller is given in Figure 12, where the blue color represents the power transferred from the distributed system to the grid, and the red color shows the transferred power from the grid to the distributed system.One can notice that there is always an energy transfer between the grid and distributed system, in one way or the other.In the first case (Variant 1) of the control algorithm, the evolution of the power received by the system, we PV gs P P P   , the power transferred to the load and to the grid, l s g P P  , and the power deficit/surplus are presented in Figure 13.In Figure 14, in correlation with Figure 13, it can be noticed that there occurs a high number of charge/discharge switches for the battery.This is caused mainly by the turbulence fluctuations of the wind speed.The evolution of the energy consumed from the grid, transferred to the grid, and the energy bills are given in Figure 15.For the evaluation of the multi-criteria performance indicator, given by Equation ( 12), it was necessary to use the  factor that weights the two terms of the performance criteria in order to have the same scale for the two factors (energy sub-criterion relative to lifetime of the battery).The negative value of the In the first case (Variant 1) of the control algorithm, the evolution of the power received by the system, P we `PPV `Pgs , the power transferred to the load and to the grid, P l `Psg , and the power deficit/surplus are presented in Figure 13.In Figure 14, in correlation with Figure 13, it can be noticed that there occurs a high number of charge/discharge switches for the battery.This is caused mainly by the turbulence fluctuations of the wind speed.The evolution of the energy consumed from the grid, transferred to the grid, and the energy bills are given in Figure 15.For the evaluation of the multi-criteria performance indicator, given by Equation (12), it was necessary to use the γ factor that weights the two terms of the performance criteria in order to have the same scale for the two factors (energy sub-criterion relative to lifetime of the battery).The negative value of the sub-criterion energy (the same for the energy bills) shows that the energy transferred to the grid is greater than the one consumed from the grid.For the performance analysis of the distributed system, the two sub-criterions are shown in Figure 16, instead of the sum of the two terms (which should be as low as possible).The results obtained showed that the adopted structure of the fuzzy controller has one disadvantage, namely it does not allow obtaining the regime in which the charge and discharge cycles take place, during the normal operation of the distributed system.To ensure the operation of the distributed system with fuzzy controller both in a buffer regime and in charge-discharge cycles the controller in Variant 2 was used.
The performances of the control algorithm when the setpoint is set at 48.5 V are similar to those illustrated in Figures 11 and 12.Although the battery works most of the time in the "buffer" regime, it is often recommended for the system to work, even for short time periods, in a chargingdischarging regime.When the battery voltage controller setpoint is constant, the performances of Variant 2 control algorithm are similar to those of the previous case.For the regime that ensures a periodic charging and discharging of the battery while normally supplying the local network, the performance indicators are now given in Figures 17 and 18.In this case, the transferred powers in one direction or the other in the charging-discharging regimes are much higher than those from the renewable sources powers and of the load.Obviously, taking into account the efficiency of the transfer circuits, the intense energy transfer is accompanied by significant losses in the system.Instead, the charge-discharge switches are rarely influenced by the evolution of the renewable sources powers or by the load.Most often, these switches are virtually equal to those imposed through the voltage loop setpoint.Consequently, the evolution of the two sub-criterions, shown in Figure 18, indicates a very low energy performance and a good performance in terms of the battery regime.We must mention that this regime is for a short period of time and it is part of the maintenance program of the battery.The results obtained showed that the adopted structure of the fuzzy controller has one disadvantage, namely it does not allow obtaining the regime in which the charge and discharge cycles take place, during the normal operation of the distributed system.To ensure the operation of the distributed system with fuzzy controller both in a buffer regime and in charge-discharge cycles the controller in Variant 2 was used.
The performances of the control algorithm when the setpoint is set at 48.5 V are similar to those illustrated in Figures 11 and 12.Although the battery works most of the time in the "buffer" regime, it is often recommended for the system to work, even for short time periods, in a charging-discharging regime.When the battery voltage controller setpoint is constant, the performances of Variant 2 control algorithm are similar to those of the previous case.For the regime that ensures a periodic charging and discharging of the battery while normally supplying the local network, the performance indicators are now given in Figures 17 and 18.In this case, the transferred powers in one direction or the other in the charging-discharging regimes are much higher than those from the renewable sources powers and of the load.Obviously, taking into account the efficiency of the transfer circuits, the intense energy transfer is accompanied by significant losses in the system.Instead, the charge-discharge switches are rarely influenced by the evolution of the renewable sources powers or by the load.Most often, these switches are virtually equal to those imposed through the voltage loop setpoint.Consequently, the evolution of the two sub-criterions, shown in Figure 18, indicates a very low energy performance and a good performance in terms of the battery regime.We must mention that this regime is for a short period of time and it is part of the maintenance program of the battery.
performance indicators are now given in Figures 17 and 18.In this case, the transferred powers in one direction or the other in the charging-discharging regimes are much higher than those from the renewable sources powers and of the load.Obviously, taking into account the efficiency of the transfer circuits, the intense energy transfer is accompanied by significant losses in the system.Instead, the charge-discharge switches are rarely influenced by the evolution of the renewable sources powers or by the load.Most often, these switches are virtually equal to those imposed through the voltage loop setpoint.Consequently, the evolution of the two sub-criterions, shown in Figure 18, indicates a very low energy performance and a good performance in terms of the battery regime.We must mention that this regime is for a short period of time and it is part of the maintenance program of the battery.

An Improved Intelligent Control Algorithm for the Distributed Energy System
The fuzzy controllers from Variant 1 and Variant 2 are constantly generating non-zero commands to transfer energy in either direction between the grid and the distributed system.The permanent variations of the controller command have the effect of maintaining, with reasonable precision, the battery voltage around the setpoint.However, in reality, this performance is not necessarily required.The battery voltage can fluctuate within a range of width ε, which can correspond to the linguistic value for "battery charged", as it is in the recommendations for ensuring a long lifetime of the battery.Instead, the parameter ε greatly influences the number of charge/discharge switches, ε T N , which appears in the performance criterion given by Equation (12).
In these conditions it is useful to have a dead zone in the static characteristic of the controller, which ensures the battery voltage fluctuates in a predetermined area.An improved variant of the controller is established on this basis.
Variant 3 of the control algorithms uses a special controller with dead zone, of a tri-positional type block implemented by fuzzy techniques.Unlike the tri-positional controller the command from outside the dead zone, either positive or negative, is proportional to the control error.Let be the dead zone imposed on the variation domain of control error ε.The control algorithm performed by the controller can be summarized as:

An Improved Intelligent Control Algorithm for the Distributed Energy System
The fuzzy controllers from Variant 1 and Variant 2 are constantly generating non-zero commands to transfer energy in either direction between the grid and the distributed system.The permanent variations of the controller command have the effect of maintaining, with reasonable precision, the battery voltage around the setpoint.However, in reality, this performance is not necessarily required.The battery voltage can fluctuate within a range of width ε, which can correspond to the linguistic value for "battery charged", as it is in the recommendations for ensuring a long lifetime of the battery.Instead, the parameter ε greatly influences the number of charge/discharge switches, N ε T , which appears in the performance criterion given by Equation (12).In these conditions it is useful to have a dead zone in the static characteristic of the controller, which ensures the battery voltage fluctuates in a predetermined area.An improved variant of the controller is established on this basis.
Variant 3 of the control algorithms uses a special controller with dead zone, of a tri-positional type block implemented by fuzzy techniques.Unlike the tri-positional controller the command from outside the dead zone, either positive or negative, is proportional to the control error.Let D " " ´p p ı be the dead zone imposed on the variation domain of control error ε.The control algorithm performed by the controller can be summarized as: The scheme of the controller in this variant is given in Figure 19.The system operation with the parameters k 1 " 2, K = 1000 and p = 0.2, when the setpoint is constant, is illustrated in Figures 20 and 21.It is noticeable that the energy transfer commanded by the controller is much lower than in the case of Variant 1 or Variant 2.
a long lifetime of the battery.Instead, the parameter ε greatly influences the number of charge/discharge switches, ε T N , which appears in the performance criterion given by Equation (12).
In these conditions it is useful to have a dead zone in the static characteristic of the controller, which ensures the battery voltage fluctuates in a predetermined area.An improved variant of the controller is established on this basis.
Variant 3 of the control algorithms uses a special controller with dead zone, of a tri-positional type block implemented by fuzzy techniques.Unlike the tri-positional controller the command from outside the dead zone, either positive or negative, is proportional to the control error.Let

D p p  
be the dead zone imposed on the variation domain of control error ε.The control algorithm performed by the controller can be summarized as: The scheme of the controller in this variant is given in Figure 19.The system operation with the parameters      Variant 3 of the control algorithm leads to noticeably different results as compared to the previous cases.The variables represented in Figures 13-16, have now the evolution given by Figures 22-25.One can see a very important reduction in the number of charge/discharge switches of the battery.When using the algorithm given by Equation ( 13), the energy sub-criterion has an evolution close to that of Variant 1, but the sub-criterion regarding the battery regime shows a considerable   Variant 3 of the control algorithm leads to noticeably different results as compared to the previous cases.The variables represented in Figures 13-16, have now the evolution given by Figures 22-25.One can see a very important reduction in the number of charge/discharge switches of the battery.When using the algorithm given by Equation ( 13), the energy sub-criterion has an evolution close to that of Variant 1, but the sub-criterion regarding the battery regime shows a considerable Variant 3 of the control algorithm leads to noticeably different results as compared to the previous cases.The variables represented in Figures 13-16, have now the evolution given by Figures 22-25.One can see a very important reduction in the number of charge/discharge switches of the battery.When using the algorithm given by Equation ( 13), the energy sub-criterion has an evolution close to that of Variant 1, but the sub-criterion regarding the battery regime shows a considerable improvement.One of the goals of the simulation based performance analysis is the choice of the controller parameter p.This is chosen within a predetermined domain [0 p max ], where p max is the tolerance of the nominal voltage, for which the battery can be considered in the regime "charged battery".Variant 3 of the control algorithm leads to noticeably different results as compared to the previous cases.The variables represented in Figures 13-16, have now the evolution given by Figures 22-25.One can see a very important reduction in the number of charge/discharge switches of the battery.When using the algorithm given by Equation ( 13), the energy sub-criterion has an evolution close to that of Variant 1, but the sub-criterion regarding the battery regime shows a considerable improvement.One of the goals of the simulation based performance analysis is the choice of the controller parameter p.This is chosen within a predetermined domain [0 max p ], where max p is the tolerance of the nominal voltage, for which the battery can be considered in the regime "charged battery".In the future we, intend to use the performance indicator given by Equation ( 12) as a criterion in a predictive control problem.We will also implement the proposed solution in this paper on a In the future we, intend to use the performance indicator given by Equation ( 12) as a criterion in a predictive control problem.We will also implement the proposed solution in this paper on a Hardware.In the Loop platform, the renewable energy simulators being replaced by hardware emulators.

Conclusions
Firstly the paper describes the models used to simulate the distributed system components, thus allowing designing and evaluating different control solutions for the system considered.All the renewable energy sources and the load where modeled, and a performance criterion was considered.This criterion takes into account the two important factors that ensure the system sustainability: the cost of electricity supplied to local consumers, and the lifetime of the battery.In this paper, three variants for the algorithm to control the energy transfer in the system, implemented using fuzzy techniques, have been proposed.This is done in order to evaluate the distributed energy system behavior when different control algorithms are chosen.The first two variants use a deficit/surplus prediction of energy in the system, and the third variant imposes a dead zone at low values of the control error.It was shown that the three variants offer similar results regarding the cost of electricity supplied to local consumers when the setpoint is chosen to be constant.Variant 3 of the control algorithm offers the best results, thus increasing the system sustainability.This evaluation takes into account that although the energy sub-criterion has an evolution close to the one from the first two variants, the sub-criterion regarding the battery regime has a radical improvement.Although the battery works most of the time in a "buffer" regime, the maintenance program of the battery often recommends its operation, for short periods, in a charging-discharging regime in order to increase its lifetime.This option was implemented in Variants 2 and 3 of the control algorithm and the results obtained showed that the energy sub-criterion was not affected.

Figure 1 .
Figure 1.Simplified block scheme of the proposed system.

Figure 1 .
Figure 1.Simplified block scheme of the proposed system.

Figure 2 .
Figure 2. Scheme of the system for numerical generation of the wind speed.
r v  m/s, was considered.The source begins to produce energy at the turbine cut-in speed 3.5 d v  m/s.By neglecting the dynamics of the low power wind

Figure 3 .
Figure 3. (a) Sample of the wind speed evolution (blue) and of the medium-and long-term component (red); and (b) power of the wind source for the wind speed sample.

Figure 2 .
Figure 2. Scheme of the system for numerical generation of the wind speed.

Figure 2 .
Figure 2. Scheme of the system for numerical generation of the wind speed.
r v  m/s, was considered.The source begins to produce energy at the turbine cut-in speed 3.5 d v  m/s.By neglecting the dynamics of the low power wind

Figure 3 .
Figure 3. (a) Sample of the wind speed evolution (blue) and of the medium-and long-term component (red); and (b) power of the wind source for the wind speed sample.

Figure 3 .
Figure 3. (a) Sample of the wind speed evolution (blue) and of the medium-and long-term component (red); and (b) power of the wind source for the wind speed sample.

Figure 5 .
Figure 5. Daily evolution of the power consumed in the local network.

Figure 4 .
Figure 4. Sample of the power generated by the solar energy source over a day, in summer regime.

Figure 5 .
Figure 5. Daily evolution of the power consumed in the local network.Figure 5. Daily evolution of the power consumed in the local network.

Figure 5 .
Figure 5. Daily evolution of the power consumed in the local network.Figure 5. Daily evolution of the power consumed in the local network.

Figure 6 .
Figure 6.Prediction of the seasonal component of the wind speed,   v t (blue line), over10, 20, and

Figure 6 .
Figure 6.Prediction of the seasonal component of the wind speed, v ptq (blue line), over 10, 20, and 30 min (red, black and green, respectively).

Figure 7 .
Figure 7. Scheme of the controller in Variant 1 of the control algorithm.

Figure 7 .
Figure 7. Scheme of the controller in Variant 1 of the control algorithm.

Figure 8 .
Figure 8. Scheme of the controller in Variant 2 of the control algorithm.

Figure 8 .
Figure 8. Scheme of the controller in Variant 2 of the control algorithm.

Sustainability 2016, 8 , 748 13 of 22 Figure 9 .
Figure9.Evolution of energy transferred from grid to distributed system (blue line), energy transferred from distributed system to grid (red line), and energy bills for 24 h (green line).

Figure 9 .
Figure9.Evolution of energy transferred from grid to distributed system (blue line), energy transferred from distributed system to grid (red line), and energy bills for 24 h (green line).

Figure 10 .
Figure 10.Evolution of the component corresponding to the commutation of the functioning regimes: commutation charging/discharging (a); and corresponding component from Equation (12) (b).

Figure 10 .
Figure 10.Evolution of the component corresponding to the commutation of the functioning regimes: commutation charging/discharging (a); and corresponding component from Equation (12) (b).

Figure 12 .
Figure 12.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 12 .
Figure 12.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 12 .
Figure 12.The command variable: power transferred from the grid (blue) and to the grid (red).

Sustainability 2016, 8 , 748 16 of 22 Figure 13 .
Figure13.Evolution of the power produced by the renewable sources + power from the grid (blue); power consumed by load + power transferred to the grid (red); power deficit/surplus (green).

Figure 13 . 22 Figure 13 .
Figure13.Evolution of the power produced by the renewable sources + power from the grid (blue); power consumed by load + power transferred to the grid (red); power deficit/surplus (green).

Figure 15 .
Figure 15.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Figure 17 .
Figure 17.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).Figure 17.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Figure 17 .
Figure 17.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).Figure 17.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).
1 2 k  , K = 1000 and p = 0.2, when the setpoint is constant, is illustrated in Figures20 and 21.It is noticeable that the energy transfer commanded by the controller is much lower than in the case of Variant 1 or Variant 2.

Figure 19 .
Figure 19.Scheme of the controller in Variant 3 of the control algorithm.Figure 19.Scheme of the controller in Variant 3 of the control algorithm.

Figure 19 .
Figure 19.Scheme of the controller in Variant 3 of the control algorithm.Figure 19.Scheme of the controller in Variant 3 of the control algorithm.

Figure 21 .
Figure 21.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 21 .
Figure 21.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 21 .
Figure 21.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 21 .
Figure 21.The command variable: power transferred from the grid (blue) and to the grid (red).

Figure 22 .
Figure22.Evolution of the power produced by the renewable sources + power from the grid (blue); power consumed by load + power transferred to the grid (red); and power deficit/surplus (green).

Sustainability 2016, 8 , 748 20 of 22 Figure 22 .
Figure22.Evolution of the power produced by the renewable sources + power from the grid (blue); power consumed by load + power transferred to the grid (red); and power deficit/surplus (green).

Figure 24 .
Figure 24.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Figure 24 .
Figure 24.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Figure 24 .
Figure 24.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Figure 24 .
Figure 24.Evolution of the consumed energy from the grid (blue), transferred to the grid (red) and energy bills (green).

Table 1 .
Parameters considered for the solar energy source in the summer regime.

Table 1 .
Parameters considered for the solar energy source in the summer regime.
Figure 4. Sample of the power generated by the solar energy source over a day, in summer regime.

Table 1 .
Parameters considered for the solar energy source in the summer regime.
Figure 4. Sample of the power generated by the solar energy source over a day, in summer regime.