scieee AI-readable full text Open interactive document viewer

Computationally Efficient Sphere Decoding Algorithm Based on Artificial Neural Networks for Long-Horizon FCS-MPC

Zafra Ratia, Eduardo; Granado Romero, Joaquín; Baena Lecuyer, Vicente; Vázquez Pérez, Sergio; Márquez Alcaide, Abraham; León Galván, José Ignacio; García Franquelo, Leopoldo

Abstract

Successful application of finite control set model predictive control (FCS-MPC) strategies with long prediction horizon depends on the careful design of the optimization algorithm. The conventional method involves transforming the problem to an equivalent box-constrained integer least-squares (BILS) formulation that can be solved with branch-and-bound techniques such as the sphere decoding algorithm (SDA). In this work, it is proposed to define an artificial neural network (ANN) to replace the SDA, avoiding its inherent computational variability. Similarly to practical applications of the SDA, the ANN finds an approximate solution of the underlying optimization problem. In contrast, the main benefit of the proposed approach is that it can be implemented in a low-cost microprocessing platform, greatly improving the performance in terms of resources in comparison with other advanced techniques roposed in the literature.

Full text

Depósito de investigación de la Universidad de Sevilla https://idus.us.es/ This is an Accepted Manuscript of an article published IEEE Transactions on Industrial Electronics available at: 10.1109/TIE.2023.3243301. “© 2023 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other Works” IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS Computationally Efficient Sphere Decoding Algorithm based on Artificial Neural Networks for Long-Horizon FCS-MPC Eduardo Zafra, Student Member, IEEE, Joaquin Granado, Vicente Baena Lecuyer, Sergio Vazquez, Fellow, IEEE, Abraham M. Alcaide, Member, IEEE, Jose I. Leon, Fellow, IEEE and Leopoldo G. Franquelo, Life Fellow, IEEE Abstract—Successful application of finite control set model predictive control (FCS-MPC) strategies with long prediction horizon depends on the careful design of the optimization algorithm. The conventional method involves transforming the problem to an equivalent box-constrained integer least-squares (BILS) formulation that can be solved with branch-and-bound techniques such as the sphere decoding algorithm (SDA). In this work, it is proposed to define an artificial neural network (ANN) to replace the SDA, avoiding its inherent computational variability. Similarly to practical applications of the SDA, the ANN finds an approximate solution of the underlying optimization problem. In contrast, the main benefit of the proposed approach is that it can be implemented in a low-cost microprocessing platform, greatly improving the performance in terms of resources in comparison with other advanced techniques proposed in the literature. I. INTRODUCTION MODEL predictive control (MPC) is becoming a prominent research topic in the power electronics field [1], [2]. Particularly, finite control set - MPC (FCS-MPC) strategies are favored in the literature thanks to its straightforward formulation and ease to address the control of complex systems and multiple control targets [3]. In a power converter, there is a set of admissible switching states defined by the topology. This is the so-called finite control set (FCS). Considering control inputs constrained to the FCS, allows one to relatively reduce the problem formulation complexity in comparison to continuous control set MPC methods [4]. Conveniently, in FCS-MPC, the problem is reduced to an exhaustive search algorithm (ESA), i.e. evaluating the FCS candidates in terms of system plant predictions and a cost function that determines the suitability of each The authors gratefully acknowledge the financial support provided by the project PID2020-115561RB-C31 funded by MCIN/AEI/10.13039/501100011033 and the Consejeria de Economia, Conocimiento, Empresas, y Universidad, Secretaria General de Universidades, Investigacion y Tecnologia, under project P18-RT-1340. Eduardo Zafra gratefully acknowledges the financial support provided by the Spanish Ministry of Universities under grant FPU18/02704. Abraham M. Alcaide’s work is supported by Junta de Andalucia under grant P18-RT-1340, and Contrataci´ on de Personal Investigador Doctor. (Convocatoria 2019) 43 Contratos Capital Humano L´ ınea 2. Paidi 2020, supported by the European Social Fund and Junta de Andaluc´ ıa. candidate. However, exhaustive enumeration of all the possible candidates can become intractable depending on the selected prediction horizon length (Np), i.e. the number of time steps considered in these predictions. In particular, the problem complexity grows exponentially with Np. Thus, an ESA-based solution is generally disregarded due to computational issues for Np≥3. There is an important amount of recent research works attempting to mitigate this problem [2], [5]–[7]. The reason is that important closed-loop performance benefits can be achieved by increasing the prediction horizon. In particular, it is possible to achieve a better harmonic performance for a given switching frequency, or reduce the switching frequency for a target harmonic distortion [8], [9]. To overcome these computational issues, a large part of the study of long prediction horizon -FCS-MPC (LPH-FCS-MPC) in the literature has focused on the design and implementation of the optimization algorithm. To solve this problem more efficiently than through exhaustive enumeration, it was proposed to transform the problem into an equivalent boxconstrained integer least-squares (BILS) problem [8]. This enabled the usage of branch-and-bound techniques such as the sphere decoding algorithm (SDA) that can solve the problem without exploring every candidate in the FCS. Research works achieving practical implementation of LPH-FCS-MPC can be categorized in three groups. The first one is characterized by the use of dSPACE platforms, generally reaching up to Np= 4 [5], [10], [11]. These platforms offer excellent rapid prototyping capabilities. However, they are quite expensive (around tens of thousands of dollars). The second group is based on low cost FPGA platforms (hundreds of dollars) [6], [12]– [14]. These implementations achieve great performance as they can generally reach Npranging from 5 to 7. Nonetheless, these proposals usually require hardware programming which is not ideal in terms of design and verification complexity. Finally, other works opt to use intermediate solutions following High-Level Synthesis tools to accomplish implementations in FPGA-based platforms with reduced design complexity [7], [15]. However, the required platforms in this case are more expensive as FPGA resource consumption is higher. Also, the obtained performance is generally lower, with Np= 4. In this paper, it is proposed to imitate the behavior of the SDA by means of an artificial neural network (ANN). The This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS main objective is to establish a method by which LPH-FCS- MPC can be solved reaching large Npwith reduced costs and low computational requirements. ANN-based techniques have been previously proposed in FCS-MPC works. In [16]–[18], an ANN is used to select the optimal weighting factors of the cost function. However, the control algorithm is solved through conventional methods. It is possible to find some works in the literature that propose the usage of neural networks to imitate the control algorithm. However, there are some important differences that can be highlighted. In [19], an ANN-based control strategy is proposed for the output voltage control of an UPS. The ANN is trained with a conventional FCSMPC strategy with Np= 1. The design is validated with simulation results. Thus, there is no proof of experimental validity of this method or extension to long prediction horizons. This limits the proposal practical usefulness as FCSMPC with Np= 1 is not computationally challenging with modern control platforms. In [20], an ANN is proposed to learn an LPH-FCS-MPC problem up to Np= 5. However, experimental assessment is not provided. This step is crucial as the main motivation for the usage of ANN is to obtain a more easily implementable algorithm to solve the LPH-FCS-MPC problem. In [21], an ANN is proposed to imitate the behavior of conventional FCS-MPC up to Np= 3. Experimental validation is provided to show the validity of ANN for practical application. However, usage of the conventional FCS-MPC formulation limits the achievable prediction horizon. Also, control effort limitation is not considered in the formulation. This is an important element as it is known that under no control effort penalty, long horizon FCS-MPC renders the same solution as FCS-MPC with Np= 1 [1]. In contrast to other FCS-MPC ANN imitation works, the proposed approach is trained to learn only the search stage of the LPH-FCS-MPC algorithm. This aims to be a more flexible and generalizable method. Particularly, a conventional SDA is selected as it provides optimality guarantee with much greater efficiency than exhaustive enumeration, while being a sufficiently standard solution in the LPH-FCS-MPC literature. Another benefit is that SDA imitation is relatively well-known in multiple input multiple output (MIMO) communication systems [22] where it is usually employed as information detector. However, SDA has become computationally prohibitive in modern MIMO communication systems and several works have been published on this topic proving that the application of deep learning to MIMO decoding can drastically reduce the complexity of the decoder while preserving its performance [23]–[26]. In particular, the authors of [23] investigate several ANNarchitectures, obtaining promising accuracy with low computational complexity. The major problem of the proposed architectures is their lack of flexibility, causing a performance drop of the detector in varying channels, a common situation in real communication systems but not in LPH-FCS-MPC for power conversion applications where the system model can usually be considered as time invariant [7]–[10]. Thanks to the proposed method, it is possible to achieve viable solutions up to Np={7,8}using a single microprocessing core of a low-cost platform such as the Zynq-7000. In contrast to other LPH-FCS-MPC works, this eliminates the LC Filter f; f; f; f f f ff f o; o; o; o c; c; c; Load Fig. 1. Three-phase VSI with output LC filter circuit. TABLE I SYSTEM VARIABLES AND PARAMETERS Variable Description Lf,CfOutput filter inductor and capacitor if,abc = [if,a if,b if,c]TOutput filter inductor current vo,abc = [vo,a vo,b vo,c]TOutput filter capacitor voltage vi,abc = [vi,a vi,b vi,c]TVSI output voltage vdc DC-link voltage Sabc = [SaSbSc]TVSI switching state io,abc = [io,a io,b io,c]TOutput load current v∗ o,abc = [v⋆ o,a v⋆ o,b v⋆ o,c]TOutput filter capacitor reference voltage fs,TsSampling frequency and sampling period requirement of costly platforms or hardware design knowledge, providing a very accesible methodology to implement LPH-FCS-MPC and incentivize its usage in the industry. The rest of this paper is organized as follows: In Section II, the selected system model and the control problem are presented. Section III is dedicated to illustrate the conventional SDA algorithm. The ANN imitator for SDA solution is described in Section IV. Finally, experimental validation is provided in Section V. II. SYSTEM MODEL AND LPH-FCS-MPC FORMULATION A grid-forming two-level three-phase voltage source inverter (VSI) with output LC filter is selected as the case study for this paper. The electric circuit is shown in Fig. 1. System variables and parameters are summarized in Table I. The prediction model for this system can be expressed in state-space form as shown in Table II 1. By default, magnitudes are referred to the stationary αβ-frame for simplicity. A steady-state Kalman filter is used to estimate the output current value without direct measurement [27]. The filter inductor current, capacitor output voltage and the output load current are the state variables. The control input ukis the switching state of the inverter, Sabc,k with Sx|x=a,b,c ∈ {0,1}. Thus, uk∈V, where V={0,1}3is the FCS which defines the admissible switching positions. The system output ykis a selection of the state variables that the controller aims to regulate. In the particular case of the grid-forming VSI, the output voltage vo,k is selected as the system output. The objective is to follow a 1Inand Onare the identity and zero matrices of dimension n×n, respectively. The matrix Jis: J=0−1 1 0 . Matrix Tαβ abc is the wellknown power invariant Clarke’s transformation matrix. This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS TABLE II DISCRETE PREDICTION MODEL αβ frame UPS system equations State-space model xk+1 =Axk+Buk yk=Cxk State variables xk= [(if,k)T(vo,k)T(io,k)T]T Input uk=Sabc,k Output and reference yk=vo,k ,y⋆ k=v⋆ o,k Matrices A=eAcTs;B=ZTs 0 eAc(Ts−τ)Bcdτ Ac=    O2−1 LfI2O2 1 CfI2O2−1 CfI2 O2O2Jω     Bc=   1 LfI2 O2 O2   Tαβ abcvdc,C=   O2 I2 O2    T sinusoidal reference v⋆ o,k. For the LPH-FCS-MPC formulation, it is useful to define the so-called switching or input sequence Uk, output sequence Ykand output reference sequence Y∗ k. These result from appending the individual inputs and outputs within the prediction horizon in a single array [6], [12]. The desired behavior is imposed by means of a cost function. This function assigns a value to each possible control action that quantifies its suitability and impact in the system to accomplish the control targets. The same conventional cost function defined in [8] is used: Jk= k+Np−1 X ℓ=k ∥yℓ+1 −y⋆ ℓ+1∥2 2+λ∥uℓ−uℓ−1∥2 2.(1) The output voltage regulation is addressed by the first term, as the squared error between output and reference is evaluated. Switching sequences that yield smaller tracking error will present lower costs and be favored by the optimization algorithm. The second term is the control effort penalization. It evaluates the switching effort of imposing a different switching state. Weighting factor λ≥0adjusts the trade-off between the switching effort penalization and output tracking error. Higher values provide lower average switching frequency ¯ Fsw as states that imply switching a semiconductor are deemed less preferable. Due to the impact of this parameter in the formulation, it is also shown in several papers that λcan also greatly affect the computational costs of branch-and-bound techniques when solving the optimization problem [6], [12]. The selection and evaluation of candidates is performed by the optimization algorithm, which seeks the minimization of the cost function. To solve this problem more efficiently, it is convenient to reformulate it as an equivalent BILS-problem. The necessary operations for this particular case are described in [6]. The final result is summarized in the expression: Uopt k=arg min Uk Jk=arg min Uk ∥HUk− ¯ Uunc k∥2 2(2a) s. t. Uk∈ {0,1}3Np,(2b) U(2)= 0U(2)= 1 = 0 = 1 i=2 i=1 i=0 U(1) = 1 U(1) = 0 U(1) = 1 U(1) U(0) = 0 U(0) = 1 U(0) = 0 U(0) = 1 U(0) = 0 U(0) = 1 U(0) = 0 U(0) i=3 Fig. 2. Three-layer SDA search tree (Np= 1). The search pattern is illustrated by arrows. Blue color indicates branches further explored to a deeper level (i−1). Yellow dashed arrows represent a horizontal step (Uk(i) + 1). Red dash-dotted arrows imply backtracking (i+ 1). Red triangle nodes indicate branch pruning. A yellow square indicates a suboptimal solution that was selected as incumbent. The green circle is the optimal solution. where (2b) are constraints that restrict the input sequences to members of the FCS extended for Np. Also, Uunc kis the unconstrained solution to the optimization problem. This can be computed every time step as Uunc k=W−1Fk. Computation of matrices W,Hand vector Fkis described in [8]. Matrix H is a lattice generator which forms a 3Np-dimensional discrete space wherein the solution lies. The optimization problem is equivalent to finding the optimal Ukwithin the lattice with the shortest Euclidean distance Jkto ¯ Uunc k=HUunc kin the transformed space. III. SPHERE DECODING ALGORITHM The conventional SDA for LPH-FCS-MPC applications is a branch-and-bound algorithm that can solve the BILS-problem. Its fundamental principle lies on the successive computation of candidate hyperspheres centered at the unconstrained solution ¯ Uunc k. Each of these hyperspheres contains one candidate sequence from the FCS. It is guaranteed that candidates outside this hypersphere can be disregarded and eliminated from the search process. The SDA seeks to minimize the squared radius of the incumbent hypersphere until the smallest hypersphere is found, which corresponds to the optimal sequence Uopt k. The evaluation of each hypersphere’s squared radius can be successively performed following a sequential process in which each step considers a new component Uk(i). This process is usually illustrated with a tree diagram with 3Nplevels as shown in Fig. 2. Each level presents a predefined number of nodes that append a new individual switching position to the parent branch in component i. Thus, each node is a partial candidate Uk(i: 3Np−1) = Uk(i)Uk(i+ 1) ... Uk(3Np−1)T. The conventional SDA follows a depth-first search strategy where vertical progression to an inferior layer i−1is prioritized. However, when exploring a branch, if the partial cost exceeds that of the incumbent candidate, it is guaranteed that the subsequent nodes growing from this branch will not yield an optimal solution. Thus, these children nodes are not explored. This is done by performing a sidetracking movement, for which, a different switching position Uk(i)is assessed for the current This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS tree layer i. If all the individual switching positions are explored from a parent node and none of them yield a better candidate than the incumbent, the branch can be pruned, effectively deleting all the subsequent children nodes from the search space. This is done by performing a backtracking movement, where the next layer corresponds to the parent node (i+ 1). The imposed search strategy does not allow the algorithm to return to the pruned branches, remaining outside of the algorithm’s scope. In each node, a partial cost is computed and accumulated to the branch cost. The 3Np+ 1 dimensional array, dis used to calculate, store and retrieve these costs following the equation: d(i) = ∥H(i, :)Uk− ¯ Uunc k(i)∥2 2+d(i+ 1),(3) where H(i, :) denotes row iof matrix Hand d(3Np)=0. The SDA provides a certificate of optimality with important computational costs reductions in comparison with exhaustive enumeration. This feature has allowed practical application of several LPH-FCS-MPC works [5]–[7], [12]–[14]. Nonetheless, there is still an important drawback to the SDA method which is its inherently high computational variability. For this reason, it is necessary to introduce computational upper bounds that limit the amount of explored nodes so that a solution can be available within the allowed time, albeit suboptimal [28]. This implies that the SDA search stage may end prematurely. Thus, losing the certificate of optimality and introducing a certain degree of suboptimality that can noticeably degrade performance of LPH-FCS-MPC. This problem has been extensively studied and analyzed in the literature, leading to the proposal of several design and implementation techniques that address this computational concerns to achieve long Np[6], [7], [12]–[14]. However, these proposals present a considerable drawback due to the extensive usage of FPGA resources and the development of hardware designs that are complex in terms of design and verification effort. For this reason, it is proposed to design an ANN that will learn the ideal SDA behavior without computational constraints. The ANN must be able to map the correct solution to each optimization problem in a more computationally efficient manner than the SDA. IV. ARTIFICIAL NEURAL NETWORK FOR SDA IMITATION ANNs are mathematical models inspired by the human brain. Each neuron in the network provides a non-linear function, called activation function, of the sum of its weighted biased inputs [29]. Neurons are usually organized in layers, so the same inputs simultaneously feed all the neurons in the layer. In a deep ANN, layers are stacked. Thus, the outputs of each layer are connected to the next layer inputs. The supervised learning of ANN aims to establish the input-output mapping and functional relationships of complex problems such as the BILS-problem previously formulated [30]. Thus, the optimal sequence provided by the SDA algorithm is equivalent to class in a classification problem. The ANN for MIMO detectors presented in [23] cannot be directly used in LPH-FCS-MPC due to the inherent differences of both applications. In the case of MIMO detectors, the terms in equations (2a) and (2b) are complex and different . . . . . . . . . . . . 1 2 n 8 M n 2 1 M n 2 1 l =1 l =2 l =3 hidden outputinputscaling l =0 Fig. 3. Proposed ANN architecture. The inputs are normalized before feeding the ANN, where Mneurons compose the hidden layers (l= {1,2}), the same number as the inputs, and 8neurons compose the output layer (l= 3). sets of constellations are usually available for transmitting the information (the equivalent of the FCS Vin FCS-MPC). The main difference is related to the Hmatrix, which represents the MIMO channel: it is unknown by the receiver and it is usually time varying in mobile communications. For these reasons, a new ANN specifically designed for the SDA used in LPH-FCS-MPC is proposed. A. Proposed ANN The proposed ANN is a 3-layer neural network with 2 hidden layers, as shown in Fig.3, where ldenotes the layer number. Thus, l={1,2}are the hidden layers, and l= 3 is the output layer. A previous pre-processing block is added to both remove the mean value and to scale the ANN input to unit variance. The inputs of the ANN (commonly called features) are the M= 3Npcomponents of the unconstrained solution Uunc, without transforming to the space generated by H. This reduces the number of online calculations. The number of neurons in the hidden layers is also M, whereas the number of neurons in the output layer was chosen based on the number of switching states of the inverter (8). Some previous simulations showed that neither more neurons per layer nor more hidden layers improve the accuracy results. Each inverter switching state is 8-bit one-hot coded, i.e, each state is represented by an 8-bit number where only one bit is set to “1” and the remaining bits are “0”. Regarding the ANN outputs, the neurons of the output layer encode the switching state of the inverter by means of a softmax function, which is commonly used in other classification applications [31]. That is, each of the eight outputs neurons Wnprovides a value between 0 and 1, with a total sum equal to 1. The higher Wn value is the one-hot coded version of the inverter switching state. The equivalent 3-bit coded version of this state is mapped to the three first components of the optimal sequence Uopt kduring the training process. The softmax function is only This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS # epoch 0.84 0.86 0.88 0.90 0.92 Accuracy Training Validation Stored 0500 1000 1500 2000 2500 0.20 0.25 0.30 0.35 Loss Training Validation Stored # epoch 0500 1000 1500 2000 2500 b)a) Fig. 4. Example of training process (fs= 25 kHz and Np= 7). a) accuracy, and b) loss function value on the validation dataset versus number of epoch. TABLE III UPS PARAMETERS Parameter Value Output filter inductor, Lf2 mH Output filter capacitance, Cf50 µF DC-link voltage, vdc 700 V Voltage reference (phase to ground) 230 V Fundamental frequency 50 Hz TABLE IV PARAMETERS VARIATIONS FOR THE TRAINING OF THE ANN Parameter Values Load resistor [Ω]{15,30,60} Load inductor [mH] {10,20} Target switching frequency, F∗ sw [kHz] {1.5,2,2.5} implemented during the training process because it is required by the categorical crossentropy function used as loss function [31]. In the hardware implementation, the softmax function is not performed, only its argument is calculated in each output neuron of the ANN. The resulting switching state is calculated by detecting the maximum of these arguments, since this maximum yields the same result and avoids calculating the softmax function. Regarding the activation function, a reduced complexity approximation of the hyperbolic tangent function shown in (4) is selected for all the neurons of the hidden layers. fa(x) =      1if x > 1 xif x∈[−1,1] −1if x < −1 (4) ANN with ideal hyperbolic tangent was also tested and implemented, showing that the approximation has a negligible impact on the performance of the ANN, while reducing computational costs in comparison to the ideal. B. Datasets and ANN training Datasets were generated by simulation of the UPS model whose parameters are shown in Table III, which includes an ideal implementation of the SDA algorithm, i.e., a certificate of optimality is ensured. In order to cover several operation conditions and to improve the generalization of the proposed ANN, the models are set with the parameters shown in Table IV. That is, each dataset includes simulations using three load resistors, two load inductors, and three target switching frequency values. One dataset was generated per each sampling frequency fs={20,25,33,40}kHz and per prediction horizon Np={1,2,...,7}. The equivalent time duration of the datasets were 20 periods of the fundamental frequency. By default, these datasets are unbalanced as the switching states are not uniformly distributed. Particularly, zero vectors are more probable than active vectors. To avoid the model to be biased to any switching state, the datasets were randomly down-sampled to the minority one. The resulting balanced dataset was splitted for training (80 %) and testing (20 %). In addition, the 20 % of the samples of each training dataset was reserved for model validation during the training process. The exact number of samples used for training depends on the trained case. For example, 88909 samples were used to train the model for configuration fs= 25 kHz and Np= 7. The ANN model is implemented, trained, and evaluated using Keras, the deep learning API written in Python running on top of the machine learning platform TensorFlow. The interested reader is referred to [32] for a detailed description of the followed steps. For training, a variation of the stochastic gradient descent method called Adam optimizer has been selected [31]. A learning rate of 10−3, batch size of 64 samples and 5000 epochs were selected to carry out the training. In some cases the batch size is increased up to 128 to avoid convergence problems. As other classification problems, the categorical cross-entropy function is used as loss function [31]. To avoid over-fitting, the following measures have been implemented: (a) the hidden layers include L1 and L2 regularization, and (b) validation-based early-stopping. L1-L2 regularization includes a term in the cost function that penalizes the network weights [31], whereas early-stop uses the accuracy on the validation set to premature stop the training processes. If the validation accuracy does not improve in the patience time of 500 epochs, the training process is stopped, and the weights are restored from the best epoch in that set [31]. To illustrate the training process, the accuracy and loss function histories for case Np= 7 and fs= 25 kHz are shown in Fig. 4 (a) and (b), respectively. The monotonous evolution of both, the results obtained with training and validation datasets, with no sign of divergence, shows that the over-fitting has been avoided. The accuracy shown in Fig. 4(a) exhibits that the training loop is stopped at epoch 2500, after 500 epochs with no improvement. C. Trained models results Table V shows the accuracy and the value of the loss function. Lower horizons and higher sampling frequency exhibit better performances for both, loss function and accuracy. The confusion matrix of case Np= 7, fs= 25 kHz is shown in Fig. 5. Here, each element represents the instances of This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS TABLE V LOSS FUNCTION /ACCURACY VALUES ON THE TEST DATA FOR DIFFERENT SAMPLING FREQUENCY fsAND HORIZON (Np). Npfs= 20 kHz fs= 25 kHz fs= 33 kHz fs= 40 kHz 1 0.051 / 0.98 0.036 / 0.99 0.031 / 0.99 0.033 / 0.99 2 0.077 / 0.97 0.075 / 0.97 0.048 / 0.98 0.041 / 0.99 3 0.148 / 0.94 0.119 / 0.95 0.073 / 0.97 0.071 / 0.97 4 0.225 / 0.91 0.200 / 0.92 0.094 / 0.96 0.079 / 0.97 5 0.217 / 0.91 0.187 / 0.93 0.140 / 0.94 0.114 / 0.95 6 0.283 / 0.88 0.216 / 0.91 0.154 / 0.94 0.119 / 0.95 7 0.261 / 0.90 0.242 / 0.90 0.177 / 0.93 0.137 / 0.95 Fig. 5. Confusion matrix for case: fs= 25 kHz and Np= 7. It is evaluated only on the dataset test portion. TABLE VI COMPUTATIONAL COMPLEXITY PER ANN LAYER: ‘+’ AND ‘*’ ARE ADDITIONS AND PRODUCTS,RESPECTIVELY. Layer ∗+Layer ∗+ 03Np3Np29N2 p3Np 19N2 p3Np324Np8 known versus predicted switching states, both coded in decimal. The bottom row and the column on the right summarize the information of columns and rows, respectively. The lower right corner shows the total accuracy of the model. Note that, switching states 0and 7(the same switching state) exhibit lower accuracy. In addition, the predicted switching states are uniformly distributed (see the right column of Fig. 5), indicating that the ANN does not alter the distribution of the switching states provided by the SDA (see bottom row of Fig. 5). Regarding computing complexity, Table VI shows the number of arithmetic operations that the proposed ANN requires for a given horizon Np. 1234567 85 90 95 123456 7 1 2 3 4 b)a) Fig. 6. a) Optimality versus Np. b) THD versus Npfor different fsvalues. The THD obtained with the ideal SDA is also shown for comparison. TABLE VII MEASURED ¯ Fsw FOR Np= 7.¯ F∗ sw IS THE TARGET ¯ Fsw IN kHz. EACH PAIR REPRESENTS ¯ Fsw ANN / ¯ Fsw IDEAL SDA ¯ F∗ sw fs= 20 kHz fs= 25 kHz fs= 33 kHz fs= 40 kHz 1.51.57 / 1.55 1.55 / 1.54 1.47 / 1.49 1.65 / 1.68 2.02.13 / 2.06 1.99 / 2.01 1.94 / 2.00 1.97 / 1.97 2.52.50 / 2.49 2.55 / 2.50 2.40 / 2.52 2.47 / 2.53 V. PERFORMANCE EVALUATION A. Simulation Results The first analyses use the same data sets and simulation model employed in Subsection IV-B for the training of the ANN. Unless otherwise specified, all the results presented in this subsection have been obtained simulating 20 fundamental cycles and averaging the results for all the combinations of parameters shown in Table IV. The simulation analysis focuses on the optimization process performance and how this translates to the control outcome. For this, two metrics will be the focus of the study: optimality Op(%) and total harmonic distortion THD(%). Optimality refers to the optimization phase success rate. An ideal SDA is capable of unequivocally finding the optimal, i.e. provides an optimality of 100 %. However, an ANN or a constrained SDA algorithm may select suboptimal solutions in some occasions. In simulation, it is possible to compute a percentage of successfully found optimal solutions in the total amount of optimization problems computed in the considered time frame. As a byproduct of this suboptimality, a certain control outcome degradation is to be expected. To address control outcome in the analyzed UPS application, the THD of the output voltage is computed and represented. Fig. 6a shows the optimality of the proposed ANN architecture for different Npand fsvalues. As stated in Subsection IV-B, each point of the graphs corresponds to a particular ANN implementation trained for these particular pair of values. From this figure it can be seen that for the depicted range of Npand fsthe optimality is always greater than 85%. As seen in Subsection IV-C, lower prediction horizon lengths and higher sampling frequencies exhibit better optimality. Also, suboptimal solutions selected by the ANN-SDA have a low impact in terms of THD degradation. Fig. 6b also shows the evolution of the THD versus Np, comparing the ideal SDA algorithm (with no limit in the number of explored nodes) This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS TABLE VIII EXECUTION TIMES FOR ANN-BASED LPH-FCS-MPC ALGORITHM. Ex. Time Np=3 Np=4 Np=5 Np=6 Np=7 Tadc 7.53 µs Tpre 3.11 µs 4.30 µs 5.85 µs 7.56 µs 10.09 µs TANN 3.76 µs 5.42 µs 7.33 µs 9.75 µs 12.21 µs and the proposed ANN architecture for different values of fs. From this figure, it can be seen that the THD obtained with the ANN is very similar to the one with the ideal SDA. The greater difference occurs at fs= 25 kHz and Np= 6 where it is lower than 0.2%. Regarding the switching frequency, Table VII shows the measured switching frequency versus the sampling frequency, comparing the proposed ANN architecture and the ideal SDA, for different target switching frequencies. From this table, it can be seen that the ANN can imitate the outcome of the ideal SDA while yielding similar switching effort. Additionally, the generalization ability of the designed ANN was evaluated, i.e., its ability to adapt properly to new and previously unseen data. Simulations with loads different than the ones used in the training process were tested, more specifically, load resistors of {10,20,40,50,70}Ω, and load inductors of {5,15,25}mH. The obtained results, not presented here for the sake of brevity, are almost the same than the one presented in Fig. 6. For instance, for a target switching frequency of 2 kHz, the absolute value of the differences between the THD obtained with the new loads and the one shown in Fig. 6 are always lower than 0.08%. These results prove that the ANN is able to generalize well for new load values. B. Experimental Results Experimental tests are performed in an UPS laboratory prototype that consists of a 20-kVA 2L-VSI connected to an LC filter. The VSI is composed by three SKM100GB12T4 commercial IGBT modules from Semikron operated using the Semikron 32 PRO R gate driver. Parameters are the same as in the simulation study unless otherwise specified. The utilized load is a 30 Ωresistor with a 20 mH inductor. The digital control is implemented in a low-cost PYNQ-Z1 development board from Digilent Inc. The board is based on a Xilinx Zynq-7000 FPSoC. Execution times for the entire algorithm are depicted in Table VIII in terms of ADC conversion time, preliminary calculations and ANN computation. Four optimization techniques are assessed in the comparisons. The first method is the proposed ANN-SDA design executed in one ARM core. The second method is the conventional constrained SDA, as proposed in [8], [14] and executed in the same ARM core. For further validation, the FPGA-based, parallel SDA proposed in [12] and K-best SDA proposed in [6] are also included in the comparative results. For these tests, the parallel SDA is configured with 8 parallel blocks and K-best SDA with Kb= 8. Harmonic distortion results for different parameters are depicted in Fig. 7. As can be seen, the proposed ANN-SDA design provides a vastly superior performance to the conventional SDA. In particular, 1.5 2 2.5 1 2 3 4 5 2 4 6 2 3 4 b) a) Fig. 7. Steady-state performance as a measure of the output voltage THD. Sampling frequency is fs= 25 kHz. a) Switching frequency sweep for Np= 6. b) Prediction horizon sweep for ¯ Fsw = 1.5 kHz. the conventional SDA implemented in microprocessor yields a very degraded performance for Np>4due to the required computational upper bounds. For this application, it is found that the maximum number of nodes that can be explored halves by each incremental unit of Np. For instance, this value is 60 nodes for Np=5 and 30 nodes for Np= 6, which is insufficient for proper solution of the optimization problem. In contrast, the ANN-SDA achieves further improvements as Npis increased. Also, performance is generally better than other advanced techniques that require more complex and resource demanding implementations, as they similarly suffer from computational restrictions. This fact is demonstrated in the experiment shown in Fig. 8. As can be seen, when selecting a prediction horizon of Np= 7 and ¯ Fsw = 2 kHz, the optimization problem is too complex for parallel SDA and K-best SDA methods. However, the ANN-SDA has been able to properly learn the optimization problem from the ideal SDA and provide more accurate solutions. Another important topic regarding the ANN-SDA method is adaptability to operation points outside the training set. For instance, in the proposed design, training is performed for a set of three different switching frequency values ¯ Fsw ={1.5,2,2.5}kHz, which correspond to specific parameter λvalues depending on parameters such as Npor fs among others. Even if training is performed for these specific λvalues, the proposed method decouples the optimization phase from the rest of the control algorithm. Thus, in contrast to other ANN-based methods fin the literature such as [20], [21], it is possible to tune different λparameters that affect the calculation of the unconstrained solution. Interestingly, experimental results highlight that the proposed ANN-SDA provides great flexibility to parameters outside the training set. This fact is depicted in Fig. 9. VI. CONCLUSION The main contribution of this paper is the design and development of an ANN imitator for the conventional SDA to solve the underlying optimization problem in LPH-FCS- MPC strategies. Solving the optimization stage with an ANN provides a method with fixed computational costs where a great part of the problem original computational burden is shifted to the offline training. The results highlight the validity and the benefits of this method as the achieved performance This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information. IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS 0 10 20 30 40 -400 -200 0 200 400 0 10 20 30 40 Time (ms) -10 -5 0 5 10 0 10 20 30 40 -400 -200 0 200 400 0 10 20 30 40 Time (ms) -10 -5 0 5 10 THD = 1.0%THD = 1.8% a) c) 0 10 20 30 40 -400 -200 0 200 400 THD = 1.6% 0 10 20 30 40 Time (ms) -10 -5 0 5 10 b) ( ) ( ) Fig. 8. Experimental results for Np= 7, fs= 25 kHz and ¯ Fsw = 2 kHz. Three phase magnitudes are represented. Top figures show the output voltage and reference. Bottom figures show the output current. a) ANN-SDA. b) Parallel SDA with 8 parallel blocks. c) K-best SDA with Kb=8. 20 30 40 1 2 3 1.5 2 2.5 3 1 2 3 ANN SDA Parallel SDA b) a) Fig. 9. ANN-SDA performance for different parameters. a) THD for different Npand ¯ Fsw. b) THD for ANN-SDA at Np= 5 working at sampling frequencies different than the training value (ANN xkHz). is vastly superior to the conventional SDA executed in the same microprocessor with computational upper bounds. The proposed method is also compared against more advanced optimization techniques in the literature that require costly hardware resources. The proposed ANN-SDA can outperform these techniques while maintaining a strong robustness for parameters outside the training data. For this reason, ANN- based SDA has been revealed as a very promising tool to help the growth of LPH-FCS-MPC strategies and enable wider application in the industry. REFERENCES [1] P. Karamanakos and T. Geyer, “Guidelines for the design of finite control set model predictive controllers,” IEEE Transactions on Power Electronics, vol. 35, DOI 10.1109/TPEL.2019.2954357, no. 7, pp. 7434– 7450, 2020. [2] P. Karamanakos, E. Liegmann, T. Geyer, and R. Kennel, “Model predictive control of power electronic systems: Methods, results, and challenges,” IEEE Open Journal of Industry Applications, vol. 1, DOI 10.1109/OJIA.2020.3020184, pp. 95–114, 2020. [3] S. Vazquez, J. Rodriguez, M. Rivera, L. G. Franquelo, and M. Norambuena, “Model predictive control for power converters and drives: Advances and trends,” IEEE Transactions on Industrial Electronics, vol. 64, DOI 10.1109/TIE.2016.2625238, no. 2, pp. 935–947, Feb. 2017. [4] C. Bordons and C. Montero, “Basic principles of mpc for power converters: Bridging the gap between theory and practice,” IEEE Industrial Electronics Magazine, vol. 9, DOI 10.1109/MIE.2014.2356600, no. 3, pp. 31–43, Sep. 2015. [5] P. Acuna, C. A. Rojas, R. Baidya, R. P. Aguilera, and J. E. Fletcher, “On the impact of transients on multistep model predictive control for medium-voltage drives,” IEEE Transactions on Power Electronics, vol. 34, no. 9, pp. 8342–8355, 2019. [6] E. Zafra, S. Vazquez, A. M. Alcaide, L. G. Franquelo, J. I. Leon, and E. P. Martin, “K-best sphere decoding algorithm for long prediction horizon fcs-mpc,” IEEE Transactions on Industrial Electronics, vol. 69, DOI 10.1109/TIE.2021.3104600, no. 8, pp. 7571–7581, 2022. [7] E. Liegmann, P. Karamanakos, and R. Kennel, “Real-time implementation of long-horizon direct model predictive control on an embedded system,” IEEE Open Journal of Industry Applications, vol. 3, DOI 10.1109/OJIA.2021.3133477, pp. 1–12, 2022. [8] T. Geyer and D. E. Quevedo, “Multistep finite control set model predictive control for power electronics,” IEEE Transactions on Power Electronics, vol. 29, no. 12, pp. 6836–6846, 2014. [9] T. Geyer and D. E. Quevedo, “Performance of multistep finite control set model predictive control for power electronics,” IEEE Transactions on Power Electronics, vol. 30, no. 3, pp. 1633–1644, 2015. [10] R. Baidya, R. P. Aguilera, P. Acuna, S. Vazquez, and H. d. T. Mouton, “Multistep model predictive control for cascaded h-bridge inverters: Formulation and analysis,” IEEE Transactions on Power Electronics, vol. 33, no. 1, pp. 876–886, 2018. [11] R. Baidya, R. P. Aguilera, P. Karamanakos, P. Acuna, C. Rojas, T. Geyer, and D. D. . Lu, “Dealing with suboptimality in multistep model predictive control for transient operations,” in 2019 IEEE Energy Conversion Congress and Exposition (ECCE), pp. 3780–3785, 2019. [12] E. Zafra, S. Vazquez, C. Regalo, V. B. Lecuyer, A. M. Alcaide, J. I. Leon, and L. G. Franquelo, “Parallel sphere decoding algorithm for longprediction-horizon fcs-mpc,” IEEE Transactions on Power Electronics, vol. 37, DOI 10.1109/TPEL.2022.3150433, no. 7, pp. 7896–7906, 2022. [13] E. Zafra, S. Vazquez, A. M. Alcaide, E. P. Martin, L. G. Franquelo, and J. I. Leon, “Hybrid sphere decoder for long prediction horizon fcs-mpc,” IEEE Transactions on Industrial Electronics, DOI 10.1109/TIE.2022.3194587, pp. 1–9, 2022. [14] T. Dorfling, H. du Toit Mouton, T. Geyer, and P. Karamanakos, “Longhorizon finite-control-set model predictive control with nonrecursive sphere decoding on an fpga,” IEEE Transactions on Power Electronics, vol. 35, no. 7, pp. 7520–7531, 2020 . [15] S. A. Bin Khalid, E. Liegmann, P. Karamanakos, and R. Kennel, “Highlevel synthesis of a long horizon model predictive control algorithm for an fpga,” in PCIM Europe digital days 2020, pp. 1–8 , 2020. [16] T. Dragiˇ cevi´ c and M. Novak, “Weighting factor design in model predictive control of power electronic converters: An artificial neural network approach,” IEEE Transactions on Industrial Electronics, vol. 66, DOI 10.1109/TIE.2018.2875660, no. 11, pp. 8870–8880, 2019. This article has been accepted for publication in IEEE Transactions on Industrial 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/TIE.2023.3243301 © 2023 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See https://www.ieee.org/publications/rights/index.html for more information.