A Neural-Network-Based Model Predictive Control of Three-Phase Inverter With an Output LC Filter

—Model predictive control (MPC) has become one of the well-established modern control methods for three-phase inverters with an output LC ﬁlter, where a high-quality voltage with low total harmonic distortion (THD) is needed. Though it is an intuitive controller easy to understand and implement, it has the signiﬁcant disadvantage of requiring a large number of online calculations for solving the optimization problem. On the other hand, the application of model-free approaches such as artiﬁcial neural network-based (ANN-based) approaches is currently growing rapidly in the area of power electronics and drives. This paper presents a new control scheme for a two-level converter based on combining MPC with feed-forward ANN, with the aim of getting lower THD and improving the steady and dynamic performance of the system for different types of loads. First, MPC is used, as an expert, in the training phase to generate data required for training the proposed neural network. Then, once the neural network is ﬁne-tuned, it can be successfully used online for voltage tracking purpose, without the need of using MPC. The proposed ANN-based control strategy is validated through simulation, using MATLAB/Simulink tools, taking into account different loads conditions. Moreover, the performance of the ANN-based controller is evaluated, on several samples of linear and non-linear loads under various operating conditions, and compared to that of MPC, demonstrating the excellent steady-state and dynamic performance of the proposed ANN-based control strategy.


I. INTRODUCTION
The three-phase inverter is an extensively popular device, which is commonly used for transferring energy from a DC voltage source to an AC load.The control of three-phase inverters has received much attention in the last decades both in the scientific literature and in the industry-oriented research [1], [2].In particular, for applications such as uninterruptible power supplies (UPSs), energy-storage systems, variable frequency drives, and distributed generation, the inverters are commonly used with an output LC filter to provide a highquality sinusoidal output voltage with low total harmonic distortion (THD) for various types of loads, especially for unbalanced or nonlinear loads [3]- [7].However, the performance of the inverter is mainly dependent on the applied control technique.These controllers must cope with the load variations, the non-linearity of the system, and ensuring stability under any operating condition with a fast transient response [8].
Just to name a few, the major drawback of non-linear methods (e.g., HVC), which require high switching frequency for effective operation, is having a variable switching frequency which creates resonance problems which reduce the converter's efficiency [26], [27].On the other hand, although the linear methods, which require carrier-based modulators, have the advantage of constant switching frequency, their dynamic response is weak comparing with HVC, because of the slow response of the modulator.However, both linear and nonlinear methods are extensively used for generating the switching signals of the inverter because of the simplicity of the controller implementation.Another example is deadbeat control which provides fast transient response, however, it has high sensitivity to model uncertainties, measurement noise, and parameter perturbations, in particular for high sampling rates.Other modern control approaches based on H ∞ control theory [28] and µ synthesis [29] have been proposed, with the aim of handling the possible uncertainties in the system.
Model predictive control (MPC) has become one of the well-established modern control methods in power electronics, particularly for three-phase inverters with LC filter according to [1], [26], [30]- [32].The key characteristic of MPC is to explicitly use the model of the system to predict the future behavior of the variables to be controlled, considering a certain time horizon.Afterwards, MPC selects the optimal control action (i.e., optimal switching signals) based on the minimization of a pre-defined cost function, which represents the desired behavior of the system [33]- [35].The main features of MPC can be summarized as: (i) an intuitive controller easy to understand and implement, with a fast dynamic response; (ii) the simple inclusion of system constraints and nonlinearities, and multivariable cases; (iii) the flexibility to include other system requirements.On the other hand, a major drawback of MPC is that it requires the optimization problem to be solved online, which involves a huge amount of real-time calculations.However, different solutions have been introduced in order to address this problem, as proposed in [31], [36], [37].
On the other hand, the application of data-driven methodologies (or model-free approaches, particularly artificial neural networks ANNs-based approaches) is currently growing rapidly in the area of power electronics and drives.These can be used for describing the behavior of the complex systems [38].In particular, ANN-based controllers and estimators have been widely used in identification and control of power converters and motor drives [39].As an example, they can be used to estimate the rotor speed, rotor-flux, and torque of induction motors [40]- [42], in addition to the identification and estimation of the stator current of induction motor drives [43].Moreover, several ANN-based methods have been used in control of power converters, as presented in [44]- [47].Indeed, the ANN-based controllers have some advantages compared to other control methods such as: (i) their design does not require the mathematical model of the system to be controlled, considering the whole system as a black-box; (ii) they can generally improve the performance of the system when they are properly tuned; (iii) they are usually easier to be tuned as compared to conventional controllers; (iv) they can be designed based on the data acquired from a real system or a plant in the absence of necessary expert knowledge.But, they require a large number of training data.However, as the present work suggests, this is not a major drawback because large amounts of data can be obtained using reliable simulation tools.
By taking advantage of the flexibility of MPC at training time, this paper proposes a feed-forward ANN-based controller for a three-phase inverter with output LC filter for UPS applications, with the aim of getting lower THD and good performance for different types of loads.The proposed controller undergoes two main steps: (i) the use of MPC as an expert or a teacher for generating the data required for training off-line the proposed neural network using standard supervised learning, under full-state observation of the system; (ii) once the offline training is performed, the trained ANN can successfully control the output voltage of the inverter, without the need of using MPC at test time, as illustrated in Fig. 1.A performance comparison between the proposed ANN-based approach and the conventional MPC, under various operating conditions, is studied.To the best of our knowledge, the control of a threephase inverter with an output LC filter using a feed-forward ANN-based MPC has not been reported in the literature.
The rest of the paper is organized as follows.Section II deals with the mathematical model of the three-phase voltagesource inverter with LC filter, whereas in Section III the proposed predictive controller strategy is explained.The ANNbased control scheme proposed in this paper is described in Section IV.In Section V, simulation implementation and results are discussed for both proposed control schemes, then the conclusion is provided in Section VI.

A. System description via Clarke transformation
The power circuit of the three-phase voltage-source inverter considered in this paper is depicted in Fig. 2. In the present case, the load is assumed to be unknown, while the models of the converter and filter are presented [30].Moreover, the two switches of each leg of the converter operate in a complementary mode, in order to avoid the occurrence of short-circuit conditions.Thus, the switching states of the converter can be represented by the three binary switching signals, S a , S b , and S c , as follows: where a = e j(2π/3) .It is noteworthy that the switching devices are assumed to be ideal switches, therefore the process of switching-ON/-OFF is not taken into consideration [32].The possible output-voltage space vectors generated by the inverter can be obtained by where v aN , v bN , and v cN represent the phase-to-neutral, N , voltages of the inverter.On the other hand, the voltage vector v i can be defined, in terms of the switching state vector S and the dc-link voltage V dc , by Fig. 3 illustrates the eight switching states and, consequently, the eight voltage vectors generated by the inverter using (1) and ( 3), considering all the possible combinations of the switching signals S a , S b , and S c .It is noteworthy that only seven different voltage vectors are considered as possible outputs, since v 0 = v 7 .
Similarly, as in (1), the filter current i f , the output voltage v c , and the output current i o can be expressed in the vectorial form as

B. LC filter modeling
As far as the model of LC filter is concerned, it can be described by two equations, the former describes the inductance dynamics, whereas the latter describing the capacitor dynamics [1].These two equations can be written as a continuous-time state-space system as where L and C are the filter inductance and the filter capacitance, respectively.The output voltage v c and the filter current i f can be measured, whilst the voltage vector v i can be calculated using (3).The output current i o is considered as a disturbance due to its dependence on an unknown load, whereas the value of V dc is assumed to be fixed and known.The output voltage v c is considered as the output of the system, which can be written as a state equation as v c = 0 1 x.Then, using (7), the discrete-time state-space model of the filter can be obtained for a sampling time T s as This model is used by the predictive controller (i.e., MPC) to predict the output voltage v c for all given input voltage vector v i .Then, for predicting the output voltage v c using (8), the output current i o is needed and can be estimated using (9), assuming that i o (k−1) = i o (k) for sufficiently small sampling times T s as proposed in [1], [35].

III. MODEL PREDICTIVE CONTROL FOR NEURAL NETWORK
In this paper, the model predictive control (MPC) proposed in [30], and which provides the state-of-art of output-voltage control of three-phase inverter for UPS applications, has been used: (i) to generate the data required for the off-line training of the proposed neural network, and (ii) to compare its performance with the proposed ANN-based controller under linear and non-linear load conditions.

A. Proposed Predictive Controller Strategy
In the proposed control strategy, it has been assumed that the inverter generates only a finite number of possible switching states and their corresponding output-voltage vectors, making it possible to solve the optimization problem of the predictive controller online [1].MPC exploits the discrete-time model of the inverter to predict the future behavior of the variables to be controlled, for each switching state.Thereafter, the optimum switching state is selected, based on the minimization of a predefined cost function, and directly fed to the power switches of the converter in each sampling interval T s , without the need for a modulation stage.The cost function to be minimized has been chosen in order to achieve the lowest error between the predicted output voltage and the reference voltage.In this work, a cost function J which defines the desired behavior of the system is expressed in orthogonal coordinates by where v * cα and v * cβ are the real and imaginary parts of the output-voltage reference vector v * c , while v cα and v cβ are the real and imaginary parts of the predicted output-voltage vector v c (k + 1).

Minimization of cost function
Predictive model The block diagram of MPC, considering only one-step prediction horizon, for a three-phase inverter with output LC filter is shown in Fig. 4. The control cycle of the predictive controller at sampling instant k is described as a pseudo code in Algorithm 1 with more detail.Line 1 of the code declares the control function, where the switching signals S a , S b , and S c are the outputs, while the inputs are the measured variables of the filter current i f (k), the output voltage v c (k), and the reference voltage v * c (k) at sampling time k, all expressed in αβ coordinates.The two variables, i f (k − 1) and v c (k − 1), are recalled from the previous sampling instant (lines 7 to 9), which are firstly initialized for k = 1 (lines 3 to 6).These two variables are used to estimate the output current i o (k) given by ( 9) (line 10), in order to obtain the possible predictions of v c (k + 1) using (8).
The optimization problem to be solved is performed between lines 12 and 20.The code sequentially selects one of the seven possible voltage vectors v i generated by the inverter based on (3) (line 13) and applies it, in order to obtain the output voltage prediction v c (k + 1) at instant k + 1, as in line 14.The cost function given by ( 10) is used to evaluate the error between the reference and the predicted output voltage at instant k + 1 for each voltage vector (line 15).The code selects the optimal value of the cost function J opt , and the optimum voltage vector x opt is then chosen (lines 16 to 19).Note that, J opt is initialized with a very high value (line 11).Finally, the switching states, S a , S b , and S c , corresponding to the optimum voltage vector are generated and applied at the next sampling instant, as illustrated in Fig. 3

B. Discussion
In fact, all the control approaches proposed in the literature, in a way or another, are model-based approaches, which require in general either diverse computational or approximative procedures for applying their solution.In this context, MPC, the widely used approach for three-phase inverters, relies on solving an optimization problem online, leading to a large number of online computations.In other words, the control signal of MPC is determined by minimizing a cost function online at each time instant.The alternative approach to be considered in the present work is to apply neural networkbased function approximators, which can be trained off-line to represent the optimal control law.Such an approach is expected to avoid the drawbacks associated with MPC-based control approaches, does not require the mathematical model of the system to be controlled, does not evaluate a cost function online at each sampling time, and, therefore, does not rely on an optimization problem to be solved online.For this reason, this paper focuses on the control of a three-phase inverter with output LC filter using an ANN-based approach.

A. Proposed Neural Network Architecture
Machine learning, and in particular artificial neural networks, is one key technology in modern control systems.An artificial neural network is an extremely flexible computational model that can be optimized to learn input-to-output mappings based on historical data.Although the most recent developments have focused on larger and larger scale problems (deep learning), improved techniques have also been proposed to improve the reliability of networks of smaller size.The result is a sound and flexible technology.
An artificial neural network (ANN) is composed of a number of simple computing elements organized in layers and linked by weighted connections.Feed-forward networks do not contain loops, so they have a static behavior and can be used to implement memoryless input-to-output mappings.In a feedforward network it is possible to distinguish one input layer, one output layer, and hidden layers that connect the input to the output.
In this work, a feed-forward neural network (fully connected multi-layer perceptron) of the "shallow" type, i.e., one hidden layer, was used to implement the control model.A grid search tuning procedure allowed the selection of a configuration with 15 units in the hidden layer, while the number of input and output units is constrained by the number of input and output variables, respectively.Training was done via the Scaled Conjugate Gradient method [48], which exploits the good convergence properties of conjugate gradient optimization [49] and has the computational advantage of not requiring a line search, nor any user-selected parameters.

B. ANN Training Procedure
The ANN takes as inputs the measured variables of the filter current i f , the output voltage v c , the output current i o , and the reference voltage v * c all expressed in αβ coordinates.For simplicity's sake, the real and imaginary parts of these variables are separately fed to the neural network, bringing the total number of input features to eight.On the other hand, the optimum voltage vector x opt to be applied at each sampling instant constitute the output of the ANN.In fact, the size of the output layer is an array with a length of 7, which represents the indexes of the seven possible voltage vectors v i that inverter generates.The output is one-hot encoded, meaning that at each sampling instant only the index of the optimum voltage vector will be active (i.e., having a value of one), while others will be equal to zero.
The training data, which have been collected by MPC, comprises 70 samples, which are divided into 60 samples for specific resistive loads (i.e., for only R = 1, 3, 5, 7, 10, 15, 20, 25, 30, and 35 Ω), whereas only 10 samples represent the case where the inverter is directly fed a nonlinear load (i.e., diode-bridge rectifier) with different values of R N L and C N L .For each sample, the simulation is run, using MPC, under various operating conditions such as sampling time T s , filter capacitor C, filter inductance L, DC-link voltage V dc , and reference voltage v * c .Then, the input features of the neural network and their targets are stored for training.
For further detailed information about the MPC simulations and training samples that have been used for training the proposed ANN, please refer to: https://github.com/IhabMohamed/MPC-3-Phase-Inverters

C. ANN-Based Controller
As previously mentioned, the ANN-based controller is trained off-line from samples collected via MPC, as shown in Fig. 1.After fine-tuning the ANN, the trained ANN can be used instead of MPC to control the system presented in Fig. 2.
Fig. 5 depicts the proposed block diagram of the ANNbased controller for a three-phase inverter with output LC filter, in order to generate a high-quality sinusoidal output voltage with low THD, considering different types of loads.
The control strategy of the proposed ANN-based controller at sampling time k can be described as follows: 1) measure the value of the filter current i f (k), the output voltage v c (k), and the output current i o (k) at sampling time k.Note that, the output current i o (k) is considered to be a measurable value, without estimation based on (9) or using the observer as in [1]; 2) then, these measured values in addition to the reference voltage v * c (k) are used by the trained ANN in order to explicitly generate the optimum voltage vector x opt to be applied at instant k + 1; 3) finally, the switching states, S a , S b , and S c , corresponding to the optimum voltage vector x opt are applied and directly given to the power switches of the converter each sampling interval T s .

A. Simulation Setup
The Simulink model and the simulations of the system shown in Fig. 2 have been implemented using MAT-LAB (R2018a)/Simulink software components, which runs on Ubuntu 16.04 64 bit, in order to verify the proposed ANNbased control strategy and compare its performance with the conventional predictive controller (i.e., MPC).A lower-end PC has been used for acquiring the training samples, offline training, and online voltage tracking purpose using the proposed ANN approach.In particular, it is equipped with an Intel ® Core i5-4210U 1.70 GHz CPU, 6 GB of RAM, and an Nvidia Geforce ® GPU, and runs Ubuntu 16.04 64 bit.

B. Simulation Results
The simulation of the three-phase inverter system shown in Fig. 2 was carried out, considering linear (i.e., resistive) and non-linear loads, in order to evaluate the behavior of the proposed ANN-based control strategy and compare its performance with that of MPC proposed in Section III.In particular, the steady and dynamic performance of both control strategies are studied and evaluated, taking into account different loads conditions.The parameters of the system are listed in Table I.The behavior of the ANN-based controller in steady-state operation for a resistive load of 5 kΩ shown in Fig. 6, while the behavior of the predictive controller for the same resistive load is shown in Fig. 7.It is noteworthy that the amplitude and the fundamental frequency of reference voltage v * c are set to 200 V and 50 Hz, respectively.It can be seen in the figures that the output voltages v c for the proposed control strategies are sinusoidal with low distortion, particularly for the ANNbased approach which has a THD of only 1.6% compared to 3.95% for MPC.Moreover, it is observed, due to the resistive load, that the output current i o is proportional to the output voltage, whilst the filter current i o measured at the output of the converter shows high-frequency harmonics, especially in the case of MPC, which are attenuated by the LC filter.
The transient response of both the control strategies for noload (i.e., open-circuit) is shown in Fig. 8 and Fig. 9. Here, the filter capacitor C and filter inductance L are set to 50 µF and 3.5 mH, respectively, whilst the sampling time T s is kept constant at a value of 30 µs.It can be seen that the ANN-based controller permits a fast and safe transient response, demonstrating the excellent dynamic performance of the proposed ANN-based control strategy.For MPC, the time elapsed in order to reach steady-state operation and to faithfully track its reference waveform is about 20 ms (1 cycle), which is affected by the change in the load, as illustrated in Table II.On the other side, for the ANN-based controller, it is observed that it takes less than 5 ms for any load, in order to reach steadystate.Furthermore, the output voltage quality of ANN-based approach is improved significantly, with a THD of 0.72% compared to 1.92% for MPC.
As previously mentioned, the proposed ANN is trained offline using a dataset which represents only different values of resistive load under different operating conditions.However, in order to verify the feasibility and effectiveness of the proposed ANN-based controller under realistic conditions, the behavior of the system is tested online considering non-linear loads, such as a diode-bridge rectifier as shown in Fig. 10 and an inductive load.Fig. 11 and Fig. 12 show the behavior of the proposed control strategies for a diode-bridge rectifier, with values C = 300 µF and R = 60 Ω, while the behavior for an inductive load of 0.01 H is shown in Fig. 13 and Fig. 14, considering the same operating conditions presented in Table I and different amplitudes of the reference output voltage.As can be seen in the figures, the output voltage generated by the ANN-based controller outperforms that obtained using MPC for non-linear loads, despite the highly distorted output currents due to feeding a non-linear load.For instance, for MPC, the total distortion in the output voltage for the inductive load was 4.86%, while it was 2.2% for the ANN-based controller.The result of MPC can be improved by using either a smaller sampling time or a higher value of the filter capacitance [32].
In order to achieve a fair comparison and prove the superiority of the proposed ANN-based approach compared to MPC in both transient and steady-state response,     in the first ten samples (i.e., S 1 − S 10 )).It can be noticed that the performance of the ANN-based controller using only sixty training samples is similar to that based on seventy samples (see column 8 and 9 in Table II).
However, for samples S 26 − S 30 , the output voltages obtained using MPC are better than that obtained using the ANN-based controller.Moreover, it can be seen in sample S 49 that the ANN-based approach failed to control the output voltage and track its reference waveform.As a consequence, the UPS does not work properly due to a higher distortion in the voltage.These results could be improved using either (i) a higher sampling frequency, or (ii) a higher value of the filter capacitance C, as illustrated in sample S 50 which represents an improvement of the result of sample S 49 .An alternative solution to be considered to improve the performance of the controller is to increase the number of training instances, taking into account various values of C and T s .In addition, it is observed that having a one-delay step in the input features of the neural network improves its performance to outperform that of MPC.For example, (T HD) AN N of samples S 26 , S 27 , S 28 , S 29 , S 49 is decreased to be 3.72%, 2.39%, 4.08%, 2.35%, 3.86%, respectively.

VI. CONCLUSION
A novel control strategy using a feed-forward ANN in order to generate a high-quality sinusoidal output voltage of a threephase inverter with an output LC filter has been successfully developed and tested, for different types of loads with various operating conditions.The output voltage of the inverter is directly controlled, without the need for the mathematical model of the inverter, considering the whole system as a blackbox.In this work, MPC has been used for two main purposes: (i) generating the data required for the off-line training of the proposed ANN, and (ii) comparing its performance with the proposed ANN-based controller for linear and non-linear load conditions.Simulation results, based on fifty test samples different than those that were used at training time, show that the proposed ANN-based controller performs better than MPC, in terms of a lower THD and a fast and safe transient response, demonstrating the excellent steady and dynamic performance of the proposed ANN-based control strategy.As in any modelbased control strategy, variations in the system parameters inevitably influence the performance of the ANN-based control scheme proposed in this paper.

Fig. 1 .
Fig. 1.An overview of the proposed control strategy: the training phase combines between using MPC for predicting the output voltage of the inverter and collecting data, under full-state observation, for training the neural network proposed.In the test phase, the trained neural network is employed online to control the output voltage of the inverter instead of MPC, considering linear and non-linear loads.

Fig. 3 .
Fig. 3. Eight possible combinations of the gating signals, and their corresponding voltage vectors generated by the inverter in the complex plane.

Fig. 4 .
Fig. 4. Schematic diagram of output voltage control of a three-phase inverter with an output LC filter using MPC.

Fig. 5 .
Fig. 5. Schematic diagram of output voltage control of a three-phase inverter with an output LC filter using ANN-based controller.

Fig. 14 .
Fig. 14.Simulation results of MPC: output voltages in steady-state for an inductive load of 0.01 H and a reference amplitude of 200 V.

Table II
Fig. 13.Simulation results of ANN-based controller: output voltages in steady-state for an inductive load of 0.01 H and a reference amplitude of 200 V.approach, either based on sixty or seventy training samples, outperforms that of MPC, which can be noticed in lower THD and less settling time to reach steady-state (i.e., t ss , as shown