Chapter 6 Feedback Linearization - Central idea: To algebraically transform a nonlinear system dynamics into a (fully or partly) linear one linear control techniques can be applied. -Feedback linearization techniques: Ways of transforming original system models into equivalent models of a simpler form. 6.1 Intuitive Concepts Feedback linearization amounts to canceling the nonlinearities in a nonlinear system so that the closed loop dynamics is a linear form 6.1.1 Feedback Linearization and the Canonical Form Example 6.1:Controlling the fluid level in a tank Dynamic model of the tank is d dt h [ A ( h ) dh ] u ( t ) a 2 gh 0 A(h): cross section of the tank a: cross section of the outlet pipe. Figure 6.1:Fluid level control in a tank h0 hd : initial level : desired level The dynamics (6.1) can be rewritten as A ( h ) h u a 2 gh (6.2) If u ( t ) a 2 gh A ( h ) v with v being an "equivalent input" to be specified, the resulting dynamics is linear h v Choosing v h with Then h (6.3) : level error, and > 0 h h ( t ) hd h h 0 (6.4) h ( t ) 0 as t Thus, the nonlinear control law u ( t ) a 2 g h A ( h ) h (6.5) -If the desired level is a known time-varying function hd ( t ) , set v hd ( t ) h h (t ) 0 as t Applying Feedback linearization to companion form or controllable canonical form system Companion Form, or Controllable Canonical Form System A companion form system: x (n) f ( x ) b ( x )u u : scalar control input x : scalar output of interest ( n 1) T x [ x , x , ..., x ] : state vector f(x) and b(x) : nonlinear function of states Using 1 u [v f ] b x (n) =v (6.7) Then, the control law v k 0 x k1 x ... k n 1 x ( n 1) with k i s n k n 1 s n 1 ... k 0 0 has all its roots strictly in the left-half complex plane exponentially stable dynamics x i.e. x (t ) 0 (n) k n 1 x as ( n 1) t ... k 0 x 0 Tracking Desired Output xd(t) the control law v xd (n) k 0 e k 2 e ... k n 1 e ( n 1) (where e(t) = x(t) -xd(t)) exponentially convergent tracking. (6.8) One interesting application of the above control design idea Example 6.2:Feedback linearization of a two-link robot - Tracking control problems arise when a robot hand is required to move along a specified path, e. g., to draw circles. - Control objective : To make the joint positions q1 and q2 follow desired position histories qd1(t) and qd2(t) specified by the motion planning system. Figure 6.2: A two-link robot- Each joint equipped with a motor to provide input torque, an encoder to measure joint position, and a tachometer to measure joint velocity Using Lagrangian equations in classical dynamics, the dynamics of the robot : H 11 H 21 q [ q1 τ 1 hq1 hq 2 q1 g 1 1 0 q 2 g 2 2 H 12 q1 hq 2 H 22 q 2 hq1 q2 ] 2 T T : two joint angles : joint inputs H 11 m 1l c1 I 1 m 2 [ l1 l c 2 2 l1l c 2 cos q 2 ] I 2 2 2 2 H 22 m 2 l c 2 I 2 2 H 12 H 21 m 2 l1l c 2 cos q 2 m 2 l c 2 I 2 2 h m 2 l1l c 2 sin q 2 g 1 m1l c1 g cos q1 m 2 g [ l c 2 cos( q1 q 2 ) l1 cos q1 ] g 2 m 2 l c 2 g cos( q1 q 2 ) - Compact expression H q q C q, q q g q - Multiplying both sides by H 1 Companion form Tracking control (6-10) Using the control law (computed torque) 1 H 11 H 12 v 1 h q 2 h q 1 h q 2 q 1 g 1 H 0 2 21 H 22 v 2 h q 1 q 2 g 2 where 2~ ~ vq d 2 q q with v = [v1 v2 ]T being the equivalent input, ~ qq q being the tracking error and d ~ q a positive number. The tracking error then satisfies the equation ~ ~ 2 q ~ 0 2 q q and converges to zero exponentially. 6.1.2 Input-State Linearization x1 2 x1 ax 2 sin x1 x 2 x 2 cos x1 u cos(2 x1 ) (6.11a) (6.11b) -Linear control design can stabilize the system in a small region around (0, 0) - What controller can stabilize it in a larger region. - Note that the nonlinearity in the first equation cannot be canceled by the control input u. - Consider the new set of state variables: z1 x1 (6.12a) z 2 ax 2 sin x1 z1 2 z1 z 2 z 2 2 z1 cos z1 cos z1 sin z1 au cos(2 z1 ) With equilibrium point at (0,0). (6.13a) (6.13b) Applying 1 u a cos( 2 z 1 ) ( v cos z 1 sin z 1 2 z 1 cos z 1 ) v : an equivalent input to be designed z 1 2 z 1 z 2 z 2 v - Linear and controllable (6.15a) (6.15b) (6.14) Using state feedback control law can place the poles anywhere with proper choices of feedback gains. v k 1 z1 k 2 z 2 For example, v 2 z2 (6.16) in the stable closed-loop dynamics z1 2 z1 z 2 1 2 -2 z2 2 z2 The control law u 1 cos(2 x1 ) ( 2 ax 2 2 sin x1 cos x1 sin x1 2 x1 cos x1 ) (6.17 ) The original state x is given from z by x1 z 1 (6.18a) (6.18b) x 2 ( z 2 sin z 1 ) / a Since both z1 and z2 converge to zero, the original state x converges to zero. Figure 6.3: Input-State Linearization • The inner loop: achieves the linearization of the input-state relation. • The outer loop: achieves the stabilization of the closed-loop dynamics. Remarks • The result is not global. The control law is not well defined when x1 = ( 4 k 2 ), k = 1, 2, … • Different from a Jacobian linearization for small range operation. • The new state components (z1, z2) must be available. If they cannot be measured directly, the original state x must be measured and used to compute them from (6.12) • Uncertainty in the model, e. g., uncertainty on the parameter a, will cause error in the computation of z and u. 6.1.3 Input-Output Linearization Consider the system x f ( x, u ) (6.19a) (6.19b) y h(x) Objective : make y(t) track a desired trajectory yd(t) while keeping the whole state bounded yd(t) : and its nth order derivative are known and bounded. Q: how to design the input u ? Input-Output Linearization Approach Consider the third-order system x 1 sin x 2 ( x 2 1 ) x 3 (6.20a) 5 x 2 x 1 x 3 (6.20b) x 3 x u (6.20c) y x1 (6.20d) 2 1 - Differentiate y twice y ( x 2 1) u f1 (x ) (6.21) f 1 ( x ) ( x1 x 3 )( x 3 cos x 2 ) ( x 2 1) x1 5 2 (6.22) - Choosing u 1 x2 1 ( v f1 ) v : a new input to be determined. yv (6.23) - Letting e = y(t) - yd (t) and choosing v y d k1 e k 2 e (6.24) with k1 and k 2 being positive constants e k 2 e k1 e 0 (6.25) If e (0) e (0) 0, then e ( t ) 0, t 0, otherwise, e(t) converges to zero exponentially. Remarks • The control law is defined everywhere, except at the singularity points such that x2 = -1. • Full state measurement is necessary in implementing the control law. • If we need to differentiate the output of a system r times to generate an explicit relationship between the output y and input u, the system is said to have relative degree r. Internal Dynamics A part of the system dynamics (described by one state component) has been rendered "unobservable" in the input-output linearization, because it cannot be seen from the external input-output relationship (6.21). - For the above example, the internal state can be chosen to be x3, and the internal dynamics is represented by x 3 x 2 1 1 x2 1 ( y d ( t ) k 1 e k 2 e f 1 ) (6.26) - If this internal dynamics is stable (by which we actually mean that the states remain bounded during tracking, i. e., stability in the BIBO sense), our tracking control design problem has indeed been solved. -Otherwise, the above tracking controller is practically meaningless, because the instability of the internal dynamics would imply undesirable phenomena such as the burning-up of fuses or the violent vibration of mechanical members. - The effectiveness of the above control design, based on the reduced-order model (6.21), hinges upon the stability of the internal dynamics. Example 6.3: Internal dynamics Consider the nonlinear system x 1 x u x 2 u 3 2 => x 1 x u y x1 3 2 (6.27a) x 2 u y x 1 x u 3 2 (6.27b) - Control objective: make y track yd (t) - Choosing the control law 3 u x 2 e (t ) y d (t ) substitute into (6.27b) (6.28) ee0 (6.29) The dynamics of x 2 cannot be observed from (6.27b) Applying u to the second dynamic equation : x 2 u x 2 e (t ) y d (t ) 3 x2 x yd e 3 2 y d (t ) e D If where D > 0, then (perhaps after a transient) (6.30) x2 D 1/ 3 x 2 in the internal dynamic is bounded (6.28) is satisfactory The Internal Dynamics of Linear Systems - In general, it is very difficult to directly determine the stability of the internal dynamics because it is nonlinear, non-autonomous, and coupled to the "external" closed-loop dynamics. - Q : How to seek simpler ways of determining the stability of the internal dynamics. Example 6.4: Internal dynamics in two linear systems Consider the simple controllable and observable linear system x 1 x 2 x u 2 u y x1 (6.31a) (6.31b) - Objective : make y(t) track yd (t). - Differentiating y(t) y x 2 u - Choosing u x2 y d ( y y d ) (6.32) e e 0 (where e = y -yd ) and the internal dynamics x 2 x 2 y d e (t ) - e ( t ) 0 and y d is bounded x 2 and u are bounded (6.32) is a satisfactory tracking controller for system (6.31). - Consider a slightly different system: x 1 x 2 u x u 2 (6.33a) y x1 (6.33b) - Applying same control law same tracking error dynamics, but different internal dynamics x 2 x 2 e ( t ) y d x2 and u go to as t . - Transfer functions for system (6.31), W1 ( s ) s 1 s 2 for system (6.33), W2 (s) s 1 s 2 - Same poles but different zeros. - Left half-plane zero at -1 stable - Right half-plane zero at 1 unstable - For all linear system, the internal dynamic is stable if the plant zeros are in the left-half plane. To keep notations simple, let us consider a third-order linear system in state space form T z Az b u yc z (6.34) and having one zero (i.e. two more poles than zeros). - The system's input-output linearization can be facilitated if we first transform it into companion form. - To do this, we note from linear control that the input/output behavior of this system can be expressed in the form b0 b1 s 1 y c ( sI A ) bu T a 0 a1 s a 2 s s 2 Thus, if we define x1 1 a 0 a1 s a 2 s s x 2 x1 x3 x 2 2 3 u 3 u (6.35) the system can be equivalently represented in the companion form x1 0 d x2 0 dt x 3 a 0 y b0 b1 1 0 a1 x1 0 x 2 x 3 0 x 1 0 1 x 2 0 u a 2 x 3 1 (6.36a) (6.36b) -Performing input-output linearization: y b0 x 2 b1 x 3 y b0 x 2 b1 x 3 b0 x 3 b1 ( a 0 x 1 a 1 x 2 a 2 x 3 u ) (6.37) -Input u appears in the second differentiation -The required number of differentiations (the relative degree) = the excess of poles over zeros -Since the input-output relation of y to u is independent of the choice of state variables, it would also take two differentiations for u to appear if we used the original state-space equations (6.34)). Thus, the control law b0 u a 0 x1 a 1 x 2 a 2 x 3 x3 b1 1 b1 (6.38) k 1 e k 2 e yd where e = y - yd , yields an exponentially stable tracking error with k 0 and k 0 : 1 2 e k 2 e k 1 e 0 which is a second order dynamics -The internal dynamics can be described by only one state equation. Since we can show x1, y, y are related to x1, x2, and x3 through a one-to-one transformation (and thus can serve as states for the system). -The internal dynamics can be found from (6.36a) and (6.36b): 1 x 1 x 2 that is, x 1 b0 b1 b1 x1 ( y b0 x 1 ) 1 b1 y (6.39) -Since y is bounded (y = e + yd), we see that the stability of the internal dynamics depends on the location of the pole of the internal dynamics, which is the zero -b0 / b1 of the original transfer function in (6.35). -If the system’s zero is in the left-half plane, which implies that the internal dynamics (6.39) is stable, independently of the initial conditions and of the magnitudes of the desired yd , …, yd (r) (where r is the relative degree). Motivation for Zero Dynamics - Previously discussed transfer functions, on which linear system zeros are based, cannot be defined for nonlinear systems. - Zeros are intrinsic properties of a linear plant, while for nonlinear systems the stability of the internal dynamics may depend on the specific control input. Zero-dynamics for a nonlinear system - Zero-dynamics: the internal dynamics when output is kept at zero by the input. - Consider the system x1 x u 3 2 x2 u y x1 the zero-dynamics is x2 x2 0 3 (6.45) The zero-dynamics (6.45) is asymptotically stable (by using the Lyapunov function V = x22 ). V 2 x2 x2 2 x 0 4 2 -Similarly, for the linear system (6.34), the zero-dynamics is (from (6.39)) x 1 b0 / b1 x 1 0 -Thus, in this linear system, the poles of the zero-dynamics are exactly the zeros of the system. -This result is general for linear systems, and therefore, in linear systems, having all zeros in the left-half complex plane guarantees the global asymptotic stability of the zerodynamics. -For linear systems, the stability of the zerodynamics implies the global stability of the internal dynamics: The left-hand side of (6.39) completely determines its stability characteristics, given that the right-hand side tends to zero or is bounded. -For nonlinear systems, it can be shown for local asymptotic stability of the zero-dynamics is enough to guarantee the local asymptotical stability of the internal dynamics. Though we will not prove it here. To summarize, control design based on inputoutput linearization can be made in three steps: A. differentiate the output y until the input u appears B. choose u to cancel the nonlinearities and guarantee tracking convergence C. study the stability of the internal dynamics