A computationally efficient model predictive control ... - Tobias Geyer

0 downloads 0 Views 232KB Size Report
reduction, sphere decoding, power electronics, drive systems. I. INTRODUCTION ..... Note that the optimization algorithm described in the next section performs a ..... can be reduced to O(n3 log n), assuming that the entries of the lattice ...
A Computationally Efficient Model Predictive Control Strategy for Linear Systems With Integer Inputs Petros Karamanakos, Member, IEEE, Tobias Geyer, Senior Member, IEEE, and Ralph Kennel, Senior Member, IEEE

Abstract—For linear systems with integer inputs, the model predictive control (MPC) problem with output reference tracking is formulated as an integer least-squares (ILS) problem. The ILS problem is solved using a modified sphere decoding algorithm, which is a particular branch-and-bound method. To reduce the computational complexity of the sphere decoder, a reduction algorithm is added as a preprocessing stage to reshape the search space in which the integer solution lies. The computational complexity of the proposed algorithm is modest, enabling its implementation in a real-time system even when considering long prediction horizons. A variable speed drive system with a threelevel voltage source inverter serves as an illustrative example to demonstrate the effectiveness of the proposed algorithm. Index Terms—Model predictive control (MPC), integer leastsquares (ILS) problem, integer programming, LLL lattice basis reduction, sphere decoding, power electronics, drive systems

I. I NTRODUCTION

T

HROUGHOUT the years, model predictive control (MPC) [1] has gained popularity in many disciplines due to its numerous advantages, including its ability to handle systems with complex dynamics, such as hybrid systems. For linear systems with integer inputs, some (or all) of the decision variables of the MPC problem are integer-valued, and the optimization problem underlying MPC is a (mixed) integer program [2], [3], which is NP-hard.This type of systems can be modeled as mixed logical dynamical (MLD) systems [4], hybrid automata [5], or polyhedral piecewise affine systems [6]. The explicit state-feedback control law can be computed offline for such systems [7], [8], or they can be solved online, using for example branch-and-bound methods [3]. The former approach, however, typically requires significant memory resources to store the explicit control law, with the required memory increasing dramatically with the problem size and complexity. Explicit control laws are also ill-suited to address variations in parameters or reference setpoints. For long prediction horizons or for problems with many integer variables, due to the combinatorial explosion of the number of possible integer solutions, solving the integer optimization problem online might lead to computational intractability [9]. Long horizons are often required to ensure stability and good closed-loop performance [10], [11], as was P. Karamanakos and R. Kennel are with the Institute for Electrical Drive Systems and Power Electronics, Technische Universit¨at M¨unchen, 80333 Munich, Germany; e-mails: [email protected], [email protected] T. Geyer is with ABB Corporate Research, 5405 Baden-D¨attwil, Switzerland; e-mail: [email protected]

shown for different applications in various fields [12]–[15]. Short sampling intervals further aggravate this issue. In the field of power electronics, for example, sampling intervals of hundreds or even tens of microseconds are common. To address this issue, a dedicated optimization technique was recently proposed in [16], [17] for MPC problems involving linear systems with integer inputs. The underlying optimization problem is formulated as an integer least-squares (ILS) problem and the branch-and-bound technique of sphere decoding [18], [19] is adopted to compute the optimal sequence of control actions. By reformulating the ILS problem through a preprocessing stage, [20] proposed a modified version of the algorithm introduced in [16]. A lattice reduction algorithm [21] was implemented to reduce the size of the n-dimensional search space and, as a result, the number of nodes in the search tree to be examined. In addition, the implementation of the sphere decoder in [16] was refined. With these improvements, the computations to be performed in real time can be reduced, while still obtaining the optimal solution. In this work, the initial results presented in [20] are extended. The formulation of the MPC problem is generalized and applied to general linear systems with integer inputs. An exhaustive description of the derivation and solution process of the reformulated ILS problem is provided, along with a detailed analysis of the complexity of the proposed algorithm. To provide further insight, an example of a linear system with integer inputs from the field of power electronics is used as a case study. More specifically, a variable speed drive system is considered, which consists of a three-level neutral point clamped (NPC) inverter driving a medium-voltage induction machine. For long horizons, such as ten steps, the computational complexity of the discussed strategy is reduced by up to 45% compared with the approach presented in [16], highlighting the efficacy of the proposed algorithm. II. F ORMULATION

OF THE

O PTIMAL C ONTROL P ROBLEM

Consider a linear system with integer inputs that is described by the discrete-time state-space model x(k + 1) = Ax(k) + Bu(k) , y(k) = Cx(k) ,

(1)

which has nx states, ny outputs and nu inputs. In this formulation, x ∈ Rnx is the state vector, y ∈ Rny the output vector, and u ∈ U is the integer-valued input vector, with

U = U × · · · × U = U nu being the nu -times Cartesian product of the set U ⊂ Z. The state-space matrices A ∈ Rnx ×nx , B ∈ Rnx ×nu and C ∈ Rny ×nx are time invariant, even though the proposed control approach is also applicable to time-varying matrices. Finally, k ∈ N denotes the time step. A. Model Predictive Control with Output Reference Tracking Consider MPC with output reference tracking as depicted in Fig. 1 with the objective function J(k) =

k+N X−1

||y err (ℓ + 1)||2Q + ||∆u(ℓ)||2R

(2)

ℓ=k

that penalizes over the finite prediction horizon N the evolution of the output error y err (k) = y ref (k) − y(k), and the control effort ∆u(k) = u(k) − u(k − 1). The ratio between the weighting matrices Q ∈ Rny ×ny , Q  0 and R ∈ Rnu ×nu , R ≻ 0 decides on the trade-off between the overall tracking accuracy and the control effort. At time step k, the optimal solution (i.e., the control input) is obtained by solving the following problem in real time minimize U (k)

J(k)

subject to x(ℓ + 1) = Ax(ℓ) + Bu(ℓ) y(ℓ) = Cx(ℓ) , ∀ ℓ = k, . . . , k + N − 1 U (k) ∈ U .

(3)

The optimization variable is the integer-valued sequence of control actions U (k) = [uT (k) . . . uT (k + N − 1)]T ∈ U = U N ⊂ Zn over the N -step horizon, where n = N · nu . It should be mentioned that because of the nature of system (1) a steady-state error may be present1 . B. Formulation of the ILS Problem Using algebraic manipulations, the optimization problem (3) can be reformulated as an ILS problem. To this end, let the vectors Y (k) = [y T (k + 1) . . . y T (k + N )]T and Y ref (k) = [y Tref (k + 1) . . . y Tref (k + N )]T denote the sequence of outputs and the corresponding sequence of output references over the horizon, respectively. The objective function J can be written in vector form as J(k) = ||Γx(k) + ΥU (k) − Y ref (k)||2∼ + Q

+ ||SU (k) − Ξu(k − 1)||2∼ ,

(4)

R

with Y (k) = Γx(k) + ΥU (k). The matrices Γ, Υ, S and Ξ can be found in [20], whereas the block diagonal matrices ∼ ∼ ∼ ∼ N Q, R are defined as Q = ⊕N i=1 Q, and R = ⊕i=1 R. After some algebraic manipulations (as explained in the appendix) the objective function (4) can be written as T  J(k) = U (k) − U unc (k) W U (k) − U unc (k) + const(k) , (5) where U unc ∈ Rn is the unconstrained solution of the problem (3), see the appendix. The matrix W is by definition symmetric positive definite and can thus be factored (using Cholesky factorization) as W = H T H, where H ∈ Rn×n is 1 Note

that no stability guarantees are provided in this work.

y ref

Optimization problem (3)

⇓ U∗

u∗

Plant

y

x

Measurements and/or estimates Fig. 1: Model predictive control with output reference tracking.

a nonsingular, upper triangular matrix. As a result, problem (3) becomes the ILS problem ¯ unc (k) − HU (k)||2 , minimize ||U 2 U (k) ∈ U

(6)

¯ unc = HU unc (k) ∈ Rn . The matrix H is commonly where U known as the lattice generator matrix—its columns represent n linearly independent vectors in Rn that generate a lattice, i.e., the set of integer P linear combinations of the basis vectors hi , i.e., L(H) = { ni=1 κi hi | κi ∈ Z}. III. S OLVING

THE

ILS P ROBLEM

To facilitate the real-time implementation of the proposed MPC algorithm the ILS problem (6) needs to be solved in a time-efficient manner. To achieve this, the procedure for solving the problem is divided into two stages: the first stage (preprocessing) consists of the reduction of problem (6), whereas in the second stage (optimization) the search for the optimal solution is performed. A. Preprocessing Stage In a first step, the Lenstra-Lenstra-Lov´asz (LLL) lattice basis reduction algorithm, as proposed in [21], is applied to the problem (6). The goal is to improve the conditioning of the optimization problem (6) by transforming H to a new upper ∼ triangular matrix H∈ Rn×n . To do so, the reduction process— which can be accomplished with only a few computations, ∼ thanks to the sparsity of H—produces the matrix H with positive diagonal entries that satisfy the following criteria: 1˜ hi,i , i = 1, . . . , j − 1 2 ˜2 ˜2 ≤h j−1,j + hj,j , j = 2, . . . , n ,

˜ i,j | ≤ |h ˜2 δh j−1,j−1

(7a) (7b)

where 1/4 < δ ≤ 1 (with the typical value being δ = 3/4). To this end, integer Gauss transformations (IGTs) and permutation matrices are employed. First, IGTs of the form M i,j = I − γei eTj are applied to the right-hand side of H, where ei is the unit vector (i.e., the ith column of the identity matrix I of proper dimensions) and γ ∈ Z. Therefore, by postmultiplying H with M i,j (with i < j) we obtain ∼

H= HM i,j = H − γHei eTj .

(8)



The matrices H and H are the same except for the (k, i) ˜ k,j = hi,j − γhk,i . entries, with k = 1, 2, . . . , i, which are h By following a procedure similar to Gaussian elimination, i.e., ˜ i,j | is by setting2 γ = ⌊hi,j /hi,i ⌉, we ensure that the entry |h sufficiently reduced such that it meets condition (7a). 2 ⌊ξ⌉ denotes the integer that is obtained by rounding ξ. This definition can be directly extended to vectors ξ, by performing elementwise rounding.

Algorithm 1 LLL Reduction 0.5

1 4 7 10 13 16 19 22 25 28

0.4 0.3 0.2 0.1 0 −0.1 −0.2 −0.3 −0.4

1

4

7

−0.5

10 13 16 19 22 25 28

0.5

1 4 7 10 13 16 19 22 25 28

0.4 0.3 0.2 0.1 0 −0.1 −0.2 −0.3 −0.4

1

7

4

−0.5

10 13 16 19 22 25 28



(a) The H matrix.

(b) The H matrix.

Fig. 2: Visualization of the lattice generator matrix (a) before and (b) after the LLL reduction algorithm, assuming the dimension n = 30. The diagonal ∼ entries of the upper triangular matrix H are positive and are placed in an ascending order. Moreover, their values are more than two times larger than those of the off-diagonal entries, thus conditions (7a) and (7b) hold.

To satisfy the second condition (7b), permutations of the entries of H are required whenever δh2j−1,j−1 > h2j−1,j + h2j,j . A Givens rotation matrix Gj−1,j [22] is employed to maintain ∼ the upper triangular form of the resulting matrix H. Hence, ∼ the LLL reduced matrix H can be written as ∼

H= GTj−1,j HP j−1,j ,

(9)

where the Givens Gj−1,j and permutation P j−1,j matrices are described in [20]. With this procedure, the second condition, as described by (7b), is met, since q  2 ˜ j−1,j−1 = h2  h  j−1,j + hj,j  2 −1/2 . ˜ j−1,j = chj−1,j−1 , c = hj−1,j (h2 h j−1,j + hj,j )   ˜ hj,j = −shj−1,j−1 , s = hj,j (h2j−1,j + h2j,j )−1/2

As a result, the reduction process strives to place the ∼ diagonal entries of H in ascending order, i.e., ˜ 1,1 ≤ h ˜ 2,2 ≤ . . . ≤ h ˜ n,n . h

(10)

Note that the optimization algorithm described in the next section performs a depth-first search. Ordering the diagonal ∼ entries of H reduces the number of nodes to be considered in the early steps of the search procedure, thus decreasing the total number of nodes to be explored. The pseudocode of the LLL reduction procedure is provided in Algorithm 1. An illustrative example3 of the effect of the LLL algorithm on H is presented in Fig. 2. More formally, ∼ H is transformed into H, which is of the form ∼

H= V T HM ,

(11)

with V ∈ Rn×n being an orthogonal matrix and M ∈ Zn×n being unimodular (i.e., det M = ±1). With this, the ILS problem (6) can be rewritten as ∼

∼ ∼

minimize || Uunc (k) − H U(k)||22 , ∼

(12)

U(k) ∈ U ∼





with Uunc (k) =H M −1 U unc (k) and U(k) = M −1 U (k). 3 The



entries of the lattice generator matrices H and H are computed based on the case study presented in Section IV. As explained there, the example is based on a prediction horizon of N = 10 steps.



function H = LLL(H) M ← In while j ← 2 ≤ n do if |hj−1,j | > 12 |hj−1,j−1 | then H ← HM j−1,j , M ← M M j−1,j end if if δh2j−1,j−1 > h2j−1,j + h2j,j then H ← GTj−1,j HP j−1,j , M ← M P j−1,j j ← max{j − 1, 2} else for i ← j − 2 down to 1 do if |hi,j | > 21 |hi,i | then H ← HM i,j , M ← M M i,j end if end for j ←j+1 end if end while ∼ H← H end function

ρ

Fig. 3: The principle of the sphere decoder: A (two-dimensional) sphere of radius ρ (shown as blue line) centered at the unconstrained solution (shown as red solid circle) includes several integer points of the lattice (shown as black solid circles). One of these points is the integer solution of the ILS problem.

B. Optimization Stage To find the optimal solution in the transformed lattice ∼ generated by H, a sphere decoding algorithm is implemented, based on the one described in [16]. This algorithm is a variant of the Fincke and Pohst sphere decoding algorithm [18], which exploits the fact that the set of admissible control input sequences U forms a (truncated) integer lattice. According to the sphere decoding principle, the optimal solution lies within a hypersphere (n-dimensional sphere) of radius ρ, see Fig. 3. As mentioned in Section III-A, the sphere decoding algorithm is a depth-first search algorithm that finds the optimal solution by traversing a search tree in a sequential manner until reaching a dead end or the bottom level. If this happens, the algorithm backtracks to examine unexplored nodes in higher layers. An example of an integer search tree is provided in Fig. 4 along with the visualization of the search procedure. ∼ To exploit the structure of H and to avoid unnecessary computations, the search tree is built in a bottom-to-top manner with the higher-dimensional nodes being located at the top layers of the search tree, and the one-dimensional nodes at the bottom, see Fig. 4. This is in contrast to [16], where the tree is generated in a top-to-bottom manner. The pseudocode of the proposed algorithm is summarized in Algorithm 2, where ∼ the initial values of the arguments are U ← [ ], i.e., the empty vector, d ← 0, i ← n, ρ ← ρ(k)—see (15), and ∼ ∼ Uunc ← H M −1 U unc (k).

Algorithm 2 Sphere Decoder

m=3



replacements m=2 m=1 Fig. 4: Search tree of the ILS problem (12) of dimension (depth) n = 3. The integer set U has cardinality three. The index m = {1, . . . , n} refers to the layer in the search tree. As the search progresses, the dimension of the sphere is reduced from m = n to a one-dimensional sphere. The nodes explored by the sphere decoder are shown as black solid circles. Those that do not lie within the sphere are shown as red solid circles, whereas nodes that are not evaluated at all are depicted as gray solid circles. The direction of the search process is shown with black arrows. To find the optimal solution, nodes are visited with a direction from left to right, and from the higher dimensional layers to the lower ones, until reaching a dead end or the bottom level, where backtracking occurs.

Before invoking Algorithm 2, the initial radius ρ(k) of the hypersphere needs to be determined. A common choice for ρ(k) is the so-called Babai estimate [23], which is a suboptimal solution to the ILS problem4. For the ILS problem (6), the Babai estimate can be easily computed by rounding the unconstrained solution to the closest feasible integer vector ¯ unc (k)⌉ = ⌊U unc (k)⌉ ∈ U , U bab (k) = ⌊H −1 U

(13)

which is equivalent [24] to ǫn = u ¯uncn /hn,n ⇒ ubabn = ⌊ǫn ⌉ , n   X ǫi = u ¯unci − hi,j ubabj /hi,i ⇒ ubabi = ⌊ǫi ⌉ .

(14)

j=i+1

The initial value of ρ(k) is then ∼

∼ ∼

ρ(k) = || Uunc (k)− H Ubab (k)||2 , where

(15)

∼ Ubab (k)

= M −1 U bab (k), and thus it results that [19] n  n 2 X X ˜ i,j u ρ2 (k) ≥ u ˜unci − h ˜j . (16) i=1

j=1

Therefore, the n conditions to be met so that the solution set is nonempty and at least one lattice point exists are5 [19] & ' $ % −ρ + u ˜uncn ρ+u ˜uncn ≤u ˜n ≤ , ˜ n,n ˜ n,n h h & ' $ % −ρn−1 + u˜uncn−1|n ρn−1 + u ˜uncn−1|n ≤u ˜n−1 ≤ , ˜ n−1,n−1 ˜hn−1,n−1 h

(17) where the conditions for the (n − 2)-dimensional node u˜n−2 up to the one-dimensional node u ˜1 can be derived by continuing the above-shown procedure in a similar fashion. 1/2 ˜ n,n u Note that in (17), ρn−1 = ρ2 − (˜ uuncn − h ˜n )2 and ˜ n−1,n u u ˜uncn−1|n = u ˜uncn−1 − h ˜n . Finally, it should be pointed out that when the LLL reduction algorithm is used to transform the lattice, the probability 4 In [16] an alternative calculation method for ρ(k) is proposed, which exploits the receding horizon policy of MPC. More specifically, the previously computed optimal control sequence is shifted by one step back in time. 5 ⌈ξ⌉ maps ξ to the smallest following integer (the smallest integer not less than ξ). Conversely, ⌊ξ⌋ maps ξ to the largest previous integer (the largest integer not greater than ξ).





function U∗ = S PH D EC(U, d2 , i, ρ2 , Uunc ) for each u ˜ ∈ U do ∼ Ui ← u ˜ ∼ ∼ ∼ d′2 ← || Uunci − H (i,i:n) Ui:n ||22 + d2 if d′2 ≤ ρ2 then if i > 1 then ∼ ∼ S PH D EC (U, d′2 , i − 1, ρ2 , Uunc ) else ∼ ∼ U∗ ← U, ρ2 ← d′2 end if end if end for end function of the Babai estimate U bab being equal to the optimal solution U ∗ is increased, as shown in [24]. As a consequence, in most cases the sphere that includes at least one lattice point has the smallest possible radius ρ, and thus the nodes to be explored by the algorithm are reduced. IV. C ASE S TUDY: T HREE -L EVEL NPC I NVERTER D RIVE S YSTEM To highlight the efficacy and the benefits of the proposed algorithm to solve the ILS problem in the general form (6), an industrial case study is presented in this section. More specifically, a medium-voltage drive system is considered, which is based on a three-level NPC voltage source inverter, as shown in Fig. 5. The inverter uses the constant dc-link voltage Vdc = 5.2 kV and has a fixed neutral point potential. A squirrel cage induction machine is connected to the inverter with 3.3 kV rated voltage, 356 A rated current, 2 MVA rated power, 50 Hz nominal frequency, 596 rpm nominal rotational speed and a 0.25 per unit (p.u.) total leakage inductance. For all cases examined, the control algorithm is operated with the sampling interval Ts = 25 µs. A. Mathematical Model of the System The inverter produces at each phase the voltages − V2dc , 0, V2dc , depending on the position of the corresponding semiconductor switches. The switch positions in the phase legs can be described by the integer variables ua , ub , uc ∈ U = {−1, 0, 1}; these variables constitute the manipulated variables, which are aggregated to the threephase vector u = [ua ub uc ]T ∈ U = U 3 . The state vector x = [isα isβ ψrα ψrβ ]T ∈ R4 encompasses the stator current is,αβ and the rotor flux ψ r,αβ in the αβ plane6 . By choosing the stator current as the output of the system, i.e., y = is,αβ ∈ R2 , the discrete-time state-space model7 of the drive system can be written in the form (1). Note that in the examined case study, the system dimensions are given by nx = 4, ny = 2 and nu = 3 according to the notation introduced in Section II. 6 Note that to simplify the computations it is common to transform a vector from the three-phase (abc) to the stationary orthogonal αβ system. 7 For the continuous-time state equations and for the detailed derivation of the system mathematical model see [25] and [16], respectively.

TABLE I: Maximum number of nodes µ evaluated and flops Nt performed in real time by the sphere decoder without and with the LLL reduction algorithm, depending on the length of the prediction horizon N .

Vdc 2

N

a

is,abc N

b

N

c

IM

Vdc 2

Fig. 5: Three-level three-phase neutral point clamped (NPC) voltage source inverter driving an induction machine with a fixed neutral point potential.

B. Direct MPC with Current Reference Tracking The block diagram of the MPC scheme with current reference tracking is alike the one in Fig. 1, with the feedback signals being the (measured) stator current and rotor speed, and the (estimated) rotor flux. The main control objective is the elimination of the current error is,err,αβ [20]. To do so, the switches of the inverter are directly manipulated without the presence of a modulator. Moreover, since for mediumvoltage drives switching losses are of paramount importance, the switching (i.e., control) effort is to be kept small. Considering the aforementioned objectives, we set in (2) y err = is,err,αβ . Moreover, since the α− and β−components of the stator current are of the same magnitude, we chose Q = I and R = λu I, where λu > 0 sets the trade-off between the stator current tracking accuracy and the switching effort (i.e., the switching frequency). V. A NALYSIS

OF THE

C OMPUTATIONAL C OMPLEXITY

The computational complexity of the proposed MPC algorithm is analyzed in this section, using the drive system as a case study. Since the system matrices are time invariant for a given speed setpoint and dc-link voltage, W and thus the lattice generator matrix H are time invariant, too. As a result, the preprocessing stage can be performed offline and only the sphere decoding algorithm needs to be executed in real time. The latter thus determines the online computational demand, while the first part of the algorithm is given for reasons of completeness. This motivates us to divide the analysis of the computational burden into two parts: (a) the preprocessing stage (Algorithm 1), and (b) the optimization stage (Algorithm 2). The focus of this analysis is on the worst-case number of operations, which is, from an implementation point of view, the decisive quantity rather than the average number of operations. A. Complexity of the Preprocessing Stage For the LLL reduction algorithm, as introduced in [21], the average complexity is O(n4 log n) floating-point operations (flops)8 . However, as shown in [26], the average complexity can be reduced to O(n3 log n), assuming that the entries of the lattice generator matrix H are independent and identically distributed (i.i.d.) random variables H ∼ N (0, 1). In our case, 8 The notion of flop count is used to provide a rough estimate of the computation time of the implemented algorithm. It is not an accurate estimate, especially when n is small (n < 100), since the computation time on today’s platforms highly depends on the architecture and compiler.

Prediction horizon N 1 2 3 4 5 7 10

Without LLL max(µ) max(Nt ) 7 99 19 369 39 915 87 2,905 148 5,667 690 10,275 831 42,147

With LLL max(µ) max(Nt ) 7 99 14 291 19 501 27 897 44 1,587 61 3,030 141 8,268

however, the entries of H are highly correlated and H is sparse. Therefore, the computational complexity is expected to be less than O(n3 log n), since the vast majority of the offdiagonal entries of H already satisfy criteria (7a) and (7b). This becomes also evident from the example shown in Fig. 2. B. Complexity of the Sphere Decoding Algorithm The ILS problem is known to be NP-hard [27], [28]. In order to derive an upper bound on the required computations, an empirical analysis is presented hereafter. To do so, the number of nodes that are evaluated by the sphere decoder at each timestep to obtain the solution is computed. More specifically, the maximum number of nodes µ examined is investigated for lattices of different dimensions (i.e., for different prediction horizons, since the length of the horizon defines the dimension of the lattice, and vice versa). The lattice generator matrix H is computed for the drive system case study detailed in the previous section. The weighting factor λu is tuned such that a switching frequency of about 300 Hz results. Table I summarizes the computational burden of the sphere decoder in terms of the number of nodes examined. Two cases are examined: the case without the LLL reduction algorithm (i.e., H is the lattice generator matrix), and the case with ∼ the LLL reduction algorithm (i.e., H is the lattice generator matrix). As can be seen, the sphere decoder with the LLL algorithm significantly reduces the number of nodes to be examined. Figs. 6(a) and 6(b) illustrate the probability distribution of the number of nodes required to be explored at each time-step to find the optimal solution, for the ten-step horizon (N = 10) case. When the ILS problem is ill-conditioned the distribution is relatively flat (with a low peak at 30), spread over a wide range of numbers (from 30 up to 225), see Fig. 6(a). On the other hand, when the search space is reshaped and the ILS problem is transformed to a well-conditioned one, the probability distribution exhibits a large peak at 30. With 30 being the depth of the search tree, this number constitutes the minimum number of nodes to be explored by the algorithm. More precisely, as can be observed in Fig. 6(b), in about 80% of the cases, the solution is found in the first iteration. Even though the complexity analysis based on the number of nodes provides a first indication, it is rather coarse. The number of computations depends not only on the number of nodes explored, but also on the dimension of these nodes, see Fig. 4. As an example, consider after the preprocessing stage

80 60 40 20 0

50

0

100

150

200

250

300

Number of nodes

100

Probability [%]

Probability [%]

100

80 60 40 20 0

0

50

100

150

200

250

300

10 8 6 4 2 0

0

5

10

15

20

25

30

35

Number of nodes Number of nodes Dimension of nodes (a) The mean number of nodes visited is 132.97. (b) The mean number of nodes visited is 36.21. (c) The mean dimension of nodes visited in the (Note that the 98, and 99 percentiles are not shown worst-case scenario is 15.7. for visualization purposes.) Fig. 6: (a) and (b): Probability distribution of the number of nodes visited by the sphere decoding algorithm (Algorithm 2), for a ten-step horizon (N = 10) (a) before, and (b) after the LLL reduction algorithm. The mean number of nodes visited is indicated by the solid vertical line. The 95 and 98, and 99 percentiles are shown as dashed, dash-dotted, and dotted vertical lines, respectively. (c): Dimension of each node visited in the worst-case scenario by the sphere decoder when using a ten-step horizon and the preprocessing stage. The mean dimension of the nodes is indicated by the solid vertical line.

sphere decoding for the horizon N = 10 case with the worstcase scenario (max(µ) = 141 nodes visited). The number of nodes explored at each layer is shown in Fig. 6(c). As can be seen, many nodes are of high dimensions (m > 15), implying that few flops are required. This is due to the use of an upper ∼ triangular H matrix and the effective pruning of suboptimal branches. In the sequel, a second and more precise analysis of the computational burden is performed for the real-time opera∼ tions. Since the computation of the unconstrained solution Uunc is performed in real time, the corresponding operations are to ∼ ∼ be taken into account. Considering that Uunc =H M −1 U unc , ∼ and that H is upper triangular, whereas M is sparse, then n(n + 1)/2 multiplications and n(n − 1)/2 additions are required, i.e., n2 flops in total. The operations performed by the sphere decoder are a function of the dimension of the node examined. Focusing on a snapshot of the recursive Algorithm 2, it can be concluded that the most effort is required to compute the update of the radius of the hypersphere. Specifically, for an m-dimensional node, n − m + 1 additions9 (n − m for the computation of ∼ ∼ H (m,m:n) U m:n and one for the addition || ∗ ||22 + d2 ), one subtraction, and n − m + 2 multiplications (n − m + 1 for ∼ ∼ the computation of H (m,m:n) Um:n and one for squaring the Euclidean norm || ∗ ||22 ) are performed. More precisely, since U ∈ U, the result of the n − m + 1 multiplications performed at the mth layer is either the multiplicand itself, with the same or reversed sign, or zero. Therefore, only one multiplication is performed at each node, regardless of its dimension. Finally, since the cardinality of U is three for the case study, for each child node explored, the two sibling nodes are evaluated to determine whether they lie inside of the hypersphere. Note that divisions are not required. Taking all the above into account, the total number of additions Na , subtractions Ns and multiplications Nm performed in real time is ! µ X  n(n − 1) +3 µ−1+ n − m(ν) , Na = 2 ν=1 (18) N = 3µ , s

Nm = 9 Except

n(n + 1) + 3µ . 2

when m = n, where there are n − m = 0 additions.

To derive an upper bound on the number of operations to be performed, a worst-case scenario is examined. This corresponds to the case where (a) the maximum number of nodes max(µ) is explored by the sphere decoder (see Table I), and (b) U ∈ U \ {0}, since multiplications with zero result in a decrease in the number of additions. The total number of operations Nt = Na + Ns + Nm corresponds to the flop count for the real-time computation. The upper bound on the operations performed in real time max(Nt ), is also summarized in Table I. For the horizon N = 10 case, the worst case number of flops is reduced by 80%, compared with a reduction of 83% when considering the worst case number of nodes. VI. P ERFORMANCE E VALUATION The simulation results presented in this section relate to the medium-voltage drive system depicted in Fig. 5. The horizon N = 10 case is investigated. The weighting factor λu = 0.1 is chosen, such that a switching frequency—corresponding to the control effort—of approximately 300 Hz is obtained. The steady-state performance of the drive is shown in Fig. 7. The normalized three-phase stator current waveforms and their references are illustrated over one fundamental period in Fig. 7(a). In Fig. 7(b) the resulting current spectrum is depicted to visualize the tracking accuracy of the controller. The total harmonic distortion (THD) of the current is used as a performance metric, which quantifies the tracking performance of the controller. The current THD is with 4.95% relatively low given the low switching frequency, as can also be seen in [17] where the direct MPC current controller with oneand multiple-step horizon is compared with the pulsewidth modulation (PWM) based strategy of space vector modulation (SVM), and a synchronous optimal modulation technique, namely the offline-calculated optimized pulse patterns (OPPs). The good performance of the controller can also be validated by the thorough comparison presented in [29] between several MPC and PWM-based techniques. Finally, Fig. 7(c) depicts the control input over one fundamental period, i.e., the three-phase switching sequence. Interestingly, in the field of power electronics, the ILS problem underlying direct MPC is typically solved using a brute-force approach, namely exhaustive enumeration of all admissible sequences of control inputs [30]. This limits the prediction horizon achievable in a real-time implementation

0.04

1 0.5

0.03

0

0.02

−0.5

0.01

−1 0

5

10

15

20

Time [ms] (a) Three-phase stator current is (solid lines) and their references (dash-dotted lines).

0

1 0 −1 1 0 −1 1 0 −1 0

500

1000

1500

2000

Frequency [Hz] (b) Stator current spectrum.

0

5

10

15

20

Time [ms] (c) Three-phase switch position (control input) u.

Fig. 7: Simulated waveforms produced by the direct model predictive controller with current reference tracking at steady-state operation, at full speed and rated torque. A ten-step horizon (N = 10) is used, the sampling interval is Ts = 25 µs and the weighting factor is λu = 0.1. The switching frequency (interpreted as the control effort) is approximately 300 Hz and the current THD (interpreted as the controller tracking accuracy) is 4.95%. TABLE II: Maximum number of nodes µ evaluated and flops Nt performed by (a) the exhaustive search algorithm, (b) the sphere decoder in [16], and (c) the proposed algorithm. The resulting current THD for each prediction horizon is also shown. Prediction horizon N 1 2 3 4 5 7 10

Exhaustive search max(µ) max(Nt ) 26 250 517 4,948 7,371 70,120 103,518 983,587 1,455,000 > 1 · 107 > 3 · 108 > 5 · 109 12 > 2 · 10 > 4 · 1013

Sphere decoder [16] max(µ) max(Nt ) 7 99 16 304 24 585 31 1,029 50 1,764 99 4,635 255 14,936

typically to one [31], despite several strategies to facilitate the implementation of MPC algorithms with nontrivial prediction horizons [32]. Recently, the concept of sphere decoding has been introduced to the power electronics community in [16]. The computational complexity of the proposed approach is compared in Table II with these two approaches from the literature. Specifically, the table shows the maximum number of examined nodes µ and operations performed Nt for different prediction horizons. As before, the converter operates at a switching frequency of about 300 Hz, regardless of the prediction horizon. The resulting current THD is shown to highlight that the closed-loop performance of the system can be improved by using longer prediction horizons. Exhaustive search clearly becomes impractical for prediction horizons exceeding two steps. When the sphere decoder is used to restrict the search space the computational complexity—even in the worst-case scenario—increases only mildly as the prediction horizon is extended. Compared to the approach proposed in [16], the sphere decoding algorithm with the modifications proposed in this work further reduces both the number of nodes examined and flops performed. The maximum number of nodes is reduced by about 45%, and that of the operations performed in real time by a very similar percentage, i.e., by 44%. This reduction is a result of the reshaping of the search space and the initial radius ρ being smaller, as can be seen in Fig. 8(a). The computation of the initial radius based on the Babai estimate (see (13) and (14)) results in a slightly tighter hypersphere, and consequently reduces the number of nodes explored. This can be observed in Figs. 8(b) and 8(c), where the probability distributions of the number of nodes visited by the sphere decoder are illustrated. As can be seen, the shape of the distributions resulting from the two sphere decoding approaches is very similar. Yet, with the proposed algorithm, it is more concentrated at the lower end of 30 nodes.

Proposed approach max(µ) max(Nt ) 7 99 14 291 19 501 27 897 44 1,587 61 3,030 141 8,268

THD % 5.76 5.65 5.43 5.37 5.29 5.09 4.95

VII. C ONCLUSIONS The optimization problem underlying model predictive control (MPC) of linear systems with integer inputs is an integer least-squares (ILS) problem. This paper discusses a computationally efficient method to solve this problem, consisting of two steps. First, in a preprocessing step, a lattice reduction algorithm transforms the optimization problem into a wellconditioned problem, such that it can be solved more efficiently. These computations are performed once and offline. Second, in the optimization stage, a refined sphere decoding algorithm is used to solve the optimization problem in a branch-and-bound manner and to derive the optimal sequence of control inputs. The initial radius of the hypersphere is computed using the Babai estimate, ensuring that the solution set is always nonempty while the radius is as small as possible. Nevertheless, since real-time guarantees of termination cannot be provided, modifications—such as adding a stopping criterion—are required to resolve this issue. This matter is further discussed in [33]. An industrial case study of a three-level inverter drive system is used to illustrate the benefits of the optimization method. The computational complexity is analyzed—both in terms of the number of nodes in the search tree explored and the number of flops required. Compared to the optimization method proposed in [16], the computational burden is reduced by up to 45%. A PPENDIX The objective function (4) can be written as J(k) = ζ(k)+||U (k)||2W +U T (k)Λ(k)+ΛT (k)U (k) , (19) where ζ(k) = ||Γx(k) − Y ref (k)||2∼ + ||Ξu(k − 1)||2∼ , Q

T ∼

T ∼

R

W = Υ Q Υ+S RS, T ∼ T ∼ T Λ(k) = Γx(k) − Y ref (k) Q Υ − Ξu(k − 1) R S

0.2

Radius

0.15 0.1

0.05 0

0

5

10

15

Time [ms] (a)

20

100

Probability [%]

Probability [%]

100 80 60 40 20 0

0

50

100

150

200

250

300

Number of nodes (b) The mean number of nodes visited is 38.93.

80 60 40 20 0

0

50

100

150

200

250

300

Number of nodes (c) The mean number of nodes visited is 36.21.

Fig. 8: (a): Initial radius ρ as a function of time, based on the Babai estimate (13) (red solid line) and the educated guess proposed in [16] (blue dashed line). (b) and (c): Probability distribution of the number of nodes visited by the sphere decoding algorithm, for a ten-step horizon (N = 10), as proposed (b) in [16], and (c) in this work. The mean number of nodes visited is indicated by the solid vertical line. The 95 and 98, and 99 percentiles are shown as dashed, dash-dotted, and dotted vertical lines, respectively.

Since R ≻ 0 ⇒ W ≻ 0, and W = W T , after rearranging terms and completing the squares, (19) can be written as J(k) = ||U (k)+ W −1 Λ(k)||2W + ζ(k) − ΛT (k)W −T Λ(k) . {z } | const(k)

(20) Note that the constant term is independent of U (k), and thus it can be neglected. Allowing U (k) ⊂ Rn , the unconstrained (i.e., relaxed) solution of (20) is U unc (k) = −W −1 Λ(k). Inserting U unc (k) in (20), (5) results, which in turn, becomes the ILS function in problem (6).  R EFERENCES [1] J. B. Rawlings and D. Q. Mayne, Model Predictive Control: Theory and Design. Madison, WI: Nob Hill, 2009. [2] C. A. Floudas, Nonlinear and Mixed-Integer Optimization: Fundamentals and Applications. Oxford, UK: Oxford Univ. Press, 1995. [3] L. A. Wolsey, Integer Programming. New York, NY: Wiley, 1998. [4] A. Bemporad and M. Morari, “Control of systems integrating logic, dynamics and constraints,” Automatica, vol. 35, no. 3, pp. 407–427, Mar. 1999. [5] R. Alur, C. Courcoubetis, T. A. Henzinger, and P. H. Ho, “Hybrid automata: An algorithmic approach to the specification and verification of hybrid systems,” in Hybrid Syst., ser. LNCS, R. Grossman, A. Nerode, A. Ravn, and H. Rischel, Eds. Springer-Verlag, 1993, vol. 736, pp. 209–229. [6] E. D. Sontag, “Nonlinear regulation: The piecewise linear approach,” IEEE Trans. Autom. Control, vol. 26, no. 2, pp. 346–358, Apr. 1981. [7] F. Borrelli, M. Baoti´c, A. Bemporad, and M. Morari, “Dynamic programming for constrained optimal control of discrete-time linear hybrid systems,” Automatica, vol. 41, no. 10, pp. 1709–1721, Oct. 2005. [8] F. Borrelli, A. Bemporad, and M. Morari, Predictive Control for Linear and Hybrid Systems. Cambridge, UK: Cambridge Univ. Press, 2011. [9] D. E. Quevedo, G. C. Goodwin, and J. A. De Don´a, “Finite constraint set receding horizon quadratic control,” Int. J. of Robust Nonlin. Control, vol. 14, no. 4, pp. 355–377, Mar. 2004. [10] M. Morari and J. H. Lee, “Model predictive control: Past, present and future,” Comput. and Chemical Eng., vol. 23, no. 4, pp. 667–682, May 1999. [11] D. Q. Mayne, J. B. Rawlings, C. V. Rao, and P. O. M. Scokaert, “Constrained model predictive control: Stability and optimality,” Automatica, vol. 36, no. 6, pp. 789–814, Jun. 2000. [12] G. C. Goodwin, H. Haimovich, D. E. Quevedo, and J. S. Welsh, “A moving horizon approach to networked control system design,” IEEE Trans. Autom. Control, vol. 49, no. 9, pp. 1427–1445, Sep. 2004. [13] D. E. Quevedo and G. C. Goodwin, “Multistep optimal analog-to-digital conversion,” IEEE Trans. Circuits Syst. I, vol. 52, no. 3, pp. 503–515, Mar. 2005. [14] ——, “Moving horizon design of discrete coefficient FIR filters,” IEEE Trans. Signal Process., vol. 53, no. 6, pp. 2262–2267, Jun. 2005. [15] D. E. Quevedo, J. Østergaard, and D. Neˇsi´c, “Packetized predictive control of stochastic systems over bit-rate limited channels with packet loss,” IEEE Trans. Autom. Control, vol. 56, no. 12, pp. 2854–2868, Dec. 2011.

[16] T. Geyer and D. E. Quevedo, “Multistep finite control set model predictive control for power electronics,” IEEE Trans. Power Electron., vol. 29, no. 12, pp. 6836–6846, Dec. 2014. [17] ——, “Performance of multistep finite control set model predictive control for power electronics,” IEEE Trans. Power Electron., vol. 30, no. 3, pp. 1633–1644, Mar. 2015. [18] U. Fincke and M. Pohst, “Improved methods for calculating vectors of short length in a lattice, including a complexity analysis,” Math. Comput., vol. 44, no. 170, pp. 463–471, Apr. 1985. [19] B. Hassibi and H. Vikalo, “On the sphere-decoding algorithm I. Expected complexity,” IEEE Trans. Signal Process., vol. 53, no. 8, pp. 2806–2818, Aug. 2005. [20] P. Karamanakos, T. Geyer, and R. Kennel, “Reformulation of the long-horizon direct model predictive control problem to reduce the computational effort,” in Proc. IEEE Energy Convers. Congr. Expo., Pittsburgh, PA, Sep. 2014, pp. 3512–3519. [21] A. K. Lenstra, H. W. Lenstra, Jr., and L. Lov´asz, “Factoring polynomials with rational coefficients,” Math. Ann., vol. 261, no. 4, pp. 515–534, 1982. [22] J. W. Demmel, Applied Numerical Linear Algebra. Philadelphia, PA: SIAM, 1997. [23] L. Babai, “On Lov´asz’ lattice reduction and the nearest lattice point problem,” Combinatorica, vol. 6, no. 1, pp. 1–13, 1986. [24] X.-W. Chang, J. Wen, and X. Xie, “Effects of the LLL reduction on the success probability of the Babai point and on the complexity of sphere decoding,” IEEE Trans. Inf. Theory, vol. 59, no. 8, pp. 4915–4926, Aug. 2013. [25] J. Holtz, “The representation of ac machine dynamics by complex signal flow graphs,” IEEE Trans. Ind. Electron., vol. 42, no. 3, pp. 263–271, Jun. 1995. [26] C. Ling, W. H. Mow, and N. Howgrave-Graham, “Reduced and fixedcomplexity variants of the LLL algorithm for communications,” IEEE Trans. Commun., vol. 61, no. 3, pp. 1040–1050, Mar. 2013. [27] M. Grotschel, L. Lov´asz, and A. Schriver, Geometric Algorithms and Combinatorial Optimization, 2nd ed. New York: Springer-Verlag, 1993. [28] D. Micciancio, “The hardness of the closest vector problem with preprocessing,” IEEE Trans. Inf. Theory, vol. 47, no. 3, pp. 1212–1215, Mar. 2001. [29] T. Geyer, “A comparison of control and modulation schemes for medium-voltage drives: Emerging predictive control concepts versus PWM-based schemes,” IEEE Trans. Ind. Appl., vol. 47, no. 3, pp. 1380– 1389, May/Jun. 2011. [30] J. Rodr´ıguez, J. Pontt, C. A. Silva, P. Correa, P. Lezana, P. Cort´es, and U. Ammann, “Predictive current control of a voltage source inverter,” IEEE Trans. Ind. Electron., vol. 54, no. 1, pp. 495–503, Feb. 2007. [31] P. Cort´es, M. P. Kazmierkowski, R. M. Kennel, D. E. Quevedo, and J. Rodr´ıguez, “Predictive control in power electronics and drives,” IEEE Trans. Ind. Electron., vol. 55, no. 12, pp. 4312–4324, Dec. 2008. [32] P. Karamanakos, T. Geyer, N. Oikonomou, F. D. Kieferndorf, and S. Manias, “Direct model predictive control: A review of strategies that achieve long prediction intervals for power electronics,” IEEE Ind. Electron. Mag., vol. 8, no. 1, pp. 32–43, Mar. 2014. [33] P. Karamanakos, T. Geyer, and R. Kennel, “Suboptimal search strategies with bounded computational complexity to solve long-horizon direct model predictive control problems,” in Proc. IEEE Energy Convers. Congr. Expo., Montreal, QC, Canada, Sep. 2015, pp. 334–341.