You are on page 1of 8

# Computationally Efficient Trajectory Optimization

## for Linear Control Systems with Input and State Constraints

Jean-Francois Stumper and Ralph Kennel, Senior Member, IEEE

Abstract This paper presents a trajectory generation burden. If only feasibility is of interest, numerical procedures
method that optimizes a quadratic cost functional with respect applying time scaling to slow down some variables can be
to linear system dynamics and to linear input and state con- used [1].
arXiv:1211.5761v1 [cs.SY] 25 Nov 2012

## straints. The method is based on continuous-time flatness-based

trajectory generation, and the outputs are parameterized using This paper treats the special case of the linearly con-
a polynomial basis. A method to parameterize the constraints strained linear-quadratic problem. The linear structure of the
is introduced using a result on polynomial nonpositivity. The system is exploited in the transformation of the problem to a
can be solved using quadratic programming. The problem can structure of the problem is maintained. The unconstrained
be further simplified to a linear programming problem by
linearization around the unconstrained optimum. The method problem is solved algebraically as it is convex. A quadratic
promises to be computationally efficient for constrained systems or linear programming (QP/LP) solver is then applied for
with a high optimization horizon. As application, a predictive constraint handling to modify the solution to a feasible
torque controller for a permanent magnet synchronous motor trajectory. The solution is computationally efficient, as first
which is based on real-time optimization is presented. a continuous parameterization is performed, and second a
I. I NTRODUCTION linear programming solver is used for the quadratic problem
by linearizing around the unconstrained optimum. To the
Trajectory optimization in real-time is an important part
knowledge of the authors, QP and LP have so far not been
of many modern control systems, for instance, predictive
applied to this type of continuous problems.
control. The trajectory optimization problem must be solved
The paper is organized as follows. Section II defines the
in the sampling interval, determined by the plant dynamics.
optimization problem and presents inversion-based linear-
A computationally efficient solution, however, encounters
quadratic trajectory optimization using basis functions, with
two major obstacles: first, the optimization horizon has a
the special case of power series. Section III proposes the
minimum length, either to avoid suboptimality or as stability
novel constraint handling method, first using a result on
criterion, and second, the trajectory must satisfy input and
polynomial nonnegativity, second rewriting the problem as
state constraints to be feasible. For fast systems, many of
linear programming problem. Section IV shows numerical
the existing constrained predictive control schemes, which
results of a synchronous motor predictive torque controller,
are based on numerical iterations, are not applicable.
which is a multivariable system with a high sampling rate and
Concerning the horizon length problem, the continuous
both input and state constraints. The algorithm is computable
approach to predictive control is of interest [1]. Using differ-
in real time: 2 ms prediction are implemented at a sampling
ential flatness, the optimal control problem can be rewritten
rate of 10 kHz. The experimental results are presented in
as output optimization problem. The basis function approach
[21].
is applied to obtain a finite-parameter optimization problem
[2] [3] [4] [5], analogeously to discrete-time optimization. II. P RELIMINARIES : C ONTINUOUS F LATNESS -BASED
A long optimization horizon is, however, obtained with L INEAR -Q UADRATIC T RAJECTORY O PTIMIZATION
comparably few optimization parameters.
A remaining issue regarding computational efficiency is A. Optimal Control Problem
the inclusion of constraints. The classical method is the The optimal control problem considered is to generate tra-
application of penalty functions [3]. As an alternative, a jectories on a finite time horizon T minimizing the quadratic
coordinate transformation was proposed to modify the con- cost functional
strained problem to a nonlinear unconstrained problem [6], Z T
xT (t)Qx(t) + uT (t)Ru(t) dt

solvable with nonlinear calculus of variations methods. The J=
existing optimization methods with penalty functions or 0
nonlinear coordinate transformations lead to a nonlinear or + (x(T ) x )T P(x(T ) x ) (1)
non-linear-quadratic problem, increasing the computational with states x(t) Rn , inputs u(t) Rm , weight matrices
This work was supported through the National Research Funds of P Rnn , Q Rnn and R Rmm , and the desired
Luxembourg under grant PhD-08-070. final state x Rn . The weight matrices are assumed to be
J-F. Stumper and R. Kennel are with the Institute of Electrical Drive positive definite and symmetric. Any quadratic functional is
Systems and Power Electronics, Department of Electrical Engineering and
Information Technology, Technische Universitat Munchen, Arcisstr. 21, D- eligible, for instance the reference x can also be included
80333 Munich, Germany. jean-francois.stumper@tum.de in the cost integral. Quadratic cost functionals are preferred
in predictive control as they will provide good closed-loop C. Output Parameterization with a Polynomial Basis
behavior [7]. They can also describe physical costs better The Ritz-Galerkin method, also called basis function ap-
than other norms. Furthermore, if the weight matrices are proach, is a direct method to find an approximate solution
positive definite, the optimization problem is convex and to an optimal control problem [10]. In the flatness-based ap-
easily solvable: a unique optimum exists and is found by proach, the outputs are parameterized as a linear combination
solving first-order necessary conditions. The states and inputs of time-variant basis functions. It is comparable to the control
are constrained to the time invariant linear dynamics of the parameterization Ritz method (CPRM) [11], where the inputs
multi-input multi-output system u are parameterized. Convergence of this method (combined

x(t) = Ax(t) + Bu(t) (2) with linear splines) was studied in [12] and more generally
in [13].
nn
with system matrix A R and input matrix B As basis functions, polynomials are chosen. Their simplic-
Rnm . The system is further assumed to be controllable. The ity is exploited for the further developments, main advantage
optimization is subject to Nc linear input and state constraints being that the parameters enter linearly, for instance they
allow to prove that the transformed cost remains convex.
Gx x(t) + Gu u(t) + g0 0, t [0, T ] (3)
They also allow constraint transformation based on a result
with Gx RNc n , Gu RNc m , g0 RNc , as well as the on polynomial nonpositivity in section III. Furthermore,
n initial conditions the dynamic shape of the resulting trajectory can be well
analyzed.
x(0) = x0 . (4)
Higher-order polynomials (for instance Laguerre and Leg-
Terminal constraints could be imposed too, but may yield an endre) have been used in many applications, but here,
unfeasible problem in the presence of input or state bounds. power series, the simplest form of polynomials, are used.
The methods and results are all applicable to higher-order
polynomials, there, the undetermined coefficients still enter
linearly and they might inherit numerical advantages (power
B. Parameterization of the System Variables using Flatness series are numerically stable only up to degree 12..15), but
the notation would be less comprehensible. In [14] it was
By definition, a linear system is said to be differentially shown that only the polynomial degree but not the type of
flat if there exist m output functions series are important for convergence. The choice is a simple
approximate, but yet, it turns out to be quite accurate.
yf (t) = Cf x(t), (5) The system outputs are defined as degree N power series
with yf (t) Rm , Cf Rmn , such that all states x(t) N
X tj
and inputs u(t) can be expressed as linear combination of yf i (t) = ij , i = 1..m, t [0, T ] (9)
Tj
the flat outputs and a finite number of their derivatives [8] j=0
[9]. Differential flatness can be interpreted as transformation with ij R. This is not an approximation of a system step
into controller canonical form, and in the linear case, it is response, but merely an assumption that the optimal solution
equivalent to controllability [9]. The flat outputs yf (t) are can be described as a polynomial. The system response is
thus the controller canonical form outputs, and the canonical exact, only the output is reduced in dimensionality.
form state vector is The original problem is thereby transformed to a finite-
   
(r 1)
z(t) = yf 1 , y f 1 , .., yf 11
(r 1)
, yf 2 , y f 2 , .., yf 22 , parameter optimization problem where a set of constants is
 T searched. Fig. 1 demonstrates the computational advantage.
(r 1) For instance, in the example in section IV, the prediction
.., yf m , y f m , .., yf mm (6)
horizon is 2 ms (the slowest time constant in the system)
with z(t) Rn and where ri is the corresponding vector and the sampling rate is 10 kHz (determined by the power
relative degree with regard to the output yf i (yf i being the stage). A discrete description takes 20 parameters, but here,
i-th flat
P output resp. i-th element of yf in (5), see [9]). Note only 6 are sufficient to describe a setpoint change. A more
that m i=1 ri = n. The differential parameterization of the complicated trajectory may not be expected on most plants.
system variables is [8] [9] The n initial conditions (4) define n of the parameters ij ,

(k1)
 they are computed via the transformed state z(0) in (6) (See
x = x yf , y f , .., yf , (7) that the initial time is t0 = 0, such that only the first element
of the power series is nonzero, same for the derivatives). For
 
(k)
u = u yf , y f , .., yf , (8)
further notational simplicity, the vector is defined as the
where k R is k = max{ri }. The functions x and u vector of the undetermined coefficients
are linear functions of z resp. of z and z , as they are derived = (1r1 , .., 1N , 2r2 , .., 2N , .., mrm , .., mN )T , (10)
from the controller canonical form transformation. See that

(7) is the inverse transformation from controller canonical with RN with N = m N n, and the indices
form, and (8) follows from (7) and (2). ri represent the respective vector relative degree of the flat
Eq. (13) is derived directly from (1) by substitution of
1
(7), (8) and (9) (or (11) and (12)). Practical (symbolical)
calculations are performed using a computer algebra tool,
0.5 matrix K is the Hessian matrix of J, and vector k follows

0
0 0.5 1 1.5 2 Proposition II.2
Time [ms]
Convexity of the conditioned cost function.
The conditioned cost function (13) is convex over the set
Fig. 1. Trajectories with 6 free parameters. Discrete-time horizon is
maximum 0.6 ms, continuous trajectory is well-conditioned at the desired RN if matrices Q, R and P in (1) are positive definite
horizon length of 2 ms. and real-symmetric matrices.

## This statement of convexity is not obvious, as the trans-

output yf i . formed cost function (13) has a higher dimension as the orig-
Based on the flatness parameterization (7) and (8), and inal cost functional (1) (N instead of n). It is proven for the
di
knowing that dt i yf are polynomials, the system variables unconstrained linear-quadratic case. This proof follows from
can be parameterized with the coefficients yielding the the knowledge that the states and inputs are polynomials
functions with coefficients linearly dependent on , and is sketched
x(t) = x (, t), (11) in appendix I. As only linear constraints are regarded, the
result can be assumed valid also for the constrained case.
u(t) = u (, t). (12)
This result allows to apply first-order conditions of op-
These functions are degree N polynomials of time t, where timality, and will guarantee a solution in finite time as an
the coefficients enter linearly. unique minimum of J exists.
It is seen that N max{ri }, i = 1..m, is mandatory
to have degrees of freedom on the trajectory. It should be III. M AIN R ESULTS : C ONSTRAINT H ANDLING
remarked that when choosing a higher N , the error bounds
of the basis function approach become smaller and the The previous section presented the unconstrained opti-
dynamical response increases, at the cost of higher com- mization of a controllable linear system with a flat output pa-
putational requirements and the risk of less good numerical rameterized with a polynomial basis. This section introduces
conditioning of the parameters. a computationally efficient method for including constraints
in trajectory generation. It is a follow-up to the previous
D. Remark: Generality of the Parameterization for Linear section.
Systems with Power Series Outputs
It is remarked that the same parameterization (11) and (12) A. Parameterizing the Constraints
can be obtained for arbitrary non-flat outputs of a controllable
The input and state constraints (3) are transformed with
and observable linear system, if the output is defined as
the system variable parameterizations (11) and (12). With
polynomial series with undetermined coefficients [15]. Then,
the knowledge that the parameterizations (11) and (12) are
the outputs do not need to be redefined to flat, or controller
univariate polynomials in t, each of the constraints in (3) is
canonical form outputs.
also a polynomial in t of order N where the coefficients are
E. Parameterizing the Cost Functional affine functions in . Thus, the constraints are rewritten as
The parameterization of the system variables (11), (12) N
X
gki0 + gTki ti 0, k = 1..Nc , t [0, T ],

is applied to transform the cost functional (1) to a finite- Pk (t) =
parameter cost function. i=0
(14)
Proposition II.1
with gki0 R and gki RN . Checking constraints
Conditioning the cost functional. over a time interval t [0, T ] is difficult. The typical
The cost functional (1) with the substitutions (11) and (12) solutions for such continuous problems are penalty functions
yields a biaffine function in the undetermined parameters in the cost functional, or nonlinear state transformations.
of the type In the following, the constraints are transformed to allow
J() = T K + kT + k0 (13) a direct check on independent of t, while maintaining the

simplicity of a linear constraint.
with k0 R, k RN and K RN N
.
The proof follows from a straightforward computation Proposition III.1
with the knowledge that (11), (12) are polynomials with Sufficient affine conditions for the constraints.
affine coefficients , and is omitted. The univariate polynomials Pk (t) are positive on the finite
interval t [0, T ] if the conditions used in a program [16]. These methods, however, require
a numerical iterative algorithm to establish the LMIs, and
Pk (0) 0, k = 1..Nc , (15)
  can therefore not be considered if computational efficiency is
T important. Due to updated initial conditions, the constraints
Pk p Pk (0) 0, p = 1..N, k = 1..Nc , (16)
N must be reconditioned in each trajectory generation cycle,
with a constant R > 0 are satisfied. and the computational burden adds up.

The constraints, written in the introduced notations, are B. Trajectory Generation in Finite Time

## gk00 + gTk0 0, k = 1..Nc


(17) In the previous section, the optimal control problem has
been transformed to a finite-parameter optimization problem.
and The transformed problem can be solved in finite time using
N  quadratic programming (QP) to find the parameters , as
Ti i
X 
T T
gki0 + gki ) i p (gk00 + gk0 0, the cost function is quadratic in and as the constraints
i=0
N are affine functions of . This is an interesting result for
p = 1..N, k = 1..Nc . (18) continuous systems, as QP is a standard method in discrete-
time optimization. Furthermore, the number of parameters
The underlying idea is shown in Fig. 2. If a polynomial is decoupled from the horizon length, thus higher prediction
trajectory P (t) of degree N is constrained at N +1 sampling horizons can be reached with less parameters.
points on the interval [0, T ] to be nonpositive, then, in the An even more convincing advantage of the presented
worst case, this polynomial reaches a maximum of P (t) = method shall be a further reduction of the computational
P (0). This maximum offset of P (0) is applied complexity. In the following, the problem will be approx-
as interleaf to the constraint boundary (the second term in imated such that it is solvable using linear programming
(16)). The proof of this proposition is presented in appendix (LP) techniques. The approximation yields a feasible solu-
II, where also the value of the constant is found, which is a tion (thus it is satisfying the constraints) with a bounded
constant depending on the polynomial degree N only. After suboptimality.
transformation of the constraints, they can be used directly
in an optimization procedure, as the result is an affine and C. Transformation to a Least Distance Problem
purely parametric constraint. They are affine functions of .
In the first step, a transformation is performed to obtain a
simpler cost functional.
P(0)
0
Proposition III.2
0.2
Reformulation as least-distance problem.
Polynomial P(t)

## 0.4 The cost functional can be transformed to

0.6 J = fT f + c, (19)

0.8 where f = (f1 , f2 , .., fN )T RN is the vector of trans-
formed parameters and c R a constant.
P(0) = 1
0 0.4 0.8 1.2 1.6 2
Time [ms] The new parameter vector f is defined as
Fig. 2. A degree N polynomial trajectory (black) constrained at N + 1 f = F( 0 ), (20)
points to be nonpositive (red arrows) will not exceed the upper bound of

P (0) (green line). Here, N = 6, P (0) = 1 and = 0.037. where 0 RN is the unconstrained minimum of the
parameterized cost functional (13)
The resulting set of constraints is sufficient, but not neces- 1
sary, thus they guarantee maintainance of the constraints, but 0 = K1 k, (21)
2
are too restrictive. The offset between the necessary and the
N
sufficient conditions is the factor , and the restriction is, for and matrix F RN is defined such that
example, 6.4% for N = 3, 1.2% for N = 10, and even less
FT F = K (22)
for higher N . It is assumed that this restriction is acceptable
for most applications regarding the inherited computational with K from eq. (13). Computation is not an issue as K is
advantages. positive definite and symmetric, for instance, in the notations
Exact results on necessary and sufficient conditions on in appendix I one would set F = BA. If this decomposition
positivity of univariate polynomials over an interval [0, T ] is not known, F can be computed via the Cholesky matrix
exist. Semidefinite programming (SDP) is applied to estab- decomposition FT = cholesky(KT ).
lish linear matrix inequalities (LMI), which, just as for the Transformation (20) must also be applied to transform
presented results, are independent of t and can directly be the constraints. This is done by substituting the inverse
transformation the lozenge). It can be shown that the resulting cost is
= 0 + F1 f (23) J = J 0 + N JC (26)

to the constraint equation, yielding directly the affine con- in the worst case, where J is the cost with the linear
straints in terms of f. The same equation is applied to program, J0 the cost of the unconstrained problem, JC
retransform the obtained results into the original parame- the extra cost when considering constraints in a quadratic
ters. Contrary to the amount of parameters, the amount of program, and N = dim() the amount of free parameters
constraints is not increased. . Thus, the linear programming solver yields the worst-
The least-distance problem is simpler to solve as the orig- case suboptimality J /(J0 + JC ) of up to N times the
inal QP problem, as some computations become obsolete in cost. If not all constraints are active, or if the constraints
the iterations [17]. The transformation renders the quadratic intersect the contour lines, suboptimality will be considerably
programming more efficient and increases numerical stabil- less. The bound of the suboptimality and the consideration
ity. that the overall suboptimality is relative to the cost of the
unconstrained problem makes the simplification of a linear
D. Transformation to a Linear Programming Problem programming solver acceptable for many applications.

Now the least distance problem can be approximated for a IV. E XAMPLE : P REDICTIVE T ORQUE C ONTROL OF
solution using linear programming. The L2 -norm is rewritten P ERMANENT-M AGNET S YNCHRONOUS M ACHINES
as L1 -norm. The variables in linear programs are limited to
positive numbers, thus the variables f are replaced by To present the advantages and the good functionality of
the presented trajectory optimization scheme, a predictive
fi = fip fin , (24) torque controller for a permanent-magnet synchronous ma-
with fip , fin R and fip 0, fin 0. chine (PMSM) is presented. So far, this plant has been
controlled via generalized predictive control (GPC), via finite
control set MPC (FS-MPC) and via the explicit solution [18].
Proposition III.3 Even though the methods provided good results, they were
Linear Cost Function for the Least-Distance Problem. either unconstrained, or limited to few prediction steps. The
The cost function approximation presented method obtains a high optimization horizon (2 ms)
N
X N
X N
X while respecting all constraints.
J =c+ fi2 c+ |fi | = c + (fip + fin ) = J , Its suboptimality in 1) the assumption of a polynomial
i=1 i=1 i=1 output, 2) the restrictive constraint parameterization (of 2%),
(25) and 3) the use of LP instead of QP is analyzed.
with fip , fin 0, yields a feasible solution with bounded A cascaded control structure is chosen [19]. The speed
suboptimality for a least-distance problem. loop is controlled via a PI controller, and the current (and
torque) loop is the predictive controller. The electrical sub-
This approximation implies a large offset between the system of a non-salient PMSM, consisting of the torque-
linearized cost J and the correct cost J. However, this is not generating and field-generating currents iq and id (peak
of importance, as the goal is to find a point in the parameter values), and the machine torque M as output, is given as
space f that is feasible and least-distance to the origin. Under d R 1
this aspect, the suboptimality is not the variation of the cost, id = id + np M iq + vd (27)
dt L L
but of the difference of the found parameters in the squared d R 1
distance to the origin. The contour lines of the quadratic cost iq = iq np M id np M K + vq (28)
dt L L
are circles around the origin, whereas these of the linear cost 3
are lozenges [7]. M = np Kiq (29)
2
It should be remarked that |fi | is not necessarily equivalent
which is linearized by the assumption that speed is constant
to fip + fin , but in the reverse, if fip + fin is minimized, it over the prediction horizon,
is equivalent to |fi | as fip , fin 0, such that at least one of
each fip , fin is zero. d
M (t0 ) 0 M (t) = M (t0 ) t [t0 , t0 + T ].
The advantages of a linear programming solver are ob- dt
(30)
vious, increased reliability and reduced computational com-
plexity, and the computational burden only grows linearly The parameters are taken from a real machine: R = 0.86
with the degree of the output polynomial N . It represents a , L = 6 mH, np = 3, K = 0.236 Vs, rated speed 314
significant computational saving compared to when applying rad/s, rated torque 10 Nm. The trajectory optimization shall
QP as solver. minimize the control error
If no constraint is active, the solution is exact. If a con- 2
Pctrl (t) = (M (t) M ) (31)
straint is active, the worst case is when the active constraint
vertex is parallel to a contour line (i.e. parallel to a side of and at the same time optimize the power efficiency by
minimizing the dissipated energy which, according to the model, reduces the induced voltage
 M on iq , thereby dtd iq is higher as when keeping id small. This is
Ploss (t) = R i2d + i2q + (Lid + K)2 + i2q ,

(32) the advantageous behavior of predictive control; in contrast
Rm
to feedback controllers with saturation, the coupling between
where Rm = 1800, thus the goal is to minimize J =
RT the states is exploited to bypass the constraints in an optimal
0 (qPctrl (t) + Ploss (t))dt + q T Pctrl (T ) with the weight fashion. This result is only visible as a high optimization
q = 20. The flat outputs id and iq are each parameterized
horizon and the constraints are included in the trajectory
with a degree 5 power series. The prediction horizon is T = 2
generation.
ms and the sampling rate is 10 kHz. The optimization must
As the constraint handling of LP is suboptimal, there is
also maintain the current constraints
a quantitative difference, especially in dynamical operation.
i2d + i2q Imax
2
= 102 A2 (33) The peaks are generally somewhat smaller, and at t = 0.07,
the negative id -peak is of shorter duration and thus less
to protect the power inverter, and the voltage constraints effective.
vd2 + vq2 Vmax
2
= 3302 V2 (34) V. C ONCLUSION
to obtain a feasible trajectory. These constraints are lin- A trajectory optimization scheme minimizing a quadratic
earized as shown in Fig. 3, similar as in [20]. The argu- cost functional to generate continuous trajectories for a
mentation is that only id 0 makes sense (field-weakening, linear control system with linear constraints was presented.
see (32)), and that the current and voltage range in q-axis is The scheme recombines several methods in order to obtain
more important for PMSMs with isotropic rotors. a computationally efficient solution. These are the use of
differential flatness and of a parameterization using a poly-
nomial basis. A result on polynomial nonnegativity is used
iq I vq as a suitable way to parameterize the constraints. Further
max Umax
developments are done to formulate a linear programming
problem.
Imax Umax Numerical simulations of a predictive controller for a
id vd permanent magnet synchronous machine show that the sub-
optimality of the method is acceptable. The optimization
problem is sufficiently simplified and solvable in real-time, in
the presented application, 2 ms prediction are implemented
at a sampling rate of 10 kHz.
Fig. 3. Linearized current and voltage constraints. Circle: feasible set
of current and voltage vectors, grey: feasible set after linearization of the R EFERENCES
constraints.
[1] M. Fliess and R. Marquez, Continuous-time linear predictive control
and flatness: A module-theoretic setting with examples, Int. Journal
Numerical simulation results are shown in Fig. 4. The of Control, Vol. 73, No. 7, pp. 606623, 2000.
results of the QP solver are shown in blue, and the results of [2] D.A. Pierre, Optimization theory with applications. New York: Wiley,
the LP solver in red. Experimental results are shown in [21]. 1969.
[3] M. Guay and J.F. Forbes, Real-time dynamic optimization of control-
At t = 0.01 s, a speed setpoint change from M = 0 to 420 lable linear systems, Journal of Guidance, Control and Dynamics, Vol.
rad/s is commanded. Then, at t = 0.07 s, a load torque step 29, No. 4, pp. 929935, 2006.
of 8 Nm is applied. From the computational results, QP takes [4] N. Petit, M.B. Milam and R.M. Murray, Inversion based constrained
trajectory optimization, Proc. 5th IFAC Symp. on nonlinear control
17 iterations in the worst case, wereas LP takes 24 iterations. systems design, 2001.
This increased number is logical, as there are 20 parameters [5] M.J. van Nieuwstadt and R.M. Murray, Real-time trajectory generation
instead of 10. As the LP algorithm is much simpler, this for differentially flat systems, Int. J. of Robust and Nonlinear Control,
Vol. 8, No. 11, pp. 9951020, 1998.
still represents a considerable computational saving. With [6] K. Graichen and N. Petit, Incorporating a class of constraints into the
an optimized C implementation, the worst case computation dynamics of optimal control problems, Optim. Control Appl. Methods,
time of the LP was 20s on a PC (1.4 GHz clock). Runtime Vol. 30, No. 6, pp. 537561, 2009.
[7] C.V. Rao and J.B. Rawlings, Linear programming and model predictive
is further discussed in [21]. control, J. of Process Control, vol. 10, pp. 283289, 2000.
From a qualitative standpoint, the resulting behavior is [8] M. Fliess, J. Levine, P. Martin and P. Rouchon, Flatness and defect
identical for both solvers. The system is always operating of nonlinear systems: Introductory theory and examples, Int. J. of
Control, Vol. 61, No. 6, pp. 13271361, 1995.
at its performance limit. There is a (feasible) voltage peak [9] H. Sira-Ramrez and S.K. Agrawal, Differentially flat systems. New
on vq at t = 0.01 s to rapidly establish a torque current York: Marcel Dekker, 2004.
iq , and after this, the induced voltage increases proportional [10] L.V. Kantorovich and V.I. Krylov, Approximate methods of higher
analysis. New York: Interscience, 1964.
to speed on vd and vq . The iron losses are reduced by [11] H.R. Sirisena, Computation of optimal controls using a piecewise
imposing id < 0. Then, at high speed, the load step polynomial parameterization, IEEE Trans. Automat. Control, Vol. 18,
is quickly compensated via the cascaded speed controller, No. 4, 1973.
[12] H.R. Sirisena and F.S. Chou, Convergence of the control parameteriza-
which commands a torque increase. To do this, the trajectory tion Ritz method for nonlinear optimal control problems, J. of Optim.
optimization generates a negative peak on id (green arrow) Theory and Appl., Vol. 29, No. 3, pp. 369382, 1979.
[13] W.E. Bosarge, O.G. Johnson, R.S. McKnight and W.P. Timlake, The A PPENDIX II
Ritz-Galerkin procedure for nonlinear control problems, SIAM Journal P ROOF OF P ROPOSITION III.3
on Numerical Analysis, Vol. 10, No. 1, pp. 94111, 1973.
[14] R.E. Brown and M.A. Stone, On the use of polynomial series with the Sufficient affine conditions for the constraints.
Rayleigh-Ritz method, Compos. Struct., Vol. 39, No. 3-4, pp. 191196, The polynomial
1997. N
[15] J-F. Stumper and R. Kennel, Inversion of linear and nonlinear observ-
X
P (s) = ci si 0, (42)
able systems with series-defined output trajectories, Proc. of the IEEE
i=0
Int. Symp. on Computer-Aided Control System Design, pp. 19931998,
2010. with ci R, is analyzed on non-positivity over a segment s [0, 1].
[16] D. Henrion and J.-B. Lasserre, LMIs for constrained polynomial in- A first necessary and sufficient condition is
terpolation with application in trajectory planning, Systems & Control
Letters, Vol. 55, No. 6, pp. 473477, 2003. P (0) = c0 0 (43)
[17] R. Fletcher, Practical methods of optimization. New York: Wiley,
1987. which in the following is assumed satisfied. Furthermore, the N
[18] P. Cortes, M. Kazmierkowski, R. Kennel, D. Quevedo and J. Ro- conditions
driguez, Predictive control in power electronics and drives, IEEE  
k
Trans. Ind. Electron., Vol. 55, No. 2, pp. 43124324, 2008. P 0, k = 1..N (44)
[19] E. Delaleau and A.M. Stankovic, Flatness-based hierarchical control
N
of the PM synchronous motor, Proc. of the American Control Conf., are also assumed to hold for all ci .
pp. 6570, 2004. These conditions can be rewritten in matrix notation
[20] S. Bolognani, S. Bolognani, L. Peretti and M. Zigliotto, Design and
implementation of model predictive control for electrical motor drives, c0 + Qc 0 (45)
IEEE Trans. Ind. Electron., Vol. 56, No. 6, pp. 19251936, 2009.
[21] J-F. Stumper, A. Dotlinger, J. Jung and R. Kennel, Predictive control of with c0 = (c0 , .., c0 )T RN , c = (c1 , .., cN )T RN and Q
a permanent magnet synchronous machine based on real-time dynamic RNN such that
optimization, European Conf. on Power Electronics and Appl., 2011.    j !
i
Q = (qij ) = P (i/N ) = ,
cj N
A PPENDIX I i = 1..N, j = 1..N. (46)
P ROOF OFP ROPOSITION III.2
It can be shown that det(Q) 6= 0 for N > 0, and that Q is positive
definite. It follows
Convexity of the conditioned cost function.
Assume Q is positive definite. Then, c Q1 c0 (47)
T
x (t)Qx(t) > 0, x(t) 6= 0 (35) which can be placed into the polynomial equation
and P (s) = c0 + sT c c0 sT Q1 c0 = (c0 ) (48)
Z T N T N T 1 T
J= xT (t)Qx(t)dt > 0, x(t) 6= 0t [0, T ]. (36) with s = (s, .., s ) R and = 1 + s Q (1, .., 1) . As
0 we assumed c0 0, the upper bound of P (s) under the mentioned
conditions is at when is at its maximum. It can be shown that
The inverse model replaces x(t) by polynomials p(t) with linear the upper bound of , = sup{} s [0, 1], is positive and
coefficients in only dependent on N , as Q is known. Some values, which were
Z T
computed numerically, are shown in the table below.
J= pT (t)Qp(t)dt > 0, x(t) = p(t) 6= 0t [0, T ]. (37)
0 N 2 3 4 10 20
= sup{}
RT
0.125 0.064 0.041 0.012 0.005
R
Define the primitives P(t) = p(t)dt thus P(T ) = 0
p(t)dt
T Therefore if the conditions (44) hold, we have
J = P (T )QP(T ) > 0, P(T ) 6= 0. (38)
P (s) P (0). (49)
The expression P(t) is the primitive of a polynomial, thus a
polynomial, with linear coefficients in , and P(T ) is rewritten Shifting the conditions by the constant (and negative) factor P (0),
as the sufficient conditions for non-positivity of the polynomial P (s)
are found:
P(T ) = A (39)
P (0) 0, (50)
and we assume rank(A) = n with n = dim(x). It follows
k
P ( ) P (0) 0, k = 1..N. (51)
J = T AT QA > 0, P(T ) 6= 0. (40) N
The matrix of the parameterized cost function is K = AT QA and
as we assumed Q is positive definite we know Q = BT B (Cholesky
decomposition). The weight matrix is then
K = AT BT BA = (BA)T (BA) (41)
T
which is positive definite as any matrix K = C C for some C
with rank(C) = n is positive semidefinite [C.D. Meyer, Matrix
analysis and applied linear algebra, SIAM books, 2000, pp. 566].
The parameterized cost functional J is thus a convex function of
the parameters .
600
ref

Torque M [Nm]
400 10
M L
200 5
M
0 0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1

## Torque current iq [A]

Field current id [A]

0
8
6 i
2
id 4 q
2
4
0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
0 300

vd 200
vq [V ]
vd [V ]

50
vq
100

100 0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time t [s] Time t [s]
10
locus curve locus curve
200
voltage 5 current
vq [V ]

iq [A]

0 0

200 5
10
Dissipated Power PL [W]

## 500 0 vd [V ] 500 20 10 0 id [A] 10 20

30
800
Iterations

600 PFe 20 LP
400 PCu
10
200
QP
0 0
0 0.02 0.04 0.06 0.08 0.1 0 0.02 0.04 0.06 0.08 0.1
Time t [s] Time t [s]

Fig. 4. Results of predictive control applying the presented trajectory optimization. Red: results with LP solver, Blue: results with QP solver.