Linear Quadratic Regulator and Fuzzy Control for Grid-Connected Photovoltaic Systems

: This work presents a control scheme to control a grid-connected single-phase photovoltaic (PV) system. The considered system has four 250 W solar panels, a non-inverting buck-boost DC-DC converter, and a DC-AC inverter with an inductor-capacitor-inductor (LCL) ﬁlter. The control system aims to track and operate at the maximum power point (MPP) of the PV panels, regulate the voltage of the DC link, and supply the grid with a unity power factor. To achieve these goals, the proposed control system consists of three parts: an MPP tracking controller module with a fuzzy-based modiﬁed incremental conductance (INC) algorithm, a DC-link voltage regulator with a hybrid fuzzy proportional-integral (PI) controller, and a current controller module using a linear quadratic regulator (LQR) for grid-connected power. Based on fuzzy control and an LQR, this work introduces a full control solution for grid-connected single-phase PV systems. The key novelty of this research is to analyze and prove that the newly proposed method is more successful in numerous aspects by comparing and evaluating previous and present control methods. The designed control system settles quickly, which is critical for output stability. In addition, as compared to the backstepping approach used in our past study, the LQR technique is more resistant to sudden changes and disturbances. Furthermore, the backstepping method produces a larger overshoot, which has a detrimental impact on efﬁciency. Simulation ﬁndings under various weather conditions were compared to theoretical ones to indicate that the system can deal with variations in weather parameters.


Introduction
Renewable energy is emerging as one of the main sources of energy for the future.The key reason for this is the depletion and pollution of fossil fuels.Renewable energy sources are available, clean, eco-friendly, and cost-effective.There are various types of renewable energy sources, of which solar and wind energy systems have become more and more popular in many countries.According to [1,2], harmonic resonances, which often occur in grid-connected wind power farms, cause negative effects on the power quality of the grid.
Nowadays, solar energy is widely used around the world and demonstrates impressive results.To effectively obtain electricity from solar energy, photovoltaic (PV) systems should be installed.The system efficiency is strongly affected by two major factors, as follow [3,4]: (a) Weather factors such as the temperature and solar radiation; (b) Hardware factors such as power electronic devices and system loads.
While the prior factor is uncontrollable, the second one depends on the designer, system operator and electric grid.To improve the efficiency of the power electronic parts, appropriate converter topologies together with efficient control schemes are required.From [5][6][7][8], there are two modes of operation for the PV systems, which are:

•
Management of several combined systems; • Regulation of each power stage or system.
Solving the second problem often requires the following tasks: • tracking the maximum power point (MPP); • minimizing the harmonics, which usually cause negative effects on the power grid and devices; • maintaining the DC-link voltage within a desired range; • keeping the unity power factor (PF) at the output of the filter [10].
One of the most important parts of this research is the MPP tracking part, which is mainly used to find and keep the output power of a PV panel at its maximum value [11][12][13].The MPP tracking (MPPT) technique can be divided into two main categories: the perturb and observe (PO) technique and the incremental conductance (INC) algorithm.The negative side of the PO algorithm is its high computational complexity, but it leads to high efficiency.It measures voltage and current values to periodically estimate the power of the solar panel and compares it with the previous power.If the power of the PV module has increased (dP/dV > 0), the system will start adjustments in that direction; otherwise, it will adjust in the opposite way.These operations continue until system finds the MPP.In fact, the technique depends on perturbations of the voltage, so if the perturbations are high, the speed of the technique is fast.The advantages of this method are simplicity without interest in the previous PV characteristics; however, the main drawback is that oscillations happening near the MPP, which may lead to power losses in varying weather conditions [10].The INC type is more advantageous in terms of accuracy in finding and tracking the MPP compared to the second type; therefore, in this paper, the INC algorithm is improved by fuzzy control and then implemented in the grid-connected PV system.
Considering current controller strategies, generally, they can be divided into two main categories: on/off controllers and pulse width modulation (PWM)-based control techniques [14].The first group has two subdivisions, which are hysteresis control and predictive control.Hysteresis control has high dynamics and fast response; however, its major drawbacks are variations of the switching frequency and high complexity of the system.Predictive control has positive sides such as less computation time, better regulation, and a decrease in offset error.On the other hand, it requires identifying a proper model for the system and the installation cost of the system is high.The second group can be divided into linear and non-linear control [14].Proportional-integral (PI) controller and its different update versions such as multiple generalized integral (MGI) [15] and Manta Ray Foraging Optimization [16] control are the well-known classical control techniques, along with their improved versions, which can be easily designed to control the current.However, the key disadvantage of this controller is its poor compensation of lower-order harmonics and presence of steady-state errors [17].The proportional-resonant (PR) controlled can compensate for the harmonics.Moreover, this type of controller has high dynamics, is less complex, and can reach a high gain at the resonance frequency.However, this controller has problems reaching the power factor control, which means that the system is not able to control the losses in the system [18].
Generally, the power factor is a ratio between working power and apparent power.Thus, if there is no control/maintenance of a high-power factor, the system efficiency is consequently low.On the other hand, predictive deadbeat control has a high level of harmonic compensation and rapid fast-tracking performance.The disadvantage of this controller is that it requires a lot of computation effort [19].Harmonic compensation and steady-state error can also be done by repetitive controllers; their slow tracking response is their main drawback [20].In various dynamic conditions, the effectiveness of the third order complex filter (TOCF) control algorithm may be demonstrated.This controller serves as a distribution static compensator, enhances grid power quality by reducing harmonics, and balances grid currents while maintaining a unity power factor.However, the controller's biggest disadvantage is its enormous computational load [21].Another method which possibly could be proposed for mitigation of the issue is the model predictive control (MPC) method [22] and its improved versions [23,24].However, these methods present oscillations when the load varies.In addition, the THD of MPC is higher compared to other methods, which makes the technique unsuitable for implementation in this case.There exist different kinds of adaptive filtering techniques, such as leaky least mean mixed norm (LLMMN), least mean mixed norm (LMMN), and least mean square (LMS).However, all of the above-mentioned adaptive approaches have the drawback of being unable to maintain acceptable performance in the presence of DC-offset [25].The combined affine projection sign algorithm (CAPSA) has high stability and tracking performance, but output has the same problem as the previous mentioned method, which is the high THD [26].Artificial neural networks (ANN) also can be implemented as controllers in this system, but the main disadvantage are their low output power compared to fuzzy logic [27].Fuzzy logic controllers (FLC) [14] are one of the popular intelligent control techniques.They are extensively used in renewable energy systems due to their efficiency and ease of use.They are also robust and applicable to a wide range of the dynamics systems, from linear to nonlinear systems.Moreover, this type of controller can perform complex estimations, which are not possible with conventional methods [11].The linear quadratic regulator (LQR) is an effective control method that is applicable for both linear and nonlinear systems.In this method, the control gain is designed to minimize a quadratic cost function by selection of appropriate weighting matrices.In our study case, the cost function is the quadratic function of the tracking error between the current and its reference and the control efforts.This technique was chosen to be implemented due to its properties such as stability, robustness, and ease in application.Moreover, the computational complexity of the LQR controller is not high, which means that it is fairly simple to implement.
This paper proposes a complete control solution for grid-connected single-phase PV systems based on fuzzy control and an LQR.Our past related research on this topic was conducted with a different type of controller, namely the backstepping approach.The present study is a significant extension and improvement of our former research in terms of enhancing the quality of the control method.The proposed technique is the LQR in appropriate combination with fuzzy control and improved INC algorithms for grid-connected photovoltaic systems; furthermore, detailed explanations on developing the fuzzy association rules of the designed fuzzy logic controllers are newly presented in this study.The main originality of this paper is to show and prove by comparison of our former and present control methods that the newly suggested method is more effective in various aspects.Specific details of the PV system and controllers can be found in our past work in [28], which was used as the basis for this paper.The major advantage of the LQR method is its ability to react in a rapid manner to changes of the system, namely, changes in the module temperature or solar irradiation.In other words, the system can reach its settling time faster, which is important to stabilize the behavior of output.Moreover, it can be said that the LQR technique is robust when faced with different disturbances and changes compared to the backstepping technique and its improved fault tolerant version [29].In addition, the backstepping method has a higher overshoot, which significantly impacts efficiency in a negative way.As was mentioned above, the speed of the LQR is faster, which makes this kind of controller preferable.These are the key contributions of this study compared to our past research in [28].Simulation results under different weather conditions show that the proposed control system can cope with changes in weather parameters effectively, and were compared with theoretical ones.Moreover, it was shown that variations in weather parameters do not significantly affect the performance of the proposed control system.The remains of the paper are organized as follows.Section 2 shows the modeling of the grid-connected PV system, which includes the system description, PV panel model, and modeling of power converters.The control system design is depicted in Section 3, which consists of the MPPT control module, DC-link voltage regulator module, and current controller module.In addition, Section 4 provides simulation results in MATLAB, in which the first test case is with a fixed module temperature, and the second test case is with an unchanged solar irradiation.A detailed comparison and assessment of efficacy between the LQR control method in this study and the backstepping approach in our past work [28] is presented in Section 5; brief comparisons between this research and other related works are also shown in this section.The conclusions are described in the last section.

PV Grid-Connected System Modeling 2.1. System Description
This paper considers a grid-connected PV system consisting of two stages of power conversion.The nominal power of the system is 1 kW. Figure 1 shows the circuitry of the system; the power generated from the PV array is directed to the non-inverting buck-boost DC-DC converter.After that, to supply the grid, the obtained result is converted to AC via the single-phase DC-AC inverter.To remove unwanted noises and disturbances injected to the grid, the LCL output filter was used [30,31].
which makes this kind of controller preferable.These are the key contributions of this study compared to our past research in [28].Simulation results under different weather conditions show that the proposed control system can cope with changes in weather parameters effectively, and were compared with theoretical ones.Moreover, it was shown that variations in weather parameters do not significantly affect the performance of the proposed control system.
The remains of the paper are organized as follows.Section 2 shows the modeling of the grid-connected PV system, which includes the system description, PV panel model, and modeling of power converters.The control system design is depicted in Section 3, which consists of the MPPT control module, DC-link voltage regulator module, and current controller module.In addition, Section 4 provides simulation results in MATLAB, in which the first test case is with a fixed module temperature, and the second test case is with an unchanged solar irradiation.A detailed comparison and assessment of efficacy between the LQR control method in this study and the backstepping approach in our past work [28] is presented in Section 5; brief comparisons between this research and other related works are also shown in this section.The conclusions are described in the last section.

System Description
This paper considers a grid-connected PV system consisting of two stages of power conversion.The nominal power of the system is 1 kW. Figure 1 shows the circuitry of the system; the power generated from the PV array is directed to the non-inverting buck-boost DC-DC converter.After that, to supply the grid, the obtained result is converted to AC via the single-phase DC-AC inverter.To remove unwanted noises and disturbances injected to the grid, the LCL output filter was used [30,31].

PV Panel Model
The PV panels used in this paper have characteristics as presented in [28].The provided data is applicable when the module temperature is 25 ℃ and the solar radiation is 1000 W/m 2 .In total, the PV array consists of four panels, where the nominal power of each panel is 250 W. Figure 2 shows the impacts of module temperature and solar radiation on the power and voltage of the PV panel, respectively.Table 1 represents MPPs of the PV panel and array in terms of power and voltage.

PV Panel Model
The PV panels used in this paper have characteristics as presented in [28].The provided data is applicable when the module temperature is 25 • C and the solar radiation is 1000 W/m 2 .In total, the PV array consists of four panels, where the nominal power of each panel is 250 W. Figure 2 shows the impacts of module temperature and solar radiation on the power and voltage of the PV panel, respectively.Table 1 represents MPPs of the PV panel and array in terms of power and voltage.

Modeling of Converters
Figure 1 illustrates all components of the system including the single-phase inverter and the non-inverting buck-boost converter [7].The input control signals of the noninverting buck-boost converter and the single-phase inverter are α p and β p , respectively.

Control System Design
The design of the control system considered in this study is shown in Figure 3 and includes three main parts: the MPPT controller, the DC link voltage regulator, and the current controller.In this paper, detailed explanations on developing the fuzzy rules of the two designed fuzzy logic controllers are presented, which are useful as references for designing other fuzzy controllers.

Control System Design
The design of the control system considered in this study is shown in Figure 3 includes three main parts: the MPPT controller, the DC link voltage regulator, and current controller.In this paper, detailed explanations on developing the fuzzy rule the two designed fuzzy logic controllers are presented, which are useful as references designing other fuzzy controllers.

The MPPT Controller Module
The PV array produces its optimal power despite varying weather with the help the designed MPPT controller.According to Figure 4, this controller has two parts: first fuzzy logic controller (FLC-1) and the proportional-integral (PI-1) controller.

The MPPT Controller Module
The PV array produces its optimal power despite varying weather with the help of the designed MPPT controller.According to Figure 4, this controller has two parts: the first fuzzy logic controller (FLC-1) and the proportional-integral (PI-1) controller.

FLC-1
The main idea of this sub-controller is to improve the conventional INC-MPPT algorithm in terms of response time and efficiency by combining it with a fuzzy logic controller (FLC-1).According to Figure 5, the FLC-1 has two inputs and one output.The first input can be one of the following two kinds: •|Ap(k)|-the absolute value of a modified slope of the power-voltage (P-V) curve as expressed in (2).This equation also includes a pre-scaling module Gp(k), as shown in (3); •|dIp(k)|-the change in the current of PV panels in absolute value.
where  , = 1000 W is the maximum power of PV panels and g1 is a positive coefficient.The second input is the INC algorithm's prior step-size ΔV(k−1). Figure 6 shows the detailed flowchart of the proposed method.In addition, the aforementioned scaling module Gp(k) is used to suitably increase the sensitivity of slope Sp(k) as given in Figure 7.

FLC-1
The main idea of this sub-controller is to improve the conventional INC-MPPT algorithm in terms of response time and efficiency by combining it with a fuzzy logic controller (FLC-1).According to Figure 5, the FLC-1 has two inputs and one output.The first input can be one of the following two kinds: where P max P,total = 1000 W is the maximum power of PV panels and g 1 is a positive coefficient.The second input is the INC algorithm's prior step-size ∆V(k−1).Figure 6 shows the detailed flowchart of the proposed method.In addition, the aforementioned scaling module G p (k) is used to suitably increase the sensitivity of slope S p (k) as given in Figure 7. lim To avoid significant changes in the step-size and instability of the PV output power, a switching module is implemented as described in Figure 5.According to the first input, namely, |A p (k)| or |dI p (k)|, the system will use the appropriate output coefficient g 2 as shown in Table 3.
To avoid significant changes in the step-size and instability of the PV output power, a switching module is implemented as described in Figure 5.According to the first input, namely, |Ap(k)| or |dIp(k)|, the system will use the appropriate output coefficient g2 as shown in Table 3.All the association rules of the FLC-1 are shown in Table 4, while the membership functions of the inputs and output can be referred to in [28].To explain the fuzzy rules in All the association rules of the FLC-1 are shown in Table 4, while the membership functions of the inputs and output can be referred to in [28].To explain the fuzzy rules in Table 4, we can analyze several sample cases as follows.In the first case, when the two inputs ∆V(k−1) and |dI p (k)| are VS, that means that the PV system is close to the MPP and the step voltage is also very small; thus, the output of the FLC-1 as the additional voltage V add (k) should be ZE to avoid fluctuations in the PV voltage at the steady state.Whereas, in another case when ∆V(k−1) is LA and |dI p (k)| is ME, the additional voltage V add (k) will be NZ because the tendency of the PV system is automatically approaching the MPP.On the other hand, when ∆V(k−1) is vs. and |dI p (k)| is VL, it means that the PV system is far from the MPP; therefore, the output ∆V(k−1) should be PL to force the PV system to Energies 2022, 15, 1286 9 of 22 quickly move to the MPP.Furthermore, when |dI p (k)| is VL and ∆V(k−1) is VL, the output ∆V(k−1) can be chosen as either PZ or ZE for the PV system to automatically move to the MPP; in this study, we want to increase the speed for searching the MPP, so the output ∆V(k−1) is set as PZ in this case.In general, the other fuzzy rules in Table 4 can be suitably interpreted with the same deductive method.

PI-1 Controller
The PI-1 controller with an anti-windup block (refer to [32]) serves as the second sub-controller of the system.Figures 4 and 8 show detailed schematics of the controller.

PI-1 Controller
The PI-1 controller with an anti-windup block (refer to [32]) serves as the second subcontroller of the system.Figures 4 and 8 show detailed schematics of the controller.

DC Link Voltage Regulator Module
According to Figure 3, the objective of the DC link voltage regulator is to determine an appropriate value of the reference grid current  used for the current controller module.We note that the ultimate goal here is to make the DC link voltage  reach its desired value  once the actual grid current  is well regulated to its reference  [7,8] by the proposed current controller module using the LQR technique, which will be shown in detail in Section 3.3.In existing studies, a conventional PI controller has often been used to generate the reference grid current  from the DC link voltage difference  =  −  , as shown in the upper left part of Figure 9.Nevertheless, it is difficult to manually choose and tune optimal values for the coefficients of the PI-2 controller due to the high nonlinearity of the grid-connected PV system, including a LCL output filter.Furthermore, the response of the conventional PI-2 controller usually has fairly large overshoot in the transient state and achieves the steady state in a relatively slow manner.Thus, this paper proposes a novel hybrid control scheme for the DC link voltage regulator module using another FLC (named FLC-2) as depicted in Figure 9 to overcome the abovementioned drawbacks of the traditional PI-2 controller and remarkably enhance the response time.
Firstly, the theoretical relation between the output power of the DC-AC inverter supplied to the grid  and the output power of the PV array  can be expressed as follows: where:  -the efficiency of the buck-boost DC-DC converter can be estimated theoretically as a ratio value of the DC link power  and the output power of PV array  ;  -the efficiency of the DC-AC inverter can be estimated theoretically as a ratio value

DC Link Voltage Regulator Module
According to Figure 3, the objective of the DC link voltage regulator is to determine an appropriate value of the reference grid current I re f g used for the current controller module.We note that the ultimate goal here is to make the DC link voltage V DC reach its desired value V re f DC once the actual grid current I g is well regulated to its reference I re f g [7,8] by the proposed current controller module using the LQR technique, which will be shown in detail in Section 3.3.In existing studies, a conventional PI controller has often been used to generate the reference grid current I re f g from the DC link voltage difference e Vdc = V re f DC − V DC , as shown in the upper left part of Figure 9.Nevertheless, it is difficult to manually choose and tune optimal values for the coefficients of the PI-2 controller due to the high nonlinearity of the grid-connected PV system, including a LCL output filter.Furthermore, the response of the conventional PI-2 controller usually has fairly large overshoot in the transient state and achieves the steady state in a relatively slow manner.Thus, this paper proposes a novel hybrid control scheme for the DC link voltage regulator module using another FLC (named FLC-2) as depicted in Figure 9 to overcome the above-mentioned drawbacks of the traditional PI-2 controller and remarkably enhance the response time.All the association rules of the FLC-2 are presented in Table 5, while the membership functions of the inputs and output can be referred to in [28].To interpret the fuzzy rules in Table 5, we can analyze and evaluate some sample cases as follows.Firstly, when deVdc(k) is NL and eVdc(k) is PL, the output of the fuzzy controller Δ(k) should be ZE since the tendency of the DC-link voltage Vdc(k) is automatically approaching its reference value.On the other hand, when deVdc(k) is ZE and eVdc(k) is NL, it means that Vdc(k) is much smaller than its reference value; thus, the output Δ(k) should be PL to force Vdc(k) to rapidly move to the desired value.Furthermore, when deVdc(k) is ZE and eVdc(k) is PS, it means that Vdc(k) is marginally larger than its reference value; hence, the output Δ(k) should be NS to slightly decrease Vdc(k) to its desired value without oscillation at the steady state.In general, the other fuzzy rules in Table 5 can be appropriately explained with a similar deductive technique.Firstly, the theoretical relation between the output power of the DC-AC inverter supplied to the grid P AC and the output power of the PV array P P can be expressed as follows: where: η DC−DC -the efficiency of the buck-boost DC-DC converter can be estimated theoretically as a ratio value of the DC link power P DC−link and the output power of PV array P P ; η DC−AC -the efficiency of the DC-AC inverter can be estimated theoretically as a ratio value of the output power of the inverter P AC and the DC link power P DC−link ; η Exp = η DC−DC × η DC−AC -the overall efficiency of the grid-connected PV system.Equation ( 7) can be written as: V g I g cos θ g = η Exp P P (8) here cosθ g is the PF of the PV system, V g is the rms value of the grid voltage, and I g is the rms value of the grid current.In the normal operation of the grid, the rms value of the grid voltage is often larger than zero, meaning that V g > 0 V. Hence, When the PF = 1, the grid current will reach the following value.
However, the actual overall efficiency η Exp depends not only on the PF, but also on other component parameters of the DC-DC buck-boost converter and the DC-AC inverter, as well as the operating conditions of the PV system (e.g., the PV power, temperature, input voltage, and so forth); as a result, it is difficult to accurately estimate a particular value for η Exp .We note that Equations ( 7)-(10) are only explanations of the theoretical relations among the parameters η Exp , P P , P AC , I g , and V g , which are used as the reference basis for introducing and calculating a new "virtual efficiency" η vir exp in our proposed hybrid control scheme for the DC link voltage regulator module, as depicted in Figure 9. Hence, the calculated value of the "virtual efficiency" η vir exp in this figure and ( 11) is not the actual value of the overall efficiency of the PV system η Exp in (7).In this study, we calculate the "virtual efficiency" value η vir exp instead of estimating the actual overall efficiency η Exp .
To fulfill the above goal, the FLC-2 is designed to frequently update a suitable value for the "virtual efficiency" η vir exp (k) in real-time, as described in (11) and Figure 9.Then, from (10), an additional value I FLC g for adjusting the reference grid current I re f g can be computed as I FLC g (k) = η vir exp (k) × P P (k)/V g (k), as shown in the right part of Figure 9. Finally, this computed additional value I FLC g (k) is used to effectively compensate for the output of the conventional PI-2 controller I PI g (k) to appropriately determine the reference grid current I re f g (k), as presented in the upper right part of Figure 9; in detail, The key aims of I FLC g (k) generated by our proposed control scheme using the FLC-2 are to significantly improve the response time for updating a suitable value for the reference current I re f g (k) and to elevate the effectiveness of the conventional PI-2 controller against effects caused by the high nonlinearity of the PV system.
In fact, using the proposed current controller module (refer to Figure 3 and Section 3.3), when the grid current I g (k) is regulated to its reference I re f g (k) suitably generated by the designed PI-Fuzzy hybrid control scheme (see Figure 9), the DC link voltage V DC achieves its desired value V re f DC [7,8].This means that both the error values of the DC link voltage (e Vdc in Figure 9) and the grid current in ( 14) and ( 15) are considered and regulated by the proposed complete control system, as given in the lower part of Figure 3.
The designed FLC-2 has two inputs and one output.The two inputs are: e Vdc (k)-error between desired and present DC link voltage; de Vdc (k)-change in error.
The output is: ∆η(k)-step in efficiency, added to the "virtual efficiency" η vir exp to reach the desired value: The two inputs are: All the inputs have the same number of linguistic variables, specifically seven; the range is [−20;20]: NL-Negative Large, NM-Negative Medium, NS-Negative Small, ZE-Zero, PS-Positive Small, PM-Positive Medium, PL-Positive Large The output ∆η(k) has nine linguistic variables, and they range from [−1;1]: NL-Negative Large, NM-Negative Medium, NS-Negative Small, NZ-Negative Zero, ZE-Zero, PZ-Positive Zero, PS-Positive Small, PM-Positive Medium, PL-Positive Large.As a result, there are 49 fuzzy rules formed in the FLC-2.
All the association rules of the FLC-2 are presented in Table 5, while the membership functions of the inputs and output can be referred to in [28].To interpret the fuzzy rules in Table 5, we can analyze and evaluate some sample cases as follows.Firstly, when de Vdc (k) is NL and e Vdc (k) is PL, the output of the fuzzy controller ∆η(k) should be ZE since the tendency of the DC-link voltage V dc (k) is automatically approaching its reference value.On the other hand, when de Vdc (k) is ZE and e Vdc (k) is NL, it means that V dc (k) is much smaller than its reference value; thus, the output ∆η(k) should be PL to force V dc (k) to rapidly move to the desired value.Furthermore, when de Vdc (k) is ZE and e Vdc (k) is PS, it means that V dc (k) is marginally larger than its reference value; hence, the output ∆η(k) should be NS to slightly decrease V dc (k) to its desired value without oscillation at the steady state.In general, the other fuzzy rules in Table 5 can be appropriately explained with a similar deductive technique.

Current Controller Module
In this section, the current controller is designed by an optimal control method.Firstly, from (2), we have the following dynamic model, The main purpose of the current controller is to make the grid current i g (i.e., x 6 ) converge to its reference x 6ref .Then, from the third equation of ( 14), the error dynamics of x 6 and the reference for x 5 (i.e., x 5ref ) can be derived as, .
Thus, we have .
where x 5ref is determined by Similarly, with x 5ref achieved from (17), combined with the second equation of ( 14), .
x 5 − . where From x 5ref and x 4ref , obtained in ( 17) and (20), respectively, the first equation of ( 14) can be rewritten as .
Hence, we have .
Energies 2022, 15, 1286 13 of 22 where Here, we decompose the control input u into two terms: u 1 and u 2 ; in detail, u 1 is used for feedback control to stabilize the error dynamics, whereas u 2 is the compensating term used to compensate for the offset in the reference tracking problem.Finally, the error dynamics of ( 15) are achieved by combining ( 22), (19), and ( 16), as follows: Equation ( 24) is rewritten in the following form: .
Consider the following cost function: where Q ≥ 0 and R > 0 are the weighting matrices with appropriate dimensions; that is, 3 × 3 and a scalar, respectively.After that, this cost function is minimized by the following control law: where K is the controller gain matrix, and P is the positive definite solution of the algebraic Riccati equation as follows Typically, Q is chosen to be diagonal: where its elements and R can be selected by the following criteria, In ( 30), x imax is the |x i | constraint, u imax is the |u i | constraint, and t si is the required settling time of x i .

Simulation Results
The simulation performed in MATLAB/Simulink and all related parameters of the considered PV system can be referred to in [28].The results with the designed LQR control are illustrated in Figures 10-13, in which the time unit in the horizontal axis is second.

Simulation 2: Constant Solar Irradiation
In the second case, solar irradiation is constant at 1000 W/m 2 , but the module temperature is varying.From t = 0 s to 0.3 s temperature is 25 ℃, next, at 0.3 s the temperature is 45 ℃, and lastly, at 0.3 s the temperature is 30 ℃.According to Figure 12, the performance of the panel is 30.38 V/1000 W, 27.92 V/912.1 W, and 29.76 V/978.8W, which is highly close to the values represented in Table 1.Despite the module temperature change, VDC matched its reference at all times.In addition, the RMS value of Ig is maintained according to the reference trend, as presented in Figure 13.The

Simulation 2: Constant Solar Irradiation
In the second case, solar irradiation is constant at 1000 W/m 2 , but the module temperature is varying.From t = 0 s to 0.3 s temperature is 25 ℃, next, at 0.3 s the temperature is 45 ℃, and lastly, at 0.3 s the temperature is 30 ℃.According to Figure 12, the performance of the panel is 30.38 V/1000 W, 27.92 V/912.1 W, and 29.76 V/978.8W, which is highly close to the values represented in Table 1.Despite the module temperature change, VDC matched its reference at all times.In addition, the RMS value of Ig is maintained according to the reference trend, as presented in Figure 13.The phases of the grid voltage and current match, which means that the system's power factor is unity.

Comparison Between LQR and Backstepping Approaches
This research suggests the suitable combination of an LQR and fuzzy control for gridconnected PV systems.To show the effectiveness of the provided technique, it is important to make comparisons between some other methods, such as photovoltaic gridconnected systems using fuzzy logic and backstepping approaches [28] (see this reference paper for the specific details of simulations).Figures 14-17 present the simulation results of fuzzy control and the backstepping approach for a grid-connected photovoltaic system

Comparison Between LQR and Backstepping Approaches
This research suggests the suitable combination of an LQR and fuzzy control for gridconnected PV systems.To show the effectiveness of the provided technique, it is important to make comparisons between some other methods, such as photovoltaic gridconnected systems using fuzzy logic and backstepping approaches [28] (see this reference paper for the specific details of simulations).Figures 14-17 present the simulation results of fuzzy control and the backstepping approach for a grid-connected photovoltaic system  This case considers when the PV module temperature is constant at 25 • C. Irradiation starts from 850 W/m 2 at a time from 0 s to 0.3 s, then it becomes 1000 W/m 2 from 0.3 s to 0.6 s and finally becomes 400 W/m 2 from 0.6 s to 0.9 s. Figure 10 shows that the results of the voltage V p of the PV array are close to the reference values for the MPPT.The obtained output powers of the PV array are 847 W, 998 W, and 385 W, which match to the reference data provided in Table 1.Thus, this means that the power loss is small in this test.
The DC-link voltages correspond to each other in Figure 11.Furthermore, the grid current is equal to the reference values.Finally, it was shown and proven that the voltage and current of the grid are in phase, which means that the power factor of the gridconnected PV system is nearly unity.

Simulation 2: Constant Solar Irradiation
In the second case, solar irradiation is constant at 1000 W/m 2 , but the module temperature is varying.From t = 0 s to 0.3 s temperature is 25 • C, next, at 0.3 s the temperature is 45 • C, and lastly, at 0.3 s the temperature is 30 • C. According to Figure 12, the performance of the panel is 30.38 V/1000 W, 27.92 V/912.1 W, and 29.76 V/978.8W, which is highly close to the values represented in Table 1.Despite the module temperature change, V DC matched its reference at all times.In addition, the RMS value of I g is maintained according to the reference trend, as presented in Figure 13.The phases of the grid voltage and current match, which means that the system's power factor is unity.

Comparison between LQR and Backstepping Approaches
This research suggests the suitable combination of an LQR and fuzzy control for gridconnected PV systems.To show the effectiveness of the provided technique, it is important to make comparisons between some other methods, such as photovoltaic grid-connected systems using fuzzy logic and backstepping approaches [28] (see this reference paper for the specific details of simulations).Figures 14-17 present the simulation results of fuzzy control and the backstepping approach for a grid-connected photovoltaic system with the module temperature (Figures 14 and 15), and then with constant solar irradiation (Figures 16 and 17), in which the time unit in the horizontal axis is seconds.The obtained simulation results should be compared to those of the above-mentioned method.Specifically, the results in Figures 11 and 13 should be compared with those in Figures 15 and 17, respectively.We can see that both the control methods have good results.

Simulation 1: Constant Module Temperature
It is obvious that the simulation results of the MPPT parts in both the cases are the same since the main changes were not related to the MPPT controller, but to the LQR.Thus, the behaviors shown in Figures 10 and 14 are same; the performances presented in

Simulation 1: Constant Module Temperature
It is obvious that the simulation results of the MPPT parts in both the cases are the same since the main changes were not related to the MPPT controller, but to the LQR.Thus, the behaviors shown in Figures 10 and 14 are same; the performances presented in Figures 12 and 16 are also similar.Comparing the DC link voltage regulator module and the current controller module in both the cases, it can be clearly seen that the LQR case reacts to the changes in the module temperature and irradiation faster; in other words, the settling time of the LQR technique is lower compared to the backstepping method.Moreover, the LQR is robust when faced with different temperature and irradiation changes, which makes this technique preferable.In addition, in the case of the backstepping method, overshooting of the signal was observed, which significantly degrades the output and overall efficiency of the considered PV system.Furthermore, the response speed of the designed LQR is faster; consequently the rise time and peak time of the LQR are lower than those of the backstepping approach.

Simulation 2: Constant Solar Irradiation
In addition, the fuzzy-based INC-MPPT controller (see Figures 3-7 and Table 4) in this paper is improved from our past method [33], with significant modifications in the pre-scaling module G p (k) for increasing the sensitivity of the slope S p (k), in the fuzzy association rules for boosting the speed of searching the MPP, and in the control parameter values, which are designed and tuned to be more suitable for grid-connected PV systems with the LCL output filter.The detailed analysis and evaluation of the effectiveness of the prior related method for a small stand-alone PV system in various simulations and experiments can be referred to in Sections 4 and 5 of our past work [33], in which cases of partial shadow on the PV array were also investigated in experiments.Moreover, the influence of the module temperature on the performance of the stand-alone PV system and MPPT controller can be found in Sections 2.2 and 4.3 of the prior study [33].In fact, our present paper proposes a complete control solution for grid-connected single-phase PV systems including the LCL output filter based on fuzzy control and LQR techniques with multiple objectives as described in Sections 1 and 3 above; thus, it is noted that the separate assessment of the MPPT controller compared to other MPPT systems is out the scope of this study.
Due to substantial differences in configurations of considered PV systems and control objectives between this study and other existing works, it seems inappropriate and difficult to directly compare the detailed effectiveness of the proposed control scheme in this research to that of other studies.Therefore, we have only performed the detailed comparison of the current controller module using the LQR method proposed in the present paper with our past work using the backstepping approach [28] for evaluation, as described in Section 5 above.Moreover, for further reference, the current controller module using the LQR technique in this paper is briefly compared with the PID-fuzzy hybrid controller introduced in our other study [34], as represented in Table 6.Table 6.Comparison between the proposed current controller module and the previously introduced PID-fuzzy controller in [34].

Control Methods The Current Controller Module Using the LQR in This Paper
The Introduced PID-Fuzzy Hybrid Controller in [34] Design and computational complexity -Fairly simple design based on an optimal control method using the algebraic Riccati equation (see Section 3.3) -Includes three separate FLCs for controlling gains K p , K I , and K D , in which each FLC consists of 49 association rules.

Field of application in power systems
-For a complete single-phase grid-connected PV system including the LCL output filter with the consideration of DC link voltage regulation.
-For a simple single-phase grid-connected PV system including the L output filter without the consideration of DC link voltage regulation.In this grid-connected PV system using a DC-AC inverter and LCL output filter, due to parasitic capacitance and grounding resistance, the issues of common mode (CM) voltage and leakage current may become significant if the design and control of the inverter and LCL filter are not appropriate [35,36].As presented in other existing studies [37,38], the issues of CM voltage and leakage current in grid-connected PV systems can be effectively investigated and reduced using various techniques such as improved PWM methods, modified topologies of PV inverters with complementary switches [37], design and implementation of CM filters [38,39], active damping control approaches [40], and so forth.On the other hand, our paper focuses on developing a complete control scheme for gridconnected single-phase PV systems including an LCL filter based on fuzzy logic and an LQR method with three key goals comprising the MPPT, DC link voltage regulation, and injection of the PV power into the grid with a unity Hence, it should be noted that the assessment and reduction of the CM voltage and leakage current are beyond the scope of the present paper; these issues will be thoroughly considered in our future work.

Conclusions
Based on fuzzy control and an LQR, this study provides a comprehensive control solution for grid-connected single-phase PV systems.In terms of improving the quality of controller methods, this work represents a substantial extension and enhancement of our past research.For grid-connected solar systems, the suggested approach is an LQR suitably combined with fuzzy control, in which the design procedures of all the controllers are also described in detail.The major novelty of this study is to demonstrate and verify that the newly proposed approach is more successful in different aspects by comparing our past and present control methods.The LQR technique's major benefit is its ability to react quickly to unexpected changes in the system, such as changes in module temperature and solar irradiation.In other words, the systems achieve their settling period sooner, which is necessary to steady the output behavior.
Furthermore, as compared to the backstepping approach, the LQR method is more resistant to various changes in weather conditions.The backstepping approach also has the greater overrun, which has a detrimental effect on the efficiency of the investigated PV system.As previously stated, the LQR has the quicker response speed, making this type of controller more desirable.These are the major contributions of our present work as compared to the earlier research.Moreover, the results of simulations under different weather circumstances were compared to theoretical ones, indicating that the proposed system can cope with variations in weather parameters well.It was also demonstrated that abrupt changes in weather factors had no significant effects on the proposed control system's performance.
In future work, intelligent models based on fuzzy control for effectively predicting PV power and load demand will be thoroughly studied and implemented to improve the effectiveness and quality of grid-connected solar energy systems, especially under adverse conditions such shaded solar PV modules.

Figure 2 .
Figure 2. Power obtained from PV panels for different (a) solar radiation values and (b) module temperature values.

Figure 2 .
Figure 2. Power obtained from PV panels for different (a) solar radiation values and (b) module temperature values.
the absolute value of a modified slope of the power-voltage (P-V) curve as expressed in (2).This equation also includes a pre-scaling module G p (k), as shown in (3); • |dI p (k)|-the change in the current of PV panels in absolute value.

Figure 7 .Table 3 .
Figure 7. PV panel power-voltage (P-V) curve.Table 3. Switching module operation.If the Input is |AP(k)| If the Input is |dIP(k)| |AP(k)| > 0.1 |AP(k) ≤ 0.1 g2 = 1 (where every value of |dIP(k)|) g2 = 0.25 g2 = 0.1 As is known from previous parts of this paper, the inputs are in the range of [0-1].It should be noted that all the inputs have the same number of linguistic variables, specifically five linguistic variables: VS-Very Small, SM-Small, ME-Medium, LA-Large, VL-Very Large.The output has nine linguistic variables in a range of [−1;1]; in detail, NL-Negative Large, NM-Negative Medium, NS-Negative Small, NZ-Negative Zero, ZE-Zero, PZ-Positive Zero, PS-Positive Small, PM-Positive Medium, PL-Positive Large.As a result, there are 49 fuzzy rules associated in the FLC-1.All the association rules of the FLC-1 are shown in Table4, while the membership functions of the inputs and output can be referred to in[28].To explain the fuzzy rules in

Figure 9 .
Figure 9. Proposed PI-fuzzy hybrid control scheme, where g 3 , g 4 and g 5 are design coefficients.

Figure 11 .
Figure 11.DC link voltage regulator module and current controller module performances with the LQR method for constant temperature case: (a) DC link voltage; (b) grid current magnitude; (c) grid voltage waveform V g (V) and current waveform where Gain is 10 × Ig (A).

Figure 13 .
Figure 13.DC link voltage regulator module and current controller module performances with the LQR for constant solar irradiation case: (a) DC link voltage; (b) grid current magnitude; (c) grid voltage waveform V g (V) and current waveform where gain is 10 × Ig (A).

Figure 14 .
Figure 14.MPPT module performance in case with the backstepping approach for constant temperature: (a) PV voltage; (b) PV output power.

Figure 15 .Figure 16 .
Figure 15.DC link voltage regulator module and current controller module performances with backstepping approach for constant temperature case: (a) DC link voltage; (b) grid current magnitude; (c) grid voltage waveform V g (V) and current waveform where gain is 10 × Ig (A).Energies 2022, 15, x FOR PEER REVIEW 18 of 22

Figure 16 .Figure 16 .Figure 17 .
Figure 16.MPPT module performance in case with the backstepping approach for constant solar irradiation: (a) PV voltage; (b) PV output power.Figure 16.MPPT module performance in case with the backstepping approach for constant solar irradiation: (a) PV voltage; (b) PV output power.

Figure 17 .
Figure 17.DC link voltage regulator module and current controller module performances with backstepping approach for constant solar irradiation case: (a) DC-link voltage; (b) grid current magnitude; (c) grid voltage waveform V g (V) and current waveform where gain is 10 × Ig (A).

-
Can well regulate the grid current with a unity power factor and DC link voltage under different operating conditions of the PV system.-Very fast response, and small overshoot.-Has good efficacy and is robust faced with large variations in solar radiation and PV module temperature.-Theoretical analysis of stability of the LQR controller has been confirmed.-Can control the active and reactive power supplied to the grid with the step change of reference signals for the two powers.-Quick response and relatively small overshoot.-Has not yet been checked with large variations in solar radiation and PV module temperature.-Theoretical analysis of stability of the hybrid controller has not yet been performed.

Table 1 .
Power and Voltage at Maximum Power Points.

Table 1 .
Power and Voltage at Maximum Power Points.
S 1 and S 2 are OFF 1; S 1 and S 2 are ON β p = S 3 and S 5 are ON, S 4 and S 6 are OFF 0; S 3 , S 4 , S 5 and S 6 are OFF −1; S 3 and S 5 are OFF, S 4 and S 6 are ON The modeling technique, specifically averaging, and Kirchhoff's laws were used to estimate a mathematical model for the two converters.Equation (1) and Table 2 demonstrate details of the previously mentioned procedure