## 1. Introduction

Photovoltaic (PV) energy sources are very promising due to several advantages over the conventional sources. PV sources provide clean, silent, friendly, naturally abundant and emissions-free energy to the installed systems [

1]. These systems can be implemented with different topologies and control methodologies. However, they can be mainly classified into two main categories, including standalone and grid connected applications [

2,

3]. In the standalone systems, a DC–DC converter is utilized between the PV source and the DC load for the purpose of maximum power point tracking (MPPT) [

4]. Actually, some systems use a direct coupling technique between the load and the source, but this method installs a lot of panels to provide the necessary energy to the load [

5]. Additionally, and because of the night hours, the storage element is mandatory in case of the standalone schemes [

6]. Batteries are a very common solution to this issue, but they require frequent replacement [

7], which increases the overall system cost, especially for low power applications. Thus, grid-connected topologies are preferred; they can be implemented by directly coupling the inverter to the grid without including the DC-DC converter stage [

8,

9]. Consequently, that is called the single stage topology. However, and due to the variable atmospheric conditions, the two stage inverter topology is very common [

10,

11]. The DC–DC converter stage provides regulation to the PV source voltage [

9,

12]. In fact, it boosts the voltage, and hence this widens the operating voltage range of the system. Furthermore, it separates the MPPT control strategy from active and reactive power inverter control. This greatly simplifies the overall control methodology and enhances the system stability [

13,

14].

In the DC–DC stage, the maximum power should be extracted from the PV source [

15]. The converter in this stage operates as a matching circuitry because of the nonlinear characteristics of the PV source and also elevates the PV voltage for proper grid connection [

16,

17]. Many MPPT techniques have been addressed in the literature [

18,

19,

20,

21]. Indeed, they differ from each other based on several factors, including methodology, efficiency, tracking speed, required sensors and cost [

18,

22,

23]. The most widespread techniques are perturb and observe (P&O) and incremental conductance (INC) [

24]. That is because of the simplicity of implementation. Further, they do not depend on the PV source or system parameters [

25]. Recently, and as a result of the continuous development of controllers (microprocessors), advanced techniques, such as the fuzzy logic controller, neural networks, model predictive control (MPC) and optimization techniques, have emerged into the light [

26,

27]. Optimization techniques or searching algorithms involving particle swarm optimization, genetic algorithm and simulated annealing [

28], are applied in nature for systems exposed to partial shading conditions caused by nearby buildings or trees, clouds or even smoke [

29]. As a result, the power-voltage (P–V) curve of the PV source exhibits several maxima, so the searching algorithm seeks the global maximum among them [

30,

31].

Through the inverter stage, the DC energy is converted to AC energy. Moreover, the control strategy in this stage relies on independent control of active and reactive power injected into the grid [

12,

26]. Several inverter control strategies are implemented in the literature. However, the most popular technique is the voltage oriented control (VOC) [

32]. In this method, two cascaded control loops are required. The outer loop (voltage loop), normally associated with the DC-link capacitor voltage, provides the direct axis component of current

$\left({I}_{d}\right)$ for the purpose of active power control. Alongside the quadrature axis component of the current

$\left({I}_{q}\right)$, this is usually set to zero to operate at a unity power factor conditions. These two components are feed to the inner current loop with a modulator to get the switching signals for the inverter [

32,

33]. For the sake of decoupling intentions and PI controller design simplicity, the VOC can be implemented with feed forward technique [

33,

34]. Another common algorithm is the direct power control (DPC) strategy; actually, in this technique the cascaded control methodology of the VOC is avoided [

35]. The inverter switching states are selected based on the instantaneous errors between the estimated and reference values of the active and reactive power, and the grid voltage vector position [

35,

36]. The DPC strategy is executed by means of hysteresis controller and lookup switching table [

36,

37], and hence there is no need for the modulator.

Recently, and over the past few years, predictive control has gotten more attention and become a very promising control scheme in various power electronics applications [

32,

38,

39]. It can be sorted into three prime branches incorporating the continuous control set, deadbeat and finite control set model predictive control (FCS-MPC) [

40]. Both the continuous control set and deadbeat model predictive control need a modulator at the output stage for switching state generation [

41]. However, FCS-MPC takes the advantage of limited number of switching actions related to the controlled converter and directly generates the optimal switching state. FCS-MPC can be simply performed by deriving the model of the system under study. Then, the discrete time model of the converter is developed. Further, the predicted control variable is differentiated from its reference value together with other conditions. Finally, the best switching action satisfying the aforementioned constraints will be enforced on the power switches [

41,

42,

43]. Obviously, the model of the system has a great effect on optimizing the FCS-MPC performance [

35,

40]. This opens the door for combining different observers with FCS-MPC to estimate the parameters of the model and enhance the robustness of the control strategy. Various studies have been carried out using such things as the model reference adaptive system (MRAS) [

44,

45], the Luenberger observer [

46], the disturbance observer [

47] and the extended Kalman filter (EKF) [

48]. However, these estimators can also be used for state estimation and hence sensorless control strategies [

49]. Presently, limited work is done in this area, and that motivated the authors to go after this control strategy, particularly for PV grid connected systems.

In this paper, a two-stage, grid-connected PV system is proposed with an optimized control strategy considering high MPPT efficiency for the boost converter and high robustness for the two-level inverter scheme. Firstly, the maximum power is extracted from the PV source by a new direct switching MPPT algorithm. For investigation, the proposed methodology is compared with the FCS-MPC MPPT [

50], which is designed with one step in the horizon, and the cost function is adopted based on the current. Secondly, a modified FCS-MPC is developed to control the inverter, wherein only three iterations are required to initiate the optimum voltage vector, unlike the case of the conventional FCS-MPC, wherein seven iterations are essential. This considerably decreases the required computation time. Further, to enhance the system’s reliability and robustness, and even eliminate the FCS-MPC dependency on the parameters of the scheme, an EKF is employed to monitor and observe the parameters for the objective of online correction of potential variations. Finally, the behavior of the system is validated with simulation results using Matlab under different operating conditions and compared with the conventional FCS-MPC algorithm.

The rest of this paper is organized as follows.

Section 2 presents the mathematical model of the PV source, boost converter and proposed MPPT.

Section 3 describes the conventional and the proposed FCS-MPC algorithms for controlling the two-level inverter. The extended Kalman filter design is explained in

Section 4. Finally, simulation results are illustrated in

Section 5.

## 4. Design of the Proposed Extended Kalman Filter

Extended Kalman filter is a powerful tool for states’ and parameters’ estimation. A great advantage of EKF is its filtering capability and noise rejection [

61]. It is designed based on the nonlinear discrete-time model of the system [

48,

61]. Obviously, FCS-MPC depends also on the discrete model of the system, so EKF and FCS-MPC fit very well together. In fact, and as mentioned previously, the FCS-MPC depends on the system parameters. Hence, a major concern is selecting an inaccurate sector and a more incorrect voltage vector, if these parameters are subjected to change. A main contribution of this paper is to eliminate the FCS-MPC dependency on the parameters of the system by estimating the values of the RL filter; i.e., the filter resistance and inductance by means of EKF. In reality, the filter parameters are exposed to variation due to aging, heat or saturation.

To implement the EKF, the discrete time nonlinear state space model of the grid connected inverter can be derived by rearranging Equation (

17) as

Thus, the model of the grid-connected inverter including disturbance can be written as

where

x = [

${i}_{\alpha}$ ${i}_{\beta}$ ${R}_{f}$ ${L}_{f}$ ]

${}^{T}$ is the state vector,

u = [(

${v}_{\alpha}$-

${u}_{\alpha}$) (

${v}_{\beta}$-

${u}_{\beta}$)]

${}^{T}$ is the input,

y = [

${i}_{\alpha}$ ${i}_{\beta}$ ]

${}^{T}$ is the measurement,

w is the system uncertainty with covariance matrix

$\mathbf{Q}$ and

v is the measurement noise with covariance matrix

$\mathbf{R}$. Further,

$\mathbf{A}$,

$\mathbf{B}$,

$\mathbf{C}$ and

$\mathbf{D}$ are the inverter system matrices, and based on Equation (

28) they are defined as

Hence, the discrete model can be expressed as

where

${\mathbf{A}}_{d}=\mathbf{I}+\mathbf{A}{T}_{s}$,

${\mathbf{B}}_{d}=\mathbf{B}{T}_{s}$,

${\mathbf{C}}_{d}=\mathbf{C}$,

${\mathbf{D}}_{d}=\mathbf{D}$ and

$\mathbf{I}$ is the identity matrix. Normally, the system uncertainty and measurement noise are not known, so the EKF is implemented as follows:

where

$\mathbf{K}\left(k\right)$ is the Kalman gain,

$\widehat{x}\left(k\right)$ and

$\widehat{y}\left(k\right)$ are the estimated quantities. Finally, the Kalman filter can be implemented through two stages of prediction and correction, following this procedure:

## 5. Simulation Results and Discussion

The proposed PV system is shown in

Figure 11. It consists of a PV array of

$15$ kW (15 series × 5 parallel), followed by a boost converter, where the MPPT function is accomplished by FCS-MPC and the direct switching technique. The FCS-MPC generates the switching state for the boost converter to follow the reference current coming from outer-side loop developed by the P&O technique. The switching state (0 or 1) identified by the cost function (

g) will be enforced to the power switch in the boost circuit. In the proposed MPPT, the switching state is generated directly. Then, the extracted power from the PV source is fed to the two-level inverter. The two-level inverter has two control loops for the purpose of active and reactive power control. The first and outer loop is achieved by PI controller to stabilize the DC-link capacitor voltage at its reference value (

${v}_{dcref}$) and to provide the reference current (

${i}_{dref}$) to the inner loop, where

${i}_{qref}$ is set to zero for unity power factor operation. In this study, the inner current loop is realized by the conventional and the proposed FCS-MPC technique. In the conventional one, the predicted currents is calculated and then the voltage vector (out of seven) corresponding to the minimum cost function (

${g}_{i}$) will be selected. It is obvious that to get this optimal vector, 14 iterations (seven for the currents, and seven for the cost function) are required in the inner loop. This in turn increases the computational burden. However, in the proposed FCS-MPC technique, the RVV is computed to narrow the calculation range from six sectors to only one sector. This greatly reduces the computation time as only three computations of the cost function (

${g}_{m}$) are required in the specified sector. Furthermore, and to avoid the potential variation in the parameters of the grid connected inverter, an EKF is employed to estimate and correct these values online. The parameters of the PV grid connected system are summed up in

Table 2.

The simulation results are divided to two subsections under different atmospheric conditions and parameter variations, where the performance of the proposed scheme is compared with the conventional FCS-MPC as follows:

#### 5.1. MPPT and System Behavior under Different Radiation Conditions

Figure 12 and

Figure 13 show the behavior of the proposed MPPT and the conventional one. The results are performed at different radiation conditions ranging from

$400\text{}\mathrm{W}/{\mathrm{m}}^{2}$ to

$1000\text{}\mathrm{W}/{\mathrm{m}}^{2}$. It is clear that the proposed MPPT has a very fast transient behavior in comparison with the conventional FCS-MPC. As there is no need for current prediction computation in the proposed algorithm, the calculation time is highly reduced. The tracking speed of the proposed direct switching method is

$0.5$ $\mathrm{m}\mathrm{s}$, while it is

$1.6$ $\mathrm{m}\mathrm{s}$ for the conventional MPPT. Besides, the average switching frequency for the direct switching technique is

$4.42$ kHz, while the conventional technique has a higher average switching frequency of

$4.85$ kHz.

The performance of the inverter control using the conventional and the proposed FCS-MPC with EKF is investigated at the previous radiation conditions, and shown in

Figure 14, where the DC-link voltage (

${v}_{dc}$), the active power injected into the gird (

P), reactive power (

Q), the direct axis current (

${i}_{d}$), the quadrature axis current (

${i}_{q}$) and the

$abc$ currents are illustrated respectively. The DC-link voltage tracks its reference value with a very low overshoot of

$1.5$% for both of the conventional and the proposed techniques. The active power behavior is similar in the two methods. However, the reactive power has a lower ripple content in the proposed strategy due to the enhanced tracking of

${i}_{q}$, as clarified in

Figure 15.

Furthermore, the total harmonic distortion (THD) of the proposed approach is better than the conventional one, despite of the lower average switching frequency of the proposed FCS-MPC. A comparative summary is provided in

Table 3. Another merit of the proposed technique with EKF is eliminating the prior need of knowledge of the system parameters.

Figure 16 shows the estimated filter parameters for the same previous atmospheric conditions. The EKF provides a very fast and accurate online monitoring for the filter inductance (

${L}_{f}$) with a maximum error of

$1.7$%. However, the filter resistance (

${R}_{f}$) estimation is relatively slower than the inductance estimation at the beginning of the simulation, but the estimation is very precise with a maximum error of

$0.8$%.

#### 5.2. System Performance with Parameter Variations

In this subsection, the effects of parameter variations on the conventional and the proposed FCS-MPC are investigated. The atmospheric conditions for this test are kept constant at 800 W/m

${}^{2}$ and

$25\text{}{}^{\xb0}\mathrm{C}$.

Figure 17 shows the PV power, voltage and current, respectively. The results of the conventional FCS-MPC MPPT exhibit higher ripples compared with the proposed MPPT in all the waveforms, where the proposed MPPT shows an increased average power extraction, and hence higher energy gain.

Table 4 presents the energy calculation for the two MPPT techniques within a one day (10 h) period. The difference (saving) between the two methods is about 228 kWh; this amount is calculated through the simulation interval (0.3 s).

Figure 18 illustrates the DC-link voltage, the active power injected into the gird, reactive power, the d-axis current, the difference between the actual d-axis current and its reference value, the q-axis current and the

$abc$ currents at different step changes of the filter resistance, respectively. In the first interval, the filter resistance is kept constant at its nominal value

${R}_{f}=0.25$ $\Omega $; after that the resistance is decreased to the half of its nominal value i.e.,

$\Delta {R}_{f}=-50\%$, finally it is increased by

$+50\%$. Filter resistance change affects the steady state error between

${i}_{d}$ and

${i}_{dref}$, which is obvious at the last interval (0.2–0.3

$\mathrm{s}$) of

${i}_{d}$, where

${i}_{d}$ is deviated from its reference, unlike the proposed method. This error is further examined in

Figure 19 for better observation. However, the effect of resistance change on the THD of the currents is small. Moreover, the estimated values of the filter resistance and inductance are presented in

Figure 20, where the EKF provides a very efficient estimation for both of them.

Figure 21 shows the DC-link voltage, the active power injected into the gird, reactive power, the d-axis current, the q-axis current and the

$abc$ currents at different step changes of the filter inductance, where the inductance is changed with a mismatch of

$\pm 50\%$, respectively. As a matter of fact, it is not strange that the performances of the conventional and the proposed FCS-MPC are enhanced with

$+50\%$ mismatch in the filter inductance, as shown in the second interval (0.1–0.2

$\mathrm{s}$); this due to the filtering capability of the inductor. However, this increase affects the steady state error of

${i}_{q}$ in the same interval, as shown in

Figure 22, and hence the steady state error of the reactive power. Referring to

Figure 22, it was found that the steady state error of the conventional FCS-MPC is about 75 (VAR), which is approximately three times the steady state error of the proposed FCS-MPC with 25 (VAR). Underestimating the filter inductance (the third interval) deteriorates the behavior of the conventional FCS-MPC, where the

$abc$ currents is greatly distorted. Furthermore, the injected active power exhibits very high ripples. In contrast, the proposed technique with EKF sustains a very good performance with reasonable active power ripples. Thanks to the accurate estimation provided by the EKF as revealed in

Figure 23. Furthermore,

Table 5 gives a comparative evaluation of the two techniques concerning the THD, where the proposed methodology has superior performance, especially when the inductance is underestimated (6

$\mathrm{m}\mathrm{H}$). The difference between the THD of the two techniques with this condition is approximately

$5\%$, where the conventional FCS-MPC exceeds the IEEE standards [

62].

The EKF is not only parameter estimation tool; it also has a filtering capability. To prove that, a current noise shown in

Figure 24 is added to the

$\alpha $$\beta $ currents. The estimated currents exhibit a very good refined waveform in comparison with the noisy currents, as revealed in

Figure 24.