Performance of ANN as a function of number of neurons in the hidden layer (method1).
Open access peer-reviewed article
This Article is part of Artificial Intelligence Section
Article metrics overview
222 Article Downloads
View Full Metrics
Article Type: Research Paper
Date of acceptance: April 2024
Date of publication: May 2024
DoI: 10.5772/acrt.34
copyright: ©2024 The Author(s), Licensee IntechOpen, License: CC BY 4.0
This paper deals with artificial neural network (ANN) applied to control a standalone microgrid in French Guiana. ANN is an artificial intelligence technique used to control non-linear and complex systems. ANN associated with the Levenberg–Marquardt (LM) algorithm has many advantages, such as rapid decision-making and improved system transients. Therefore, this technique should be adapted for the control of photovoltaic (PV) systems in the tropical climate of French Guiana with high variation in irradiance. The microgrid is composed of a PV source and a storage battery to supply an isolated building which is modeled by a DC load. The PV source is controlled by an ANN-based MPPT (Maximum Power Point Tracking) controller. To validate our ANN-MPPT, we compared it with one of the very popular MPPT algorithms, which is the P&O-MPPT algorithm. The comparison results show that our ANN-MPPT works well because it can find the maximum power point quickly. In the case of battery control, we tested two feed-forward backpropagation neural network (FFBNN) configurations called method1 and method2 associated with the Levenberg–Marquardt (LM) algorithm. We varied the number of hidden layers in each of these two FFBNN configurations to obtain the optimal number of hidden layers for each configuration which optimizes battery control. Method1 is chosen because it is better than method2, in a sense that it respects the maximum amplitude of the battery current for our application and improves the transient regimes of this current. This best configuration (method1) is then tested with two other learning algorithms for comparison: Bayesian regularization (BR) and scaled conjugate gradient (SCG) methods. The system performance with LM algorithm is better than SCG and BR algorithms. LM algorithm improves the performance of the system in transient regimes while the results obtained with the SGG and BR algorithms are similar. Then, we focused on the advantage of using ANN control compared to the conventional proportional integral control (PI control). The comparison results showed that ANN control associated with the LM algorithm (ANN-LM) made it possible to reduce battery current peaks by 26% in transient regimes compared to conventional PI control. Finally, we present and discuss the results of our simulation obtained with the MATLAB Simulink software.
PV-battery system
microgrid
ANN control
ANN based MPPT
Author information
The energy sector faces a steady increase in global energy consumption, mainly due to demographic evolution. The largest raise in energy demand will take place in developing countries where the proportion of global energy consumption is expected to increase from 46 to 58% between 2004 and 2030 [1]. Even though in 2020 the global energy consumption decreased by 5.9% compared to 2019 due to COVID-19 pandemic, the demand for renewable energy increased by nearly 1.5% [2]. The energy sector is therefore faced with challenges related to the integration of renewable energies. Solar energy is one of the fastest growing energies and photovoltaic (PV) technology is widely installed in residential buildings [3].
Microgrids based on PV technology, with a robust control, can reduce power fluctuations by providing output power smoothing, ensuring service continuity, and stabilizing the grid [4, 5].
French Guiana is a French overseas territory, located in Latin America and has a tropical climate, where solar energy is one of the most widespread renewable energies [6, 7]. But equipment is imported from Europe and is therefore not adapted to the tropical climate of French Guiana. So, this equipment degrades quickly because of the severity of this climate. In addition, if the system is poorly controlled, their degradation can accelerate due to the bad behavior of the system in transient regimes which generates current peaks.
To limit these negative effects on the battery, we propose to use artificial neural networks (ANN) which are artificial intelligence techniques used to control nonlinear and complex systems [8]. Indeed, many scholars have used ANN in several different ways [8–14]. But to the best of our knowledge, no study has been done using ANN controllers to control the battery to better respect its technological constraints and thus improve its lifetime in a tropical climate context.
Using these innovative techniques in this domain permits improvement in the transient regimes of the battery current in order to improve its lifetime and therefore reduce the operating cost of the system.
This paper is organized into the following sections: Section 2 presents the methodology; Section 3 presents the results and discussion. Finally, Section 4 presents the conclusion.
The block diagram of the studied system is presented in Figure 1. The system is composed of two parts: a source part consisting of a photovoltaic generator (PVG) which supplies the isolated building which is modeled by a DC load through a DC/DC boost converter; and a storage part consisting of a battery connected to the
As shown in Figure 1, the source part is controlled by an ANN-MPPT (ANN-based Maximum Power Point Tracking) block. As for the battery, it is controlled by two ANN controllers (ANN1 and ANN2). We detail these controls in the following section.
As previously mentioned, artificial neural networks (ANN) are artificial intelligence techniques used to control non-linear and complex systems. They have various merits, such as, excellent approximation of nonlinear function, fast decision making, no restriction on the normality etc. For each ANN model, there are several key configurations such as the number of hidden layers, the activation function etc. [10, 14].
Each artificial neuron is an elementary processor which receives a variable number of inputs from upstream neurons. Each input is associated with a weight (
The principal equation of an ANN describes in Figure 2 is given in (1).
There are several neural network architectures and learning algorithms. A very popular and efficient one would be the backpropagation learning algorithm [10, 11]. According to [10], Levenberg–Marquardt method (LM) is based on the non-linear least squares technique and the Gauss–Newton algorithm with restricted neighborhood. It is a standard algorithm for the quadratic error optimization due to its fast convergence and robustness properties [10]. Still according to the same author, LM algorithm permits lower cost of calculations and the fast guarantee of convergence to a minimum.
According to [15], LM algorithm would be faster than others training algorithm like Bayesian regularization and scaled conjugate gradient methods. It is recommended for training the network.
For all these reasons, we choose, both for source part control and battery control, a neural network of the feed-forward backpropagation type, by using Matlab Software, with the training function TRAINLM (Levenberg-Marquardt Backpropagation) and “logsig, tansig and purelin” as activation functions for input layer, hidden layer, and output layer respectively.
As previously mentioned, the source part is controlled by an ANN-based MPPT presented in [10] and [16]. Its principle is illustrated in Figure 3 and its simulation scheme is shown in Figure 5.
The role of ANN (see Figure 3) is to deliver the optimal voltage
In this case,
To set up ANN controllers, it is necessary to obtain data as input and output variables to train the neural network. For this, we randomly generated the data using a MATLAB program by considering the following equations [16, 17]:
Note that the choice of minimum and maximum parameters are made according to the realities of the field of study (French Guiana).
So, by considering Equations (2)–(5) and using “for loop” in MATLAB, it is possible to build the needed data to train our ANN models. For this, we arbitrarily chose to build 1500 samples.
Afterwards, as previously announced, we chose the error backpropagation method with LM algorithm to train our ANN models as in [10] and [16]. Moreover, three hidden-layer-neural network is used to reach
Figure 4 shows the regression curve of the training of the ANN-MPPT model carried out in this work. It can be seen that the regression (
The first ANN controller (ANN-MPPT) having given the reference voltage
Figure 5 shows the simulation scheme of the source part control (PV control).
Our ANN-based MPPT method is similar to those presented in [10] and [16] but with a slight difference. Indeed, in [10], the authors consider a single ANN controller with three inputs (
The result of the source part control is presented in Section 3 (result and discussion).
The battery control contains two nested loops:
A voltage loop which compares the reference voltage (
The block diagram of the proposed battery ANN control is illustrated in Figure 6.
To set up ANN controllers for controlling the battery, we generated the data (1500 samples) by using a MATLAB program and the parameters of the battery which are indicated in Table 3.
We tested different configurations of this ANN model according to the number of neurons in the hidden layer to choose the best configuration for the most efficient ANN model. Indeed, the role of the input layer is to transfer the input values corresponding to the input variables (input data) to the next layer called the hidden layer [10]. Therefore, the number of input layers depends on the number of input data to be processed. The number of the output layers also depends on the number of output data.
To choose the number of input layers, we asked ourselves if the comparator should be in or outside the ANN controller as the number of input data differs depending on whether the comparator is included in the ANN or not. Hence our two methods: method1 and method2.
In this configuration method, we consider the comparator to be outside the ANN controller (Cf. Figure 6). In this case, the ANN controller input is the comparison error (𝜀
Table 1 shows the performance of ANN according to the number of neurons in the hidden layer (for method1).
ANN1 | ANN2 | ||
---|---|---|---|
Hidden layer number | MSE (%) | Hidden layer number | MSE (%) |
2 | 26.5529 | 2 | 0.026072 |
3 | 22.659 | 3 | 0.02579 |
4 | 22.4424 | 4 | 0.015102 |
5 | 22.3476 | 5 | 0.024541 |
6 | 22.3608 | 6 | 0.014644 |
7 | 22.1468 | 7 | 0.014855 |
8 | 22.2094 | 8 | 0.014914 |
9 | 22.0856 | 9 | 0.014512 |
10 | 22.4147 | 10 | 0.014568 |
As shown in Table 1, the best configurations are those for which the number of hidden layers is equal to nine for the two ANN controllers (ANN1 & ANN2). Indeed, these configurations have the lowest mean square error (
Figure 7 shows the principle of the method2.
As shown in Figure 7, in configuration method2, instead of the input of the ANN controller being a comparison error between the measured quantity and its reference (between
In this case, two input layers and one output layer are required as we have two input data (
Table 2 shows the performance of ANN according to the number of neurons in the hidden layer (for method2).
ANN1 | ANN2 | ||
---|---|---|---|
Hidden layer number | MSE (%) | Hidden layer number | MSE (%) |
2 | 26.2949 | 2 | 0.010255 |
3 | 22.5856 | 3 | 0.01015 |
4 | 22.8456 | 4 | 0.0098326 |
5 | 22.377 | 5 | 0.0097088 |
6 | 22.1368 | 6 | 0.0097896 |
7 | 22.4019 | 7 | 0.009624 |
8 | 22.1476 | 8 | 0.0098795 |
9 | 22.124 | 9 | 0.0097267 |
10 | 22.5518 | 10 | 0.0097808 |
Table 2 indicates that the best configurations are those for which the number of hidden layers is equal to nine and seven for ANN1 and ANN2 respectively with
Each ANN model is trained with 1500 data samples for both method1 and method2. Thus, after having trained the models, we use the MATLAB command “gensim” to generate the Simulink toolbox of the ANN controller which is then used in the Simulink model of the simulation.
To choose between the two methods, we superposed the simulation result obtained by the two methods in Figure 10. Looking at Figure 10, both methods work but method1 is better than method2. Indeed, not only does the amplitude of the battery current obtained with method1 correspond exactly to the maximum amplitude of our application (
Figure 8 shows the model of the ANN controllers thus configured (with method1).
Our method of synthesizing an ANN controller is summarized in Figure 9.
To justify the choice of the LM algorithm, starting from the same optimal number of hidden layers (nine) presented in Table 1 and considering the same activation functions (“logsig, tansig and purlin”), we have implemented the model of method1 with two other training functions: Bayesian regularization (BR) and scaled conjugate gradient (SCG) methods. The result presented in the following section confirms that our choice of the LM algorithm is judicious in terms of improving transient regimes.
Moreover, to validate our ANN control, we compared it with the conventional Proportional Integral (PI) control whose parameters (of PI) are calculated in [18].
The simulation is carried out with the parameters indicated in Table 3. For more information on these parameters, see [18].
Source part | ||
---|---|---|
Symbol | Parameter | Value |
1STH-215-P | PV model | |
Short circuit current | 7.84 A | |
Open circuit voltage | 36.3 V | |
Maximum power | 213.15 | |
Maximum voltage | 29 V | |
Maximum current | 7. 35 | |
Number of cells in series | 60 | |
Series resistances | 0.39383 Ω | |
Shunt resistance | 313.3991 Ω | |
Cell ideality factor | 0.98117 | |
𝛼 | Current temperature coefficient | 0.102 |
𝛽 | Voltage temperature coefficient | − |
Number of parallel string | 5 | |
Number of strings in series | 1 | |
PPVG_max | Maximum power of the PVG | 1.066 kW |
Inductance of the boost converter | 5 mH | |
C1 | Input capacitor of the boost | 3300 μF |
C2 | Output capacitor of the boost | 330 μF |
Switching frequency of the boost | 10 kHz | |
DC load | ||
Load resistance | 5.2 Ω | |
Voltage of the DC load | 48 V | |
Power consumed by the DC load | 426 W | |
Storage part | ||
Symbol | Parameter | Value |
Lithium-ion | Type of the battery | |
The need autonomy of the battery | 2.3 h | |
Maximum battery current | 8.88 A | |
Input battery voltage | ||
Capacity of the battery | 17.76 h | |
SOC | Initial state of charge | 45% |
Battery side inductance | 5.2 mH | |
Battery side capacitor | 400 μF | |
Switching frequency of the RDC | 10 kHz |
We have chosen the municipality of Saül which is an isolated municipality in a sense that it is not connected to the coastal electricity distribution network of French Guiana. To test the control, we chose the sunniest day of the year 2020 (11/09/2020) for this study area.
Simulation results are shown in the following Figures 11–16. The irradiance (Cf. Figure 11) is estimated (every one hour) by a computer program developed by us [19]. To simplify, we have implemented in MATLAB the daily irradiance profile in seconds instead of hours. This is why the time-axis is in second.
Figure 11, Figure 12 and Figure 13 show the variations of irradiance (G) PV power (
Figure 15 shows the battery current variation (
Figure 14 and Figure 16 show the comparison of all our control methods described in the previous section (ANN-LM, ANN-BR, ANN-SCG and PI). To make this comparison, we have superposed the battery SoC as well as the variations of the battery current (
Figure 14 shows that the PI control discharges the battery more quickly and deeply than the ANN control (ANN-LM, ANN-BR, ANN-SCG). But in terms of charge, it’s the opposite. The battery controlled by an ANN controller charges more than if it was controlled by a conventional PI controller. It can also be that in discharge mode, the PI control presents some oscillations which are probably be due to an instability. It should also be noted that the charge and discharge are progressive in the case of an ANN control while they are brutal in the case of a PI control. So, it can be concluded that ANN control is better than conventional PI control because the battery does not display brutal charge-discharge and deep discharge.
Still Figure 14 shows that the results of the two controllers ANN-BR and ANN-SCG are similar. Indeed, their curves are almost merged. It can also be seen that these two controllers (ANN-BR and ANN-SCG) allow faster charging than the ANN-LM controller. But the ANN-LM controller presents the best compromise of charging and discharging speed. Moreover, we must choose the controller that stresses the battery the least. Therefore, the ANN-LM controller is better in terms of fixed objective than the ANN-BR and ANN-SCG controllers.
Figure 16 indicates that the battery current variation is progressive in the case of the ANN control (ANN-LM , ANN-BR and ANN-SCG) while it is brutal in the case of the PI control (Cf. Figure 16a). We can also observe good behavior of system transients in the case of an ANN control, which is very interesting insofar as the battery is less stressed with an ANN control and consequently it contributes to extending its lifetime. Moreover, Figure 16a shows that the battery charging time is very limited in the case of a PI control. This means that the battery continues to supply the DC load despite the presence of
Still with the objective of comparing the performance of the four controllers (ANN-LM, ANN-BR, ANN-SCG and PI), we zoomed in on the transient regimes at the start of the simulation. This situation is shown in Figure 16b. We notice that the current overshoot (current peak) in transient regimes is more important in the case of the PI control than in the worst case of the ANN control (ANN-SCG). Indeed, we note in Figure 16b that in terms of current overshoot in transient regimes, PI control is worse than ANN-SCG control, ANN-SCG control is worse than ANN-BR control and ANN-BR is worse than ANN-LM control. So again, the best controller (the best algorithm) is the ANN-LM controller. In the case where the system is controlled with an PI control, the current peak in transient regimes at the start of the simulation is equal to 41.14 A. This current peak is reduced to 30.56 A in the best case of the ANN control (ANN-LM) i.e., a reduction of 26%. We can therefore conclude that the ANN-LM control improves the performance of the system in transient regimes, it does not stress the battery too much, it respects the technological constraints of the battery and thus improves its lifetime. This is relevant in the context of French Guiana where the equipment is not designed to be used in a severe tropical climate and therefore deteriorates rapidly.
The main purpose of this study was to design an optimal control to better control the PV-Battery microgrid to be used in the context of use in French Guiana to help improve battery lifetime.
For this, an ANN-based MPPT algorithm was first designed and applied for PV source control. The simulation result showed that the developed ANN-based MPPT algorithm worked well.
Then, to control the battery, two configurations (method1 and method2) of the ANN controller based on the feed-forward backpropagation neural network (FFBNN) associated with a Levenberg–Marquardt (LM) algorithm were designed. For each configuration, an optimal number of hidden layers was obtained. The comparison between method1 and method2 made it possible to identify the best configuration (method1) which was retained in this work.
Then, to compare the LM algorithm with other algorithms, the same model trained with the LM algorithm was tested (under the same conditions) with two other algorithms: Bayesian regularization (BR) and scaled conjugate gradient (SCG) methods. Finally, a comparison was made between the different ANN controls on the one hand and between the best ANN control and the conventional PI control on the other hand. Regarding the comparison between the three ANN controllers (ANN-LM, ANN-BR and ANN-SCG), it was shown that the two controllers (ANN-BR and ANN-SCG) are almost similar and that the best ANN controller is the ANN-LM controller which better improved the performance in transient regimes. This ANN-LM controller also allowed a reduction in peak current of 26% compared to conventional PI control.
Moreover, the ANN-LM control allowed optimal control of the battery. It improved transient regimes to better respect the technological constraints of the battery and thus extend its lifetime. This therefore reduced the overall operating cost of the system.
The authors declare no conflict of interest.
Written by
Article Type: Research Paper
Date of acceptance: April 2024
Date of publication: May 2024
DOI: 10.5772/acrt.34
Copyright: The Author(s), Licensee IntechOpen, License: CC BY 4.0
© The Author(s) 2024. Licensee IntechOpen. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and reproduction in any medium, provided the original work is properly cited.
Impact of this article
222
Downloads
159
Views
1
Altmetric Score
Join us today!
Submit your Article