Sei sulla pagina 1di 6

SOFT CONSTRAINTS AND EXACT PENALTY FUNCTIONS IN MODEL

PREDICTIVE CONTROL
Eric C. Kerrigan and Jan M. Maciejowski

Department of Engineering, University of Cambridge


Trumpington Street, Cambridge CB2 1PZ, United Kingdom, http://www-control.eng.cam.ac.uk
Fax : +44 1223 332662. Email: eck21@eng.cam.ac.uk, jmm@eng.cam.ac.uk

ABSTRACT problem, however, is that in MPC this weight is de-


pendent on the current state of the system and it is
One of the strengths of Model Predictive Control therefore necessary to calculate the lower bound for
(MPC) is its ability to incorporate constraints in the weight for all possible states that the plant could
the control formulation. Often a disturbance drives be in.
the system into a region where the MPC problem To the authors knowledge, a systematic method
is infeasible and hence no control action can be for computing a lower bound has not yet been
computed. Feasibility can be recovered by softening published. A naive and impractical solution would
the constraints using slack variables. This approach be to grid the state space region of interest and
does not necessarily guarantee that the constraints compute the optimal Lagrange multipliers at each
will be satisfied, if possible. Results from the point. This method is computationally demanding
theory of exact penalty functions can be used and due to the finite nature of the grid one
to guarantee constraint satisfaction. This paper cannot guarantee that the true lower bound on the
describes a method for computing a lower bound weight has been found. As mentioned in [4], a
for the constraint violation penalty weight of the conservative state-dependent upper bound might be
exact penalty function. One can then guarantee that obtainable by exploiting the Lipschitz continuity of
the soft-constrained MPC solution will be equal to the quadratic program [5]. However, it is unclear as
the hard-constrained MPC solution for a bounded to how exactly one would proceed to implement this
subset of initial states, control inputs and reference for the entire feasible state space.
trajectories. This paper shows how the Karush-Kuhn-Tucker
Keywords : feasibility, Lagrange multipliers, (KKT) conditions can be used to compute a lower
multi-parametric quadratic programming bound by solving a finite number of linear pro-
grams (LPs). This method is therefore compu-
INTRODUCTION tationally less demanding than gridding and pro-
vides a guarantee that the lower bound has been
The success of Model Predictive Control (MPC) in found.
industry is primarily due to the ease with which Once a lower bound has been computed, the
constraints on the inputs and states can be included soft-constrained MPC problem can be set up. This
in the control problem formulation. However, new MPC problem will produce a result where the
sometimes a disturbance drives the plant into a state original hard-constrained MPC problem would have
for which the control problem is infeasible and hence been infeasible. The important result is that one can
a new control input cannot be computed. Heuristic guarantee that the soft- and hard-constrained MPC
methods such as removing constraints or repeating problems will produce the same result for the region
the previously computed input, are not optimal and in which the latter is feasible.
could lead to unpredictable closed-loop behaviour. The paper starts by defining a standard reference
A more systematic method for dealing with tracking formulation of MPC. It is shown that
infeasibility is to soften the constraints by adding the cost function and constraints of the resulting
slack variables to the problem [1, 2] where the size quadratic program (QP) are dependent on the
of the slack variables correspond to the size of the current plant state, previous control input and
associated constraint violations. The slack variables current reference trajectory. More precisely, the
are added to the MPC cost function and the MPC problem can be treated as a multi-parametric
optimiser searches for a solution which minimises the quadratic program (mp-QP) [6]. This allows one
original cost function, while keeping the constraint to gain additional insight into the structure of the
violations as small as possible. problem.
It is desirable that the solution to the soft- Following this, exact penalty functions are intro-
constrained MPC problem be the same as the so- duced in order to find a condition on the lower bound
lution to the original hard-constrained MPC prob- for the violation weight. By introducing slack vari-
lem, if the latter is feasible. The theory of ex- ables the non-smooth, exact penalty function can be
act penalty functions can be used to derive a lower converted into a smooth, soft-constrained QP prob-
bound for the violation weight [3, Sect. 14.3]. The lem.

A procedure for setting up an optimisation r(k + 1|k)
..
routine for computing a non-conservative lower T (k) , .
bound for the violation weight is described. This
r(k + Hp |k)
weight guarantees the exactness of the penalty
function over an a priori chosen subset of feasible

u(k|k)
states. ..
A simple example is presented to show how a U(k) , . .
soft-constrained mp-QP could be set up to have the u(k + Hu 1|k)

same solution as the original hard-constrained mp-
Z(k) has the form Z(k) = x(k) + u(k 1) +
QP. The paper concludes with a summary of the
U(k). The matrices , , , Q and R are
results.
obtained by substituting (1) into
 (2) and collecting

terms, before defining , I . It is
MODEL PREDICTIVE CONTROL necessary to define the augmented state vector:

A standard formulation for MPC is described below. x(k)
The cost function and constraints are shown to be (k) , u(k 1) .
dependent on an augmented system state vector, T (k)
which includes the current state, previous control Cost function (3) is usually minimised subject
input and reference trajectory. The feasible region to linear inequality constraints on the inputs, states
for the MPC problem is defined. and outputs of the plant, possibly also including the
reference trajectory T (k):
Standard Formulation
U (k)
Consider the following discrete-time LTI state-space U(k)

model:
Z(k)  (4)
X (k)
x(k + 1|k) = A
x(k|k) + Bu(k) (1a)
T (k)
z(k) = C x
(k|k) (1b)
where U(k), the vector of future control inputs, and
where x (k + i|k) Rn denotes an estimate of the X (k), the vector of future plant states, are defined
plant state at time k + i made at time k; u(k) Rm in a similar fashion as above; and are problem-
is the real input to the plant; the controlled variables dependent. The MPC problem then reduces to the
are z(k) Rp . Note that x (k|k) = x(k) is the following strictly convex QP problem:
current plant state. 1
The cost function to be minimised is: min U(k)T HU(k) + U(k)T G(k)
U(k) 2 (5a)
X
Hp
+ (k) F (k)
T
V ((k), U (k)) = k
z (k + i|k) r(k + i)k2Q(i)
i=1 subject to
u 1
HX
EU (k)  f + G(k) (5b)
+ k
u(k + i|k)k2R(i) .
i=0 where F = T Q, G = 2T Q, and H =
(2) 2(T Q + R); E, f and G are obtained by
The first term in (2) penalises deviations of the substituting (1) into (4) and collecting terms. The
controlled variables from the reference trajectory term involving F in (5a) is usually dropped, since it
r(k + i) and the second term penalises changes in does not affect the optimal solution U (k).
the control input u(k) , u
(k) u
(k 1). Hp and Only the first part of the solution is used in
Hu are the output and control horizons; Q(i)  0 accordance with the receding horizon strategy and
the implemented control input is therefore
and R(i)  0 are the weights on tracking error and  
control action where kk2Q , T Q. It is assumed u (k) = u(k 1) + Im 0m(Hu 1) U (k) . (6)
that Hu Hp and u(k + i|k) = 0 for i Hu .
The state at the next time instant x(k + 1) is
The cost function can be rewritten as:
measured and the process of setting up the QP and
V ((k), U (k)) = kZ(k) T (k)k2Q + kU(k)k2R calculating the new control action is repeated.
(3) Note that both the cost function (5a) and
constraints (5b) are dependent on (k), which
where includes the current state x(k), past input u(k

z(k + 1|k) 1) and the reference trajectory T (k). The MPC
.. problem can therefore be treated as an mp-QP for
Z(k) , .
which an explicit solution can be computed off-
z(k + Hp |k) line [6].
Feasibility and Invariance Exact Penalty Functions
The QP constraints (5b) define the set of feasible The general non-linear, constrained minimisation
control sequence and augmented state pairs: problem can be stated as:

F , {(, U ) : EU  f + G} (7) min V () (9a)



and the assumption that F 6= is made. Often some
subject to
of the constraints on and U in F are redundant
and removing these will improve computation time c()  0 . (9b)
both on-line and when computing the constraint
violation weight, as described later . The values of This optimisation problem can be recast into the fol-
for which the QP problem is feasible, i.e. for which a lowing equivalent unconstrained, non-smooth penal-
feasible control sequence exists, is therefore defined ty function minimisation:
as:
min V () + kc()+ k (10)
F , { : U such that (, U ) F} . (8)

The MPC problem is not defined for any other where is the constraint violation penalty weight,
combination of past control input, current state the vector c()+ contains the magnitude of the
and reference trajectory, i.e. if / F then the constraint violations for a given and c+ i ,
QP problem is infeasible. The set F can be max(ci , 0).
seen to be the orthogonal projection of F onto the The concept of a dual norm is used in the
subspace and can therefore be computed using condition on for which the solution to (10) is
standard techniques, such as the Fourier-Motzkin equal to the solution to (9). The dual of a norm k k
elimination method [7]. is defined as
In general, even for the case with no distur-
kukD , max uT v . (11)
bances and model uncertainty, the set F is not nec- kvk1
essarily positively invariant for the closed-loop sys-
tem. Since constraints can be satisfied if and only It can be shown that the dual of k k1 is k k and
if the initial condition (k) is in a set which is pos- vice versa, and that k k2 is the dual of itself.
itively invariant [8] for the closed-loop system, it is If denotes the optimal solution to (9) and

important to design the controller such that F is in- is the corresponding optimal Lagrange multiplier
variant. If Hp = Hu , one can guarantee nomi- vector, then the following well-known result gives a
nal feasibility for all time by requiring that the pre- condition under which the solutions to (9) and (10)
dicted terminal state (k + Hp |k) lie in a control in- are equal:
variant set, as discussed in [9]. For simplicity, it is as-
Theorem 1. If the penalty weight > k kD and
sumed that F is positively invariant for the nomi-
c( )  0, then the solution to (9) is equal to the
nal closed-loop system and that a feasible sequence
solution to (10).
of reference trajectories is always chosen.
Assuming the above, it is still possible that a Proof. See [3, Thm. 14.3.1].
disturbance or modelling error could result in the
system being driven to a state where the problem is If > k kD , then (10) is called an exact penalty
infeasible and hence no solution exists. One possible function. The cost function (10) is non-smooth and
way of dealing with this situation is to soften some therefore not as easy to solve for as, say, a QP. One
or all of the constraints. way to overcome this difficulty is to introduce slack
variables into the problem.
SOFT CONSTRAINTS
Slack Variables as Soft Constraints
A straightforward way for softening constraints is
The non-smooth, unconstrained minimisation (10)
to introduce slack variables which are defined such
can be cast into the following equivalent smooth,
that they are non-zero only if the corresponding
constrained problem which is a lot easier to compute:
constraints are violated. If the original, hard-
constrained solution is feasible, one would like
the soft-constrained problem to produce the same min V () + kk (12a)
control action. In order to guarantee this the ,
weights in the cost function have to be chosen large
enough such that the optimiser tries to keep the subject to
slack variables at zero, if possible. Exact penalty
c()   (12b)
functions can be used to guarantee this behaviour [3,
Sect. 14.3]. 0 (12c)
where  are the slack variables representing the A Non-conservative Lower Bound
constraint violations, i.e.  = 0 if the constraints
are satisfied. If V () = V ((k), U (k)) as in (3), The condition on the lower bound on over all
c() = EU f G, = U and kk1 or kk is feasible can now be stated as:
used in (12), then the problem can be formulated as
> max kkD (15)
a QP and solved using standard techniques [1, 2]. ,

Note that even though the l2 -norm kk2 , T 
will result in a non-smooth penalty function, one with the maximisation subject to the KKT optimal-
cannot formulate the soft-constrained MPC problem ity conditions (14) with U as above. This is the
as a QP because V ((k), U (k)) is quadratic and lowest bound on that guarantees that the soft- and
kk2 has a square root. Using the l22 quadratic norm hard-constrained QP problems produce the same so-
kk22 , T  one can express the problem as a QP, lution for all feasible , since all points (U, )
but this does not result in an exact penalty function which satisfy the KKT conditions for a given
since (10) will be smooth; it is the non-smoothness solve the corresponding strictly convex primal QP
of the penalty function which allows it to be exact1 . and dual problem. It can be shown that the op-
timal U and are uniquely defined continu-
ous, piecewise affine functions of [6]. The op-
COMPUTING A LOWER BOUND FOR timisation in (15) is difficult, since it is the max-
THE PENALTY WEIGHT imisation of the norm of a piecewise affine func-
tion, which is not necessarily convex or concave.
In MPC, the optimal solution U is dependent on It is also possible that the maximisation is
the current augmented state as can be seen in (5) unbounded. If the region F is bounded, then
and hence the corresponding Lagrange multiplier the maximisation is bounded. However, F is
is also dependent on . The lower bound for is not necessarily bounded. From this point on, the
therefore dependent on . optimisation is subject to the additional constraint
0 , where 0 is a polyhedron of initial conditions
One would therefore have to calculate a lower
which is chosen such that 0 F is bounded. If 0
bound for which guarantees that the soft-con-
is a polytope2 , then 0 F is also a polytope, hence
strained MPC will produce the same solution as
the maximisation is bounded.
the original hard-constrained MPC for all F .
The last constraint in (14) is the complementary
Duality in optimisation theory provides some insight
slackness condition. Let j and j denote the La-
into the relation of the Lagrange multipliers to .
grange multiplier vectors for the jth set of inac-
tive and active constraints as in [6]. Let E j , fj , G
j
j j j
KKT conditions for mp-QP Problems and E , f , G be the corresponding matrices ex-
tracted from E, f and G. Adopting the above the op-
The Lagrangian of optimisation problem (5) is timisation in (15) becomes3 :

1 j kD
max k (16a)
L (U , ) = U T HU + U T G + T F j
j,,
2 (13)
+ T (EU f G) . subject to

A stationary point for the Lagrangian occurs j  0, 0 , j {1, 2, . . . , N }


(16b)
when U L (U , ) = 0, hence the corresponding
(E j H1 G + G
j ) + fj  0 (16c)
KKT optimality conditions are:
j 1 j T 1 j j 1
j
= (E H (E ) ) (f + (G + E H G))
j
HU + G + E T = 0 (14a) (16d)
 0, Rq (14b) where N is the number of possible active and
EU f G  0 (14c) inactive constraint combinations. The norm kk D=
diag()(EU f G) = 0 (14d)
kk is used if kk1 is used to penalise the constraint
D = kk
violations and kk 1 if kk is used.
where q is the minimal number of linear inequalities j  0 for each combina-
describing F. Provided H  0 (as is the case when Remark 1. Note that
j | =
j k , maxi |
tion of active constraints. If k
R  0), one can solve for U = H1 (G + E T ) i
and substitute it back into (14). 2A polytope is a bounded polyhedron.
3 As in [6], it is assumed that the rows of E j are linearly
1 In [2], kk2 is added to the cost function, together with independent in order to guarantee that (E j H1 (E j )T )1
S
a weighted l1 -norm; the l1 -norm guarantees an exact penalty exists. The fact that j = 0 allows one to eliminate it from
function and S is an extra tuning weight used to penalise the the equations. Note that one can also eliminate j from the
constraint violations. cost function and constraints.
maxi j is used in the maximisation (16a), a se- subject to
i
quence of LPs solves maxi,j,, j j . Similarly, if
j k1 , P j | = P i
j is used, a sequence of LPs 1 + + 1 (18b)
k |
i i Pi ij 1 2 (18c)
will solve max j
j,, .
i i
0 (18d)
For large systems with many constraints, this
approach might seem computationally impractical, has the same solution as the hard-constrained mp-
because of the large number of possible combinations QP (17) for 2.
of active constraints (2q 1). In practice, however, The first step is to define the regions in which
far fewer combinations of active constraints can the different combinations of constraints become ac-
actually occur over the feasible set, e.g. it is not tive, using the KKT conditions (14). Consider-
possible for an input or state to be at both its upper ing all four possible combinations of active and inac-
and lower bound. tive constraints, the analytic expressions for the La-
A method for computing the possible active grange multipliers for all feasible 2 are:
constraint combinations that can occur over 0 F h i
32
is given in [6]. The authors outline a method where
  0 if 2 23
the feasible space is divided into polytopes in which = 0
if 32 2
the same constraints on U become active at the
h0 i
0 if 2
solution. By solving the above-mentioned LPs over 2
the corresponding polytopes, one can compute a
lower bound for the penalty weight. The fourth combination, when both constraints are
The authors of [6] also make some comments re- active, occurs only at = 2 and this combination
garding the computational complexity and maxi- is therefore redundant.
mum number of possible active constraint combi- The next step is to calculate max kk for the
nations. However, for off-line design and analy- areas in which constraints are active. For 2,
sis of the system computation speed is less of an is- 2 = 2, hence max2 kk is unbounded. One
sue. The method outlined here is more efficient therefore has to bound from above if is to be
than the brute force method of gridding and pro- finite. Restricting our search to 2 4 gives:
vides a guarantee that the lower bound has been
found.
4 if 2 3
2

max kk = 0 if 3 2
2


EXAMPLE 2 if 2 4

This section demonstrates how a soft-constrained The lower bound of the violation weight for the soft-
mp-QP problem can be designed given a hard- constrained mp-QP is therefore
constrained mp-QP. A simple example was chosen,
> max kk = 4 .
in order that the reader can work out the solutions 24
analytically and visualise the results easily. Consider
the following hard-constrained mp-QP: Choosing > 4 guarantees that the soft-constrained

mp-QP (18) solution sof t is equal to the solution

min 2 + + 2 (17a) hard of the hard-constrained mp-QP (17) for all
R
2 4.
subject to Figure 1 is a plot of the actual Lagrange multipli-
ers of the hard-constrained mp-QP at the optimal so-
1+ (17b) lution as is varied from -2 to 4, confirming that
1 (17c) is a piecewise affine function of . Figure 2 shows
that the difference between the soft-constrained op-
where the inequalities describe the feasible set F. timal solution and the hard-constrained optimal so-
The feasible set for is therefore given by F = lution is zero for > 4 over the range 2 4.
{ : 2}, i.e. the hard-constrained mp-QP The soft-constrained and hard-constrained solutions
problem is infeasible for < 2. will differ for > 4, depending on the actual value
For the soft-constrained problem one can take used for . For < 2 the hard-constrained mp-QP
kkD = kk . If > max2 kk then the soft- does not have a solution, while the soft-constrained
constrained mp-QP4 mp-QP solution minimises the constraint violations.

min 2 + + 2 + kk1 (18a) CONCLUSIONS


,

4 Since kk = 1T  if   0, problem (18) can be written


1
A standard reference tracking formulation of MPC
as a QP. was given. The set of states for which the MPC
4
If the constraint violation weight that is used in
3.5 1

the soft-constrained cost function is larger than the
2

3
maximum norm, the solution is guaranteed to be
Magnitude of Lagrange multipliers

equal to the hard-constrained solution for all feasible


2.5
conditions that were considered.
2

1.5 FURTHER REMARKS


1
Thus far, in all examples, the authors have found the
0.5 norm to be convex over F and hence the maximum
0 is obtained at one of the vertices of 0 F . This
2 1 0 1 2 3 4
State of system might be related to the fact that the optimal value
of the MPC cost function is convex over F . It
Figure 1: Lagrange multipliers of the hard- might be that the Lagrange multipliers are related
constrained optimal solution for 2 4 to the partial derivatives with respect to of the
optimal cost function , since the mp-QP is similar in
0.8
structure to a perturbed QP when performing a local
0.7 sensitivity analysis. The authors will appreciate
any correspondence which confirms this or suggests
Sum of square of differences for 2 4

0.6
otherwise.
0.5

0.4
ACKNOWLEDGEMENTS
0.3

The authors would like to thank Dr Alberto Bempo-


0.2
rad, ETH Zurich, for proof-reading a draft of the pa-
0.1 per and giving helpful comments and suggestions.
0
3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 5
Violation weight REFERENCES

Figure 2: Plot showing that the difference between [1] N.M.C. de Oliveira and L.T. Biegler. Constraint
handling and stability properties of model-predictive
sof t and hard for 2 4 is zero if > 4
control. AIChE Journal, 40(7):11381155, July 1994.
[2] P.O.M. Scokaert and J.B. Rawlings. Feasibility
issues in model predictive control. AIChE Journal,
problem is feasible was defined. The importance of
45(8):16491659, August 1999.
ensuring that the feasible set is positively invariant
for the nominal closed-loop system was briefly [3] R. Fletcher. Practical Methods of Optimization. John
Wiley & Sons, 2nd edition, 1987.
discussed.
[4] P.O.M. Scokaert and J.B. Rawlings. Inifinite hori-
It was shown that both the cost function and
zon linear quadratic control with constraints. In Pro-
the constraints of the resulting QP is dependent ceedings of the 13th Triennial IFAC World Congress,
on the current state, previous control input and pages 109114, San Francisco, USA, 1996. IFAC.
reference trajectory. This implies that the Lagrange
[5] W.W. Hager. Lipschitz continuity for constrained
multipliers are also dependent on these variables. processes. SIAM Journal of Control and Optimiza-
Exact penalty functions require that the con- tion, 17(3):321338, May 1979.
straint violation weight be larger than the norm [6] A. Bemporad, M. Morari, V. Dua, and E.N. Pis-
of the Lagrange multiplier of the original optimi- tikopoulos. The explicit solution of model predic-
sation problem. It is therefore necessary to com- tive control via multiparametric quadratic program-
pute the upper bound on this norm for all feasi- ming. In Proceedings of the American Control Con-
ble combinations of current states, previous con- ference, Chicago, USA, June 2000.
trol inputs and reference trajectories. [7] S.S. Keerthi and E.G. Gilbert. Computation of
A method for computing the upper bound on the minimum-time feedback control laws for discrete-
norm of the Lagrange multipliers over a bounded time systems with state-control constraints. IEEE
subset of the feasible states was presented. The Transactions on Automatic Control, AC-32(5):432
region of interest can be divided into polytopes in 435, 1987.
which different combinations of constraints become [8] F. Blanchini. Set invariance in control. Automatica,
active at the solution. The problem of finding the 35:17471767, 1999.
maximum norm of the Lagrange multipliers reduces [9] D.Q. Mayne, J.B. Rawlings, C.V. Rao, and P.O.M.
to solving a finite number of LPs. The maximum Scokaert. Constrained model predictive control:
norm therefore lies at one of the vertices of these Stability and optimality. Automatica, 36:789814,
polytopes. 2000.

Potrebbero piacerti anche