1 Introduction

Community battery systems are shared by a small group of energy consumers to reduce the peak power demands, provide energy arbitrage or control the network voltages [1, 2]. Batteries have significant capital (CAPEX) and operating (OPEX) costs. The economic daily operation of energy storages requires an intelligent trade-off is made between energy supply cost savings versus the battery operational and capital costs. Any real time battery management optimization will rely completely upon daily forecasts of the aggregated customer loads and any local generation [3,4,5].

The optimum solution will contain a strong periodic component which reflects the daily demand profiles of customers and the diurnal variation in solar generation. A feature of community battery storage systems is the relatively small number of consumers which often falls into the range of 10 to 100. The load variability is higher than is observed in large electricity markets. Likewise, the number of embedded generators is smaller. As the generation is not as geographically distributed to the extent that may occur in a large power system the spatial smoothing is lower.

The battery cycle life costs of charging and discharging batteries are highly variable and depend strongly on the application. It can range from some cents to more than 1.00 $/kWh, exclusive of additional capital costs for inverters and grid connections [6,7,8]. Battery costs can be competitive for retail customers who calculate a return on a battery investment in terms of the retail costs of electricity [7]. In a network application, the battery costs will often exceed the costs of providing network solutions in a well serviced interconnected system. Remote, rural or island systems are an important exception. Many utilities have programs of research aimed at supporting the edge of the rural distribution grid [9, 10].

Electric vehicles have driven expansions in battery manufacturing at the scale of tens of gigawatts hours annually and retired electric vehicle batteries provide a new emerging lower-cost storage opportunity [11, 12]. BMW has recently announced it will offer a residential battery pack based on batteries recycled from its i3 EV series vehicles [11].

This paper will focus on the use of load forecasting to optimize the economic operation of community battery systems. The paper will be structured as follows. Firstly the use of a non-causal average is introduced as an optimum method of peak reduction. This process is inherently dependent upon a future knowledge of the network load and the need for load forecasting is introduced. The periodic nature of the daily or diurnal optimization is then discussed and the Fourier series is introduced as a compact method of representing the battery state of charge. Finally a generalized optimization method is introduced and some representative outcomes, based on data from the Perth Solar City trials, are presented.

2 Distribution network battery storage

Battery systems can be centrally located within a power system or distributed. The control of distributed assets may be more challenging to co-ordinate but their distributed nature allows a battery to be more responsive to local network conditions and constraints [13]. Within the low voltage system, the control of local voltages and the reduction of the peak demand upon networks and distribution transformers are important. Figure 1 shows load data, as the blue trace, collected for a 200 kVA 400/230 Vac distribution transformer installed within the Perth Solar City High Penetration Trial [14]. This three phase four wire feeder supplies 77 residential homes. Of these, 29 homes have roof top photovoltaic systems that total 54 kWp. The aggregated load data was collected at the distribution transformer. The evening peak which is associated with summertime air conditioning. At midday, periods of very low loading occur due to the offset of load by the embedded rooftop solar generation. Occasional periods of load flow reversal from the low voltage (LV) transformer terminals to the high voltage (HV) terminals have been observed. Flow reversals can be a cause of over voltages. A community battery system can both prevent a power flow reversals and extend the transformer insulation life by alleviating the peak load.

Fig. 1
figure 1

Transformer load and 24-hour averaged load

3 Battery energy profile for peak reduction

The concept of the 24-hour non-causal average power loading usefully illustrates some aspects of the battery control problem. Equation (1) gives a definition for the load averaged over 24 hours [14]:

$$\overline{{p_{g} \left( t \right)}} = \frac{1}{T}\int_{{t - \frac{T}{2}}}^{{t + \frac{T}{2}}} {p_{g} \left( t \right){\text{d}}t}$$

where \(\overline{{p_{g} \left( t \right)}}\) is a non-causal averaged grid load; \(p_{g} \left( t \right)\) is the instantaneous power drawn from the grid; T is the daily averaging period, 24 hours.

The non-causal average has no phase delay in the calculation of the average value but requires knowledge of the load for twelve hours into the future. Figure 1 shows the 24-hour average applied to the load profile. A battery energy storage system could be managed to charge and discharge at rates, allowing for battery and conversion losses, which result in the total transformer load that follows the averaged power. This method would focus on the minimization of the peak demand. It does not inherently include the other factors affecting the energy cost.

A key factor is the battery levelised cost of energy (LCOE) [8], which expresses the capital and operational costs, including losses, as a charge for each kilowatt-hour of energy exchanged. A practical control system that focuses on the day to day management of a battery requires two components: namely a forecasting system that can provide reasonable estimates of the load power, net of solar generation, over a forecast period and an optimization step that can find the minimum 24-hour energy cost.

Community battery energy storage systems will typically operate with a relatively uniform daily cycle. The solution may change slowly with prevailing weather patterns and seasons. A periodic solution requires that the state of charge (SOC) of the battery system at the end of each day is constant. Any discrepancy would accumulate over time leading to over-charging or over-discharging. For an ideal lossless battery the periodic nature of the battery system stored energy is expressed as [14]:

$$p_{b} \left( t \right) = p_{b} \left( {t + T} \right)$$
(2)
$$SoC\left( t \right) = SoC\left( {t_{0} } \right) + \int_{{t_{0} }}^{t} {p_{g} \left( t \right){\text{d}}t}$$
(3)
$$SoC\left( t \right) = SoC\left( {t + T} \right)$$
(4)

where \(p_{b} \left( t \right)\) is the battery power (kW), and charging is defined as a positive power; \(SoC\left( t \right)\) is the battery stored energy (kWh) or state of charge.

Equations (3) and (4) imply that the battery power has a daily average of zero. Figure 2 shows a battery daily energy and power cycle over two identical days which is drawn from a peak demand reduction application. The battery power is negative during discharge and the peak discharge it at t = 18 hours (6.00 p.m.). In this example a high peak demand charge was applied and the battery discharged at relatively high power during the period of peak energy demand. The battery energy is the integral of power and minimum state of charge, \(SoC_{ \hbox{min} }\) depends on the constant of integration in (3).

Fig. 2
figure 2

Typical periodic battery energy and power cycles

4 Representation of cyclic state of charge profiles

The solution to an optimal daily operation of a battery system can be expressed in terms of the optimum daily energy or SoC(t) profile. This determines the instantaneous charging power and ultimately the combined daily load profile and charges. The optimal solution can be specified as a daily vector of n sample values of SoC(t) at regular time intervals:

$$\varvec{C}_{T} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {SoC\left( 1 \right)} \\ {SoC\left( 2 \right)} \\ \vdots \\ \end{array} } \\ {SoC\left( n \right)} \\ \end{array} } \right]$$
(5)
$$SoC\left( i\right) = SoC\left( {\frac{{\left( {i - {1}} \right)T}}{n}} \right)$$
(6)

All numerical optimization processes rely upon the repeated evaluation of a cost function at a proposed solution point subject to the problem constraints. Battery systems have constraints on the maximum and minimum states of charge and the charge and discharge power. A power constraint imposes an absolute difference constraint between each point within the \(\varvec{C}_{T}\) vector. Constraint checking increases the computational load during optimization. In some optimization methods such as genetic algorithms, the internal constraints between each point of the \(\varvec{C}_{T}\) vector are difficult to integrate with operations such as gene crossover during the generation of new candidate solutions.

A useful approach is to represent the periodic SoC(t) waveform using a vector of m Fourier coefficients pairs such that [14]:

$$\varvec{C}_{F} = \left[ {\begin{array}{*{20}c} {a_{1} } & {b_{1} } \\ \vdots & \vdots \\ {a_{m} } & {b_{m} } \\ \end{array} } \right]$$
(7)

The Fourier DC component can be treated as constant of integration for determination of state of charge. The state of charge profile associated with \(\varvec{C}_{F}\) will be:

$$SoC\left( t \right) = a_{0} + a_{1} \cos \left( {\frac{2\uppi t}{T}} \right) + b_{1} \sin \left( {\frac{2\uppi t}{T}} \right) + \ldots + a_{m} \cos \left( {\frac{2\uppi mt}{T}} \right) + b_{m} \sin \left( {\frac{2\uppi mt}{T}} \right)$$
(8)

The coefficient a0 can be freely adjusted to set a minimum state of charge but does not contribute to the battery power.

5 Optimization cost functions

The optimization cost function is a sum of energy costs and battery cyclic costs which can be determined given a daily state of charge profile [14]:

$$J\left( {\varvec{C}_{F} } \right) = J_{\text{peak}} \left( {\varvec{C}_{F} } \right) + J_{\text{energy}} \left( {\varvec{C}_{F} } \right) + J_{\text{wear}} \left( {\varvec{C}_{F} } \right)$$
(9)

where \(J_{\text{peak}} \left( {\varvec{C}_{F} } \right)\) is a daily peak demand charge; \(J_{\text{energy}} \left( {\varvec{C}_{F} } \right)\) is a daily energy charge; \(J_{\text{wear}} \left( {\varvec{C}_{F} } \right)\) is the daily battery wear charge.

The peak demand charge is further defined as:

$$J_{\text{peak}} \left( {\varvec{C}_{F} } \right) = P_{g,\hbox{max} } R_{\hbox{max} }$$
(10)

where \(P_{{g,{ \hbox{max} }}}\) is the relevant peak demand; \(R_{ \hbox{max} }\) is the relevant peak demand charge rate.

The peak demand may be charged according to real or apparent power demands that are averaged over a defined period. The daily energy purchase cost is determined by the time varying tariff rate, r(t) and the grid power p g (t):

$$J_{\text{energy}} \left( {\varvec{C}_{F} } \right) = \int_{{t_{0} }}^{{t_{0} + T}} {p_{g} \left( t \right) r\left( t \right){\text{d}}t}$$
(11)

The daily battery wear cost is determined from a LCOE calculation [8]. This allows an effective cost weighting factor to be determined. The total cost is proportional to the energy the battery exchanges with the grid as follows:

$$J_{\text{wear}} \left( {\varvec{C}_{F} } \right) = \frac{{K_{\text{wear}} }}{2}\int_{{t_{0} }}^{{t_{0} + T}} {\left| {p_{b} \left( t \right)} \right| {\text{d}}t}$$
(12)

where \(k_{\text{wear}}\)is the LCOE cost factor.

A battery optimization will be performed subject to limits battery energy storage and power constraints:

$$SoC_{ \hbox{min} } \le SoC\left( t \right) \le SoC_{ \hbox{max} }$$
(13)
$$\left| {p_{b} \left( t \right)} \right| \le P_{{b,{ \hbox{max} }}}$$
(14)

where \(SoC_{ \hbox{min} }\) is the minimum allowable state of charge; \(SoC_{ \hbox{max} }\) is the maximum allowable state of charge; \(P_{{b,{ \hbox{max} }}}\) is the maximum battery power.

In the this case the battery power is pure magnitude constraint as may be imposed by an interfacing converter but different constraints can be readily applied on charging and discharging. For some storages, such as flow batteries, battery power ramp rates may be applied.

6 Receding horizon optimization

Energy consumption and the peak demand in a community low voltage system has quasi-periodic daily behavior. The daily consumption profile is a strong function of exogenous variables especially temperature, relative humidity and the day of the week. A practical community battery system can be managed by receding horizon optimization method which can adjust to changes in the daily load profile [14]. An explanatory diagram is shown in Fig. 3.

Fig. 3
figure 3

Periodic battery profile control

The receding horizon approach relies on performing a sequence of 24-hour periodic optimizations that are updated on a periodic basis. The update period \(T_{s}\) is a design choice. In this example, a one hour update period is selected.

The key features receding horizon method are [14] that for each update period a 24-hour load profile is assembled using 12 forecasts at hourly intervals for the future load values and 12 historical load values. This is the current load value and the hourly loads eleven hours into the past. For the assembled 24-hour load profile, a direct search optimization is applied to find the battery state of charge profile, \(\varvec{C}_{F} \left( {kT_{s} } \right),\)that minimizes the daily energy cost. The new calculated profile is used to progressively update an averaged charge profile, \(\overline{{\varvec{C}_{F} \left( {kT_{s} } \right)}}\). The battery power is then controlled to follow the averaged charge profile. The allowable battery power will determine the rate at which the averaged profile may be permitted to change.

The update equation for the averaged target profile is as follows:

$$\overline{{\varvec{C}_{F} \left( {kT_{s} } \right)}} = \left( {1 - \alpha } \right)\varvec{C}_{F} \left( {kT_{s} } \right) + \alpha \overline{{\varvec{C}_{F} \left( {\left( {k - 1} \right)T_{s} } \right)}}$$
(15)

where α is a low pass filter coefficient.

7 Forecast methods

The key to the performance of the battery optimization system is the availability of suitable forecasts of the power system load net of solar generation. Three approaches have been trialed including neural networks, wavelet neural networks and an adaptive networked based fuzzy inference system.

These are described in more detail below and the results are shown in Table 1. For training purposes, a set of 14451 points was assembled. Data was drawn from records collected from the Perth Solar City PV trial between 17th October 2011 and 29th January 2012. A corresponding test set of 4032 points was extracted from the data collected from the 30th January 2012 to 26th February 2012. The training set included the annual peak load day. In order to provide a reasonable training outcome, the training set was purposefully selected to cover a broader climatic range than the climatic range found in the test set.

Table 1 Mean prediction error

7.1 Neural networks

Neural networks have been widely applied for short term electrical load forecasting [15]. Twelve forecasts are required and twelve neural networks were individually trained to provide the load forecasts. Each network considered just one load forecast period. The network inputs are related to load, weather and time. The load related parameters are the current load, the load 24 hours ago and 168 hours ago and the average load over the past 24 hours. The weather related parameters are the dry bulb temperature the relative humidity and solar radiation. The Time/calendar parameters are the hour of the day, an integer representing the day of the week and an integer flag indicating if the day is a working day or holiday. The neural networks each have ten inputs and a hidden layer of 20 neurons. Training was undertaken using a mean absolute error (MAE) performance metric with the default MATLAB toolbox Levenburg-Marquardt algorithm [16].

7.2 Wavelet neural networks

The power system includes rapidly changing high-frequency loads such as thermostatically controlled appliances and low-frequency loads such general lighting. These have mixed timescales. The rapid and slow fluctuations in load profile cannot be captured adequately by one neural network. Wavelet analysis is a time-frequency joint representation of a signal which can be used to decompose a time domain signal to several other scales with different levels of resolution. The wavelet transformation requires the definition of a mother wavelet which embodies a set of specific characteristics that influence the frequency decomposition process. The choice of the appropriate mother wavelet depends on the type of application. In power systems, Daubechies (DB) mother wavelets are shown to be more effective than the other wavelets because they are orthogonal and do not cause any information loss [17, 18].

A combination of wavelet transform and neural network can bring up the benefits of having both approaches. In this paper, the past load measurement data from 1, 24 and 168 hours ago are decomposed into a low frequency component and three higher elements (level 4, DB4) [18]. The 12 decomposed load frequency signals and the other seven inputs used for the neural network in Section 7.1 are fed into a new neural network for training. The neural network (NN) element has 19 inputs and a hidden layer of 20 neurons. The Levenberg–Marquardt (LM) back-propagation algorithm was applied for training [18]. A total of 12 wavelet neural networks (WNNs are used to forecast the load for each of the specific future instants.

7.3 Adaptive network fuzzy inference system (ANFIS)

The ANFIS was firstly proposed by Jang in 1993 [19]. Two machine learning methods, fuzzy logic and neural networks, are integrated to overcome the drawbacks of neural networks and fuzzy logic systems. These are the limitations of neural networks with their representation of implicit knowledge and subjective and heuristic nature of fuzzy systems [20,21,22].

ANFIS is a class of adaptive multilayer feedforward networks, applied to nonlinear forecasting where past samples are used to forecast the samples ahead. ANFIS incorporates the self-learning ability of neural network with the linguistic expression function of fuzzy inference. The ANFIS architecture can be shown in Fig. 4. One drawback of ANFIS is that an increase in the number of network inputs for building an ANFIS model will largely increase training time and computing resources. In this load forecasting simulation, each fuzzy neural network inputs has only six inputs which are: the current load; the average load in the past 24 hours; the relative humidity; the dry bulb temperature; an integer flag indicating if the day is a working day or holiday and the hour of the day.

Fig. 4
figure 4

ANFIS framework

For each input, three Gaussian membership functions are assigned and the outputs of membership functions are linear. The Matlab toolbox ANFIS was used with a back propagation gradient descent optimization method to compute all parameters for building load forecasting models.

8 Predictive performance

Each method was used to generate twelve future forecast series. The prediction interval varied from one hour into the future to twelve hours. Each series included 168 hourly points over the one week period from midnight 30th January to 11.00 p.m. 6th February 2012. The mean absolute error (MAE) is shown for each of the twelve series in Table 1. The wavelet neural network has provided the best estimates in this case. Figure 5 shows the output of each method for the load forecast for twelve hours into the future compared to the actual load. The top traces are for the neural network method, the second set of traces are for the wavelet neural net and the lower set are for the ANFIS system.

Fig. 5
figure 5

Twelve-hour future forecasts of NN, WNN and ANFIS

9 Battery control simulations

Two practical applications of the forecast data are now considered. These are the use of the data in a peak demand reduction application and a periodic optimization application.

Figure 6 shows a 24-hour non-causal average load power calculated using WNN predictions for the one week period from midnight 30th January to 11.00 p.m. 6th February 2012.

Fig. 6
figure 6

Non-causal smoothed load control

The top trace shows the load power and estimate of the non-causal average based on the WNN forecasts. The second trace is the difference between the average power estimate and the true averaged power shown in Fig. 1. The peak error is 9.5 kW and MAE is 2.4 kW. These are small relative to the battery power which has a peak of 81.3 kW and is shown in trace three. The final trace shows the resultant battery energy. The proposed control method reduced the peak load from 169.3 kW to 91.4 kW. This is close to the true averaged load peak of 89.0 kW.

Figure 7 shows the output of the receding horizon periodic optimization system utilizing WNN as the prediction tool. The simulation assumes a two part low voltage energy and demand tariff, based on a commercial Australian retail offer, of 14.977 c/kWh for energy and monthly charge 31.725 $/kW peak demand. To accommodate the daily optimization horizon, the monthly charge is scaled to a daily charge of 1.0423 $/kW. The battery round trip energy efficiency 90% and the cyclic wear cost 10 c/kWh. The Fourier series SOC vector includes the first 4 harmonics and the charge profile update coefficient α is set to 0.9.

Fig. 7
figure 7

Receding horizon periodic optimization

The top trace is the original load waveform and the net power system loading. The second and third traces are the battery energy and power respectively. The periodic optimization process focuses on the total cost of energy supply which includes the battery wear cost. In order to reduce the battery costs, this example will not reduce the peak as strongly as the non-causal average result. The peak power is 117.6 kW and as expected this is higher than the 91.4 kW peak achieved in the earlier example.

The choice of the short Fourier coefficient vector length limits the higher frequency components of the battery energy profile. The highest harmonic, the fourth, corresponds to a six hour period. Fast changes in load demand are outside the effective bandwidth of the control system. The faster load components still appear in the power system loading. These are small and have very little impact in regard to energy or the peak demand. While it is possible to extend the length of the Fourier vector the improvements will be ultimately limited by the impact of the forecast errors within the optimization process.

10 Conclusion

This paper has demonstrated two community battery control methods both of which rely upon a future forecast of a distribution transformer load to adequately control the battery state of charge. The first battery management method is well suited to the control of the peak power demand. A 24-hour non-causal average provides a useful control target for a battery management system but requires a twelve hour future forecast. Three forecast methods, NN, WNN and ANFIS are compared. Of these the WNN and ANFIS systems achieve the better results. In this paper, twelve forecasts are made at one hour intervals. These are used together with load power samples in the previous twelve hours to calculate a moving 24-hour average. The averaging process significantly attenuates any forecasting errors and it is possible to generate a 24-hour forecast with low average errors. In this application, a MAE was less than 3% of the averaged peak load power.

The non-causal moving average system does not incorporate factors which influence the overall cost of energy and these include the battery wear costs and the impact of time of use tariff structures. This paper presents a periodic optimization method that determines an optimum periodic solution for any load profile over a 24-hour period. The cyclic solution for the battery state of charge is represented using Fourier coefficients.

The optimization process is embedded in a receding horizon battery control system. At each hour forecasts are made to develop a prospective 24-hour load profile. An optimization determines an optimal battery charge profile. The optimum profiles are progressively updated on an hourly basis with a twelve hour receding horizon. This approach is illustrated for a typical application with a two part energy and demand tariff.