Feedback Linearization and LQ Based Constrained Predictive Control

Feedback linearization is a powerful technique that allows to obtain linear model with exact dynamics (Isidori,1985), (Slotine & Li, 1991). Linear quadratic control is well known optimal control method and with its dynamic programming properties can be also easily calculated (Anderson & Moore, 1990). The combination of feedback linearization and LQ control has been used in many algorithms in Model Predictive Control applications for many years and it is used also in the current papers (He De-Feng et al.,2011), (Margellos & Lygeros, 2010). Another problem apart from finding the optimal solution on a given horizon (finite or infinite) is the constrained control. A method which uses the advantages of feedback linearization, LQ control and applying signals constraints was proposed in (Poulsen et al., 2001b). In every step it is based on interpolation between the LQ optimal control and a feasible solution – the solution that fulfils given constraints. A feasible solution is obtained by taking calculated from LQ method optimal gain for a perturbed reference signal. The compromise between the feasible and optimal solution is calculating by minimization of one variable – the number of degrees of freedom in prediction is reduced to one variable.


Introduction
Feedback linearization is a powerful technique that allows to obtain linear model with exact dynamics (Isidori,1985), (Slotine & Li, 1991). Linear quadratic control is well known optimal control method and with its dynamic programming properties can be also easily calculated (Anderson & Moore, 1990). The combination of feedback linearization and LQ control has been used in many algorithms in Model Predictive Control applications for many years and it is used also in the current papers (He De-Feng et al.,2011), (Margellos & Lygeros, 2010). Another problem apart from finding the optimal solution on a given horizon (finite or infinite) is the constrained control. A method which uses the advantages of feedback linearization, LQ control and applying signals constraints was proposed in (Poulsen et al., 2001b). In every step it is based on interpolation between the LQ optimal control and a feasible solution -the solution that fulfils given constraints. A feasible solution is obtained by taking calculated from LQ method optimal gain for a perturbed reference signal. The compromise between the feasible and optimal solution is calculating by minimization of one variable -the number of degrees of freedom in prediction is reduced to one variable.
Feedback linearization relies on choosing new state input and variables and then compensating nonlinearities in state equations by nonlinear feedback. The signals from nonlinear system are constrained, they are accessible from linear model through nonlinear equations. Therefore in the interpolation a nonlinear numerical method has to be used. The whole algorithm is operating in a discretized system.
There are several problems while using the method. One of them is that signals from nonlinear system can change its values within given one discrete time interval, while we assume that variables of linear model are unchanged. Those values should be considered as constrained. Another problem is finding the basic feasible perturbed reference signal which will provide well control performance. Method proposed in (Poulsen et. al, 2001b) gives good results if the weight matrices in cost function and the sampling interval are well chosen. Often it is difficult to choose these parameters and in general the solution may provide not only unfeasible signals (violating constraints), but also signals which violate assumption for system equations (like assumption of nonzero values in a denominator of a fraction).
Other method of finding feasible solution proposed in the chapter provides better results of feasibility. The presented method also takes into consideration important feature, that input of nonlinear system changes its value in the sampling interval, while the control value of linearized model is unchanged. The algorithm is applied to the two tanks model and also to the continuous stirred tank reactor model, which operates in an area of unstable equilibrium point. The influence of well chosen perturbed reference signal is presented on charts for those two systems. The chapter is closed by concluding remarks.

Input-output feedback linearization
The main idea in feedback linearization is the assumption that the object described by nonlinear equations is not intrinsically nonlinear but may have wrongly chosen state variables or input. By nonlinear compensation in feedback and new variables one can obtain linear model with embedded original model and its dynamics. A nonlinear SISO model and a feedback law (,) . uv x   (4) Important factor in feedback linearization is a relative degree. This value represents of how many times the output signal has to be differentiated as to obtain direct dependence on input signal. If relative degree r is definite for the system then there is a simple method of obtaining linear system (2) with order r. It can be developed by differentiating r times the output variable y and by choosing new state variables and input as where the derivatives can also be expressed by Lee derivatives The linear system (5) describes the dependence between the new input v and the output y. These equations can be used to design appropriate input v in order to receive desirable output y. If relative degree r is smaller than the order of original nonlinear system n, then to track all state variables x we need additional n-r variables z. For the variables from vector (6) should satisfy condition In that case the system has internal dynamics which has to be taken into consideration in stability analysis. The convenient way to consider the stability of n-r variables which after linearization are unobservable from output y is the analysis the zero dynamic. The zero dynamics is the internal dynamics of the system when the output is kept at zero by input. By using appropriate input and state and then checking the stability of obtained equations it is possible to find out if the system is minimum phase and the unobservable from y variables will converge to a certain value when time tends to infinity.
Feedback linearization method (Isidori,1985), (Slotine & Li, 1991) in the basic version is restricted to the class of nonlinear models which are affine in the input and have smooth functions f(x), g(x), definite relative degree and stable zero dynamics. Therefore algorithms which uses feedback linearization are limited by above conditions.

Unconstrained control
Unconstrained LQ control will be applied to discrete system obtained by feedback linearization of (1) and by discretization of (2) with sampling interval Ts.
In order to track the nonzero reference signal w t we augment the state space system by adding new variable z int with integral action The cost function can be written by then the control law which minimize the cost function (11) , where L is the optimal gain and   0.
T yd LL C  (11) is complete controllable and the weight matrices Q and R are positive definite, then the cost function J t is finite and the control law (12) guarantee stability of the control system (Anderson & Moore 1990).

Constrained predictive control
Constrained variables of nonlinear system (1) Constraints will be included into control law by interpolation method in every step t. It operates by using optimal control law (12) to  original reference signal w t (unconstrained optimal control),  changed reference signal tt t wwp    with p t called perturbation so chosen, that all signals after using control law will satisfy constraints, then using ttt t ww p    one has to minimize in every step α t with constraints (14) while using (10) and (12) to predict future values on prediction horizon. For nonlinear system constrained values depend on signals from linear model through nonlinear functions (3,4) therefore to minimize α t the bisection method was used in simulations.
The α t can take values between 0 (this represents unconstrained control) and 1 (feasible but not optimal solution). If changing control v t have the effect in chan g ing u and every constrained values in monotonic way then the dependence of α t on constrained values is also monotonic and there exists one minimum of α t .
Note that p t is a vector of the size of reference signal w t calculated in the time instant t. The perturbation p t which provide feasible solution can be obtained from previous step by With optimal α t we can rewrite control law from (12): and the state equation (10) with used (16): At the beginning of the algorithm (t=0) we have to find p t in other way -we do not have p t-1 . Several ways of choosing this initial perturbation p 0 will be presented with analysis of its performance in the section 7.1.

Two coupled tanks
Equations describing dynamics of two tanks system presents action of the system. The variables h 1 and h 2 represent levels of a fluid in the first and the second tank. h 2 is also the output of the system. The control input is the inflow q to the first tank and the output is the level in the second tank. More details about this system can be find in (Poulsen et al.2001b).
After replacing the state by vector x and the input by u after some calculation we obtain system (1) with 12 00 12 2 System inflow and the two levels are constrained in this system owing to its structure. Constrains are given by equations: www.intechopen.com

Feedback linearization
By differentiating the output signal and choosing the consequent elements of vector z: While operating on linear model we need to have access to state variables the diffeomorphism (3). We also need equation to calculate the control signal from original system (4).
This can be done via the following equations (calculated as a result of (24) and above):

Continuous stirred tank reactor
The operation of reactor (CSTR) is described by 3 differential equations (27). First equation illustrates the mass balance, where C(t) is the concentration (molar mass) of reaction product measured in [kmol/m 3 ]. The second equation represents the balance of energy in the reactor the balance of energy in the reactor cooling jacked is described by third equation with T(t) -temperature inside the reactor and Tj(t) -temperature in the cooling jacket, both measured in Kelvin.
Thermal energy in the process of cooling and the velocity of reaction are described by additional equations: represents cooling flow through the reactor jacket expressed in [m 3 /h] and is the input of the system. The output variable is the temperature T(t). More detailed explanation of this system can be found in (Zietkiewicz, 2010).
Equations (27) can be rearranged to the simplified form (1)  Constrained value in this system is the inflow of the cooling water to the reactor jacket -the input of the system 33 0m / h 2.5m / h u  The system has an interesting property -three equilibrium points, two stable and one unstable. In normal work the system is operating in the unstable area.

Feedback linearization
The system has order n=3 relative degree r=2. Therefore we obtain two linear equations (two states) differentiating the output the modulus of a is less than 1 therefore the system is minimum phase.
The third state variable satisfying condition (7) will be chosen as

Operating of the algorithm
The control strategy described in sections 2-4 will be developed in this point showing advantages of the algorithm while using it to the two nonlinear systems with constraints.

Initial perturbation
Problem with finding initial perturbation signalized at the end of the section 4, arise because the solution must guarantee constraints, and the constrained values in spite of linearization are not accessible in a linear way. On the other hand this solution should not be too simple and only feasible as it will be shown on charts.
The first way of calculating initial perturbation is the method proposed in (Poulsen et al.2001b). It is based on using zero as the reference signal and the initial state corresponding to the step of original reference signal. We obtain state equation In fig.(1) charts with dashed lines presents signals without perturbation and with zero reference signal, whereas solid lines represent signals with used perturbation obtained from (34). Minimization of the first element in (33) approaches output and input v to zero, minimization of the second element approaches signals to that without using perturbation. Problem appears with the input v which approaches to zero by minimization of the first element of (33) but by minimization of the second element approaches to high negative value. This is visible in the first steps. This value also depends on Q p and R p nonetheless it cannot be chosen arbitrarily close to zero. Too high modulus of v causes signals of nonlinear system to be more didstant from zero, and that can violate constraints. Another way of calculating initial perturbation can be find in (Poulsen et al.2001a) but that method is limited to linear (or Jacobian linearized) models.

Fig. 1. First method of finding the initial perturbation trajectory
To remedy this difficulty we can try to use as the initial perturbation signal which makes w t and automatically other signals unchanged. This however causes problems in working algorithm in next steps and provides week tracking of original reference signal (this will be shown in fig.(11)).
Other way of calculating initial perturbation is to take minimum of 2 After using this cost function (37) with the same Q p and R p as was used in the first method of calculating initial perturbation we obtain signals presented in fig.(2).

Fig. 2. Second method of finding the initial perturbation trajectory
It can be seen from figures (1) and (2) that in the second variant the two input values have smaller absolute values which can have an influence on fulfilling constraints. The second solution is not provide feasible signals for every Q, R, Q p R p , T s but it simplify choosing those parameters.

Constrained values as a dependence of α
After using the third method of obtaining initial perturbation for model of two tanks and reactor we will see how the constrained values are dependent on α t in the first step. Important feature of nonlinear system is that in a sampling interval T s in given step t when v t is constant, u is changing because u is a function of v t and x, which is also changing from x t to x t+1 . We have to monitor this control value as it may violate constraints. We can calculate x in every step from the inversion of (3) but (4) gives as only initial u t at the beginning of T s . Therefore u has to be calculated by integration. However when T s is not to high and u changes monotonically in T s we can use its approximated value at the end of T s calculated from (4) by That value has to be taken in consideration in the algorithm while minimizing α t with constraints.
For the two tanks system we have constrained u, x 1 and x 2 . Constraints are given in (23).
Figures represent how the input and the two variables change for various α t . The system was sampled with T s =5, weight matrices for LQ regulator are given Q=diag(1 1 1), R=0.01 and the weight matrices used to calculate initial perturbation are Q p =0.01* diag(1 1 1), R p =1. Reference signal was changed from 20cm to 40cm.  On above figures it can be seen that the dependence of x and u on α t is monotonic and for small values α t the variables are close to zero end fulfils constraints. We can see that input values at the end of every period T s is very important because it can takes higher values than u t calculated from (4).
The CSTR system has one constrained value -control input u, the constraints are given in equation (29). For simulations the sampling interval was chosen as T s =5s, weight matrices for LQ regulator: Q=diag(1 1 1), R=10 and weight matrices for LQ regulator in first perturbation calculations: Q p =0.1*diag(1 1 1), Rp=10. Reference values was changed from 333K to 338K. www.intechopen.com In figures (7-8) we can see as for the two tank system that constrained values are monotonically dependent on α. Moreover the two unconstrained variables x 1 and x 2 which charts are presented in fig.(9,10) are also monotonically dependent on α therefore those variables could be taken into consideration as constrained variables in the algorithm.

Simulations of the algorithm
In this section the final algorithm is used for two tanks system and then for CSTR system. On every figure time is expressed in seconds. For the two tanks system reference signal was changed from 20cm to 40cm in time 160s, other adjustments were chosen as: T s =8s, Q=diag(1 1 1), R=0.1.
In the first experiment the initial perturbation was chosen so that reference signal and therefore every signals in the system was unchanged. The result is given in fig.(11). In this case if we use perturbed reference trajectory obtained in the described way, in every time instant t changing α t means that the perturbed reference signal is a step in this time instant and it is not changing from time t+1 to the end of original reference signal.
In the upper chart the output is represented by solid line, whereas dotted line means perturbed reference signal (the first value of the perturbed reference signal is taken in every step t). There is visible that from about 250s to 300s the perturbation is the same, in those instants α has to be equal 1. That is a consequence of too low perturbed reference signal which results in too low value of input, which has to be placed by appropriate α at the constraint, in this case zero. In normal work of this algorithm if the active constraint is the constraint of input it should concern values in the first steps distant from the current t.
In the second experiment we will use initial perturbation calculated with cost function (37) and weight matrices Q p =0.1*diag(1 1 1), R p =0.1.
In the second experiment the active constraint is the input and from time 270s the level in the first tank. The regulation time is shorter than in the first experiment, constraints are fulfilled. The fast changes of input value visible from time 150s are the changes within intervals T s .

Conclusion
Model based predictive control attracts interest of researchers for many years as the method which is intuitive and allows to include constraints in the control design. Quadratic cost function in various types are used in MPC. Application of feedback linearization in MPC is also interested issue. Proposed interpolation method allows to reducing the number of degrees of freedom in the prediction. horizon. In the chapter the algorithm which combine interpolation and LQ regulator for feedback linearized system was tested for a CSTR model which is nonlinear and works in unstable area. It has been developed by using new initial perturbation calculating and by taking into consideration input values of unconstrained model which changes within sampling intervals. Model Predictive Control (MPC) usually refers to a class of control algorithms in which a dynamic process model is used to predict and optimize process performance, but it is can also be seen as a term denoting a natural control strategy that matches the human thought form most closely. Half a century after its birth, it has been widely accepted in many engineering fields and has brought much benefit to us. The purpose of the book is to show the recent advancements of MPC to the readers, both in theory and in engineering. The idea was to offer guidance to researchers and engineers who are interested in the frontiers of MPC. The examples provided in the first part of this exciting collection will help you comprehend some typical boundaries in theoretical research of MPC. In the second part of the book, some excellent applications of MPC in modern engineering field are presented. With the rapid development of modeling and computational technology, we believe that MPC will remain as energetic in the future.