# Online Gradient Descent for Grid Regulated Power Point Tracking Under a
Highly Fluctuating Weather and Load

Muhy Eddin Za’ter  Electrical Engineering Department
University of Colorado Boulder
Boulder, Colorado
<EMAIL_ADDRESS>Sandy Yacoub Miguel  IEEE Student
Princess Sumaya University for Technology
Amman, Jordan
<EMAIL_ADDRESS>Majd Ghazi Batarseh  Electrical Engineering
Department
Princess Sumaya University for Technology
Amman, Jordan
<EMAIL_ADDRESS>
###### Abstract

The heavy reliance on Photovoltaic (PV) systems to meet the increasing
electricity demand cost-effectively imposes new challenges on researchers and
developers to guarantee the operation at maximum power point (MPP) under all
conditions. However, the increasing penetration of renewable energy into the
grid creates additional difficulties for the grid operators, which requires
the limitation and flexibility of the energy contribution from those renewable
resources to a specific grid-regulated threshold for stability and reliability
purposes. All of these technical and operational issues gave rise to the need
for a Maximum Power Point Tracker (MPPT) in order to maximize the power
extraction from the needed renewable sources, on the one hand, and Flexible
Power Point Trackers (FPPT) in order to meet the grid constraints due to the
added PV sources, on another. Nevertheless, the MPP is a weather-dependent
parameter and the tracking of which is governed by a convergence speed faster
than the dynamic change of irradiance, hence the need for online techniques.
The work in this document attempts to address this shortcoming by utilizing
online gradient algorithms for this purpose. Numerical analysis and
verification are presented hereunder, while the code of the algorithms can be
found at this link.

###### Index Terms:

Flexible Power Point Tracking, Maximum Power Point, Photovoltaic Systems,
Online Gradient Descent.

##  I Introduction

Due to the rapidly increasing economies and businesses, in addition to the
need for grid decarbonization to avoid the catastrophic consequences of
climate change, renewable energy resources have witnessed a dramatic expansion
in the power-generating sector. Solar energy grew faster than other renewable
energy sources, owing to its availability and minimized environmental effects.
In addition, due to the reduced cost of photovoltaic (PV) panels, the growth
rate of installation of PV power plants (PVs) is rapidly increasing around the
globe [1, 2].

The essential issue for both utility and residential PV owners is maximizing
their revenue, which depends on cost and efficiency. Thus it is necessary to
maximize the extracted power. However, the maximum power that can be extracted
from the PV is a function of irradiance, temperature, and load; therefore, the
maximum operating power differs with time and is unique. The variation in
irradiance, temperature, or load changes the voltage at which maximum power
transfer occurs, hence the need for an algorithm that continuously tracks the
maximum power point and operates the system at this point. These algorithms
are known as Maximum Power Point Trackers (MPPT) [3, 4], in which a DC-DC
converter is implemented with a control scheme that continuously updates the
duty cycle in order to match the PV source resistance to the load resistance,
as seen by the source.

However, the increased penetration of renewable energy into the grid and power
network poses new operational challenges that are primarily related to the
stability and reliability of the power system. Therefore, new constraints and
operational regulations are being implemented to fulfill the future’s grid
stability and power quality requirements. In order to address the operational
challenges and limit the power injected from the PV into the grid, a new
concept known as Flexible Power Point Tracking (FPPT) is presented. Figure 1
[5] depicts how the power extracted from the PV is adjusted to a flexible
power point that is regulated with grid constraints. Several algorithms to
track the FPPT are being developed, each with its advantages and
disadvantages. One is a fast and reliable approach that takes a few iterations
to find a local maximum for a given I-V curve, known as the Online Projected
Gradient Descent (OPGD). This paper proposes using the OPGD technique for
micro-inverter-based topology, as shown in Figure 2 [6].

Figure 1: Maximum and Flexible power point tracking in PVs (MPP -Maximum power
point FPP - Flexible power point) [5]

The rest of the document is divided as follows: section II lists related work
and the need for an online algorithm to solve the problem of FPPT. Section III
illustrates the problem formulation, whereas section IV presents how OPGD
tracks the flexible power point. Section V lays out the simulation setup and
the results. Finally, section VI presents the conclusion and practical
implications of this work.

Figure 2: AC modules (micro-inverter) topology [6]

##  II Time-Varying Constraints and Related Work

###  II-A Time-Varying Constraints

Depending on the level of penetration from inverter-based resources and the
stability and reliability of the grid, countries have various regulations and
standards for the operation of PV systems under different conditions. Each
operational constraint imposes different constraints that vary with time,
weather conditions, load, and other operational factors. The operational
constraints are as follows [5, 7]:

  1. 1.

MPPT control zone (unconstrained): MPPT operation is implemented here, in
which there are no operational constraints. The purpose of the algorithm in
this zone is to extract the maximum available power from the PVs.

  2. 2.

Power reserve constraint (delta power constraint): A delta power constraint is
used to limit the active power from a PV to a desired constant value in
proportion to the maximum available power. This operational zone is vital as a
regulating reserve.

  3. 3.

Ramp rate constraint: A ramp rate constraint is used to limit the power ramp
rate by which the active power can be changed

  4. 4.

Power limiting control (absolute power constraint): An absolute power
constraint is typically used to protect the power system against overload in
critical situations.

###  II-B Related Work and The Need For Online Optimization

The maximum Power point tracking domain is older and hence more extensively
explored than Flexible Power Point Tracking (FPPT). Therefore, to prove that
FPP and MPP tracking need online optimization, MPPT literature will be
considered as it is richer and better documented. There are numerous MPPT
algorithms; each has its strengths and drawbacks. However, the majority of the
literature only tests these algorithms under rapidly changing weather
conditions (mainly irradiance) and only focuses on accuracy and convergence
time. It is worth mentioning that irradiance variability is around
$80\mathrm{~{}W}/\mathrm{m}^{2}$ in less than 2 seconds [8], [9] and varies
more with larger time steps. An $80\mathrm{~{}W}/\mathrm{m}^{2}$ change can
contribute to a $6\%$ loss in the power extracted if the operational point
remains unchanged. In addition to the weather, the load is continuously
changing, affecting the optimal operation point. The algorithms in literature
usually consume more time to converge to the maximum power point, which is
summarized in Table 1[10]:

TABLE I: T HE PERFORMANCE OF ALGORITHMS IN TERMS ON CONVERGENCE SPEED Algorithm |  | Best
---
Convergence
| Worst
---
Convergence
Fuzzy Logic Controller (FLC) [11] | 2.4 sec | 5.4 sec
Particle Swarm Optimization (PSO) [12] | 6.59 sec | 9.69 sec
Switched Photovoltaic [13] | 11.6 sec | 16.8 sec
Artificial Bee Colony (ABC) [14] | 5.01 sec | 5.63 sec

Therefore, as can be noted from Table 1, since the convergence time is less
than the time it takes for the environmental conditions to change, there is a
pressing need for an online algorithm.

##  III Problem Formulation

As aforementioned, FPPT aims to regulate the overall maximum power extracted
from the PV modules under different grid, load, and operational constraints.
However, the maximum power is continuously affected by the irradiance and
temperature. In contrast, the flexible power is governed by the operational
constraints and load, which affect the regulated maximum operation point of
the PV. In this work, partial shading conditions are not studied as they have
no significant impact under the micro-inverter topology adopted in Figure 2.

The power extracted from a PV is given by equation (1):

$P_{pv}=V*I_{L}-V*I_{o}*e^{\frac{V}{V_{t}}}$ (1)

Where $V$ is the PV voltage, $I_{L}$ is the light-generated current, $I_{o}$
is the saturation current, and $V_{t}$ is the thermal voltage. The light-
generated current is a function of irradiance. In contrast, the thermal
voltage $V_{t}$ varies with the module temperature, which changes the power
extracted and the required voltage $V$ to operate at the maximum power point.

For this work, in order to treat the problem as a minimization instead of a
maximization problem, the power will be multiplied by $-1$. The flow of
analysis is inspired by the work in [15]

###  III-A Preliminaries

Let $N:=\\{1,2,\ldots\\}$ and $N_{0}:=N\cup\\{0\\}$. In this problem, $F$ is
considered the overall power in which $F:=\left\\{f_{t}:R^{n}\mid k\in\right.$
$\left.N_{0}\right\\}$ represents a family of continuous functions and where
$X:=\left\\{X_{t}\subset R^{n}\mid t\in N_{0}\right\\}$ are closed, non-empty
sets that capture the possible time-varying constraints, and where $n$
represents the number of PV modules that are connected to the grid. The
algorithm is required to generate solutions to the following sequence of
optimization problems as in equation $(2)$, using iteration of the form shown
in equation (3):

$\min_{x\in X_{t}}f_{t}(x)$ (2)

$x_{t+1}=G_{t}\left(x_{t}\right)$ (3)

Where the operator $G_{t}:R^{n}\rightarrow R$ uses first-order information and
knowledge of the feasible set $X_{t}$ at the current time step.

In this work, uniform irradiance across the PV panels is assumed. Hence, it is
safe to say that attention is restricted to families of locally smooth,
strongly convex functions with Lipschitz gradient and convex constraints, and
hence the following assumptions:

Theorem 1 (Smoothness): Every $f\in F$ is twice continuously differentiable.
This indicates that the power is an exponential function that is known to be
smooth and is not globally Lipschitz continuous

Theorem 2 (Uniform strong convexity): It is well documented and known in the
literature that a PV under uniform irradiance has one unique maximizer
(minimzer) and, therefore, is strongly convex.

Assumption 1 (Convex Constraints): Every $X\in X$ is closed, convex and non-
empty.

This work employs the online projected gradient descent algorithm to solve the
problem presented in equation (2), which applies a specific choice for $G_{t}$
that is shown in equation (3). Under assumption 1, $f_{t}$ is guaranteed to
have a unique global minimizer over $X_{t}$.

###  III-B Metrics

In this work, The following metrics will be used to evaluate the performance
of the algorithm:

  1. 1.

Tracking Error: $\left\|x_{t}-x_{t}^{*}\right\|$, which represents the
difference between the estimated voltage and the actual voltage at MPP.

  2. 2.

Instantaneous regret$f_{t}\left(x_{t}\right)-f_{t}\left(x_{t}^{*}\right)$
which represents the difference between the output power and the maximum
available power at time $t$ and hence it represents the power lost. In the
context of FPPT, the instantaneous power is greater than zero.

  3. 3.

Average Dynamic
Regret$\sum_{t=1}^{T}f_{t}\left(x_{t}\right)-\sum_{t=1}^{T}f_{t}\left(x_{t}^{*}\right)$
which represents the average power between the algorithms resulting output
power and the maximum power available. It is useful to compute the dynamic
regret as if multiplied by the operational time, representing the overall
energy loss; therefore, it is important to compute the dynamic regret.

  4. 4.

Static Regret: $\sum_{t=1}^{T}f_{t}\left(x_{t}\right)-\min_{x\in
X}\sum_{t=1}^{T}f_{t}\left(x_{t}^{*}\right)$ Since there exists a tracking
algorithm that is called constant voltage which fixes the operational voltage
at a specific value and does not change it. Therefore it is important to
compute the static regret.

The instantaneous regret is defined as in equation (4):

$\phi_{t}=f_{t}\left(x_{t}\right)-f_{t}\left(x_{t}^{*}\right)$ (4)

###  III-C Unconstrained Case

First of all, bounds for the unconstrained case (MPPT control) are considered.
The guarantee that $\nabla f_{t}\left(x_{t}^{*}\right)=0$ when $X_{t}=R^{n}$
leads to the inequality in (5):

$f_{t}\left(x_{t}\right)-f_{t}\left(x_{t}^{*}\right)\leq\frac{L}{2}e_{t}^{2}$
(5)

Consequently, instantaneous regret is bounded as following when
$\alpha=\frac{2}{L+\mu}$ which is the value used to minimze the upper bound,
then:

$lim_{t\rightarrow\infty}\phi_{t}\leq\frac{LV^{2}(L+\mu)^{2}}{8\mu^{2}}$ (6)

###  III-D Constrained Case

The previous error bounds apply equally well to constrained and unconstrained
problems. However, the presence of constraints means that extra consideration
should be considered. The bounds in the previous subsection do not apply as
the minima does not have to be a stationary point.

Finite time feasibility: the following assumption of finite time feasibility
guarantees the feasibility of the projected gradient descent as follows:

$\left\|x_{t+1}-x_{t}^{*}\right\|\leq D$ (7)

Where $D<+\infty$

Bounds on the temporal variability:

$\left\|x_{t+1}^{*}-x_{t}^{*}\right\|\leq\frac{V}{\mu}$ (8)

Proof: To show the computation of the bound, starting from (derived in the
previous problem):

$\left\|x_{t}-x_{t}^{*}\right\|\leq\left\|x_{t}-x_{t-1}^{*}\right\|+\left\|x_{t-1}^{*}-x_{t}^{*}\right\|$
(9)

Where $f_{t}$ is strongly convex with $\mu$.

Now substituting $x=x_{t+1}^{*}$ and using the fact that $\nabla
f_{t+1}\left(x_{t+1}*\right)=0$ and adding it to the above, the equation
becomes:

$\left\|\nabla f_{t+1}\left(x_{t+1}^{*}\right)-\nabla
f_{t}\left(x_{t+1}^{*}\right)\right\|\geq\mu\left\|x_{t+1}^{*}-x_{t}^{*}\right\|\
\ \ \ \ (10)$

And assuming that:

$\left\|\nabla f_{t+1}\left(x_{t+1}^{*}\right)-\nabla
f_{t}\left(x_{t+1}^{*}\right)\right\|\leq V$ (10)

Then the bound is:

$\left\|x_{t+1}^{*}-x_{t}^{*}\right\|\leq\frac{1}{\mu}\left\|\nabla
f_{t+1}\left(x_{t+1}^{*}\right)-\nabla
f_{t}\left(x_{t+1}^{*}\right)\right\|\leq\frac{V}{\mu}$ (11)

Uniform Lipschitz cost for such $G\geq 0$, there exists: For the pair $F,X$
there exists $G>0$ where

$\|\nabla f_{t}(x)\|\ \leq G$ (12)

##  IV ALGORITHMS

This section presents the algorithms that attempted to solve the FPPT problem
explained earlier.

###  IV-A Proposed Online Algorithm

This work proposes using the online optimization method, Online Projected
Gradient Descent (OPGD). First, the sensors in the system take different
relative measurements at each time; irradiance, temperature, and load-related
values. As in (1), the power equation can be calculated with sufficient
measurements. Thus, the gradient for the voltage can be calculated to get the
optimal operating voltage. Finally, the DC-DC converter’s duty cycle is
calculated according to the optimal value that equalizes the load resistance
as seen by the source resistance to the source resistance and thus achieving
maximum power transfer. Figure 3 illustrates the flow of the algorithm. Online
projected gradient descent will be executed with a constant step size of
$\alpha=\frac{2}{10}$.

Figure 3: Online projected gradient descent algorithm flow

###  IV-B Perturb and Observe

Perturb and Observe (P&O) is the most popular and widely used tracking
algorithm for PV systems due to its relatively good accuracy, ease of
implementation, and being PV module independent. This work compares the
performance of online gradient descent to the widely used P&O as a benchmark.

##  V Simulation Results and Discussion

This section presents the simulation setup and associated simulation results.

###  V-A Simulation Setup

MATLAB Simulink is used as a simulation tool to build the following system
configuration shown in figure 4.

Figure 4: Maximum (flexible) Power Point block diagram

It is worth mentioning that for flexible power point tracking, the same
controller will be used but with constraints on the operating conditions and
thus has the same block diagram as above.

Table 2 summarizes the characteristics of the PV modules used.

TABLE II: PV MODULES CHARACTERISTICS PV Characteristic | Value
---|---
Number of modules | 8
Open Circuit Voltage | 36.3 V
Short Circuit Current | 7.84 A
MPP Voltage at STC | 29.2 V
MPP current at STC | 7.3 A
Maximum Power at STC | 213.15 W

Finally, the algorithms were tested under a highly fluctuating irradiance to
test their ability to track the optimal operating point. The code and
simulation files are available at this link.

###  V-B Simulation Results

####  V-B1 Unconstrained Case:

Figures 5 and 6 below show the plots of the tracking and instantaneous errors
respectively for the online gradient descent algorithm (the P&O graphs for
clarity). Each time t is a 0.1 second step.

Figure 5: Instantaneous error - Unconstrained case

Figure 6: Tracking error - Unconstrained case

For further evaluation and comparison, the average dynamic regret and static
regret are calculated for both the online gradient descent and P&O. For static
regret, the operating voltage was simply fixed at 29 V. Table 3 presents the
results for each algorithm. The dynamic regret shown is at the end of the
simulation (at time T).

TABLE III: OGD AND P&O COMPARISON FOR THE UNCONSTRAINED CASE Metric | OGD | P&O
---|---|---
Average Dynamic Regret | 54.67 | 67.3
Static Regret | 51.36 | 55.3

####  V-B2 Constrained Case

As aforementioned, sometimes the grid imposes some operational challenges that
require some actions from the PV controllers, such as solar curtailment, power
control, or over-voltage protection, which in turn imposes constraints on the
PV controllers. In the two constrained cases, the operational mode is varied
between the MPPT case (unconstrained), over-voltage protection, and active
power control. Figures 7 and 8 below show the plots of the tracking and
instantaneous errors, respectively, for the online gradient descent algorithm
in the unconstrained case. Each time t is a 0.1-second step.

Figure 7: Instantaneous error - Constrained case

Figure 8: Tracking error - Constrained case

Similar to the unconstrained case, the average dynamic and static regrets are
calculated and compared against the P&O as shown in table 4. In the case of
static regret, if the fixed operating voltage is above the constraint, it is
reduced to the allowed value. The dynamic regret shown is at the end of the
simulation (at time T).

TABLE IV: OGD AND P&O COMPARISON FOR THE CONSTRAINED CASE Metric | OGD | P&O
---|---|---
Average Dynamic Regret | 61.363 | 72.4
Static Regret | 55.1 | 57.41

##  VI Conclusion and Practical Implications

As there are 8 PV modules, with each module able to generate 213.15 W under
Standard Test Conditions (STC) (1000 W/m 2 irradiance and 25 C temperature).
The average loss of power for OGD for the unconstrained case is 54.7 W and
61.36 for the constrained case. The P&O algorithm performance was relatively
worse, achieving 67.3 W and 72.4 W loss of power in the unconstrained and
constrained cases, respectively. However, in the span of time, the energy
yielded from the OGD will be considerably higher than the energy harvested by
the P&O. Also, it has been noticed that when the sudden change in irradiance
or load is high, the P&O performance becomes significantly worse, as it has to
search for the MPP, which is usually much further from the original operating
point. On the other hand, OGD is not affected by the variability in
irradiance, as it calculates the required duty cycle and operating voltage
rather than searching for it, Therefore, the OGD is better at placing the FPP
under extremely varying conditions.

## References

  * [1] B. Shen, F. Kahrl, and A. J. Satchwell, “Facilitating power grid decarbonization with distributed energy resources: Lessons from the united states,” _Annual Review of Environment and Resources_ , vol. 46, pp. 349–375, 2021.
  * [2] I. Staffell and S. Pfenninger, “The increasing impact of weather on electricity supply and demand,” _Energy_ , vol. 145, pp. 65–78, 2018.
  * [3] M. G. Batarseh and M. E. Za’ter, “Hybrid maximum power point tracking techniques: A comparative survey, suggested classification and uninvestigated combinations,” _Solar Energy_ , vol. 169, pp. 535–555, 2018.
  * [4] P. S. Khalane, D. A. Patil, and C. Remadevi, “Literature survey of various maximum power point tracking techniques for photovoltaic systems,” in _2017 International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT)_. IEEE, 2017, pp. 836–840.
  * [5] H. D. Tafti, G. Konstantinou, C. D. Townsend, G. G. Farivar, A. Sangwongwanich, Y. Yang, J. Pou, and F. Blaabjerg, “Extended functionalities of photovoltaic systems with flexible power point tracking: Recent advances,” _IEEE Transactions on Power Electronics_ , vol. 35, no. 9, pp. 9342–9356, 2020.
  * [6] K. Zeb, W. Uddin, M. A. Khan, Z. Ali, M. U. Ali, N. Christofides, and H. Kim, “A comprehensive review on inverter topologies and control strategies for grid connected photovoltaic system,” _Renewable and Sustainable Energy Reviews_ , vol. 94, pp. 1120–1141, 2018.
  * [7] Q. Peng, A. Sangwongwanich, Y. Yang, and F. Blaabjerg, “Grid-friendly power control for smart photovoltaic systems,” _Solar Energy_ , vol. 210, pp. 115–127, 2020.
  * [8] M. Lave and J. Kleissl, “Solar variability of four sites across the state of colorado,” _Renewable Energy_ , vol. 35, no. 12, pp. 2867–2873, 2010.
  * [9] H. Jain, M. Sengupta, A. Habte, and J. Tan, “Quantifying solar pv variability at multiple timescales for power systems studies,” in _2020 47th IEEE Photovoltaic Specialists Conference (PVSC)_. IEEE, 2020, pp. 0180–0185.
  * [10] R. Bradai, R. Boukenoui, A. Kheldoun, H. Salhi, M. Ghanes, J.-P. Barbot, and A. Mellit, “Experimental assessment of new fast mppt algorithm for pv systems under non-uniform irradiance conditions,” _Applied energy_ , vol. 199, pp. 416–429, 2017.
  * [11] B. N. Alajmi, K. H. Ahmed, S. J. Finney, and B. W. Williams, “A maximum power point tracking technique for partially shaded photovoltaic systems in microgrids,” _IEEE transactions on Industrial Electronics_ , vol. 60, no. 4, pp. 1596–1606, 2011.
  * [12] K. Lian, J. Jhang, and I. Tian, “A maximum power point tracking method based on perturb-and-observe combined with particle swarm optimization,” _IEEE journal of photovoltaics_ , vol. 4, no. 2, pp. 626–633, 2014.
  * [13] A. A. Elserougi, M. S. Diab, A. M. Massoud, A. S. Abdel-Khalik, and S. Ahmed, “A switched pv approach for extracted maximum power enhancement of pv arrays during partial shading,” _IEEE Transactions on Sustainable Energy_ , vol. 6, no. 3, pp. 767–772, 2015.
  * [14] K. Sundareswaran, P. Sankar, P. S. R. Nayak, S. P. Simon, and S. Palani, “Enhanced energy output from a pv system under partial shaded conditions through artificial bee colony,” _IEEE transactions on sustainable energy_ , vol. 6, no. 1, pp. 198–209, 2014.
  * [15] D. D. Selvaratnam, I. Shames, J. H. Manton, and M. Zamani, “Numerical optimisation of time-varying strongly convex functions subject to time-varying constraints,” in _2018 IEEE Conference on Decision and Control (CDC)_. IEEE, 2018, pp. 849–854.