CHAPTER 3 MODEL PREDICTIVE CONTROL This chapter describes MPC and especially RNMPC that is applied to the plant outlined in Chapter 2. The chapter starts by explaining MPC and its history, followed by a description of robust MPC and the reason for its development, and finally focuses on the controller theory used for the simulation study in Chapter 5. The description of MPC and the development of stability theory, including robust stability, in Sections (3.1)-(3.4) are summaries from the survey done by Mayne et al. (2000) and provided here for background. 3.1 INTRODUCTION MPC, also known as receding horizon control (RHC), takes a measurement of the plant, uses a mathematical model of the system to predict its future behaviour in order to calculate a sequence of control moves (N steps) into the future that will optimise (usually minimise) an objective or penalty function, which describes a measure of performance of the system. The first control move of the calculated sequence is applied to the system and a new measurement is taken. The process is then repeated for the next time step. MPC calculates the control sequence on-line at each time step, compared to conventional control theory where the control law is pre-calculated and valid for all possible states of the system. MPC has the distinct advantage of controlling multi-variable systems well and can explicitly take into consideration constraints on the inputs (such as actuators, valves, etc.) as well as states or outputs (Camacho and Bordons, 2003). MPC is especially useful in situations where an explicit controller cannot be calculated offline. The basic ideas present in the MPC family, according to Camacho and Bordons (2003), are that • outputs at future time instances are predicted by the explicit use of a mathematical model, Department of Electrical, Electronic and Computer Engineering University of Pretoria 37 CHAPTER 3 INTRODUCTION • an objective function is minimised by calculating the appropriate control sequence, and • at each time instant, the horizon is displaced towards the future, which involves applying the first control signal calculated at each time instance to the system; called the receding horizon strategy. The MPC theory described in this chapter is in discrete time and the system takes the following form (Mayne et al., 2000): x(k + 1) = f (x(k), u(k)), y(k) = h(x(k)). (3.1) (3.2) To simplify the notation, the value of x at time k is given by xk = x(k). The value of x at time k + 1, therefore, becomes xk+1 = x(k + 1), the value of y at time k becomes y(k) = yk and the value of u at time k becomes uk . The equations (3.1)-(3.2), therefore, becomes xk+1 = f (xk , uk ), (3.3) yk = h(xk ). (3.4) The control and state sequences must satisfy xk ∈ X, (3.5) uk ∈ U, (3.6) where X ⊂ Rnx and U ⊂ Rnu . Given a control vector sequence of length N, uN = uN (k), uN (k + 1), . . . , uN (k + N − 1) , where uN (k + 1) specifies the control vector at time k + 1, the predicted state vector sequence based on the control sequence uN is given by xu (xk , k) = {xu (k, xk , k), xu (k + 1, xk , k), . . . , xu (k + N − 1, xk , k), xu (k + N, xk , k)} , (3.7) where xu (k + 1, xk , k) is the calculated state vector at time k + 1 from the initial state xk , initial time k and control vector uN (k) using f (·, ·). The notation for the state sequence is N simplified by stating the current state xk and time k as subscripts to give xN xk ,k = x (xk , k) = n o xxuk ,k (k), xxuk ,k (k + 1), . . . , xxuk ,k (k + N − 1), xxuk ,k (k + N) . The objective function that is used in the optimisation process has the following form: k+N−1 φ (xk , k, uN ) = ∑ L(xxuk ,k (i), uN (i)) + E(xxuk ,k (k + N)), (3.8) i=k Department of Electrical, Electronic and Computer Engineering University of Pretoria 38 CHAPTER 3 INTRODUCTION where L(xxuk ,k (i), uN (i)) is the cost at each time step into the future with regard to the states and inputs, while E(xxuk ,k (k + N)) is the cost at the final state, reached after the whole control sequence has been applied. At each time k, the final time is k + N, which increases as k increases and is called a receding horizon. In certain MPC formulations, a terminal constraint set is defined xxuk ,k (k + N) ∈ X f ⊂ X. (3.9) The optimal control problem P(xk , k) of minimising the objective function is performed subject to the constraints on the control and state sequences, and in certain cases the terminal constraint to yield the optimised control sequence u opt n o opt opt opt (xk , k) = uxk ,k (k), uxk ,k (k + 1), ..., uxk ,k (k + N − 1) , (3.10) and optimised value for the objective function opt φ opt (xk , k) = φ (xk , k, uxk ,k ). (3.11) The first control move at time k of the sequence uopt (xk , k) is implemented to form an implicit control law for time k opt κ(xk , k) = uxk ,k (k). (3.12) The objective function is time invariant, because neither L(xxuk ,k (i), uN (i)) nor E(xxuk ,k (k +N)) has terms that depend on time. The optimal control problem P(xk , k) can be defined as starting at time 0 to give PN (xk ) = P(xk , 0) . N represents the finite prediction horizon over which the optimisation takes place, and the optimisation problem can be redefined as opt PN (xk ) : φN (xk ) = min φN (xk , uN )|uN ∈ UN , uN (3.13) where the objective function is now N−1 N φN (xk , u ) = ∑ L(xxuk (i), uN (i)) + E(xxuk (N)), (3.14) i=0 with UN the set of feasible control sequences that satisfy the control, state and terminal constraints. If problem PN (xk ) is solved, the optimal control sequence is obtained uopt (xk ) = opt opt uxk (0), uopt xk (1), ..., uxk (N − 1) , (3.15) and the optimal state trajectory, if the control actions are implemented, is given by xopt (xk ) = opt xxk (0), xxopt (1), ..., xxopt (N − 1), xxopt (N) . k k k Department of Electrical, Electronic and Computer Engineering University of Pretoria (3.16) 39 CHAPTER 3 HISTORICAL BACKGROUND The optimal objective value is opt φN (xk ) = φN (xk , uopt xk ). (3.17) The first control action is implemented, leading to the implicit time invariant control law κN (xk ) = uopt xk (0). (3.18) Dynamic programming can be used to determine a sequence of objective functions φ j (·) deterministically in order to calculate the sequence of control laws κ j (·) offline, where j is the time-to-go until the prediction horizon. This is possible because of the deterministic nature of the open-loop optimisation. This would be preferable, but is usually not possible. The difference between MPC and dynamic programming is purely a matter of implementation. MPC differs from conventional optimal control theory in that MPC uses a receding horizon control law κN (·) rather than an infinite horizon control law. 3.2 HISTORICAL BACKGROUND MPC builds on optimal control theory, the theory (necessary and sufficient conditions) of optimality, Lyapunov stability of the optimal controlled system, and algorithms for calculating the optimal feedback controller (if possible) (Mayne et al., 2000). There are a few important ideas in optimal control that underlie MPC. The first links together two principles of the control theory developed in the 1960s: the Hamilton-Jacobi-Bellman theory (Dynamic Programming) and the maximum principle, which provides necessary conditions for optimality. Dynamic programming provides sufficient conditions for optimality, as well as a procedure to synthesise an optimal feedback controller u = κ(xk ). The maximum principle provides necessary conditions of optimality as well as computational algorithms for determining the opt optimal open-loop control uxk (·) for a given initial state xk . These two principles are linked together as κ(xk ) = uopt xk (0), (3.19) in order for the optimal feedback controller to be obtained by calculating the open-loop control problem for each x (Mayne et al., 2000). From the commencement of optimal control theory it is stated by Lee and Markus (1967, p. 423): “One technique for obtaining a feedback controller synthesis from knowledge of open-loop controllers is to measure the current control process state and then compute very rapidly for the open-loop control function. The first portion of this function is then used during a short time interval, after which a new measurement of the process state is made and a new open-loop control function is computed for this new measurement. The procedure is then repeated.” Department of Electrical, Electronic and Computer Engineering University of Pretoria 40 CHAPTER 3 HISTORICAL BACKGROUND Kalman, as discussed in Mayne et al. (2000), observed that optimality does not guarantee stability. There are conditions under which optimality results in stability: infinite horizon controllers are stabilising, if the system is stabilisable and detectable. Calculating infinite horizon optimal solutions is not always practical on-line and an alternate solution was needed to stabilise the receding horizon controller. The first results for stabilising receding horizon controllers were given by Kleinman (1970), who developed a minimum energy controller for linear systems. He showed that the feedback controller is linear, time invariant and stable if a Lyapunov function φ (x) = xT Px is used as the objective function. Another approach is to define a stability constraint as part of the optimal control problem. The stability constraint is defined as an equality constraint x(T ) = 0 that forces the solution to converge to the origin. Thomas, as discussed in Mayne et al. (2000), suggested this technique as part of a linear quadratic control problem and implemented it by using M , P−1 in place of P as the Riccati variable and solving the Riccati-like differential equation with terminal condition M(T ) = 0. MPC was really driven by industry as part of process control theory. Richalet et al. (1978) was the first to propose MPC for process control applications, but MPC was proposed earlier by Propoi and Lee and Markus (as discussed in Mayne et al. (2000)). The MPC method, called identification and command (IDCOM), was proposed by Richalet et al. (1978). It uses a linear model in the form of a finite horizon impulse response, quadratic cost and constraints on the inputs and outputs. The method makes provision for linear estimation using least squares, and the algorithm for solving the open-loop optimal control problem is the “dual” of the identification algorithm. DMC is a later method proposed by Cutler and Ramaker (1980) and Prett and Gillette (as discussed in Mayne et al. (2000)). DMC uses a step response model, but as in IDCOM, handles constraints in an ad hoc fashion. This limitation was addressed by García and Morshedi (as discussed in Mayne et al. (2000)) by using quadratic programming to solve the constrained open-loop optimisation problem. This method also allows certain violations of the constraints in order to enlarge the set of feasible states. This method is called Quadratic Dynamic Matrix Control (QDMC). The third generation of MPC technology, introduced about a decade ago, “distinguishes between several levels of constraints (hard, soft and ranked). This technology provides some mechanism to recover from an infeasible solution, and addresses the issues resulting from a control structure that changes in real time, and allows for a wider range of process dynamics and controller specifications” (Qin and Badgwell, 2003). The Shell multi-variable optimising control (SMOC) uses state-space models, incorporates general disturbance models and allows for state estimation using Kalman filters (as discussed in Mayne et al. (2000)). An independent but similar approach was developed from the adaptive control theory and is called generalised predictive control (GPC). The method uses models in the backward shift operator q-1 which is more general than the impulse and step response models of DMC. GPC started as minimum variance control (Mayne et al., 2000) that only allowed for a horizon of Department of Electrical, Electronic and Computer Engineering University of Pretoria 41 CHAPTER 3 STABILITY OF MPC length 1. Minimum variance control was extended to allow for longer prediction horizons by Peterka (1984) as well as Clarke et al. (1987a, b). GPC, and early versions of DMC, did not explicitly incorporate stability in the method and had to rely on the tuning of the prediction horizon as well as the weights of the states and inputs to achieve stability. 3.3 STABILITY OF MPC The inability of both GPC and DMC to guarantee stability caused researchers to focus more on modifying PN (x) to ensure stability, owing to increased criticism (Bitmead et al., 1990) of the makeshift approach of using tuning to attain stability. With terminal equality constraints, the system is forced to the origin by the controller that takes the form E(x) = 0, as there is no terminal cost and the terminal set is X f = {0}. Keerthi and Gilbert, as discussed in Mayne et al. (2000), proposed this stabilising strategy for constrained, nonlinear, discrete time systems and showed a stability analysis of this version (terminal equality constraints) of discrete-time receding horizon control. MPC, with a terminal equality constraint, can be used to stabilise a system that cannot be stabilised by continuous feedback controllers, according to Meadows et al. (as discussed in Mayne et al. (2000)). Using a terminal cost function is an alternative approach to ensure stability. Here the terminal cost is E(·), but there is no terminal constraint and the terminal set is thus X f = Rnx . For unconstrained linear systems the terminal cost of E(x) = 21 xT Pf x is proposed by Bitmead et al. (1990). Terminal constraint sets differ from terminal equality constraints, in that subsets of Rnx that include a neighbourhood of the origin are used to stabilise the control, not just the origin. The terminal constraint set, like the terminal equality constraint, does not employ a terminal cost, thus E(x) = 0. The MPC controller should steer the system to X f within a finite time, after which a local stabilising controller κ f (·) is employed. This methodology is usually referred to as dual mode control and was proposed by Michalska and Mayne (1993) in the context of constrained, nonlinear, continuous systems using a variable horizon N. A terminal cost and constraint set is employed in most modern model predictive controller theory (Mayne et al., 2000). If an infinite horizon objective function can be used, on-line optimisation is not necessary and stability and robustness can be guaranteed. In practical systems, constraints and other nonlinearities make the use of infinite horizons impossible, but it is possible to approximate an infinite horizon objective function if the system is suitably close to the origin. By choosing the terminal set X f as a suitable subset of Rnx , the terminal cost E(·) can be chosen to approximate an infinite horizon objective function. A terminal cost and constraint set controller therefore needs a terminal constraint set X f in which the terminal cost E(·) and infinite horizon feedback controller K f are employed. To synthesise these, Sznaier and Damborg (as discussed in Mayne et al. (2000)) proposed that the terminal cost Department of Electrical, Electronic and Computer Engineering University of Pretoria 42 CHAPTER 3 STABILITY OF MPC E(·) and feedback controller K f of a standard linear-quadratic (LQ) problem be used, which is an unconstrained infinite horizon problem, when the system is linear ( f (x, u) = Ax + Bu) and the state and input constraint sets, X and U, are polytopes. The terminal constraint set X f is chosen to be the maximal output admissible set (Gilbert and Tan, 1991) of the system f (x, u) = (A + BK f )x. Most industrial or commercial MPC controllers do not use terminal costs or constraints, because they do not even provide nominal stability that these terminal costs and constraints are designed to provide and can be attributed to their DMC and IDCOM heritage (Qin and Badgwell, 2003). Most industrial MPC controllers, therefore, require brute-force simulation to evaluate the effects of model mismatch on closed-loop stability (Qin and Badgwell, 2003). Time spent tuning and testing of industrial controllers can, however, be significantly reduced if the controllers implement nominal and potentially robust stability measures, even though closed-loop stability of industrial MPC itself is not perceived to be a serious problem by industry practitioners (Qin and Badgwell, 2003). 3.3.1 Stability conditions for model predictive controllers From the above discussion, it is clear that the addition of a terminal constraint set X f , terminal cost E(·) and local feedback controller κ f in the terminal constraint set forms the basis of stabilising MPC. Some conditions, in the form of axioms, are formulated (Mayne et al., 2000) for the terminal constraint set, terminal cost and local feedback controller, which ensures that the controller is stabilising. Two related methods are available for establishing stability. Both methods use a Lyapunov function as the objective function. The first method ensures that the objective function opt φN (xk ) evolves with the state from xk to xk+1 = f (xk , κN (xk )) so that opt opt φN (xk+1 ) − φN (xk ) + L(xk , κN (xk )) ≤ 0, (3.20) while the alternative method uses the fact that opt opt opt φN (xk+1 ) − φN (xk ) + L(xk , κN (x)) = φN (xk+1 ) − φN−1 (xk+1 ), (3.21) opt and shows that the right-hand side is negative, either directly or by showing that φ1 (·) ≤ opt opt opt opt φ0 (·) and exploiting monotonicity, which implies that if φ1 (·) ≤ φ0 (·) then φi+1 (·) ≤ opt φi (·) for all i ≥ 0. Assume a model predictive controller that can steer the system state x to the terminal constraint set X f within the prediction horizon N or fewer steps. The control sequence that accomplishes this is called an admissible or feasible control sequence u = {u(0), u(1), ..., u(N − 1)}. This control sequence should satisfy the control constraints u(i) ∈ U for i = 0, 1, ..., N − 1 and ensure that the controlled states satisfy the state constraints xxuk (i) ∈ X for i = 0, 1, .., N Department of Electrical, Electronic and Computer Engineering University of Pretoria 43 CHAPTER 3 STABILITY OF MPC and the final state satisfies the terminal constraint set xxuk (N) ∈ X f . If the control problem PN (xk ) is solved, the control sequence uopt (xk ) is obtained that will steer the system within the set of states that is possible with an MPC with horizon N, x ∈ XN . The opti opt opt mal control sequence uopt (xk ) n = uopt xk (0), uxk (1), ..., uxk (N − 1) will o result in the optiopt opt opt opt opt mal state sequence x (xk ) = xxk (0), xxk (1), ..., xxk (N − 1), xxk (N) . The first control opt action of uopt (xk ), that is uk = κN (xk ) = uxk (0) is implemented to get to the next state opt xk+1 = f (xk , κN (xk )) = xxk (1). A feasible control sequence x̃(xk+1 ) for the state xk+1 , will opt result in an upper bound for the optimal objective function φN (xk+1 ), because a feasible control sequence should give a larger value for control n the objective function than an optimal o opt opt opt sequence. The abbreviated control sequence uxk (1), uxk (2), ..., uxk (N − 1) derived from opt uopt (xk ) should be a feasible control sequence to steer state xk+1 to xxk (N) ∈ X f . If an extra opt opt opt term is added to the control sequence {uxk (1), uxk (2), ..., uxk (N − 1), v}, the control seopt opt quence will be feasible for PN (xk+1 ) if v ∈ U and v steers xxk (N) ∈ X f to f (xxk (N), v) ∈ X f . opt This will be true if v = κ f (xxk (N)), with the terminal state constraint X f and local controller κ f (·) having the properties: X f ⊂ X, κ f (xk ) ∈ U and f (xk , κ f (xk )) ∈ X f ∀xk ∈ X f , (3.22) implying that the terminal set X f is invariant when the controller is κ f (·). The feasible control sequence for PN (xk+1 ) is ũ(xk ) = opt opt opt uxk (1), uopt xk (2), ..., uxk (N − 1), κ f (xxk (N)) , (3.23) with the associated cost opt (N)) φN (xk+1 , ũ(xk )) = φN (xk ) − L(xk , κN (xk )) − E(xxopt k (N))) +L(xxopt (N), κ f (xxopt k k (N)))). (N), κ f (xxopt +E( f (xxopt k k (3.24) opt This cost φN (xk+1 , ũ(xk )) is the upper bound on φN (xk+1 ) and satisfies opt φN (xk+1 , ũ(xk )) ≤ φN (xk ) − L(xk , κN (xk )), (3.25) E( f (xk , κ f (xk ))) − E(xk ) + L(xk , κ f (xk )) ≤ 0, ∀xk ∈ X f . (3.26) if The condition (3.26) will hold if E(·) is a control Lyapunov function in the neighbourhood of the origin and the controller κ f and the terminal constraint set X f are chosen appropriately. If the condition (3.26) is satisfied, then (3.20) will hold for all xk ∈ XN , which is sufficient for the closed-loop system xk+1 = f (xk , κN (xk )) to converge to zero as time k tends to infinity, provided that the initial state is within XN . The stability conditions can be summarised in the following axioms (Mayne et al., 2000): Department of Electrical, Electronic and Computer Engineering University of Pretoria 44 CHAPTER 3 STABILITY OF MPC A1: X f ⊂ X, X f is a closed set and 0 ∈ X f . This condition implies that the state constraints should be satisfied in the terminal constraint set. A2: κ f (x) ∈ U, ∀x ∈ X f . This condition implies that the constraints on the controls should be satisfied by the local controller in the terminal constraint set X f . A3: f (x, κ f (x)) ∈ X f , ∀x ∈ X f . This implies that the terminal constraint set X f is positively invariant under the local controller κ f (·). A4: E( f (x, κ f (x))) − E(x) + L(x, κ f (x)) ≤ 0 ∀x ∈ X f . The terminal cost function E(·) is a local Lyapunov function in the terminal constraint set X f . The conditions, as summarised in A1 to A4, are merely sufficient conditions to ensure stability in model predictive controllers. These conditions can be shown to hold for the monotonicity approach as well as the continuous case (Mayne et al., 2000). The following paragraphs will show how the stabilising methods of Section 3.3 satisfy the stability conditions A1 to A4. 3.3.2 Terminal state MPC The terminal state variant of model predictive controllers (Mayne et al., 2000) uses the terminal state X f = {0} with no terminal cost E(·) = 0. The local controller in the terminal constraint set is κ f (x) = 0 that will ensure that the state remains at the origin if this controller is applied. The functions E(·) and κ f (·) are only valid in X f which is at the origin. The satisfaction of the stability conditions A1 to A4 are as follows: A1: X f = {0} ∈ X - Satisfied. A2: κ f (0) = 0 ∈ U - Satisfied. A3: f (0, κ f (0)) = f (0, 0) = 0 ∈ X f - Satisfied. A4: E( f (0, κ f (0))) − E(0) + L(0, κ f (0)) = 0 - Satisfied. The controller ensures that the closed-loop system is asymptotically (exponentially) stable with region of attraction XN . 3.3.3 Terminal cost MPC Terminal cost model predictive controllers are only valid in linear unconstrained (Bitmead et al., 1990) and linear, stable, constrained (Rawlings and Muske, 1993) cases. In order to ensure stability, a terminal constraint is necessary if the system is nonlinear or linear, constrained and unstable. Linear, unconstrained systems are defined as f (x, u) = Ax + Bu, Department of Electrical, Electronic and Computer Engineering University of Pretoria 45 CHAPTER 3 STABILITY OF MPC and L(x, u) = 12 (|x|2Q + |u|2R ) where Q > 0 and R > 0. The first three conditions A1 to A3 are trivially satisfied in the unconstrained case, because X = Rnx and U = Rnu . In the case where A and B are stabilisable, the local controller is defined as κ f , K f x, and Pf > 0 should satisfy the Lyapunov equation ATf Pf A f + Q f = 0, A f , A + BK f , Q f , Q + K f RK f , (3.27) then the terminal cost function E(x) , 12 xT Pf x satisfies A4 and the closed-loop system is asymptotically (exponentially) stable with a region of attraction Rnx . Linear, constrained, stable systems have control constraints u ∈ U, but no constraints on the states, thus X = X f = Rnx . In order to satisfy A2, the controller function, if linear, should be κ f (x) = 0 (Rawlings and Muske, 1993), that leads to the first three conditions (A1 to A3) being satisfied. The final condition A4 is satisfied if the terminal cost function is E(x) , 12 xT Pf x, where Pf satisfies the Lyapunov equation AT Pf A + Q = 0, that results in a controller with asymptotic (exponential) stability with region of attraction Rnx . 3.3.4 Terminal constraint set MPC Terminal constraint set model predictive controllers employ a terminal constraint set xxuk (N) ∈ X f without a terminal cost E(x) = 0 for nonlinear, constrained systems. Michalska and Mayne (1993) introduced the idea of a variable prediction horizon N for continuous-time, constrained, nonlinear systems. Scokaert et al. (1999) proposed a fixed horizon version for nonlinear, constrained, discrete-time systems. The controller steers the state of the system x to within the terminal constraint set X f , after which a local stabilising controller κ f (x) = K f x is employed. This type of MPC is sometimes referred to as dual-mode MPC. This method is similar to the terminal equality constraint method, except that the equality {0} is replaced by a set X f . The local controller κ f (·) and the terminal constraint set X f are chosen to satisfy the first three conditions A1 to A3. The local controller κ f (·) is chosen to steer the system exponentially fast to the origin for all states in the terminal constraint set (∀x ∈ X f ). The stage cost of the objective function L(x, κ f (x)) should be 0 when the system state is within the terminal constraint set X f in order to satisfy A4. A suitable choice for the stage cost is L(x, u) , α(x)L(x, u), (3.28) where α(x) = 1, ∀x ∈ / X f , else α(x) = 0 and L(x, u) = 12 (xT Qx + uT Ru), where Q > 0 and R > 0. The closed-loop system is exponentially stable with domain of attraction XN , because the MPC controller steers the system with initial state x ∈ XN within finite time to X f with the controller value κN (·). Department of Electrical, Electronic and Computer Engineering University of Pretoria 46 CHAPTER 3 3.3.5 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS Terminal cost and constraint set MPC 0 (x) = In linear, constrained systems the terminal cost function can be chosen as E(x) = φuc 1 T 2 x Pf x, that is the same as the unconstrained infinite horizon optimal control problem. The local controller κ f (xk ) = K f xk is the optimal infinite horizon controller and the terminal constraint set X f is the maximal admissible set for the system xk+1 = A f xk , A f , A + BK f , thus satisfying A1-A4. This results in an exponentially stable controller with domain of attraction opt X f . The ideal choice for the terminal cost would be to choose E(x) = φ∞ (x), the objective function of an infinite horizon optimal controller, that would result in the objective function opt opt for the model predictive controller being φN (x) = φ∞ (x), and on-line optimisation would not be necessary. The resulting model predictive controller will have all the advantages of infinite horizon control. This is usually not practical, and the use of the terminal constraint 0 (x) = 1 xT P x approximates the advantages of using E(x) = φ opt (x). set X f and E(x) = φuc ∞ f 2 The nonlinear case is also given in Mayne et al. (2000). From this discussion, it is clear that the use of a terminal constraint set X f , terminal cost function E(·) and local stabilising controller κ f (·) is necessary to ensure stability in MPC. The first two requirements, terminal constraint set X f and terminal cost function E(·), are explicitly incorporated into the controller, while the feedback controller κ f (·) is only implicitly needed to prove stability. If the cost function E(·) is as close to the objective function opt φ∞ (·) as possible, the closed-loop trajectory is exactly the same as that predicted by the solution of the optimal control problem PN (x). 3.4 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS Robust MPC is concerned with the stability and performance of the closed-loop system in the presence of uncertainty in the plant model. Early studies in the robustness of model predictive controllers considered unconstrained systems and found that if the Lyapunov function retains its descent property in the presence of disturbances (uncertainty), it will remain stable. In the constrained case, the problem becomes more complex, because the uncertainty or disturbances should not cause the closed-loop system to violate its state or control constraints. Richalet et al. (1978) performed one of the earliest studies in robustness on systems with impulse response models, by investigating the effect of gain mismatches on the closed-loop system. Later work on systems modelled by impulse responses approached the optimal control problem as a min-max problem, that caused the problem to grow exponentially with the size of the prediction horizon. There are several approaches to robust MPC, the first being a study of the robustness of MPC designed with a nominal model (that does not take uncertainty into account). The second Department of Electrical, Electronic and Computer Engineering University of Pretoria 47 CHAPTER 3 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS approach considers all the possible realisations of the uncertain system when calculating the open-loop optimal controller (min-max open-loop MPC). The open-loop nature of MPC is a problem when model uncertainty is present and the third approach addresses this by introducing feedback in the optimal control problem that is solved on-line. For the discussion of robust MPC, the uncertain system is described as xk+1 = f (xk , uk , wk ), yk = h(xk ), (3.29) (3.30) where the state xk and control uk satisfy the same constraints xk ∈ X, (3.31) uk ∈ U, (3.32) and the disturbance or uncertainty wk satisfies wk ∈ W (xk , uk ) for all k where, for each (xk , uk ), W (xk , uk ) is closed and contains the origin in its interior. The disturbance sequence wN , wN (0), wN (1), ..., wN (N − 1) , together with the control sequence uN and initial state xk , will produce the resulting state sequence (N) . (N − 1), xxu,w (1), . . . , xxu,w (0), xxu,w xu,w (xk ) = xxu,w k k k k (3.33) Let F (xk , uk ) , f (xk , uk ,W (xk , uk )), which will map values in X and U to subsets of Rnx , resulting in xk+1 ∈ F (xk , uk ). De Nicolao et al. (1996) and Magni and Sepulchre (1997) studied the inherent robustness of model predictive controllers that were designed without taking uncertainty into account. A more recent study by Grimm et al. (2004) found that there are examples showing that when MPC is applied to a nonlinear system, it is asymptotically stable without any robustness to measurement error or additive disturbances. This only happens in a nonlinear system where both the MPC feedback control law and the objective function are discontinuous at some point(s) in the interior of the feasibility region. 3.4.1 Stability conditions for robust MPC Most versions of robust MPC take all the realisations of the uncertainty or disturbance w into consideration that requires strengthened assumptions to be satisfied, which are summarised as robust versions of axioms A1-A4 (Mayne et al., 2000): A1: X f ⊂ X, X f closed, 0 ∈ X f . A2: κ f (x) ∈ U, ∀x ∈ X f . A3a: f (x, κ f (x), w) ∈ X f , ∀x ∈ X f , ∀w ∈ W (x, κ f (x)). Department of Electrical, Electronic and Computer Engineering University of Pretoria 48 CHAPTER 3 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS A4a: E( f (x, κ f (x), w)) − E(x) + L(x, κ f (x), w) ≤ 0, ∀x ∈ X f , ∀w ∈ W (x, κ f (x)). If E(·) is a robust Lyapunov function in the neighbourhood of the origin, there exists a triple (E(·), X f , κ f (·)), which ensures that A4a is satisfied and results in an asymptotically or exponentially stable controller. 3.4.2 Open-loop min-max MPC Open-loop min-max MPC considers all the possible realisations of the uncertain system in order to ensure that the state, control and terminal constraints are met for all the possible realisations (Michalska and Mayne, 1993). The objective function value in this case is determined for each realisation N−1 J(xk , uN , wN ) , (i), uN (i)) + E(xxu,w (N)), ∑ L(xxu,w k k (3.34) i=0 and the final objective value is the worst case for all the realisations φN (xk , uN ) , max J(xk , uN , wN )|wN ∈ WN (xk , uN ) , wN (3.35) where WN (xk , uN ) is the set of admissible disturbance sequences. Other choices are to take the objective value as the nominal objective value by using wN = 0. Badgwell (as discussed in Mayne et al. (2000)) used an interesting approach, where the controller should reduce the objective function value for every realisation, which is assumed finite, for a linear system. This is stronger than only reducing the worst-case objective value. The set of admissible control sequences UNol (xk ) is the one that satisfies the control, state and terminal constraints for all possible realisation of the disturbance sequence wN when the initial state is xk . Suppose the set Xol i , for all i ≥ 0, is the set of states that can be robustly steered to the terminal state constraint X f in i steps or fewer by an admissible control sequence uN ∈ UNol (xk ). The open-loop optimal control problem is o n opt PNol (xk ) : φN (xk ) = min φN (xk , uN )|uN ∈ UNol (xk ) . uN (3.36) The solution to PNol (xk ) yields the optimal control sequence uopt (xk ), where the implicit minmax control law is κNol (xk ) , uopt xk (0), (3.37) as in the nominal case. The control sequence will result in multiple optimal state sequences {xopt (xk , wN )} as a result of the disturbance sequence wN , so that opt x (xk , u opt n o opt opt opt opt ) = xxk ,w (0), xxk ,w (1), ..., xxk ,w (N − 1), xxk ,w (N) . Department of Electrical, Electronic and Computer Engineering University of Pretoria (3.38) 49 CHAPTER 3 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS The triple (E(·), X f , κ f (·)) is assumed to satisfy the stability conditions A1-A4a. Assume the process is started with an initial state xk ∈ XNol and has an optimal (and by implication a opt opt opt feasible) control sequence {uxk (0), uxk (1), ..., uxk (N − 1)} for the optimal control problem PNol (xk ) that steers the state to within the terminal constraint set X f within N steps or fewer, opt so that xxk ,w (N) ∈ X f , ∀w ∈ W (xk , uopt (xk )). As a result the abbreviated control sequence opt opt opt {uxk (1), uxk (2), ..., uxk (N − 1)} should steer the state xk+1 ∈ F (xk , κN (xk )) to the terminal ol . A problem arises when a constraint set X f within N − 1 steps or fewer, where xk+1 ∈ XN−1 feasible control sequence needs to be generated by adding a term to the abbreviated control sequence ũ(xk ) = opt opt uxk (1), uopt xk (2), ..., uxk (N − 1), v , (3.39) for the optimal control problem PNol (xk+1 ), where the control action v ∈ U is required to opt satisfy f (xxk ,w (N), v, wN ) ∈ XN for all wN ∈ W (xk , uopt (xk )). The stability condition A3a does not ensure that such a control action v can be obtained, which prevents the upper bound opt of the objective function φN (xk+1 ) from being calculated. Michalska and Mayne (1993) circumvent this problem by using a variable horizon optimal control problem P(xk ) with decision variables (uN , N). The optimal solution (uopt (xk ); N opt (xk )) is obtained by solving the optimal control problem P(xk ), where uopt (xk ) = opt opt uxk (0), uopt xk (1; x), ..., uxk (N(xk ) − 1) . For the optimal control problem P(xk+1 ) the solution (u(xk ), N opt (xk ) − 1) is a feasible solution for any xk+1 ∈ X (xk , κN (xk )). The variable horizon objective function φ opt (·) and implicit controller κ ol (·) will ensure that stability condition A4a holds for all xk ∈ Xol N ⊂ N ol X f , ∀w ∈ W (xk , κ (xk )). Inside the terminal constraint set X f , a suitable local controller κ f (·) is used subject to stability conditions A1-A4a. This will result in an asymptotic (exponential) stable controller with domain of attraction Xol N , subject to further modest assumptions (Michalska and Mayne, 1993). 3.4.3 Feedback robust MPC Feedback robust MPC is better suited for uncertain systems than open-loop min-max controllers, because open-loop controllers assume that the trajectories of the system may diverge, which may cause Xol N to be very small, or even empty for a modest-sized prediction horizon N, which is very conservative. This happens because the open-loop min-max controllers do not take the effect of feedback into consideration, which would prevent the trajectories from diverging too much. To address the shortcomings of open-loop min-max control, feedback MPC was proposed by Lee and Yu (1997), Scokaert and Mayne (1998), Magni et al. (2001) and Kothare et al. (1996). In feedback MPC, the control sequence u is replaced by a control Department of Electrical, Electronic and Computer Engineering University of Pretoria 50 CHAPTER 3 ROBUST MPC - STABILITY OF UNCERTAIN SYSTEMS policy π which is a sequence of control laws: π , {u(o), κ1 (·), ..., κN−1 (·)} , (3.40) where κi (·) : X → U is a control law for each i, while u(0) is a control action, because there is only one initial state. The resulting state sequence when applying the sequence of control laws π and starting at the initial state xk subject to the disturbance sequence w is given π,w π,w π,w by xπ,w (xk ) = xxπ,w k (0), xxk (1), . . . , xxk (N − 1), xxk (N) . The objective function for the feedback model predictive controller is φN (xk , π) , max J(xk , π, wN )|wN ∈ WN (xk , π) wN (3.41) and the objective function for each realisation N−1 J(xk , π, wN ) , (i), uπ (i)) + E(xxπ,w (N)), ∑ L(xxπ,w k k (3.42) i=0 π where uπ (i) , κi (xxπ,w k (i)), i = 1, . . . , N − 1 and u (0) = u(0). The admissible set of disturbances, given the control policy π is implemented, is WN (xk , π). The set of admissible control policies that will satisfy the control, state and terminal constraints for all the admissible disturbances with initial state xk , is ΠN (xk ). The set of initial states that can be steered to the terminal constraint set X f by an admissible control policy π in i steps or fewer, is fb Xi , ∀i ≥ 0. The feedback optimal control problem becomes fb opt PN (xk ) : φN (xk ) = min {φN (xk , π)|π ∈ ΠN (xk )} . (3.43) π fb If a solution to PN (xk ) exists, the optimal control policy is π opt (xk ) = n o opt opt opt uopt (0), κ (·), κ (·), ..., κ (·) , xk 1,xk 2,xk N−1,xk (3.44) where the implicit feedback MPC law is fb κN (xk ) , uopt xk (0). (3.45) fb If the stability conditions A1-A4a are satisfied for PN (xk ), a feasible control policy for fb fb fb PN (xk+1 ) for all xk+1 ∈ F (xk , κN (xk )) and xk ∈ XN is π̃(xk , xk+1 ) , n o opt opt κ1,xk (xk+1 ), κ2,xk (·), ..., κN−1,xk (·), κ f (·) . fb (3.46) fb With this feasible control policy, and with XN an invariant set for xk+1 ∈ F (xk , κN (xk )), fb fb assumption A4a will be satisfied for all xk ∈ XN and w ∈ W (xk , κN (xk )). The resulting robust model predictive controller is asymptotically (exponentially) stable with domain of Department of Electrical, Electronic and Computer Engineering University of Pretoria 51 CHAPTER 3 ROBUST NONLINEAR MPC FORMULATIONS fb attraction XN under further modest assumptions. The results are very similar to open-loop fb min-max control, except that the domain of attraction XN includes Xol N and could possibly be much larger. Feedback MPC is encouraging, but suffers from much higher complexity than open-loop min-max control. Other formulations for robust MPC are also provided in Mayne et al. (2000). 3.5 3.5.1 ROBUST NONLINEAR MPC FORMULATIONS Lyapunov-based robust model predictive control Mhaskar and Kennedy (2008) propose a robust model predictive controller for nonlinear systems with constraints on the magnitude of the inputs and uncertainties as well as rate constraints on the inputs. Rate constraints can easily be handled by MPC formulations as soft constraints (Zheng and Morari, 1995), but the effect of rate constraints on stability and guaranteed satisfaction of rate constraints as hard constraints have not been addressed. The proposed formulation can handle rate constraints as soft constraints or as hard constraints when possible with fall-back to soft constraints to maintain feasibility and robust stability. The controller synthesis is Lyapunov-based to allow for explicit characterisation of the initial conditions that guarantee stabilisation, as well as state and control constraint satisfaction (Mhaskar et al., 2005, 2006). The explicit characterisation of the initial conditions is important to ensure that stability is guaranteed, because the stability guarantees rely on stability constraints embedded in the optimisation problem. Guaranteeing stability requires feasibility of the stability constraints, which is assumed by most formulations, not guaranteed (Mhaskar and Kennedy, 2008). Mhaskar et al. (2005) proposes a robust hybrid predictive control structure that acts as a safety net for any other MPC formulation. The other MPC formulations can explicitly take uncertainties into account, but it is not required. The control structure includes a Lyapunovbased robust nonlinear controller developed by El-Farra and Christofides (2003) that has well-defined stability characteristics and constraint-handling properties, but cannot be designed to be optimal to an arbitrary performance function as with MPC. The structure in addition contains switching laws that try to use the performance of MPC as much as possible, but falls back to the Lyapunov robust controller when the MPC fails to deliver a control move, which may be due to computational difficulties or infeasibility, or to instability of the MPC, which may be caused by inappropriate penalties or horizon length in the performance function (Mhaskar et al., 2005). Mhaskar (2006) proposes a robust model predictive controller for nonlinear systems that are subject to constraints and uncertainty and that is robust to faults in the control actuator. Lyapunov-based techniques (El-Farra and Christofides, 2003) are employed to design the robust model predictive controller by formulating constraints that explicitly account for the Department of Electrical, Electronic and Computer Engineering University of Pretoria 52 CHAPTER 3 ROBUST NONLINEAR MPC FORMULATIONS uncertainties in the predictive control law and allow the set of initial conditions to be explicitly characterised that will guarantee constraint satisfaction initially and successive feasibility necessary for robust stability. 3.5.2 Reachable set methods Feedback robust MPC is concerned with bounding the system trajectories to increase the possible domain of attraction compared to open-loop min-max robust MPC. Bravo et al. (2006) present an RNMPC for constrained nonlinear systems with uncertainties. The evolution of the system under uncertainties is predicted by using reachable sets of the system. The reachable sets are approximated by outer bounds on the reachable set. Bravo et al. (2006) use a method based on zonotopes (Alamo et al., 2005) to describe the approximate reachable sets, which improves on a previous formulation by Limon et al. (2005) that used a conservative approximation of the reachable set based on interval arithmetic. The controller drives the system to a robust invariant set and forces the closed-loop system to be bounded by using contractive constraints. 3.5.3 Closed-loop min-max predictive control Closed-loop min-max MPC reduces the conservatism of open-loop min-max MPC by incorporating the effect of feedback at each time-step into the optimisation problem. This limits the spread of the trajectories into the future and increases the feasible region of the controller. This was first proposed by Lee and Yu (1997) and further developed by Lazar et al. (2008), Limon et al. (2006), Magni et al. (2006, 2003). The stability of the closed-loop min-max MPC was studied in the input-to-state stability (ISS) framework (Jiang and Wang, 2001, Sontag, 1989, 1990, 1996) by Limon et al. (2006), Magni et al. (2006), where Limon et al. (2006) showed that in general only input-to-state practical stability (ISpS) (Jiang et al., 1996, Sontag, 1996) can be ensured for min-max nonlinear MPC. It is desirable to have ISS compared to ISpS, because ISpS does not imply asymptotic stability when there are no disturbances on the inputs, while ISS ensures that asymptotic stability will be recovered when the input disturbances vanish. Lazar et al. (2008) proposed a new approach that guarantees ISS for min-max MPC of nonlinear systems with bounded disturbances. 3.5.4 Open-loop min-max predictive control Open-loop min-max MPC of a continuous-time nonlinear system with constraints and uncertainties uses robust nonlinear optimal control at its core. The open-loop optimal control problem is solved for the current state measurement and the first control move implemented. The next state measurement is taken and the nonlinear optimal control problem resolved in a receding horizon fashion that leads to RNMPC. Department of Electrical, Electronic and Computer Engineering University of Pretoria 53 CHAPTER 3 ROBUST NONLINEAR MPC FORMULATIONS In order to solve the continuous-time nonlinear optimal control problem, it should be discretized by casting it into a nonlinear parameter optimisation problem. Continuous-time nonlinear optimal control can be cast into a nonlinear parameter optimisation problem using the direct-multiple shooting formulation (Bock and Plitt, 1984). Robust control can be obtained by performing robust nonlinear parameter optimisation, which is quite difficult to solve in general. Diehl et al. (2006) describes a method of approximating robust nonlinear optimisation through an approximate worst-case formulation. The approximation linearises the uncertainty set, described by norm bounded parameter uncertainty, to obtain penalty functions for the objective function and constraint functions. The penalty functions are further approximated to maintain the sparsity of the large-scale problem as well as the smoothness of the objective and constraints functions, enabling efficient implementation of the resulting approximate robust nonlinear parameter optimisation problem. This formulation can be solved quite efficiently by using a real-time iteration scheme for nonlinear optimisation proposed by Diehl et al. (2005). 3.5.5 Linear embedding of nonlinear models Embedding of the trajectories of the original nonlinear system into a family of linear plants is exploited by some authors to implement robust MPC of even highly nonlinear systems by using linear methods (Casavola et al., 2003). Linear matrix inequality (LMI) based controllers produce feedback policies, which are implemented at each time interval. The problem with these controllers is that they use an ellipsoid invariant set for their domain of attraction, which makes them conservative. This is because the sets must be symmetric, and in systems where the constraints are non-symmetric, the ellipsoid sets will be a small subset of the maximum admissible set. The feedback robust MPC technique was introduced by Kothare et al. (1996). The technique was improved by Cuzzola et al. (2002) by describing the uncertain system as a polytope and applying different Lyapunov functions to each vertex of the uncertain polytope to reduce the conservatism of the method. The method uses semidefinite programming (SDP) to solve the minimisation problem on-line, which is computationally very expensive compared to quadratic programming (QP) used in nominal MPC. Further improvements made by Casavola et al. (2004), Ding et al. (2004), Wan and Kothare (2003) resulted in an attempt to move as much as possible of the calculation offline. Nonlinear systems with uncertainties and constraints can be approximated by radial basis function – auto-regressive with exogenous input (RBF-ARX) models, which are hybrid pseudo-linear time-varying models that contain elements of Gaussian RBF neural network and linear ARX model structures. Peng et al. (2007) used this RBF-ARX model in conjunction with a min-max MPC to do RNMPC. The min-max MPC is based on the LMI-based method proposed in Cuzzola et al. (2002) that falls in the feedback robust MPC framework. An approach to feedback robust MPC is proposed by Langson et al. (2004) who use tubes to Department of Electrical, Electronic and Computer Engineering University of Pretoria 54 CHAPTER 3 NONLINEAR MODEL PREDICTIVE CONTROL encapsulate all the possible states that can result from the controller. If the uncertainties can be sufficiently described, the optimisation problem only has to be calculated once, and the control policy will steer the system to the terminal constraint set X f , where a local stabilising controller will keep the uncertain system in the terminal constraint set. The robust model predictive controllers do not always provide off-set free tracking and this problem is addressed by Wang and Rawlings (2004a, b), who use a robust predictor that updates itself each time measurements are available to ensure that the off-set is eliminated. Pannocchia and co-workers (Pannocchia, 2004, Pannocchia and Kerrigan, 2003, 2005) approached the problem by designing a robust linear feedback controller and an appropriate invariant set where the controller will satisfy the constraints. The controller uses the “prestabilisation” approach suggested by Rossiter et al. (1998) and later implemented by Kouvaritakis et al. (2000), Schuurmans and Rossiter (2000) and Lee and Kouvaritakis (2000), where the feedback law ui (·) in the policy π is restricted to have the form ui (x) = vi + Kx, i = 0, 1, 2, ..., N − 1, that changes the optimisation problem to calculating the free control moves {v0 , v1 , v2 , ..., vN−1 } rather than the policy. The “pre-stabilisation” of the controller in Pannocchia and Kerrigan (2005), however, uses a dynamic state feedback controller, rather than a static state feedback gain to obtain the offset free tracking property. 3.6 NONLINEAR MODEL PREDICTIVE CONTROL NMPC takes a measurement of the current state of the plant and then uses a nonlinear model to predict the future behaviour of the plant in order to calculate the optimal control moves or control laws with regard to a specified objective function. NMPC is derived from nonlinear optimal control over a constant or varying time interval into the future [tk ,tk + T ]. Only the first control move or control law is implemented and a new state measurement is taken. The nonlinear optimal control problem is then recalculated for the new time interval [tk+1 ,tk+1 + T ], which leads to receding horizon control (Mayne et al., 2000). The nonlinear optimal control problem is to find a control profile u(·) such that it minimises a particular scalar performance index min x,u s.t. φc (x, u) (3.47) ẋ(t) = fc (x(t), u(t), p̃) (3.48) θc (x, u) ≤ 0 (3.49) t1 , 0, x1 , x(t1 ) (3.50) t f , T, x f , x(t f ), ψ(x f ) = 0 (3.51) where x : R → Rnx is the state trajectory, u : R → Rnu is the control trajectory, x(t) ∈ Rnx is the state vector, ẋ(t) ∈ Rnx is the state sensitivities to time, u(t) ∈ Rnu is the control vector, x f ∈ Rnx is the terminal state vector, (x, u) 7→ φc (x, u) is the scalar performance function, Department of Electrical, Electronic and Computer Engineering University of Pretoria 55 CHAPTER 3 NONLINEAR MODEL PREDICTIVE CONTROL (x, u) 7→ θc (x, u) is the inequality constraints function, ψ : Rnx → R is the terminal constraint function, p̃ ∈ Rn p is the nominal parameter vector and fc : Rnx × Rnu × Rn p → Rnx is the ordinary differential equation describing the dynamics of the plant. The plant dynamics are time invariant and each optimal control problem can therefore be solved from time t1 = 0 without affecting the result. The initial state value x1 ∈ Rnx is the currently measured state of the system. The final state x f ∈ Rnx will be a fixed value based on the setpoint for the current iteration of the optimisation problem, because the terminal constraints are defined as equality constraints (3.55). The final state value x f may vary from iteration to iteration if setpoint changes are made. The final time t f of the optimisation problem is fixed for this implementation. h iT For the sequel the ordered pair (a, b) , aT bT is defined as a column vector. The nonlinear optimal control problem, consisting of a system with continuous dynamics, needs to be discretized in order to be cast in terms of a nonlinear parameter optimisation problem. This is accomplished by dividing the prediction horizon [0, T ] into N discrete time intervals called nodes (Hull, 1997) t0 , 0 < t1 < t2 < · · · < tk < · · · < tN−1 < tN , T where the sampling time is defined as τs , tk+1 − tk . The functions of time x(·) and u(·) are replaced by their values at the nodes xk ∈ Rnx and uk ∈ Rnu for k = 0, . . . , N and some form of interpolation between the nodes. The resulting nonlinear controlled discrete-time system is xk+1 , fk (xk , uk , p̃), k = 0, 1, . . . , N − 1. The nonlinear optimal control problem can now be cast into the following nonlinear parameter optimisation problem min s,q s.t. φ (s, q) (3.52) g(s, q, p̃) = 0 (3.53) θi, j (s j , q j ) ≤ 0, i = 1, . . . , nc , j = 1, . . . , N − 1, θN (sN ) ≤ 0, (3.54) (3.55) where φ : RN·nx × R(N−1)·nu → R is the performance function to be optimised, g : RN·nx × R(N−1)·nu × RN·n p → RN·nx is the equality constraint function that describes the discrete time system dynamics, θi, j : Rnx × Rnu → R, i = 1, . . . , nc , j = 1, . . . , N − 1 are the inequality constraint functions, θN : Rnx → R is the terminal constraint function, si ∈ Rnx , i = 1, . . . , N are the estimated state parameters, qi ∈ Rnu , i = 1, . . . , N − 1 are the control parameters, p̃ , ( p̃, . . . , p̃) ∈ R(N−1)n p is the sequence of nominal model parameters, s , (s1 , . . . , sN ) is the state sequence and q , (q1 , . . . , qN−1 ) is the control sequence to be optimised in the nonlinear optimisation problem (Diehl et al., 2005). Using only the control moves in the parameter optimisation problem leads to a single integration of the state equations over the time interval [0, T ]. If the time interval is long, the accuracy of the numerical integration is affected. The accuracy of the numerical derivatives Department of Electrical, Electronic and Computer Engineering University of Pretoria 56 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL for a given perturbation size is affected even more. To compensate for this problem, an estimate of the state value xk at each time node is made (represented by sk ) and the system dynamics are integrated between nodes. This method is called direct multiple shooting (Bock and Plitt, 1984, Hull, 1997). The nonlinear optimiser then removes any error between the estimate (sk ) and actual dynamics (xk ) through the equality constraints (3.53). 3.7 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL Plant models always differ from the real system owing to incomplete modelling, parameter uncertainty and unmodelled disturbances. In this section, the NMPC developed earlier in (Coetzee et al., 2008) are robustified to parameter uncertainty, by approximating the worstcase realisations of the objective function and the constraint functions to the parameter variations (Coetzee et al., 2009). The worst-case objective function is then minimised subject to the worst-case constraints. The approximated min-max optimisation problem is called an approximate robust counterpart formulation (Ben-Tal and Nemirovskii, 2001, 2002, Diehl et al., 2006). 3.7.1 Parameter uncertainty description Consider an uncertain parameter vector p ∈ Rn p and nominal parameter vector p̃ ∈ Rn p , which are assumed to be restricted to a generalised ball P = {p ∈ Rn p | kp − p̃k ≤ 1} (3.56) defined by using a suitable norm k·k in Rn p (Diehl et al., 2006). A suitable norm may be the scaled Hölder q-norm (1 ≤ q ≤ ∞), kpk = A−1 pq , with an invertible A ∈ Rn p ×n p matrix. The Hölder q-norm is also suitable for describing box uncertainty where the upper pu and lower pl bounds on the parameters p are known: Pbox , {p ∈ Rn p |pl ≤ p ≤ pu } , ) ( −1 p + p p − p u u l l p− = p ∈ Rn p | diag ≤1 2 2 (3.57) ∞ u where the centre of the box is defined as p̄ , pl +p ∈ Rn p . In general the centre of the box p̄ 2 and the nominal parameter vector p̃ do not have to be the same point ( p̃ 6= p̄). Department of Electrical, Electronic and Computer Engineering University of Pretoria 57 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL The dual norm k·k# for the norm k·k is the mapping k·k# : R(N−1)·n p → R a 7→ kak# , max p∈R(N−1)·n p aT p s.t. kpk ≤ 1, (3.58) and the dual norm k·k∗ for the norm k·k is the mapping k·k∗ : Rn p → R a 7→ kak∗ , maxn aT p s.t. kpk ≤ 1, p∈R p (3.59) It is well known that for any scaled Hölder q-norm kpk = kApkq (A an invertible matrix, q , ∞ and for q = ∞, 1 ≤ q ≤ ∞), the dual norm is kak∗ = A−1 a q (for q = 1, define q−1 q−1 q q−1 define , 1) as observed in the context of the worst-case analysis by Ma and Braatz (2001) and independently by Bock and Kostina (2001). The q-norm k·kq : Rn p −→ R for 1 ≤ q ≤ ∞ is defined as (n kxkq = )1 q p q ∑ |xi| (3.60) i=1 and the case where q = ∞ becomes kxk∞ = max |xi | . 1≤i≤n p 3.7.2 (3.61) Direct approximate robust counterpart formulation To add uncertainty into an optimisation problem, a min-max optimisation can be done (Diehl et al., 2006, Ma and Braatz, 2001). The worst-case value for the cost φ (s, q) is defined as ψ(q) , max s,p s.t. φ (s, q) (3.62) g(s, q, p) = 0 (3.63) and the worst-case values for the constraint functions θi, j (s j , q j ) are defined as ωi, j (q j ) , max s j ,p j s.t. θi, j (s j , q j ) (3.64) gτs (s j , q j , p j ) = 0, (3.65) where gτs : Rnx × Rnu × Rn p → Rnx is the system dynamic for one time step τs , pi ∈ Pbox , i = 1, . . . N −1 are defined as the unknown time varying model parameters and p , (p1 , . . . , pN−1 ) ∈ (N−1) Pbox is defined as the sequence of time varying model parameters. The worst-case cost and constraint functions are calculated by maximising the cost function and constraint funcDepartment of Electrical, Electronic and Computer Engineering University of Pretoria 58 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL (N−1) tions with regard to the model parameter sequence p ∈ Pbox and state values s ∈ R(N·nx ) . The worst-case cost function ψ(q) is then minimised by choosing the control moves q , (q1 , q1 , . . . , qN−1 ) ∈ R((N−1)·nu ) subject to the worst-case constraints ωi, j (q j ) min q s.t. (3.66) ψ(q) ωi, j (q j ) ≤ 0, i = 1, . . . , nc , j = 1, . . . , N − 1. (3.67) This min-max optimisation problem is difficult to solve for general nonlinear systems. The optimisation problem can, however, be simplified by approximating the worst-case calcula tions for the cost ψ̃ (q) and the constraints ω̃i, j q j . The approximate robust counterpart formulation is given by min q s.t. (3.68) ψ̃(q) ei, j (q j ) ≤ 0, ω i = 1, . . . , nc , j = 1, . . . , N − 1, (3.69) where the approximation of the worst-case cost ψ̃ (q) and constraints ω̃i, j (q) can be done through linearisation of the system dynamics g (s, q, p) = 0 and the cost φ (s, q) and constraint θi, j (s j , q j ) functions. The approximation of the worst-case cost, ψ (q) by ψ̃ (s, q), is defined by a convex optimisation problem max ∆s,∆p s.t. ∂φ (s, q)∆s ∂s ∂g ∂g (s, q, p̄) ∆s + (s, q, p̄) ∆p = 0, ∂s ∂p k∆pi k ≤ 1, i = 1, . . . , N − 1, φ (s, q) + (3.70) (3.71) (3.72) and the approximation of the worst-case constraints ωi, j q j by ω̃i, j (s, q) are defined as max ∆s,∆p s.t. ∂ θi, j (s j , q j )∆s ∂s ∂g ∂g (s, q, p̄) ∆s + (s, q, p̄) ∆p = 0, ∂s ∂p ∆p j ≤ 1, j = 1, . . . , N − 1 θi, j (s j , q j ) + (3.73) (3.74) (3.75) where ∆s ∈ R(N·nx ) , p̄ , ( p̄, . . . , p̄) ∈ R(N−1)·n p is a sequence of parameters at the centre of the box, ∆p j , p j − p̄ ∈ Rn p is the deviation of the model parameters from the centre of the box and ∆p , (∆p1 , . . . , ∆pN−1 ) ∈ R(N−1)·n p is defined as the sequence of model parameter deviations. The optimisation problems (3.70)-(3.75) have analytical solutions. The approximation for the worst-case cost can be expressed as Department of Electrical, Electronic and Computer Engineering University of Pretoria 59 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL T −T T ∂g ∂g ∂φ ψ̃ (s, q) = φ (s, q) + − (s, q, p̄) (s, q, p̄) (s, q) ∂p ∂s ∂s (3.76) # and the approximation of the worst-case constraints can be expressed as T −T T ∂ θi, j ∂g ∂g ω̃i, j (s, q) = θi, j (s j , q j ) + − (s, q, p̄) (s, q, p̄) (s j , q j ) (3.77) ∂p ∂s ∂s # where k·k∗ is the dual norm of k·k as described in (3.59). For notational convenience the uncertainty term of (3.76) is defined as T −T T ∂g ∂g ∂φ ∆φ (s, q) , − (s, q, p̄) (s, q, p̄) (s, q) ∂p ∂s ∂s (3.78) # and the uncertainty term for (3.77) is defined as T −T T ∂ θi, j ∂g ∂g (s, q, p̄) (s, q, p̄) (s j , q j ) ∆θi, j (s, q) , − ∂p ∂s ∂s (3.79) # The approximate robust counterpart of (3.68)-(3.69) can now be expressed as min s,q s.t. φ (s, q) + ∆φ (s, q) (3.80) θi, j (s j , q j ) + ∆θi, j (s, q) ≤ 0, i = 1, . . . , nc , j = 1, . . . , N − 1, g(s, q, p̄) = 0 (3.81) (3.82) In order to solve this approximate min-max optimisation problem (3.68)-(3.69) efficiently, new optimisation variables D ∈ R(N·nx )×n pare defined (Diehl et al., 2006) in the form of a −1 ∂g sensitivity matrix D , (D1 , D2 , . . . , DN ) = − ∂∂ gs (s̄, q, p̄) ∂ p (s̄, q, p̄) to prevent the explicit calculation of the matrix inverse in (3.78) and (3.79), which would reduce the sparsity of the problem. The direct approximate robust counterpart formulation becomes min s,q,D T T ∂φ φ (s, q) + D (s, q) ∂s (3.83) # s.t. g(s, q, p̄) = 0, ∂ g(s, q, p̄) ∂ g(s, q, p̄) D+ = 0, ∂s ∂p T i = 1, . . . , nc , T ∂ θi, j θi, j (s j , q j ) + D j (s j , q j ) ≤ 0, ∂sj j = 1, . . . , N − 1, ∗ θN (sN ) ≤ 0. Department of Electrical, Electronic and Computer Engineering University of Pretoria (3.84) (3.85) (3.86) (3.87) 60 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL In order to maintain smooth objective and constraint functions in the optimisation problem, slack variables δ , (δ0,1 , . . . δnc ,1 , . . . , δnc ,N−1 ), δi, j ∈ R, i = 0, . . . , nc , j = 1, . . . , N − 1 are introduced to replace the dual norms in the optimisation problem (3.83)-(3.87) (Diehl et al., 2006). The nonlinear parameter optimisation problem that is solved at each time step is given by min s,q,D,δ s.t. φ (s, q) + eT δ0,1 + · · · + eT δ0,N−1 (3.88) g(s, q, p̄) = 0, ∂ g(s, q, p̄) ∂ g(s, q, p̄) D+ = 0, ∂s ∂p T ∂φ T −δ0, j ≤ D j (s, q) ≤ δ0, j , j = 1, . . . , N, ∂sj (3.89) i = 1, . . . , nc , j = 1, . . . , N − 1, T i = 1, . . . , nc , T ∂ θi, j (s j , q j ) ≤ δi, j , −δi, j ≤ D j ∂sj j = 1, . . . , N − 1, θi, j (s j , q j ) + eT δi, j ≤ 0, θN (sN ) ≤ 0. (3.90) (3.91) (3.92) (3.93) (3.94) where e , (1, . . . , 1) ∈ Rn p (Diehl et al., 2006, 2005). 3.7.3 RNMPC implementation For implementation of the RNMPC, the scalar performance function and the discrete time system dynamics function need to be defined. The scalar performance function is defined as N−1 φ (s, q) , ∑ Li(si, qi) + E(sN ) (3.95) i=1 where the scalar interval performance indexes and the terminal performance index are defined as quadratic functions Li (si , qi ) , h(si , qi )T Qh(si , qi ) + ∆qTi R∆qi E(sN ) , sTN PsN , (3.96) (3.97) where Q and R represent the weighting matrices on the outputs and controls respectively, h : Rnx × Rnu → Rny is the function that maps the current state and control vector to the output vector using nominal model parameters, ∆qi , qi − qi−1 and P is the terminal cost weighting matrix. Department of Electrical, Electronic and Computer Engineering University of Pretoria 61 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL The equality constraint function describing the discrete time system dynamics is defined as xk − s1 , f1 (s1 , q1 , p1 ) − s2 , g(s, q, p) , .. . fN−1 (sN−1 , qN−1 , pN−1 ) − sN . (3.98) where fi (si , qi , pi ), i = 1, . . . , N −1 are defined as the function values at the nodes for the continuous time dynamics ẋ = fc (x(t), u(t), p(t)). The interpolation between nodes is defined as integrating the state equations for one sample time τs xk+1 , fk (xk , uk , pk ) ˆ tk +τs =tk+1 fc (x, uk , pk ) dt , (3.99) tk with initial conditions x(tk ) , xk = sk and the controls uk = qk constant over the interval [tk ,tk+1 ]. The integration of the state equations can be done with a software package called CPPAD (Lougee-Heimer, 2003). CPPAD is also capable of calculating sensitivities of the integral. This is useful for calculating the sensitivities of the system dynamics fk (xk , uk , pk ) with regard to states sk , inputs qk and parameters pk . It is also capable of calculating second order derivatives of the integral. CPPAD does automatic differentiation of specially modified C++ code. It works by recording all the mathematical operations being done in the desired function and then uses the chain rule of differentiation to calculate the derivatives. The advantages of automatic differentiation are that it is fast to calculate and does not suffer from truncation errors present in other numerical methods. CPPAD also contains a module to solve ordinary differential equations (ODEs) with the Runge-Kutta method that is required to integrate the state equations. The derivatives of the integral are then calculated by automatic differentiation. Nonlinear optimisation software is required to solve the nonlinear parameter optimisation problem stated in (3.88)-(3.94). The software used is a package called IPOPT (Kawajir et al., 2006), which is useful when solving large-scale sparse nonlinear optimisation problems. IPOPT requires the following functions to be provided: • Scalar performance function value ϕ(X) • Gradient of the performance ∇ϕ(X) • Constraint functions values ϑ (X) • Jacobian of the constraints ∇ϑ (X) where X is the vector of all decision variables. Department of Electrical, Electronic and Computer Engineering University of Pretoria 62 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL For the problem specified in (3.88)-(3.94), the vector of decision variables is defined as X , (s1 , q1 , D1 , δ0,1 , . . . , δnc ,1 , . . . , sN−1 , qN−1 , DN−1 , δ0,N−1 , . . . , δnc ,N−1 , sN , DN ) (3.100) where X ∈ R((nx +nu +nD +nslack )·(N)+nx +nD ) , nD , nx × N and nslack , (nc + 1) × n p . All matrix variables in X are unrolled into vectors to simplify implementation. The matrix is unrolled by placing the rows of the matrix sequentially to form a vector. The scalar performance function is defined in terms of the decision variables X as N−1 ϕ(X) , ∑ Li (si , qi ) + eT δ0,i + E(sN ) (3.101) i=0 where the scalar interval performance indexes and the terminal performance index are the same as in (3.96) and (3.97). The gradient of the performance function ∇ϕ(X) ∈ R((nx +nu +nD +nslack )·N+nx +nD ) then becomes 2Qs1 2Rq1 0 nD 1n p 0 nc ·n p .. . ∇ϕ(X) = 2QsN−1 . (3.102) 2Rq N−1 0nD 1 np 0nc ·n p 2Ps N 0nD where 0n , (0, . . . , 0) ∈ Rnx and 1n , (1, . . . , 1) ∈ Rnx . The values of the constraint functions ϑ (X) are interleaved equality and inequality constraint functions with the same decision variables that will result in a Jacobian of the constraints ∇ϑ (X) that is sparse and banded. For RNMPC, the following structure for the constraints Department of Electrical, Electronic and Computer Engineering University of Pretoria 63 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL function ϑ (X) ∈ R((nx +nD +nc +2·nslack )·N+nx +nD ) is defined ϑ1 (X) ϑ2 (X) .. . ϑ (X) , ϑ N−1 (X) ϑN (X) (3.103) where ϑ1 (X) , xk − s1 −Inx D2 + 0 θ1,1 (s1 , q1 ) + eT δ1,1 .. . θnc ,1 (s1 , q1 ) + eT δnc ,1 T DT2 ∂∂ Ls 1 (s1 , q1 ) − δ0,1 T 1 T D2 ∂∂ Ls 1 (s1 , q1 ) + δ0,1 T 1 ∂θ T D2 ∂ s1,1 (s1 , q1 ) − δ1,1 T 1 ∂θ T D2 ∂ s1,1 (s1 , q1 ) + δ1,1 1 .. . T ∂θ DT2 ∂ nsc ,1 (s1 , q1 ) − δnc ,1 1 T ∂θ T D2 ∂ nsc ,1 (s1 , q1 ) + δnc ,1 , (3.104) 1 Department of Electrical, Electronic and Computer Engineering University of Pretoria 64 CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL fi−1 (si−1 , qi−1 , p̄) − si ! ∂ fi−1 (si−1 ,qi−1 , p̄) · D − i−1 ∂ si−1 ,qi−1 , p̄) Inx · Di + ∂ fi−1 (si−1 ∂ p θ1,i (si , qi ) + eT δ1,i .. . θnc ,i (si , qi ) + eT δnc ,i T DT ∂ Li (s , q ) − δ0,i i+1 ∂ si i i T ϑi (X) , DTi+1 ∂∂θs1,i (si , qi ) − δ1,i i .. . T DTi+1 ∂ θnc ,i (si , qi ) − δnc ,i ∂s i T ∂ Li DT (s , q ) + δ0,i i+1 ∂ si i i T ∂θ DTi+1 ∂ s1,ii (si , qi ) + δ1,i .. . T ∂ θnc ,i T Di+1 ∂ si (si , qi ) + δnc ,i , ∀i = 2, . . . , N − 1, fN−1 (sN−1 , qN−1 , p̄) − sN ∂ fN−1 (sN−1 ,qN−1 , p̄) · DN−1 − ∂ sN−1 ∂ fN−1 (sN−1 ,qN−1 , p̄) Inx · DN + ∂p ϑN (X) , (3.105) ! . (3.106) which results in a Jacobian of the constraints function ∇ϑ (X) ∈ Rnjac_row ×njac_col where njac_row , ((nx + nD + nc + 2 · nslack ) · N + nx + nD ) and njac_col , ((nx + nu + nD + nslack ) · N + nx + nD ), with a block structure defined in Figure 3.1. The blocks lie on the diagonal of the Jacobian matrix ∇ϑ1 (X) 0 0 0 0 ∇ϑ2 (X) 0 0 ∇ϑ (X) = (3.107) ... 0 0 0 0 0 0 ∇ϑN−1 (X) where the first 2 × 3 entries of each block are the same entries as the last 2 × 3 entries of the previous block. IPOPT only requires the non-zero entries to be populated for this sparse Jacobian matrix. The number of non-zero entries for this structure is defined as nnz , N (nx + nx (nx + nu )) + N (nD (2nx + nu + 1)) + N (nc (nx + 2nu + N)) + 2N (nslack (2nx + 2nu + 1)) + nx + nD − nc · nu − 2 · nslack · nu All the sensitivities and second-order derivatives as shown in the constraints (3.104)-(3.106) and Jacobian of the constraints (Figure 3.1) are also calculated by CPPAD (Lougee-Heimer, 2003). Department of Electrical, Electronic and Computer Engineering University of Pretoria 65 0 0 ∂p ∂ qi −Inx 0 ∂p ∂ si ∂ θ1,i (si ,qi ) ∂ θ1,i (si ,qi ) ∂ si ∂ qi ∂ θ2,i (si ,qi ) ∂ θ2,i (si ,qi ) ∂ si ∂ qi .. .. . . ∂ θnc ,0 (si ,qi ) ∂ θnc ,i (si ,qi ) ∂ si ∂ qi T ∂ DT ∂ Li (s ,q )T ∂ Li T ∂ D i+1 ∂ si i i i+1 ∂ si (si ,qi ) ∂ qi ∂ s0 T T ∂θ ∂ θ1,i T T ∂ Di+1 ∂ s (si ,qi ) ∂ Di+1 ∂ s1,i (si ,qi ) i i ∂ si ∂ qi .. .. . . T T ∂ θ ∂ θ n ,i n ∂ DT T c (s ,q ) c ,i (s ,q ) ∂ D i i i i i+1 i+1 ∂ si ∂ si ∂ si ∂ qi T ∂ DT ∂ Li (s ,q )T ∂ Li T ∂ D i+1 ∂ si (si ,qi ) i+1 ∂ si i i ∂ si T ∂ qi T ∂ θ1,i ∂θ T T ∂ Di+1 ∂ s (si ,qi ) ∂ Di+1 ∂ s1,i (si ,qi ) i i ∂ s ∂ q i i .. .. . . T T ∂ θnc ,i ∂ DT ∂ θnc ,i (si ,qi ) T ∂ D (s ,q ) i i i+1 i+1 ∂ si ∂ si ∂ s ∂ q i i ∂ fi (si ,qi , p̄) ∂ fi (si ,qi , p̄) ∂ f (s ,q∂ q, p̄)i ∂ f (s ,q∂ s, ip̄) ∂ i ∂is i ·Di ∂ i ∂is i ·Di i i + + ∂q ∂s ∂ ∂ fi (si i ,qi , p̄) ∂ ∂ fi (sii ,qi , p̄) ∂ Department of Electrical, Electronic and Computer Engineering University of Pretoria 0 0 In p 0 .. . 0 0 0 0 0 .. . 0 0 0 0 0 0 0 0 .. . 0 In p .. . 0 0 1Tnp 0 0 0 0 0 In p 0 .. . 0 .. . 0 0 .. . 0 0 0 .. . 0 0 0 .. . 0 0 0 0 0 −Inx 0 0 0 .. . 0 0 −In p 0 0 .. . 0 .. . 0 0 .. . 0Tnp .. . 0 0 0 0 0 0 0Tnp 0 0 0 .. . 0 0Tnp . . . Figure 3.1: Jacobian block. ∂ Di 0 0 −In p .. . 0 .. . 0 .. . ∂ fi (si ,qi , p̄) ·Di ∂ si 0 .. . 0 −In p 0 0 0 0Tnp 0Tnp 0 0 1Tnp . . . .. . . . . 0Tnp .. . 0Tnp .. . 0 0 ... 0 ... 0Tnp . . . 0 0 1Tnp 0 0 0Tnp 0 −InD 0 ∇ϑi (X) = i T i T ∂ Di+1 ∂ Li (si ,qi ) ∂s ∂ θnc ,i (si ,qi ) ∂ si .. . ∂ Di+1 ∂ DTi+1 T −InD 0 ∂ Di+1 ∂ θnc ,i (si ,qi ) ∂ si .. . ∂ Di+1 i ∂ Di+1 T ∂θ T ∂ Di+1 ∂ s1,i (si ,qi ) ∂ DTi+1 ∂ DTi+1 0 T ∂ Li (s ,q ) ∂ si i i ∂ Di+1 T ∂ θ1,i (s ,q ) i i ∂s ∂ DTi+1 ∂ DTi+1 0 .. . 0 0 0 (3.108) CHAPTER 3 ROBUST NONLINEAR MODEL PREDICTIVE CONTROL 66 CHAPTER 3 3.8 STATE OBSERVERS STATE OBSERVERS Some mathematical models of plants use state-space descriptions. State-space description of plant make practical control difficult, because it is not usually possible to measure all the states in the model and some sort of reconstruction of the states from the available measurements is needed. An observer can be constructed from a mathematical model of the plant to estimate the states from the available measurements (Marquez and Riaz, 2005). The milling circuit is described mathematically by nonlinear state-space models in Section 2.3.4. Observers were not used in this thesis and only a quick overview is provided here for completeness. State observers for nonlinear system are more challenging than for linear systems, because the separation principle does not apply in general for nonlinear system (Freeman, 1995), where the separation principle states that a stable controller and a stable observer can be designed independently for a plant and the combined closed-loop system will be stable. Atassi and Khalil (1999, 2000) showed that high-gain observers can be constructed for certain classes of nonlinear systems that maintain the separation principle. Some possible observers that can be used for nonlinear systems with robustness to model mismatches are input-output observers (Marquez and Riaz, 2005), robust H∞ observers based on LMI for nonlinear systems with time-varying uncertainties (Abbaszadeh and Marquez, 2009), sliding mode observers (Bartolini et al., 2003, Davila et al., 2005, Spurgeon, 2008, Xiong and Saif, 2001), high gain observers (Atassi and Khalil, 2000) and moving horizon estimators or moving horizon state observers (Chu et al., 2007, Michalska and Mayne, 1995, Rao et al., 2003). Sliding mode observers have received much attention recently, because: “Sliding mode observers have unique properties, in that the ability to generate a sliding motion on the error between the measured plant output and the output of the observer ensures that a sliding mode observer produces a set of state estimates that are precisely commensurate with the actual output of the plant. It is also the case that analysis of the average value of the applied observer injection signal, the so-called equivalent injection signal, contains useful information about the mismatch between the model used to define the observer and the actual plant. These unique properties, coupled with the fact that the discontinuous injection signals which were perceived as problematic for many control applications have no disadvantages for software-based observer frameworks, have generated a ground swell of interest in sliding mode observer methods in recent years.” (Spurgeon, 2008) and “For both relatively general non-linear system representations and also application specific models with significant nonlinearity sliding mode observers are seen to be at the forefront of robust techniques for state and parameter estimation.” (Spurgeon, 2008) Moving horizon estimators (MHE) or moving horizon state observers (MHSO) provide a very close parallel to MPC controllers (Chu et al., 2007). It uses a moving window of Department of Electrical, Electronic and Computer Engineering University of Pretoria 67 CHAPTER 3 CONCLUSION previous measurements to obtain an estimate of the current state of the system (Rao et al., 2003). It can handle nonlinear systems and inequality constraints on the decision variables explicitly (Rao et al., 2003). Recently, Chu et al. (2007) proposed a refinement to MHSOs that allow MHSOs to handle model uncertainty in addition to external disturbances in a robust manner to produce a robust moving horizon state observer (RMHSO). The RMHSO can possibly be combined with the RNMPC of Section 3.7 to obtain an output-feedback RNMPC (Michalska and Mayne, 1995). 3.9 CONCLUSION This chapter outlines the development of MPC and stability theory for MPC. The stability theory focuses on the requirements for exponential stability, while some control formulations are based on other stability formulations such as Lyapunov, asymptotic, ISS and ISpS. It outlines the RNMPC theory (Section 3.7) that will be applied to the nonlinear model presented in Section 2.3.4. Simulation results of the RNMPC applied to the nonlinear milling circuit model are provided in Chapter 5 for different operational conditions. Department of Electrical, Electronic and Computer Engineering University of Pretoria 68 CHAPTER 4 PID CONTROL The PI controllers presented in this chapter serve only as an example implementation to provide a baseline for comparison with RNMPC and NMPC. Single-loop PI controllers without a MIMO compensator or a centralised design were used, because more than 60% of all respondents still use PI controllers, according to a recent survey by Wei and Craig (2009), usually single-loop PI controllers. A decentralised PID controller design that takes interaction into account was attempted in Addendum C. The PI controllers presented here are not intended to serve as the best PI controller design for the presented milling circuit based on an exhaustive study, because that was not the main focus of this thesis. The comparison of the RNMPC and NMPC controllers to the PI controllers should, therefore, not be seen as a definitive, but rather serve as an example of possible benefits that RNMPC can provide over PI control typically employed in industry (Wei and Craig, 2009), when large feed disturbances are common in the milling circuit. 4.1 INTRODUCTION PID control is a fundamental feedback control method employed broadly in process control. PID control usually forms the lowest level of control with multi-variable controllers such as MPC providing the setpoints for the PID controllers. PID control can be described in the time domain by the following algorithm ˆ de(t) 1 t e(t)dτ + Td u(t) = K e(t) + Ti 0 dt (4.1) where the error is defined as the difference between the plant output and the setpoint (e(t) := y(t) − r(t)). The transfer function form of the PID controller is given by U(s) 1 = C parallel (s) = K 1 + + sTd Y (s) sTi Department of Electrical, Electronic and Computer Engineering University of Pretoria (4.2) 69 CHAPTER 4 PI CONTROL WITH ANTI-WINDUP where K is the gain, Ti the integral time and Td the derivative time. The PID form in (4.2) is known as the parallel (“ideal”, “non-interacting”) form. The tuning rules based on the IMC principle developed by Skogestad (2003) uses the series (cascading, “interacting”) form given by τI s + 1 U(s) = Cseries (s) = Kc · (τD s + 1) (4.3) Y (s) τI s where Kc is the proportional gain, τI is the integral time and τD the derivative time for the series form of the controller. The parameters from the series form can be converted to the parallel form by τD K = Kc 1 + τI τD Ti = τI 1 + τI τD Td = 1 + ττDI (4.4) The two transfer functions (equation (4.2) and (4.3)) describing the PID controller are improper. If the closed-loop transfer function is also improper, a suitable order filtering term should be added to the denominator to produce a proper closed-loop transfer function. 4.2 PI CONTROL WITH ANTI-WINDUP The derivative term in PID control allows the controller to react quickly to sudden changes in the process. The derivative term of the PID controller acts on process noise as if the process is changing rapidly, which causes undesirable closed-loop behaviour. Industry therefore usually only employs PI control rather than full PID control, because the derivative term is so sensitive to noise. The rest of this chapter will therefore focus only on PI control. Windup in PI/PID control is when there is saturation of the control action that prevents the control error from reaching zero. This will cause the integrator value to keep on increasing/decreasing in an effort to eliminate the control error. If the plant output passes the setpoint value, the sign of the error will change, but the integrator value has to wind down before normal operation can resume. Anti-windup therefore forces the integrator input to zero when saturation occurs to prevent it from winding up (Åström, 2002). In Figure 4.4 the input to the integrator is the control error multiplied by the integrator gain K e Ti where e is the control error, but if the error cannot vanish due to saturation on the control, the integrator value will keep increasing. To prevent windup, a second control loop is added Department of Electrical, Electronic and Computer Engineering University of Pretoria 70 CHAPTER 4 LINEARISED MODELS FOR SIMC TUNING METHOD to the integrator input (Åström, 2002) K 1 e + es Ti Tt where es is the error between the desired control action v and the saturated control action u and Tt is the tracking time constant that controls how fast the controller resets after saturation. When the control action u saturates, the error eS equals the control error e es = − KTt e Ti (4.5) that results in the desired control action value that settles at v = ulim + KTt e Ti (4.6) which is slightly higher than the saturation value and prevents the integrator from winding up. The smaller Tt is, the faster the integrator resets and the quicker the controller can react to a change in error. The tracking time constraint should ideally be chosen to be larger than √ Td and smaller than Ti and as a rule of thumb can be chosen to be Tt = Ti Td (Åström, 2002). Implementing anti-windup for PID is defined for the parallel form and the controller structure is shown in Figure 4.4. 4.3 LINEARISED MODELS FOR SIMC TUNING METHOD Linearised models are necessary to design the PI controllers using the SIMC method. Linearised models can be created by performing step tests on the nonlinear model and performing system identification (SID) on the step responses. The output-input pairings for single-loop controllers on multivariable systems are very important, because the output should be paired with the input that has the most influence on that output and the input should have the least interaction with other outputs. The traditional output-input pairings used on milling circuits are LOAD-MFS, PSE-SFW and SLEV-CFF (Chen et al., 2007b, Conradie and Aldrich, 2001, Lynch, 1979, Napier-Munn and Wills, 2006). This pairing is not without its problems when used on industrial plants, as described by Chen et al. (2007b): “Decoupled PID control had been frequently interrupted by changes in mineral ore hardness, feed rate, feed particle size, etc., ...” This statement was supported by preliminary simulations using the above-mentioned pairing where the sump would either overflow or underflow as soon as ore hardness and composition disturbances were introduced. Craig and MacLeod (1996) also found SLEV control to be the most problematic aspect of controlling the milling circuit. Department of Electrical, Electronic and Computer Engineering University of Pretoria 71 CHAPTER 4 LINEARISED MODELS FOR SIMC TUNING METHOD An alternative output-input pairing was then investigated that paired LOAD-MFS, PSE-CFF and SLEV-SFW (Smith et al., 2001). The pairing of SLEV-SFW, rather than PSE-SFW and SLEV-CFF, was traditionally used only when a fixed speed sump discharge pump was available (Lynch, 1979). The pairing LOAD-MFS, PSE-CFF and SLEV-SFW, however, shows much better robustness to the feed disturbances subject to actuator limitations, as shown later in Section 5.3.2 and Addendum B. The single-loop PI controllers are designed with the above-mentioned output-input pairings. The interactions between loops are ignored, because they cannot be included in the PI controller design using the SIMC tuning method, unlike other methods (Pomerleau et al., 2000). The PI controllers are SISO controllers and the three controlled variables (PSE, LOAD and SLEV) will be independently controlled by three independent PI loops. Neither a multivariable compensator (Vázquez and Morilla, 2002) nor a centralised design (Morilla et al., 2008) will be used for the PI controllers, because most plants that use PI controllers employ only single-loop PI controllers (Wei and Craig, 2009). An attempt at decentralised PID tuning that takes interactions into account was made in Addendum C. 4.3.1 PSE – CFF model PSE exhibits a non-minimum phase first order response with time-delay to a change in CFF. A first order transfer function model was fitted to the step response data that has the following form: (1 + ZPC s) (−θPC s) e (1 + PPC s) (1 − 0.63s) (−0.011s) e GPSE-CFF (s) = −0.00035 (1 + 0.54s) GPSE-CFF (s) = KPC (4.7) (4.8) The model form was changed to include a zero in order to improve the fit of the linear model to the step response data of the nonlinear model. The step response data for the model fitting as well as the comparison between the linear and nonlinear models are shown in Figure 4.1. The linear model for PSE-CFF shows good agreement with the nonlinear model response. 4.3.2 LOAD – MFS model The mill load volume exhibits an integrating response to the feed-rate of ore. An integrator transfer function model is fitted to the step test data of the nonlinear model with the following form: KLF s 0.01 GLOAD-MFS (s) = s GLOAD-MFS (s) = Department of Electrical, Electronic and Computer Engineering University of Pretoria (4.9) (4.10) 72 CHAPTER 4 LINEARISED MODELS FOR SIMC TUNING METHOD −4 Step Test Data PSE−CFF PSE 0.802 6 x 10 Measured and simulated 4 0.8 2 0.798 0 5 10 15 20 −2 444 CFF 0 443 −4 442 −6 441 0 5 10 Time (hour) 15 20 −8 14 (a) PSE vs CFF 16 18 Time (hour) 20 (b) Nonlinear vs Linear model Figure 4.1: The change in PSE with a step change in CFF. The nonlinear (solid line) model is compared to the linear model (dashed line). −3 Step Test Data Mill Load to Feed Flow−Rate LOAD 15 x 10 Measured and simulated 0.46 0.45 0.44 10 0 5 10 15 20 5 MFS 39 38 0 37 36 0 5 10 Time (hours) 15 20 −5 14 (a) LOAD vs MFS 16 18 Time (hour) 20 (b) Nonlinear vs Linear Model Figure 4.2: The change in LOAD with a step change in MFS. The nonlinear (solid line) model is compared to the linear model (dashed line). The step response data for the model fitting, as well as the comparison between the linear and nonlinear models, are shown in Figure 4.2.The linear model for PSE-CFF shows good agreement with the nonlinear model response. 4.3.3 SLEV – SFW model The sump level exhibits an integrating response to the flow-rate of water added to the sump. An integrator transfer function model is fitted to the step test data of the nonlinear model with the following form: KSW s 0.42 GSLEV-SFW (s) = s GSLEV-SFW (s) = Department of Electrical, Electronic and Computer Engineering University of Pretoria (4.11) (4.12) 73 CHAPTER 4 SIMC TUNING METHOD Measured and simulated SLEV Step Test Data SLEV−SFW 5 0.6 4 0.4 3 2 0.2 0 5 10 15 20 0 −0.2 SFW 268 267 −0.4 266 −0.6 265 0 5 10 Time (hour) 15 −0.8 14 20 (a) SLEV vs SFW 16 18 Time (hour) 20 (b) Nonlinear vs Linear Model Figure 4.3: The change in SLEV with a step change in SFW. The nonlinear (solid line) model is compared to the linear model (dashed line). The step response data for the model fitting, as well as the comparison between the linear and nonlinear models, are shown in Figure 4.3. The linear model for PSE-CFF shows good agreement with the nonlinear model response. 4.4 SIMC TUNING METHOD SIMC is a model-based tuning method with only a single tuning parameter for the closedloop response. It is based on the IMC method. The PID parameter settings for the SIMC-PID method (Skogestad, 2003) are given in Table 4.1. The method tries to obtain a first-order closed loop response with time delay of the form y r desired = 1 e−θ s τc s + 1 (4.13) where τc is the desired closed-loop time constant, which is the only tuning parameter. If the process models are not in the forms given in Table 4.1, then they should be manipulated to conform to the basic forms given in Table 4.1 using the rules given below. Only the rules from Skogestad (2003) that apply to the linear models of Section 4.3 are given below. 4.4.1 Simplifying first-order transfer function models Skogestad (2003) developed simplification rules to get almost any arbitrary transfer function model into either a first-order transfer function model with time delay or a second order model with time delay. Only the rules that apply to the linear models obtained in Section 4.3 will be given here. The first-order linear model for the PSE-CFF loop contains a negative numerator time constant relating to a non-minimum phase zero. This is cast into the first-order response of Department of Electrical, Electronic and Computer Engineering University of Pretoria 74 CHAPTER 4 IMPLEMENTATION Table 4.1: SIMC-PID settings with τc as a tuning parameter for the serial form of the PID controller (from Skogestad (2003)). Process g(s) Kc τi τD −θ s 1 τi k τc +θ 1 1 k τc +θ k (τe s+1) First-order Integrating k 1 e−θ s s min {τ1 , 4 (τc + θ )} — 4 (τc + θ ) — Actuator Model with saturation R+ Σ V E U Actuator Σ K Y K Ti - 1 s Σ 1 Tt Σ + Es Figure 4.4: PI Controller with Anti-Windup (from Åström (2002)). Table 4.1 by subtracting the value of the negative numerator time constant from the time delay to obtain the effective first-order time delay (Skogestad, 2003). To illustrate the simplification, start with a first-order transfer function model with time delay of the following form (1 + Zs) −θ s Gfo = K · e , (4.14) (1 + Ps) and define the effective time delay as θeffective := θ − Z. (4.15) Applying the effective time delay to the transfer function model in (4.14) gives the equivalent first-order transfer function model Gfo-eq = K · 4.5 1 e−θeffective s . (1 + Ps) (4.16) IMPLEMENTATION The PI parameter values are obtained from Table 4.1 using the simplified models obtained by following the rules outlined above. The PI parameter values are for the serial form of the Department of Electrical, Electronic and Computer Engineering University of Pretoria 75 CHAPTER 4 IMPLEMENTATION controller as well as the parallel form, because there is no differential term. The structure of the anti-windup PI controller is shown in Figure 4.4. 4.5.1 PI controller for the PSE-CFF loop The PSE-CFF loop is characterised by a first-order transfer function model with time delay. The model is derived in Section 4.3.1 and given by (1 + ZPC s) (−θPC s) e (1 + PPC s) (1 − 0.63s) (−0.011s) e GPSE-CFF (s) = −0.00035 (1 + 0.54s) GPSE-CFF (s) = KPC (4.17) (4.18) with the effective time delay given by θPC-EFF = θPC − ZPC (4.19) = 0.01 + 0.63 (4.20) = 0.64 (4.21) to give the equivalent first-order model 1 e(−θPC-EFF s) (1 + PPC s) 1 = −0.00035 e(−0.64s) (1 + 0.54s) GPSE-CFF-EQ (s) = KPC (4.22) (4.23) that gives the following PI parameter values by using the rules of Table 4.1 Kc = −1187, τi = 2.6, τd = 0. 4.5.2 (4.24) PI controller for the LOAD-MFS loop The LOAD-MFS loop is characterised by an integrating transfer function model. The model is derived in Section 4.3.2 and given by KLF s 0.01 GLOAD-MFS (s) = s GLOAD-MFS (s) = (4.25) (4.26) that gives the following PI parameter values by using the rules of Table 4.1 Kc = 10000, τi = 0.04, τd = 0. Department of Electrical, Electronic and Computer Engineering University of Pretoria (4.27) 76 CHAPTER 4 SUMMARY Table 4.2: Parameters of the three PI Controllers Process g(s) k τ1 θ Kc τi e−θ s PSE-CFF k (τ s+1) −0.00035 0.54 0.64 −1187 2.6 1 k 0.42 — — 238 0.04 SLEV-SFW s k LOAD-MFS 0.01 — — 10000 0.04 s 4.5.3 τD — — — PI controller for the SLEV-SFW loop The SLEV-SFW loop is characterised by an integrating transfer function model. The model is derived in Section 4.3.3 and given by KSW s 0.42 GSLEV-SFW (s) = s GSLEV-SFW (s) = (4.28) (4.29) that gives the following PI parameter values by using the rules of Table 4.1 Kc = 238, τi = 0.04, τd = 0. 4.6 (4.30) SUMMARY A tuning method for PI control with anti-windup is provided in this chapter. Linearised models are derived from the nonlinear model of Mintek by conducting step tests on the nonlinear model and fitting it to models with relevant forms. PI controllers are designed for the linear models derived in Section 4.3 and some models are further simplified in Section 4.5 before obtaining the PI controller parameters from Table 4.1. The PI controllers are applied to the nonlinear model presented in Section 2.3.4 and the results of the simulations are given in Chapter 5.1 for comparison to the simulations of the robust nonlinear model predictive controller presented in Section 3.7. The three loops with their model and controller parameters are summarised in Table 4.2. Department of Electrical, Electronic and Computer Engineering University of Pretoria 77

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement