Model Predictive Control for Nonlinear Sampled-data Systems

Summary. The topic of this paper is a new model predictive control (MPC) approach for the sampled–data implementation of continuous–time stabilizing feedback laws. The given continuous–time feedback controller is used to generate a reference trajectory which we track numerically using a sampled-data controller via an MPC strategy. Here our goal is to minimize the mismatch between the reference solution and the trajectory under control. We summarize the necessary theoretical results, discuss several aspects of the numerical implemenation and illustrate the algorithm by an example.


Introduction
Instead of designing a static state feedback with sampling and zero order hold by designing a continuous-time controller which is stabilizing an equilibrium and discretizing this controller ignoring sampling errors which leads to drawbacks in stability, see [5,8], our approach is to use a continuous-time feedback and to anticipate and minimize the sampling errors by model predictive control (MPC) with the goal of allowing for large sampling periods without loosing performance and stability of the sampled-data closed loop.Therefore we consider two systems, the first to be controlled by the given continuous-time feedback which will give us a reference trajectory, and a second one which we are going to control using piecewise constant functions to construct an optimal control problem by introducing a cost functional to measure and minimize the mismatch between both solutions within a time interval.In order to calculate a feedback instead of a time dependent control function and to avoid the difficulties of solving a Hamilton-Jacobi-Bellman equation for an infinite horizon problem we reduce the infinite time interval to a finite one by introducing a positive semidefinite function as cost-to-go.To re-gain the infinite control sequence we make use of a receding horizon technique.
For this approach we will show stability and (sub-)optimality of the solution under certain standard assumptions.We will also show how to implement an algorithm to solve this process of iteratively generating and solving optimal control problems.The latter one is done using a direct approach and full discretization that will give us one optimization problem per optimal control problem which can be solved using an SQP method.Therefore in Section 2 the problem, the necessary assumptions and our control scheme will be presented.In Section 3 we review the theoretical background results about stability and inverse optimality from [13].Having done this the numerical implementation will be presented and discussed in Section 4 and its performance will be demonstrated by solving an example in Section 5. Finally conclusions will be given in Section 6.

Problem formulation
The set of real numbers is denoted as We consider a nonlinear feedback controlled plant model with vector field f : R n × U → R n and state x(t) ∈ R n , where u : R n → U ⊂ R m denotes a known continuous-time static state feedback which (globally) asymptotically stabilizes the system.We want to implement the closed loop system using a digital computer with sampling and zero order hold at the sampling time instants Then for a feedback law u T (x) the sampled-data closed loop system becomes Our goal is now to design u T (x) such that the corresponding sampled-data solution of (2) reproduces the continuous-time solution x(t) of (1) as close as possible.
The solution of the system (1) at time t emanating from the initial state x(0) = x 0 will be denoted by x(t, x 0 ).Also we will assume f (x, u(x)) to be locally Lipschitz in x, hence a unique solution of the continuous-time closed loop system to exist for any x(0) = x 0 in a given compact set Γ ⊂ R n containing the origin.Remark 2.1 The simplest approach to this problem is the emulation design in which one simply sets u T (x) := u(x).This method can be used for this purpose but one can only prove practical stability of the sampled-data closed loop system if the sampling time T is sufficiently small, see [8].
In order to determine the desired sampled-data feedback u T we first search for a piecewise constant control function v whose corresponding solution approximates the solution of the continuous-time closed loop system.Therefore the mismatch between the solutions of can be measured.Here ξ(t, ξ 0 ) denotes the solution of the system under control and v [0,∞] is a piecewise constant function with discontinuities only at the sampling instants In order to measure and minimize the difference between both trajectories a cost functional of the form is needed where l : R n × U → R ≥0 .This results in an optimal control problem with infinite horizon which involves solving a Hamilton-Jacobi-Bellman type equation.In the linear case solutions to different H 2 and H ∞ control designs are known but the nonlinear case is typically too hard to be solved.
In order to avoid this computational burden we consider a reduced problem in a first step by limiting the horizon to a finite length.This will give us a suboptimal MPC controller whose numerical computation is manageable.
Since T is fixed due to the problem formulation the length of the horizon H can be given by M ∈ N via H = M • T .Hence the cost functional can be written as using the function F to measure the cost-to-go Remark 2.2 It is not necessary for F to be a control-Lyapunov-function of (3), (4) to prove semiglobal practical stability of the closed loop system.Moreover terminal costs of the form Using this approach an optimal control problem with finite horizon has to be solved which will return a finite control sequence û[0,M−1] .In order to determine the sampled-data feedback law u T an infinite sequence of optimal control problems can be generated and solved using a receding horizon approach.To this end in a second step only the first control ) is implemented and the horizon is shifted forward in time by T .Hence a new optimal control problem is given and the process can be iterated.According to this procedure the receding horizon control law u T = u M is a static state feedback for the coupled system that is implemented in a sampled-data fashion.Then the overall closed loop system is given by (9) Remark 2.3 We like to emphasize that it is not only our goal to obtain asymptotical stability of (8), ( 9) which implies tracking since we have that ) but also that we achieve this in an appropriate sub-optimal manner.

Stability and Inverse Optimality
Since most of the time one can only work with approximated discrete-time models consistency with the exact discrete-time model as described in [11] is needed.Under the consistency condition given by Definition 1 in [10] and suitable mild additional assumptions one can conclude that asymptotic stability of the approximate model carries over to semiglobal practical asymptotic stability for the exact model, see [11] for a general framework and [3] for corresponding results for MPC algorithms.This justifies the use of numerical approximations, cf. also Remark 4.1, below.To conclude semiglobal asymptotical stability of the closed loop system using the proposed MPC controller we present the following theorem, which relies on Theorem 1 in [1].Theorem 3.1 (Stability) Suppose the following conditions hold: 1. l and F are continuous; 2. U is bounded; 3a.The continuous-time system (1) is globally asymptotically stable; 3b.There exists a constant r 0 > 0 and a function γ ∈ K ∞ with l(y, u) ≥ max max (11) Proof.Make use of the underlying discrete-time system via Theorem 1 in [1] and Theorem 1 in [10], see [13] for details.Therefore one can apply the calculated MPC control coming out of an approximated model in reality without loss of stability.Remark 3.2 If F is a control Lyapunov function for the exact discrete-time model of the uncontrolled sampled-data system then it follows from [1] that the theoretical bound M * 1 for the necessary prediction horizon decreases which was confirmed in our numerical simulations.Remark 3.3 Explicit bounds to guarantee the stability properties of the underlying discrete-time system can be found in [1].In order to show inverse optimality of our approach we suppose that F is such that there exists a closed set X f ⊂ R 2n and a control law Theorem 3.4 (Inverse (Sub-)Optimality) Consider the discrete-time model (12), (13) and suppose that the previous assumptions are valid.Then there exists a set X M ⊂ R 2n and a function ∀(ξ, x) ∈ X M , u ∈ U such that for all (ξ, x) ∈ X M we have that the controller (7) minimizes the cost functional Proof.The principle of optimality and the stated assumptions are utilised to show Q(ξ, x, u M ) ≥ Q(ξ, x, u M ), see [13] for details.

Numerical Solution
For the solution of the optimal control problem we use a direct approach and therefore replace the problem to minimize (6) with dynamics (3), (4) by numerical approximations ξ(t, ξ 0 , u) of ξ(t, ξ 0 , u) and x(t, x 0 , u) of x(t, x 0 ), respectively.For this approach convergence has been investigated in [7] and under suitable conditions one can guarantee that the order of convergence is O(T ).From this formulation one obtains an optimization problem by introducing the variable z = (ξ 0 , . . ., ξ M , x 0 , . . ., x M , u 0 , . . ., u M ) and rewriting the approximated optimal control problem as with the constraints coming along with the approximation.This is a well known problem that can be solved using the KKT conditions by SQP methods if the cost functional and the constraints are sufficiently often differentiable in a sufficiently large neighborhood N (z * ) of the local minima z * .These methods are known to be stable and efficient even for large systems.
The used algorithm computes a sequence (z [k] ) via z Within this iteration the search direction p [k] is calculated by generating and solving quadratic subproblems of the form min The algorithm computes the derivatives by forward difference schemes if they are not given by the user and the matrix B [k] is an approximation of the Hesse matrix where a BFGS-Rank 2 update is implemented so that the Hesse matrix has to be calculated only once.Therefore the usual quadratic order of convergence of the Newton method is reduced but superlinear convergence can still be shown.The step size α [k] is obtained by minimizing a merit function ρ j G 2 j (z) such that the natural step size α [k] = 1 of the Newton method is reduced but one can expect it to be close to 1 in a small neighborhood of z * .Remark 4.1 Since our aim is to allow for large sampling periods T an adaptive step size control algorithm such as DoPri5, see [4], is necessary within each interval [kT, (k + 1)T ), k ∈ N, in order to avoid errors in the state trajectories and the cost functional which therefore has to be transformed.Note that the local accuracy guaranteed by the step size control here plays the role of the accuracy parameter δ in the consistency Definition 1 in [10].Remark 4.2 The case of an integration step size h that is different from the sampling period T has been analysed theoretically for MPC schemes in [3].An important aspect of this analysis is that h, or -more generally -the numerical accuracy parameter, can be assigned arbitrarily and independently of T (where of course one has to ensure that the sampling instants are included in the set of gridpoints used for integration in order to match the discontinuities of the control function).It should be noted that our algorithm fulfils this requirement.In fact, when we remove the x-subsystem (3) from our scheme and use a local Lyapunov function as a terminal cost we obtain exactly the direct MPC algorithm discussed theoretically in [3].Compared to this standard MPC approach the main difference of our scheme lies in the fact that we can directly enforce a desired transient behavior induced by the continuous-time feedback, while in standard MPC schemes the transient behavior can only be influenced indirectly through the choice of the cost functional.Clearly, the design of a suitable continuous-time controller requires a considerable amount of a priori work, but this may be rewarded by a better performance of the resulting sampled-data closed loop.Remark 4.3 An important problem is the choice of a good initial guess v [0,M −1] for the optimization, keeping in mind that we deal with a nonlinear optimization problem.Even though suboptimal solutions to this problem may be sufficient to ensure stability, see [6], here we also aim at good performance.Convergence to the global optimum, however, can only be expected when the initial solution is already close to it.When passing from t k to t k+1 the shifted optimal control sequence from the previous step typically yields such a good initial guess, which is confirmed by our numerical experience that the computational costs for the optimization are decreasing monotonically during the iteration process.A more severe problem is the choice of the initial guess at t 0 when no previous optimal control is known.In this case, in our approach the known continuoustime feedback can be exploited for this purpose when the emulated feedback from Remark 2.1 yields solutions which do not deviate too far from the continuoustime reference.However, this method fails when the emulated feedback leads to unstable solutions and the time horizon H = M • T is rather large.Such situations can sometimes be handled by reducing the length of the horizon H = M • T but proceeding this way one has to keep in mind that there exists a lower bound for H from the stability proof.Also, simulations have shown that while on one hand computational costs grow with the length of the horizon, on the other hand better performance can be achieved using longer horizons.Therefore, at the moment it is up to simulations to find a good set of parameters and a good initial guess of v [0,M −1] .A promising alternative approach and topic of future research is whether some of the methods developed in [9,12] can be used in order to construct the initial guess, an approach that would lead to a predictor-corrector type algorithm in which the MPC strategy plays the role of the corrector.

Example
Here we present a model of a synchronous generator taken from [2]  ) with feedback gain a 1 > 0, whose purpose is to enlarge the domain of attraction of the locally stable equilibrium x * ≈ (1.12, 0.0, 0.914) (note that this equilibrium is locally asymptotically stable also for u ≡ 0).As initial value we used the vector x 0 = (0.5, 0.0, 2.0) and generated results for T = 0.1, T = 0.5 and a 1 = 0.45.One can see that the fast dynamics of the problem require small sampling periods to maintain stability using the emulated feedback law.The MPC control on the other hand not only stabilizes the equilibrium even for rather large T but also keeps the sampled-data solution close to the reference.

Conclusion
We proposed an unconstrained model predictive algorithm for the sampleddata implementation of continuous-time stabilizing feedback laws.Stability and inverse optimality results were briefly revisited and numerical issues were discussed.Compared to direct MPC approaches without using continuoustime feedbacks, advantages of our method are that the sampled-data solutions inherit the performance properties of the continuous-time controller and that the knowledge of the continuous-time controller helps to reduce the computational cost of the numerical optimization.Future research will include a systematic study about how this knowledge can be used in a numerically efficient way and an extension of our approach to dynamic continuous-time controllers.

ẋ1 = x 2 ,ReferenceFig. 1 .
Fig. 1.Improvement by MPC control over emulation for a1 = 0.45, T = 0.1 (left), T = 0.5 (middle) and reference solution using continuous-time feedback (right) We use the parameter b 1 = 34.29,b 2 = 0.0, b 3 = 0.149, b 4 = 0.3341, P = 28.22 and E = 0.2405, as well as the continuous-time feedback law u(x) = a 1 ((x 1 −x * 1 )b 4 +x 2 )with feedback gain a 1 > 0, whose purpose is to enlarge the domain of attraction of the locally stable equilibrium x * ≈ (1.12, 0.0, 0.914) (note that this equilibrium is locally asymptotically stable also for u ≡ 0).As initial value we used the vector x 0 = (0.5, 0.0, 2.0) and generated results for T = 0.1, T = 0.5 and a 1 = 0.45.One can see that the fast dynamics of the problem require small sampling periods to maintain stability using the emulated feedback law.The MPC is continuous, zero at zero and non-decreasing.It is of class K if it is continuous, zero at zero and strictly increasing.It is of class K ∞ if it is also unbounded.It is of class L if it is strictly positive and it is decreasing to zero as its argument tends to infinity.A function β : R ≥0