Artificial Neural Network Based Constrained Predictive Real-Time Parameter Adaptation Controller for Grid-Tied VSCs

—This paper proposes a real-time algorithm for identifying the grid parameters, which is concurrently used for online tuning of the predictive controller in each iteration, in a grid-tied active front end (AFE) voltage source converter (VSC) applications. The algorithm is designed by inspiring from the concepts of the extended Kalman ﬁlter (EKF) and the model predictive controller (MPC). The performance of the algorithm highly depends on the weighting factors of the algorithm. The artiﬁcial neural networks (ANN)-based algorithm is used to ﬁnd the optimal set of weighting factors among the ones in a parameter search block. An ofﬂine particle swarm optimization (PSO) is run to provide the data source for the parameter search block. The algorithm identiﬁes not only the inductance but also the resistance of the grid. Additionally, the hard constraints on the amplitude of the input and output variables are guaranteed. The validation of the proposed approach is performed experimentally and compared with the state-of-the-art conventional methods. The experimental results show the proposed method could effectively stabilize the system in weak grid conditions and under wide impedance variations. Additionally, the accuracy of the proposed impedance identiﬁcation method is 96%.


I. INTRODUCTION
O VER the coming decades, societies around the world will need to develop carbon-free electrical power grids.In this context, intensifying the connection of renewable energy sources (RES) to the bulk grid will be one of the cornerstones of such development where new scientific challenges emerge.For example, the stochastic behavior of the RES such as photovoltaics and wind turbines may cause frequency stability issues, grid congestions, and grid voltage deviations.Gridconnected converters play an important role in supporting the frequency, the voltage, and increasing the low voltage (LV) ride-through capability of future electric power grids.
Mohammad Mehdi Mardani, Nenad Mijatovic, and Tomislav Dragičević are with the Department of Wind Energy, Center for Electric Power and Energy, Technical University of Denmark (DTU), Denmark, (email: mmema@dtu.dk;nm@dtu.dktomdr@dtu.dk).Mohammad Mehdi Mardani is also with Sino-Danish College (SDC), University of Chinese Academy of Sciences.
There are many advanced control approaches in the literature for controlling the voltage source converter (VSCs) that outperform conventional cascaded linear control in terms of static and dynamic performance metrics [1], [2].Notable examples are table-based direct power control (DPC) [3], sliding mode control (SMC) [4], passivity-based control (PBC) [5], fuzzy logic control (FLC) [6], feedback linearization [7] and optimization-based methods [8].Optimization methods allow formal guarantees of performance, and thus they are the most appropriate for demanding applications.Among the optimization approaches, the model predictive control (MPC) for VSCs has attracted considerable attention due to its control flexibility, fast and robust dynamic response, capability to explicitly handle multi-input multi-output systems, and hard constraints on the amplitude of the input and output variables [9].The MPC approaches are generally robust against parameter sensitivity for accurately modeled systems.However, finding optimal weighting factors for the cost function of the MPC is a challenging issue.Each weighting factor in the cost function is paired with a specific objective in the final control decision.As far as utilizing empirical methods are complex and time-consuming, several solutions are presented in the literature to solve this problem such as artificial neural networks (ANN), genetic algorithms, particle swarm optimization (PSO), etc [10].The other major disadvantage of MPC is that its performance strongly depends on the accuracy of the system model.In other words, it may perform poorly under model-mismatch or un-modeled dynamics [11].On the other hand, since the converters are installed in a grid with a lifetime of more than fifteen years, there is a need to keep the model in MPC up to date.Thus, combining the MPC with online state and parameter identification offers the potential for better performance and this is one of the main motivations of this paper.
In the context of MPC-based control of grid-tied converters, their connection to weak-grids presents a particularly challenging scenario from a parameter uncertainty standpoint [12], [13].Namely, in weak grids, the grid impedance, which is seen from the output of a particular converter, may vary significantly depending on current renewable generation, load, and the grid configuration [14].These changes are difficult to precisely predict in advance.Thus, the converter controllers, which are typically designed for strong (stiff) grids, may not work stably in weak grids.In this context, it is of interest to be able to identify the perceived grid impedance online and adapt the controller to maximize the stability margins, system efficiency, and transient and steady-state performance.Besides, the grid impedance identification and state variables estimation in grid-tied VSCs are not only utilized for adding a degree of freedom for increasing the performance of the system but also useful for the reliable operation of grid tied VSC [15].For example, the grid impedance identification was deployed for voltage control [16], islanding detection [17], supporting reactive power [18], fault detection [19], determining short circuit capacity (SCC) [20], decoupling the inner current loops in the synchronous reference frame (SRF) [14], stability analysis based on Nyquist criteria [21], adaptive tuning of phase-locked loop (PLL) controller in SRF [22].On the other hand, a lack of impedance identification may result in several challenges such as the risk of negative impedance instability [23].Time-varying grid impedance is not directly measurable at the point of common coupling (PCC).Thus, an online algorithm is essential to identify the grid parameters and estimate the grid state variables such as current, voltage, and frequency at the PCC [24], [25].
Grid impedance estimation techniques are split into active and passive, which are also known as intrusive and nonintrusive [26], [27], methods.Active methods intentionally disturb the grid and then perform data analysis.Some of the examples of active techniques are frequency [16], [18], [21], [28], [29], transient voltage [30], [31], and current impulse injection [32].The frequency injection technique is divided into insection of a single frequency such as 75 Hz [16], 300 Hz [18], and 600 Hz [29], dual frequencies such as 400 Hz and 600 Hz [29], and a large spectrum of frequencies [21].However, active techniques have some drawbacks.Firstly, the injected disturbance results in temporarily reduced performance of the converter.Secondly, the estimation time is large for precisely identifying the system parameters.Thirdly, if the injected disturbance has a large amplitude, then the nonlinearity behavior of the system may be excited, thus subsequently decreasing the estimation accuracy.The other grid impedance identification technique is utilizing the evaluations of the inverter's output power [15], [33], [34].This method is working based on sampling two operating points with the predefined instances when the active and reactive power is changing.However, the main drawbacks of this approach could be enumerated as follows.Firstly, it is required to set the active and reactive power to zero for estimating the grid inductance and impedance, respectively.Thus, the functionality of the converter is reduced in this approach.Secondly, the estimation time needs to be increased if the two operation points technique is deployed.The [35]- [37] inject a periodic non-characteristic harmonic current into the grid.Afterward, the grid impedance is estimated by utilizing the Fourier transfer (FT) or wavelet transfer (WT).In this approach, it is required to record the measured voltage and current.The drawbacks of this method can be classified as follows.Firstly, it is required to inject the periodic noncharacteristic harmonic current into the grid.Secondly, this method needs high computational effort for recording voltage and-or current data.
Against the abovementioned methods, the passive tech-niques utilize the system noise to identify the grid impedance.The passive technique attracts lots of attention due to its low computational effort, minimum effect on the power system, and simple implementation [38].The passive approaches usually use the available information at the point of common coupling (PCC) to identify the grid impedance.Since controlled excitation has an influence on the resonance frequency of the inductance-capacitor-inductance (LCL) filter, Ref. [39] used controlled excitation to identify the grid impedance of the grid-tied VSC.The recursive least square (RLS) [40] and EKF [27] are used to identify the grid impedance using the measured currents and voltages at the PCC.Ref. [41] used the frequency locked loop based on the second-order generalized integrator (SOGI-FLL) to monitor the phasors of the currents and voltages at the PCC.Then the impedance of the grid is estimated using the processed values.Ref. [42] tries to accurately estimate the real grid information instead at the PCC.The Kalman filter is used to estimate the grid impedance, voltage amplitude, and phase angle.Then, the estimated information guides the designed controller to eliminate the effect of impedance changes in weak grids.The main contribution of this paper is adaptive parameter tuning for the MPC controller in a grid-tied VSC based on online identified impedance and system state variables.Particularly, this paper proposes an algorithm for predictive real-time parameter adaptation control of grid-tied VSC.The algorithm deploys the concept of the extended Kalman filter (EKF) to identify the grid resistance and inductance and estimate the grid variables.Then, by inspiring from the concept of the MPC, the identified parameters are used in each iteration to update the parameters of the constrained predictive controller.The algorithm satisfies the constraints on the amplitude of the inputs, which are the duty cycles of each leg, and output variables, which are the current and voltage at the PCC.It is worth noting that hard constraints on the amplitude of input and output variables are usually satisfied even with the unconstrained predictive controller, which needs lower computational effort.In this context, the proposed algorithm employs the constrained predictive controller if and only if the unconstrained predictive controller does not formally guarantee hard constraints on the system.Separate from the identification and control difficulties, defining the optimal parameters for the cost functions in the proposed algorithm is very challenging.These weighting factors in cost functions have a significant effect on the smoother output response, the rate of convergence, and the performance of the identification and control.Therefore, an ANN-based algorithm was proposed to select the optimal weighting factor set among the predefined weighting factor sets.The predefined weighting factor sets are calculated using the PSO algorithm for different conditions of the circuit.The main novelty of the proposed approach can be classified as follows: proposing an algorithm to identify the grid resistance and inductance; estimating the state variables such as the current and the voltage of the PCC; the identified parameters are used to update and tune the predictive controller and then design a duty cycle for the AFE grid-tied VSCs; considering hard constraints on the amplitude of the input and the output variables; Using online ANN with offline PSO algorithms to find the optimal solution for the weighting factors in the proposed algorithm; Experimentally evaluate the validity and demonstrate the superior performance of the proposed approach.
The rest of this paper is organized as follows.Section II addresses the VSC modeling preliminaries.Section III investigates the EKF for parameters and state estimation.Section IV studies the proposed MPC-based approach.Section V discusses the experimental results.Finally, Section VI draws a conclusion.

II. VOLTAGE SOURCE CONVERTER MODELING PRELIMINARIES
The three-phase grid-connected VSC is illustrated in Fig. 1.In the three-phase abc stationary coordinate, the state space model of the three-phase VSC can be represented as follows: where V a , V b , and V c are three-phase grid input voltages; i a , i b , and i c denote three-phase grid input currents; V dc shows the constant dc voltage.  1) can be represented as the following equation by employing SRF rotating coordinate [43]: where direct axis current, i d , and quadrature axis current, i q , are associated with active and reactive powers, respectively.V d is direct axis voltage with associated duty d d , while V q is quadrature axis voltage with associated duty d q (commonly kept at 0 with appropriate alignment of dq system).The angular frequency of the V P CC is denoted by ω, which can be calculated by ω = 2πf .Model ( 2) is used to propose a simple high-performance controller.The equation ( 2) could be represented as where x = i d i q T , and Using the Euler discretization method, one has where the 2-dimensional vector y k denotes the discrete-time output variables, which is equal to the state variable in (4).
, and C = I 2 are system matrices.
Remark 1.The proposed approach is valid and implementable for any application that can be explained in the state-space model of the form (4).

III. EXTENDED KALMAN FILTER FOR PARAMETERS AND STATE ESTIMATION
The equation ( 4) shows the linear state-space model of the VSC.Define the system parameter vector θ k = R/L 1/L T , where L and R are the equivalent grid inductance and resistance seen from a power converter to the grid side, respectively.Adding the parameter vector to the state one, then the augmented system can be represented in the following nonlinear structure: where e k ∼ (0, Ξ k ) and ν k ∼ (0, R k ) are process and measurement zero-mean white noises, respectively.S k and R k are variances of the processes and measurement noises, respectively.
Table I presents the stepwise sequence EKF algorithm for identifying the state and parameters of the VSCs.In this algorithm, the " Ôk ", is the estimation of the variable "O" in the time step "k".The superscripts "−" and "+" are priori and posteriori estimations in the time step "k", respectively.After initializing the EKF algorithm, in each iteration, the algorithm is split into time and measurement updates.In the time update, the priori state and parameter estimation of the VSC for the next time step is predicted.Additionally, the priori covariance estimation is also predicted for the next update by assuming the process and measurement noises are white and independent.In the measurement update, the Kalman gain is calculated using the existing data.Then, the actual measured output is used to update the posteriori state and parameters at the current time step.Next, the posteriori covariance matrix is updated to use in the next iteration of the EKF algorithm.

IV. PROPOSED MODEL PREDICTIVE CONTROL-BASED APPROACH
Consider the state space model ( 4).The output variables can be predicted as follows: The equation ( 6) can be represented as follows: where , and .

A. Predictive Controller
The cornerstone of all of MPC approaches is well-defined cost function.Here, a cost function is defined to predicts a N × T s horizon ahead.Here, we propose the following cost function for the state-space model (4): where W k is a vector of the reference signals for N future horizon.P and Q are positive definite weighting matrices with suitable dimensions.These matrices can give a relative importance to each variable or the relation between one variable with another.Additionally, this cost function is essential for making dimensionless state variables (i.e.compensating the large differences in the order of the magnitude of the state variables).The following theorem is presented to find the optimal control signal by minimizing the cost function (8).
Theorem 1 (Non-constrained MPC).For each iteration, the optimal solution for the cost function (8) can be analytically calculated as follows: whereas the receding horizon strategy is employed, the first two rows of the U k denote the control signal u k and implemented to the VSC.Additionally, the duty cycle is Proof.Substitute (7) into cost function (8), one has The proof is completed by simplifying (12).

Definition 1 (Linear Matrix Inequality). Consider the decision variables
which are a vector of n real numbers and Hermitian matrices, respectively.Then, the inequality is called linear matrix inequality (LMI).
Lemma 1 (Schur Complement).Consider an affine function S, which is partitioned as follows: Then, S < 0 is satisfied if and only if one of the following equations are satisfied: Theorem 2 (constrained MPC).Define the positive definite scalar γ such that the cost function J in (8) satisfies J < γ.Then, the suboptimal solution for the cost function J is obtained by finding any matrix U and minimizing scalar γ such that the following LMI conditions are satisfied: where and u k is the first two entries rows of matrix U .Furthermore, the obtained control signal makes the output of the system track the reference with the performance index γ.Additionally, the amplitudes of the control and output signals are assured to be inside a predefined region by defining U max , U min , Y max , and Y min .
Proof.Conditions ( 17)-( 18) and ( 19)-( 20) introduce constraints on the amplitude of the input and output variables, respectively.Due to the constraints on the amplitude of the input and output variables, there is no analytical solution for the cost function (8).The suboptimal solution for the cost function J is obtained by substituting (11) into J < γ.One has where U k and γ are decision variables with suitable dimensions.By employing Lemma 1, the non-convex conditions ( 21) is converted to the convex one, which is calculated in (16).

B. Predictive Control of VSC with Unknown Parameters
The details of the proposed online parameter estimation and predictive controller are illustrated in Fig. 2. Because the system parameters are considered to be state variables (5), the overall discrete-time model of the system is nonlinear.Thus, by utilizing the proposed algorithm not only the parameters, which consist of the inductance and resistance of the grid, but also the state variables of the nonlinear augmented system are estimated.As shown in the flowchart, firstly, the algorithm is initialized.Secondly, in each time iteration, the estimation of the system parameters is carried out.Based on the estimation, the system parameters are updated.Thirdly, based on the obtained data, the non-constrained predictive controller can be used to calculate the duty cycle.By implementing the obtained control signal, if the input and output constraints are satisfied, then the control signal is acceptable.Else, only for one time in each time iteration, the constrained MPC is used to obtain the suboptimal control signal.Fourthly, the measurement update is employed to find the postriori estimation of the parameters and state variables.Finally, the updated data is utilized to obtain the pripori estimation for the next time step.

C. Design Optimal Weighting Parameters Using ANN for the Proposed Algorithm
In the proposed algorithm (Fig. 2), it is required to design four weighting factors, which have a challenging effect on the performance, smoother output response, and convergence rate.The algorithm (Fig. 3) shows the flowchart for the proposed online weighting factor tuning loop.In the designing procedure, the ANN serves as an alternate for the system represented in Fig. 1 and described in (1).To find the optimal solution for the algorithm, a feedforward ANN, which is trained using a backpropagation algorithm, is considered.The data for training the ANN is obtained based on the simulation results.To obtain the mapping, the proper dataset is required Initialize EKF (Table I

Measurement
Update (Table I) to train the ANN.In this paper, the structure of the ANN is considered to be: six, twelve, five, and two neurons in input, first hidden, second hidden, and output layers, respectively.The input dataset consists of the reference values for the active and reactive currents (w 1 , w 2 ), the identified grid parameters R and L, and the input signals u d , and u q .The input signals u d , and u q are calculated based on the control law presented in Theorems 1 and 2, measured data from the Measurement update block in the Algorithm (Fig. 2), and weighting factors, which are defined in the parameter search block.The details information about the designed ANN is provided in Table II.

Satisfied
In each iteration of the algorithm (Fig. 2), the online weighting factor tuning algorithm (Fig. 3) is executed for T max times.T max is the number of available data sets in the "parameter search" block.In each iteration of the algorithm (Fig. 3), a weighting factor set is selected from the "parameter search" block.The "calculate u d and u q " block generates the input signals based on the recent measured output, selected parameters from the "parameter search block", and Theorems 1 and 2. By using the ANN, the output response is obtained based on the selected weighting factors, the identified system parameters, and the reference signals.The output response is compared with the reference output, and the cost function f t is calculated.The weighting factor set, which is assigned to the minimum value of the f (f min ), is saved and updated cost function parameters in the main algorithm (Fig. 3).
The data in the "parameter search" block needs to be  defined in advance.This block consists of a set of parameters [P, Q, R, S], which regulate the convergence ratio and performance of the algorithm, for different conditions of the circuit.To find the suitable set of parameters for each condition, an auxiliary objective function, which could be nonlinear, is minimized by using the inverse optimization algorithm.The idea is to solve the algorithm (Fig. 2) for different P, Q, R, and S to find the optimal set of parameters.Among all metaheuristic methods, PSO searches faster in the solution space and provides a more optimal solution in comparison with deterministic methods.Additionally, unlike many other meta heuristic methods like genetic simulated annealing, three terms of inertia, the best learning ratio, and self are used in the PSO algorithm to find the optimal solution between particles among the search space [44].Thus, the PSO algorithm is a good candidate to find the optimal set, which provides a faster convergence trend and a more precise solution.The PSO algorithm runs for different values of grid resistance and inductance to generate a data set for the weighting factor tuning algorithm (Fig. 3).
Remark 2. There are many ANN-based methods to find the optimal value of the cost function parameters [10], [47].However, these approaches are usually using the sweeping range for each weighting factor parameter.In the case that the weighting factors are defined as a matrix, then it is challenging to define a range for each parameter.The proposed approach goes one step further to cope with these difficulties.
V. SIMULATION RESULTS, EXPERIMENTAL VERIFICATION, AND COMPARISON This section studies simulation results, experimental tests, and comparisons for verification purposes.The results clearly  illustrate the better performance and effectiveness of the proposed algorithm.

A. Simulation Verification
The proposed algorithm is simulated in Matlab-Simulink with the parameters, presented in Table II.Two grid conditions, which are mainly focused on changes in the active current and grid inductance, are addressed in simulation results.
Table III indicates the changes in the grid inductance and the active current for the first condition.The results are shown in Fig. 4. It is shown that the proposed algorithm could identify the system parameters correctly and also the system variables are controlled such that the better performance of the system in terms of settling time, reference tracking, and the percentage of the overshoot is guaranteed.Fig. 5 shows the active current by changing the inductance value, based on the order of Fig. 4, however, the value of the inductance in the MPC controller is considered to be fixed.The aqua and black colors illustrate the inductance value equivalent to 13.2mH and 11mH, respectively.The red color shows the performance of the proposed approach.As it is clear, the proposed algorithm could work significantly better than the MPC algorithm.For the proposed approach in Fig. 5, there is some chattering in the i d and i q at the times 1.25s, 2.5s, and 3s.One of the reasons for these chatterings is coming from selecting the non-optimal solution for the parameters  [P, Q, R, S] by the ANN method.However, after a short period, the ANN algorithm finds the optimal solution among the "parameter search" block and updated the parameters.Thus, the efficiency of the system is increased.To compare the computational burden of the proposed approach with the one presented in [46], a personal computer with the specification: Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz, 2.11 GHz, and 16 GB RAM is used.The results show that the CPU time for one period of the PI controller [48], MPC controller [46], and the proposed approach are about 2µs, 50µs, and 30µs, respectively.
Next, the effect of the weighting factor on the performance of the identification section is reflected.To do this, a weighting factor from the parameter search block is considered and also the ANN is not used in the algorithm.The considered weighting factor is assigned to the case L g = 13.2mH.The grid inductance is changed based on the Table III.Fig. 6 illustrates the estimation of the state variable I d and grid inductance L g for the case that L g = 13.2mH.By comparing Fig. 6 with Fig. 4, one can conclude that using the ANN-based algorithm to select the optimal set of the weighting factors among the parameter search block improves the performance of the identification algorithm.

B. Experimental Verification
The laboratory-scale testbed setup is used to evaluate the validity and applicability of the proposed approach.The configuration of the experimental setup is presented in Fig. 7.The setup consists of a Danfoss VSC, a three-phase AC power amplifier, Delta power supply, converter and grid side inductors, voltage and current measurements, and a breaker.The breaker is used to emulate different impedances.The considered laboratory-scale test-bed setup elements are summarized in  Table II.As presented in Table II, the switching frequency is considered 10kHz, which shows the applicability of the proposed approach on commercial and industrial controllers.The boards DS2004 and DS5101 are employed to convert the measured analog signal to the digital one and generate the pulsed width modulator waveform, respectively.The proposed online estimated state and parameters and predictive controller algorithm (Fig. 2) is built in Matlab/Simulink and uploaded on the dSpace RTI1006 using ControlDesk experimental software.

The Performance of the Proposed Approach
In this section, two scenarios are considered.The first one addresses the effect of current changes on the identification algorithm.The second one identifies the grid impedance changes.
1) Scenario A: State Estimation: The goal of this scenario is to investigate whether changes of the state variables affect the parameter identification or not.To do this, the reference value of the i d is changed from 6A to 10A, 10A to 6A, 6A to  8A, and 8A to 6A at times t 1 , t 2 , t 3 , and t 4 , respectively.Fig. 8 illustrates the behavior of the state variables and identified grid inductor.As expected, changes in the active current have a negligible effect on the identified parameter.Fig. 9 shows the system behavior for the proposed approach by changing the active current.Channel 1, which is located at the top of each scope, shows the measured voltage signal of one of the phases, and channels 2, 3, and 4, which are located at the bottom of each scope, show the measured three-phase current at the PCC.Additionally, behaviors of the system at the t 1 , t 2 , t 3 , and t 4 are also illustrated in the Fig. 9.One can observe that the proposed approach could follow the reference signal with a better settling time and overshoot in comparison with the state-of-the-art methods.2) Scenario B: Parameter Identification: This scenario focuses on the experimentally testing problem of the grid parameter identification with the proposed approach.To do this, several stepwise inductance changes are experimentally implemented to the system by utilizing two breakers.As shown in Fig. 7, each breaker is placed in parallel with a 2.2mH inductor.Thus, when each breaker is open, the equivalent 2.2mH inductance is added to the circuit.When the breaker is closed, the 2.2mH inductor is bypassed.In this scenario, at times t 1 and t 2 , the first and the second breakers are opened respectively.At times t 3 and t 4 , the first and second breakers are closed, respectively.At times t 5 and t 6 , both the breakers are opened and closed together simultaneously, respectively.These stepwise impedance changes simulate the condition when individual high power generators or loads or even a subnetwork are connected to or disconnected from the network.As shown in the Fig. 10, the algorithm suitably identifies the changes in the inductance of the grid and properly controls the system after these changes.Let's define the difference between the upper and the lower margins of the changes in the identified impedance as the identification error.Errors of the identified parameter are 0.45mH and 0.3mH for the cases that the inductances of the grid are 13.2mH and 11mH, respectively.Thus, the accuracy of the identified inductance of the grid is approximately 96%.To evaluate the transient performance of the algorithm during the inductance changes, the behavior of the system at the PCC is illustrated at times t 2 and t 6 .As expected, the changes in the system variables do not have any effect on the measured variables at the PCC.

C. Comparison
In this section, the results are experimentally compared with the conventional proportional-Integrator (PI) and modern MPC controllers [46].The PI controller is tuned based on the method presented in the appendix section of Ref. [48].In more detail, For converter control: K pc = 2α c L f , and K ic = (α c / c ) 2 L f For PLL control: K ppll = 2 × α pll /V p , and K ipll = (α pll / pll ) 2 /V p where α c = 300, α p ll = 20, c = pll = 1, and V p is the peak value of the grid voltage.Additionally, to implement the MPC controller, we considered the horizon N = 4, with the predefined weighting matrices P = I 4 ⊗ diag{3458, 1810} and Q = I 4 ⊗ I 2 , where I r indicate the identity matrix with dimension r and ⊗ shows the Kronecker product.
Behaviors of the state variables at the PCC for the PI and MPC controller are presented in Figs.11 and 12, respectively.Times t 1 to t 6 in Figs.11 and 12 indicate the same impedance changes as Fig. 10 in Scenario B. The voltage signal of one of the phases at the PCC is illustrated on the top and the three-phase current at the PCC is illustrated in the bottom part of the scope.The PI controller and the proposed one are demonstrated in Figs.11 and 10, respectively.As shown in Figs.11 and 10, the transient and the steady-state performance of the proposed approach are better.In addition, the comparison was extended to a standard MPC controller without Online parameter identification [46].Due to this reason, the changes in the grid inductance have strong adverse effects on the behavior of the controller.Here, we considered the wrong value for the impedance of the grid.As shown in Fig. 12, by comparing the results from the MPC controller with our proposed approach, one can conclude that not only the transient performance but also the steady-state performance of the proposed approach is significantly better.The changes in the impedance of the grid affect the amplitude of the current signals.However, in our proposed approach, the grid impedance is firstly identified by the controller and the MPC parameters are updated in each iteration.Additionally, the authors compared the total harmonic distortion (THD) for the PI controller and our proposed controller.To have a fair comparison, we considered that the grid parameters are fixed and constant.Fig. 13 illustrates the first twenty harmonics of the current for the proposed and the PI controllers.Fig. 13 shows that the proposed method provides lower harmonics rather than the conventional PI controller.Moreover, the THDs for the proposed MPC-based method and PI one are 3.6% and 5.9%, respectively.
There are some differences between the disturbance observer-based model predictive controller for grid-connected inverters [45], [46] and the proposed approach.In the observerbased techniques, the input and output information of the controller is considered to be measured and the system parameters are assumed to be known.Then, the full state variables and the grid voltage could be observed.However, the proposed approach not only estimates the full state variables but also identifies the system parameters.The authors experimentally compared the observer-based method [45] with their proposed method.To do this, the observer-based method [45] was tuned and implemented on the circuit, which is presented in Fig. 7. Fig. 14 illustrates the behavior of the three-phase currents and voltage of one of the phases at the PCC.Fig. 14 (a) illustrates the evaluation of the state variables by utilizing the observer-based controller [45] and tuning the controller for the case L g = 8.8mH.Then, by considering the same  controller, we change the grid inductance from L g = 8.8mH to L g = 13.2mH.The evaluations of the state variables are demonstrated in Fig. 14 (b).Although the observer-based method [45] is robust against system uncertainty, however, the approach is not optimal for the case that the system parameters is changed from one value to another.VI.CONCLUSIONS This paper proposed an online algorithm to identify the grid parameters, estimate the state variables, and design a constrained predictive controller for the AFE power electronic converters.The algorithm provided a framework to not only improve the performance of the converter in terms of settling time, steady-state error, and the percentage of the overshoot but also consider hard constraints on the amplitude of the input and output variables.In this algorithm, the constraints, which need a higher computational effort, were only used when the constraints were not satisfied on the system.Thus, the probability of loss of data will be reduced.Besides the identification and control algorithm, different load conditions and reference setpoints provided a new optimal weighting factor by using the PSO method.A novel ANN-based weighting factor design algorithm was implemented to find the optimal set of weighting factors; and then update them in each iteration of the control algorithm.Then, the validity and applicability of the proposed algorithm were experimentally tested in the PowerLabDK.As illustrated in the experimental results, the proposed algorithm could identify the system parameters with an accuracy of 96%.Additionally, the transient and steady-state responses of the system variables are improved significantly.
denote three-phase inductor and resistance, respectively.d a , d b , and d c denote the duty cycle of each leg.The equation (

Fig. 2 .
Fig. 2. The flowchart of the proposed online parameter estimation and predictive control of grid connected VSC.

Fig. 4 .
Fig. 4. Controlled active current and identified grid inductance by changing the grid parameters and reference of the active current.

Fig. 5 .
Fig. 5. Sensitivity of the controller on the parameter changes.

Fig. 6 .
Fig. 6.Controlled active current and identified grid inductance for the fixed weighting factor by changing the grid parameters.The elected weighting factor is assigned for the case Lg = 13.2mH in parameter search block.

Fig. 8 .
Fig. 8. Estimating the state variables at the PCC and evaluate the performance of the proposed algorithm by changing the reference current.

Fig. 9 .
Fig. 9.The measured state variables at the PCC, when the reference current is changing.The bottom and top signals in scopes illustrate the three-phase current and the voltage of one of the three phases, respectively.

Fig. 10 .
Fig. 10.Identifying the grid impedance changes using proposed approach.The transient performance of the measured variables at the times t2 and t6.The bottom and top signals in scopes illustrate the three-phase current and the voltage of one of the three phases, respectively.
This article has been accepted for publication in IEEE Journal of Emerging and Selected Topics in Power Electronics.This is the author's version which has not been fully edited and content may change prior to final publication.Citation information: DOI 10.1109/JESTPE.2022.3214342© 2022 Crown Copyright.Personal use is permitted.For any other purposes, permission must be obtained from the IEEE by emailing pubs-permissions@ieee.org.Authorized licensed use limited to: Danmarks Tekniske Informationscenter.Downloaded on October 18,2022 at 13:10:07 UTC from IEEE Xplore.Restrictions apply.

Fig. 11 .
Fig. 11.Evaluations of the measured variables at the PCC for PI controller by changing the impedance of the grid.The bottom and top signals in scopes illustrate the three-phase current and the voltage of one of the three phases, respectively.

Fig. 12 .
Fig. 12. Evaluations of the measured variables at the PCC for MPC controller by changing the impedance of the grid.The bottom and top signals in scopes illustrate the three-phase current and the voltage of one of the three phases, respectively.

Fig. 13 .Fig. 14 .
Fig. 13.The first 20 harmonics of the current.The red and blue lines illustrate the proposed MPC approach and the conventional PI one, respectively.
This article has been accepted for publication in IEEE Journal of Emerging and Selected Topics in Power Electronics.This is the author's version which has not been fully edited and content may change prior to final publication.Citation information: DOI 10.1109/JESTPE.2022.3214342 © 2022 Crown Copyright.Personal use is permitted.For any other purposes, permission must be obtained from the IEEE by emailing pubs-permissions@ieee.org.Authorized licensed use limited to: Danmarks Tekniske Informationscenter.Downloaded on October 18,2022 at 13:10:07 UTC from IEEE Xplore.Restrictions apply.
This article has been accepted for publication in IEEE Journal of Emerging and Selected Topics in Power Electronics.This is the author's version which has not been fully edited and content may change prior to final publication.Citation information: DOI 10.1109/JESTPE.2022.3214342 © 2022 Crown Copyright.Personal use is permitted.For any other purposes, permission must be obtained from the IEEE by emailing pubs-permissions@ieee.org.Authorized licensed use limited to: Danmarks Tekniske Informationscenter.Downloaded on October 18,2022 at 13:10:07 UTC from IEEE Xplore.Restrictions apply.

TABLE III CHANGES
IN THE GRID INDUCTANCE AND CURRENT