Computationally efficient model predictive control for

0 downloads 0 Views 500KB Size Report
For this reason, Nonlinear MPC (NMPC) has gained attention recently [10], [11]. ... cite vehicle dynamics [25], power plants like boiler-turbine systems [26] ... an autonomous tram with regenerative breaking [25] and the torque control of a ...
Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

Computationally efficient model predictive control for a class of linear parameter-varying systems ∗ Universit` a

Luca Cavanini∗ , Gionata Cimini† , Gianluca Ippoliti∗ Politecnica delle Marche, Ancona, Italy. Email: {l.cavanini,g.ippoliti}@univpm.it † ODYS S.r.l., Lucca, Italy. Email: [email protected]

Abstract—The use of Linear Parameter Varying (LPV) prediction models has been proven to be an effective solution to develop Model Predictive Control (MPC) algorithms for linear and nonlinear systems. However, the computational effort is a crucial issue for LPV-MPC, which has severely limited its application especially in embedded control. Indeed, for dynamical systems of dimension commonly found in embedded applications, the time needed to form the Quadratic Programming (QP) problem at each time step, can be substantially higher than the average time to solve it, making the approach infeasible in many control boards. This paper presents an algorithm that drastically reduces this computational complexity for a particular class of LPV systems. We show that when the input matrix is rightinvertible, the rebuild phase of the QP problem can be accelerated by means of a coordinate transformation which approximates the original formulation. We then introduce a variant of the algorithm, able to further reduce this time, at the cost of a slightly increased sub-optimality. The presented results on vehicle dynamics and electrical motor control confirm the effectiveness of the two novel methods, especially in those applications where computational load is a key indicator for success. Index Terms—Model predictive control, linear parameter varying systems, embedded control.

I. I NTRODUCTION Model Predictive Control (MPC) is a technology widely investigated in many control problems, including process industry, automotive, aerospace and energy systems [1]. This ever growing interest is mainly due to the simplicity of handling constrained, multivariable control problems, by making explicit use of the plant model to predict the future evolution of the plant [2], [3]. The well-known drawback of MPC is the computational effort needed to solve, at each time step, a finite-time optimal control problem. With a Linear TimeInvariant (LTI) prediction model, a quadratic cost function and affine input/output constraints, the optimization problem is convex, and equivalent to solve a Quadratic Programming (QP) problem [4]. This is the most common formulation, and in this paper we refer to it as MPCLTI . The research on fast QP solvers [5], [6], as well as on the explicit solution [4], has reduced the online complexity of MPC, opening the door to its application even in real-time, fast-sampled, control problems, like power electronics or electrical motors [7], [8]. However, the closed-loop performance is strongly dependent on the quality of the model, and a stationary linear prediction could be not sufficient to capture the main dynamics of a system [9]. For this reason, Nonlinear MPC (NMPC) has gained attention recently [10], [11]. However, despite the advances in nonlinear

optimization, e.g. sequential quadratic programming [12], the complexity of NMPC is still a cumbersome for real-time implementations. Linear Parameter Varying (LPV), as well as Linear Time Varying (LTV), models are valuable alternatives to approximate the behavior of nonlinear models. They have been successfully used for different control problems, such as aerospace, automotive and renewable energies [13]–[17]. The LPV framework, first introduced in [18], enhances the modeling capabilities of LTI systems, by describing a family of non-stationary models where the state-space depends on a finite number of measurable, exogenous, time-varying scheduling parameters [19]. At the same time, they preserve the simplicity of LTI systems, and make it possible to reuse some of the well-known results in that field. LPV models can be either obtained by linearizing a given nonlinear model or derived with black-box identification [20], [21]. Moreover, if a nonlinear model is available, for instance equation-based or identified through a neural network, a common approach is to linearize online the model at each time step around a time-varying reference trajectory (e.g. the previous optimal trajectory), thus obtaining a LTV model [21], [22]. For this reason, from now on, we will refer only to LPV models, being the LTV framework an extension where the parameters depends on a fixed trajectory over time. The use of LPV models for MPC has attracted much attention, because of the improved modeling capabilities compared to MPCLTI , while preserving the convexity of the optimization problem [9], [23], [24]. Indeed, at each time step, the scheduling parameters are supposed to be measured or estimated. This results into a QP problem but, unlike MPCLTI , all the QP matrices are time-varying, as they depend on the new state-space. Therefore, at each time step the QP problem not only needs to be solved, but also constructed. As shown in the paper, the time needed to compute the QP problem of dimensions commonly found in embedded applications, is substantially greater than the average time to solve it. This worsening of computational time can prevent the embedded implementations of MPCLPV with high sampling rate, and lowpower boards. In order to counter this drawback, we propose an algorithm that is able to drastically reduce the computational complexity of the overall MPCLPV routine, when applied to systems where nx ≤ nu , with nx the number of states and nu the number of inputs. This is a particular structure of linear dynamical systems that implies the right invertibility of the input matrix. Applications where such structure holds true

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

can be found in several engineering fields, among which we cite vehicle dynamics [25], power plants like boiler-turbine systems [26], electrical motors control [8], heat exchange control [27] and regulation of wind turbines [28]. This paper extends the preliminary results presented in [29], and shows that the cost of the rebuild phase of a MPCLPV algorithm can be drastically reduced if the prediction model belongs to the aforementioned category of dynamical systems. Indeed, by exploiting a change of coordinates, we show that the costly rebuild phase reduces to the computation of only some of the inequalities forming the QP problem, without the need to modify neither the cost function or the remaining part of the constraints inequalities. For this reason, we will refer to the proposed algorithm as Rebuild-Free (RF)-MPCLPV . It guarantees remarkable improvements in computational complexity, while the sub-optimality caused by the approximation is shown to be negligible. The algorithm has been widely tested on a benchmark set of random QP problems, as well as on two real-world control problems, namely the position tracking of an autonomous tram with regenerative breaking [25] and the torque control of a Permanent Magnet Synchronous Motor (PMSM) [8]. Besides the improvement of the execution time, the RF-MPCLPV algorithm is much simpler than standard MPCLPV and requires a smaller memory footprint, which are both crucial aspects for the majority of embedded applications [8], [29], [30]. Even though RF-MPCLPV substantially speeds up the control task, it still requires a partial rebuild of the constraint inequalities, whose computational time is not negligible. As a second contribution of the paper, we present a variant of the RF-MPCLPV algorithm that we refer to as RF2 -MPCLPV . By scarifying the solution accuracy, RF2 -MPCLPV is able to further speed up MPC routine, proving to be very useful when the execution time is crucial. The tests on both random QP problems and real-world examples confirm the effectiveness of the control algorithm, which derives a solution of good quality in less than half the time needed by MPCLPV . Moreover, thanks to the particular structure of the control law, the inputs applied at the current iteration are guaranteed to be always feasible. The paper is organized as follows. Section II presents the standard formulation of MPCLPV . Section III details the main contribution of the paper, presenting the two computationally efficient algorithms. Section IV shows the results of both the proposed algorithms, when compared to the standard MPCLPV , and Section V concludes the paper. II. P ROBLEM S TATEMENT Define θk ∈ Θ a time-varying vector of exogenous parameters, measured at each time step k, with Θ ⊂ Rnθ a set of interest. An LPV model can be written as follows: xk+1 = A(θk )xk + B(θk )uk yk = Cx

(1a) (1b)

where x ∈ Rnx is the state vector, u ∈ Rnu is the input vector, y ∈ Rny is the output vector, A(θk ) ∈ Rnx ×nx , B(θk ) ∈ Rnx ×nu and C ∈ Rny ×nx are the state-space matrices. MPCLPV makes use of (1) as a prediction model,

and with a quadric cost function subject to affine constraints, the optimization problem to solve can be formulated as: min. ∆u

Np X

kQy (yk+i|k − rk )k22 +

NX u −1

i=1

kQ∆u ∆uk+h|k k22

h=0

(2a) s.t. xk+i+1|k = A(θk )xk+i|k + B(θk )uk+i|k

(2b)

yk+i+1|k = Cxk+i+1|k

(2c)

xk|k = xk

(2d)

∆uk+Nu +j|k = 0

(2e)

∆uk+h|k ∈ Dk

(2f)

yk+i|k ∈ Y

(2g)

i ∈ {0, . . . , Np − 1}

(2h)

h ∈ {0, . . . , Nu − 1}

(2i)

j ∈ {0, . . . , Np − Nu − 1},

(2j)

where Np is the prediction horizon, Nu is the control horizon, Qy , and Q∆u are square weight matrices, with Q∆u invertible, xk+i|k denotes the prediction of the variable x at time k + i based on the information available up to time k, ∆uk+i|k is the vector of the input increments, with uk−1|k = uk−1 , rk is the vector of outputs references, and Dk , Y are polyhedral sets of constraints inputs’ increments, and outputs, respectively. Given the inputs constraints Eu u ≤ eu , and the inputs’ increments constraints E∆u ∆u ≤ e∆u , then 0 Dk = {∆u ∈ Rnu | D∆u ≤ dk } where D = E∆u Eu  0 and d = e∆u eu − Eu uk−1 . The solution to (2) can be found by optimizing the equivalent time-varying QP problem below, usually addressed as condensed formulation: min. z

s.t.

1 0 z Hk z + ρ0k Fk0 z 2   ∆u   ∆u  G∆u W w z≤ ρk + Gyk Wky wky

(3)

where z ∈ Rnz is the vector of optimization variables, ρk ∈ P is the vector of MPC parameters of dimension nρ = ny + nx + nu , with P ⊂ Rnρ a bounded set of 0 interest and ρk = rk uk−1 xk|k , Hk ∈ Rnz ×nz is a symmetric and positive definite matrix, Fk ∈ Rnz ×nρ is the linear cost term, G∆u ∈ Rmu ×nz , Wk∆u ∈ Rmu ×nρ k ∆u mu are the terms defining inputs’ increments and wk ∈ R constraints, Gyk ∈ Rmy ×nz , Wky ∈ Rmy ×nρ and wky ∈ Rmy are the terms defining outputs constraints. The optimization   variables are defined as z = ∆uk , . . . , ∆uk+Nu . It is worth noticing that, as a standard assumption, the vector of parameters θk is supposed to be constant in prediction [23], [31]. The recent literature proposed several algorithms to solve efficiently the QP problem (3), among which we cite gradient projection [32], interior-point [33] and active-set methods [6], [8]. However, solving problem (3) is not the only computationally costly operation for MPCLPV . Indeed, unlike MPCLTI , the matrices Hk , Fk , Gk , Wk and wk are time-varying, because of the dependence on the model (1), and therefore they must be recomputed at each time step. Unfortunately, the time required by this rebuild can be high enough to discourage the use of MPCLPV . As an example,

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

QP building time

Theorem III.1. Given a MPC formulation as in (2), with ¯ k ) and B(θk ) = nu ≥ nx , let A(θk ) = A(θ0 ) + A(θ ¯ k ), two time-varying matrices computed at time B(θ0 ) + B(θ k, for some θ0 ∈ Θ. Consider the LTI system defined by

QP solving time

3

Time [ms]

2.5

x ¯k+1 = A(θ0 )¯ xk + B(θ0 )¯ uk

2

y¯k = C x ¯k .

(4a) (4b)

and let F(¯ uk , xk ) : Rnu → Rnu be a coordinate transformation of the inputs defined as

1.5

¯ k )xk ) F(¯ uk , xk ) := uk = B(θk )+ (B(θ0 )¯ uk − A(θ

1 3

6

9

12 Np

15

18

21

Figure 1. Computational time required to compute the optimal inputs with a standard MPCLPV formulation with ny = nx = nu = 2, Nu = Np /3. The time required to compute the QP and to solve it are shown. For each Np the box-plot is derived over 1000 examples. The dual simplex solver from Mosek c is used. Aps

Fig. 1 provides an idea about this complexity, comparing the time required to build the problem and to solve it, on a large set of random QP problems with dimensions commonly found in embedded applications. Clearly, the rebuild time depends only on the dimensions, whereas the solution time depends on the iterations taken by the solver and it is represented by a box-plot resulting from 1000 random tests for each point. The R computational framework is a PC with Intel Core i5-3210M CPU @ 2.50GHz, running the dual simplex solver from Mosek c . The same setup has been used throughout the rest of Aps the paper. The results show that the time spent on building the QP is substantially larger than the average time to solve it, and can be even larger than the worst-case. III. R EBUILD - FREE LPV-MPC From the considerations of Section II, it is easy to conclude that by reducing the time spent building the QP problem from scratch, the efficiency of MPCLPV can be considerably improved. This section details the RF-MPCLPV algorithm, which is the main contribution of the paper, and shows the improvements when compared with standard MPCLPV . As a second contribution, the RF2 -MPCLPV variant is also presented, where, by scarifying solution accuracy, the speed can be further enhanced. A. Coordinate transformation of system’s inputs In order to derive the RF-MPCLPV framework, we introduce here a coordinate transformation of the systems’ inputs, which allows to design the MPC controller for an LTI system. This is close in spirit with Feedback Linearization (FL) technique, [34]–[37]. However, the drawbacks of FL are avoided in this case, as i) the cost function remains convex, ii) the constraints on the transformed variables can be computed by affine operations on the original ones. The following theorem introduces the coordinate transformation, and derives the relations to correctly impose the constraints on the transformed variables.

(5)

with B(θk )+ the right pseudo-inverse of B(θk ). Then, in order to impose constraints on the original LPV system (1), the LTI system (4) must be constrained such as: ¯ k+h where D ¯ k+h is an i) given ∆u ∈ Dk , then ∆¯ uk+h ∈ D affine transformation of Dk , depending on xk+h ; ii) given yk+i ∈ Y, then y¯k+i ∈ Y, ∀ i = 0, . . . , Np − 1. Proof: i) Consider Dk = {∆u ∈ Rnu | D∆u ≤ dk }, then applying the coordinates’ transformation (5), the following polyhedral space is derived ¯ k+h ={∆¯ ¯ k+h ∆¯ D u ∈ Rn u | D u ≤ d¯k+h , ∀h = 0 . . . Nu } (6) where ¯ k+h = DB(θk )+ B(θ0 ) D ¯ k )xk+h|k + dk . d¯k+h = DB(θk )+ A(θ

(7)

ii) Given uk+i|k = F(¯ uk+i|k , xk+i|k ), ∀i = 0, . . . , Np − 1, with uk+i|k = uk+Nu −1|k , ∀i ≥ Nu . Let the output prediction equation be yk+i+1|k = C(A(θk )xk+i|k + B(θk )uk+i|k ),

(8)

then, applying the coordinate transformation, the following equation is obtained: yk+i+1|k = C(A(θ0 )xk+i|k + B(θ0 )¯ uk+i|k )

(9)

and therefore yk+i+1|k = y¯k+i+1|k holds, from which clearly follows that y¯k+i ∈ Y. As a by-product, equation (9) demonstrates also that xk+i|k ≡ x ¯k+i|k which will be useful in the rest of the paper. Theorem III.1 suggests how to design a MPC controller for the LTI system (4), that, when used in feedback with the coordinates’ transformation (5), regulates the original LPV system by imposing the desired inputs/outputs constraints. In the specific, given the proved equivalence of the outputs, the outputs’ constraints can be imposed directly on the LTI system, without the need of time-dependant rebuild in the condensed form. On the other hand, the constraints on the inputs can be derived by an affine transformation of the original set. However, this transformation would depend on the future evolution of the states, which would turn into a non-holonomic constraints’ formulation, difficult to be solved in real-time. The next subsection proposes the complete RFMPCLPV algorithm, with a solution to solve efficiently the aforementioned problem.

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

B. Rebuild-free MPCLPV algorithm The convex optimization problem to be solved by the MPC controller, designed to regulate the LTI system (4), can be cast into the following QP problem, where the Hessian H, the matrix F , and the outputs’ matrix inequality are time-invariant: 1 min. z¯0 H z¯ + ρ0k F 0 z¯ z¯ 2  ∆u       ∆u  ¯k T¯k Tk G G w s.t. z ¯ ≤ ρ + ρ ¯ + W0y k Gy0 w0y 0(my ×nu ) k (10)   uk , . . . , ∆¯ uk+Nu , F = F (θ0 ), H = H(θ0 ), with z¯ = ∆¯ ¯k Gy0 = Gy (θ0 ), W0y = W y (θ0 ), wy0 = wy (θ0 ), and Tk , T¯k , G and ρ¯k are the only time-varying components whose derivation ∆u is detailed below. Consider G∆u relative h,j the row of G the the j-th input increment constraint, at the h-th prediction step, with j = 1, . . . , mu and h = 0, . . . , Nu − 1. Assume G∆u to be ordered by grouping all the constraints at the same prediction step, with increasing j, and let w∆u follow the same ∆u the single element. By applying the order scheme, with wh,j coordinates’ transformation (5), for h = 0 the input increments can be written as: ¯ k )xk|k ) − uk−1 ∆uk|k = B(θk )+ (B(θ0 )¯ uk|k − A(θ

(11)

and the j-th input constraint on the new coordinates can be computed as u ¯ u ¯ ¯x ¯k|k (12) T¯0,j ∆¯ uk|k ≤ w0,j − T¯0,j u ¯k−1 + G∆u 0,j uk−1 + T0,j x

with u ¯ + ∆u ¯ T¯0,j = G∆u 0,j B(θk ) B(θ0 ) = G0,j G0,j k x + ¯ T¯0,j = G∆u 0,j B(θk ) A(θk )

(13a) (13b)

Equation (11) allows to recompute the inputs’ increments (and inputs) constraints in the new coordinates, to exactly impose those limits on the original LPV system. As a result, the inputs effectively applied to the system will be always feasible. However, the constraints at the future prediction steps are nonholonomic, due to what proved by Theorem III.1. Therefore, in order to maintain the convexity of the problem, RF-MPCLPV approximates the prediction of the states with that computed at the previous time-step k − 1. With this assumption, the general constraint j, at prediction step v = 1, . . . , Nu , can be approximated by: u ¯ u ¯ T¯v,j ∆¯ uk+v|k ≤ wv,j − T¯v,j u ¯k−1 + G∆u 0,j uk−1 + (14) x +T¯v,j x ¯k+v|k−1 where xk+v|k−1 denotes the states’ prediction obtained at the previous time-step, which can be derived by considering: x ¯k+v|k−1 = A(θ0 )¯ xk+v−1|k−1 + B(θ0 )¯ uk+v−1|k−1

(15)

with x ¯k|k−1 = x ¯k|k , and u ¯k+Nu −1|k−1 = u ¯k+Nu −2|k−1 due to the unavailability of ∆¯ uk+Nu −1|k−1 . Consequently, the prediction of the LPV inputs are computed as: uk+v−1|k−1 =B(θk )+ B(θ0 )¯ uk+v−1|k−1 + ¯ k )¯ −B(θk )+ A(θ xk+v−1|k−1 .

(16)

The equations (12) and (14) are the ground for the derivation of the time-varying components of the constraints’ inequality

 in (10). In the specific, ρ¯k is found to be ρ¯k = ρ¯uk with

ρ¯uk¯

  ρ¯uk = u ¯k−1|k−1 . . . u ¯k+Nu −1|k−1 0(nu ×1)   ρ¯uk¯ = uk|k−1 . . . uk+Nu −1|k−1 0(nx ×1)   ρ¯xk = xk+1|k−1 . . . xk+Np −1|k−1 .

ρ¯xk

0

(17a) (17b) (17c)

¯ k , Tk and T¯k As a last step, the time-varying components G of the QP problem (10) are computed at each iteration as:   ¯0 ... G ¯h ... G ¯ N −1 ¯k = I G G (18a) u k k k  (m ×n )  u x u y Tk = 0 (18b) T0 T0k  u¯  u x ¯ ¯ ¯ ¯ Tk Tk = Tk T (18c)  u¯  u ¯ u ¯ u ¯ ¯ ¯ ¯ ¯ Tk = I T0k . . . Thk . . . TNu −1k (18d)  (m ×n )  u u u u u u T =I 0 T1 . . . Th . . . TNu −1 (18e)  (m ×n )  x x u x 0 T . . . Thxk . . . TNx u −1k (18f) Tk = I 1k  ¯    ¯ −G∆u Gh,1k h,0 G0,0k  ..    ..  .    .     ¯ 0,j  ¯ h,j  , T¯u¯ =  −G∆u G ¯h =  G G (18g) h,j hk k k k      .    . ..  ..    ∆u ¯ ¯ Gh,mu k −Gh,mu G0,mu k  ∆u   ¯x  Gh,0 Th,0  ..   ..   .   .   x   ∆u  u x ¯    Th =  Gh,j  , Thk =  (18h)  Th,j   .   .  . .  .   .  T¯x G∆u h,mu

h,mu

Given the above equations, Algoritheorem 1 details the steps of one iteration of RF-MPCLPV .

C. Approximation with constraints constant in prediction The RF-MPCLPV algorithm saves the costly rebuild of the hessian Hk , the matrix Fk and the matrix inequality of the output constraints. However, it still needs to rebuild at each time step the matrix inequality regarding the constraints on the inputs, and inputs’ increments. This is unavoidable to have an accurate affine approximation of the original nonholonomic constraints, which translates into an optimizer very close to what obtained with the standard MPCLPV . However, one can have the necessity to further improve the speed of the algorithm, at the cost of scarifying the solution accuracy. To this end, a simple but effective solution is to build the constraints at the current iteration step, that is equation (12), and impose it for the whole control horizon. This reflects a similar idea used in FL to approximate the non-linear constraints at future prediction time-steps, [35]. Therefore, in order to implement this variation of the algorithm, which is referred to as RF2 -MPCLPV , matrices Tk , T u and T¯k needs to

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:

xk|k−1 ← xk ; u ¯k−1|k−1 ← u ¯k−1 ; uk−1|k−1 ← uk−1 ; ρ¯k ← ∅; for i = 1, . . . , Np do if i ≤ Nu − 1 then u ¯k+h|k−1 ← u ¯k+h−1|k−1 + ∆¯ uk+h+1|k−1 ; else u ¯k+h|k−1 ← u ¯k+h−1|k−1 ; end if compute xk+h|k−1 ;  . See Eq. (15) uk+h|k−1 ← F u ¯k+h|k−1 , xk+h|k−1 ; ρ¯uk ← uk+h|k−1 ; ρ¯xk ← xk+h|k−1 ; ρ¯uk¯ ← u ¯k+h|k−1 ; end for 0 ρ¯k ← [¯ ρuk , ρ¯xk , ρ¯uk¯ ] ; ¯k; build G . See Eq. (18a) build Tk ; . See Eq. (18b) build T¯k ; . See Eq. (18c) compute z¯∗ by solving the QP problem (10); u ¯k ← u ¯k−1 + ∆¯ uk|k−1 ; uk ← F (¯ uk , xk );

Output: The inputs uk to apply to the system. be redefined, respect to what shown in Section III-B, such as ρ¯k = u ¯k−1 and   Tk = 0(Nu ·mu ×ny ) T u Tkx (19a) 0  u u u u (19b) T = T0 . . . Th . . . TNu −1  x 0 x x x Tk = T0k . . . Thk . . . TNu −1k (19c)  u¯ 0 u ¯ u ¯ T¯k = T¯0k . . . T¯hk . . . T¯Nu −1k . (19d) with Thu , Thxk and T¯hu¯k given by Eq. (18g) and (18h). Eq. (19) shows that the time-varying matrices required to update the QP problem (10) have a simpler structure for RF2 -MPCLPV , with respect to RF-MPCLPV . Moreover the states’ approximation steps are not required. Both these aspects makes RF2 -MPCLPV a faster algorithm, at the price of an increased sub-optimality. D. Benchmark on embedded problems The proposed RF-MPCLPV and RF2 -MPCLPV have been tested on a large data-set of MPC problems, subject to box constraints on inputs, inputs’ rate and outputs. The dimensions of such problems are typical of embedded applications, given the impact of the algorithm on real-time systems. The performances have been compared with respect to the standard MPCLPV approach, in terms of speed and solution accuracy. The computational environment is the one introduced in Section II. In order to evaluate the optimality, let the cost at instant k be Jk = 0.5zk0 Hk zk + ρk Fk0 zk . (20)

Average time [ms]

1:

MPCLPV

RF-MPCLPV

RF2 -MPCLPV

101

100

10−1

3

6

9

12

RF-MPCLPV

15

18

21

RF2 -MPCLPV

10 8 ηk [%]

Algorithm 1 RF-MPCLPV Algoritheorem Input: Parameters arrays ρk , θk , system state xk , previous step inputs uk−1 ,¯ uk−1 , previous step input increments ∆uk+h|k−1 , h = 0, . . . , Nu − 1

6 4 2

3

6

9

12 Np

15

18

21

Figure 2. Comparison between MPCLPV , RF-MPCLPV and RF2 -MPCLPV techniques when controlling systems with ny = nx = nu = 2 and horizons Nu = Np /3. From top to bottom average computation times and average percentage cost error are showed.

Given Jk∗ the cost at zk∗ , which is the optimizer computed by standard MPCLPV , we introduce the optimality gap ηk : ηk = 100 · |Jk∗ − Jˆk | / |Jk∗ |

(21)

with Jˆk the cost computed at zˆ∗ , defined as the optimizer obtained with either RF-MPCLPV or RF2 -MPCLPV . Figures 2 and 3 collect the results of the benchmark. Each single point is the average value of 1000 randomly generated MPC problems. It is worth noticing that the time reported refers to the whole control routine. Figure 2 shows how the algorithm performs with increasing prediction and control horizons. As expected, RF-MPCLPV drastically reduces the computational time of MPCLPV , from 7 to 8 times less, with a solution quality close to the optimum (less than 7% error in the worstcase). On the other hand, RF2 -MPCLPV further accelerates the control routine, by allowing an higher sub-optimality. Figure 3 shows the dependence of the results from the systems dimensions, while keeping constant the prediction and control horizon. Similar speed improvements and optimality gap can be observed in this case, too. IV. C ASE S TUDIES In this section two case studies taken from real-world applications are considered to evaluate the performance of the proposed algorithms. The first part of the section shows the control of an autonomous tram [25], and the second part

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

MPCLPV

RF-MPCLPV

RF2 -MPCLPV

Average time [ms]

101

brake ff (t) can only take negative values. Let us define α = 0.5ρCDA , and let a(t) = v(t) ˙ be the acceleration of the tram, the vehicle dynamics must be subject to the following set of time-varying constraints on speed, acceleration, electrical machine and friction forces: 0 ≤ v(t) ≤ v max (s(t))

10

min

0

≤ a(t) ≤ a

(23b) (23c)

ffmin (t) 6

9

12

RF-MPCLPV

15

18

21

10

ηk [%]

8 6 4 2

3

6

9

12 ny

15

18

≤ ff (t) ≤ 0

fe (t) + ff (t) ≥ M a

min

(23d) 2

+ αv(t) + M h(β(t))

where, given the motor power Pm , the electrical force can be computed on-line as:   max Pm max , fe,a (t) femax (v(t)) = min v(t) min P femin (v(t)) = m v(t) max fe,a (t) = M amax + αv(t)2 + M h(β),

RF2 -MPCLPV

21

Figure 3. Comparison between MPCLPV , RF-MPCLPV and RF2 -MPCLPV techniques consider plants with ny = nx = nu and horizons Np = 12, Nu = 4. From top to bottom average computation times and average optimal cost error are showed.

presents the torque control of a PMSM [8], [38]. In both the cases the LPV algorithms have been tested when regulating the original nonlinear system. A. Position tracking of a catenary-free tram This control problem regards the low-level automatic train operation system of a catenary-free tram with regenerative breaking. In brief, the traction force, the regenerative brake and the dissipative brake have to be optimally actuated to move the tram between two consecutive stations, guaranteeing punctuality, comfort and energy efficiency. The system dynamics can be represented by the following nonlinear, continuous-time, model: s(t) ˙ = v(t) (22a) 2 fe (t) + ff (t) − 0.5ρCDA v(t) v(t) ˙ = − h(β(t)) (22b) M h(β(t)) = µg cos(β(t)) + g sin(β(t)) (22c) where s is the tram position to be controlled, v the tram speed, M the mass, fe and ff the electrical machine and dissipative braking forces, respectively, CDA the coefficient of aerodynamic drag, ρ the density of air, β(t) the grade angle, µ the coefficient of rolling distance, and g the gravity acceleration. The electrical machine force fe (t) can take positive values, representing the traction force, and negative values, representing the regenerative braking. The dissipative

(23a)

femin (v(t)) ≤ fe (t) ≤ femax (v(t))

a

3

max

(23e) limits

(24a) (24b) (24c)

and the time-varying limit vmax (s(t)) is a piece-wise constant function of the position. The meaning and values assumed by all the parameters in Eqs. (23) and (24) are collected in Table I. It has been demonstrated as the non-linear dynamics (22) of the vehicle can be approximated by an LPV model, with sufficient accuracy for control purposes [25]. Let us define 0 0 x(t) = s(t) v(t) , u(t) = fe (t) ff (t) and uv (t) =  0 sin(β) cos(β) , the following LPV system is used as the prediction model for MPC: x(t) ˙ = Ac (x2 (t))x(t) + Buc u(t) + Bvc uv (t), with the continuous-time LPV matrices defined as:     0 1 0 0 c Ac (xt ) = , B = , 1 1 u 2 (t) 0 − axM    M M 0 0 1 0 Bvc = , Cc = . −µg −g 0 1

(25)

(26a) (26b)

The discrete-time model is easily obtained from Eq. (26), by RT c c Ad (θk ) = eA (θ(t))Ts , B d (θk ) = 0 s eA (θ(t))Ts B c dτ and C d ≡ C c . This model with the constraints of Eq. (23) are the bricks for the development of the MPC controller to be tested. Regarding the design of such controller, the reader is pointed to [25], which details the specifics of the MPCLPV controller which is used in the following as the baseline to compare the novel algorithms. The main parameters of the MPC are collected in the second half of Table I. It is worth mentioning that the tested controller makes use of the preview on both the reference position and the measured disturbances. In order to derive the corresponding RF-MPCLPV and RF2 MPCLPV controllers, the value θ0 = 10 m/s of the timevarying parameter x2 (t) is selected, being the average value in the allowed range described by the speed constraints in the considered scenario. The comparison of the control performance between MPCLPV , RF-MPCLPV and RF2 -MPCLPV , when driving the tram nonlinear model of Eq. (22) between two consecutive stations, is presented in Figures 4. It shows

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

Table I T RAM S PECIFICATIONS AND MPC T UNING PARAMETERS Parameter

Symbol

Value

Units

Mass Rolling resistance coeff. Aerodynamic drag coeff. Air density Max. acceleration Min. acceleration Max. motor power Min. motor power Min. brake force

M µ CDA ρ amax amin max Pm min Pm min ff

80000 0.005 5.4 1 1 −1.2 850 850 105

kg

Prediction horizon Control horizon

Np Nu

Output weights

Qy

Input weights

Qu

Input rates weights

Q∆u

Sampling time

Ts

20 11  10 0 0 0 2 0 0.2

MPCLPV

m/s2 m/s2 kW kW N

RF2 -MPCLPV

s[m]

2,000 1,000

 0 0  0 3 0 2

0

0

50 MPCLPV

100

150

RF-MPCLPV

200 RF2 -MPCLPV

20 s

v[m/s]

15

Table II T RAM POSITION TRACKING WITH MPC - P ERFORMANCE C OMPARISON

Ta [s] TM [s] ∆Ta [%] ηa [%]

RF-MPCLPV

MPCLPV

RF-MPCLPV

RF2 -MPCLPV

0.0123 0.0404 −− −−

0.00599 0.01771 51.4525 9.8280

0.00574 0.01481 53.5225 9.8297

10 5 0

0

50 MPCLPV

100

150

RF-MPCLPV

200 RF2 -MPCLPV

10

fc [kN]

5 0 −5 −10

0

50 MPCLPV

100

150

RF-MPCLPV

200 RF2 -MPCLPV

0 ff [kN]

the input forces computed by the three algorithms, the tracked output position and the output vehicle speed with related constraints, respectively. Clearly, the differences in the overall control performance are not relevant, but the improvement in the average computational Ta time and maximum computational time TM is substantial as confirmed by Table II. With an average sub-optimality of ηa of 9%, the proposed techniques are able to reduce the average percentage computation ∆Ta time up to the 53%. It is worth mentioning that the error in the solution is computed on the whole, predicted, control sequence. However, only the first inputs are applied and RFMPCLPV produces a maximum error on the actual inputs of 1.04% for u1 and 0.38% for u2 . Whereas, for RF2 MPCLPV this error amounts to 2.8% and 1.6%, for u1 and u2 respectively.

−0.5

−1 B. Torque control of a PMSM This section shows the application of the RF-MPCLPV and RF2 -MPCLPV to optimally track the torque of a brushless motor [8], [38]. With respect to the (d,q) reference frame rotating synchronously with the rotor, the electrical subsystem of an isotropic PMSM is: i R i˙ d (t) = − id (t) + ω(t)iq (t) + ud (t) L L ˙iq (t) = − R iq (t) + 1 uq (t) − λ ω(t) L L L p p B q ω(t) ˙ = ω(t) + Kt i (t) − τl (t), J J J

(27a) (27b) (27c)

0

50

100 150 Time[s]

200

Figure 4. From top to bottom: comparison of tram position, tram velocity, electrical machine force and breaking force when driving the tram with MPCLPV (red), RF-MPCLPV (dashed yellow) and RF2 -MPCLPV (dotted green) algorithms. The blue circles in the first plot represent the set-point for the tram position. The dashed black lines in the second and third plot represent system constraints on tram velocity and electrical force.

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

where L and R are the stator inductance and resistance, respectively, i and u are the stator currents and voltages, respectively, ω is the electrical motor speed, τ = Kt iq (t) = 23 pλiq (t), Kt is the torque scaling constant, p is the number of pole pairs and the subsctripts d and q stand for the direct and quadrature components. Model Predictive Torque Control (MP-TC), aims at manipulating the stator voltages to track a torque trajectory provided by an external loop, usually a linear regulator, which is devoted to steer the output speed at a desired value [38]. The double loop structure is commonly used in this context as the electrical quantities are much faster than the mechanical ones, and the constraints to impose regard the currents and voltages. Let us consider the LPV model: xk+1 = A(wk )xk + Buk + Gvk

Table III B RUSHLESS M OTOR AND MPC T UNING PARAMETERS Parameter

Symbol

Value

Units

Resistance Inductance Flux linkage

R M λ0

4.3 3.56 0.0245

Ω mH Wb

Prediction horizon Control horizon

Np Nu

5 2 

Output weights

Qy

Input weights

Qu

Voltage limit Current limit Sampling time

Vmax Imax Ts

 0.1 0 0.5   0 0.05 0 0 0.05 √ 36/ 3 0.8 0.3

V A ms

(28a)

yk = Cxk (28b)  0  0 where xk = idk iqk is the state vector, uk = udk uqk d 0 is the input vector, yk = ik τk is the output vector and vk = ωk is the measured disturbance. From the nonlinear model (27), the state space matrices of the LPV system (28) are found to be:     −R/L ωk 1/L 0 A(wk ) = ,B= , ωk −R/L 0 1/L     0 1 0 G= ,C= . (29) −λ/L 0 Kt Besides regulating the torque, MP-TC has to enforce constraints on inputs and outputs. In the specific, the phasevoltage limit Vmax is imposed by the maximum DC-bus voltage tolerated by the inverter. The maximum current Imax is chosen so as to prevent overheating, and peaks larger than this limit are usually allowed for short time intervals. In the (d, q) reference frame, these constraints are imposed as 2-norm limits, such that u ∈ U = {u ∈ R : ||u||2 ≤ Vmax }

(30a)

x ∈ X = {x ∈ R : ||x||2 ≤ Imax }.

(30b)

However, in order to obtain an MPC formulation with affine constraints, equations (30a) are commonly approximated by polyhedra, and in this work we implemented such constraints as hexagons, which give an acceptable trade-off between accuracy and number of inequality constraints [8]. The parameters of the brushless motor and the tuning factors of the controller are grouped in Tab. III. The RF-MPCLPV and the RF2 -MPCLPV have been compared with respect to the standard MPCLPV approach. The control scenario is shown in Fig.5, and the results are summarized in Tab. IV. The average computational time Ta of MPCLPV is 0.83, while the proposed RF-MPCLPV and RF2 -MPCLPV algorithms reduces it to 0.33 ms and 0.31 ms, respectively. Similarly, the maximum computational time TM is reduced from 1.12 ms, to 0.57 and 0.55 ms respectively. The sub-opmtimality ηa shown by the two controllers is 3.46% for RF-MPCLPV and 3.51% for RF2 -MPCLPV . The maximum error on the actual inputs computed by the RF-MPCLPV is 0.69% for ud and 0.56% for uq and whereas for the RF2 MPCLPV it is 0.78% and 0.68%, for ud and uq , respectively. This differences in the overall control performance is not

Table IV B RUSHLESS MOTOR WITH MPC - P ERFORMANCE C OMPARISON

Ta [s] TM [s] ∆Ta [%] ηa [%]

MPCLPV

RF-MPCLPV

RF2 -MPCLPV

0.00083 0.00112 −− −−

0.00033 0.00057 32.33 3.4649

0.00031 0.00055 33.74 3.5129

relevant, and Fig.5 shows that the control results obtained with the three algorithms are very close. V. C ONCLUSIONS This paper has proposed a new Model Predictive Control (MPC) approach for a class of Linear Parameter Varying (LPV) systems. The aim is to reduce the computational complexity of the standard MPCLPV approach, by exploiting a coordinates’ transformation of the inputs. The proposed controller applies to those systems where the number of inputs is greater or equal to the number of states. The algorithm does not require to reconstruct the Quadratic Programming (QP) problem from scratch at each iteration, saving time and easing the control routine. This enables the application of MPCLPV to those systems with high sampling frequency and/or low-power boards. As a second contribution, the paper has presented a variant of the approach, which scarifies optimality of the solution to achieve even higher throughput. The two novel MPC algorithms have been tested on a large data-set of random MPC problems, and compared with standard MPCLPV for evaluating the time and optimality. The application on two real-world control problems, regarding the steering of an autonomous tram and the torque regulation of a brushless motor is also presented. The tests have shown remarkable improvements of the computational time on the proposed test cases, up to more than 53% when compared to the baseline. R EFERENCES [1] D. Q. Mayne, “Model predictive control: Recent developments and future promise,” Automatica, vol. 50, no. 12, pp. 2967–2986, dec 2014. [2] Camacho, Eduardo F and Alba, Carlos Bordons, Model predictive control. Springer Science & Business Media, 2013. [3] Maciejowski, Jan Marian, Predictive control: with constraints. Pearson education, 2002.

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

MPCLPV

RF-MPCLPV

RF2 -MPCLPV

ω[rpm]

3,000 2,000 1,000 0

0

5 · 10−2 0.1 MPCLPV

·10−2

τ [N·m]

2

0.15

0.2

RF-MPCLPV

0.25

0.3

RF2 -MPCLPV

1

0 0

5 · 10−2 0.1 MPCLPV

0.15

0.2

RF-MPCLPV

0.25

0.3

RF2 -MPCLPV

8

ud [V]

6 4 2 0

0

5 · 10−2 0.1 MPCLPV

0.15

0.2

RF-MPCLPV

0.25

0.3

RF2 -MPCLPV

uq [V]

4

2

0

0

5 · 10−2 0.1

0.15

0.2

0.25

0.3

Time[s] Figure 5. From top to bottom: comparison of the brushless motor speed ω, motor torque τ , input voltages ud and uq when the system is controlled by MPCLPV (red), RF-MPCLPV (dashed yellow) and RF2 -MPCLPV (dotted green) algorithms. The blue circles in the first and second plot represent the set-points for the motor speed and torque, respectively.

[4] A. Bemporad, M. Morari, V. Dua, and E. Pistikopoulos, “The explicit linear quadratic regulator for constrained systems,” Automatica, vol. 38, no. 1, pp. 3–20, 2002. [5] S. Richter, C. Jones, and M. Morari, “Computational complexity certification for real-time MPC with input constraints based on the fast gradient method,” IEEE Trans. Automatic Control, vol. 57, no. 6, 2012. [6] A. Bemporad, “A quadratic programming algorithm based on nonnegative least squares with applications to embedded model predictive control,” IEEE Transactions on Automatic Control, vol. 61, no. 4, pp. 1111–1116, April 2016.

[7] S. Vazquez, J. Leon, L. Franquelo, J. Rodriguez, H. Young, A. Marquez, and P. Zanchetta, “Model predictive control: A review of its applications in power electronics,” IEEE Industrial Electronics Magazine, vol. 8, no. 1, pp. 16–31, Mar. 2014. [8] G. Cimini, D. Bernardini, A. Bemporad, and S. Levijoki, “Online model predictive torque control for permanent magnet synchronous motors,” in Industrial Technology (ICIT), 2015 IEEE International Conference on, March 2015, pp. 2308–2313. [9] Z. Wan and M. V. Kothare, “Efficient scheduled stabilizing model predictive control for constrained nonlinear systems,” International Journal of Robust and Nonlinear Control, vol. 13, no. 3-4, pp. 331–346, 2003. [10] J. H. Hours and C. N. Jones, “A parametric nonconvex decomposition algorithm for real-time and distributed nmpc,” IEEE Transactions on Automatic Control, vol. 61, no. 2, pp. 287–302, Feb 2016. [11] F. Allg¨ower and A. Zheng, Nonlinear model predictive control. Birkh¨auser, 2012, vol. 26. [12] P. E. Gill, M. A. Saunders, and E. Wong, Modeling and Optimization: Theory and Applications: MOPTA, Bethlehem, PA, USA, August 2014 Selected Contributions. Cham: Springer International Publishing, 2015, ch. On the Performance of SQP Methods for Nonlinear Optimization, pp. 95–123. [13] C. Edwards, A. Marcos, and G. Balas, “Special issue on linear parameter varying systems,” International Journal of Robust and Nonlinear Control, vol. 24, no. 14, pp. 1925–1926, 2014. [14] A. Zolghadri, “Advanced model-based fdir techniques for aerospace systems: Today challenges and opportunities,” Progress in Aerospace Sciences, vol. 53, pp. 18–29, 2012. [15] L. Wu, X. Yang, and F. Li, “Nonfragile output tracking control of hypersonic air-breathing vehicles with an LPV model,” IEEE/ASME Transactions on Mechatronics, vol. 18, no. 4, pp. 1280–1288, 2013. [16] R. T´oth, H. S. Abbas, and H. Werner, “On the state-space realization of LPV input-output models: Practical approaches,” IEEE Transactions on Control Systems Technology, vol. 20, no. 1, pp. 139–153, 2012. [17] P. M. Gebraad, J.-W. van Wingerden, P. A. Fleming, and A. D. Wright, “LPV identification of wind turbine rotor vibrational dynamics using periodic disturbance basis functions,” IEEE Transactions on Control Systems Technology, vol. 21, no. 4, pp. 1183–1190, 2013. [18] J. S. Shamma and M. Athans, “Analysis of gain scheduled control for nonlinear plants,” IEEE Transactions on Automatic Control, vol. 35, no. 8, pp. 898–907, 1990. [19] J. S. Shamma, “An overview of LPV systems,” in Control of linear parameter varying systems with applications. Springer, 2012, pp. 3– 26. [20] M. Mejari, D. Piga, and A. Bemporad, “A bias-correction method for closed-loop identification of linear parameter-varying systems,” Automatica, vol. 87, no. Supplement C, pp. 128 – 141, 2018. [21] R. Toth, Modeling and Identification of Linear Parameter-Varying Systems, ser. Lecture Notes in Control and Information Sciences. Springer Berlin Heidelberg, 2010. [22] Falcone, Paolo and Borrelli, Francesco and Asgari, Jahan and Tseng, Hongtei Eric and Hrovat, Davor, “Predictive active steering control for autonomous vehicle systems,” IEEE Transactions on Control Systems Technology, vol. 15, no. 3, pp. 566–580, 2007. [23] T. Besselmann, J. L¨ofberg, and M. Morari, “Explicit MPC for LPV systems: Stability and optimality,” IEEE Transactions on Automatic Control, vol. 57, no. 9, pp. 2322–2332, 2012. [24] P. Falcone, H. Eric Tseng, F. Borrelli, J. Asgari, and D. Hrovat, “MPCbased yaw and lateral stabilisation via active front steering and braking,” Vehicle System Dynamics, vol. 46, no. S1, pp. 611–628, 2008. [25] G. Cimini, Y. Kim, B. McCain, J. Siegel, and A. Stefanopoulou, “Model predictive control for real-time position tracking of a catenary-free tram,” IFAC-PapersOnLine, vol. 50, no. 1, pp. 1000 – 1005, 2017, 20th IFAC World Congress. [26] Pang-Chia Chen and Jeff S. Shamma, “Gain-scheduled `1-optimal control for boiler-turbine dynamics with actuator saturation,” Journal of Process Control, vol. 14, no. 3, pp. 263 – 277, 2004. [27] Hangos, Katalin M and Bokor, J´ozsef and Szederk´enyi, G´abor, Analysis and control of nonlinear process systems. Springer Science & Business Media, 2006. [28] D. P. Martin and K. E. Johnson and D. S. Zalkind and L. Y. Pao, “LPVbased torque control for an extreme-scale morphing wind turbine rotor,” in 2017 American Control Conference (ACC), May 2017, pp. 1383– 1388. [29] L. Cavanini, G. Cimini, and G. Ippoliti, “A fast model predictive control algorithm for linear parameter varying systems with right invertible input matrix,” in 2017 25th Mediterranean Conference on Control and Automation (MED). IEEE, 2017, pp. 42–47.

Author preprint version. The original version is available at http://digital-library.theiet.org/content/journals/10.1049/iet-cta.2017.1096

[30] S. Kouro, M. Perez, J. Rodriguez, A. Llor, and H. Young, “Model predictive control: MPC’s role in the evolution of power electronics,” IEEE Industrial Electronics Magazine, vol. 9, no. 4, pp. 8–21, Dec 2015. [31] H. S. Abbas, R. T´oth, N. Meskin, J. Mohammadpour, and J. Hanema, “An MPC approach for lpv systems in input-output form,” in Decision and Control (CDC), 2015 IEEE 54th Annual Conference on. IEEE, 2015, pp. 91–96. [32] P. Patrinos and A. Bemporad, “An accelerated dual gradient-projection algorithm for embedded linear model predictive control,” IEEE Trans. Automatic Control, vol. 59, no. 1, pp. 18–33, 2014. [33] Y. Nesterov and A. Nemirovskii, Interior-Point Polynomial Algorithms in Convex Programming. Society for Industrial and Applied Mathematics, 1994. [34] M. J. Kurtz and M. A. Henson, “Feedback linearizing control of discretetime nonlinear systems with input constraints,” International Journal of

Control, vol. 70, no. 4, pp. 603–616, 1998. [35] D. Simon, J. Lofberg, and T. Glad, “Nonlinear model predictive control using feedback linearization and local inner convex constraint approximations,” in Control Conference (ECC), 2013 European, July 2013, pp. 2056–2061. [36] N. H. El-Farra, A. Armaou, and P. D. Christofides, “Analysis and control of parabolic PDE systems with input constraints,” Automatica, vol. 39, no. 4, pp. 715–725, 2003. [37] J. Deng, V. Becerra, and R. Stobart, “Input constraints handling in an MPC/feedback linearization scheme,” International Journal of Applied Mathematics and Computer Science, vol. 19, no. 2, pp. 219–232, 2009. [38] M. Preindl and S. Bolognani, “Model Predictive Direct Torque Control With Finite Control Set for PMSM Drive Systems, Part 1: Maximum Torque Per Ampere Operation,” IEEE Transactions on Industrial Informatics, vol. 9, no. 4, pp. 1912–1921, Nov 2013.