{'fraction_non_alphanumeric': 0.04318618042226487, 'fraction_numerical': 0.012695366054291198, 'mean_word_length': 4.495103209281302, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modular Model Predictive Control upon an Existing Controller

: The availability of predictions of future system inputs has motivated research into preview control to improve set-point tracking and disturbance rejection beyond that achievable via conventional feedback control. The design of preview controllers, typically based upon model predictive control (MPC) for its constraint handling properties, is often performed in a monolithic nature, coupling the feedback and feed-forward problems. This can create problems, such as: (i) an additional feedback loop is introduced by MPC, which alters the closed-loop dynamics of the existing feedback compensator, potentially resulting in a deterioration of the nominal sensitivities and robustness properties of an existing closed-loop and (ii) the default preview action from MPC can be poor, degrading the original feedback control performance. In our previous work, the former problem is addressed by presenting a modular MPC design on top of a given output-feedback controller, which retains the nominal closed-loop robustness and frequency-domain properties of the latter, despite the addition of the preview design. In this paper, we address the second problem; the preview compensator design in the modular MPC formulation. Speciﬁcally, we derive the key conditions that ensure, under a given closed-loop tuning, the preview compensator within the modular MPC formulation is systematic and well-designed in a sense that the preview control actions complement the existing feedback control law rather than opposing it. In addition, we also derive some important results, showing that the modular MPC can be implemented in a cascade over any given linear controllers and the proposed conditions hold, regardless of the observer design for the modular MPC. The key beneﬁt of the modular MPC is that the preview control with constraint handling can be implemented without replacing the existing feedback controller. This is illustrated through some numerical examples.


Introduction
In many control applications, preview knowledge is available for improving tracking quality and disturbance rejection. Model predictive control (MPC) is a popular method for incorporating both preview knowledge and constraints, because, in principle [1], the information is incorporated in a systematic fashion. However, a standard preview MPC design is often monolithic in nature, where the constraint, preview, and feedback information are coupled in the associated optimisation (e.g., [2][3][4][5]). In contrast, large-scale industrial plants are often live systems with an operating feedback controller. Re-designing the controller within the MPC framework may be costly and impractical. Thus, it is more attractive to practitioners if the advanced control features, such as preview information and constraint handling, can be retrofitted into their existing feedback controller (e.g., [6]).
One of the popular approaches is the reference governor. The reference governor is an add-on scheme that ensures the satisfaction of the state and control constraints by modifying the set-point to a well-designed closed-loop system [7]. For example, the work by Gilbert and Ong [8], Borrelli et al. [9] proposed a reference governor design that satisfies constraints by adjusting the set-point based on the maximal output admissible set. However, such a design is simple and efficient, but only employing the set-point as the degree-of-freedom could result in a loss of optimality, where the degrees-of-freedom are limited to the reference signal only [10]. Much research in recent years has focused on the development of the reference governor within the predictive control framework. For example, the work by Aghaei et al. [11] showed an MPC-based reference governor design, where a couple of exogenous signals, computed by solving an on-line optimisation, were added onto the reference and control variables of the original closed-loop system for ensuring constraint satisfaction. Work by Klauco [12] developed another MPC-based reference governor design for which a set of future references is optimised based on the prediction of the closed-loop system behaviour.
Nonetheless, a large number of these MPC-based reference governor studies employed the set-point as the only optimisation variable, which could thus lead to a loss in performance and optimality. In addition, in some studies, the reference signal is assumed to be constant or the existing control design was based on a state-feedback controller. For some applications, an output-feedback controller is often employed, which is synthesised using frequency domain techniques for satisfying some robustness and performance specifications given in the frequency domain. As a consequence, this begs the question: is there a systematic way to incorporate the merits of MPC, such as the capability for handling constraint and preview knowledge, into an existing feedback controller? A simplistic proposal might involve a standard MPC formulated around the underlying closed-loop dynamics. However: (i) the MPC computes the decision variables depending on the predictions and current state of the closed-loop dynamics. Therefore, the constraint handling features of the MPC depend upon the predictions of the closed-loop dynamics. Thus, optimising such predictions will introduce an additional feedback loop to the original closed-loop, in turn impacting on the carefully designed properties of the existing controller [13,14]; (ii) coupling the feedback and feed-forward design in the standard MPC results in an 'optimal' feed-forward compensator with respect to the instantaneous cost function rather than the overall closed-loop behaviour. Consequently, the performance of such a compensator is often poor, as reported in many studies [4,15,16]. In the context of designing a modular MPC upon a given feedback controller, if the preview compensator is not carefully designed in a sense that it only handles the transient of the existing closed-loop, the preview action is then mistakenly corrected by the pre-determined feedback control law, resulting in a deterioration in the performance.
We addressed the former problem in our earlier work [14] by presenting a preview modular MPC layer that is based on a known feedback controller. In short, the pre-determined feedback control law focuses on the frequency domain closed-loop properties, such as sensitivity, whilst the feed-forward input from the modular MPC is purely based on advance knowledge. Without corrections that are linked to the measurements from the plant, the MPC module thus does not, unnecessarily, interact with the feedback loop. In this work, we propose the preview compensator design procedure for the modular MPC formulation. Specifically, we derive the key conditions that ensure the preview gain is systematic and optimal in a sense that the preview compensator from the modular MPC formulation only handles the transient of the closed-loop and, once the steady-state is reached, the preview perturbation input remains at zero. Moreover, we derive results demonstrating that the modular MPC can be implemented upon any given linear feedback controller and the use of an observer on the modular MPC has no effect upon the proposed conditions. This paper first presents the basic definitions of the model and known output-feedback controller and also the formulation of the modular MPC in Section 2. In Section 3.1, the conditions that guarantee the additional MPC design does not influence the nominal stability and robustness of the closed-loop dynamics are revisited. The novelty of this paper starts in Section 3.2, where we derive a set of conditions that proves the preview compensator within the modular MPC formulation is well-designed and systematic in a sense that the preview compensator only handles the transient of the closed-loop based on the future reference signals. In the rest of Section 3, we also derive results that show that the modular MPC is feasible to implement upon any existing linear controller and the proposed conditions hold, regardless of the observer design for the modular MPC. In Section 4, numerical examples are presented and followed by conclusions in Section 5.

Notation
Let R and C denote the real and complex fields, respectively, and let s ∈ C denote a complex variable. The space R denotes the space of proper real-rational transfer function matrices and k ∈ Z denotes a sample variable of a discrete-time signal. Let v T ∈ R 1×n v denote the transpose of a vector v ∈ R n v and V T ∈ R n y ×n z is the transpose of a matrix V ∈ R n z ×n y . The notation v →k ∈ R n v n p denotes the future prediction sequence where v T 1|k denotes the one-step ahead predictions at step k. Let λ(V) ∈ C denote the eigenvalues of the matrix V.

Preliminaries: Modular MPC Design upon an Existing Controller
This section revisits some preliminaries on the modelling assumption and the modular MPC design.

System and the Existing Controller Models
Assume that the linear model of the plant G(s) ∈ R n y ×n u is a strictly proper function, which can be described in discrete-time state-space forms, as follows: where u k ∈ R n u , y k ∈ R n y and x p k ∈ R n xp represent the input, output, and state of the plant, respectively, whilst the subscript p denotes the plant.
Let the existing output-feedback controller stabilising the linear model (1) and track the set-point r k ∈ R n y be given by K(s) ∈ R n u ×n y , with its discrete-time state-space form. as follows: where the vector x κ k ∈ R n xκ represents the state of the controller and the subscript κ denotes controller. To achieve offset-free control from the modular MPC, it is convenient to express the system (1) and controller (2) model in terms of the deviation variables, defined as follows: where the deviation of the plant statex p,k = x p,k − x s p,k , the controller statex κ,k = x κ,k − x s κ,k , the inputũ k = u k − u s k and the outputỹ = y k − r k are with respect to their steady-state x s p,k , x s κ,k , u s k . The steady-states x s p,k , x s κ,k , u s k , that enable y → r k asymptotically, can be calculated from a typical steady-state target calculator (e.g., [17]), defined as follows: Combining the linear model (3a) and controller (3b), the closed-loop dynamic system model can be expressed in the following form: The pairs {A, B} and {A, [C, K] T } are assumed be to controllable and observable, respectively.

Design of the Modular MPC
The working principle of a typical modular MPC is to compute a future perturbation input sequence by solving an optimisation problem that takes into account the closed-loop model prediction, performance index, and constraint. Figure 1 shows the architecture combining the proposed modular MPC and the separate feedback controller, where u, y and r denote the input, output, and reference signal of the plant, respectively. The proposed modular MPC optimises the perturbation c to handle constraints as well as act upon the preview reference signal r

Augmentation of Perturbation into the Underlying Control Law
The modular MPC formulation in this work adopts a dual-mode closed-loop paradigm (e.g., [18,19]), whereby the degrees-of-freedom (d.o.f) c k ∈ R n u within the predictions are defined around a stabilising feedback control law (5b), such that the input can be parametrised, as follows: The premise behind this approach is that the MPC perturbation c k is non-zero if and only if constraints are active or preview knowledge is available; obviously, when c k = 0 the underlying feedback controller operates unaffected. Such a feature is particularly useful in formulating a modular MPC on top of a given feedback controller. Notice that the predicted perturbation sequence c →k = [c 0|k , c 1|k , ..., c n c −1|k ] T ∈ R n u n c is optimised over the control horizon n c , whilst, beyond n c , the closed-loop dynamics are solely governed by the given feedback control law.

Cost Function and Optimisation Problem
A common cost function is to penalise the weighted squares of the predicted tracking errors and the deviations in control input from its steady-state (e.g., [19]): where Q = Q T ≥ 0 ∈ R n x ×n x and R = R T > 0 ∈ R n u ×n u denote the weighting matrices on state and input, respectively. Subsequently, the associated optimisation problem that minimises the perturbation sequence c →k is described, as follows: The predictions of state, input, set-point, and steady-state are denoted by (8b), (8c), (8d), and (8e), respectively. The set-point r k is assumed to be known for n a steps into the future and beyond the preview horizon n a , the reference prediction is assumed to hold the last available value r k+i = r k+n a −1 ∀i ≥ n a .

Autonomous Prediction Model to Simplify the Optimisation Problem
The predictions of state (8b), input (8c), set-point (8d), and steady-state (8e) can be expressed in a more convenient and compact autonomous prediction model form (e.g., [20]), for which the state z i|k ∈ R n z consists of the state x i|k of the model, perturbations c →k and future reference signal r →k = [r k , r k+1 , ..., r k+n a −1 ] T ∈ R n y n a . Thus, the model is defined, as follows: where the initial state z 0|k = [x 0|k , c →k , r →k ] T and Ψ are defined as: where Φ = A + BK ∈ R n x ×n x and |λ(Φ)| < 1, and the shift matrices M c ∈ R n u n c ×n u n c and M r ∈ R n y n a ×n d n a are defined as follows: and E ∈ R n x ×n u n c is described as follows: Lemma 1 (e.g., [20]). The MPC optimisation problem (with equivalent cost function to (8)) and using the autonomous form (9), is given by: Proof. The result follows from substitution of (9) into (8). See [20]. (8) (and thus also (11a)) can be compacted into a finite-horizon form, while using the Lyapunov equation Ψ T SΨ = S − W and z i|k = Ψ i z 0|k :

Corollary 1. The infinite-horizon cost function in
where ǫ denotes the terms that are independent of c → and x 0|k = x k .
The key point of Corollary 1 is to simplify the infinite-horizon cost function (11a) into the finite-horizon cost (12).

Constraint Formulations in Terms of Perturbations
Let the system be subject to constraints of the form: Given that the state and input is captured in terms of the autonomous form (9), thus, the inequalities (13) can be written, as follows: where It is noted that to ensure no constraint violations, possible violations in (14) must be checked over an infinite prediction horizon, which would appear to be computationally impractical. However, it is well known [21] that there exists a sufficiently large horizon n ∞ , where any additional linear equalities of (14) for i ≥ n ∞ become redundant, assuming |λ(Φ)| < 1, c i|k = 0 for i ≥ n c , r k is bounded and the constraints contain the steady-state within their interior. Thus, the inequalities (14) can be expressed as a maximal controlled admissible set, as follows: where the matrices (M, N , V and b) can be computed off-line by admissible set algorithms [21,22]. To sum up, the proposed modular MPC can be summarised by Algorithm 1.

Algorithm 1: Modular MPC
At each sampling instant k: 2. Apply the first block element c k = c 0|k of the perturbation sequence c →k within the existing control lawũ k = Kx k + c k , where the perturbation sequence c →k is the minimiser of the optimisation problem (16).

Remark 1. The subtle difference between the proposed modular MPC and dual-mode closed-loop paradigm
MPC (e.g., [19]) is the pre-determined feedback controller. In the dual-mode MPC, the pre-determined controller is state-feedback. In contrast, the modular MPC addresses control problems with an existing output-feedback controller. The plant and controller states are embedded into the optimisation problem (16).

Analysis of the MPC Design upon an Existing Controller
We revisit in Section 3.1 the conditions that ensure the nominal stability and robustness properties of the original closed-loop are retained. The key novelty of this paper begins from Section 3.2, where we derive the key conditions that ensure the preview compensator is systematic and well-designed in a sense that the preview control action only handles the transient of the existing closed-loop dynamics. Moreover, in the rest of Section 3, other theoretical aspects of the modular MPC formulation, such as the practicality and tuning, are discussed.

Interactions between the Modular MPC and Existing Controller
As discussed in Algorithm 1, the perturbation c k is added into the embedded control law (5b); hence, the control input now becomes, as follows: The perturbation c k seems to solely handle the constraints and preview knowledge; however, this might not be true, as illustrated in the following lemma.

Lemma 2 ([14]
). The modular MPC introduces an additional feedback loop to the existing closed-loop system when constraints are inactive.
Proof. Following an unconstrained optimisation problem (16a) in Algorithm 1, the perturbation to the control law is: Substituting (18) into (17) yields:ũ Clearly, as the optimum c k depends upon the state x k , the underlying state feedback gain K is implicitly changed to K − EK cx .
Lemma 2 indicates that the perturbation c k from the modular MPC could potentially change the nominal stability and robustness properties of the underlying controller, even when constraints are not active.
In order to retain the nominal closed-loop dynamics, it is required that the perturbation c k becomes independent of the feedback measurement x k , in other words, the term c  (2), such that the weights Q, R, N satisfy the following conditions: Proof. See [14].
Theorem 1 demonstrates that the extra control layer that satisfies the conditions (20) will not impact on the underlying robust output-feedback control law, unless constraints are predicted to be active. Consequently, in normal operation, the properties of the original closed-loop dynamics are retained and the additional control layer solely handles the upcoming/preview information.
The reader may wonder whether an alternative form of the cost function, where only the measures of c → and r → are considered, and the term that is linked to S xc is neglected, could circumvent the need of the conditions (20). Indeed, the perturbation c from (16a) would then become independent of x k . However, the preview gain P r would then become sub-optimal, which is demonstrated in the following section.

Preview Compensator in the Modular MPC Formulation
In Section 2 and 3.1, we revisit the modular MPC design and important conditions. In Section 3.2, based upon the earlier results, we present the preview compensator design within the modular MPC formulation, which is the key novelty of this paper.
By inspection of the offset-free control law (17), the perturbation input for handling the preview knowledge c →k = P r r →k only requires to respond to the transient of the closed-loop systems, whilst the steady-state is ensured by the embedded control lawũ k = Kx k . For the perturbation input only handling the transient, the preview control gain P r ∈ R n u n c ×n y n a needs to possess certain matrix structures. However, first, before the structure of the preview gain is defined, the concept of the tail or consistency in predictions is revisited [19,23]. The tail or consistency in predictions is known as the solutions of the input predictions, that are optimised at the previous sample, are extended into the candidates of the optimisation at the current sample. For example, when considering the perturbation input predictions c →k at step k and c →k+1 at step k + 1, defined as follows: If the predictions are consistent, then the perturbation input prediction c →k+1 at step k + 1 should possess the following form: From (22), it is shown that the prediction at step k + 1 is consistent with its corresponding prediction at step k, for example c 0|k+1 = c 1|k . To fulfil the requirement of consistency in predictions, consider the general form of the preview gain P r , as follows: where the elements p i,j ∈ R n u ×n y , i ∈ [1, 2, · · · , n c ], j ∈ [1, 2, · · · , n a − 1] need to satisfy the following lemmas.
It is clear that, for example, the perturbation input (c 0|k+1 in (25)) at step k + 1 does not consist of the past reference value (r k ) from step k, that is because the preview action at step k + 1 shouldn't act on the past reference values from step k. Thus, in order for the prediction of the perturbation input (c 1|k ) at step k also not consisting of the past reference value r k , (i.e. c 0|k+1 = c 1|k consistency in predictions), the element p 2,1 needs to be zero and, by induction, p i,j = 0, ∀i > j.
Next, when considering a preview reference signal at steady-state, a well-designed preview control action and its predictions c  Proof. Let a constant reference signal be denoted as r →k = [r ss , r ss , · · · , r ss ]. Substituting the constant reference signal into (24) reveals that for c 0|k = 0 and c 1|k = 0 to hold only if ∑ j p 1,j = 0 and ∑ j p 2,j = 0. By induction, ∑ j p i,j = 0 ∀i. (22) holds if P r in (23) possesses the following form:
and the prediction at step k + 1, c →k+1 is as follows: From (27) and (28), it is clear that c 1|k = c 0|k+1 and by induction, consistency in predictions (22) can be proven.
To summarise, for the perturbation input c →k = P r r →k from the modular MPC only handling the transient of the closed-loop and remaining zero whilst the steady-state is reached, the preview control gain P r is needed to be of the following form: where ∑ j p i,j = 0, ∀i. The systematic and well-designed P r structure (29) ensures the perturbation c k in the embedded control law (17) possesses the property of consistency in predictions. The question is now how to obtain the P r structure (29) from the modular MPC optimisation (8). Thus, the key result of this work is as follows. (18) is of the form (29) if and only if the following conditions are satisfied:

Theorem 2. The preview control gain P r in
Proof. From (18), it is shown that the preview gain is defined as P r = S −1 c S cr . In the first part of this proof, we prove S c is an block diagonal matrix and then, in the second part, S cr is of the form similar to (29). The proof is based on inspection of the Lyapunov equation Ψ T SΨ = S − W, expressed as follows: First, in proving S c being an identity matrix multiplied by a constant, begin from the middle equality of (31): Suppose the conditions (30) are true, then S xc = 0 must be true based on Theorem 1. Subsequently, the equality (32) becomes: Notice that the vector E = [I, 0, · · · , 0] possesses a special property: In addition, the matrix M c also possesses a special property. When considering the term M T c S c M c in (33), define the general form of S c ∈ R n u n c ×n u n c , as follows: The term M T c S c M c in (33) now becomes: Thus, based on the results from (34) and (36), the first row of (33) becomes: and the second row of (33), by inspection of (34) and (36), is as follows: Repeat the step (38) to other rows of (33), by induction, the term S c can be proven to be a block diagonal matrix, as follows: and, furthermore, the inverse of a block diagonal matrix S −1 c is also a block diagonal matrix. Next, let us prove S cr is of the form (29). When considering the middle-right equality in (31): Suppose the conditions (30) are true, then S xc = 0 from Theorem 1. Subsequently, the equality (40) becomes: where E T (B T S x K xr E + B T S xr M r ) are simplified, as follows (E = [I, 0, · · · , 0]): and the term M T c S cr M r possesses some special properties, as follows: Based on (42) and (43), the first row of (41) becomes: Next, we need to prove S  (31): Suppose that the conditions (30) holds, then we can substitute Q (45): Thus, extracting the term (Φ T − I) in (47) yields: Consequently, substituting the result from (48)  . Repeating the step (49), by induction, it reveals that S cr possesses a similar structure as the preview gain P r in (29). Consequently, based on the earlier result S c in (39), the structure of P r = S −1 c S cr is in an equivalent form of (29) if the conditions (30) hold. (30) are equivalent to the conditions (20). Satisfying these conditions is crucial, which can simultaneously ensure that the modular MPC (i) retains the nominal stability and robustness properties of the original closed-loop; and, (ii) provides an optimal preview control action that solely handles the transient closed-loop dynamics. (20) and (30) Based upon the conditions (20) and (30), the readers may wonder whether there exist the weights Q, R for any given feedback controllers K. Indeed, finding a feasible set of Q, R for a stable controller K to be optimal with respect to the cost function (7) is not always guaranteed. Nonetheless, if cross-product terms are allowed in the cost function (7), then one is guaranteed to find some feasible set of Q, R, N ∈ R n x ×n u for any linear feedback controller K. The feedback controller K is optimal with respect to the cost function, which is summarised in the following Theorem 3. (7), a set of weights Q, R, N exists, such that any given linear controller K is optimal with the following cost function:

Theorem 3. If the cross-term N is included in the cost function
and its corresponding conditions in Theorem 1 and 2 are modified, as follows: Proof. The proof is based on some earlier work on the inverse linear quadratic regulator problem [24]. When considering a control law u k = Kx k , every closed-loop system with such a control law is optimal with respect to some cost functions: where R > 0 is any positive-definite matrix. The cost function (52) has shown that with the cross terms, one can always recover the weights for a linear control law u k = Kx k .
Thus, based upon the conditions (51) and given that the stabilising controller K in (5b) is pre-determined, the weights Q, R, N that satisfy (51) can be computed by solving a linear matrix inequality (LMI) problem [25]. For example, consider the convex optimisation problem, as follows [26,27]: By selecting an arbitrary R * > 0 and solving the optimisation problem (53), the inequalities (53b) and equalities (53c), (53d) enforce the weights Q, R, N to satisfy the proposed conditions (51), for any chosen R * > 0.

Tuning of the Modular MPC
The preview horizon n a can be chosen as large as possible. The number of state in the autonomous prediction model (9) increases accordingly and so does the computational cost. As for the control horizon n c , a longer control horizon results in a larger maximal controlled admissible set S (15), which implicitly reduces the chance of infeasibility in optimisation (16). Additionally, more computational power is required for a large n c .

Remark 4. The condition (51) only requires satisfaction of the weights Q, R, N within the cost function (50)
and is independent of the choice of preview and control horizons n a , n c . (20) and (30) So far, it is implicitly assumed that the full-state measurements are available to the modular MPC. In most applications, the full-state measurements are not typically accessible to the controller. Given that the modular MPC is formulated based on the state-space design approach that relies upon the full-state measurements, thus, an observer design is necessary for such applications that without the full-state measurements. Thus, it raises a question as to whether the modular MPC would affect the existing closed-loop if an observer is incorporated or, namely, whether the proposed conditions (20) and (30) hold if the observer is used with the modular MPC. When considering the closed-loop system model (5), the observer is constructed, as follows:x

The Impact of Observer Design for the Modular MPC on the Proposed Conditions
where L ∈ R n x ×n y denotes the observer gain and the closed-loop control law (54b) is a function of the estimatex k of the statex k . Given that the degree-of-freedom of the modular MPC is the perturbation input c k , which is added upon the existing controllerũ k = Kx k + c k . Thus, in order to ensure the modular MPC with an observer does not impact the existing closed-loop in nominal situation, the perturbation input c k is proved to be independent of the estimated statex k , similar to the argument in Theorem 1, in the following Theorem. Proof. When considering the closed-loop system model (5) and the observer system (54), the augmented closed-loop system is defined, as follows: Replacing the closed-loop model matrices (5)  The results from Theorem 4 show that the perturbation input c k in (54b) is independent of the estimated statex k in nominal operation if the conditions (20) are satisfied. However, the accuracy of the predictions of the closed-loop dynamics depends upon the quality of the state estimation. The inaccurate predictions could potentially cause the modular MPC falsely expecting constraint violations, then, the perturbation input c k could become more active than necessary. In such cases, the modular MPC would affect the sensitivities and robustness properties of the existing closed-loop. Nonetheless, tuning the observer to achieve accurate state estimation is process dependent; thus, the readers can refer to [28] for more details on the observer tuning under the MPC framework.

Discussions on Stability and Feasibility when Constraints Are Active
It should be emphasised that, when constraints are active, the robustness of the feedback closed-loop dynamics cannot be retained as the perturbation input c k would then necessarily impact upon the closed-loop as constraint handling is linked to predictions and predictions are based on the current state. Techniques to give absolute robust guarantees during constraint handling, such as LMIs and tube methods [29,30], are known to be cautious as well as computationally challenging and, thus, are not pursued here.
Nevertheless, the nominal stability of the proposed modular MPC during constraint handling can be established based upon the use of infinite horizons and invariant sets, but only assuming the optimisation (8) is feasible at every sample k. The proof is standard in the literature [19], so it is not expanded here. Assume that at the first sample there exists a perturbation input sequence c → that ensures the trajectories of the closed-loop system always satisfy the constraints (13) then, thereafter, recursive feasibility of this assumption alongside optimisation (8) gives an implicit proof the perturbation input c k tends to zero and, thus, the control law defaults to the underlying robust stable feedback.
However, in the presence of model uncertainties, unmodelled disturbances or ambitious constraint requirements alongside large target changes, there might not exist a perturbation input sequence c → that satisfies the constraint set (15); this is so-called infeasibility of optimisation (8). In addition, the steady-state u s i|k , x s i|k could become unreachable due to active constraints. The focus of this paper is on a simple MPC formulation on an output-feedback controller, thus, for tackling the infeasibility in MPC, the readers are referred to some studies, for example, the use of constraint-softening strategies [31,32] and steady-state target calculators [33,34].

Illustrative Examples
In this section, we present numerical examples to demonstrate how easily the modular MPC algorithm can be implemented upon an existing controller. The plant considered in this work, as adopted from [35], is the double integrator with a slow process zero, defined as follows: and the robust controller is given in [35], as follows: K(s) = 3628 s + 11.02 (s + 2)(s + 78. 28) .
Subsequently, when considering a reasonable sampling time T s = 0.02s, the discrete time closed-loop model is characterised by the matrices: Based on the closed-loop model (58), the weights Q, R, N for the MPC cost function (50) can be computed by performing the optimisation (53). Let the preview knowledge be available up to n a = 10 samples and the control horizon is chosen as n c = 10 for demonstration purposes.

Example 1: Handling Preview Information
The control task is to track a step reference signal that happens at 2 s. Figure 2a shows that with the preview knowledge, the proposed modular MPC (the thick solid red line) clearly achieved better tracking with less overshoot than the system with only the original controller (the thin solid blue line). The input effort was also lower when the MPC module anticipated the changes in the preview measurement, as shown in Figure 2b. Furthermore, the perturbation input from the modular MPC is illustrated in Figure 2c. It is clearly shown that the modular MPC is only active between 1.8 s and 2.2 s, where, with the preview horizon n a = 10 (that is 0.2 s), the MPC module noticed a sudden step changes from the preview reference signal and provided additional perturbation input to the closed-loop system for improving the overshoot.

Example 2: Handling Preview and Constraint Information
This example shows how the constraint handling feature is incorporated into the existing controller. The control task is equivalent to the previous example that a step reference is tracked, but, in this example, a constraint is imposed on the input as |u| ≤ 20. Figure 2a,b show the output and input of the original closed-loop system and the modular MPC algorithm with preview and constraint information. In Figure 2a, it is clearly demonstrated that the modular MPC with constraint and preview knowledge (the dashed line) drove the output into the more opposite direction at the beginning (around 1.85 s), as comparing to the MPC layer with only the preview measurement (the thick solid red line). Figure 2b shows how the modular MPC with constraint and preview knowledge (the dashed line) anticipated constraint violation and reacted more aggressively in advance, in comparison to the MPC algorithm with only the preview knowledge (the thick solid red line). In addition, in Figure 2c, it reveals that, when the constraint violation was not expected and the preview signal reached a steady-state, the perturbation input from the modular MPC always remained at zero.

Optimality and Consistency in Predictions
Sections 4.1 and 4.2 showed that the preview action from the modular MPC solely handled the transient of the closed-loop dynamics in the unconstrained case. To demonstrate that the preview action is optimal, consistency in predictions is examined, as suggested by Remark 2. Figure 3 shows the predicted sequences and closed-loop trajectory of the perturbation input at different time instant. At each time instant, the modular MPC predicted the perturbation input sequence (grey solid line) and the first sample of the sequence (star) was then implemented into the system. By inspecting Figure 3, the predictions are consistent with the actual closed-loop input trajectory (dash line). In other words, the tail of the predictions at the previous time sample is included in the predictions at the later time. Thus, the preview control action is optimal with respect to the overall closed-loop behaviour.

Conclusions
This paper has first revisited the modular MPC design where the preview measurements and constraint handling capability are retrofitted into a known output-feedback controller, together with the conditions to ensure the former does not interfere with the closed-loop dynamics provided by the latter. Based upon the modular MPC design, this paper has proposed a preview compensator design procedure within the modular MPC formulation. The key conditions were derived to ensure that the preview compensator is systematic and well-designed, in the sense that the preview control action only handles the transient of the existing closed-loop and once the steady-state is reached, the input from the preview compensator remains at zero. Two key benefits of the modular MPC design were discussed, namely: (i) the sensitivities and robustness properties of the nominal output-feedback controller are retained in the unconstrained case and such robust properties are, to some extent, extended to the constrained case; and, (ii) the preview control with constraint handling can be systematically incorporated into the existing feedback controller without replacing it. Numerical simulation studies have been provided in order to illustrate the efficacy of the modular MPC design.