Management of battery charging and discharging in a photovoltaic system with variable power demand using artificial neural networks

The energy is the basis of all human activities. Nowadays, much of the world's energy demand is taken from fossil fuels. However, fossil fuel reserves are limited. The use of solar photovoltaic energy is therefore a necessity for the future. With the rapid increase of photovoltaic or hybrid systems, solar batteries provide an unforgettable energy storage tool in this type of systems in order to ensure an energy supply to consumers. Due to the sensitivity of solar batteries and the random operation of photovoltaic systems that depend on solar irradiance, control and management strategies are quite important. In this paper, we present a technique based on artificial neural networks to control the charging and discharging of solar batteries in order to protect the batteries from overcharging and deep discharging. In addition, ensuring continuous supply to consumers. The proposed model is developed and simulated in Matlab/Simulink.


Introduction
In today's world, artificial intelligence is becoming increasingly important in many areas including the electrical systems, smart and micro-grids. The integration of this technology in the electrical systems makes them more intelligent and efficient.
The increase in the rate of consumption of fossil energy sources results in dwindling fossil reserves, and at the same time causes major problems such as climate change and health problems [1].
The use of renewable energy sources such as photovoltaic generators in stand-alone or distant systems is a very promising solution. This type of system will ensure the reduction in the rate of pollution, limit the evolution of climate change and progressively replace traditional energy sources with environmentally friendly green sources (photovoltaic systems) [2,3]. The estimates indicate that by 2030, the use of solar energy sources will provide 7% of the world's electricity needs, this percentage will increase to about 25% by the year 2050 [4].
Since photovoltaic generators are known for their random operation which requires the presence of solar irradiation (Meteorological conditions), the use of batteries as a storage tool is an obligation in stand-alone systems. This solution will ensure the supply to the consumer in case of absence of solar irradiation (clouds or night).
In order to ensure a proper functioning of the global system and to protect the battery against overcharging * Corresponding author: author@email.org and deep discharging, a management strategy is important.
In this context we will propose a new management technique based on artificial neural networks (ANN). The content of the manuscript is subdivided into three parts as the following: In the first part we will presents the studied system and its principal components.
The second part is dedicated to the management strategy, the neural network architecture chosen and the discussion of the results obtained in the development of the ANN model.
The third part presents the system under Matlab and the discussion of the results obtained in different test condition.
Finally, a conclusion of the work made and prospects for future work.
2 The structure and modelling of the system Figure 1 shows the main components of the system under the study which consists of: A photovoltaic generator, a solar battery, a DC/dc buck-boost converter with "MPPT'" control (Perturb and observe) [5], a bidirectional DC/DC converter used to ensure the flow of current in both directions (Manage the charge and discharge of the battery) [6,7], a DC to AC converter to provide an alternative power supply to the consumers. In addition to two loads, one permanently connected and the second connected and disconnected to the system using SL2 switches. A bi-directional DC/DC converter is a key element in many new and emerging applications such as automobile systems, servers and renewable energy systems.
To manage the state of charge of the battery, a bidirectional buck-boost converter will be used to ensure the flow of current in both directions (charge/discharge) according to the state of switches S1 and S2, whose commands are generated by the neural network output states "zero or one".

The management strategy:
As a result of weather conditions, the use of distributed renewable energy production such as photovoltaic generator is subject to certain difficulties. This is due to their production being variable over time and their prediction values are difficult to be determined.
The integration of storage units such as solar batteries is a promising solution in order to overcome the random function behaviour of photovoltaic generators, as well as ensuring a continuous energy supply to consumers.
Due to the sensitivity of the solar battery, a charge/discharge management and protection strategy is important.
During its use, a battery placed in a stand-alone network can undergo either overload when its SOC exceeds 90%, or deep discharges when its SOC decreases below 30% [8]. Based on these indications, we propose a management strategy for a hybrid stand-alone network in order to prevent deep discharges and overcharges of the battery and ensure continuous power supply for the consumer.

The neural network architecture
The artificial neural networks are machine learning systems inspired by the biological neural networks and able to perform processing similar to the human brain [9], [10], [11].
In this part, we will present the structure of the developed neural network such as the number of layers, number of neurons per layer, the number of inputs/outputs and the activation functions .... The Figure 4 illustrates the neural network structure is a multilayer perceptron (MLP), which consists of three input vectors as power generated by the photovoltaic generator, the state of charge of the battery and the power demanded by the loads. Concerning the MLP model output, we have two output vectors: S1 and S2 (Switches S1 and S2 are used to control the charge/discharge of the battery as well as protecting the battery against overcharge and deep discharge). The dimension of each input or output vector is 6000x1. Concerning the number of layers, we have an input layer with three neurons, a hidden layer with eight neurons and an output layer with two neurons.
The choice of this architecture is made after several tests in which we try to find the architecture that has an MSE close to zeros and R-Squared close to one.

Evaluation indicators of the ANN model
To evaluate the performance of the developed ANN model, we have chosen to use the two most widely known and used statistical indicators [12], [13], namely:

-The MSE
The figure 5, shows that the training, test and validation mean square errors (MSE) converge to the same 7.7619*10-3 value at epoch 86. This shows, that the network training is functioning well, and the network output converges to the desired output values [14]. -The R-Squared: In Figure 6 it is noticed that in all three phases (training, validation and test) the R-squared value is close to one, which shows that there is a strong correlation between the ANN model output and the desired output.

Testing of the ANN model and results discussion
In this part, we will test the operation of the developed ANN management model in various test conditions. In order to analyse the efficiency of the model, we have chosen to set it in two cases where the test conditions are different: The case 1: The conditions given in this case: -As shown in the figure 8, a variable photovoltaic power and a variable load demand power. -A battery state of charge below the minimum value (SOC < SOCmin) as shown in figure 10.   During the operation of the system in this case (SOC < SOCmin), as the power required by the load system is greater than the power produced by the solar panels (From 0 to 0.2 Second and from 0.6 to 1 Second), as a consequence in these intervals the ANN model imposes the protection of the battery against deep discharge by setting the switches S1 and S2 to 0 as illustrated in figure 9.
When the photovoltaic power becomes higher than the power demand (From 0.2 to 0.6 Second), the ANN model sets the switch S2 to 1 and S1 to 0, consequently the battery will be charged from to PV system as illustrated in figure 10.

The case 2:
The conditions accorded in this case: -As shown in the figure 11, a variable photovoltaic power and a variable load demand power. -A battery state of charge above the maximum value (SOC > SOCmax) as shown in figure 13. Fig. 11. The Photovoltaic and load power characteristics.  During the operation of the system in this case (SOC > SOCmax), as the power demanded by the load is higher than the power generated by the photovoltaic generator (From 0 to 0.2 Second and from 0.6 to 1 Second). Therefore, the ANN model imposes the discharge of the battery by setting the switch S1 to 1 and S2 to 0, in order to ensure the supply to the consumers.
When the photovoltaic power becomes higher than the power demand (From 0.2 to 0.6 Second), the ANN model sets the switch S2 to 0 and S1 to 0, as a result, the protection of the battery against overcharging as illustrated in figures 12 and 13.