Efficient Model Predictive Algorithms for Tracking of Periodic Signals

This paper studies the design of efficient model predictive controllers for fast-sampling linear time-invariant systems subject to input constraints to track a set of periodic references. The problem is decomposed into a steady-state subproblem that determines the optimal asymptotic operating point and a transient subproblem that drives the given plant to this operating point. While the transient subproblem is a small-sized quadratic program, the steady-state subproblem can easily involve hundreds of variables and constraints. The decomposition allows these two subproblems of very different computational complexities to be solved in parallel with different sampling rates. Moreover, a receding horizon approach is adopted for the steady-state subproblem to spread the optimization over time in an efficient manner, making its solution possible for fast-sampling systems. Besides the conventional formulation based on the control inputs as variables, a parameterization using a dynamic policy on the inputs is introduced, which further reduces the online computational requirements. Both proposed algorithms possess nice convergence properties, which are also verified with computer simulations.


Introduction
One of the most attractive features of model predictive control (MPC) is its ability to handle constraints [1].Many other control techniques are conservative in handling constraints, or even try to avoid activating them, thus, sacrificing the best performance that is achievable.MPC, on the contrary, tends to make the closed-loop system operate near its limits and hence produces far better performance.This property of MPC gives it the strength in practice, leading to a wide acceptance by the industry.
A very good example of system operating near its limits is a plant being driven by periodic signals to track periodic references.Under this situation, some of the system constraints will be activated repeatedly, and the optimal operating control signal is far from trivial.Just clipping the control signal to fit into the system constraints produces inferior performance typically.And the loss being considered here is not just a transient loss due to sudden disturbances, but indeed a steady-state loss due to a suboptimal operating point.Therefore, the loss is on long term and severe.
On the other hand, the successful real-life applications of MPC are mostly on systems with slower dynamics such as industrial and chemical processes [2].The reason is simply that MPC requires a constrained optimization to be carried out online in a receding horizon fashion [3,4].Therefore, to apply MPC to fast-sampling systems, the computational power needed will be substantial.In any case, because of its great success in slow-sampling systems, the trend to extend MPC to fast-sampling systems is inevitable, and many recent researches have been carried out to develop efficient methods to implement MPC in such cases.While some of these works focus on unloading the computational burdens [5][6][7][8][9], others emphasize on code optimization [10][11][12] and new algorithmic paradigms [13][14][15][16][17].
If MPC is applied to the tracking of periodic signals in a receding horizon fashion, the horizon length will be related to the period length, and a long period will imply an online optimization problem of many variables and constraints.For a fast-sampling system, it is essentially an attempt to solve a very big computational problem within a very small time frame.In this paper, we shall analyze the structure of this u (1) u s (1) u t (1) u s (1) x t (1) u s (2) . . .
x s (1) x (1) u s (1) or v (1) v( 1) problem and then propose two efficient algorithms for the task.They aim to make the application of MPC to a fastsampling system possible by a slight sacrifice on the transient performance, but the optimal or near-optimal steady-state performance of periodic tracking will be maintained.
In Section 2, the mathematical formation of the problem will be presented.The two algorithms, one based on the concept of receding horizon quadratic programming and the other based on the idea of dynamic MPC policy, will be presented in Sections 3 and 4, respectively.A comment on the actual implementation will be given in Section 5, followed by some computer simulations in Section 6 to illustrate several aspects of the proposed algorithms.Finally, Section 7 concludes the paper.
To avoid cumbersome notations like u(k | k), u(k + 1 | k), . . ., u(k + N u − 1 | k), the MPC algorithms in this paper will only be presented as if the current time is k = 0, and we shall write u(0), u(1), . . ., u(N u − 1) instead.The reader is asked to bear in mind that the algorithm is actually to be implemented in a receding horizon fashion.

Problem Formulation
Consider a linear time-invariant plant subject to a periodic disturbance: where the superscript + denotes the time-shift operator, that is, and the disturbance w is measurable and periodic with period N p .The control objective is to construct a control signal u such that the plant output y will track a specific periodic reference r of the same period N p asymptotically with satisfactory transient performance.The control input u is also required to satisfy some linear inequality constraints (e.g., to be within certain bounds).The reference r is not necessarily fixed but may be different for different disturbance w. (For that reason, it may be more appropriate to call w an exogenous signal rather than a disturbance).
The algorithms developed in this paper are motivated by the following situations: (1) the period N p is very long compared with the typical transient behaviours of the closed-loop system; (2) the linear inequality constraints on u are persistently active, that is, for any given k, there exists a k > k such that u(k) will meet at least one of the associated linear equality constraints; (3) there is not sufficient computational power to solve the associated quadratic program completely within one sampling interval unless both the control horizon and the prediction horizon are much shorter than N p .
As a matter of fact, without the above considerations and restrictions, the problem is not very challenging and can be tackled with standard MPC approaches for linear systems.The underlying idea of the approach proposed in this paper is that since the transient behaviour of the closedloop system is expected to be much shorter than the period N p , we should decompose the original control problem into two: one we call the steady-state subproblem and the other we call the transient subproblem.Hence, the transient subproblem can be solved with a control horizon and a prediction horizon much shorter than N p .While the steadystate subproblem is still very computationally intensive and cannot be solved within one sampling interval, it is not really urgent compared with the transient subproblem, and its computation can be spread over several sampling intervals.Indeed, the two subproblems need not be synchronized even though the transient subproblem depends on the solution to the steady-state subproblem due to the coupled input constraints.The former will utilize the latter whenever the latter is updated and made available to the former.It is only that the transient control will try to make the plant output y track a suboptimal reference if the optimal steady-state control is not available in time.Now let us present the detailed mathematical formulation of our proposed method.Naturally, since both w and   r are periodic with period N p , the solution u should also be periodic of the same period asymptotically, that is, there should exist a periodic signal u s (k) such that lim Let x s and y s be the corresponding asymptotic solutions of x and y, and they obviously satisfy the dynamics inherited from ( 1) and ( 2): Ideally, we want y s = r but this might not be achievable when u s is required to satisfy the specific linear inequality constraints.Therefore, following the spirit of MPC, we shall find u s , such that is minimized for some positive definite matrix Q, where e s (k) is the asymptotic tracking error defined by e s = y s − r, ( 8 ) and the summation in (7) satisfy the dynamics derived from (1)-( 3), subject to the original linear inequality constraints being applied to u t (k) + u s (k).Since the control horizon and the prediction horizon for this transient subproblem are allowed to be much shorter than N p , it can be tackled with existing MPC algorithms.
It is important to note that in this steady-state/transient decomposition, the steady-state control u s is actually a feedforward control signal determined from w and r, whereas the transient control u t is a feedback control signal depending on x.As an unstable plant can only be stabilized by feedback, but the main interest of the current paper is the computational complexity of the steady-state subproblem, we shall not discuss in depth the stabilization issue, which has been studied quite extensively in the MPC literature.Typically, stabilizability of a constrained system using MPC would be cast as the feasibility of an associated optimization problem.For the numerical example in Section 6, we shall conveniently pick a plant where A is already stable, and hence the following quadratic cost may be adopted for the transient subproblem: (11) where N u is the control horizon with N u N p , Q and R are chosen positive definite matrices, and P T is the (weighted) observability gramian obtained from the Lyapunov equation The minimization of J t is simply a standard quadratic program over u t (0), u t (1), . . ., u t (N u − 1) for a given x t (0).The situation will be more complicated when A is not stable, but one well-known approach is to force the unstable modes to zero at the end of the finite horizon [18].
Remark 1. Essentially, the choice of the cost function (11) with P T from (12) for a stable A means that the projected control action after the finite horizon is set to zero, that is, u t (k) = 0 for k ≥ N u since the "tail" of the quadratic cost is then given by This terminal policy is valid because the steady-state subproblem has already required that u s satisfies the linear inequality constraints imposed on u.Hence, J t is obviously a Lyapunov function which will be further decreased by the receding horizon implementation when the future control u t (N u ) turns into an optimization variable from zero.
Remark 2. We have deliberately omitted the R-matrix in the steady-state cost J s in (7).The reason is simply that we want to recover the standard linear solution (for perfect asymptotic tracking) as long as u s does not hit any constraint.

Steady-State Subproblem: A Receding Horizon Quadratic Programming Approach
When the periodic disturbance w is perfectly known, the steady-state subproblem is also a conceptually simple (but computationally high-dimensional) quadratic program.One way to know w is simply to monitor and record it over one full period.This, however, does not work well if w is subject to sudden changes.For example, the plant to be considered in our simulations in Section 6 is a power quality device called Unified Power Quality Conditioner [19], where w consists of the supply voltage and the load current of the power system, and both may change abruptly if there are supply voltage sags/swells and variations in the load demands.Indeed, the main motivation of the receding horizon approach in MPC is that things never turn out as expected and the control signal should adapt in an autonomous manner.If the suddenly changed disturbance w can be known precisely only after one full period of observation, the transient response of the steady-state subproblem (not to be confused with the transient subproblem described in Section 2) will be unsatisfactory.
One way to overcome this is to introduce an exogenous model for the signals w and r, as adopted in [19].Specifically, we construct a state-space model: and assume that both w and r are generated from this model.Since w and r are periodic with period N p , we have One simple (but not the only) way to construct A v , as demonstrated similarly in [19] in the continuous-time case, is to make A v a block-diagonal matrix with each block taking the form: where n is an integer, T s is the sampling time and ωT s × N p = 2π.Then the matrices C w and C r are just to sum up their respective odd components of v.This essentially performs a Fourier decomposition of the signals w and r, and hence their approximations by C w v and C r v will be arbitrarily good when more and more harmonics are included in the model.
Based on the exogenous model ( 14)-( 17), an observer can be easily constructed to generate (an estimate of) v from the measurements of w and r.From v(0), the model ( 14)-( 17) can then generate predictions of w(0), w(1), . . ., w(N p − 1) and r(0), r(1), . . ., r(N p − 1), and these can be used to find u s (0), u s (1), . . ., u s (N p − 1) by the quadratic program.The use of the exogenous model ( 14)-( 17) typically allows the changed w and r to be identified much sooner than the end of one full period.The quadratic program for the steady-state subproblem can be written as follows: where N m is the total number of linear inequality constraints.
Note that since we assume only input but not state constraints for our original problem, (20) does not depend on v(0) and, hence, the feasibility of any u s (0) remains the same even if there is an abrupt change in v(0) (i.e., if v(0) is different from the predicted value from ( 14) and v(−1)).Furthermore, the active set of constraints remains the same.
Next, we present a one-step active set algorithm to solve the quadratic program ( 19)-( 20) partially.
Algorithm 4. Given an initial feasible u s (0) and a working set W 0 ⊂ A(u s (0)).Let the set of working constraints be represented by where the inequality sign applies componentwise, that is, each row of A 0 , b 0 represents a working constraint in (21).
(1) Compute the gradient and the null space of A 0 , denoted Z 0 by If Z T 0 g 0 ≈ 0, go to step (5).(2) Compute a search direction w 0 = Z 0 w 0 , where (3) Let (4) If α 0 ≥ 1, go to step (5).Otherwise, update u s (0) to u * s (0) by and add a (blocking) constraint to W 0 to form a new working set W * 0 according to the method described in Remark 7 below.Quit.
(5) Update u s (0) to u * s (0) by Compute the Lagrange multiplier λ 0 from to see whether any component of λ 0 is negative.If yes, remove one of the constraints corresponding to a negative component of λ 0 from W 0 to form a new working set W * 0 according to the method described in Remark 7 below.Quit.Algorithm 4 can be interpreted as follows.It solves the equality-constrained quadratic program: and then searches along the direction until it is either blocked by a constraint not in W 0 (step (4)) or the optimal u s (0) is reached (step ( 5)).This is indeed a single step of the standard active set method (the null-space approach) for quadratic programming [20,21] except for the modifications that will be detailed in Remark 7 below.
In other words, if we apply Algorithm 4 repeatedly to the new u * s (0), W * (0), it will converge to the solution of the original inequality-constrained quadratic program ( 19)- (20) within a finite number of steps, and the cost function J s is strictly decreasing.However, here we only apply a single step of the active set method due to the limited computational power available within one sampling interval.Furthermore, we do not even assume that the single step of computation can be completed within T s .Let N a T s be the time required or allowed to carry out Algorithm 4. To complete the original quadratic program ( 19)- (20) in a receding horizon fashion, we need to forward u * s (0), W * (0) to u s (N a ), W (N a ) by rotating the components of u * s (0) by an amount of N a since it is supposed to be periodic: Obviously, Algorithm 4 will then continue to solve an equivalent quadratic program as long as v strictly follows the exogenous dynamics ( 14).Hence we have the following convergence result.
Proposition 5. Algorithm 4 together with the rotation of the components of u * s (0) in (32) will solve the quadratic program (19)- (20) in finite time as long as v(k) satisfies the exogenous dynamics (14).
Proof.From the argument above it is easy to see that as long as v(k) follows the dynamics ( 14), the algorithm is consistently solving essentially the same quadratic program.So it remains to check that the convergence proof of the standard active set algorithm remains valid despite the modifications we shall detail in Remark 7, which is indeed the case.
Of course, the most interesting feature of the receding horizon approach is that the solution will adapt autonomously to the new quadratic program if there is an abrupt change in v. Since constraint (20) is independent of v, an abrupt change in v will not destroy the feasibility of the previously determined u s and the working set W determined previously also remains a valid subset of the active set.Hence, the receding horizon active set method will continue to work even though the objective function (19) has changed.However, if it is necessary to include not only control but also state constraints into the original problem formulation, we shall then require a quadratic programming algorithm (other than the active set method in its simplest form) that does not assume the initial guess to be feasible.Remark 6.There could be two possible ways to arrange the steps in Algorithm 4. One is to update the working set W followed by u s , and the other is to update u s followed by the working set W .In the receding horizon framework, it might seem at first glance that the first choice is the right one, since we shall then avoid basing the optimization of u s on an "outdated" working set if v happens to have changed.However, it turns out that the first choice is actually undesirable.One well-known "weakness" of the active set method is that it is not so easy to remove a constraint once it enters the working set W .This becomes even more a concern in the receding horizon framework.If v has changed, and so has the objective function (19), the original stationary u * s obtained in step (5) may no longer be stationary, and it will require at least an additional iteration to identify the new stationary point before we can decide whether any constraint can be dropped from the working set or not.This will seriously slow down the transient response of the steady-state subproblem.Indeed, once v has changed, many of the constraints in the previous working set are no longer sensible, and it will be wiser to drop them hastily rather than being too cautious only to find much later that the constraints should still be dropped eventually.

Remark 7.
One key element in the active set method of the quadratic program is to add or drop a constraint to or from the working set W .The constraint being added belongs to the blocking set B, defined as those constraints corresponding to the minimum α 0 in (26).Physically, they are the constraints that will be first encountered when we try to move u s (0) to u s (0) in (31).The constraint being dropped belongs to the set L, defined as those constraints corresponding to a negative component of the Lagrange multiplier in (29).The active set method will converge in finite time no matter which constraint in B will be added or which constraint in L will be dropped.One standard and popular choice in the conventional active set method is that the one in L corresponding to the most negative component of λ will be dropped, whereas the choice from B will be arbitrary.This is a very natural choice when there is no other consideration.
However, in the receding horizon framework, one other (and in fact important) consideration emerges, which is the execution time of the control input(s) associated with a constraint.Specifically, if Algorithm 4 takes time N a T s to carry out, then W * 0 updated in the current iteration will be used to optimize u s (N a ) in the next iteration, but the outcome of that optimization is ready only at k = 2N a , based on which the transient control u t is computed.Suppose that the transient subproblem takes one sampling interval to solve, then the transient subproblem at k = 2N a will update u(2N a + 1) = u s (2N a + 1) + u t (2N a + 1) (see Section 5 below for a more detailed discussion).Hence, the "time priority" of u s is 2N a + 1, 2N a + 2, . . ., N p − 1, 0, 1, . . ., 2N a and from this argument, we choose to drop the constraint in L that is associated with the first u s in this sequence or to add the constraint in B that is associated with the last u s in this sequence (of course the most negative Lagrange multiplier can still be used as the second criterion if two constraints in L happen to have the same urgency).
The proposal here aims to assign most freedom to the most urgent control input in the optimization, which makes sense in the receding horizon framework since the less urgent inputs may be reoptimized later.
Remark 8. Basically, the approach proposed in this section is to spread the original quadratic program over many intervals, so that each interval only carries out one iteration of the algorithm, and also to ensure that the quadratic program being solved is consistent when the prediction of the exogenous model is valid, but will migrate to a new quadratic program when there is a change in v(k).
It is worth mentioning that the original standard MPC is a static controller by nature, since the true solution of a complete quadratic program is independent of the MPC's decisions in the past (past decisions can help to speed up the computations but will not affect the solution), but by spreading the algorithm over several intervals, it is turned into a dynamic controller with internal state u s (k), W (k).

Steady-State Subproblem: A Dynamic Policy Approach
The approach proposed in Section 3 optimizes u s .Consequently, the number of (scalar) variables being optimized is proportional to N p .To further cut down the computations required, this section proposes another approach based on the idea of a dynamic policy, inspired by the works of [13,22,23].This approach optimizes a smaller number of variables typically, and the number is independent from N p , although the number of linear inequality constraints remains the same.In return, the optimization result is expected to be slightly inferior to that of Section 3 due to the reduction of variables (degree of freedom).However, it should be noted that the number of optimized variables in this second approach is adjustable based upon the designer's wish.The central idea of the dynamic policy approach [13,22,23] is that instead of optimizing the control input directly, we generate the control input by a dynamic system of which the initial system state is optimized.This is similar to what we have done to w and r in Section 3. Specifically, we assume u s is also generated from a state-space model: where This state-space model is designed a priori but the initial state v(0) will be optimized online.Obviously, the quadratic program ( 19)-( 20) becomes min v(0) J s ,  where and O is the observability matrix The number of variables in this new quadratic program is the dimension of v(0), denoted by n v .If A v is constructed from the method of Fourier decomposition described in Section 3, Shannon's sampling theorem implies that a sufficiently large but finite n v will guarantee a full reconstruction of the original optimization variable u s (0).On the other hand, a smaller n v restricts the search to a lower dimensional subspace of u s (0) and hence the optimization is easier but suboptimal.
One natural choice of the dynamics A v is to make A v = A v in the exogenous model ( 14)- (17).Of course, it should be noted that constrained control is generally a nonlinear problem, and therefore the number of harmonics to be included in u s may exceed that of w and r in order to achieve the true optimal performance.However, we could have overdesigned the exogenous model ( 14)-( 17) to include more harmonics in A v than necessary for w and r, thus making the choice A v = A v here not so conservative.The simulation results in Section 6 will demonstrate both cases.It remains to choose the matrix C v in (35).The one we suggest here is based on the linear servomechanism theory [24][25][26], which solves the linear version of our problem when there is no input constraint.Essentially, when there is no constraint, perfect asymptotic tracking (i.e., y s = r or e s = 0) can be achieved by solving the regulator equation: for the matrices X, U, and then let which also implies Therefore, to recover the optimal (or perfect) solution in the linear case when u s does not hit any constraint, the statespace model of u s may be chosen as However, this state-space model is not guaranteed to be observable.When it is not, the resulting H in (37) will become semidefinite instead of strictly positive definite.To overcome this, we suggest to perform an orthogonal state transformation to bring (44) to the Kalman decomposition form and hence obtain a reduced-order model to become (34)-( 35).It is easy to verify that is upper block-triangular and Certainly, the discussion above only provides a suggestion of how to choose the state-space model for u s , which we shall also adopt for our simulations in Section 6, but, in general, the designer should feel free to employ any valid state-space model to suit his problem.Remark 9. Having reparameterized the quadratic program in terms of v(0) rather than u s (0), we can apply a similar version of Algorithm 4 to (37)-(38).In other words, it is not necessary to solve the quadratic program completely within one sampling interval.Instead of rotating the components of u * s (0) to obtain u s (N a ), we obtain v(N a ) by A Na v v * (0).

Implementation Issues and Impacts on Transient Performance
Before we present the simulation results, let us comment on the impact of computational delay on the transient subproblem in Section 2. First of all, we assume that the transient quadratic program can be solved completely within one sampling interval.Therefore, despite the way we presented the cost function J t in (11), in actual implementation we shall optimize u t (1), u t (2), . . ., u t (N u ) based on x t (1) at time k = 0, instead of u t (0), u t (1),. . .,u t (N u − 1) based on x t (0).The unknown x t (1) can be projected from the known variables and system dynamics.After the optimization is carried out to obtain u t (1), u t (2), . . ., u t (N u ), the control input to be executed at k = 1 will be u(1) = u s (1) + u t (1).Bear in mind that all these calculations can only be based on the best knowledge of the signals at k = 0. Figure 1 summarizes how the unknown variables can be computed from the known variables.The variables in each layer are derived from those variables directly below them, but in actual implementation it is sometimes possible to derive explicit formulas to compute the upper layer from the lower layer bypassing the intermediate layer, thus not requiring those intermediate calculations online.The variable on top is the control action u(1), computed from the variables of the steady-state subproblem on the left, and those of the transient subproblem on the right, separated by a solid line.The variables in the bottom layer, v(0) is provided by the observer described in Section 3, x(0) is a measurement of the current plant state, and u(0) is the control input calculated by the algorithm at k = −1.Note that to compute u t (1), the values of u s (1), u s (2), . . ., u s (N u ) are needed to form the constraints for the transient quadratic program since the original linear inequality constraints apply to u(k) = u s (k) + u t (k).On the other hand, x s (1) can be written as a linear function of v(1) and u s (1) (or v(1)) explicitly.Finally, the steady-state subproblem requires a computational time of N a T s , implying that the solution u s (0) provided by the steady-state subproblem at k = 0 is based on a measurement of v(k) at some k between −2N a +1 and −N a .So in the worst case, u( 1) is based on some information as old as v(−2N a + 1), which corresponds to a worst-case delay of 2N a T s .For instance, if N a = 1, the control u(k) is computed from a measurement of x(k − 1), v(k − 1), and v(k − 2).
Remark 10.Although we said in Section 2 that the transient subproblem was not the main interest of this paper, it is an ideal vehicle to demonstrate the power of MPC since the "useful freedom" of u t (k) may have been totally consumed by u s (t) when the latter hits a constraint.For example, the simulations to be discussed in Section 6 have the constraint If u s (k) already saturates at ±1, one side of u t (k) is lost but that could be the only side to make the reduction of J t possible, thus forcing u t (k) to zero.So the input constraint does not only restrict the magnitude, but also the time instant to apply the transient control u t .Such problem is extremely difficult for conventional control techniques.

Simulation Results
In this section we use an example to demonstrate the performance of our algorithms by computer simulations.The plant is borrowed from [19] and represents a power quality device called Unified Power Quality Conditioner (UPQC), which has the following continuous-time statespace model: The exogenous input w is composed of the supply voltage and the load current, which are periodic at 50 Hz but may consist of higher-order harmonics.The plant output y is composed of the load voltage and the supply current, which will be made to track designated pure sine waves of 50 Hz.
The control input u is composed of two switching signals across the voltage source inverters (VSIs), both of which are required to satisfy the bounds −1 ≤ u ≤ 1.The general control objective is to maintain y to the desired waveforms despite possible fluctuations in w like supply voltage sags/swells or load demand changes.To apply the MPC algorithms proposed, we obtain a discrete-time version of the above state-space model by applying a sampling interval of T s = 0.2 ms (i.e., 100 samples per period).Smallsized quadratic programs (such as our transient subproblem) can possibly be solved within such a short time thanks to the state-of-the-art code optimization [12], which reports sampling rates in the range of kHz, but to solve a big quadratic program like our steady-state subproblem we shall resort to the technique of Algorithm 4. Note that in our formulation, the transient subproblem and the steadystate subproblem can be solved in parallel.Although the optimization of u t depends on u s , the transient control u t (k + 1) is computed from u s (k) which is made available by the steady-state subproblem in the previous step.So it is independent of the current steady-state subproblem being solved.
As typical in a power system, we assume only odd harmonics in the supply voltage and the load current.Hence we can reduce the computations in the steady-state subproblem by the following easy modifications from the standard algorithms presented in Sections 3 and 4; N p may be chosen to represent half of the period instead of the whole period, satisfying instead of (6), and instead of ( 17) and (36), with ωT s × N p = π instead of 2π.The rotation operation in (32) should also become . . .
This cuts down half of the scalar variables as well as constraints in the quadratic program.The model parameters of the UPQC used in our simulations are summarized in Table 1 for the circuit components and Table 2 for the line and VSI impedances.They are the same as those values in [19], except for V dc which we have changed from 400 V to 320 V so as to produce a saturated control u more easily.Note that V dc is the DC-link voltage, which determines how big a fluctuation in the supply voltage or load current the UPQC can handle.In other words, saturation occurs when the UPQC is trying to deal with an unexpected voltage sag/swell or load demand that is beyond its designed capability.The simulation scenario is summarized in Figure 2.Both the supply voltage and the load current consist of odd harmonics up to the 9th order.Despite the harmonics, it is desirable to regulate the load voltage to a fixed pure sine wave, whereas the supply current should also be purely sinusoidal, but its magnitude and phase are selected to maintain a power factor of unity and to match the supply active power to the active power demanded by the load, which means the reference of this supply current is w-dependent.The waveforms of both w and r are shown in Figure 2. The simulation scenario is designed such that the steady-state control u s is not saturated at the beginning.At t = 0.5 s, a voltage sag occurs which reduces the supply voltage to 10% of its original value.The UPQC is expected to keep the load voltage unchanged but (gradually) increase the supply current so as to retain the original active power.This will drive u s into a slightly saturated situation.At t = 1.0 s, the load demand increases, causing the reference of the supply current to increase again, and u s will become deeply saturated.At t = 1.5 s, the voltage sag is cleared and the supply voltage returns to its starting value, but the (new) load demand remains.Although the load demand is still higher than its initial value, the u s required will just be within the bounds of ±1, thus leaving the saturation region to return to the linear region.So, in short, u s is expected to experience "linear → slightly saturated → deeply saturated → linear but nearly saturated" in this simulation scenario.
To evaluate the performance of our algorithms, we compare them to two other cases.In the first case, instead of Algorithm 4, the complete quadratic program is solved in each iteration of the steady-state subproblem every N asampling intervals.We call this case the complete QP, and it serves to indicate how much transient performance has been sacrificed (in theory) by spreading the quadratic program over a number of iterations.In the second case, the constraints are totally ignored, such that the optimal u s (0) in the steady-state subproblem is supposed to be where U is the solution to the regulator equation ( 41).The transient subproblem can also be solved by where F is the optimal state-feedback gain minimizing the transient quadratic cost However, the combined input u is still clipped at ±1.We label this control law the multivariable regulator (MVR) following the linear servomechanism theory.This case serves to indicate how bad the quadratic cost J s can be if a linear control law is used without taking the constraints into consideration.
Note that in both cases, the computational delays discussed in Section 5 will be in force, where u(k + 1) instead of u(k) will be optimized and the steady-state control u s is only updated every N a -sampling intervals.In reality, of course the MVR should involve negligible computational delay, whereas the complete QP should need a longer time to solve than Algorithm 4, but we are merely using their associated quadratic costs here to analyze the behaviours of our algorithms.
Figure 3 plots the steady-state cost J s of our first approach in Section 3 based on receding horizon quadratic programming together with the costs in the other two cases.N a is assumed to be 3 in this simulation.The transient subproblem has a control horizon of N u = 5, corresponding to 10 scalar variables and 20 scalar inequality constraints.On the other hand, the steady-state subproblem has N p = 50 corresponding to 100 variables and 200 constraints.As shown in Figure 3, all J s are zero prior to t = 0.5 s and should also settle down to zero after t = 1.5 s.It is observed that the transient response of our J s is pretty close to that of the complete QP during the transitions from "linear" to "slightly saturated" and from "slightly saturated" to "deeply saturated," but is poorer when it tries to return from "deeply saturated" to "linear."This can probably be attributed to the weakness of the active set method in removing a constraint from the working set as discussed in Remark 6. Figure 3 also indicates that the MVR settles down to a much higher J s value when a saturation occurs, due to its ignorance of the control constraints.The exact values of J s just prior to t = 1.0 s and t = 1.5 s are summarized in Table 3, which are about 6-7 times the J s values of our algorithm.
Figure 4 zooms into the first component of the control input u.The top two plots draw attentions to the steady-state control u s (u is essentially u s just prior to t = 1.0 s and t = 1.5 s).It is observed that the differences in u s between MVR and MPC are very subtle.Compared with the MVR, the MPC u s merely reaches and leaves its limit (+1 here) at very slightly different time instants and also produces some "optimized ripples" of less than 0.25% around that limit instead of a "flat" value as adopted in the clipped linear control law, but by doing these little things the MPC manages to bring J s down by almost one order of magnitude.This demonstrates how nontrivial the optimal u s can be.We can also see from the plots that only one constraint is active in the "slightly saturated" situation whereas multiple constraints are active in the "deeply saturated" saturation.On the other hand, the bottom two plots in Figure 4 illustrates our discussion in Remark 10.The plots clearly show that during certain moments of the transient stages (t > 1.0 s and t > 1.5 s), the transient control u t is "disabled" due to the saturation of the steady-state control u s .Note that we are labeling the dashed blue curve as "u s used to compute u t " since it is slightly different from the actual u s .For instance, u t (k + 1) is computed from the knowledge of u s at time k, which is not exactly the same as u s (k + 1).Obviously, u t is not just disabled whenever u s saturates.It happens only when the desired direction of u t violates the active constraint.
Next, let us look at the performance of our second MPC approach in Section 4 based on dynamic policy.Odd harmonics up to the 9th order are included in A v resulting in a total of n v = 20 variables.See Table 3.Since the number of variables is much lower than that of the first approach, we assume N a = 1 here, that is, one iteration of Algorithm 4 (equivalent version) is carried out in each sampling interval, whereas the transient subproblem is solved completely within each sampling interval.The transient performance of J s is plotted in Figure 5.Note that the MVR curve exhibits a slightly different transient from Figure 3 since their N a values are different.The dynamic policy approach clearly shows a faster transient response than the receding horizon quadratic programming approach, not only because of a smaller N a but also a smaller-sized quadratic program overall.However, the drawback is a slightly suboptimal J s , as indicated in Table 3.
As mentioned in Section 4, it is possible to over-design A v , and hence A v , so that the optimal J s in this second MPC method will approach the first MPC method.For example, although we only have odd harmonics up to the 9th order in w, we may include odd harmonics up to the 29th order in A v and A v .The results are also recorded in Table 3, and we see that this J s value is very close to the optimal one in the first method.

Conclusions
To apply MPC to fast-sampling systems with input constraints for the tracking of periodic references, efficient algorithms to reduce online computational burdens are necessary.We have decomposed the tracking problem into a computationally complex steady-state subproblem and a computationally simple transient subproblem, and then proposed two approaches to solve the former.The first approach, based on the concept of receding horizon quadratic programming, spreads the optimization over several sampling intervals, thus reducing the computational burdens at the price of a slower transient response.The second approach, based on the idea of a dynamic policy on the control input, further reduces the online computations at the price of a slightly suboptimal asymptotic performance.Despite the limitations, these approaches make the application of MPC to fast-sampling systems possible.Their transient behaviours and steady-state optimality have been analyzed via computer simulations, which have also demonstrated that the steadystate subproblem and the transient subproblem can be solved in parallel with different sampling rates.When the methods proposed in this paper are combined with modern code optimizations, the applicability of MPC to the servomechanism of fast-sampling constrained systems will be greatly enhanced.

Figure 1 :
Figure 1: Derivations of unknown variables from known variables.

Figure 2 :
Figure 2: Simulation scenario.Voltage sag at t = 0.5 s; load demand changed at t = 1.0 s; sag cleared at t = 1.5 s.

1 Figure 3 :
Figure 3: Quadratic cost J s of the steady-state subproblem, the receding horizon quadratic programming approach.

Figure 4 :
Figure 4: The first component of controls u and u t before and after transitions at t = 1.0 s and t = 1.5 s.

1 Figure 5 :
Figure5: Quadratic cost J s of the steady-state subproblem, the dynamic policy approach.

Table 1 :
Values of the components of the UPQC.

Table 2 :
Line impedance and VSI impedances of the UPQC.

Table 3 :
Summary of J s values for various cases studied.