Adaptive Predictive Control with Neuro-Fuzzy Parameter Estimation for Microgrid Grid-Forming Converters

: Model predictive control (MPC) is a ﬂexible and multivariable control technique with better dynamic performance than linear control. However, MPC is sensitive to parametric mismatches that reduce its control capabilities. In this paper, we present a new method of improving the robustness of MPC to ﬁlter parameter variations/mismatches by easily implementable parameter estimation. Furthermore, we extend the proposed technique for wider operating conditions by novel neuro-fuzzy estimation. The results, which are demonstrated by both simulations and real-time hardware-in-the-loop tests, show a steady-state parameter estimation accuracy of 95%, and at least 20% improvement in total harmonic distortion (THD) than conventional non-adaptive MPC under parameter mismatches up to 50% of the nominal values.


Introduction
Grid-forming converters hold an important place in microgrids powered by converterinterfaced renewable distributed energy resources (DERs). In AC microgrids, they have four necessary requirements, viz [1]: (1) During normal power system operations, they function as AC voltage sources. (2) During transient conditions arising from sudden power changes to the power system, they still operate as voltage sources, but observe safety limits for self-protection (e.g., current limits). (3) They can work without connection to the main grid, and provide voltage and frequency references to the network they operate in. (4) They could be required to provide black start services and grid restoration after a blackout; this would require supplementary energy storage.
The comprehensive requirements of grid-forming converters (hereafter called converters for simplicity) are difficult to achieve with conventional linear control techniques. For this reason, model predictive control (MPC), a robust, multi-variable control technique has been identified as a highly promising candidate for converters [2]. The performance of model predictive control is highly dependent on the accuracy of the prediction model of the controlled system. It has been shown that prediction errors are not only caused by parametric mismatches, but also by instantaneous values of load current and voltage-and this is dominantly manifest with inductance mismatches and negligible with resistive mismatches [3]. Thus, whenever mismatches occur between the system parameter values utilized in the model (nominal values) and the actual/physical values, it results in control errors. These errors manifest as persistent steady-state offsets [4] and distorted output signals [5]; these even deteriorate further in transient situations. Other factors that cause model mismatches include temperature, measurement errors, operational time of use of the equipment/electronics, etc. The methods to address the MPC-based parameter accuracy errors are grouped as model-free, disturbance estimation, and adaptive model techniques.
Model-free methods do not require a prior knowledge of the plant [6][7][8], but their accuracy is determined by the sampling frequency [9,10]. In addition, some of them (including Kalman filter, deadbeat, sliding mode, least-square-based) have utilized complex and computationally-intensive algorithms or require extra measurements [11,12]. Disturbance estimation methods estimate the disturbance caused by parameter mismatches and uncertainties, and provide a feedforward compensation [13,14]. Adaptive parameter predictive control (which is less computationally demanding) utilizes an online estimate of the actual parameter in the prediction model, and this results in more accurate controls [5,15]. Nonetheless, there are few investigations on adaptive predictive control, and existing solutions are constrained by the limited range of the operational application.
The robustness and accuracy of MPC can be improved with online parameter estimation. This reduces the errors that arise from mistmatch between physical and control model parameter values. In [16], the estimation of inductance and resistance was reported for the voltage-oriented control of three-phase pulse-width modulated (PWM) rectifiers, but it required significant tuning efforts for the adaptive rate. A Lyapunov-based estimation of inductance for a model reference adaptive system reported in [17], aided the improvement in line voltage estimation accuracy for an active front-end (AFE) rectifier. Several estimation methods are focused on the application to balanced grid conditions, e.g., the least square method in [18]. The authors of [19,20] investigated inductance estimation (by gradient correction and Kalman filter) under distorted grid conditions. The proposed solutions reduced both harmonics and ripples but with a high computational burden.
In recent times, power electronics researchers have sought to explore data-based methods as alternatives to model-based techniques [21,22]. Some benefits reported in the literature are the improvement of reliability (sensor reduction) [23,24], and reduction of hardware requirements [25]. One artificial intelligence (AI) data-based method is neurofuzzy control, and it is a hybrid of fuzzy logic and artificial neural networks (ANN) [26]. The membership functions used in a fuzzy controller can be auto-tuned (with a higher degree of accuracy than heuristic techniques) by offline ANN training done with historical input-output data of the plant. Although the neuro-fuzzy controller has an increasing computational burden as the fuzzy subsets increase, it has the advantage of being operable over a wider range of operating conditions than conventional controllers [27]. Hence, an optimal trade-off between accuracy and cost is done in applications to converter control for microgrids [28] and electrical drives [29,30].
The above literature review indicates that auto-tuned parameter estimation can improve predictive control's robustness to parameter variation/mismatch. Moreover, the neuro-fuzzy method, which is a hybrid of expert-knowledge and data-based design, is yet to be applied to either microgrid parameter estimation or MPC. Furthermore, many of the proposed solutions operate around a specific operating point, requiring re-tuning with a change in operating conditions. Motivated by these, this paper proposes novel parameter auto-tuning for MPC using two methods. First, a simple estimation procedure for a specific operating point and second, a neuro-fuzzy based estimation of parameter variation that can cover a wider operational range. Please note that the estimation being proposed in this control scheme is the estimation of the amount of filter parameter (L or C) variation relative to its pre-known nominal value. The major contributions of this work are highlighted as follows:

1.
We present a theoretical analysis of LC-filter parameter variation dynamics (Section 3.1); 2.
To extend the operational range of the estimator, we introduce a new neural-trained fuzzy logic parameter estimator for islanded AC microgrids (Section 4.2); 3.
The new estimator is then embedded in a comprehensive adaptive predictive control scheme for microgrid converters (Section 3). The overall scheme has much better performance than a conventional MPC under parametric mismatches, with results verified via extensive simulations and hardware-in-the-loop (HiL) experiments.
The organization of the paper comprises the introduction of MPC for converters in Section 2, the underlying principles of an adaptive neuro-fuzzy control in Section 4, and the proposed adaptive MPC control schemes in Section 3. The results and conclusion are provided in Sections 5 and 6 respectively.

Conventional Dual-Objective Model Predictive Inverter Control
An AC microgrid with inverter-interfaced distributed generation and common AC loads is shown in Figure 1. This section will introduce the fundamental principles for the predictive control of inverters, as a basis for later developing the proposed adaptive MPC system in Section 3.

LC Filter
Assuming the inverter in Figure 1 has identical filter parameter values in all three phases (i.e., inverter legs), we invoke Clarke's transformation to obtain the αβ transformation of the three-phase current and voltage vectors: where K = 1 3 1 e j 2 3 π e j 4 3 π . By Kirchoff's current and voltage laws, the LC filter is modeled in continuous-time state-space as: The variables R f , L f , and C f represent the filter resistance, inductance, and capacitance respectively. The filter current is The discrete-time state space model of Equation (2) is achieved using zero-orderhold (ZOH) with a sampling period T s , and to account for digital computational delays, the two-step-forward prediction is employed as: where A d = e AT s and B d = T s 0 e Aτ Bdτ. In practice, the load current i o is of slow dynamics (grid frequency); thus it can be assumed constant within two samples (i o (k + 1) ≈ i o (k)), without any loss of accuracy.

Cost Function
Minimizing the Euclidean distance error of tracking both i f and v f will yield more accurate results than tracking either alone due to the cross-coupling between them (see Equation (2)). The cost function in Equation (4) achieves the dual-objective tracking.
where χ i is the current term weighting factor, χ u penalizes the switching effort u sw (k) = ∑ |u(k) − u(k − 1)|, and the fourth term accounts for the physical current limits on the device as: Equation (6) The reference current is given by [31]:

Droop Relationship
The droop curve dictates how power drawn by the common load is shared between parallel connected inverters and is given by the following equations: where k p and k q are MG droop coefficients for frequency-active-power and voltage-reactivepower respectively.

The Proposed Adaptive MPC Scheme
In this section, a new parameter variation estimation method will first be introduced; next, its application to predictive control will be illustrated.

Parameter Estimation and Adaptive Model Update
The proposed adaptive MPC scheme is described by Figure 2. The main difference between this scheme and the conventional scheme is that the output current, filter current, and voltage are utilized to first estimate the variation in the filter inductance and capacitance from their nominal values L f and C f , respectively. Since MPC's prediction errors from parametric mismatches are negligible for resistive mismatches and dominant in passive energy-storage elements [3], this study attends only to inductive and capacitive mismatches/variations from their nominal values. We define δ y to indicate the sign of the parameter mismatch relative to the nominal value. δ y ∀ y ∈ [C, L] as:

Inductance Variation Estimation
With reference to Figure 5, the difference between the voltage at the inverter output v i and the voltage across the filter capacitor v f is linearly proportional to the rate of change of inductor current i f . Therefore, when there is an inductance variation ∆L, the instantaneous After algebraic operations as explained in Appendix A.1, the normalized capacitance variation becomes: where and δ L is as defined in (10).

Capacitance Variation Estimation
The capacitance variation dynamics is: Hence, the normalized capacitance variation is determined by the linear relationship in Equation (14). After algebraic operations as explained in Appendix A.2, the normalized capacitance variation becomes: where n 1 = 1/(C f v f_amp ) and n 2 is a tuned coefficient, v f_amp is the amplitude of v f , , and δ C is as defined in (10).

Adaptive Model Update
Equations (10)- (14) together define how the proposed adaptive estimation method gives the estimated parameterŷ at the kth sampling instant as: and this is illustrated in Figure 3. The estimated variations ∆L L and ∆C C are processed using the adaptive estimator in Figure 3 to generate the updated inductanceL and updated capacitanceĈ respectively. This is done for every sample. The updated parameters are used to compute the state-space matrices A and B whose terms are needed to predict the values of i p f and v p f . After the parameters have been updated as described by Equation (15), they are used to update the system matrices as:

Virtual Impedance
The prediction model in (3) becomes modified to: whereÂ d = eÂ T s andB d = T s 0 eÂ τB dτ. The cost function in (4) still applies.

The Proposed Neuro-Fuzzy Parameter Estimator
In this section, the principles underlying adaptive neuro-fuzzy control will be introduced as a foundation for application to the proposed parameter estimation scheme.

Principles of Adaptive Neuro-Fuzzy Control
A neuro-fuzzy control system combines the principles of fuzzy systems and artificial neural networks (ANN) to regulate the relationship between inputs and outputs. In general, ANN is applied to improve the accuracy of an initially-designed fuzzy controller according to historical data, and this will be further explained in the following discussion. Figure 4 shows the outlay of this paper's neuro-fuzzy scheme. It comprises four layers: Input layer, membership layer, rule layer, and the output layers [32,33].

Input Layer
Membership Layer Output Layer Rule Layer

The Input Layer
comprises inputs x 1 , x 2 . In this study, the inputs are the inductance variation dynamics v and capacitance variation dynamics i , as defined in Equations (11) and (13) (18), to give l r , where w ij is the weight between membership and rule layers, taken as one, µ ij is membership function i with neighbor j, for each input x i .

The Output Layer
in this case is a single node that computes results as in Equation (18), where w ij , µ ij , and x i are as earlier defined, N r is the total number of rules, and N mf is the total number of membership functions [32,33]:

Neuro-Fuzzy Parameter Estimation
Due to its adaptability to a wide range of operating conditions, we propose the following neuro-fuzzy parameter estimation scheme, which follows from preceding discussions. The earlier defined parameter variation dynamics v and i are necessary inputs for the neuro-fuzzy estimator. The overall structure of the control scheme is shown in Figure 5. It comprises a four-leg, H-bridge, three phase inverter whose switching is dictated by the adaptive MPC scheme that will be further described below. The LC-filter voltage and current variation dynamics (v and i respectively, earlier defined in Equations (11) and (13)) are fed into the neuro-fuzzy parameter estimation and update block; an integrator is used to smoothen the signals by filtering high frequency components. After the neuralnetwork-based training of membership functions, the estimation block accurately estimates parameter mismatches (∆L and ∆C) to a maximum mean square error less than 5%. Thus the updated parameters for the prediction model areL = L f + ∆L andĈ = C f + ∆C. The workflow to achieve the trained neuro-fuzzy estimator is shown in Figure 6. About seven million data points were generated with the conventional MPC model while the nominal filter parameters where increased in linear scales of 10% up to 50%. For instance for the inductance, we had L f to 0.5L f . This was done for events including load step changes too. The data were then used to train the initial membership functions created (see Figure 7a). Details on rules regarding selections of appropriate membership functions are outside the scope of this paper, but can be found in [33]. The initial membership functions were designed with MATLAB Simulink Fuzzy Logic Toolbox by expert knowledge of the system, in such a manner that they model the relationship between input and output signals (here, the input signals are v and i , and the output signals are ∆L and ∆C). As earlier mentioned in Section 4, the bell-shaped membership functions were used here (Figure 7a). These were then trained offline, using MATLAB Simulink's Neuro-Fuzzy Toolbox, for improved accuracy with the system's input-output data from simulation runs, resulting in the trained functions shown in Figure 7b. The trained system had 4.2 million training data pairs, 2.5 million checking data pairs, 35 nodes, 9 linear parameters, 18 nonlinear parameters, and 9 fuzzy rules.

Results and Discussion
The simulative and real-time hardware-in-the-loop results are presented in this section. The discussion is done under headings of system description, parameter estimation, transient performance, steady-state performance, and parametric robustness.

System Description
The proposed control scheme was tested via both simulations and HiL demonstrations. The overall system topology and control scheme are depicted in Figure 2, and the system parameters are provided in Table 1. The simulation tests were carried out with MATLAB/Simulink software, while the real-time HiL tests were done with two PLECS RT-Box 1 real-time systems which exchange digital pulse-width modulation and analog signals: One for the controller, and the other for the plant subsystem. The laboratory testbench is shown in Figure 8.

Parameter Estimation
Both parameter estimation methods earlier described in Sections 3 and 4 have identical levels of accuracy. Therefore, for the simulation results in this section, only results for the neuro-fuzzy parameter variation estimation are shown. Figure 9 shows the estimation results for filter capacitance. The designed estimator was able to detect the deviation from the nominal values with a high degree of accuracy. The capacitance estimation has ripples that are higher as the mismatch with nominal grows. Similarly, inductance estimation results are illustrated in Figure 10, and it is observed that for both values tested, the estimator came within a high degree of accuracy. The mean square training and checking errors during the neuro-fuzzy training process were 4.73% and 4.12% respectively. In addition, higher training error values were observed with load step change data-as high as 11.5%. For parameter estimation errors less than 10%, identical power quality as using the actual values is obtainable.

Parameters
Symbols Values     Figure 11 is a plot of the simulated performance of the proposed neuro-fuzzy-based estimation and adaptive MPC control with a step chanve in active and reactive powers. During the transient operation, rapid and robust transient responses are desired, and these were achieved using the adaptive neuro-fuzzy MPC scheme in Figure 5. Figure 11 shows that during the transient period (initiated at 0.1s), the proposed control scheme did not lose tracking performance, the voltage ripples are very low, while transient distortions are minimized, due to the effective parameter estimation and compensation for the mismatch in the inductance.

Steady-State Performance
The steady-state performance will inquire into the relationship between the average switching frequency (as regulated by the switching effort weighting factor χ u ) on the output voltage and current THDs. We achieved this by maintaining the weighting factor for current χ i constant at 3 (gives optimal performance among other heuristically tested values), while χ u was varied from 0 to 70 in unit steps. The results (comparing conventional MPC and the proposed adaptive MPC) are plotted in Figure 12. The average switching frequency was calculated with f sw = ∑ N k=1 u sw (k) 3NT s , where N is the number of samples per second (i.e., 800 for T s = 25 µs). THDs were obtained with MATLAB/Simulink's spectrum analyzer. The voltage THD decreased with switching frequency: From 2.5% at 5 kHz to 0.5% at 12 kHz. These results are for nominal filter parameters, and indicate that the proposed method has similar steady-state performance as the conventional MPC.  Figure 13 illustrates the voltage and current sensitivities to a wide range of parameter variations. These figures show a broader view of the performance of the proposed control algorithm. Adaptive MPC voltage THD has a lower range (3%) than conventional MPC (8%), for almost all ranges of parameter variations of filter inductance and capacitance. In addition, adaptive MPC current THD has a lower range (12%) than conventional MPC (18%).

Real-Time Hardware-in-the-Loop Verification
In this section, the real-time HiL performance will be discussed. We set up the test micrgrid system on a test bench made up of PLECS RT-Box 1 real-time HiL equipment.

Transient Performance
During the transient, operation rapid and robust transient responses are desired. Figure 14 shows that during the transient period, the proposed control scheme did not lose tracking performance.  Figure 15 are for conventional MPC, while the right-hand plots are for adaptive MPC. Comparing the top plots (voltage) shows that the proposed adaptive MPC scheme produces significantly less distortion than the left waveform (63.2% THD reduction). Similarly, the adaptive MPC current waveform on the right is less distorted than the waveform on the left, i.e., 47.6% THD reduction. These results point to the robustness of the proposed control scheme to parameter variations.

Conclusions
The performance of predictive-controlled converters deteriorates with parametric mismatches. In this paper, we demonstrated a solution to this problem via the design of a parameter estimator for an operating point, and neuro-fuzzy parameter estimator for wider operating conditions. The latter's advantages came at the price of a higher estimation computation burden. The simulation and HiL results have demonstrated the effectiveness of the proposed adaptive predictive control of grid-forming converters with an improved power quality and robustness to parameter uncertainties.
In future, we would be interested in examining how other intelligent/data-based methods reduce the computational burden without compromising the performance.
Since i f is sinusoidal, the RHS is a sine wave too. The evaluation of the integral results in: where κ is an integration constant. Normalizing with the nominal inductance L f gives: The MATLAB/Simulink and PLECS implementation of (A7) is in the form: where i f_amp is the amplitude of i f , m 2 is a tuned term, and, Equations (A8) and (A9) together define how the proposed adaptive estimation method operate to give the estimated inductanceL at the kth sampling instant as (A10) and this is illustrated in

. Capacitance Variation Estimation
Applying Kirchoff's current law to Figure 2, we have: where all variables are as earlier defined. When there is a small variation in the capacitance ∆C, and for a difference current at nominal inductance (i f − i o )| C f , we write (A11) as: We define the difference (A11) and (A12) as: The evaluation of the integral becomes: where κ c is an integration constant. Normalizing with the nominal inductance C f gives: The MATLAB/Simulink and PLECS implementation of (A16) is in the form: where v f_amp is the amplitude of v f , n 2 is a tuned term, and Equations (A17) and (A18) together define how the proposed adaptive estimation method operate to give the estimated capacitanceĈ at the kth sampling instant asĈ(k) = C f 1 + ∆C(k) C f , and this is illustrated in Figure 3.