Integration of artificial neural networks for multi-source energy management in a smart grid

Received Jun 15, 2021 Revised Jul 2, 2021 Accepted Jul 12, 2021 Among the most widespread renewable energy sources is solar energy; Solar panels offer a green, clean, and environmentally friendly source of energy. In the presence of several advantages of the use of photovoltaic systems, the random operation of the photovoltaic generator presents a great challenge, in the presence of a critical load. Among the most used solutions to overcome this problem is the combination of solar panels with generators or with the public grid or both. In this paper, an energy management strategy is proposed with a safety aspect by using artificial neural networks (ANNs), in order to ensure a continuous supply of electricity to consumers with a maximum solicitation of renewable energy.


INTRODUCTION
In the fast increase in universal access to electricity in the last decades. The demand for renewable energy sources is increasing, day by day. In 2016, the share of renewables in total final energy consumption increased at the fastest rate since 2012 and reached almost 17.5%. Renewables are essential in the drive towards universal access to affordable, sustainable, reliable, and modern energy [1]. With the growing fears of climate changes and increasing oil prices, the world is moving towards the use of green energy sources to minimize the use of fossil energy. Solar energy is one source of power generation that independent away from petroleum and coal dependent energy resource [2].
Among the adopted of several solutions we find, the combine of various energy sources such as solar, wind, diesel generator, flywheels, compressed air storage, pumped hydro, superconducting magnetic sources and vehicle-to-grid integration [3]- [5]. The incorporation of diesel generators and link to the public grid is an efficient solution to ensure the reliability of the system and the supply of electricity, especially when there are critical loads (24-hour demand for electricity without interruptions). The system presented in this article consists of three energy sources (photovoltaic generator, diesel generator, and the public grid) and a storage unit. To ensure the reliability of the system, a safety aspect is added to the operation of the diesel generator. To guarantee the correct switching between energy sources, maximum use of renewable sources and a continuous supply of electricity to the loads, a new management technique based on artificial neural

THE MANAGEMENT STRATEGY
During system operation, the ANN management system must guarantee; i) continuous supply to consumers in different weather conditions; ii) battery charge and discharge control, iii) battery protection against deep discharge and overcharge, iv) test the operation of the diesel generator in order to replace the photovoltaic generator; and v) maximize the solicitation of renewable energy sources. The algorithm of operation started by reading different measures of power produced by the photovoltaic system (Ppv), the power demanded by the loads (PLoad), the state of charge of the battery (SOC), the indicator of operation of the diesel group (I) (This verification has the objective to know if the generator is running or not, after having the start order). The chart in the Figure 2, shows different scenarios in which the system operates and the actions to be taken in the event of validation of each scenario. The diesel generator function test is done the usage of a MATLAB function, which will input the current generated by the diesel generator, and the function will output one if the diesel generator is able to support the power system, or zeros if not.

Neural network architecture
The artificial neural networks are machine learning systems inspired by the biological neural networks and able to perform processing as similar to the human brain [12], [13]. A linear and non-linear algorithm models, artificial neural networks (ANNs) can build. The artificial neural network (ANN) used in this study is a multilayer perceptron network (MLP), which consists of an input layer, four hidden layers and an output layer. The dimension of each input or output vector is 1x10000. The choice of MLP is due to its ease of implementation, the speed of solving non-linear problems, its construction and the fact that our dataset contains a limited number of variables. The data used during the development of MLP are divided into three parts; the first 70% for training, the second 15% concern the test operation and the third 15% to validate the model [14]- [16]. The objective of this operation is to show the predictive quality of model development. Figure 3 shows the adopted architecture of ANN chosen. The choice of this architecture (The number of layers, number of neurons per layer, activation functions, learning algorithm ...) is made after several tests, in which we tried to find the model that has an error close to zero (Convergence of the model outputs to the desired outputs) and a correlation coefficient close to one (which signified a strong correlation between the model outputs and the desired outputs). The ANN model input vectors are: The power delivered by the photovoltaic generators, the power demanded by the loads, the battery state of charge and the diesel generator operating state indicator. Concerning the output vectors, there are four vectors which are; S1 and S2 which have as functions the control of the bidirectional converter in order to manage the charge and discharge of the battery, the S_DG is the switch of the connection with the diesel group, and the S_G is to switch to the mode that is connected to the public electrical grid in case of deficiency of the electrical supply at the local level.

TRAINING AND RESULTS DISCUSSION
The architecture of the neural network must undergo a learning phase once it has been chosen. This consists of calculating the optimal weights of the different links, using the training base and a collection of algorithms [17]. The learning algorithms used in the following are part of MATLAB toolbox of neural networks [18]. One of the indicators, that show the quality of the training operation, is the mean square error [19]- [21]. As shown in the following Figure 4, the mean square error gets the value 7.8488x10 -3 at 73 epochs, which shows that the training operation has worked well, which means that the MLP outputs will converge to the desired outputs perfectly in the three phases of training, testing and model validation [22]- [25]. The Figure 5 shows the different elements used in the construction and training of neural networks, such as; the architecture, the algorithms used during training and some results that provide information about the training operation.

Test of the ANN management model
In this section, we will examine the ANN management model under different operating conditions in order to validate and visualise the capacity, robustness and reliability of the system management (ANN). During the operation of the power supply system, three critical cases can be encountered, where the system will be put in operating conditions that require the intervention of instant management so as to protect the equipments of the installation and to ensure an uninterrupted power supply to consumers by a maximum using of energy produced by the solar panels.
The Case 1: In this case, we will see the robustness of the control model by assigning to the battery states of charge a higher value than the maximum one (soc_max), with a variable power at photovoltaic generator and consumers. In this case, the battery acts as the main generator if the photovoltaic power falls below the required power.
As shown in Figure 6, two operating scenarios can be distinguished in four-time intervals. Scenario 1: From 0s to 0.1s and from 0.9 to 1s: These time intervals show an increase in photovoltaic power above the required power and a battery state of charge above soc_max. As a consequence of these conditions, the ANN model will protect the battery from overcharge by setting both switches S1 and S2 to zero. Scenario 2: From 0.1s to 0.3s and from 0.7s to 0.9s: In these time intervals, we have noticed an increase in power demand than the photovoltaic power, and a battery state of charge is always higher than soc_max. As a result of these conditions, the ANN model will force the battery to move into discharge mode by setting the switch S1 to one and the switch S2 to zero in order to supply the charging system. Since the battery state of charge is sufficient to replace the photovoltaic system, the diesel generator and public grid switches remain unchanged.
The Case 2: In this case as shown in Figure 7, two scenarios will be discussed, when the power demanded by the load is higher than the PV generator and the battery state of charge is insufficient for the battery to replace the PV generator. As a result of these conditions the diesel generator will be used to supply consumers. To better interpret this case, we will choose two time intervals where the results are clear: a. Interval number 1 (Desired operation): From 0.3s to 0.7s; In this interval, we notice that Ppv > PL and SOC < SOCmin, as a consequence of these conditions, we will have the battery charge from the photovoltaic system (Battery protection from deep discharge), by setting switch S2 to one and the switch S1 remains at 0. b. Interval number 2 (PV system failure): From 0.1s to 0.2s; in this interval, we obsrve that Ppv < PL and SOC < SOCmin, since the diesel generator indicator equals 1 (Idg > Iref), which means that the generator is able to supply the system and charge the battery, by setting switch S2 to one and the switch S1 remains at 0. The state of switch S_G remains zero. The setting of this switch by the ANN model is done when the diesel generator indicator equals 0, which means that there is a deficiency in the diesel group. This will be seen in the case number 3. The Case 3: In this case as shown in Figure 8, we will create a failure in the diesel generator, which will lead to the declaration (I < Iref) to the neural network that the diesel group is incapable of replacing the photovoltaic generator. Therefore, the ANN control model, will force S_G to change to one for switching to the connected mode with the public grid, in order to ensure continuous supply to the consumer and battery charging (The public grid is the main provider in this case). As in the previous case, we will take two time intervals to better interpret the results. a. The first interval (Desired operation): From 0.3s to 0.7s; in this interval, we notice that Ppv > PL and SOC < SOCmin. As the result of these conditions, we will have the battery charge from the photovoltaic system (Battery protection from deep discharge). b. The second interval (PV and DG systems failure): From 0.1s to 0.2s and from 0.7s to 0.9s; we can that the Ppv < PL, SOC < SOCmin and the diesel generator indicator equals 0 (Idg < Iref). This means that the diesel generator is not functioning. Therefore, the ANN forces the S_G to switch to one; the system moves to the connected mode in order to support the local power system and charge the battery by setting the switch S2 to one.

CONCLUSION
The integration of renewable energy sources, such as solar generators and the discentralisation of production units, will reduce the demand of fossil fuel sources and surmount of the climate change that threatens humanity. Since renewable energy sources are known by their random operation, which is mainly dependent on weather conditions, the integration of storage units and other secondary energy sources are necessary to ensure an uninterrupted power supply to consumers, especially in the case of critical loads that require a permanent current. To ensure a robust and optimal operation the addition of safety aspects to the control system are recommended. In this paper, an artificial neural network control system has been developed to manage the battery charging and discharging (Battery overcharge and deep discharge protection), the diesel generator operation verification and the management of the switching between energy sources, all these functions are done by the ANN model simultaneously. The use of neural networks has been widely diffused in several fields including the smart grid. The paper presents one of several examples that have shown the effectiveness and robustness of the use of ANNs in smart grids.