Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur

Similar presentations


Presentation on theme: "CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur"— Presentation transcript:

1 CIS 540 Principles of Embedded Computation Spring 2015 http://www.seas.upenn.edu/~cis540/ Instructor: Rajeev Alur alur@cis.upenn.edu

2 Pendulum Equilibria Dynamics when external torque is 0: d  = ; d = - g sin  / l Length l Torque u Weight mg Displacement  mg sin  Equilibrium states: =0; sin  =0 Equilibrium state 1: =0;  =0; Pendulum is vertically downwards Equilibrium state 2: =0;  =-  ; Pendulum is vertically upwards CIS 540 Spring 2015; Lecture April 1

3 Lyapunov Stability  Consider a closed continuous-time component H with Lipschitz- continuous dynamics dx/dt = f(x)  Given an initial state s, let x[s] denote the unique state response signal for the initial value problem x(0)=s and dx/dt=f(x)  Consider an equilibrium state s e : if initial state is s e then the response x[s e ] is a constant function of time, always equal to s e  Stability of an equilibrium: when the system is in an equilibrium state, if we perturb its state slightly  As time passes, will the state stay close to the equilibrium state ?  As time passes, will the system eventually return to the equilibrium state? CIS 540 Spring 2015; Lecture April 1

4 Lyapunov Stability Conditions  Suppose the initial state s is close to an equilibrium state s e, does the state along the response signal x[s] stay close to s e ?  If so, the equilibrium s e is said to be stable  Formally, for every  >0, there exists  >0 such that for all states s with ||s e -s|| =0, ||x[s](t)-s e ||<  sese s x(s) Time   CIS 540 Spring 2015; Lecture April 1

5 Lyapunov Stability Conditions  If in addition, the response signal x[s] converges to the equilibrium state s e, then the equilibrium is asymptotically stable  There exists  >0 such that for all states s if ||s-s e || infty x[s](t) exists and equals s e  Note: This is a stronger condition Time sese s x(s)  CIS 540 Spring 2015; Lecture April 1

6 Pendulum Equilibria Length l Torque u Weight mg Displacement  mg sin  Equilibrium state 1: =0;  =0; Pendulum is vertically downwards. Equilibrium state 2: =0;  =-  ; Pendulum is vertically upwards Stable, but not asymptotically stable Unstable ! CIS 540 Spring 2015; Lecture April 1

7 Input-Output Stability Continuous-time Component H Inputs I Outputs O  A continuous-time component H maps input signals I(t) to output signals O(t)  Input-output stability: If we change the input signal slightly, the output signal should change only slightly  Suffices to focus on “bounded” signals CIS 540 Spring 2015; Lecture April 1

8 Input-Output Stability  A signal x(t) is bounded if there exists constant  s.t. ||x(t)||<=  for all times t  Constant signal x(t) = a : Bounded  Linearly increasing signal x(t) = a +bt : Not bounded (assuming b != 0)  Exponential signal x(t) = a + e bt : Bounded if exponent b <= 0  Sinusoidal signals x(t) = a sin bt : Bounded  Bounded-Input-Bounded-Output (BIBO) stability: A continuous-time component H with Lipschitz-continuous dynamics is BIBO stable if: for every bounded input signal I(t), output response signal O(t) from initial state x(0)=0, is bounded CIS 540 Spring 2015; Lecture April 1

9 Helicopter Model (Simplified) Design problem: What torque should the tail rotor apply to keep the helicopter from spinning? Yaw =  Spin (rate of change of yaw) = s Torque by rotor: T Moment of inertia: I X axis Y axis Z axis Rotation: Yaw Equation of motion: ds/dt = T / I CIS 540 Spring 2015; Lecture April 1

10 Stability of Helicopter Model ds = T / I Torque TSpin s  Is the system BIBO stable?  Consider bounded constant input signal T(t) = T 0  Output response from initial state 0 is not bounded: s(t) = T 0 t / I  Not BIBO stable !  What are equilibria ?  Set input torque to 0. If initial spin is c, it will stay c. Thus every value is an equilibrium  Each such equilibrium state c is stable but not asymptotically stable! CIS 540 Spring 2015; Lecture April 1

11 Control Design Problem Plant model as Continuous-time Component H Uncontrolled Inputs Observable Outputs  Design a controller C so that the composed system C || H is stable  Is there a mathematical way to check when a system is stable?  Is there a way to design C so that C||H is stable ?  Yes, if the plant model is linear ! Controllable inputs Controller C CIS 540 Spring 2015; Lecture April 1

12 Linear Component  A linear expression over variables x 1, x 2, … x n is of the form a 1 x 1 + a 2 x 2 + … + a n x n, where a 1, a 2, … are constants (integers/rationals)  A continuous-time component H with state variables S, input variables I, and output variables O is called linear if  For every state variable x, the dynamics is given by dx/dt = f(S,I), where f is a linear expression  For every output variable y, the algebraic equation is given by y = h(S,I), where h is a linear expression  Heatflow, Car, Helicopter: linear; pendulum : nonlinear CIS 540 Spring 2015; Lecture April 1

13 Continuous-time Component Car2 v F dx = v; dv = (F – kv - mg sin  ) / m; real x L <= x <= x U ; v L <= v <= v U  RHS for dv/dt is not linear  Easy fix: Replace disturbance  by another variable  ‘ = sin  real [-  /6,  /6]  CIS 540 Spring 2015; Lecture April 1

14 Continuous-time Component Car2 v F dx = v; dv = (F – kv - mg  ’) / m; Rewriting to normal form: dx = 0x + 1v + 0F + 0  ’ dv = 0x + (-k/m)v + (1/m)F +(-g)  ’ v = 0x + 1v + 0F + 0  ’ real [sin -  /6, sin  /6]  ’ Matrix-based representation: S = [ x I = [ F O = [ v ] v ];  ’] ; dS = A S + B I; O = C S + D I A = 0 1 B = 0 0 0 -k/m 1/m -g C = 0 1 D = 0 0 CIS 540 Spring 2015; Lecture April 1

15 (A,B,C,D) Representation of Linear Components  Suppose a linear continuous-time component has  n state variables S = {x 1, x 2, … x n }  m input variables I = {u 1, u 2, … u m }  k output variables O = {y 1, y 2, … y k }  Then the dynamics is given by dS/dt = A S + B I and O = C S + D I  A is (n x n) matrix  B is (n x m) matrix  C is (k x n) matrix  D is (k x m) matrix  Rate of change of i-th state variable given by dx i /dt = A i,1 x 1 + A i,2 x 2 + … + A i,n x n + B i,1 u 1 + B i,2 u 2 + … + B i,m u m  Value of j-th output variable given by y j = C j,1 x 1 + C j,2 x 2 + … + C j,n x n + D j,1 u 1 + D j,2 u 2 + … + D j,m u m CIS 540 Spring 2015; Lecture April 1

16 Input-Output Linearity Continuous-time Component H Inputs I Outputs O  A continuous-time component H maps input signals I(t) to output signals O(t) (assume a fixed initial state)  Scaling: Suppose O(t) is the output response to a given input signal I(t). Then, for every constant , the response of H to the input signal  I(t) is the output signal  O(t)  Additivity: Suppose the responses of H to the input signals I 1 (t) and I 2 (t) are the output signals O 1 (t) and O 2 (t). Then, the response of H to the input signal (I 1 +I 2 )(t) is the output signal (O 1 +O 2 )(t)  Theorem: If H is linear, then both the above properties hold. CIS 540 Spring 2015; Lecture April 1

17 Response of Linear Systems  Consider a single dimensional linear system with no inputs: dx/dt = ax; Initial state x 0  Execution is given by the signal x(t) = x 0 e at  e p = 1 + p + p 2 /2 + p 3 /3! + p 4 /4! + …  Verify that solution x(t) actually does satisfy the differential eqn  How did we derive it? See notes CIS 540 Spring 2015; Lecture April 1

18 Response of Linear Systems  General case: S contains n variables, system has no inputs, and dynamics is given by: dS/dt = A S; Initial state s 0  Execution is given by the signal S(t) = e At s 0  Matrix exponential e A = I + A + A 2 /2 + A 3 /3! + A 4 /4! + …  What if we have an input signal? dS = A S + B I S(t) = e At s 0 + Integral 0 t [ e A(t-  ) B I(  ) d  ] CIS 540 Spring 2015; Lecture April 1

19 Matrix Exponential  Matrix exponential e A = I + A + A 2 /2 + A 3 /3! + A 4 /4! + …  Is there a way to compute this?  Each term in the sum is (n x n) matrix  If A k = 0 for some k, then sum is finite and can be computed directly  In general case, sum of first k terms will give approximation (with quality of approximation improving with increasing k)  What if A is a diagonal matrix ?  Notation: D(a 1, a 2, … a n ) represents a matrix whose (i,i)-th entry is a i, and (i,j)-th entry, for i != j, is 0  Claim: if A is diagonal matrix D(a 1, a 2, … a n ) then e A is the diagonal matrix D(e a1, e a2, …e an )  Analytical method based on eigenvalues and similarity transformation CIS 540 Spring 2015; Lecture April 1

20 Eigenvalues and Eigenvectors  For an (n x n) matrix A, if the equation A x = x holds, for an n- dimensional non-zero vector x and scalar, then x is called an eigenvector of A, and is called a corresponding eigenvalue  How to compute eigenvalues ?  Consider the set of equations with unknown variables 1, 1, … n determinant (A – I ) = 0  Determinant of a 2 x2 matrix A is A 1,1 A 2,2 - A 1,2 A 2,1  Calculate eigenvalues and eigenvectors of the matrix [[4 6] [1 3]]  Are eigenvectors linearly independent?  What are the eigenvalues of a diagonal matrix?  Calculate eigenvalues and eigenvectors of the matrix [[1 2] [0 1]]  Calculate eigenvalues and eigenvectors of the matrix [[0 1] [-1 0]] CIS 540 Spring 2015; Lecture April 1


Download ppt "CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur"

Similar presentations


Ads by Google