Keywords

1 Introduction

A majority of residential complexes nowadays include renewable energy resources in integration with a grid of low voltage which are connected to individual receivers in association with a dedicated transmission and distribution network. Therefore, the optimal utilization of renewable energy sources (RES) is gradually becoming a matter of extreme importance so that the increased energy consumption demands can be met and the usage of fossil fuel can be restricted. Taking into notice the variety of RES, each with its own set of boon and bane, one of the major drawbacks of various forms of RES is the uncertainty or fluctuations in the energy generation process which can lead to wearing and tearing of electrical components [1].

Solar photovoltaic (PV) is an influential technology where the PV process of energy generation is completely silent due to absence of movable parts and the energy from the sunlight is directly converted into electrical energy. The PV technology can be used either as an autonomous system in itself or a grid-tied system. In an autonomous system, there is a requirement of battery bank for storage purposes which is sufficient for a low-voltage system but in this scenario of the grid-tied-type system, the extra energy is directly transferred to the grid for external use or other useful purposes. The PV energy generation is highly dependent on quantities like temperature and solar irradiance [1]. Due to various factors, the most challenging hurdle for PV is the irregularities faced during energy generation which has led to its incapability to contest in today’s market and this has further led to limit in their use for large-scale grid operations.

The difficulty of uncertain and irregular power generated by RES can be solved with the help of a grid-tied system with smart management system. A grid-tied RES system is a type of an electrical system in which one or more than one renewable energy resources are used in association with a storage device and an electric grid. In a global scenario, a country’s energy grid network is deliberated similar to a hybrid PV system. Numerous literary articles present a concept of handling a hybrid, autonomous, and grid-tied system with a storage device [2, 3], with use of energy management (EM) and optimization in real-time scenario [1, 4].

This paper suggests the employment of PSO-based fuzzy algorithm for MPPT control to draw out the maximum power that is available at the PV terminals in a grid-tied RES electrical system. In [3, 5], the authors present the concept of smart power extraction for an autonomous PV system, where MATLAB and Simulink were used to create a model for the same, whereas in [2, 6], the authors present an AI-based demand-side management structure for the autonomous PV system. Hence, the primary goal of this paper is implementation and literary overview of the AI optimization via PSO-based fuzzy algorithm in a grid-tied PV system and the use of the optimization method explained as “PSO Fuzzy” for the purpose of balancing irregularities on the generation side of the system and consumption side of the system.

The paper entails five different sections. The effects, use, and advantages of grid-tied system and fuzzy logic and PSO are concisely elucidated in Sect. 2 of this paper. The mathematical modeling of the suggested algorithm for EM is proposed in Sect. 3. Section 4 provides the data for the concurrent testing outcomes, while Sect. 5 comprises of the conclusion of the paper.

2 Grid-Tied PV System

In the current scenario, the grid-tied PV systems consist of a PV array connected to a storage device which is further connected to the local grid which can be utilized for transferring power to the local residential facilities surrounding the test site by trading it directly to the electricity provider in that particular region. Various components that comprise the grid-tied system like the PV panel and the DC-DC boost converter are further explained (Fig. 1).

Fig. 1
figure 1

Grid-tied solar photovoltaic-based system

2.1 PV Panel

The equivalent model for the PV array is shown in Fig. 2, which shows a p-n semiconductor junction, that is essentially the building block of a solar cell [7, 8]. The voltage and current equation for the solar cell for the model presented in Fig. 2 is as follows:

$$I_{{{\text{sa}}}} = I_{{\text{s}}} - I_{{\text{o}}} \times \left\{ {{\text{e}}^{{\left( {\frac{{V_{{{\text{sa}}}} + R_{{\text{s}}} I_{{{\text{sa}}}} }}{{mV_{{\text{T}}} }}} \right)}} - 1} \right\} - \frac{{V_{{\text{s}}} + R_{{\text{s}}} I_{{{\text{sa}}}} }}{{R_{{{\text{sh}}}} }}$$
(1)
Fig. 2
figure 2

Equivalent model for a PV cell

here the model comprises of \(I_{{\text{S}}}\) and \(V_{{\text{S}}}\) is the current and voltage of the source, respectively, a diode and a resistance \(R_{{\text{s}}}\), the shunt resistance \(R_{{{\text{sh}}}}\), the diode current \(I_{{\text{o}}}\) (dependent on temperature), \(V_{{{\text{Sa}}}}\) and \(I_{{{\text{Sa}}}}\) are the voltage and current being fed to the DC-DC boost converter, m is the ideal factor (ideally m = 1, real m > 1) and \(V_{{\text{T}}}\) is the thermal potential which is characterized as:

$$V_{{\text{T}}} = \frac{KT}{q}$$
(2)

T is the temperature in Kelvin, K signifies Boltzmann constant (K = 1.38 × 10−23 J/K), and q is electrical charge of an electron (q = 1.6 × 10−19 C). The net voltage \(V_{{{\text{Sa}}}}\) and the net current \(I_{{{\text{Sa}}}}\) are given by the following formulae:

$$I_{{{\text{sa}}}} = I_{{\text{s}}} - I_{{\text{D}}}$$
(3)

Taking into consideration of Fig. 2, it is possible to determine the I-V characteristics of the PV array with N cells in series and M cells in parallel.

$$V_{{{\text{sa}}}} = \varphi \times V_{{\text{T}}} \times \ln \left\{ {\frac{{I_{{\text{s}}} - I_{{{\text{sa}}}} }}{{M \times I_{{\text{O}}} }} + 1} \right\} - R_{{\text{s}}} I_{{{\text{sa}}}}$$
(4)

where

$$\varphi = M \times N$$
(5)

The real solar cell in simple terms can be described by the elementary parameter of the open-circuit voltage and short-circuit current Isc which correlates to the voltage drop across the diode when it is traversed by the diode current ID which are mentioned in Eqs. (1), (2), (3), (4), and (5). At the test site, M = 2 and N = 2.

2.2 DC-DC Boost Converter

The dynamic model for the DC-DC boost converter displayed in Fig. 3 can be expressed in terms of current and voltage between output and input as follows:

$$\left[ {\begin{array}{*{20}c} {\frac{{{\text{d}}i_{L} }}{{{\text{d}}t}}} \\ {\frac{{{\text{d}}V_{{{\text{bus}}}} }}{{{\text{d}}t}}} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 0 & { - \frac{1 - D}{L}} \\ {\frac{1 - D}{C}} & {\frac{ - 1}{{RC}}} \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{L} } \\ {V_{{{\text{bus}}}} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} \frac{1}{L} \\ 0 \\ \end{array} } \right] \cdot V_{{{\text{in}}}}$$
(6)
Fig. 3
figure 3

Simplified DC-DC boost converter

where Is is the infused current in the boost converter, L is inductance, and C is capacitance as seen in Fig. 3, D signifies the duty cycle, VBus is voltage across the bus bar and Vin is input voltage. The values of the electrical parameter (L and C) is assumed to be high enough so that the switching device chosen has a smooth current (due to L) and smooth output voltage (due to C).

3 Mathematical Model and Flowchart

3.1 Fuzzy Logic for MPPT Controller

Fuzzy logic can be defined as a Boolean logic with further bifurcations in order to take into account a real-time scenario which cannot be represented by normal Boolean logic. The actualization of fuzzy controllers is done in three stages: fuzzification, inference, and defuzzification, respectively [9, 10]. The suggested fuzzy algorithm has been given two inputs (change of error and error) and a single output (duty cycle for the converter). The equations for the two inputs are as follows:

$$E_{n} \left( K \right) = \frac{{P_{{\text{S}}} \left( {K + 1} \right) - P_{{\text{S}}} \left( K \right)}}{{V_{{\text{S}}} \left( {K + 1} \right) - V_{{\text{S}}} \left( K \right)}}$$
(7)
$${\text{d}}E_{n} \left( K \right) = E\left( {K + 1} \right) - E\left( K \right)$$
(8)

where the instantaneous power of the solar generator is Ps, the instantaneous voltage of the solar generator is Vs, En(K) is the error and dEn(K) is the change in error input parameter. The output parameter of duty cycle D is given as:

$${\text{d}}D = \frac{{\mathop \sum \nolimits_{i = 1}^{n} \mu \left( {D_{i} } \right) - D_{i} }}{{\mathop \sum \nolimits_{i = 1}^{n} \mu \left( {D_{i} } \right)}}$$
(9)

Due to the presence of a single output, Mamdani method for fuzzy logic inference is preferred as well as the defuzzification process employs the center of gravity approach to determine the value of duty cycle D (the output in this scenario) which is computed from Eq. (9). There are various methods for automatic tracking of MPPT. However, fuzzy logic is very convenient to operate upon and is significantly robust than its peers, hence fuzzy logic was used.

The fuzzy inference rules table is given in Table 1 while the membership function graph for the input En/dEn and output dD is represented in Fig. 4 [11].

Table 1 Fuzzy inference rule table
Fig. 4
figure 4

Membership function for input En/dEn and output dD

3.2 Particle Swarm Optimization

Developed by Kennedy and Eberhart in 1995 [10], PSO is an evolutionary technique used for computation. It is highly efficient for problems related to optimization, specifically related to multiple dimensions, non-differentiable and nonlinear-related problems [11]. N particles are considered in a search space D for the purpose of minimization of the objective function f. Every particle is initialized with a value of position and velocity which can be calculated by the following equations.

$$v_{i,j}^{k + 1} = w\left\{ {v_{i,j}^{k} + c_{1} {\text{rand}}_{1} \left( {x_{{{\text{pbest}},i,j}}^{k} - x_{i,j}^{k} } \right) + c_{2} {\text{rand}}_{2} \left( {x_{{{\text{gbest}},j}}^{k} - x_{i,j}^{k} } \right)} \right\}$$
(10)
$$x_{i,j}^{k + 1} = x_{1,j}^{k} + v_{i,j}^{k + 1}$$
(11)
$$w = \frac{2}{{\left| {2 - C - \sqrt {C^{2} - 4C} } \right|}}$$
(12)
$$C = C_{1} + C_{2}$$
(13)

where xi is the position vector, vi is the position vector, xpbest,i is the local best position vector, xgbest is the global best position vector, rand1 and rand2 are random constants between [0, 1] which are evenly distributed after each update in velocity, c1 and c2 are the positive learning rate constants between (0, 2.05], [12] w is the constriction factor, D is the search space, and j is a number where j ∈ {1, …, D}. The values of xpbest,i and xgbest are computed after every iteration by the following equations:

$$x_{{{\text{Pbest}},i}}^{k + 1} = \left\{ {\begin{array}{*{20}l} {x_{{{\text{pbest}},i}}^{k} } \hfill & {{\text{if}}\,f\left( {x_{i}^{k + 1} } \right) \ge x_{{{\text{pbest}},i}}^{k} } \hfill \\ {x_{i}^{k} } \hfill & {{\text{otherwise}}} \hfill \\ \end{array} } \right.$$
(14)
$$x_{{{\text{gbest}}}}^{k + 1} = \min_{{{\text{pbest}},i}} f\left( {x_{{{\text{pbest}},i}}^{k + 1} } \right),\quad 1 \le i \le N$$
(15)

After every iteration, the value of k is restricted between [xmin, xmax], in the case of violation in values of the limits as specified the following equation forces the proper values into place [10].

$$x_{i} = \left\{ {\begin{array}{*{20}l} {x_{\min } } \hfill & {{\text{if}}\,x_{i} < x_{\min } } \hfill \\ {x_{i} } \hfill & {{\text{if}}\,x_{\min } < x_{i} < x_{\max } } \hfill \\ {x_{\max } } \hfill & {{\text{if}}\,x_{i} > x_{\max } } \hfill \\ \end{array} } \right.$$
(16)

When such changes in the position vector are implemented then the ith particle is forced to hunt for its global best and its local best, i.e., xgbest and xpbest,i respectively (Fig. 5).

Fig. 5
figure 5

Algorithm for PSO

3.3 Fuzzy PSO Tuning

The practical application of the fuzzy controller logic in real-time scenario is only plausible when the parameter of the controller is properly regulated. Additionally, a risk is involved by early allocation of a randomly selected parameter which can lead to instability in the system. Therefore, during the time of simulation as well as during practical application, a close to real model of the grid-tied PV system is absolutely necessary for the successful completion of the procedure. Hence, the design for the fuzzy tuning before going online is presented in Fig. 1, where the controllers P1, P2, P3, \(K_{E_{n}}\), \(K_{{\text{d}}E_{n}}\) and KdD are used for the purpose of minimizing the fitness function whose equation is as follows:

$$f\left( k \right) = \mathop \sum \limits_{i = 1}^{N} \left| {e\left( i \right)} \right|$$
(17)
$$e\left( i \right) = P_{\max } - P_{{\text{s}}}$$
(18)

where \(f\left( k \right)\) is the fitness function, the maximum power for the solar generator is Pmax, total amount of samples is N, k is iterations. For the initial population, the regulated parameter set is distributed according to the limits as follows for every particle.

$$0.01 < P_{1} ,P_{2} ,P_{3} < 1\,\,{\text{and}}\,\,0.001 < K_{E_{n}} ,\,K_{{{\text{d}}E_{n}}} ,\,K_{{{\text{d}}D}} < 100$$
(19)

4 Results and Discussion

The implementation of the PSO-based fuzzy algorithm is performed on a PC in Python, while the simulations were performed on the MATLAB/Simulink system. The scheduled timeline for simulation data, as well as for practical implementation, was of 15 days from mid-December 2019 to January 2020. The simulation and practical applications were carried out in irradiance level changing from 120 to 500 W/m2. The grid-tied PV system is optimized with c1 = c2 = 2.05 and starting with a population size of 40 particles with 40 iterations using PSO-based fuzzy algorithm. The PV panel rating (for 1000 W/m2, 25 °C) is given in Table 2. The data received after the PSO-based fuzzy process successful implementation is shown in Table 3. The graphs of irradiance (in W/m2), temperature (in °C), power and current from the PV generator of the PSO-based fuzzy algorithm for MPPT control for the grid-tied PV system are displayed in Figs. 6, 7, 8, and 9, respectively. The graphs for PV power and current are the values of 1 out of the 4 panels installed at the test site whereas Table 2 contains the data for all of the 4 panels (M = 2 and N = 2 as seen in Eq. (5)).

Table 2 Specifications of solar PV module (PM-0250 photon energy systems)
Table 3 Data after successful implementation (all the 4 modules)
Fig. 6
figure 6

Graph of solar irradiance (W/m2) in the scheduled period

Fig. 7
figure 7

Graph of temperature (in °C) in the scheduled period

Fig. 8
figure 8

Graph for photovoltaic generator power in the scheduled period (1 of the 4 modules)

Fig. 9
figure 9

Graph for photovoltaic generator current in the scheduled period (1 of the 4 modules)

5 Conclusion

In this paper, a PSO-based fuzzy algorithm was used for the purpose of MPPT control to draw out the maximum power that is available at the PV terminals of a grid-tied PV system at the testing facility in Delhi with integration of a storage device as well as local electricity grid. The findings clearly state that the aim of smart control of MPPT in the partially shaded condition and optimization of generated and consumed data was successfully achieved. The simulation in MATLAB/Simulink and practical application via Python/MATLAB provides the verification about the capabilities of the proposed structure for SEM. The results of various MPPT algorithms vary drastically in a situation where partial shading is present and the PV module does not receive a uniform solar irradiance. Due to the partial shading, the PV characteristics for the complete PV array turn more complicated having numerous peaks. Hence, a necessity arises for efficient tracking for the global maximum point and the need for an improved MPPT algorithm. To overcome these challenges, the use of fuzzy PSO takes into account variables like irradiance and temperature (of cell) which assisted in MPPT even in partial shading conditions. This can be seen from extreme variations in irradiance and temperature values and its slight effect on generated and consumed energy. The data was received using a smart energy meter having functionality of automatic data logging at programmable interval of time. Form the observed partially shaded PV array, it can be easily stated that the power as well as current for the PV generator are not only dependent on irradiance and temperature but also dependent on array arrangement and pattern of shading. Furthermore, utilization of the same resource in a large-scale controller and system as well as integration into specified software library of the programming language (microgrid PSO Master Python library) is proposed.