1 Introduction

The penetration of renewable energy sources in power system is growing significantly [1]. The most commonly utilized renewable energy source is the hydro-power one. Wind energy comes in the second place and then the photovoltaic (PV) power. However, the construction rate of PV power is increasing rapidly. Thus, it is a matter of time till the PV power dominates the renewable energy market. Numerous reasons easify spreading the PV source of energy. For instant, the source of PV power is naturally abundant and universe (the sun), unlike hydro and wind power, which need specific site properties for installation [2]. That fast increase necessitates many grid codes’ updates to insure safe operation of the PV systems under different circumstances. Hence, stability and resilience of the PV system are getting more interest. However, the nonlinear behavior of the PV source coming from dependency on the atmospheric conditions (radiation and temperature) makes that task more challenging [3].

Among modern grid codes, constant power regulation is considered the most common technique alongside the maximum power point tracking (MPPT) operation [4]. For low power scale PV application, it is important to extract the maximum available power from the PV source at various atmospheric conditions, which is known as MPPT [5]. However, at high power levels, the MPPT operation is allowed if the PV power is lower than a certain threshold. If the power exceeds this value, the power will be limited and sustained at this level. This operation is known as constant power generation (CPG) [6]. The reason for that regulation is to limit the power variation, specially at fast-changing atmospheric conditions. Under these circumstances, if the MPPT is enabled, high power oscillations will occur. Thus, frequency deviations may happen due to the power change in a very short time [7].

Furthermore, flexible power regulation, which is desired for grid support, cannot be realized if the MPPT is enabled; thus, constant power generation algorithm can simplify different flexible power regulation schemes for new grid codes [4]. To be specific, PV systems are expected to support the grid frequency during any potential disturbances [8]. For example, for 50-Hz system, the PV source should produce the full capacity of the system if the operating frequency is within a predefined range (47 Hz to \(f_1\)), where \(f_1\) is larger than 47 Hz. For frequencies larger than this value (\(f_1\)), a reserved amount of PV power \((\Delta P)\) should be considered. The value of \(\Delta P\) is kept till the frequency rises to a certain value (normally larger than 50 Hz). If the frequency is still increasing, then the PV generator starts to decrease the produced power. The PV power production falls to zero and disconnected from the grid, if the frequency hits the maximum allowable operating frequency (52 Hz) [9].

The two-stage grid-connected PV system utilizes a boost converter in the first stage, where the control of the PV power production is accomplished in this stage. Furthermore, the boost converter increases the voltage of the PV side to appropriate voltage level for grid connection. Normally, the MPPT is executed at this level of control [10]. However, due to the variable nature of the PV power, an additional power regulation is included with the MPPT function. In the literature, the most popular techniques for MPPT extraction are perturb and observe (P&O) and incremental conductance (INC) methods [11]. However, both of them have a poor performance at fast-changing atmospheric conditions [12]. Soft computing methods are also addressed for MPPT to consider the partial shading conditions, where the power voltage (P–V) curve exhibits several maxima. Thus, the optimization technique is searching for the global one among them. Numerous techniques are utilized for such purpose, to mention a few, particle swarm optimization [13], genetic algorithms [14], simulated annealing method [15], ant colony technique [16], firefly algorithm [17], grey wolf optimization [18], and bat algorithm [19]. However, these methods suffer from high calculation burden and slow transient behavior inherited from their searching nature. Recently, constant power regulation is adopted in conjugation with the MPPT operation. This new regulation can be implemented using additional devices (storage elements) [9]. However, the most cost-effective procedure is to modify the MPPT algorithm [20].

The second stage of the two-stage system is the inversion stage, which is concerned with active and reactive power regulation. Popularly, the voltage-oriented control (VOC) and direct power control (DPC) are applied for such purpose. On the one side, the VOC relies on the cascaded structure of the voltage and current loops and its performance is mainly dependent on a proper tuning of the PI controllers. On the other side, the DPC avoids the cascaded structure of the VOC. However, it presents higher peak-to-peak ripples in the steady-state waveforms. More recently, predictive control techniques become competitive with the conventional controllers. They are simple to implement and straightforward. Furthermore, additional control objectives and constrains can be easily implemented and included in the quality function design [10, 21].

In the literature, some efforts have been made to limit the PV power combining the MPPT algorithm with the constant power concept. In [22], single-stage three-phase grid-connected system was introduced, where P&O method has been integrated with the constant power approach. In this method, an extra amount of voltage \((\Delta v)\) is added to the PV voltage to make the system operate at the right side of the maximum power point (MPP) due to the single-stage operation. A similar approach was used in [23]. However, two-stage configuration was utilized in this system. A proportional controller (P) was employed for both the MPPT and the CPG operations in [24], where the two-stage system is considered. However, the methodology exhibits high ripples at steady state; thus, an adaptive step is suggested in [20] to enhance the system’s performance. Furthermore, the operation of the system is restricted to the left side of the MPP to account for sudden drop of the atmospheric conditions, where the system may operate nearly to the open-circuit condition at such situation. Most of the studies in the area of CPG employ the conventional techniques like P&O or INC, which are known with their unsatisfactory performance at fast-changing atmospheric environment. Furthermore, drift can occur during these conditions, resulting in fluctuation of the injected power. Moreover, undesirable offset can happen at the DC-link [25].

Considering the aforementioned drawbacks, a modified drift-free MPPT technique is proposed in this paper. The proposed MPPT depends on a newly formulated reference voltage expression for the MPP location. This method is integrated with CPG concept for the two-stage grid-connected system. Furthermore, and to enhance the steady-state performance of the proposed control methodology, an adaptive step size is utilized. The DC-offset associated with the drift problem is totally solved using a new adaptive DC-link controller. The inverter control, to manage the active and reactive power injection, is adopted with the finite-set model predictive control (FS-MPC) technique. The proposed inverter control considers two control objectives for power management, which are current control and switching frequency minimization. The total harmonic distortion (THD) of the injected currents was used as a rule of judgment to tune the weighting factor included in the cost function design. The proposed methodology is compared with the conventional technique at various radiation conditions using simulation results.

The remainder of this paper is organized as follows: Section 2 introduces the model of the two-stage grid-connected PV system. Section 3 proposes the modified drift-free MPPT algorithm with the CPG approach. The adaptive DC-link with the inverter control using FS-MPC technique is investigated in Sect. 4. Section 5 presents the simulation results, and finally the paper is concluded in Sect. 6.

Fig. 1
figure 1

Topology of the single-diode model of the PV module

2 Model of the two-stage grid-connected PV system

2.1 PV source modeling

The single-diode model is commonly used in the literature to describe the behavior of the PV source due to its simplicity and accuracy. Therefore, the current–voltage (I–V) relation of the PV source shown in Figure 1 can be expressed as [10, 12]

$$\begin{aligned} i_\mathrm{pv} = i_\mathrm{ph} - i_o [ e^{(\frac{v_\mathrm{pv}+i_\mathrm{pv}R_\mathrm{s}}{nN_\mathrm{s}v_t})} -1] - \frac{v_\mathrm{pv}+i_\mathrm{pv}R_\mathrm{s}}{R_\mathrm{sh}}, \end{aligned}$$
(1)

where \(i_\mathrm{ph}\) is the photovoltaic current, n is the diode ideality factor, \(i_o\) is the saturation current of diode, \(R_\mathrm{s}\) is the module series resistance, \(R_\mathrm{sh}\) is the module shunt resistance, \(v_t=kT/q\) is the thermal voltage, \(N_\mathrm{s}\) is the number of series cells in the module, \(i_\mathrm{pv}\) is the output current, and \(v_\mathrm{pv}\) is the output voltage.

2.2 Boost converter modeling

Fig. 2
figure 2

Equivalent circuit of the boost converter when: a switch is OFF and b switch is ON

Generally, the state-space model of system can be written as [10]

$$\begin{aligned} \begin{array}{l} \dot{x} = {\mathbf{A}}x + {\mathbf{B}}u,\\ y = {\mathbf{C}}x + {\mathbf{D}}u, \end{array} \end{aligned}$$
(2)

where x is the state vector, u is the input value or vector, and y is the output. Furthermore, \({\mathbf{A}}\), \({\mathbf{B}}\), \({\mathbf{C}}\), and \({\mathbf{D}}\) are the system matrices.

The boost converter has two modes of operation specified by the switch condition (ON or OFF). Figure 2 shows the two states of the boost converter. Thus, when the switch is open, i.e.,  OFF, the behavior of the boost converter can be described as

$$\begin{aligned} \frac{{\text {d}}i_l}{{\text {d}}t}= \frac{1}{L} (v_\mathrm{pv}- v_\mathrm{dc}), \end{aligned}$$
(3)

where \(i_l\) is the inductor current, L is the inductance value, and \(v_\mathrm{dc}\) is the output capacitor voltage (DC-link).

$$\begin{aligned} \frac{{\text {d}}v_\mathrm{dc}}{{\text {d}}t}= \frac{1}{c_\mathrm{dc}} (i_{l}- i_{inv}), \end{aligned}$$
(4)

where \(c_\mathrm{dc}\) is the DC-link capacitance, and \(i_{inv}\) is the output current. Furthermore, when the switch is ON (closed), the converter performance can be described as

$$\begin{aligned} \frac{{\text {d}}i_l}{{\text {d}}t}= & {} \frac{1}{L} v_\mathrm{pv}, \end{aligned}$$
(5)
$$\begin{aligned} \frac{{\text {d}}v_{{\text {d}}c}}{{\text {d}}t}= & {} -\frac{1}{c_\mathrm{dc}} i_{inv}. \end{aligned}$$
(6)

As a conclusion, the full model of the boost converter can be summarized by

$$\begin{aligned} {\mathbf{A}} = \begin{bmatrix} 0&{}\quad { -\frac{1-d}{L}}\\ { \frac{1-d}{c_\mathrm{dc}}}&{}\quad 0 \end{bmatrix}, {\mathbf{B}} = \begin{bmatrix} {\frac{1}{L}}&{}\quad 0\\ 0&{}\quad {-\frac{1}{c_\mathrm{dc}}} \end{bmatrix}, {\mathbf{C}} = \begin{bmatrix} 0&\quad 1 \end{bmatrix}, {\mathbf{D}} = 0,\nonumber \\ \end{aligned}$$
(7)

where d is the duty cycle, x= [\(i_{l}\) \(v_\mathrm{dc}\)]\(^{\mathrm{{T}}}\), u = [\(v_\mathrm{pv}\) \(i_{inv}\)]\(^{\mathrm{{T}}}\), and \(y=v_\mathrm{dc}\).

2.3 Model of the two-level inverter with grid integration

The configuration of the grid-connected inverter is shown in Figure 3, where a two-level inverter is connected to the grid via an RL filter. The response of this part of the system can be determined from

$$\begin{aligned} v_{abc} = u_{abc}+L_\mathrm{f} \frac{{\text {d}}i_{abc}}{{\text {d}}t}+R_\mathrm{f} i_{abc}, \end{aligned}$$
(8)

where \(v_{abc}\) are the voltages of grid side, \(i_{abc}\) are the line currents, \(u_{abc}\) are the inverter-side voltages, \(L_\mathrm{f}\) is the filter inductance, and \(R_\mathrm{f}\) is the filter resistance. Furthermore, the output voltages of the inverter are deduced as [26]

$$\begin{aligned} u_{abc} = \frac{1}{3} v_\mathrm{dc} T_{abc} S_{abc}, \end{aligned}$$
(9)

where \(S_{abc}\) is the switching states of the two-level inverter, and \(T_{abc}\) is the transformation matrix, which can be expressed as

$$\begin{aligned} T_{abc} = \begin{bmatrix} 2&{}\quad -1&{}\quad -1\\ -1&{}\quad 2&{}\quad -1\\ -1&{}\quad -1&{}\quad 2 \end{bmatrix}. \end{aligned}$$
(10)

In the rotating reference frame (\(d-q\)), Eq. (8) can be rewritten as

$$\begin{aligned} \begin{array}{l} v_d = u_d+L_\mathrm{f}\frac{{\text {d}}i_d}{{\text {d}}t}+R_\mathrm{f} i_d- \omega L_\mathrm{f} i_q,\\ v_q = u_q+L_\mathrm{f}\frac{{\text {d}}i_q}{{\text {d}}t}+R_\mathrm{f} i_q+ \omega L_\mathrm{f} i_d,\ \end{array} \end{aligned}$$
(11)

where \(v_{dq}\) are the dq components of the abc voltages, \(i_{dq}\) are the line currents in dq reference frame, and \(\omega \) is the angular frequency of the grid. Furthermore, the active and reactive powers are obtained as:

$$\begin{aligned} \begin{array}{l} P= \frac{3}{2} (v_{d} i_{d} + v_{q} i_{q} ),\\ Q= \frac{3}{2} (v_{q} i_{d} - v_{d} i_{q} ).\ \end{array} \end{aligned}$$
(12)
Fig. 3
figure 3

Two-level inverter interfaced with the grid using RL filter

3 Modified drift-free MPPT algorithm with constant power generation

The proposed drift-free MPPT depends on the model of the PV source, whereas an expression for the MPP location is pursued in this part of study. Several studies have tried to allocate the locus of the MPPs. In [27, 28], linear and cubic equations were introduced based on the curve-fitting procedure. Logarithmic function was suggested in [21, 29,30,31]. However, up to date, there is no straightforward derivation for the locus of the MPP. Considering this gap in the literature, an analogy between the open circuit point and the MPP is used in this work to investigate the effect of both the temperature and radiation on the MPP’s location. It is worth mentioning that the location of the MPP depends on the atmospheric conditions (temperature and radiation). In [31], the radiation effect is only considered, while the temperature effect is only regarded in [32, 33]. However, the current study is considering both of them.

It should be mentioned that the open-circuit point is intentionally used here due to the simple calculation at this point. The effect of the radiation and temperature on this point will be investigated, and using the similarity principle, the effect of these conditions will be transferred to the MPP. Firstly, to examine the radiation effect, at open-circuit condition (\(i_\mathrm{pv}=0\), \(v_\mathrm{pv}=v_\mathrm{oc}\)), the behavior of the PV source (the circuit shown in Fig. 1) can be formulated as

$$\begin{aligned} 0 = i_\mathrm{ph} - i_o \left[ e^{\left( \frac{v_\mathrm{oc}}{nN_\mathrm{s}v_t}\right) } -1\right] - \frac{v_\mathrm{oc}}{R_\mathrm{sh}}. \end{aligned}$$
(13)

Normally, the value of \(R_\mathrm{sh}\) is high; thus, neglecting the current flowing into this resistance, Eq. (13) can be further simplified to

$$\begin{aligned} i_\mathrm{ph} = i_o \left[ e^{\left( \frac{v_\mathrm{oc}}{nN_\mathrm{s}v_t}\right) } -1\right] . \end{aligned}$$
(14)

Solving Eq. (14) for \(v_\mathrm{oc}\), the following yields

$$\begin{aligned} v_\mathrm{oc} = n N_\mathrm{s} v_t {} \ln \left( \frac{I_\mathrm{ph}+i_o}{i_o}\right) . \end{aligned}$$
(15)

The value of the saturation current of the diode \(i_o\) (in the numerator) can be neglected with respect to \(i_\mathrm{ph}\); thus, Equation (15) can be further simplified to

$$\begin{aligned} v_\mathrm{oc} = n N_\mathrm{s} v_t {} \ln \left( \frac{I_\mathrm{ph}}{i_o}\right) . \end{aligned}$$
(16)

The previous equation is valid at the standard test condition (STC), i.e.,  \({25}^{\circ }{\hbox {C}}\), \({1000}{\hbox { W}/\hbox {m}^{2}}\). As we now considering the radiation effect, i.e.,  that temperature is constant. Therefore, taking another operating point, similar formula can be written

$$\begin{aligned} v_\mathrm{ocn} = n N_\mathrm{s} v_t {} \ln \left( \frac{I_\mathrm{phn}}{i_o}\right) , \end{aligned}$$
(17)

where \(v_\mathrm{ocn}\) is the open-circuit voltage at the new radiation level, and \(I_\mathrm{phn}\) is the corresponding photovoltaic current. As \(v_t\) and \(i_o\) are mainly dependent on the temperature, hence, their values will not be updated. Subtracting Eq. (16) from (17), the open-circuit voltage in comparison with another one can be derived as

$$\begin{aligned} v_\mathrm{ocn}= v_\mathrm{oc}+ n N_\mathrm{s} v_t \left[ \ln \left( \frac{I_\mathrm{phn}}{I_\mathrm{ph}}\right) \right] . \end{aligned}$$
(18)

The photovoltaic current is proportional to the radiation (G) [34, 35]; thus, replacing the currents with the radiation results in

$$\begin{aligned} v_\mathrm{ocn}= v_\mathrm{oc}+ n N_\mathrm{s} v_t \left[ \ln \left( \frac{G_{2}}{G_{1}}\right) \right] , \end{aligned}$$
(19)

where \(G_1\) is the radiation at STC, and \(G_2\) is the new radiation value. Figure 4 shows the power–voltage (P–V) curve of the PV module (KC200GT module) at different radiation conditions. It is clearly obvious that the open-circuit points have a logarithmic relation among each other, where the spacing among these points is small at high radiation conditions. However, the spacing becomes relatively high at low radiation conditions.

Fig. 4
figure 4

P–V characteristics at numerous radiation values

Fig. 5
figure 5

P–V characteristics at numerous temperature values

Fig. 6
figure 6

The proposed dual-mode power generation algorithm with adaptive step-size

Let us transfer the above observation to the MPPs as shown in Fig. 4. It is quite obvious that the decreasing (falling) manner of the MPPs is smaller than the open-circuit ones; thus, the natural logarithm (to the base e) in Eq. (19) is replaced with the common one (to the base 10), and hence, it can be rewritten as

$$\begin{aligned} v_\mathrm{mppn}= v_\mathrm{mpp}+ n N_\mathrm{s} v_t \left[ \log \left( \frac{G_{2}}{G_{1}}\right) \right] , \end{aligned}$$
(20)

where \(v_\mathrm{mppn}\) is the new MPP voltage at certain radiation level, and \(v_\mathrm{mpp}\) is the MPP voltage at STC.

Secondly, the effect of the temperature on the MPPs will be investigated. Figure 5 shows the P–V curve at various temperature conditions, where the open-circuit voltage variation range is linear. The same behavior applies also for the MPP voltage, and hence

$$\begin{aligned} v_{mppt}= v_\mathrm{mpp}+ k_v (T-T_n), \end{aligned}$$
(21)

where \(v_{mppt}\) is the modified MPP voltage due to temperature effect, \(k_v\) is the open-circuit voltage temperature constant, and \(T_n\) is the temperature at STC. Finally, and combining Eqs. (20) and (21), to get the impact of both radiation and temperature on the MPP voltage, the following can be deduced

$$\begin{aligned} v_\mathrm{mppl}= v_\mathrm{mpp}+ n N_\mathrm{s} v_t \left[ \log \left( \frac{G_{2}}{G_{1}}\right) \right] +k_v (T-T_n), \end{aligned}$$
(22)

where \(v_\mathrm{mppl}\) is the location of MPP voltage at any atmospheric condition. Further simplification can be subjected to Equation (22)

$$\begin{aligned} v_\mathrm{mppl}= & {} v_\mathrm{mpp}\left[ 1{+} \frac{n N_\mathrm{s} v_t}{v_\mathrm{mpp}} \left[ \log \left( \frac{G_{2}}{G_{1}}\right) \right] \right] {+}k_v (T{-}T_n), \end{aligned}$$
(23)
$$\begin{aligned} v_\mathrm{mppl}= & {} v_\mathrm{mpp}\left[ 1+ k {} \log \left( \frac{G_{2}}{G_{1}}\right) \right] +k_v (T-T_n), \end{aligned}$$
(24)

where \(k={n N_\mathrm{s} v_t}/{v_\mathrm{mpp}}\). It is quite interesting that k is written as a constant (0.0539) in many publications in the literature [21, 29,30,31], and it can be modified for better tuning of the MPP voltages. The reason is that the value of this constant is very small. Therefore, the temperature effect can be neglected. Moreover, the calculated value of this constant for the used PV module is 0.0708.

Fig. 7
figure 7

The proposed adaptive DC-link controller

So far, the MPP voltage locus is determined using the atmospheric conditions (G, T). As a next step, the PV voltage of the installed array is sensed with the atmospheric conditions. Then, the error between the estimated voltage from Eq. (24) and the sensed one is adjusted adopting adaptive step-size as

$$\begin{aligned} \Delta d= N_1 {}|v_\mathrm{mppl}-v_\mathrm{pv}|, \end{aligned}$$
(25)

where \(\Delta d\) is the duty cycle change, and \(N_1\) is a factor to be calibrated. A similar approach to adjust the duty cycle of the converter at CPG condition can be employed as

$$\begin{aligned} \Delta d= N_2{} |P_\mathrm{pv}-P_\mathrm{ref}|, \end{aligned}$$
(26)

where \(P_\mathrm{ref}\) is the reference power limit, \(N_2\) is a factor to be regulated, and \(P_\mathrm{pv}\) is the output power of the PV source. The final algorithm for dual-mode power generation from the PV source is further illustrated in the flowchart shown in Fig. 6.

4 Control of the two-level inverter

4.1 FS-MPC principle and design

Table 1 PV grid-connected system parameters
Fig. 8
figure 8

Configuration of the proposed two-stage grid-connected system with CPG and adaptive DC-link control

The FS-MPC principle depends on the discrete-time model of the system. Therefore, such model is derived to control the active and reactive powers injected into the grid. Solving Eq. (11) for the current and applying the Euler method for discretization, one gets

$$\begin{aligned} i_d (k+1) = (1-\frac{T_\mathrm{s} R_\mathrm{f}}{L_\mathrm{f}}) i_d (k)+ \omega T_\mathrm{s} i_q+ \frac{T_\mathrm{s}}{L_\mathrm{f}}(v_d (k)-u_d (k)), \nonumber \\ i_q (k+1) = (1-\frac{T_\mathrm{s} R_\mathrm{f}}{L_\mathrm{f}}) i_q (k)- \omega T_\mathrm{s} i_d+ \frac{T_\mathrm{s}}{L_\mathrm{f}}(v_q (k)-u_q (k)). \end{aligned}$$
(27)

where \(T_\mathrm{s}\) is the sampling period. The two-level inverter has 8 switching vectors; hence, according to the cost function design, the best one will be selected. FS-MPC adds flexibility to the design of the cost function; thus, in this work the switching frequency minimization is added as a secondary control objective. Furthermore, the absolute function, which is known with stability issues [36], is replaced with the square function as follows

$$\begin{aligned} g= & {} [i_d (k+1)- i_{d\mathrm{ref}} (k+1)]^2+[i_q (k+1)- i_{q\mathrm{ref}} (k+1)]^2 \nonumber \\&+ \lambda \sum _{i=1}^{8}[S_i(k)-S(k-1)]^2, \end{aligned}$$
(28)

where S(k) is the current switching instant, \(S(k-1)\) is the previous one, and \(\lambda \) is the weighting factor. It is also recommended to use the square function when considering more than one control objective in the cost function design [37]. The predicted reference currents can be evaluated using linear extrapolation as [38]

$$\begin{aligned} \begin{array}{l} i_{d\mathrm{ref}}(k+1) = 2{}i_{d\mathrm{ref}}(k)- i_{d\mathrm{ref}}(k-1),\\ i_{q\mathrm{ref}}(k+1) = 2{}i_{q\mathrm{ref}}(k)- i_{q\mathrm{ref}}(k-1).\ \end{array} \end{aligned}$$
(29)

4.2 Adaptive DC-link voltage controller

Normally, the DC-link between the boost converter and the inverter is controlled using PI controller to provide the reference current for the inverter control loop. As mentioned previously, the behavior of the PI controller at rapidly changing atmospheric conditions is poor [25]. Furthermore, it has poor disturbance rejection capability [39]. Although in [25], a modification to the PI controller of the voltage loop is adopted to solve the drift occurrence in the single-stage topology, the DC-link in the two-stage system still suffers from offsets even if the drift problem is solved. This phenomenon is not well-documented in the literature in the area of PV systems. Therefore, a new adaptive DC-link controller is designed in this study to solve this problem. The adaptive step-size of the reference current for the inverter control loop can be evaluated as

$$\begin{aligned} \Delta i_{d\mathrm{ref}}= N_3{} |v_{\mathrm{dcref}}-v_\mathrm{dc}|, \end{aligned}$$
(30)

where \(N_3\) is a tuning factor, and \(v_{\mathrm{dcref}}\) is the reference value of the DC-link voltage. Figure 7 shows the updating procedure of the adaptive DC-link controller.

5 Simulation results and discussion

The proposed dual-mode power generation system utilizes a 15-kW PV array, which is followed by boost converter for MPPT with CPG. Furthermore, the boost converter increases the PV array voltage to a proper level for the grid connection. The outer PI controller at the DC-link is substituted with the adaptive DC-link controller. The two-level inverter manages the active and reactive power control as a main objective and reduces the switching frequency as a secondary purpose. This is accomplished using a modified cost function design for FS-MPC. Finally, the output of the two-level inverter is interfaced with the grid via RL filter. Table 1 summarizes the system components and control parameters, and Fig. 8 shows the whole configuration of the system.

5.1 Weighting factor tuning of the FS-MPC

Fig. 9
figure 9

THD of the injected currents versus the weighting factor

Fig. 10
figure 10

The behavior of dual-mode power operation under different step changes of radiation for: a the conventional P&O. b the proposed drift-free approach

The weighting factor (\(\lambda \)) included in the quality function should be adjusted properly, so as not to deteriorate the main objective of the inverter control (active and reactive power control). The THD of the currents is used to judge and tune the value of the weighting factor. Figure 9 shows the THD versus the weighting factor. It is obvious that the THD of the currents within the IEEE standard [40] when \(\lambda \) \(\le \) 0.7. However, to maintain the quality of the injected currents, a value of 0.1 is selected. It should be mentioned that the curve shown in Fig. 9 is drawn at low power level; thus, when the power exceeds this level, the THD will be further enhanced.

5.2 Performance of the dual-mode power generation algorithm under different atmospheric conditions

The performance of the proposed dual-mode power generation technique is investigated under different radiation profiles. For better evaluation, step changes, ramp variations, and sinusoidal ones are created and studied using MATLAB. The ramp profiles with different slopes are suggested by the European efficiency test [41] to assess the performance of the PV systems. Furthermore, the atmospheric conditions can follow a random pattern. Thus, and under fast-varying atmospheric conditions, the step changes are simple waveforms to judge the performance of the PV system. This necessitates to develop numerous profiles to describe the changing manner of the atmospheric conditions as near as possible.

Firstly, the performance of the proposed system under different step changes of radiation is investigated and compared with the conventional approach. The conventional approach is implemented using the P&O method in combination with the FS-MPC for inverter control. Figure 10 shows the behavior of the two-mode power operation with the traditional and the proposed algorithms, where the PV power (\(p_\mathrm{pv}\)), voltage (\(v_\mathrm{pv}\)), and current (\(i_\mathrm{pv}\)) are illustrated, respectively. The reference for the CPG mode is assumed to be 70% (about 10 kW for the utilized system) of the rated power according to the regulations adopted in Germany [4].

In Figure 10, and in the first two intervals, where the radiations equal 400 W/m\(^2\) and 600 W/m\(^2\), respectively, the MPPT is enabled and the algorithm tracks the maximum power. As the radiation increases in the following intervals, where the radiations are 800 W/m\(^2\) and 1000 W/m\(^2\), respectively, the CPG is activated. (The PV power exceeds the reference value.) Thus, the power is maintained at 10 kW. The proposed adaptive drift-free MPPT technique has a lower ripple content at steady state in comparison with the traditional P&O, and hence, the gained average power from the PV source increases. It is worth mentioning that the P&O is also designed with adaptive step-size [42]. Furthermore, in the power waveform, moderate overshoots exist when the system operates with the CPG, the reason is the abrupt step changes of radiation.

Fig. 11
figure 11

The behavior of dual-mode power operation under ramp profile of radiation for: a the conventional P&O and b the proposed drift-free approach

Fig. 12
figure 12

The behavior of dual-mode power operation under sinusoidal profile of radiation for: a the conventional P&O and b the proposed drift-free approach

Fig. 13
figure 13

The behavior of inverter control at step changes of radiation for: a the traditional FS-MPC and b the proposed FS-MPC with adaptive DC-link controller

Fig. 14
figure 14

The behavior of inverter control at ramp waveform of radiation for: a the traditional FS-MPC and b the proposed FS-MPC with adaptive DC-link controller

It might seem that the two algorithms have a similar behavior under step change of radiation. This proves the aforementioned claim that the step changes are simple to judge the performance of the MPPT and CPG approach. Thus, the behavior of the proposed system is further investigated at more complex and challenging profile like the ramp one. Figure 11 shows the PV power, voltage, and current waveforms, respectively. The P&O method is known with its unsatisfactory performance at gradual increase or decrease of the radiation [21]. This is very obvious from the PV voltage (\(v_\mathrm{pv}\)) in Fig. 11, where it exhibits a higher ripple. Furthermore, it shows a diverging behavior, which is known as the drift problem [21, 25, 34]. This phenomenon causes a significant power drop as shown after the end of CPG span, where the MPPT is expected to operate at the beginning of the descending interval of PV power. On the one hand, the PV voltage at this interval presents a constant behavior. However, the PV current is decreasing causing the same for the PV power. On the other hand, the PV voltage with proposed algorithm is tracking its locus, which leads to an elegant maximum power extraction. Furthermore, with the traditional P&O, the drift problem interferes with the CPG function causing higher ripples in the power as shown at the end of the CPG interval.

Table 2 Performance summary of the traditional and the proposed inverter control at different step changes of radiation
Fig. 15
figure 15

The behavior of inverter control at sinusoidal waveform of radiation for: a the traditional FS-MPC and b the proposed FS-MPC with adaptive DC-link controller

Figure 12 shows the same results but with sinusoidal radiation profile, where the drift problem is getting worse. The PV voltage presents an approximately constant value corresponding to the descending interval of the sinusoidal profile. Furthermore, the PV current is decreasing in this interval, and the power also is decreasing. At the ascending interval of the sinusoidal waveform, the PV voltage fluctuates in a wide range resulting in a significant drop in the PV power. (The PV power drops to 2.5 kW.) This causes the span of the CPG to be shortened with higher ripples in comparison with the suggested technique, where the transition between the MPPT and the CPG is very smooth without any drift.

Fig. 16
figure 16

The behavior of DC-link voltage with the proposed drift-free MPPT incorporating PI and adaptive DC-link controller for: a Ramp waveform of radiation and b sinusoidal waveform of radiation

Fig. 17
figure 17

The behavior of inverter control at different step changes of filter inductance for: a the traditional FS-MPC and b the proposed FS-MPC with adaptive DC-link controller

5.3 Investigation of the inverter control using FS-MPC and adaptive DC-link controller

Figure 13 presents the DC-link voltage (\(v_\mathrm{dc}\)), the active power (P) injected into the grid, reactive power (Q), the d-axis current (\(i_d\)), the q-axis current (\(i_q\)), and the abc currents (\(i_{abc}\)), respectively, at different step changes of radiation. The transient behavior of the proposed algorithm is very fast in comparison with the conventional one with PI controller, specially at the start-up. The reason behind that is the proposed adaptive DC-link controller, which utilizes a large step when the DC-link voltage is far from its reference (700 V), and a smaller one as the voltage approaches its reference. Furthermore, the overshoots are approximately negligible in comparison with the traditional PI. The injected active power and the d-axis current have a slower transient behavior inherited from the outer PI controller of the traditional scheme. The reactive power and the q-axis current have a higher oscillatory behavior in comparison with the proposed algorithm. Moreover, the total harmonic distortion (THD) of the abc currents for the proposed algorithm is enhanced despite the reduction in the average switching frequency by approximately 20% in comparison with the traditional one. Table 2 summarizes the comparison between the two algorithms.

Figure 14 shows the same results at ramp profile of radiation. For the conventional technique, the DC-link voltage exhibits undesirable offsets in conjunction with the ascending and descending power waveform, where the offset is positive at the increasing interval of power, and negative at the deceasing one. In contrast to the proposed adaptive DC-link controller, no offset can be observed. The active power and the d-axis current show a drop as a result of the drift in the P&O method. Furthermore, the ripple content in the reactive power and the q-axis current are improved with the proposed algorithm.

The system performance is further investigated at sinusoidal radiation waveform. The inverter results are shown in Fig. 15, where the DC-link voltage presents a random offset profile. However, it is still positive in accordance with the increasing power waveform and negative with the deceasing one. The high oscillatory behavior of the active power and the d-axis current is inherited from the MPPT due to the drift. This in turn affects the interval of the CPG algorithm. The reactive power and the q-axis current have higher ripples with the traditional method. Moreover, due to the drift, distorted currents are injected into the grid. On the other side, the proposed algorithm has an efficient MPPT and the dual-mode power generation is very smooth with lower ripples. Furthermore, the injected power into the grid is higher due to drift avoidance.

As mentioned previously, unlike the single stage [25], if the drift problem of the MPPT is solved, the DC-link voltage still exhibits unwanted offsets. This is further investigated in Fig. 16, where the drift-free MPPT with a PI controller for the DC-link is shown in the left-hand side of the figure. In the right one, the drift-free MPPT is utilized with the adaptive DC-link controller. The results show that the DC-link voltage is still having offsets when PI controller is used. The upper part of the figure is at ramp waveform of radiation, and the lower one is at sinusoidal profile. However, the adaptive DC-link controller (left-handed part) is offset-free.

5.4 Robustness assessment

In this subsection, the effect of the system’s parameters on the performance of the inverter control is investigated. The parameters of the system are the filter resistance and inductance. The impact of the resistance’s variation can be neglected [10]. However, the step changes of inductance are studied and shown in Fig. 17. The mismatch range is assumed to be \(\pm \,50\)%. For the traditional FS-MPC algorithm, the DC-link voltage has some offsets at low inductance values. Furthermore, the active power and the d-axis current have very notable fluctuations. On the other side, with the proposed algorithm, no offsets are observed. At low inductance values, the active power and the d-axis current have a reasonable ripple content. Also, the oscillation in the reactive power and the q-axis current with proposed methodology are lower. Furthermore, distorted abc currents are injected into the grid with the conventional FS-MPC.

6 Conclusion

In this article, the detailed model of the two-stage grid-connected PV system has been presented. The dual-mode power operation is developed by combining the MPPT and the CPG algorithms. The MPPT function is implemented using a modified drift-free method, where the location of the MPP is accurately tracked by a new formulation. The proposed formulation has taken the analogy between the open-circuit point and the MPP into consideration. In both of the MPPT and the CPG regions, an adaptive step-size is adopted to enhance the steady-state performance. The results have shown that the drift problem of P&O method has caused a significant power drop and oscillatory behavior. Furthermore, it has affected and interfered with the CPG algorithm. The inverter control has been accomplished using a FS-MPC algorithm with two objectives for the cost function design. Moreover, the outer PI controller is removed and replaced with a new adaptive DC-link controller to generate the reference current. That adaptive DC-link controller not only enhances the transient behavior but also removes the undesirable offsets at the DC-link side. Furthermore, it simplifies the overall control algorithm. Finally, the proposed methodology is more robust than the traditional FS-MPC against parameter variations.