1. Introduction
The number and applications of battery-powered devices have significantly increased over the last decades [
1]. Mobile phones, laptops, electronic watches, portable radios, children’s toys, and many others are a few examples of daily-life battery-operated appliances.
Additionally, battery systems are playing an increasingly prevalent role in the support of smart energy systems [
2,
3] by means of providing energy storage functionalities to make the electric grids more flexible, clean, and efficient.
Smart energy systems are the application of Information and Communication Technologies (ICT), computer-based algorithms, and/or artificial intelligence (AI) methodologies to design, operate, and maintain a sustainable, efficient, and reliable energy supply infrastructure [
4]. As modern smart energy systems incorporate more intelligent devices with their own computing and connectivity capabilities, they build up an Internet of Energy [
5] where the centralized control is complemented with, and in certain cases even substituted by, a distributed control over cloud computing architectures [
6].
Frequency Containment Reserve (FCR) is one of these applications of battery storage systems (BSSs) to power networks. According to the European Union Network Code on System Operation [
7], FCR denotes “the active power reserves available to contain system frequency after the occurrence of an imbalance”. These reserves are used whenever a deviation of nominal frequency occurs, either absorbing or supplying the imbalanced amount of energy. The main target of FCR is to provide a fast response (in seconds) to changes in the network frequency to contain and limit its deviation from the nominal value (50 Hz in Europe), while other energy storage or sources with more capacity but larger time responses can begin to operate and restore the normal operation state.
Self-Consumption Increase (SCI) in the private sector is considered, besides FCR, one of the most prominent applications of BSSs to power systems [
8,
9]. In a typical SCI application, a household owner with a private photovoltaic (PV) installation tries to accommodate its power demand to the solar-dependent generation profile. When PV-generated power exceeds the demanded power, the surplus energy is stored in a battery system. On the other hand, when the electricity demand surpasses solar-dependent generation, the BSS supplies the lacking power.
In this article, we focus on FCR and SCI only, although batteries can be employed in smart energy systems for a variety of other applications such as peak shaving [
10], electric service reliability [
11], spot market trading [
12], and many others, as are summarized in [
13].
The behavior and performance of a BSS in a certain application can be analyzed using different approaches. In the first place, a set of physical experiments on laboratory-controlled or in-field conditions can be undertaken [
14]. However, these tests require physical (and usually expensive) equipment, they must be run in real time (which is very time-consuming), and they lack enough flexibility to investigate many different scenarios and assess rare events.
To overcome these problems, simulation-based analysis is a common practice for BSS assessment. For running these simulations, the most precise and detailed models consider the physicochemical equations ruling the BSS behavior [
15]. Besides that, thermal, mechanical, and electrical models complement the theoretical description of all the subsystems that make up a complex BSS [
16].
Physicochemical models have shown themselves to be very accurate, offer a deep and detailed insight into internal processes, and are very flexible in testing different experimental conditions. They are also about one order of magnitude faster than physical tests, which means that the most optimized models can be run in about one-tenth of the real-time duration of the simulated experiment [
17]. However, although these results are a remarkable improvement over the physical test, they require a well-parametrized and battery-chemistry-specific model. Additionally, they require an enormous amount of computing resources, making them useless for long-term experiments. For instance, a one-year-length analysis would still require about one month to be simulated using this type of model.
An extensively used alternative to physicochemical simulations is based on considering the battery cells as black box electric circuits which can be described using an equivalent electric model [
18]. While they still offer very good estimations of the BSS behavior, the corresponding simulations can be run about two to four orders of magnitude faster than the real test. Then, for instance, a one-year-length experiment could be simulated in about one day. Therefore, due to this reduced computation time, many battery operation conditions can be tested and compared. Some examples of simulators based on equivalent electric models are summarized in [
19].
Although electric circuit models are certainly suitable for many analyses, they already have severe limitations when many different BSSs and/or operation conditions have to be considered. To cope with these cases, several machine learning (ML) approaches have been proposed [
20,
21,
22]. They use the inputs and outputs of previous experiments, either real or simulated, to build a data-driven ML model that, once completely trained, can obtain remarkable estimations of the outputs corresponding to novel inputs. Training an ML model is usually a time-demanding process in human and computer resources which mainly depends on the complexity of the model and the size of the dataset available. On the other hand, the prediction step can be performed with the highest computing efficacy (about five to eight orders of magnitude faster than real tests). The comparison of different analysis methods of BSSs is sketched in
Figure 1.
The impact that a certain input (for instance, the frequency signal for FCR or the household load and PV generation for SCI) has on a BSS can be described in terms of a set of output signals. They typically measure the evolution of some physical magnitudes, such as the storage power provided for (drawn from) the BSS, its state of charge (SOC), or its state of health (SOH). It is a common practice to summarize this impact, that is, the set of output signals, using a handful of KPIs [
23] to better analyze and compare the storage load profiles. Using KPIs is a way to summarize the behavior of a BSS in a handful of values. The KPIs selected in this research either emphasize the performance of the BSS, such as the battery efficiency (
), or they are precursory indicators of the expected battery degradation, such as the number of Full Equivalent Cycles (FEC) and the number of charging-discharging swaps (
).
This research is focused on the development of an ML methodology to estimate the impact, as it is summarized by a set of KPIs, of a given input signal in a BSS when it is used for FCR or SCI applications. This methodology does not require any knowledge about the physicochemical process inside the BSS, nor even an equivalent electric model. The ML approach is based on an agnostic model which is trained using datasets with the results of previous experiments.
The main contribution of the research is to show the capabilities of the ML techniques to describe, in a very fast way, the behavior of a BSS under different operation conditions. The use of ML methods in this research has been proposed mainly for three reasons: they do not require an explicit set of equations to describe the BSS (agnostic model); they can be run in much less time (see
Figure 1); and, finally, because ML is a well-established discipline that has proven successful in many different applications.
The paper is organized as follows: in
Section 2, the datasets employed and the proposed methodology are described; the main results are explained in
Section 3, outlining the estimation errors of the different KPIs;
Section 4 discusses these results and takes into consideration their dependence on design parameters such as the length of the input signals, their time resolution, or the number of input profiles available for training; and finally, the main conclusions of the research are presented in
Section 5.
4. Discussion
4.1. Interpreting Results
The results obtained using ML techniques to predict the KPIs of a BSS operating in a certain scenario can be assessed using four approaches as presented in the previous section: a plot comparing predicted and actual values (
Figure 5), the
error metric, the
error metric, and the
determination coefficient. According to three of these indicators, the best predictions are obtained for
, closely followed by
, and, with a lower performance,
. The only exception to that unanimity is found for
in SCI applications, showing high relative errors (with the best performance in the remaining three criteria). However, this anomaly can be explained because, although the absolute errors in SCI scenarios are low, the actual
values are very low (see
Figure 7), yielding high relative errors.
By ordering the KPIs from low to high prediction errors, the following list is obtained:
,
, and
. This order can be explained intuitively. Let us consider, for example, a 30 min evolution of the frequency in the electric grid as it is shown in the left part of
Figure 9. In an FCR application, the storage power and the SOC of the BSS will follow an evolution as indicated in the central part of the Figure. To predict the number of swaps, it is required to estimate the number of positive power regions (in blue in the graph). On the other hand, to predict the
, it is required to estimate not only the number of regions but also their areas. Finally, to predict the efficiency, it is required in addition to estimate the initial and final values of the SOC. So, the more information required to estimate a KPI, the more difficult it should be to predict its value, which explains the results obtained.
On the other hand, when different simulation scenarios are considered, the results show that FCR applications obtain better estimations than SCI. Additionally, for a more detailed analysis, in the FCR case, the KPIs for a BSS with three modular power electronic units obtain (slightly) better estimations than those simulations where a single power electronic unit is used. Finally, the estimation of KPIs in the feed-in damp SCI scenario is better than the estimations for the greedy SCI strategy.
To gain some intuition on the reasons for these results, the smoothness of the input profiles will be considered. The underlying idea is that the estimation of the KPIs must be easier for a smooth input profile than for those with sudden unpredictable changes. To depict these ideas, two random examples are drawn in
Figure 10.
In the top part, a 60 min FCR simulation is shown, while in the bottom row, a one-day SCI application is considered. In the first column, the input profiles are plotted, clearly showing that significantly more unpredicted events occur in the SCI case. In this example (a household), the sudden changes in SCI are probably due to an increase in the power demand during lunchtime and after-work activities. On the other hand, for the FCR application, the frequency signal responds to an aggregated demand showing a more stable evolution.
To explain the differences between the prediction performances in different operation strategies, the storage power in the BSS is considered, as is shown in the upper (FCR) and lower (SCI) rows of the central column in
Figure 10. For an easy reading of the signals in the example, the differences between the charging power in both scenarios are plotted in the right column of the Figure.
It can be seen that the smoothness of the signal in different operation strategies is not so different than those seen when comparing different applications (FCR vs. SCI). However, in the FCR 1PE scenario, the charging power is always equal to or greater than the modular PE operation. As only one power electronic unit is available, a less flexible operation can be provided, yielding (slightly) less smooth signals. A similar situation occurs in SCI applications where the charging power signal in the greedy operation directly follows the unpredicted changes in the photovoltaic residual power (photovoltaic generation minus household demand), while the feed-in damp operation attenuates this impact by a more tempered charge of the battery, also yielding (slightly) smoother signals. These reasons explain the differences found in prediction performances between applications and operation strategies.
4.2. Learning Curves
Once the hyperparameters have been selected in the validation process, the training and validation datasets are unified in an extended training dataset containing 80% of the total number of instances: that is, about 50,000 instances. To assess if this is a sufficient amount of training samples, a learning curve is plotted, where the regression performance (
metric) is computed for an increasing number of training examples. The resulting learning curves for a particular KPI (
) and three single-target regressors are depicted in
Figure 11. Similar results are obtained for other KPIs and regressors. It can be seen that the ridge regressor reaches the maximum performance for about 10,000 training instances. Still, neither the random forest nor the neural network regressors achieve a maximum flat performance for the available number of training samples.
These results can be explained by considering the number of parameters required to define each model, which are summarized in
Table 7. The higher the number of parameters, the more complex a model is, and a greater number of instances is required for its training. So, if larger datasets were available, better estimations should be expected.
4.3. Length of Input Profiles
The design matrix used to train the models was generated by splitting each one-year-length input into segments of one-day length. By decreasing the length of these segments, a greater number of segments was obtained. To check the dependence of the values of a certain KPI on the length of segments, a one-year-length input signal is split into several segments. For each segment, several values of that KPI are obtained: the shorter the segment, the greater the number of values. These values can be statistically described using, for instance, their median and IQR. The relationship between these statistics and the length of the segments is depicted for an FCR scenario in
Figure 12 and for an SCI application in
Figure 13. Similar results are obtained for the remaining scenarios.
In these Figures, it can be seen that the statistical distribution of the values of the KPIs remains stable if the input profiles are split up into one-day-length segments. For shorter segments, a qualitative change in the KPI values should be expected. So, it is not advisable to increase the datasets by reducing the length of segments.
4.4. Sampling Times
Input profiles are available in the datasets with a resolution of one second and a length of one year. That means that each input profile contains 31,536,000 values. Therefore, processing these high-resolution signals is computationally demanding. To explore if it is possible to down-sample these profiles, a frequency analysis has been performed. For that purpose, the spectrum of amplitude is obtained for each input profile, using a fast Fourier transform (FFT) algorithm.
The results for an example of FCR and SCI input profiles are shown in
Figure 14. It can be seen that the highest frequency of a significant harmonic for an FCR signal corresponds to a sampling period of about one minute. For the SCI input profiles, this harmonic corresponds to about four hours. Therefore, input profiles could be significantly down-sampled, using resolutions higher than 30 s for FCR and two hours for SCI.
5. Conclusions
This research has shown that the behavior of a BSS can successfully be estimated from its input power signal using machine learning (ML) techniques, which can be applied to unseen new datasets as long as they have the same statistical distribution: that is, the input profiles are independent and identically distributed (IID). Different KPIs summarizing the functioning of the battery have been predicted with an average relative error () of less than 10%. These average errors may differ depending on the KPI and the battery operation scenario, ranging from 2% in the better case to 16% in the worst case.
Although the precisions estimating the battery KPIs are not very high, the ML approach proposed in this article offers the advantage of obtaining a prediction in a relatively short time (a few seconds), a remarkable result compared to the computing effort required when using simulations based on electric-equivalent circuits (several hours).
The precision obtained in this research highly depends on the number of training examples available. As the learning curves have shown, the selected ML algorithm (a random forest regressor) has not reached its maximum performance and better predictions should be expected with a larger training dataset.
The predicting models are valid for the same conditions employed to obtain the datasets. If the application, the operation strategy, and/or the parameters of the battery system change, a new ML model has to be trained from the corresponding dataset.
From the previous paragraphs, it can be stated that the methods proposed in this research have two main limitations: they can only be used in cases where similar examples have been previously analyzed, either in lab tests or by equation-based simulations; and, on the other hand, the estimation of KPIs through ML techniques does include an estimation error (10% on average in our study).
ML techniques are a very powerful tool to have at hand, but they do not replace an in-depth analysis and domain knowledge-based discussion of results altogether. As applied herein, they do not eliminate the need for precise physical-model-based simulations or lab-controlled experimentation, but they can offer a first and very fast rough approximation of the expected behavior of a BSS.
The results presented in this article, mainly those concerning to and , indicate that ML techniques can probably be extended to estimate the SOH of a battery after a given input profile, a question that the authors will research in the future.