You are on page 1of 138

AOE 5204

Linear Systems Analysis

Last time: Axisymmetric, torque-free rigid body Linear equations, complete analytical solution Asymmetric, torque-free rigid body Nonlinear equations, analytical solution for angular velocities; linearized about principal axis spin

AOE 5204

Rigid Body Dynamics Equations of Motion

The dierential equations are coupled through , as well as through the dependence of force and moment on position, velocity, attitude, and angular velocity The force and moment can also include controls; for example, the torque on a submersible vehicle can include environmental torques due to viscosity, buoyancy, and gravity, as well as control torques due to actuators such as momentum wheels and ns The equations are also nonlinear

The complete set of coupled translational and rotational equations of motion for a rigid body: v f g = I1 h 1 p = m = f (r, v, R, ) = g(r, v, R, )

1 p r m = p + f p = r = Q( q q) = h + g h

AOE 5204

Control of Desired Motions

Many dynamics and control problems involve relatively simple, steady motions Examples straight and level ight of an airplane Earth-pointing attitude of a satellite in a circular orbit straight and level motion of a submersible vehicle straight motion of a surface marine vessel

The nonlinear equations of motion are applicable Disturbances aect the motion (i.e., wind gusts, solar radiation pressure, ocean currents, waves) Controls are used to counter the eects of the disturbances Linearization about the desired motion simplies system analyis and control synthesis

AOE 5204

Linear Systems Analysis and Control

Linearization of the equations of motion Stability analysis Modal analysis PID and LQR control synthesis Controllability and observability Stabilizability and detectability

AOE 5204

General Nonlinear System

The function f is sometimes called the vector eld Often f will not depend on t, and in that case the system is called autonomous, or time-invariant Furthermore, y usually does not depend on u; if y does depend on u, then the system is said to have a feedforward connection between the input and the output

Generally, the equations describing dynamics and control problems can be developed in the form: = f (x, u, t) x y = g(x, u, t)

where x Rn , y Rm , and u Rp The vector x is the state vector, the vector u is the input vector, and the vector y is the output vector

AOE 5204

Linearization

Suppose that there is some constant input, u , and a constant state vector, x , such that = f (x , u , t) = 0 x This combination of input and state is called an equilibrium, = 0 implies that the state since x remains constant Dynamics and control analysts are often interested in the stability of equilibrium motions, and in controlling motions near equilibrium motions

Equations of motion for a pendulum: + g sin = 0 l There is no input, but clearly = 0 and = are two equlibrium solutions Using physical reasoning, we also see that = 0 is stable, whereas = is unstable Exercise

AOE 5204

Linearization (2)

Dene small perturbations away from the equilibrium state and control: x = x + x u = u + u Recall that for a scalar function f (x), the Taylor series is f (x) = f (x + x) = f (x ) + f 0 (x ) x + 1 00 2 f (x ) x + 2!

For the vector functions of vector arguments here, the Taylor series is expressed similarly: f (x) = f (x + x) = f (x ) + f (x ) x + x

where the represent the higher order terms in the Taylor series.

AOE 5204

Linearization (3)
= f (x, u, t) = f (x + x, u + u, t) x

By denition, the term f (x , u , t) = 0, so that the dierential equation is approximated as f f (x , u , t) x + (x , u , t) u x= x u

f The terms x (x , u , t) and trices, respectively f u (x , u , t)

are n n and n p ma-

AOE 5204

Linearization (4)
f f (x , u , t) x + (x , u , t) u x = x u

The rst matrix in the linearized equation

is

where the notation |(x ,u ) denotes that the terms in the matrix are evaluated at (x, u) = (x , u ) This matrix, A(t) is the plant matrix, or simply The Plant If A(t) does not depend on t, then the system is a time-invariant, or constant-coecient system

f (x , u , t) = x

f1 x1

. . .

f1 xn

. . .

fn x1

fn xn

A(t)
(x ,u )

AOE 5204

Linearization (5)
f f (x , u , t) x + (x , u , t) u x = x u

is

This matrix, B(t) is the input matrix

f (x , u , t) = u

f1 u1

. . .

f1 up

. . .

fn u1

fn up

B(t)

(x ,u )

Using these matrix denitions, the linear equation can be written x = A(t) x + B(t) u

AOE 5204

Linearization (6)
f f (x , u , t) x + (x , u , t) u x = x u

The linearized equation

is abbreviated as x = A(t) x + B(t) u Frequently, the and the time-dependence are understood, and the equation is written = Ax + Bu x This is a standard form for the linear state-space dierential equation One also sees = Fx + Gu x

AOE 5204

Linearization (7)
The output equation is handled similarly y y + y y y y = = = = = g(x, u, t) g(x + x, u + u, t) g g (x , u , t) x + (x , u , t) u x u C x + D u Cx + Du

Thus, the general nonlinear system = f ( x, u , t ) x y is approximated by = Ax + Bu x y = Cx + Du = g(x, u, t)

AOE 5204

Linearization Example

Consider the motion of a spinning rigid body with a constant environmental torque. The desired motion of spinning body is = [1 2 3 ]. We want to linearize the equations of motion about the desired motion. Expressed in a principal frame, the environmental torque is ge . The control torque, g , required to maintain the desired motion is easily computed using Eulers equations: g = = I1 I + I1 ge + I1 g = f (x, u) I ge

0 =

I1 I + I1 ge + I1 g = f (x , u )

Given the desired motion, and the environmental torque ge , we can easily compute g , which is clearly constant In this problem, x = , u = g, x = , and u = g

AOE 5204

Rosetta stone: x = , u = g, x = , and u = g Equations in scalar form: 1 2 3 The matrix, = = = I2 I3 2 3 + I1 I3 I1 1 3 + I2 I1 I2 1 2 + I3 is 0

I3 I1 I2 3 I1 I2 I3 2 I2 I3 I1 3 I2 I3 I1 2 I3 I1 I2 1

ge 1 g1 + = f1 (x, u) I1 I1 ge 2 g2 + = f2 (x, u) I2 I2 ge 3 g3 + = f3 (x, u) I3 I3

f ( x , u , t), x

Clearly A depends only on the inertias and the desired steady motion .

f (x , u , t) = x

0
I1 I2 I3 1

AOE 5204

1 I1

ge 1 g1 + = f1 (x, u) I1 I1 ge 2 g2 + = f2 (x, u) I2 I2 ge 3 g3 + = f3 (x, u) I3 I3

f ( x , u , t) u

f (x , u , t) = 0 u 0

0
1 I2

1 I3

0 0 B

As with A, the matrix B is constant and depends only on the inertias. Note that B = I1

AOE 5204

Linearization Example (4)

= A + B g or = Ax + Bu x

Thus, the linearized equations of motion are

where A=

0
I3 I1 I2 3 I1 I2 I3 2

I2 I3 I1 3

0
I1 I2 I3 1

I2 I3 I1 2 I3 I1 I2 1

and

B= 0 0

1 I1

0
1 I2

1 I3

0 0

Note that = , and g = g g . A typical control problem is to determine the control g that will maintain the desired motion in the presence of initial condition errors and other disturbances. A recommended exercise is to choose values of I, ge , and , and then compare the results of integrating the nonlinear dierential equations with the results of integrating the linear equations.

AOE 5204

Stability Analysis
Consider the special case where A is diagonal The dierential equation decouples into the n rst-order dierential equations x 1 x j x n = A11 x1 = Ajj xj = Ann xn

The linearization process serves to shift the origin to the equilibrium of interest Before applying a control, we should determine whether the origin is stable in the absence of any control (i.e., u = 0) = Ax x We further assume that A is constant, so that we have a timeinvariant system Stability analysis is based on the eigenvalues of A

and each solution is immediately integrable as xj (t) = eAjj t xj (0) Exercise: Solve for xj (t)

AOE 5204

Stability Analysis (2)

xj (t) = eAjj t xj (0) The diagonal elements of a diagonal matrix are the eigenvalues of the matrix, typically denoted j (A), j = 1, ..., n

If A is diagonal

If Ajj < 0, then limt xj (t) = 0 If Ajj > 0, then limt xj (t) = Thus, Ajj < 0 stability, And Ajj > 0 instability If all states are stable, then the system is stable. If any of the states are unstable, then the system is unstable.

AOE 5204

Stability Analysis (3)

If any eigenvalue has Re j = 0, then the linear stability analysis is inconclusive We will develop the eigenvalue decomposition next time

More generally, A is not diagonal, and its eigenvalues are either real, or complex conjugate pairs Denote the real and imaginary parts of the eigenvalues by Re j and Im j The stability condition can then be written as Re j < 0 j stability Re j > 0 for any j instability

AOE 5204

Linearization Review
= f (x, u, t) x y = g(x, u, t)

The general nonlinear system of equations is

where the state is x Rn , the input is u Rp , and the output is y Rm Equilibrium motions, (x , u ) satisfy = f (x , u , t) = 0 x Linearization about (x , u ), and simplifying notation with x x gives the linear system = Ax + Bu x y = Cx + Du

AOE 5204

State Feedback Control Preview

= Ax + Bu x y = Cx + Du

General form for linear system is

A standard control application is to let the input depend on the state: u = Kx With this form for the input, the state dynamics equation becomes = Ax BKx x = [A BK] x = Ax As we continue with linear stability analysis, keep in mind that the = Ax is equally applicable to x = Ax analysis of x

AOE 5204

Stability Analysis
Consider the special case where A is diagonal The dierential equation decouples into the n rst-order dierential equations x 1 x j x n = A11 x1 = Ajj xj = Ann xn

The linearization process serves to shift the origin to the equilibrium of interest Before applying a control, we should determine whether the origin is stable in the absence of any control (i.e., u = 0) = Ax x We further assume that A is constant, so that we have a timeinvariant system Stability analysis is based on the eigenvalues of A

and each solution is immediately integrable as xj (t) = eAjj t xj (0) Exercise: Solve for xj (t)

AOE 5204

Stability Analysis (2)

xj (t) = eAjj t xj (0) The diagonal elements of a diagonal matrix are the eigenvalues of the matrix, typically denoted j (A), j = 1, ..., n

If A is diagonal

If Ajj < 0, then limt xj (t) = 0 If Ajj > 0, then limt xj (t) = Thus, Ajj < 0 stability, And Ajj > 0 instability If all states are stable, then the system is stable. If any of the states are unstable, then the system is unstable.

AOE 5204

Stability Analysis (3)

If any eigenvalue has Re j = 0, then the linear stability analysis is inconclusive We will develop the eigenvalue decomposition next time

More generally, A is not diagonal, and its eigenvalues are either real, or complex conjugate pairs Denote the real and imaginary parts of the eigenvalues by Re j and Im j The stability condition can then be written as Re j < 0 j stability Re j > 0 for any j instability

AOE 5204

Eigenvalue Decomposition of A
= Ax x

Work with the zero-input state dynamics equation

Assume solutions of the form x(t) = et e, with constants C, e Cn Substitute into the dierential equation, and obtain et e = Aet e The scalar, et can never be zero, so e = Ae [1 A] e = 0 det [1 A] = 0 p() = 0 characteristic polynomial

AOE 5204

Eigenvalue Decomposition of A (2)

= x Ax, x(t) = et e

det [1 A] = 0 p() = ( 1)( 6) + 2 = 0 2 7 + 8 = 0 = 5.5616, 1.4384

Matlab: eig([1 2; -1 6]) and roots([1 -7 8]) both give this result.

AOE 5204

Eigenvalue Decomposition of A (3)

Generally, there are n eigenvalues (roots of the characteristic polynomial), and they are distinct There can be repeated eigenvalues Eigenvalues can be real or complex; if complex, they always come in complex conjugate pairs If the eigenvalues are distinct, then there are n linearly independent eigenvectors, ej , one associated with each eigenvalue, j Linear independence means that no eigenvector can be written as a linear combination of the remaining eigenvectors With n linearly independent eigenvectors, any vector x Rn can be written as a linear combination of the eigenvectors: x=
n X j =1

cj ej

AOE 5204

Aej = j ej

Each eigenvalue-eigenvector pair satises

We can rewrite as (Exercise) A[e1 en ] = [e1 en ] diag[1 n ] AE = E Since the eigenvectors are linearly independent, the matrix E is non-singular, so A = EE1 Thus, we have factored the matrix A into the product of three matrices, one of which is diagonal (for distinct eigenvalues) This factorization is called the eigenvalue decomposition; there are other matrix decompositions

AOE 5204

A = EE1

We are still assuming distinct eigenvalues, in which case

where E is the eigenvector matrix and is the diagonal eigenvalue matrix = Ax: Recall the assumed form of the solution to x xj (t) = ej t ej Since the eigenvectors are linearly independent, any solution can be written as a linear combination of these n solutions: x(t) =
n X j =1

cj ej t ej

AOE 5204

n X j =1

= Ax is The general solution to x x(t) = cj ej t ej

where the constants cj depend on the initial conditions We can rewrite the summation as (Exercise): x(t) = E diag e
1 t

j t

n t

Note the similarity in the eigenvalue decomposition of A and its application to the solution: A = EE1 x(t) = Eet E1 x(0)

AOE 5204

Eigenvalue Decomposition of A (6)

A = EE1 x(t) = Eet E1 x(0)

For constant A with distinct eigenvalues, we have

Where is the diagonal eigenvalue matrix, E is the eigenvector matrix, and x(0) is the initial state Premultiply the solution by E1 to obtain E1 x(t) = et E1 x(0) Notice that E1 x appears on both sides. Dene z(t) = E1 x(t), and obtain = z z(t) = et z(0) z Thus, for the constant-coecient case, if A has distinct eigenvalues, we can transform the system to a decoupled system

AOE 5204

Eigenvalue Decomposition Example

A = 2 1 1 0.5 2.5 0.5 Matlab: [E,Lambda]=eig(A) 0.5 0.5 1.5 3 0 0 0 1 0 0 0 2 0.7071 0.7071 0 0.7071 0 0.7071 0 0.7071 0.7071 Matlab check: E*Lambda*inv(E) should = A Initial conditions [2 3 1]T

E =

E1 [2 3 1]T

Matlab:

z0 = E\x0

AOE 5204

Eigenvalue Decomposition Example (2)

2 1 1 A = 0.5 2.5 0.5 0.5 0.5 1.5

Started with

or

Found the eigensystem. Transformed initial conditions from x(0) to z(0). Now we can write the solution as 1 0 0 z(t) = z1 (0)e3t 0 + z2 (0)e1t 1 + z3 (0)e2t 0 0 0 1

0.7071 0.7071 0 +c3 e2t 0.7071 0 x(t) = c1 e3t 0.7071 +c2 e1t 0.7071 0 0.7071

AOE 5204

Complex Eigenvalue Example

1 0 0 A = 0 3 2 0 5 3 i 0 0 0 = 0 i 0 0 1 0 0 1 E = 0.5071 + 0.1690i 0.5071 0.1690i 0 0.8452 0.8452 0

is diagonal, but it is also complex. We can create a block-diagonal matrix and block-diagonal eigenvalue matrix as follows Eb = = b = = [Re {e1 } Im {e1 } e3 ] 0 0 1 0.5071 0.1690 0 0.8452 0 0

1 E b AEb 0 1 0 1 0 0 0 0 1

AOE 5204

Complex Eigenvalue Example (2)

System is block-diagonalized. Not quite as good as diagonal, but better than nothing. 0 0 1 Eb = 0.5071 0.1690 0 0.8452 0 0 0 1 0 0 b = 1 0 0 0 1 x(t) = E eb t E1 x(0)
b b

AOE 5204

Complex Eigenvalue Example (3)

x(t)
1 = Eb eb t E b x(0)

z(t) = z(t) = z(t) =

1 E b x(t) eb t z(0)

The block-diagonalization procedure works for complex eigenvalues of the form + i, and makes use of Eulers identity: e+i = e ei e (cos + i sin )

AOE 5204

Linear Systems Analysis

Last time: Review of linearization about equilibrium motions Diagonal systems Eigenvalue decomposition Diagonalization and blockdiagonalization

AOE 5204

Eigenvalue Decomposition of A

If A Rnn has distinct eigenvalues, then we can factor A into the product of three matrices: A = EE1 where is the diagonal matrix of eigenvalues, and E is the matrix of linearly independent eigenvectors. In general, Cnn , and E Cnn With the eigenvalue decomposition, we can write eAt = Eet E1 The advantage of this formulation of the matrix exponential is that 1 t j t n t T t e e e = diag e

AOE 5204

Zero-Input Solution
= Ax x

The solution to the dierential equation

is x(t) = eAt x(0) = Eet E1 x(0) Decoupled system dynamics is obtained by transforming from x to z E1 x(t) = et E1 x(0) z(t) = et z(0) If and E are complex, then a real-valued partial decoupling is possible by dening Eb and b ; e.g.
1 Eb = [Re{e1 } Im{e1 } e3 ] , b = E b AEb

AOE 5204

Block Diagonalization Procedure

If A has complex eigenvalues and eigenvectors, they always come in complex conjugate pairs: j,j +1 = i, ej,j +1 = Re{ej } iIm{ej } For each c.c. pair of eigenvalues and eigenvectors, replace eigenvectors (j and j + 1 columns of E) with Re{ej } and Im{ej }; e.g. Eb = [Re{e1 } Im{e1 } e3 ] Then form the block-diagonal eigenvalue matrix using
1 b = E b AEb

The 2 2 blocks of b associated with the complex conjugate pair will always be in the form Diagonal blocks associated with real eigenvalues are unaected

AOE 5204

Eigenvalue Recognition: Pop Quiz

matrices? 1 4 (c) 0 3 1 11 3 (f ) 0 3 1 0 0 7

What are the eigenvalues of the following 1 0 1 0 (a) (b) 0 3 2 3 1 0 0 1 0 0 (d) 0 3 0 (e) 11 3 0 0 0 7 3 1 7 (g) (h) (i) (j) (k) (l) 2 + 3 + 2 (2 + 3 + 2) ( + 2)( + 1) ( + 2)( + 1) ( + 7)( + 2)( + 1)

AOE 5204

Matrix Exponential and Matrix Functions

The matrix exponential eAt is dened so that its Taylor series is in the same form as that for the scalar exponential e
at

eAt

1 2 2 1 3 3 1 n n = 1 + at + a t + a t + a t + 2! 3! n! 1 2 2 1 3 3 1 n n = 1 + At + A t + A t + A t + 2! 3! n!

The Cayley-Hamilton Theorem: A matrix A satises its own characteristic polynomial: p() = p(A) = n + an1 n1 + + a1 + a0 = 0

An + an1 An1 + + a1 A + a0 1 = 0

Example application: Multiply p(A) by A1 and solve for A1 : A

1

1 n1 n 2 A = + an1 A + + a1 1 a0

AOE 5204

Matrix Exponential Examples

1 2 2 1 1 a t + a3 t3 + an tn + 2! 3! n! 1 1 1 = 1 + At + A2 t2 + A3 t3 + An tn + 2! 3! n! = 1 + at +

AOE 5204

Matrix Exponential Examples (2)

Compute the exponential of a 2 2 block-diagonal matrix, 0 A= 0 eAt = = 1 1 1 1 + At + A2 t2 + A3 t3 + An tn + 2! 3! n! 2 1 0 1 0 0 + t+ t2 + 0 1 0 2! 0 3 1 0 t3 + 3! 0 2 1 0 1 0 0 t2 + + t+ 2 0 0 0 1 2! 3 1 0 t3 + 3 0 3! 1 2 2 1 3 3 t 3! t + 1 2! t + 1 3 3 1 2 2 t + 1 2! t + t + 3! cos t sin t sin t cos t

= =

AOE 5204

Consider complex conjugate eigenvalues 1,2 = i The 2 2 block of b is A =

Instead of Taylor series, apply eAt = Eet E1 The eigenvector matrix and its inverse are 1 1 1/2 i/2 E= and E1 = i i 1/2 i/2 Note that these eigenvectors are not normalized, nor is normalization of eigenvectors required The exponential term is (+i)t e et = 0

0 e(i)t

AOE 5204

Matrix Exponential Examples (4)

Continuing with c.c. eigenvalues 1,2 = i The diagonalized matrix exponential term is (+i)t 0 e et = 0 e(i)t Recall that e(+i)t = et (cos t + i sin t) Carrying out the required matrix multiplication leads to eAt = exp t = 1 1 i i e (cos t + i sin t) 0 0 et (cos t i sin t)t et
t

AOE 5204

Matrix Exponential Examples (5)

An example with 5 eigenvalues: one real, 1 ; two pure imaginary, 2,3 = i1 ; and two complex conjugates, 4,5 = i2 0 0 0 0 1 0 0 0 0 1 0 0 b = 0 1 0 0 0 0 2 0 0 0 2 = e
1 t

eb t

0 0 0 0

0 0 0 0 0 0 cos 1 t sin 1 t sin 1 t cos 1 t 0 0 0 0 et cos 2 t et sin 2 t et sin 2 t et cos 2 t 0 0

Any matrix A that has these ve eigenvalues will have this block diagonal structure

AOE 5204

Cayley-Hamilton

The Cayley-Hamilton Theorem: A matrix A satises its own characteristic polynomial: p(A) = An + an1 An1 + + a1 A + a0 1 = 0

Example application: Multiply p(A) by A1 and solve for A1 : 1 n1 n 2 A + an1 A + + a1 1 A = a0 1 2 A 2 2 example: A = , p() = 2 7 + 8 = 0 1 6 1 1 2 1 0 7 A1 = 1 6 0 1 8 0.7500 0.2500 = 0.1250 0.1250
1

Exercise: check this calculation with Matlab, and try the procedure on some matrices with larger n

AOE 5204

Another Cayley-Hamilton Application

p(A) = An + an1 An1 + + a1 A + a0 1 = 0

Since A satises its own characteristic polynomial,

every higher order power of A can be written as a linear combination of {1, A, A2 , An1 } A useful application of this fact is the expression of eAt : e
At

= = =

1 2 2 1 + At + A t + 2! 0 (t)1 + 1 (t)A + 2 (t)A2 + + n1 (t)An1

1 n X j =0

j (t)Aj

where the j (t) terms are independent functions of time We can calculate the j (t) functions, but the most useful application of this expression is in the development of the conditions for controllability and observability

AOE 5204

Modal Analysis

We have already seen the modal decomposition that arises when we diagonalize or block-diagonalize a linear system A more detailed example: 4 6 1 A = 2 1 1 4 4 4

Block-diagonalize by dening

has eigenvalues (3.6252, 1.3126 i1.9478) (stable or unstable?), and eigenvectors 0.8154 0.8154 0.2565 E = 0.1673 0.2967 + i0.2740 0.2967 i0.2740 0.9520 0.4109 i0.0556 0.4109 + i0.0556
1 Eb = [e1 Re{e2 } Im{e2 }] and b = E b AEb

AOE 5204

Modal Analysis (2)

4 6 1 3.6252 A = 2 1 1 = diag 1.3126 + i1.9478 4 4 4 1.3126 i1.9478 0.8154 0.8154 0.2565 E = 0.1673 0.2967 + i0.2740 0.2967 i0.2740 0.9520 0.4109 i0.0556 0.4109 + i0.0556 Eb 0.2565 0.8154 0 0.2740 = 0.1673 0.2967 0.9520 0.4109 0.0556 3.6252 0 0 0 1.3126 1.9478 = 0 1.9478 1.3126

We can use x, z, or zb

AOE 5204

Modal Analysis (3)

= Ax, x = z , z b = b zb z

x is coupled; z is completely decoupled; zb is partially decoupled With x, one cannot easily see how the three states relate to the eigenvalues and eigenvectors With z, the fact that two states are complex-valued makes it dicult to understand the dynamics With zb , the coupling between z2 and z3 is natural and easily understood Consider the initial condition x(0) = [1 0 0]T Note that the period of the oscillatory motion is T = 2 / , where is the imaginary part of the eigenvalue

AOE 5204

Modal Analysis (4)

100 x1 80 60 40
x

x2 x3

20 0 20 40 0

0.5

1.5 t

2.5

3.5

Initial state is x(0) = [1 0 0]T . Even though x2 (0) = x3 (0), all three states diverge due to the coupling and the instability

AOE 5204

Modal Analysis (5)

40 z1 20 0 20
z

z2 z3

40 60 80 100 0

0.5

1.5 t
T

2.5

3.5

Initial state is x(0) = [1 0 0] z(0) = [0.6897 1.4433 1.1421]T . The state associated with the stable eigenvalue is not unstable

AOE 5204

Modal Analysis (6)

0.1 z1 0 0.1 0.2 z2 z3

0.3 0.4 0.5 0.6 0.7 0

0.5

1.5 t

2.5

3.5

Initial state is z(0) = [0.6897 0 0]T , corresponding to the stable mode. The other states remain zero

AOE 5204

Modal Analysis (7)

40 z1 20 0 20
z

z2 z3

40 60 80 100 0

0.5

1.5 t

2.5

3.5

Initial state is z(0) = [0 1.4433 1.1421]T , corresponding to the unstable mode. The other state remains zero

AOE 5204

Modal Analysis (8)

= Ax to obtain Modal analysis is based on block-diagonalizing x b = b zb z Whereas x is coupled, zb is partially decoupled The real eigenvalues have one-dimensional real modes with exponential (aka rst-order) behavior The complex conjugate eigenvalues have two-dimensional real modes with exponential+oscillatory (aka second-order) behavior By decomposing the motion into dierent modes, we can determine the behavior of a dynamic system and focus attention on specic modes of interest Typically unstable, marginally stable, or barely stable modes are of the most interest

AOE 5204

Back to the Solution

= Ax is x(t) = The solution to the dierential equation x eAt x(0) = Eet E1 x(0), but what about = Ax + Bu ? x Consider the n = p = 1 case x = ax + u x ax = u where a is constant and u is time-varying One way to solve this rst-order ODE is to turn the left-hand side into a total derivative Multiply by an unknown function y (t) and determine the form of y (t) so that the left-hand side is d(xy )/dt xy axy = d (xy) = xy + xy dt

AOE 5204

Back to the Solution (2)

d (xy) = xy + xy dt

Subtract xy from both sides to obtain axy = xy ay = y y (t) = eat y (0)

Choose y (0) = 1, so y (t) = eat Now, back to the original dierential equation (with y(t) in it): d (xy ) = uy d(xy ) = uy dt dt Z t Z ()(t) d(xy ) = uy ( ) d
()(0)

uy ( ) d

AOE 5204

Back to the Solution (2)

x(t)y(t) x(0)y(0) x(t)e
at

= =

x(0)

x(t)eat x(t)

uea d 0 Z t = x(0) + uea d 0 Z t = eat x(0) + eat uea d

0

uy ( ) d
t

The form of the solution for general n and p is the same as above: Z t x(t) = eAt x(0) + eAt eA Bu( ) d
0

The rst term is the zero-input solution, and the second term is the zero-state solution: x(t) = xzi (t) + xzs (t)

AOE 5204

= Ax + Bu is The general solution to x Z t x(t) = eAt x(0) + eAt eA Bu( ) d

0

The rst term is the zero-input solution, and the second term is the zero-state solution: x(t) = xzi (t) + xzs (t) Controllability. Does a control exist such that xzs (tf ) = xf for any xf and nite tf ? If yes, then the system is controllable. The output equation is y = Cx + Du Observability. Does an initial state x(0) exist such that the zeroinput solution produces identically zero output? If so, then the system is unobservable.

AOE 5204

Linear Systems Analysis

Last time: Diagonalization and blockdiagonalization Eigenvalue recognition Cayley-Hamilton Theorem Matrix Exponential

AOE 5204

Another Cayley-Hamilton Application

p(A) = An + an1 An1 + + a1 A + a0 1 = 0

Since A satises its own characteristic polynomial,

every higher order power of A can be written as a linear combination of {1, A, A2 , An1 } A useful application of this fact is the expression of eAt : e
At

= = =

1 2 2 1 + At + A t + 2! 0 (t)1 + 1 (t)A + 2 (t)A2 + + n1 (t)An1

1 n X j =0

j (t)Aj

where the j (t) terms are independent functions of time We can calculate the j (t) functions, but the most useful application of this expression is in the development of the conditions for controllability and observability

AOE 5204

Modal Analysis

We have already seen the modal decomposition that arises when we diagonalize or block-diagonalize a linear system A more detailed example: 4 6 1 A = 2 1 1 4 4 4

Block-diagonalize by dening

has eigenvalues (3.6252, 1.3126 i1.9478) (stable or unstable?), and eigenvectors 0.8154 0.8154 0.2565 E = 0.1673 0.2967 + i0.2740 0.2967 i0.2740 0.9520 0.4109 i0.0556 0.4109 + i0.0556
1 Eb = [e1 Re{e2 } Im{e2 }] and b = E b AEb

AOE 5204

Modal Analysis (2)

4 6 1 3.6252 A = 2 1 1 = diag 1.3126 + i1.9478 4 4 4 1.3126 i1.9478 0.8154 0.8154 0.2565 E = 0.1673 0.2967 + i0.2740 0.2967 i0.2740 0.9520 0.4109 i0.0556 0.4109 + i0.0556 Eb 0.2565 0.8154 0 0.2740 = 0.1673 0.2967 0.9520 0.4109 0.0556 3.6252 0 0 0 1.3126 1.9478 = 0 1.9478 1.3126

We can use x, z, or zb

AOE 5204

Modal Analysis (3)

= Ax, x = z , z b = b zb z

x is coupled; z is completely decoupled; zb is partially decoupled With x, one cannot easily see how the three states relate to the eigenvalues and eigenvectors With z, the fact that two states are complex-valued makes it dicult to understand the dynamics With zb , the coupling between z2 and z3 is natural and easily understood Consider the initial condition x(0) = [1 0 0]T Note that the period of the oscillatory motion is T = 2 / , where is the imaginary part of the eigenvalue

AOE 5204

Modal Analysis (4)

100 x1 80 60 40
x

x2 x3

20 0 20 40 0

0.5

1.5 t

2.5

3.5

Initial state is x(0) = [1 0 0]T . Even though x2 (0) = x3 (0), all three states diverge due to the coupling and the instability

AOE 5204

Modal Analysis (5)

40 z1 20 0 20
z

z2 z3

40 60 80 100 0

0.5

1.5 t
T

2.5

3.5

Initial state is x(0) = [1 0 0] z(0) = [0.6897 1.4433 1.1421]T . The state associated with the stable eigenvalue is not unstable

AOE 5204

Modal Analysis (6)

0.1 z1 0 0.1 0.2 z2 z3

0.3 0.4 0.5 0.6 0.7 0

0.5

1.5 t

2.5

3.5

Initial state is z(0) = [0.6897 0 0]T , corresponding to the stable mode. The other states remain zero

AOE 5204

Modal Analysis (7)

40 z1 20 0 20
z

z2 z3

40 60 80 100 0

0.5

1.5 t

2.5

3.5

Initial state is z(0) = [0 1.4433 1.1421]T , corresponding to the unstable mode. The other state remains zero

AOE 5204

Modal Analysis (8)

= Ax to obtain Modal analysis is based on block-diagonalizing x b = b zb z Whereas x is coupled, zb is partially decoupled The real eigenvalues have one-dimensional real modes with exponential (aka rst-order) behavior The complex conjugate eigenvalues have two-dimensional real modes with exponential+oscillatory (aka second-order) behavior By decomposing the motion into dierent modes, we can determine the behavior of a dynamic system and focus attention on specic modes of interest Typically unstable, marginally stable, or barely stable modes are of the most interest

AOE 5204

Back to the Solution

= Ax is x(t) = The solution to the dierential equation x eAt x(0) = Eet E1 x(0), but what about = Ax + Bu ? x Consider the n = p = 1 case x = ax + u x ax = u where a is constant and u is time-varying One way to solve this rst-order ODE is to turn the left-hand side into a total derivative Multiply by an unknown function y (t) and determine the form of y (t) so that the left-hand side is d(xy )/dt xy axy = d (xy) = xy + xy dt

AOE 5204

Back to the Solution (2)

d (xy) = xy + xy dt

Subtract xy from both sides to obtain axy = xy ay = y y (t) = eat y (0)

Choose y (0) = 1, so y (t) = eat Now, back to the original dierential equation (with y(t) in it): d (xy ) = uy d(xy ) = uy dt dt Z t Z ()(t) d(xy ) = uy ( ) d
()(0)

uy ( ) d

AOE 5204

Back to the Solution (2)

x(t)y(t) x(0)y(0) x(t)e
at

= =

x(0)

x(t)eat x(t)

uea d 0 Z t = x(0) + uea d 0 Z t = eat x(0) + eat uea d

0

uy ( ) d
t

The form of the solution for general n and p is the same as above: Z t x(t) = eAt x(0) + eAt eA Bu( ) d
0

The rst term is the zero-input solution, and the second term is the zero-state solution: x(t) = xzi (t) + xzs (t)

AOE 5204

= Ax + Bu is The general solution to x Z t x(t) = eAt x(0) + eAt eA Bu( ) d

0

The rst term is the zero-input solution, and the second term is the zero-state solution: x(t) = xzi (t) + xzs (t) Controllability. Does a control exist such that xzs (tf ) = xf for any xf and nite tf ? If yes, then the system is controllable. The output equation is y = Cx + Du Observability. Does an initial state x(0) exist such that the zeroinput solution produces identically zero output? If so, then the system is unobservable.

AOE 5204

Controllability

= Ax + Bu is The zero-state solution to x Z t xzs (t) = eAt eA Bu( ) d

0

Controllability. Does a control exist such that xzs (tf ) = xf for any xf and nite tf ? If yes, then the system is controllable. Keep in mind that x Rn , u Rp , A Rnn , and B Rnp Also recall that the Cayley-Hamilton Theorem leads to eAt =
1 n X j =0

j (t)Aj

where the j (t) terms are independent functions of time Remember, the question is: Can we get from zero to anywhere in nite time?

AOE 5204

Controllability (2)
0 1

Consider the system with 1 0 A= , 0 3

B=

Since the system is diagonal, the dynamics are decoupled and the two states are governed by x 1 = x1 and x 2 = 3x2 + u

The control has no eect on x1 ; thus x1 is uncontrollable. There is no control u that can drive x1 to any non-zero value in nite (or even innite) time.

AOE 5204

Controllability (3)

One way to add controllability to the problem in the previous example is to modify the B matrix Consider the system with 1 0 A= , 0 3

B=

1 1

Since the system is diagonal, the dynamics are decoupled and the two states are governed by x 1 = x1 + u and x 2 = 3x2 + u

The control aects both states, and, as we show later, the system is controllable Controllability depends on A and B

AOE 5204

Controllability (4)

= Ax + Bu is The zero-state solution to x Z t xzs (t) = eAt eA Bu( ) d

0

and we want to determine whether any xzs (t) is possible. Z t eA Bu( ) d xzs (t) = eAt 0 Z t = eA(t ) Bu( ) d
0

n 1 X j =0

j (t)Aj

Substitute this sum into the integral

AOE 5204

Controllability (5)
xzs (t) =
n 1 Z t X j =0 0 n 1 X j =0 n 1 X j =0 j

j (t )Aj Bu( ) d Z
t 0

A B

j (t )u( ) d
t 0 t

Z Aj b1 b2 Z

j (t )u1 ( ) d +

j (t )u2 ( ) d + + 0 Z t bp j (t )up ( ) d
0

The integrals are functions of t: Z t jk (t) = j (t )uk ( ) d , k = 1, , p

0

AOE 5204

Controllability (6)
xzs (t) =
n 1 X j =0

Z Aj b1 b2 Z

t 0 t

j (t )u1 ( ) d +

j (t )u2 ( ) d + + 0 Z t bp j (t )up ( ) d
0

0

1 n X j =0

Aj [b1 j 1 (t) + b2 j 2 (t) + + b1 jp (t)]

AOE 5204

Controllability (7)
n 1 X j =0

The zero-state solution is xzs (t) = Aj [b1 j 1 (t) + b2 j 2 (t) + + bp jp (t)]

Suppose that the set of n 1 vectors n1 b1 b1 , Ab1 , , A is linearly independent. Then any state xzs (t) can be written as a linear combination of these n vectors, and the system is controllable One way to state mathematically that the set of vectors is independent is to state that n1 b1 = n rank b1 Ab1 A

AOE 5204

Controllability (8)
n 1 X j =0

If the set of vectors n1 b1 b1 , Ab1 , , A

is not linearly independent, then it has rank < n However, there are still p 1 controls remaining, and perhaps the additional Aj bk vectors can be used to construct a linearly independent set of n vectors One way to state mathematically that the set of vectors provides a set of n linearly independent vectors is n 1 B =n rank B AB A

AOE 5204

Controllability (9)

The test for controllability, therefore, is to construct the controllability matrix, n1 B Mc = B AB A and determine whether it has rank n. If rank B = p, the reduced controllability matrix can be used: np B Mc = B AB A The controllability test for this case is also rank Mc = n What are the dimensions of these two controllability matrices?

AOE 5204

Controllability (10)
0 1

Determine whether system 1 0 A= , 0 3 is controllable. Note that n = 2 and p = 1.

B=

Mc = [B AB] =

0 1

0 3

The columns are linearly dependent and thus rank Mc = 1 The system is not controllable

AOE 5204

Controllability (11)
1 1

Determine whether system 1 0 A= , 0 3 is controllable. Note that n = 2 and p = 1.

B=

Mc = [B AB] =

1 1

1 3

The columns are linearly independent and thus rank Mc = 2 The system is controllable

AOE 5204

Observability
xzi (t) = eAt x(0)

= Ax + Bu is The zero-input solution to x

The output equation is yzi (t) = Cx = CeAt x(0) Observability. Is there an initial condition, x(0) such that yzi (t) = 0 for all time? If not, then the system is observable. Keep in mind that x Rn , y Rm , A Rnn , and C Rmn Also recall that the Cayley-Hamilton Theorem leads to eAt =
1 n X j =0

j (t)Aj

AOE 5204

AOE 5204

Linear System Recap

= f (x, u, t) x y = g(x, u, t)

Standard form for nonlinear system

Equilibrium motions: constant (x , u ) such that f (x , u , t) = Linearization about (x , u ) to obtain = Ax + Bu x y = Cx + Du General solution for time-invariant system Z t x(t) = eAt x(0) + eAt eA Bu( ) d
0

AOE 5204

Linear System With State and Output Feedback

Standard form for linear systems = Ax + Bu x y = Cx + Du Two types of feedback: full-state, and output u = = x u = = x Kx [A BK] x = Ax Ky [A BKC] x = Ax

(Assuming no feedforward) In both cases, the solution can be written as x(t) = eAt x(0)

AOE 5204

An Aside on Linear Algebra

Linear systems analysis depends on many results from linear algebra, so a strong background in linear algebra is important Linear algebra is much more than matrix multiplication, but much of linear algebra involves how matrices multiply other matrices An excellent reference is Gilbert Strang, Linear Algebra and Its Applications An n n matrix A is nonsingular if and only if F F F F F F its rank is n its rows are linearly independent its columns are linearly independent its determinant is non-zero none of its eigenvalues are zero the dimension of its nullspace is zero

AOE 5204

An Aside on Linear Algebra (2)

Many of the matrices we see in linear systems analysis are not square The input matrix is usually (but not always) tall (rows > columns) The output matrix is usually (but not always) short (rows < columns) The controllability matrix is always wide The observability matrix is always tall The rank of a non-square matrix is the maximum of the number of independent rows or the number of independent columns The rank cannot exceed the smallest dimension of the matrix These terms are not necessarily standard, but are suggestive

AOE 5204

Controllability Recap

Controllability depends on the two matrices A, B (A, B) is controllable if the controllability matrix n1 B Mc = B AB A has rank n If rank B = p, the reduced controllability matrix can be used: np B Mc = B AB A The controllability test for this case is also rank Mc = n If a system is controllable, then the eigenvalues of = A BK A can be placed anywhere in the complex plane by appropriate choice of K (provided that the complex eigenvalues come in c.c. pairs)

AOE 5204

Another Controllability Test

Another way to test for controllability is to apply the PopovHautus-Rosenbrock (PHR) test rank [(1 A) B] = n for all Since 1 A has rank n for all values of except for the eigenvalues of A, the test only has to be applied at the eigenvalues Using the controllability matrix test, rank Mc = n, we form a single n np matrix and test its rank Using the PHR test, we form n matrices, each of which is n (n + p), and test the rank of each of them

AOE 5204

Some Controllability Applications

Suppose rank B = n; then (A, B) is controllable because the rst n columns of the controllability matrix are linearly independent Suppose p = 1, and B Rn is an eigenvector of A; then the system is uncontrollable n p B rank Mc = rank B AB A n1 = rank B B B = 1 Relate to the PHR Test Suppose 1 < p < n, and the columns of B, bk Rn , k = 1, , p, are all eigenvectors of A; then the system is uncontrollable np B rank Mc = rank B AB A np = rank B Bs B s = p

where s is the diagonal matrix of the eigenvalues corresponding to the columns of B

AOE 5204

Pole Placement

If (A, B) is controllable then the state-feedback closed-loop eigenvalues (or poles) of = A BK A can be arbitrarily placed in the complex plane by appropriate choice of K, with the restriction that complex eigenvalues must be c.c. pairs Suppose we want the closed-loop characteristic equation to be n1 n1 + + a 1 + a 0 p () = n + a We can form the characteristic polynomial p() and match its coecients with those of p () to determine K There are numerous methods for constructing K to match the coecients

AOE 5204

Pole Placement (2)

Consider the linear system with 1 0 1 0 A= and B = 0 2 0 1 Clearly the system is controllable, since the controllability matrix 1 0 1 0 Mc = [B AB] = [1 A] = has rank n 0 1 0 2 Suppose we want u = Kx, such that 1,2 = (1, 2) Select the elements of K to place the eigenvalues of 1 0 1 0 K11 = A BK = A K21 0 2 0 1 K12 1 K11 = K21 2 K22 K12 K22

AOE 5204

Pole Placement (3)

= ( 1 + K11 )( 2 + K22 ) K21 K12 = 2 + (K11 + K22 3) + (K11 1)(K22 2) K12 K21

The characteristic polynomial is p()

Evidently, for this example, we can choose K12 = K21 = 0, so that p() = The roots are 1,2 = = = i p 1h (K11 + K22 3) (K11 K22 + 1)2 2 1 [(K11 + K22 3) (K11 K22 + 1)] 2 1 K11 , 2 K22 2 + (K11 + K22 3) + (K11 1)(K22 2)

Thus K11 = 2, K22 = 4 1,2 = (1, 2) Determine gains to place the eigenvalues at a specic complex conjugate pair, 1,2 = i . May require non-zero K12 and K21

AOE 5204

Pole Placement (4)

= 2 + (K11 + K22 3) + (K11 1)(K22 2) K12 K21

The characteristic polynomial is p()

Determine gains to place the eigenvalues at a specic complex conjugate pair, 1,2 = i The desired characteristic polynomial is p () = ( i )( + i ) = 2 2 + 2 + 2 For pole placement, we require (K11 + K22 3) = K11 K22 K12 K21 2K11 K22 + 2 = Try K11 K12 K21 2 2 + 2

= K22 = K1 K1 = (3 2 )/2 2 = 2 2 2 + K1 3K1

AOE 5204

Stabilizability

Stabilizability is a less stringent variation of controllability (A, B) is stabilizable if the eigenvalues of = A BK A can be placed in the left half of the complex plane by appropriate choice of K If a system is controllable, then it is stabilizable The Popov-Hautus-Rosenbrock (PHR) test applies to stabilizability as well as to controllability

AOE 5204

Stabilizability (2)

= A BK) can be placed in the left (A, B) is stabilizable if (A half of the complex plane by appropriate choice of K Stability Stabilizability and Controllability Stabilizability The Popov-Hautus-Rosenbrock (PHR) test applies to stabilizability with slight modication rank [(1 A) B] = n for all with Re 0 Since 1 A has rank n for all values of except for the eigenvalues of A, the test only has to be applied at the eigenvalues, and only at the marginally stable and unstable eigenvalues The essence of stabilizability is that all uncontrollable modes are stable and all unstable modes are controllable If a system is unstabilizable, then the D&C folks are in trouble!

AOE 5204

Observability
xzi (t) = eAt x(0)

= Ax + Bu is The zero-input solution to x

The output equation is yzi (t) = Cx = CeAt x(0) Observability. Is there an initial condition, x(0) such that yzi (t) = 0 for all time? If not, then the system is observable. Keep in mind that x Rn , y Rm , A Rnn , and C Rmn Also recall that the Cayley-Hamilton Theorem leads to eAt =
1 n X j =0

j (t)Aj

where the j (t) terms are independent functions of time

AOE 5204

Observability (2)
C= 0 1

Consider a linear system with 1 0 A= , 0 3

Since the states are completely decoupled, the solution to the state zero-input dynamics are x1 = et x1 (0) and x2 = e3t x2 (0) The output dynamics are described by y = Cx = x2 = e3t x2 (0)

Clearly, if we choose any value for x1 (0) and choose x2 (0) = 0, then y = 0 for all time. Thus the system is unobservable, and clearly the unobservability is caused by the lack of a connection between x1 and y .

AOE 5204

Observability (3)

We can obtain observability by adding another sensor, or connection, between the state and the output: 1 0 A= , C= 1 1 0 3 The state zero-input dynamics are x1 = et x1 (0) and x2 = e3t x2 (0) The output dynamics are described by y = Cx = x1 + x2 = et x1 (0) + e3t x2 (0)

Clearly, there are no choices for x1 (0) and x2 (0), such that y = 0 for all time. Thus the system is observable.

AOE 5204

Observability (4)

Recall that the zero-input solution is xzi (t) = eAt x(0). Thus the output solution for zero-input dynamics can be written as yzi = Cxzi (t) = CeAt x(0)

Incorporating the Cayley-Hamilton summation for eAt , we can rewrite yzi as yzi = C
1 n X j =0 1 n X j =0

Recall that C Rmn , and note that CA Rmn also.

AOE 5204

Observability (5)

For there to be a non-zero initial condition x(0) such that yzi = 0, that initial condition would have to satisfy CAj x(0) = 0 for each j = 0, , n

This requirement can be written in matrix form as 0 CA . x(0) = 0, or Mo x(0) = 0 . . CAn1 If rank Mo = n, the system is observable If rank Mo < n, then the system is unobservable there are initial conditions such that the output is identically zero for all time A PHR test for detectability is 1 A rank = n for each eigenvalue C

AOE 5204

Observability (6)
0 0

Consider the linear system: 1 0 A= , 0 3 The observability matrix is Mo = C CA

C=

0 1

1 3

Clearly the rows of Mo are linearly dependent, and hence (A, C) is unobservable If an additional sensor were added, so that C = [1 1], then the system would be observable

AOE 5204

Detectability

Detectability is related to observability in much the same way that stabilizability is related to controllability A system is detectable if the output observes all the unstable modes In the concept of stabilizability, we are concerned with the eigenvalues of the matrix A BK, which arises due to a feedback control of the form u = Kx A system is said to be detectable if an output-injection matrix L exists, such that the matrix A LC is stable (i.e., has all its eigenvalues in the left-half plane) A PHR test for detectability is 1 A rank = n C for each unstable eigenvalue

AOE 5204

Duality

There is a duality between controllability and observability The system (A, B) is controllable if and only if the system (AT , BT ) is observable Similarly, the system (A, B) is stabilizable if and only if (AT , BT ) is detectable

AOE 5204

Summary of C, O, S, D
Observability means any state can be detected in the output Tests: rank Mo 1 A rank C for each eigenvalue = n = n

Controllability means any state can be reached in nite time Tests: rank Mc = n rank [(1 A) B] = n for each eigenvalue

Stabilizability means all eigenvalues can be made stable with feedback Test: rank [(1 A) B] = n for each eigenvalue with Re 0

Detectability means all unstable modes can be detected in the output Test: rank 1 A) C = n

AOE 5204

Last time: Controllability Stabilizability Observability Detectability

AOE 5204

Summary of C, O, S, D
Observability means any state can be detected in the output Tests: rank Mo 1 A rank C for each eigenvalue = n = n

Controllability means any state can be reached in nite time Tests: rank Mc = n rank [(1 A) B] = n for each eigenvalue

Stabilizability means all eigenvalues can be made stable with feedback Test: rank [(1 A) B] = n for each eigenvalue with Re 0

Detectability means all unstable modes can be detected in the output Test: rank 1 A) C = n

AOE 5204

- ilities: Pop Quiz

For each of the following systems, determine stability, controllability, and observability, and explain your reasoning 1 0 1 0 1 0 A= B= C= 0 1 0 1 0 1 1 A= 0 0 0 0 1 0 0 1 1 0 B= 0 1 1 1 C= 1 0 0 0 1 1

1 A= 0 0 5 A= 1 3

0 0 1 0 1 1 0 0 2 0 B = 0 1 1 C = 0 1 1 0 3 1 1 0 0 0 4 0 4 4 1 0 B= 0 1 1 1 C= 1 0 0 0 1 1

AOE 5204

- ilities: Pop Quiz (2)

For each of the following systems, determine stability, controllability, and observability, and explain your reasoning 1 3 1 A= B= C= 1 0 3 1 0 1 0 0 0 4 A = 0 2 B= 1 C= 0 1 1 0 4 2 1 2 3 0 1 0 A = 3 2 B= 1 C= 1 1 1 0 0 3 1 5 0 3 0 0 4 0 A= B= 1 C= 0 1 0 3 0 5 0

AOE 5204

Linearization Example Revisited

Consider the motion of a spinning rigid body with a constant environmental torque. The desired motion of spinning body is = [1 2 3 ]. We want to linearize the equations of motion about the desired motion. Expressed in a principal frame, the environmental torque is ge . The control torque, g , required to maintain the desired motion is easily computed using Eulers equations: g = = I1 I + I1 ge + I1 g = f (x, u) I ge

0 =

I1 I + I1 ge + I1 g = f (x , u )

Given the desired motion, and the environmental torque ge , we can easily compute g , which is clearly constant In this problem, x = , u = g, x = , and u = g

AOE 5204

Rosetta stone: x = , u = g, x = , and u = g Equations in scalar form: 1 2 3 The matrix, = = = I2 I3 2 3 + I1 I3 I1 1 3 + I2 I1 I2 1 2 + I3 is 0

I3 I1 I2 3 I1 I2 I3 2 I2 I3 I1 3 I2 I3 I1 2 I3 I1 I2 1

ge 1 g1 + = f1 (x, u) I1 I1 ge 2 g2 + = f2 (x, u) I2 I2 ge 3 g3 + = f3 (x, u) I3 I3

f ( x , u , t), x

Clearly A depends only on the inertias and the desired steady motion .

f (x , u , t) = x

0
I1 I2 I3 1

AOE 5204

1 I1

ge 1 g1 + = f1 (x, u) I1 I1 ge 2 g2 + = f2 (x, u) I2 I2 ge 3 g3 + = f3 (x, u) I3 I3

f ( x , u , t) u

f (x , u , t) = 0 u 0

0
1 I2

1 I3

0 0 B

As with A, the matrix B is constant and depends only on the inertias. Note that B = I1

AOE 5204

Linearization Example Revisited (4)

= A + B g or = Ax + Bu x

Thus, the linearized equations of motion are

where A=

0
I3 I1 I2 3 I1 I2 I3 2

I2 I3 I1 3

0
I1 I2 I3 1

I2 I3 I1 2 I3 I1 I2 1

and

B= 0 0

1 I1

0
1 I2

1 I3

0 0

Note that = , and g = g g . A typical control problem is to determine the control g that will maintain the desired motion in the presence of initial condition errors and other disturbances. A recommended exercise is to choose values of I, ge , and , and then compare the results of integrating the nonlinear dierential equations with the results of integrating the linear equations.

AOE 5204

Linearization Example Revisited (5)

Use the numerical values from Homework 7: 0 2 0 0 5 = [10 0 6]T A = 3 0 2 0 B = diag[0.0333 0.0250 0.0200] Clearly the input matrix B has rank n, so the system is controllable What if the torque actuator about one of the axes were to fail? Three possibilities: 0.0333 0 0.0333 0 0 0.0250 , B13 = 0 0 , B = B12 = 0 0 0 0.0200 0 0 0 B23 = 0.0250 0 0.0200

AOE 5204

Linearization Example Revisited (6)

3 , we have Assuming no control torque about b 0 2 0 0 5 A = 3 0 2 0 0.0333 0 0 0.0250 B = B12 = 0 0 Controllability matrix: 0.0333 0 0 0.0250 Mc12 = 0 0 0 0.0500 0.1000 0 0 0.0500

Clearly, rank Mc12 = 3, so system is controllable with missing 3) input u3 (control torque about b Note that we used the reduced dimension version of Mc

AOE 5204

2 , we have With no control torque capability about b 0 2 0 0 5 A = 3 0 2 0 0.0333 0 0 0 B13 = 0 0.0200

Clearly, rank Mc13 = 3, so system is controllable with missing 2) input u2 (control torque about b Exercise: Determine the controllability for other failed actuator cases

AOE 5204

Linearization Example Revisited (8)

Block-diagonalization 0 2 0 0.8575 0.4082i 0.4082i 0 5 E= 0 0.8165 0.8165 A = 3 0 2 0 0.5145 0.4082i 0.4082i Eb 0.8575 0 = 0.5145 e = 0 0
0t

0 0.4082 0 0 0 0.8165 0 , b = 0 0 4 0 0.4082 0 4 0

eb t

The matrix exponential, et , turns out to be a rotation matrix The real mode is marginally stable, as are the coupled oscillatory modes

AOE 5204

Linearization Example Revisited (9)

Eb 0.8575 0 0.4082 0 0.8165 0 = 0.5145 0 0.4082

Block-diagonalization

The real mode is marginally stable, as are the coupled oscillatory modes
1 0.8

0.6

0.4

0.2

-0.2

-1

-0.6 -1

b b

AOE 5204

Linearization Example Revisited (10)

To consider observability, we need to dene an output vector Suppose we have three rate gyros capable of measuring the rates about the three principal body axes y = = g(x, u, t) = g(x)

We want to linearize g(x) about x to obtain the output matrix C The matrix, C =
g x

, is g x x = 1C

Since C has rank n, the system is observable if all the sensors are operable What if a sensor fails?

AOE 5204

Linearization Example Revisited (11)

row of

Suppose two of three rate gyros fail; then C is simply one the identity matrix T T T 0 0 0 2 1 0 , 1 , 0 0 C , A= 3 0 0 1 0 2

0 5 0

The three observability matrices are 1 0 0 0 1 0 0 0 1 0 2 0 , 3 0 5 , 0 2 0 Mo 6 6 0 10 0 16 0 0 10 Clearly the rst and third of these observability matrices both have rank 3, but the second has rank 2

2 axis, The system is unobservable with only a rate gyro on the b but is observable with a rate gyro on the rst or third axes

AOE 5204

Look more closely at the unobservable case 0 2 0 0 5 C = [0 1 0] , A= 3 0 2 0 The observability matrix is Mo 0 = 3 0 1 0 0 5 16 0

The initial condition state that is unobservable is the vector x(0) such that Mo x(0) = 0 That is, x(0) N (Mo ); in words, x(0) is in the nullspace of Mo What initial state x(0) satises this condition?

AOE 5204

Linearization Example Revisited (13)

Carrying out the matrix multiplication, we obtain x2 3x1 + 5x3 16x2 = 0 x2 = 0 = 0 x1 = 5x3 /3 = 0 x2 = 0

We want to solve Mo x(0) = 0 0 1 0 x1 0 5 x2 = 0 Mo x(0) = 3 x3 0 16 0

Clearly, any solution must lie along the line spanned by x(0) = 5/3 0 1]T

This line is the same as the eigenvector associated with the zero real eigenvalue (check this claim); this mode is unobservable with a 2-axis rate gyro

AOE 5204

Linearization Example Revisited (14)

Use the PHR test for detectability (1 A) rank = n C for each unstable or marginally stable (01 A) rank C 0 2 0 3 0 5 rank 0 2 0 0 1 0 eigenvalue = n = 2

AOE 5204

Linear Systems Analysis

Last time: Examples of Controllability, Stabilizability, Observability, and Detectability This time: PID (Proportional + Integral + Derivative) Control

AOE 5204

Way Back to Translational Motion

x1 x2 x3 x4 x5 x6 x = = = = = = x y z x y z R6

x 1 x 2 x 3 x 4 x 5 x 6

= = = = = =

x4 x5 x6 fx /m fy /m fz /m

= f (x, u, t) x

In general, the forces fx , fy , and fz could depend on xj and x j , as well as on time t. The forces could also be nonlinear in the states.

AOE 5204

Simple rearrangement of the equations of motion leads to the standard form:

0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 0 = Ax + Bu 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1

x +

Clearly this system is controllable and stabilizable (exercise) Also, the system is in a decoupled form that is common for mechanical systems

AOE 5204

Translational Linear System (2)

0 0 0 0 0 0 0 0 0 = 0 0 0 0 0 0 0 0 0 = Ax + Bu 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 x + 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 u

Looking back to the origin of these equations, recall that

x x j x j = xj +3

= fx /m(= u1 ), so = uj and x j +3 = uj

AOE 5204

Translational Linear System (3)

x j = xj +3 and x j +3 = uj

If we let uj = kp xj kd xj +3 , then j +3 = kp xj kd xj +3 x j = xj +3 and x x j + kd xj +3 + kp xj = 0 x j + kd x j + kp xj = 0 x + kd x + kp x = 0

We can pick the gains kd and kp so that the eigenvalues have negative real parts (detectability) p() kd = 2 = i

= 2 2 + 2 + 2 and kp = 2 + 2

AOE 5204

Translational Linear System (4)

x + kd x + kp x = 0

A standard form for this second-order system is p() kd = 2n = and

2 2 + 2n + n 2 kp = n

The damping ratio, is usually chosen so that [0.5, 0.707], and the natural frequency n is the bandwidth of the system with PD control

AOE 5204

Im

Gain selection in terms of and n : kd = 2n and

2 kp = n

sin1 n

Solution to ODE: ent (c1 cos d t + c2 sin d t) p where d = n 1 2 The damping ratio, is usually chosen so that [0.5, 0.707], and the natural frequency n is the bandwidth of the system with PD control x(t) =

Re d

AOE 5204

Translational Linear System (6)

S tep Response

Suppose the second order system with PD control is subject to a unit step disturbance:
0.5 0.4 To: Ou t(1) Amplitude To: Out( 2)

ustep

0.3

0.2

0.1

0 0.4 0.35 0.3 0.25 0.2 0.15 0.1

1t > 0

0t 0

What happens as t ?

0.05 0

0.5

1.5

2 Time (sec )

2.5

3.5

Answer: The output (x) does not stabilize to the origin. Rather, x() > 1/kp

AOE 5204

Translational Linear System (7)

The dierential equation becomes x + kd x + kp x = ustep + uI

How can we stabilize in presence of step disturbance: x + kd x + kp x = ustep ?

We have feedback control forces that are proportional to the error (kp ) and proportional to the derivative of the error (kd ). Introduce a feedback control force that is proportional to the integral of the error (kI ) uI = kI Z
t

Dierentiate once to get + kp x + kI x xiii + kd x = 0

The roots of the characteristic equation include the two PD eigenvalues and an additional 2 pole at kI /n
2 The term kI /n is typically denoted 1/T , where T is the integral or reset time

x( ) d
t0

AOE 5204

PID Control
Typically, PID control is written as u = kx kTD x Z t k x ( ) d TI t0

PID Control includes three terms: proportional, derivative, and integral: up ud uI = = = kp x

kd x Z t kI x( ) d
t0

This type of control makes the output robust to constant disturbances, but also makes the system less stable (or less damped)

There are several ways to tune the three parameters appearing in the PID control