CONTROL OF PLANTS WITH CHANGING DYNAMICS USING SWITCHING MODEL PREDICTIVE CONTROL Simon Lam Department of Electrical & Computer Engineering University of Toronto email:
[email protected] ABSTRACT A recent problem in adaptive control is the task of controlling a plant which is subject to large structural changes. In this case, it is often assumed the plant can be described by a specified family of models, and that the plant can change from one member of the family of models to some other member of the family of models. Such a system can be controlled by using a set of predefined controllers, and then switching among the controllers to compensate for the change in the plant dynamics. In previous studies, such switching controllers have been found to compensate for changes in the plant dynamics, but the transient response error is typically excessively large, due to the fact that the switching controller, during its “learning period”, may produce unstable closed-loop systems, which produce excessively large control signals. In this paper, a new switching controller is described, which uses model predictive control to impose constraints on the control signals. It is shown by simulation that, since the new controller does not produce “peaking” in the control signals, it subsequently solves the above family of controllers switching problem with greatly improved transient behaviour. KEY WORDS Adaptive control, switching control, model predictive control, uncertain systems.
1
Introduction
In the past, several switching control methods have been developed for adaptive control purposes. (e.g. [1]-[7]). One area of switching control is the so-called ‘family of plants’ problem [3], where the system to be controlled is characterized by being one member of a given family of plant models, P. For this problem, it is possible to construct a set of controllers, K, and then apply various switching schemes to determine which controller in K to apply, where K has the property that for any Pi ∈ P there exists a corresponding controller in K that can control Pi . A brief summary of past contributions in this area can be found in [4]. In more recent studies, a revised switching controller is presented in [5], which uses less apriori plant information than [3] and exhibits a certain level of robustness. In [6], the family of plants problem is extended so that the problem becomes controlling an unknown plant P ∈ P which
Edward J. Davison Department of Electrical & Computer Engineering University of Toronto email:
[email protected] changes from one member of P to some other member of P. In this case, the switching controller of [5] is verified in [6] to be capable of maintaining control under plant dynamics changes. In designing the switching controllers mentioned above, the size of the control signals are not constrained, and during the “learning period” of the switching controller, the system typically goes through an unstable phase. As a result, the above controllers typically produce very large control signals, which may subsequently saturate the system actuators, and/or produce erratic system behaviours. This fact motivates the development of a new switching controller presented in this paper. In particular, the switching controller of [5] is modified to use model predictive control (MPC), which takes input constraints into consideration when solving the control problem. It is shown that by implementing the constraints directly into the controller, the resulting switching controller obtained produces smaller control signals by a factor of approximately 15 and the system subsequently behaves more desirably. This paper is organized as follows. In Section 2, the switching controller in [5] is reviewed, which requires a review on the robust servomechanism problem (RSP) [8]. Model predictive control [9] is also reviewed in this section. In Section 3, the revised switching controller is presented. Then in a simulation study of a 3-member plant family carried out in Section 4, this controller is verified to be able to achieve the desired control objectives with smaller control signals and greatly improved system transient behaviour.
2 2.1
Preliminaries Notation
To distinguish between continuous and discrete systems, a time-dependent vector is written as x(t) or simply x, if the time-scale is continuous. If the time-scale is discrete, then the vector is written as x[k] or xk . The i component of x or xk is denoted by a subscript, i.e. xi or xki . The ∞-norm of a vector x ∈ Rn is denoted by: ||x|| := ||x||∞ = max |xi | 1≤i≤n
(1)
Also, a function, f : R+ → Rn , is said to lie in L∞ (i.e.
f ∈ L∞ ) if ||f || is finite, where:
2.3
||f || := ||f ||∞ = sup |f(t)|
(2)
t>0
Also, we denote that a matrix M ∈ Rn×n is symmetric positive definite by M > 0. 2.2
Robust Servomechanism Problem (RSP) [8]
In this paper, the control objective is to design a controller that provides acceptable reference tracking and disturbance rejection, in addition to system stability. Such a controller can be obtained by solving the Robust Servomechanism Problem (RSP) [8], which is reviewed in this section. Consider the following continuous linear-time invariant (LTI) system x˙ = Ai x + Bi u + Ei w y = Ci x + Di u + Fi w n
Switching Adaptive Controller I [5, 6]
This section briefly reviews the adaptive switching controller developed in [5]. Let P be a given finite family of continuous LTI plants (3). Denote the size of P by ν. Also, let K denote a set of corresponding RSP controllers (4), such that for every Pi ∈ P, there exists a controller, κi ∈ K, such that κi provides acceptable reference tracking and disturbance rejection for Pi under bounded piecewise constant reference and constant disturbance inputs, for i = 1, . . . , ν. It is assumed that the plant to be controlled, P , is characterized by one member of the given family, i.e. P ∈ P. The exact member, however, is not necessarily known (otherwise, one can trivially switch to the controller, κ ∈ K, which corresponds to P ). To control the system, we look at the following (adaptive) switching controller developed in [5], which from now on is referred to as Controller I. Denoting k ∈ N as the switching index, which is constant for t ∈ (tk , tk+1 ], define Controller I as
(3)
κi(t)
for t ∈ (tk , tk+1 ]
(5)
m
where x ∈ R is the state vector, u ∈ R is the control input, y ∈ Rr is the system output, and w ∈ Rq is a constant unmeasurable disturbance. Let yref ∈ Rr be a constant tracking signal and let e := y − yref denote the error in the system. Now assume that the following necessary and sufficient conditions for the existence of a solution to the RSP [8] are satisfied. Lemma 2.1. There exists a solution to the RSP for (3) iff: (a) (Ci , Ai , Bi ) are stabilizable and detectable
where i = ((k − 1) mod1 ν) + 1 is the controller decision for k, and ηi (t+ k ) ≡ 0 (i.e. the servo-compensator states are reset to zero at the beginning of each switching instance). The switching times, tk , are defined by: min t if minimum exists, where t satisfies (i) t > tk−1 (ii) ||ηi (t)|| = f1(k − 1) and/or tk = ||ef(t)|| = f2 (k − 1) ∞ otherwise (6) where ef(t) is the output of a filter given by: e˙ f(t) = −λef(t) + λe(t)
(b) m ≥ r
(7)
Then the following controller solves the robust servomechanism problem for system (3)
where λ ∈ R+ is a filter parameter, and e(t) := y(t) − yref(t) is the tracking error. In other words, Controller I is defined such that it cycles through the controllers in K (i.e. κ1 → κ2 → · · · → κν → κ1 → · · · ), where the switching criteria is determined by (6). Fig. 1 illustrates the closed-loop system of the plant with Controller I. Here, (f1(k), f2 (k)) are dual bounding functions as defined in [5] and restated below.
η˙ = Gi η + Hi y + Ji yref ξ˙ = Ki ξ + Li y + Mi η u = Ni ξ + Oi y + Pi η
Definition 2.1. Functions f1 : N → R+ and f2 : N → R+ are said to be dual bounding functions (i.e. (f1 , f2 ) ∈ DBF), if for k ∈ {1, 2}, fk is strictly increasing and for all (c0 , c1 , c2 , c3 ) ∈ R4+ ,
(c) rank
Ai Ci
Bi Di
=n+r
(d) y is measured
(4a) (4b) (4c)
where (4a) is the servo-compensator, and (4b+4c) is the stability compensator of the RSP controller. In this paper, it will be assumed that the plant to be controlled may undergo large structural changes; in particular, it will be assumed that the model of the plant is contained in a given family of plant models, where each plant model satisfies the existence conditions of Lemma 2.1
fk (i) → ∞ (8) i−1 i−1 X X c0 + c1 (i − 1) + c2 f1(j) + c3 f2 (j) j=1
as i → ∞. 1a
mod b = a−floor(a/b) × b
j=1
w
y
Plant u
Model Predictive Control (MPC)
In this section, we review the MPC problem for discrete systems associated with solving the RSP [9]. Assume that the plant to be controlled arises from sampling a continuous-time plant with sampling period h > 0, and has the structure:
κ1 κ2
Switch
2.4
κv yref
Figure 1. A diagram of the closed-loop system with Controller I (inside dotted box) applied. Here controller κi , i = 1, 2, . . . , ν are described by (4).
Controller I is guaranteed to eventually stop switching and arrive at the correct controller as stated in the following Theorem [5]. Theorem 2.1. Let Controller I be applied to P ∈ P at t = 0 with k = 1. Assume that ||η1 (0)|| < f1(1) and ||ef(0)|| < f2 (1). Then for all (f1 , f2 ) ∈ DBF and λ ∈ R+ , and all bounded piecewise continuous reference and disturbance signals, the closed loop system has the following properties: i) There exists a finite time tss > 0 such that κi = κss ∈ K for all t > tss . ii) The plant states, x ∈ L∞ , the controller states, η, ξ ∈ L∞ , and the filtered error states, ef ∈ L∞ .
Furthermore, the following is also true. Proposition 2.1. Controller I maintains the properties of Theorem 2.1, even in the presence of plant changes within P, that is, when Pi → Pj at some t > 0, for Pi , Pj ∈ P. Proof. The details of the proof are given in [6], and are omitted here. Hence, Proposition 2.1 states that Controller I is adaptive, because even when the dynamics of the plant shifts from one member, Pi ∈ P, to another Pj ∈ P, Controller I is able to achieve the desired control objectives by switching to the correct controller, κj , corresponding to Pj . Remark 2.1. It should be noted that in Proposition 2.1, it is assumed that a change in plant dynamics occurs only after the previous closed-loop system has reached “steadystate”. Furthermore, the switching index, k, is reset to 1 at the beginning of each shift in plant dynamics.
= Axk + Buk + Ewk
yk ek
= Cxk + Duk + F wk = yk − yref
(9)
where xk ∈ Rn , uk ∈ Rm , yk ∈ Rr , and wk ∈ Rq denote respectively the state, input, output, and disturbance of the system, and ek ∈ Rr denotes the error in the system for a tracking signal yref . Assume also that wk and yref are piecewise constant signals with wk unmeasurable, that the plant data (C, A, B, D) is known, but that the disturbance gain matrices, (E, F ) are unknown. Consider now the following augmented system obtained by cascading the servo-compensator [8] for (9) given by ηk+1 = ηk + ek (10) with the plant (4): A zk+1 = C
ykm
iii) For almost all controller parameters, the tracking error e(t) → 0 as t → ∞. Proof. The details of the proof can be found in [5] and are omitted here.
xk+1
C = 0 0
B uk zk + D E 0 wk + yref F −I D 0 I zk + 0 u k 0 0 F 0 wk 0 0 + (11) yref 0 I
0 I
h iT T T where zk := xk T , ηk T , and ykm := yk T , ηk T , yref are the measurable outputs of the system. On letting x ˆk := xk − xk−1 , u ˆk := uk − uk−1 and on noting from (10) that ek = ηk+1 − ηk , a representation for the augmented plant (11) is given by: x ˆk+1 A 0 x ˆk B = + u ˆk ek ek−1 C I D x ˆk 0 I ek−1 = (12) ek−1 which has the following property [9]: Lemma 2.2. i) The augmented plant representation (12) is stabilizable and detectable and possess the same fixed modes as (9) iff the existence conditions of Lemma 2.1 all hold.
ii) The system (12) is minimum phase iff the plant (9) is minimum phase. Define now the set U := u ∈ Rm |umin ≤ ui ≤ umax , i = 1, 2, . . . , m i i (13) where umin < umax and consider the plant (9) with the i i control constraint uk ∈ U . Assuming now that yref and wk in (9) are feasible [9] with respect to the constraint set (13) and that the conditions of Lemma 2.1 hold, the following performance index is proposed Jk :=
k+N X−1 i=k
ei−1 T Qei−1 + u ˆTi Rˆ ui ; Q > 0, R > 0
(14) for implementation using MPC, where N is the window size of the MPC horizon.
3
Main Results
controllers for the plant is no longer carried out. Instead, when the switching logic indicates that controller i (where i ∈ {1, 2, . . . , ν}) is to be applied to the plant, a MPC is thence applied to the plant using the plant model i, which has the structure (12), obtained from the family of plant models, in conjunction with the performance index (14). Thus in this case a standard MPC controller design is carried out, where the choice of window size, N , in (14) is to be made.
4
A Numerical Example
To demonstrate the behaviour of Controller II, we study the 3-member plant family, Pa , introduced in [3] (also studied in [5, 6]). P1 :
x˙ =
One limitation of the Switching Adaptive Controller I discussed in Section 2.3 is that it does not place any constraints on the control inputs. Subsequently, the control signals generated can be quite large, which is not only impractical as it may saturate system actuators, but it can also cause the system to have large erratic transient behaviours. So, in this paper, we present a modified version of Controller I called Controller II, which uses MPC to control the system with appropriate constraints placed on the control signals.
y
=
−0.75 −2.25
−1.2
1.4 −1.65
7.25 −8.25 4.1 x
x+
0.1 0.4
u+
0.1 0.1
w
P2 :
x˙ = =
y
−0.45
0.1 −0.18 21.1 w u+ x+ 0.1 0.33 −25.4 7.0 x
P3 : 3.1
Switching Adaptive Controller II
In Section 2.3, a description of the Switching Adaptive Controller I is made. In this controller, it is assumed for each model of the family of plant models that a corresponding controller which solves the RSP has been precalculated, e.g. by finding an optimal controller for (12) which minimizes the performance index: J :=
∞ X i=0
ei T Qei + u ˆTi Rˆ ui ; Q > 0, R > 0
(15)
In this case, the optimal controller obtained for each of the family of plant models has the structure uk = uk−1 + K0 (xk − xk−1 ) + K1 ek−1
(16)
which can be implemented by using an observer, and the switching Controller I thence chooses, amongst this set of controllers, that specific controller which solves the RSP problem, as indicated in Theorem 2.1 and Proposition 2.1. The Switching Adaptive Controller II is very similar to Controller I; in particular the switching logic is identical. The main difference is now that a family of pre-calculated
x˙ = y
=
−1.9 −1.3 2
10.9 −12.2 −5 x
x+
0 0.1
u+
0.1 0.1
w
Discretizing the member plant, Pi , for i ∈ {1, 2, 3}, and cascading the servo-compensator (10) with it, the following three discretized augmented systems (11) are thence obtained, where the sampling period is chosen to be h = 0.1s: P¯1 :
zk+1
ykm
0 0.87 0.46 0 = −0.14 0.39 0 zk + 0 yref −1 −1.2 4.1 1 1.2 × 10−2 2.0 × 10−2 + 2.6 × 10−2 uk + 5.8 × 10−3 wk 0 0 0 0 −1.2 4.1 0 wk 0 1 zk + 0 0 = 0 yref 0 1 0 0 0
P¯2 :
System Output Response 200
1.06 0.80 = −0.06 0.04 −0.45 7.0 −6.4 × 10−4 + 1.2 × 10−2 0 −0.45 7.0 0 0 = 0 0
zk+1
ykm P¯3 :
0 0 0 zk + 0 yref 1 −1 1.6 × 10−2 uk + 3.0 × 10−3 wk 0 0 0 0 wk 1 zk + 0 0 yref 0 1 0
100
0
−100
y
−200
−300
−400
−500
zk+1
ykm
0.78 0.55 0 0 = −0.07 0.27 0 zk + 0 yref 2.0 −5.0 1 −1 −3 1.2 × 10−2 3.5 × 10 + 5.7 × 10−3 uk + 5.2 × 10−3 wk 0 0 0 0 2 −5 0 wk = 0 0 1 zk + 0 0 yref 0 1 0 0 0
The weights of the MPC performance index (14) for the three plants are all chosen to be: Q=1
R = 0.05
(17)
In terms of defining the switching criteria, the following dual bounding functions are used [5]: (f1(k), f2(k)) ( (20k, 50k) 3 = k 2 (k e 6) , 6
(18) 1 ≤ k ≤ 10 3 k 2 (k e 6)
6
k > 10
For simplicity, the unfiltered error, ef (t) = e(t), is directly used as in [5]. In this example, we are interested in studying the closed-loop system when the plant dynamics change within the family Pa . As an illustration, we examine the case when the plant dynamics shift from P1 → P3 → P2 at t = 15s and t = 50s respectively. The control objective is to track a constant reference of yref = 10, with a constant disturbance of w = 2. The initial conditions are x0 = [1, 2]T . For purposes of comparison, a second set of controllers based on the discrete version of Controller I is designed: κI1 κI2 κI3
: : :
u ˆk = −30.3ˆ xk1 + 1.04ˆ xk2 + 3.19ek−1(19a) u ˆk = −83.3ˆ xk1 − 41.0ˆ xk2 + 3.47ek−1(19b) u ˆk = −39.4ˆ xk1 − 1.22ˆ xk2 − 4.14ek−1(19c)
where servo-compensator (10) is used and the gains of (κI1 , κI2 , κI3 ) are respectively obtained by solving the discrete linear-quadratic regulator (LQR) problem for performance index (15) using MATLAB’s DLQR command for
−600
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 2. Output response of system with Controller I applied and with 2 plant shifts: P1 → P3 (t = 15s), and P3 → P2 (t = 50s). yref = 10 and w = 2.
(P¯1 , P¯2 , P¯3 ) and using the same weights (17) as for the MPC component. It is interesting to note that for this 3-member plant family and the set of controllers based on Controller I and Controller II, any plant-controller mismatch results in an unstable closed-loop system. Fig. 2 gives the system output response of using Controller I. As expected from the results of [6], system stability and reference tracking is maintained with Controller I, even in the presence of plant dynamics changes. Fig. 3 shows the switching decisions and it can be seen that when the plant dynamics change from P1 to P3 at t = 15s, Controller I cycles through the controllers (19) and finds the correct one (i.e. κI3 ) at t ≈ 22s. Likewise when the plant dynamics switch from P3 to P2 at t = 50s, Controller I cycles and finds the correct controller (κI2 ) at t ≈ 73s. However, it can be seen from Fig. 4 that Controller I generates very large control signals, and the system subsequently behaves wildly with large outputs, which as mentioned earlier is undesirable. In comparison, Fig. 5 and 6 show respectively the system response and control signal when Controller II is applied, where −umin = umax = 305 and the window size is N = 50. It can be seen that Controller II is also capable of maintaining system stability and reference tracking. However, the control signal of Controller II is now some 15 times smaller compared to Controller I, and as a result, the system behaviour is less violent and much nicer. Fig. 7 shows the switching decisions of Controller II, and it can be seen that the correct controller decisions are indeed made for both plant shifts.
System Output Response
Switching Decisions 100
12
Switching Index, k
10 80
8 6
60
4 2
40
0
10
20
30
40
50
60
70
80
90
100 y
0
20
4
Controller index, i
0
3 −20
2 −40
1
0
−60
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 3. Switching decisions of Controller I, where the top plot shows k, and the bottom plot shows i = ((k − 1) mod 3) + 1.
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 5. Output response of system with Controller II applied and with 2 plant shifts: P1 → P3 (t = 15s), and P3 → P2 (t = 50s). yref = 10 and w = 2.
Control Signal Response
Control Signal Response
400
2000
300 1000
200 0
100
u
u
−1000
0
−2000
−100 −3000
−200
−4000
−5000
−300
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 4. Control signal of Controller I.
5
Conclusions and Future Work
In this paper, a new switching controller is presented, which uses model predictive control (MPC) to constrain the control effort and improve the transient response of a plant which is subject to large structural changes. In this problem, it is desired to solve the tracking/regulation servomechanism problem, for the case when the plant is subject to unknown and unmeasurable constant disturbances, and when the plant is described by an unknown LTI model contained in a given family of plant models. In this case, it is assumed that after the controlled plant reaches “steadystate”, the dynamics of the plant may suddenly change, via the plant model changing from one member of the family of plant models to another member. The motivation for
−400
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 6. Control signal of Controller II.
using MPC is that when the switching controller “learns” what family of plant member corresponds to the correct plant model, it typically has to apply to the plant a sequence of unstable controllers, which cause large transient responses to occur in the control signal. The utilization of MPC can minimize such a peaking effect by applying constraints on the control signal. In a simulation study of a family of 3 LTI systems, this new switching controller has successfully demonstrated stability recovery after plant shifts, reference tracking, and disturbance rejection, while also showing smaller control signals and greatly improved transient behaviour. Although the new switching controller has been shown to be successful in simulation, it should be noted that some of the disadvantages of MPC are inevitably inher-
[5] M. Chang and E. J. Davison, “Adaptive switching control of LTI MIMO systems using a family of controllers approach,” Automatica, vol. 35, pp. 453–465, 1999.
Switching Decisions 6
Switching Index, k
5 4 3 2 1 0
0
10
20
30
40
50
60
70
80
90
100
[7] ——, “A switching approach to the control of jump parameter systems,” in Proc. of American Control Conference, Minneapolis, MN, USA, June 14-16 2006, pp. 5419–5424.
Controller index, i
4
3
2
1
0
[6] S. Ching and E. J. Davison, “Control of plants which change using switching controllers,” in Proc. of American Control Conference, Portland, OR, USA, June 810 2005, pp. 1181–1185.
0
10
20
30
40
50 Time (s)
60
70
80
90
100
Figure 7. Switching decisions of Controller II, where the top plot shows k, and the bottom plot shows i = ((k − 1) mod 3) + 1.
ited. In particular, solving the quadratic programming (QP) problem can be computationally intensive, especially for large systems, and may render the controller to be practical for use only for slower dynamic systems. Furthermore, recall that it has been assumed in the paper that the plant dynamics shift only when the previous system has reached “steady-state”. The case when the plant dynamics change before the previous system reaches “steady-state” is left for future research.
References [1] K. S. Narendra and J. Balakrishnan, “Improving transient response of adaptive control systems using multiple models and switching,” IEEE Trans. Automat. Contr., vol. 39, no. 9, pp. 1861–1866, 1994. [2] A. S. Morse, “Supervisory control of families of linear set-point controllers – part 1: exact matching,” IEEE Trans. Automat. Contr., vol. 41, no. 10, pp. 1413–1431, 1996. [3] D. E. Miller and E. J. Davison, “Adaptive control of a family of plants,” in Control of Uncertain Systems: Proceedings of an International Workshop, Bremen, West Germany, June 1989, D. Hinrichson and B. M˚ artensson, Eds., Birkh¨auser, Boston, June 1990. [4] D. E. Miller, M. Chang, and E. J. Davison, “An approach to switching control: theory and application,” in Lecture Notes in Control and Information Sciences: Control using logic-based switching, A. S. Morse, Ed. London: Springer, 1997, vol. 222, pp. 234–247.
[8] E. J. Davison and A. Goldenberg, “Robust control of a general servomechanism problem: the servo compensator,” Automatica, vol. 11, no. 5, pp. 461–471, 1975. [9] D. E. Davison, R. Milman, and E. J. Davison, “Optimal transient shaping in mpc,” in Proc. of IFAC World Congress, Prague, July 2005, Paper Code TU-E21T016.