Energy storage control for dispatching photovoltaic power

The strong growth of the solar power generation industry requires an increasing need to predict the profile of solar power production over a day and develop highly efficient and optimized stand-alone and grid-connected photovoltaic systems. Moreover, the opportunities offered by Battery Energy Storage Systems (BESSs) coupled with PV systems require an ability to forecast the load power to optimize the size of the entire system composed of PV panels and storage devices. This paper presents a sizing and control strategy of BESSs for dispatching a photovoltaic generation farm in the 1-hour ahead and day-ahead markets. The forecasting of the solar irradiation and load power consumption is performed by developing a predictive model based on a feedforward neural network trained with the Levenberg-Marquardt back-propagation learning algorithm.


I. INTRODUCTION
S OLAR power generation using Photovoltaics (PVs) has become widely employed, especially in places where power grids are inconvenient or unreasonably expensive to connect, but its use is also increasing significantly in gridconnected situations as a way to feed low-carbon energy into thegrid [1].
The increasing use of solar energy introduces new technical challenges due to the intermittency of this source, which is influenced by natural and meteorological conditions, as well as other factors [2].
Due to this uncertainty and the intermittency of solar energy, any grid-connected solar PV plant is considered to be an uncontrollable and non-dispatchable power source with fluctuations in its power output that affect the stability of power systems [3].
In Europe, the growth in the numbers and power rating of photovoltaic plants has been relatively high. There has been a growth in installed power, from 141 MW in 2007 to 256 GW at the end of 2015. Therefore, there is a need to dispatch renewable resources so they can be controlled Manuscript  in a similar way as any other conventional generator [4].
A key advantage of mimicking dispatchable generators is that battery-assisted solar PV systems can be integrated into the mature market that has been established for dispatchable generators [5]. In fact, the advancement of smart grid technologies facilitates a convenient and fast interaction among all participants in the electricity market and provides technical support for the application of Demand Response (DR) in electricity markets [6].
Recent advances in electric energy storage technologies have provided an opportunity for the use of batteries to address the intermittent behavior of renewable energy sources. Therefore, PV or wind power can be dispatched on an hourly basis.
However, it is impractical for an Independent System Operator (ISO) to dispatch and control a massive distributed storage system directly because of the large dimension and the need for information privacy, so the concept of aggregators has been developed to cope with such distributed resources [7]- [9].
The aggregator is the interface between the demand side and the Distributed System Operators (DSOs). The aggregator agent provides the DSO with the cumulative energy available, from storage, at any time during the day [10]. The storage service is crucial for the efficient performance of an aggregator agent. Therefore, energy storage may be one of the important ways to solve the fluctuation of renewable sources because storage services can smooth out the power output of Renewable Energy Sources (RESs) by configuring a certain capacity. However, these storage services require a suitable control strategy. Different control strategies are proposed in the scientific literature [11]- [14], many of which utilize short-term forecasting of the photovoltaic system. However, it is necessary to increase the forecasting period to achieve better dispatchability and to enable the renewable sources to provide the ancillary services that are required by the network. Because traditional generation plants use a day-ahead dispatch provision, it is important to evaluate the feasibility of increasing the forecasting period to a 24-hour ahead period for the entire system composed of the renewable generator and storage system (e.g., PV + BESS). Paper [15] introduces a day-ahead dispatch provision, but it focuses on determining the optimal dispatch schedule for energy stored in the battery to achieve a specific amount of load peak shaving. References [16] and [17] are devoted to the application of PVs in low-voltage distribution networks. In contrast, the present paper is dedicated to PV plants connected to the primary distribution Medium Voltage (MV) grids. Reference [18] also studies the battery sizing for grid-connected PV systems to achieve power arbitrage and peak shaving, but the targeted applications are from the user's point of view.
The aim of this paper is to find the best BESS size to extend the hour-ahead dispatch provision to the day-ahead dispatch provision within an acceptable error limit and to help the aggregator to select the right battery size with respect to the risk he/she wants to assume.
Because an accurate prediction of the power output of a PV system can largely help in the planning and scheduling of the power dispatch, this paper first implements a predictive model based on a feed-forward neural network to forecast the solar irradiation and load power consumption. BESS control strategies are strongly influenced by the subsequent dispatch period, and this dispatch period depends on the nature of the renewable source considered. Different types of neural networks have been analyzed by changing the number of layers and neurons and their activation functions, and by training the networks using the Levenberg-Marquardt backpropagation algorithm. In contrast with [19], where a twolayer feed-forward network is adopted, this research employs a three-layer feed-forward network because it is identified as the best compromise. The creation of a good input set, as well as a good network architecture, is of great importance in limiting the forecasting errors.
A BESS control strategy is then presented. The study considers lithium-ion batteries used as the compensation device, but the methodology proposed can be easily extended to other storage technologies when different limitations are adopted. The effectiveness of the proposed control method in increasing the dispatching prediction accuracy will be demonstrated through simulations. Many simulations are presented to find the relation between the Weighted Average Percentage Error (WAPE) [20] and the BESS size for both the 1-hour ahead forecasting and the day-ahead dispatch provision. The final goal is the optimization of the BESS size for the dayahead provision to match the performance of the 1-hour ahead provision.
Finally, the conclusions are discussed to underline the benefits of the proposed approach.

II. PROBLEM DEFINITION: THE USE OF ENERGY STORAGE
FOR DISPATCHING PHOTOVOLTAIC POWER The efficiency of the BESS compensation system depends on the installation point of the BESS with respect to the PV generator. In particular, the efficiency increases with a decrease in the distance between the two elements and reaches its maximum if the elements are installed at the same point. In this case, the BESS can be connected to the AC side or directly to the DC side in integrated systems, as shown in Fig. 1a. However, this condition is mainly applied in low-voltage grids where it is important to maximize the self-consumption of each consumer because the aim of the various incentive programs is to achieve grid parity in the installation of plants. The PV plants connected to MV grids are mainly used to sell energy and therefore, maximizing their self-consumption is not as important. However, the growth of these large installations can only be accepted by the DSO if the connected generators are able to participate in the voltage and frequency regulation. This capability is not tasked to the single producer, but it can be performed by a new operator, called an aggregator, that combines a set of generators and supplies all the ancillary services required by the DSO through this compensating system [21]- [23].
As new entities in electricity markets, DR aggregators act as brokers between DR resource owners and the ISO. From the customers' perspective, the DR aggregators are buyers who help them value the reduction in demand and provide various contracts which customers can voluntarily agree to take part in [24]. From the ISO's perspective, the DR aggregators hold the aggregated DR and submit DR offers in the day-ahead (DA) markets in the same way power generation companies do [6].
In this case, the installation point of the BESS is not the same as that of the generators, and the effect of the BESS on the dispatchable energy can only be observed upstream of the Point of Common Coupling (PCC), as shown in Fig. 1b.
Because the paper is dedicated to PV plants connected to MV grids, the following analysis considers only the latter case where the BESS is connected to the AC section of the system at the PCC by means of a dedicated power converter, as well as to each photovoltaic generator.

III. SOLAR IRRADIATION AND LOAD POWER CONSUMPTION FORECASTING
BESS control strategies are strongly influenced by the subsequent dispatch period, and this dispatch period depends on the nature of the renewable source considered. For example, in the case of PV generators, the dispatch period is usually assumed to be equal to one hour [25]- [27]. This is because the most widely used prediction methods do not show sufficient accuracy over longer periods of time.
For solar forecasting, very different methodologies are preferred, depending on the forecast horizon [28]. In the last decade, it has been widely recognized that Artificial Neural Networks (ANNs) are superior to traditional statistical models when the relationship between the output and input variables is implicit, complex and nonlinear [29]. Many interesting forecasting techniques are therefore based on the neural network theory. An interesting survey comprehensive of comparison among different approaches is reported in [30].
This study implemented a predictive model based on a feedforward neural network to forecast the solar irradiation and load power consumption required to proceed with the implementation of a control strategy.
Different types of neural networks have been analyzed. In particular, the error for each network has been calculated by changing the number of layers and neurons, and their activation functions. All the networks analyzed possess a feedforward architecture and the networks have been trained by means of the Levenberg-Marquardt back-propagation algorithm. Because the network needs to be trained by means of a relevant input set to make the network aware of the task it is going to perform, different training sets were used to train the network properly.
The training set has to cover enough cases to enable the neural network find a good forecast. However, the training set cannot be too large to avoid tightening the constraints, which can bring about an inaccurate forecast. For this reason, recorded data from a 1-year period were used to train the neural network to cover all the possible climate conditions in the summer and winter seasons.
Various metrics have been proposed and used to quantify the accuracy of solar and PV forecasts. Which metrics are most appropriate depends on the user: system operators need metrics that accurately reflect the costs of forecast errors, while researchers require indicators of the relative performance of different forecast models, and of a single model under different conditions. Whatever the intended use of forecasts, standardizing performance measures or metrics helps facilitate forecast evaluations and benchmarking [30].
In this paper, all the analyzed data are not described and only the neural networks and input sets that provided the best results for forecasting purposes are presented. However, the preliminary analysis allowed us to optimize the parameters of the neural network, determine the horizon of predictability and compare the forecasting quality for different cases.
The data used for forecasting the solar irradiation were the solar irradiation, ambient temperature, wind speed and sampling timestamp (date and time), and they were acquired from 1-year observation in the SolarTech Lab in Campus Bovisa of the Politecnico di Milano [31], [32].
A large number of simulations were carried out using the MATLAB neural network toolbox. The entire data set was randomly divided into 8760 time steps, and 70% of the data were used for the training set.
The solar irradiation forecasted by the neural network forecaster was compared to the actual solar irradiation, and the error was calculated. The principal statistics used to evaluate the performance of these models, the Weighted Average Percentage Error (WAPE), is defined as follows: where Irr forecasted and Irr actual are the forecasted solar irradiation and the actual solar irradiation, respectively, i is the index of a single array element and n is the number of elements (in this case n = 8760).
Different networks were simulated to find the best combination of the number of neurons and the number of layers. A good compromise between the computational cost and the mean error value was found using a three-layer structure (the input, hidden and output layers) such as the one reported in Fig. 2, with an input set composed of the following vectors: hours (0-23), month (0-12), the solar irradiation 24 hours before, the forecasted ambient temperature, the day of the year (1-365) and the mean solar irradiation from the previous 24 hours.
The simulations on this network, characterized by a higher number of neurons especially in the hidden layer, give a WAPE% = 22.41%. The comparison between the actual and forecasted solar irradiation is shown in Fig. 3. From this comparison, it is easy to note how well this network is able to forecast the solar irradiation if the day-to-day solar irradiation does not change quickly. On the other hand, the network tends to suffer when the irradiation values increase or decrease suddenly.
Because artificial neural networks are suitable for learning and predicting time series vectors, they are also used to forecast the load power consumption.
The data set available is a table of historical hourly loads and generic observations of the temperature for five years, with a 1-hour sampling period. The available data are the load power consumption, ambient temperature, dew point temperature and sampling timestamp (date and time).
Starting from these data, different input sets were created and employed to train the networks considered. To forecast the load power consumption 24 hours ahead, the target vector is delayed for 24 hours with respect to the input vectors.
A fast training process is of great importance in reducing the computational complexity. Therefore, an input set related to only the first year of observations was preferred, and it is composed of the following vectors: hour (0-23), day of the week (1-7), the load power consumption 24 hours before, the load power consumption one week before, the forecasted ambient temperature and the mean power consumption from the previous 24 hours. The best results were obtained using this input set in combination with a three-layer structure such  as the one shown in Fig. 4. The simulations on this network give a WAPE% = 1.68% and a typical error of 2.79%, as reported in [33].
For the training phase, this simulation needed only 32 seconds and 91 iterations to be completed, indicating that this forecasting technique is suitable for real-time applications such as the creation of automated strategies for BESS control where the training state of the network is constantly refreshed.
A regression analysis was also performed for both the solar irradiation and power consumption forecasting to display the network outputs with respect to the targets for the training, validation and test sets. An R-value close to 1 indicates that there is a linear relationship between the outputs and targets. The results are shown in Fig. 5. It is observed that the solar radiation forecasting has greater dispersion than the load demand forecasting due to the variability of the climate conditions; this variability can also produce more outliers. The solar and hence the PV production forecasting accuracy are mainly influenced by the variability of the meteorological and climatological conditions. To a minor extent, accuracy is affected by uncertainties related to the different modelling steps that are needed to make energy forecasts out of irradiation forecasts [30]. However, the R coefficient remains close to 1.

IV. BESS CONTROL STRATEGY IMPLEMENTATION
To correctly define the accuracy and relative error of the prediction, it is necessary to evaluate the performance of the forecasting models using different error indexes [34].
First, a dispatch level needs to be defined for the subsequent dispatch period, which is assumed to be 1 hour. This desired dispatch level is assumed as the PV power is forecasted for the next hour. The forecasting is obtained by means of a feedforward backpropagation neural network, as discussed earlier.
The only difference is that the prediction horizon for the control strategy implementation is set to 1 hour ahead instead of 24 hours ahead. The reduction of the forecasting horizon causes a reduction in the prediction error: from 23.85% for the 24-hour ahead provision to 12.46% for the 1-hour ahead provision. The control strategy wants the BESS to compensate for the difference between P set and P PV , where P set is the 1-hour ahead forecasted power set as the dispatch level and P PV is the actual power produced by the PV plant. Figure 6 shows the difference (P set − P PV ), which corresponds to the ideal power profile that the compensating system should supply or absorb.
This study considers lithium-ion batteries applied inside the compensation device because of their diffusion, but the methodology proposed can be easily applied to other storage technologies when different limitations are adopted, as better explained in the following.
The control method developed to increase the dispatching prediction accuracy can be summarized as follows.
Once the maximum charge and the discharge power that the compensating device has to guarantee are verified, the only constraint for the BESS is its State of Charge (SOC). The SOC of a battery is its available energy expressed as a percentage of its rated capacity. To prolong the battery life and preserve its health, a complete discharge or an overcharge of the battery should be prevented [35]; therefore, the SOC of the battery should be kept within the proper limits and estimated accurately at each control interval. The SOC limitation imposed for this study is the following: This interval allows the maximum power exchange for most types of storage systems and prevents either a significantly large discharge or an overcharge.
When the SOC interval range is defined, the goal is to force the actual power delivered or absorbed by the BESS to be equal to the ideal reference power: where P BESS_ref = P set − P PV (4) Equation (3) cannot always be obeyed because it depends on the actual SOC of the BESS. Therefore, the following rules have to be applied: By adding P BESS actual to the actual power generated by the PV plant P PV , the actual power profile dispatched by the entire system PV + BESS is obtained as: As mentioned above, this study focuses on the energy management and it can be easily adapted to different technologies used for the storage systems. In fact, to enable more flexibility and an easier implementation, only the total capacity and the maximum charge and discharge power were considered. Other constraints, such as current or voltage limitations, can be added to the system whenever a customized model based on a particular storage technology is needed. An example could be a system that utilizes flywheel energy storage; in this case, it is possible to create rules for the angular speed instead of the SOC [36], [37].

V. SIMULATION RESULTS
Simulations were carried out to evaluate the best size of the BESS required to make the PV plant dispatchable for a longterm period such as the 24-hour ahead period [38].
The study considers a real PV plant located in Northern Italy with a rated power of 1 MWp and connected to the MV primary distribution grid. The 1-hour ahead forecasting is obtained by means of the three-layer Artificial Neural Network described earlier. The data set employed composed of 8760 elements, which correspond to hourly observations in a 1-year period.
To verify the accuracy of this method, the WAPE% error definition, which was applied when evaluating the forecasting accuracy, was used. As a matter of fact, we can see the  effect of the battery control from the reduction in the forecasting error. The method was applied to the PV plant for the 1-hour ahead forecasting for different BESS sizes. Simulations were also performed without any BESS compensation system to evaluate the contribution of the BESS compensation system. Moreover, the analysis also considers the case in which there is a dispatching power deviation of ±5% for the PV rated power.
Finally, the provision period was stretched to the day-ahead provision to find the best size of the BESS that matches the performance of the 1-hour ahead provision.

A. Simulation: 1-Hour Ahead Forecasting
The first case considers a BESS with a capacity of 1 MWh, obtaining the following: The compensation effect of the BESS produces a consistent reduction in the forecasting error. From Figure 7, it can be observed that for the considered period, the dispatched power P dispatched (in dotted blue) tracks the set power P set (in red) almost perfectly. Sometimes the P dispatched does not track the P set anymore and instead begins to follow the PV actual power P PV (in green) because the SOC limit (upper or lower) has been reached. Figure 8 shows a zoom of the previous figure including a subplot with the corresponding SOC where the upper and lower limits are highlighted.  This study does not consider any limitations on the BESS power to obtain the sizing power of the compensation system. In this case, the maximum power supplied or absorbed by the BESS, obtained from the simulation, is 244kW, leading to a BESS power rating of 250kW. Because a poor provision affects the mismatch between P dispatched and P set , it is important to evaluate the impact of the provision error. Figure 9 represents the power profiles for a good forecast, where the error compensation for the dispatching program is almost perfect because the SOC always remains within its limits.
Otherwise, a poor error compensation is obtained for a highly inaccurate forecast, as shown in Fig. 10. Therefore, the poor forecasting accuracy usually causes the SOC to reach its upper limit during the observation period and results in the discontinuation of the BESS' operation.
This method also underlines the importance of a good prediction from an economic point of view. A better forecasting accuracy corresponds to a lower capacity of the BESS and hence considerable economic savings.
The impact of the introduction of an accurate BESS is depicted in Fig. 11, which shows the absolute hourly difference between the P dispatched and P set with and without the compensation system.
Considering an acceptable forecasting error deviation of ±5% with respect to the PV rated power (1 MWp), the WAPE% becomes the following: The error plot of the mismatch is shown in Fig. 12.  The same simulations were performed by increasing the size of the compensation system to evaluate the benefits introduced by the BESS compared with the WAPE% 1h−0 base case. Table I shows the simulation results and the relative error reduction, in terms of the WAPE%, for both of the cases described above.
Some observations can be drawn from these results. For example, a 100 kWh BESS, that provides the PV peak power (1 MWp) for 1/10 of 1 hour (observation period in the 1-hour ahead market) is able to reduce the WAPE% by approximately 30%.
By making the connection between the size of the BESS and the error reduction, the curve shown in Fig. 13 is obtained.
The curve has a large derivative at lower BESS sizes and then appears to saturate for higher BESS capacities. This means that the best performance is obtained for a compensation system that is able to store an energy equivalent to the PV peak power for 1 /4 of the forecasting period. Favorable performance can be obtained until 3 /4 of the forecasting period has elapsed, while a further increase in the BESS size does not produce a proportional increase in the error reduction and is therefore not justified.

B. Day-Ahead Dispatch Provision
Because traditional generation plants use a day-ahead dispatch provision, it is important to evaluate the feasibility of stretching the forecasting period to the 24-hour ahead provision by considering the system with a renewable generator and a storage system (e.g., PV + BESS). Therefore, a new simulation that uses the 24-hour ahead PV power forecasting was carried out.
In this simulation, the provision error gives a WAPE% of 23.85% that is assumed as the base case for the subsequent evaluations. The first case considers the system without a BESS, obtaining the following: In considering the system above including a BESS with a capacity of 1 MWh, the error becomes: The error for WAPE% 24h−1MWh is significantly higher than that for WAPE% 1h−1MWh . Figure 14 shows that the dispatched power P dispatched (in dotted blue) does not follow the set power P set (in red) for longer periods unlike what was observed in the previous case (Fig. 8).   Table II shows the simulation results in terms of the WAPE% reduction with respect to the base case WAPE% 24h−0 , with and without the 5% tolerance, for a forecasting period of 24 hours.
The error values are significantly higher than those obtained from the 1-hour dispatching. To obtain an error similar to the 1-hour dispatch with a 1 MWh BESS for the day-ahead dispatch period, a 6.5 MWh BESS must be employed. This requires a huge economic investment. This methodology can be very useful to enable an aggregator to evaluate the best size of a BESS with respect to the risk he/she wants to assume. In fact, he/she can decide on an approach for the day-ahead market by starting with the performance obtained in the 1-hour ahead market and balancing the possible revenue with the potential economic risk. Figure 15 shows that to obtain the best technical-economic performance in the case of the 24-hour dispatch, the BESS must store a minimum energy equivalent to the PV peak power for 2 hours, which is 1/12 of the forecasting period.
In choosing the BESS size, one also has to consider the life cycle of the storage system to prevent a degradation of the system's performance. It is acknowledged that the ratio between the power P (kW) and capacity C (kWh) cannot be too high to prevent sudden discharges that can compromise the life of the system.  The results obtained by applying the proposed method comply with this rule. Indeed, the optimal BESS size that reduces the WAPE% to acceptable values is such that P/C is always less than 1.

VI. ECONOMIC IMPACT
A preliminary economic analysis of the impact of the BESS on the total cost of the PV plant is presented. It is important to estimate the increase in the cost as a result of using a BESS to evaluate whether it is worthwhile. The mean values of large PV plants have been derived from [39]: for 1 MWp the average capex is currently equal to 1,100 $, while its value should decrease to 970 $ in 2020. Regarding the BESS, the capital costs are reported in Figure 16.
The analysis evaluates the increase in the installation cost of the PV + BESS for different sizes of the storage system today and in 2020. The results are reported in Table III.
The convenience of installing the BESS depends on the market balance. In particular, given the current situation, in the 1-hour ahead market with a WAPE% of 2.64%, the BESS accounts for 24% of the capital installation cost and increases by up to 160% in the 24-hour ahead market. Therefore, the BESS introduction is clearly not economically sustainable in the 24-hour ahead market, however, it can be considered in the 1-hour ahead market. On the other hand, more changes are expected in the near future. In fact, in 2020, the impact of the BESS on the capital installation cost will decrease from 160% to 67% in the 24-hour ahead market and from 24% to 10% in the 1-hour ahead market. These values are acceptable because the BESS presence would allow the PV systems to participate in balancing the market and result in an increase in revenue.

VII. CONCLUSION
The paper addresses the problem of the dispatchability of PV farms connected to MV distribution grids. The diffusion of PV systems has brought about the need to control them to optimize their contribution within the existing context. Battery energy storage systems are ready to address the intermittent behavior of renewable energy sources by smoothing out the output of the RES' power and by configuring their capacity. The introduction of a BESS control strategy could allow PV power to be dispatched on an hourly basis in a similar way as other conventional generation systems. Participating in a wellunderstood market allows the owner of a battery-assisted solar PV system to avoid the uncertainties present in the emerging market of non-dispatchable generators.
The paper implemented a method to correlate the size of a BESS with the risk in power dispatching for both the hourahead and day-ahead dispatch provisions. Different types of neural networks were analyzed because the accurate prediction of the power output of a PV system, the utilization of a good input set and the implementation of a good network architecture are of great importance in limiting the forecasting errors. This study implemented a predictive model based on a feed-forward neural network trained by means of the Levenberg-Marquardt back-propagation algorithm to forecast the solar irradiation and load power consumption needed to proceed with a control strategy implementation.
Simulations were performed using actual solar PV data, and the results showed a good performance of this control scheme; the control strategy tracks the desired dispatch set points quite closely while keeping the SOC of the BESS within the desired limits. The proposed control method was applied to lithium-ion batteries, but it is noteworthy that can this be easily extended to other storage technologies. The same methodology was implemented by stretching the forecasting period to 24 hours.
The study proved the effectiveness of this method, which results in a great improvement in dispatching intermittent renewable sources as solar photovoltaic energy. The results showed that solar energy can be dispatched in the one-hourahead market with a low risk and the use of convenient technologies. The stretch to the day-ahead market implies a higher risk or the use of larger-size BESSs that are not convenient at the current prices but should become affordable in the next few years.