Lecture 9 Nonlinear Control Design Course Outline Eact-linearization Lyapunov-based design Lab Adaptive control Sliding modes control Literature: [Khalil, ch.s 13, 14.1,14.] and [Glad-Ljung,ch.17] Lecture 1-3 Lecture 4-6 Lecture 7-8 Lecture 9-13 Lecture 14 Modelling and basic phenomena (linearization, phase plane, limit cycles) Analysis methods (Lyapunov, circle criterion, describing functions) Common nonlinearities (Saturation, friction, backlash, quantization) Design methods (Lyapunov methods, Sliding mode & optimal control) Summary Eact Feedback Linearization Eact linearization: eample [one-link robot] Idea: Find state feedback u = u(, v) so that the nonlinear system ẋ = f() + g()u τ l m θ turns into the linear system ẋ = A + Bv and then apply linear control design method. ml θ + d θ + mlg cos θ = u where d is the viscous damping. The control u = τ is the applied torque Design state feedback controller u = u() with = (θ, θ) T Introduce new control variable v and let u = ml v + d θ + mlg cos θ Then θ = v Choose e.g. a PD-controller v = v(θ, θ) = k p (θ ref θ) k d θ This gives the closed-loop system: θ + k d θ + kp θ = k p θ ref Hence, u = ml [k p (θ θ ref ) k d θ] + d θ + mlg cos θ Computed torque Multi-link robot (n-joints) z θ y θ 1 General form M(θ) θ + C(θ, θ) θ + G(θ) = u, θ R n Called fully actuated if n indep. actuators, M n n inertia matri, M = M T > 0 C θ n 1 vector of centrifugal and Coriolis forces G n 1 vector of gravitation terms τ Lyapunov-Based Control Design Methods The computed torque (also known as Eact linearization, dynamic inversion, etc. ) gives closed-loop system u = M(θ)v + C(θ, θ) θ + G(θ) v = K p (θ ref θ) K d θ, (1) θ + K d θ + Kp θ = K p θ Ref The matrices K d and K p can be chosen diagonal (no cross-terms) and then this decouples into n independent second-order equations. ẋ = f(, u) Select Lyapunov function V () for stability verification Find state feedback u = u() that makes V decreasing Method depends on structure of f Eamples are energy shaping as in Lab and, e.g., Back-stepping control design, which require certain f discussed later. 1
Lab : Energy shaping for swing-up control Lab : Energy shaping for swing-up control Use Lyapunov-based design for swing-up control. [movie] Rough outline of method to get the pendulum to the upright position Find epression for total energy E of the pendulum (potential energy + kinetic energy) Let E n be energy in upright position. Look at deviation V = 1 (E E n) 0 Find swing strategy of control torque u such that V 0 Eample of Lyapunov-based design Eample - cont d Consider the nonlinear system ẋ 1 = 3 1 + 1 + u () ẋ = 3, Find a nonlinear feedback control law which makes the origin globally asymptotically stable. We try the standard Lyapunov function candidate V ( 1, ) = 1 ( 1 + ), which is radially unbounded, V (0, 0) = 0, and V ( 1, ) > 0 ( 1, ) (0, 0). V = 1 1 + = ( 3 1 + 1 + u) 1 + ( 3 ) = 3 1 +u 1 + 1 4 We would like to have V < 0 ( 1, ) (0, 0) Inserting the control law, u = 1, we get V = 3 1 1 + 1 4 = 3 }{{} 1 4 < 0, 0 =0 Consider the system ẋ 1 = 3 ẋ = u Find a globally asymptotically stabilizing control law u = u(). Attempt 1: Try the standard Lyapunov function candidate V ( 1, ) = 1 ( 1 + ), which is radially unbounded, V (0, 0) = 0, and V ( 1, ) > 0 ( 1, ) (0, 0). V = 1 1 + = 3 1 + u = ( 1 + u) = 0 }{{} where we chose u = 1 (3) However V = 0 as soon as = 0 (Note: 1 could be anything). According to LaSalle s theorem the set E = { V = 0} = {( 1, 0)} 1 What is the largest invariant subset M E? Plugging in the control law u = 1, we get ẋ 1 = 3 ẋ = 1 (4) Observe that if we start anywhere on the line {( 1, 0)} we will stay in the same point as both ẋ 1 = 0 and ẋ = 0, thus M=E and we will not converge to the origin, but get stuck on the line = 0. Attempt : ẋ 1 = 3 ẋ = u (5) Try the Lyapunov function candidate which satisfies V (0, 0) = 0 V ( 1, ) = 1 1 + 1 4 4, V ( 1, ) > 0, ( 1, ) (0, 0). radially unbounded, compute V = ẋ 1 1 + ẋ 3 = 3 ( 1 + u) = 4 0 if we use u = 1
With u = 1 we get the dynamics ẋ 1 = 3 ẋ = 1 (6) V = 0 if = 0, thus E = { V = 0} = {( 1, 0) 1 } However, now the only possibility to stay on = 0 is if 1 = 0, ( else ẋ 0 and we will leave the line = 0). Thus, the largest invariant set M = (0, 0) According to the Invariant Set Theorem (LaSalle) all solutions will end up in M and so the origin is GAS. Adaptive Noise Cancellation Revisited Let us try the Lyapunov function u b s+a + V = 1 ( + γ a ã + γ b b ) V = + γ a ã ã + γ b b b = b s+â = ( a ã + bu) + γ a ã ã + γ b b b = a where the last equality follows if we choose ẋ + a = bu + â = bu Introduce =, ã = a â, b = b b. Want to design adaptation law so that 0 Invariant set: = 0. ã = â = 1 γ a This proves that 0. b = b = 1 γ b u (The parameters ã and b do not necessarily converge: u 0.) A Control Design Idea, and a Problem Sliding Modes Assume V () = T P, P > 0, represents the energy of ẋ = A + Bu, u [ 1, 1] Idea: Choose u such that V decays as fast as possible ẋ = { f + (), σ() > 0 f (), σ() < 0 f + σ() > 0 f σ() < 0 V = T (A T P + AP ) + B T P u u = sgn(b T P ) Difficulty (theoretical and practical): Infinitely fast switches. ẋ B T P = 0 ẋ The sliding set is where σ() = 0 and f + and f point towards σ() = 0, that is σ() = 0 f + < 0 f > 0 Note: If f + and f point in the same direction on both sides of the set σ() = 0, then the solution curves will just pass through and this region will not belong to the sliding set. Sliding Mode Eample The fast switches will give rise to average dynamics that slide along the set where σ() = 0. The sliding dynamics is where α() is obtained from ẋ = α()f + () + (1 α())f (), 0 = dσ dt = ẋ = f () + α() [ f + () f () ]. ẋ = which means that [ ] [ ] 0 1 1 + u = A + Bu 1 1 1 u = sgnσ() = sgn = sgn(c) ẋ = { A B, > 0 A + B, < 0 Determine the sliding set and the sliding dynamics. 3
The sliding dynamics are the given by ẋ 1 = + u = sgn( ) ẋ = 1 + u = 1 sgn( ) [ ] σ() = 0 f + 1 = 1 1 [ ] f + 1 = 1 + 1 σ() = 0 = 0 f + < 0 1 1 < 0 f > 0 1 + 1 > 0 We thus have the sliding set { 1 < 1 < 1, = 0} ẋ = αf + + (1 α)f 0 = f () + α() [ f + () f () ] On the sliding set { 1 < < 1, = 0}, this gives ] [ ] [ ] [ẋ1 1 + 1 = α + (1 α) 1 1 1 + 1 ẋ Eliminating α gives 0 = 1 + 1 α ẋ 1 = 1 ẋ = 0 Hence, any initial condition the sliding set will give eponential convergence to 1 = = 0. Sliding Mode Dynamics Equivalent Control Assume ẋ = f() + g()u u = sgnσ() has a sliding set on σ() = 0. Then, for (t) staying on the sliding set we should have 0 = σ() = d dt = ( ) f() + g()u The equivalent control is thus given by solving The dynamics along the sliding set in σ() = 0 can also be obtained by finding u = u eq [ 1, 1] such that σ() = 0. u eq is called the equivalent control. ( ) 1 u eq = g() f() for all those such that σ() = 0 and g() 0. Equivalent Control for Linear System More on the Sliding Dynamics ẋ = A + Bu u = sgnσ() = sgn(c) Assume CB invertible. The sliding set lies in σ() = C = 0. 0 = σ() = ( ) f() + g()u = C ( ) A + Bu eq gives CBu eq = CA. Eample (cont d) For the previous system If CB > 0 then the dynamics along a sliding set in C = 0 is ( ) ẋ = A + Bu eq = I (CB) 1 BC A, One can show that the eigenvalues of (I (CB) 1 BC)A equals the zeros of G(s) = C(sI A) 1 B. (eercise for PhD students) u eq = (CB) 1 CA = ( 1 )/1 = 1, because σ() = = 0. Same result as above. Design of Sliding Mode Controller Idea: Design a control law that forces the state to σ() = 0. Choose σ() such that the sliding mode tends to the origin. Assume system has form 1 f 1 () + g 1 ()u d dt. = 1 = f() + g()u. n n 1 Choose control law u = pt f() p T g() µ p T g() sgnσ(), where µ > 0 is a design parameter, σ() = p T, and p T = [ p 1... p n ] represents a stable polynomial. Sliding Mode Control gives Closed-Loop Stability Consider V() = σ ()/ with σ() = p T. Then, V = σ() σ() = T p ( p T f() + p T g()u ) With the chosen control law, we get V = µσ()sgnσ() 0 so σ() 0 as t +. In fact, one can prove that this occurs in finite time. 0 = σ() = p 1 1 + + p n 1 n 1 + p n n = p 1 n (n 1) + + p n 1 (1) n + p n (0) n where (k) denote time derivative. P stable gives that (t) 0. Note: V by itself does not guarantee stability. It only guarantees convergence to the line {σ() = 0} = {p T = 0}. 4
Time to Switch Eample Sliding Mode Controller Consider an initial point such that σ 0 = σ() > 0. Then σ = p T ẋ = p T (f + gu) = µsgn(σ) = µ Hence, the time to the first switch is Note that t s 0 as µ. t s = σ 0 µ < Design state-feedback controller for [ ] [ ] 1 0 1 ẋ = + u 1 0 0 y = [ 0 1 ] Choose p 1 s + p = s + 1 so that σ() = 1 +. The controller is given by u = pt A p T B µ p T B sgnσ() = 1 µsgn( 1 + ) Phase Portrait Time Plots Simulation with µ = 0.5. Note the sliding set is in σ() = 1 +. 1 0 Initial condition (0) = [ 1.5 0 ] T. Simulation agrees well with time to switch t s = σ 0 µ = 3 1 1 1 0 1 1 and sliding dynamics ẏ = y u The Sliding Mode Controller is Robust Implementation Assume that only a model ẋ = f() + ĝ()u of the true system ẋ = f() + g()u is known. Still, however, [ p V T (fĝ T = σ() fg T ] )p p T µ pt g ĝ p T ĝ sgnσ() < 0 if sgn(p T g) = sgn(p T ĝ) and µ > 0 is sufficiently large. Closed-loop system is quite robust against model errors! A relay with hysteresis or a smooth (e.g. linear) region is often used in practice. Choice of hysteresis or smoothing parameter can be critical for performance More complicated structures with several relays possible. Harder to design and analyze. (High gain control with stable open loop zeros) ABS Breaking Net Lectures L10 L1: Optimal control methods L13: Other synthesis methods λ ma L14: Course summary By moving along the dashed arrow, an ABS controller attains higher average friction than what is obtained by locked wheels. Ideally, the slip ratio should be kept at the maimizing value λ ma. 5
Net Lecture Optimal control Read chapter 18 in [Glad & Ljung] for preparation. 6