Lectures To Optimal
Lectures To Optimal
LTI System
x Ax Bu, x (t0 )
y Cx Du
Laplace
Transform
Transfer Function
Y (s)
C ( sI A) 1 B D
U (s)
1
9.1 Stability of Zero-Input Response
LTI System
2
9.1 Stability of Zero-Input Response
x Ax Bu, x (t0 )
y Cx Du
t
t e
A ( t t0 ) A(t )
x (t ) e x (t0 ) Bu( )d
0
y (t ) Cx (t ) Du(t )
3
9.1 Stability of Zero-Input Response
x Ax , x (t0 ) x e 0 Axe
4
9.1 Stability of Zero-Input Response
0 1 0
x x u , x0
1 2 1
5
9.1 Stability of Zero-Input Response
6
9.1 Stability of Zero-Input Response
(Definition) Internal stability
The equilibrium is said to be internally stable if, for any x0 in the
region of ||x0 - xe|| < , the trajectory of x starting from x0 stays in
the region of ||x - xe|| < for t 0.
7
9.1 Stability of Zero-Input Response
8
9.1 Stability of Zero-Input Response
9
9.1 Stability of Zero-Input Response
xe x
10
9.1 Stability of Zero-Input Response
11
9.1 Stability of Zero-Input Response
0 1 0
x x , x0
2 2 0.5
12
9.1 Stability of Zero-Input Response
(Definition) Unstability
The equilibrium is said to be unstable if, for any x0 in the region
of ||x0 - xe|| < , the trajectory of x starting from x0 grows
infinitely for t 0.
13
9.2 Stability of Zero-State Response
14
9.2 Stability of Zero-State Response
15
9.2 Stability of Zero-State Response
1 0 0
x x u , x0 0
1 2 1
y 1 1 x
16
9.3 First Lyapunov Method – Linearization
1
9.3 First Lyapunov Method – Linearization
2
9.3 First Lyapunov Method – Linearization
3
9.3 First Lyapunov Method – Linearization
x1 x12 x2 2 1
x2 x1 x2
4
9.3 First Lyapunov Method – Linearization
Energy-Based Analysis
If the system dissipates energy along any trajectory that starts near
the equilibrium state so that the system energy converges to local
minimum, we expect this to correspond to asymptotic convergence
of the trajectory to the equilibrium, thereby indicating an asymptotic
ally stable equilibrium
6
9.4 Second Lyapunov Method – Lyapunov Direct
Energy-Based Analysis
Consider the second-order linear translational
mechanical system,
7
9.4 Second Lyapunov Method – Lyapunov Direct
8
9.4 Second Lyapunov Method – Lyapunov Direct
We observe that system energy is positive whenever [x1, x2]T ≠ [0, 0]T
and attains the minimum value of zero at equilibrium state
x ~
~
[ 1, x 2]T = [0,0]T
9
9.4 Second Lyapunov Method – Lyapunov Direct
Case-I: For zero damping (c = 0) we have dE/dt = 0, so the total system en
ergy is constant along any trajectory
For m = 1 kg, k = 10 N/m, and c = 0 N-s/m along with the initial state
X(0) = X0 = [1, 2]T:
Case-II: For positive damping (c > 0), we have dE/dt < 0 along any trajectory
for which the mass velocity is not identically zero
With c = 1 N-s/m and all other parameters unchanged:
System eigenvalues: λ1,2 = -0.50 ± j3.12, each with negative real part
13
9.4 Second Lyapunov Method – Lyapunov Direct
Case-III: For negative damping (c < 0), we have dE/dt > 0 along any trajecto
ry for which the mass velocity is not identically zero
Finally, with damping coefficient changed to c = -1 N-s/m:
14
9.4 Second Lyapunov Method – Lyapunov Direct
System eigenvalues: λ1,2 = +0.50 ± j3.12, each with positive real part
15
9.4 Second Lyapunov Method – Lyapunov Direct
16
9.4 Second Lyapunov Method – Lyapunov Direct
x v
v x v 3
Consider:
m = 1 and k = 1 1 2 1 2 1 2 2
E kx mv E (x v )
2 2 2
17
9.4 Second Lyapunov Method – Lyapunov Direct
(Definition) Definiteness
For xTAx defined by x 0 and a real symmetric matrix A,
1. If xTAx >0, A is a positive definite(PD) matrix or shortly PD
2. If xTAx 0, A is positive semi-definite(PSD)
3. If xTAx <0, A is negative definite(ND)
4. If xTAx 0, A is negative semi-definite (NSD)
5. If xTAx is negative or positive, A is indefinite.
18
9.4 Second Lyapunov Method – Lyapunov Direct
a11 a12
1 a11 , 2 ,..., n | A |
a21 a22
20
9.4 Second Lyapunov Method – Lyapunov Direct
(Proof)
Choose V(x) = xTPx as the Lyapunov function, where P is a PD
symmetric matrix. Differentiating V(x) gives
21
9.4 Second Lyapunov Method – Lyapunov Direct
T T
T T
V ( x ) x Px x Px ( Ax ) Px x P ( Ax )
x T ( AT P PA) x
In order for the system to be asymptotically stable, it
must be V(x) < 0 for a PD matrix Q.
V ( x ) x T Qx
Comparing equations and yields
ATP+PA = -Q
Therefore, if a PD matrix P that satisfies the above
equation exists, the system becomes asymptotically stable.
22
9.4 Second Lyapunov Method – Lyapunov Direct
Ex: Show that the system is stable using the Lyapunov direct
method.
0 1
x x AT P PA Q
-1 -1
23
9.4 Second Lyapunov Method – Lyapunov Direct
2 1 0
x x u, x0
0 3 1
24
10. Controllability and Observability
10.3 Controllability
Controllability concept
Situations:
We want to design a feedback system with the
desired performance.
We want to control unstable systems.
Questions:
Is it possible to move the initial state x(t0) to the
desired state x(t1) after a finite time by applying
the appropriate input u(t)?
1
10.3 Controllability
Observability concept
Situations:
Some variables are difficult to measure for
feedback.
Some sensors are too expensive. So they can not
be used.
Questions:
Is it possible to know the initial state x(t0) or the
state x(t) from both the input u(t) and the output
y(t) observed for a finite time?
2
10.3 Controllability
(Definition) Controllability
A system is said to be controllable at t = t0 if there is a control
input u(t), t0 < t t1 that can move the initial state x(t0) to the
desired state x(t1) at t = t1.
3
10.3 Controllability
0 1 1 0
x x u, x (t0 ) x0
1 2 0 1
1 0 0 1 Since U = 2 = n,
U [ B AB ] controllable.
0 1 1 2
5
10.3 Controllability
6
10.4 Observability
7
10.4 Observability
(Definition) Observability
A LTI system is said to be observable if there is enough t = t1>0
that u and y determine x0 uniquely. Especially it is observable if
one of the following conditions is true:
1. The rank of the np m observability matrix V is n.
C
CA
V
n-1
CA
8
10.4 Observability
C(sI - A)-1
t
AT T A
Wo e C Ce d , t 0
0
9
10.4 Observability
Example: 0 1 0
Consider a SISO LTI system x x u, x (t0 ) x0
1 2 1
y 1 0 x
C 1 0
V
CA 0 1
10
10.5 Similarity Transformation
Controllable and
observable system
Controllable but
unobservable system
Observable but
uncontrollable system
Uncontrollable and
unobservable system
11
10.5 Similarity Transformation
Controllable subsystem
x Ax Bu, x (t0 ) x0
y Cx Du
x Qx
12
10.5 Similarity Transformation
n1 independent linear
vectors selected from U
13
10.5 Similarity Transformation
Original system
x Ax Bu, x (t0 ) x0
y Cx Du
Similarity transformation x Qx
x Ax Bu
y Cx Du
where
A Q 1 AQ, B Q 1 B, C = CQ, D D
14
10.5 Similarity Transformation
Transformed system
x c Ac A12 xc Bc
u
c 0
x Ac xc 0
xc
y Cc Cc Du
xc
Controllable subsystem
x c Ac xc Bc u
y Cc xc Du
15
10.5 Similarity Transformation
Observable subsystem
x Ax Bu, x (t0 ) x0
y Cx Du
x Q 1 x
16
10.5 Similarity Transformation
q1
q
2 n2 independent vectors
selected from V
where Q qn2
q
n2 1 (n- n2) vectors
randomly chosen such
that Q is nonsingular
qn
17
10.5 Similarity Transformation
Original system
x Ax Bu, x (t0 ) x0
y Cx Du
1
Similarity transformation x Q x
x Ax Bu
y Cx Du
where A QAQ 1 , B QB, C CQ 1 , D D
18
10.5 Similarity Transformation
Transformed system
x o Ao A12 xo Bo
u
x o 0 Ao xo 0
xo
y Co Co Du
xo
Observable subsystem
x o Ao xo Bo u
y Co xo Du
19
10.6 Controllable Canonical Form
Plant
x Ax Bu, x (t0 ) x0
y Cx Du
Assumption
The plant is a SISO LTI system(u and y are scalars)
It is controllable & observable (U = n, V = n)
20
10.6 Controllable Canonical Form
Similarity transformation
Before
x Ax Bu, x (t0 ) x0
y Cx Du
x Qx
After
Q is
x Ax Bu, x (t0 ) x0 nonsingular
y Cx Du
1 1
where A Q AQ, B Q B, C CQ, D =D
21
10.6 Controllable Canonical Form
Controllability
n 1
Before U [ B AB A B ], U n
After U [ B AB Ai 1 B An 1 B ]
The ith term in the above equation
i 1 1 1 1 1 1 i 1
A B (Q AQ )(Q AQ ) (Q AQ )Q B Q A B
Observability
C C
CA
CA
Before V , V n After V
n 1
CA CAn1
(i-1) times
23
10.6 Controllable Canonical Form
After transformation
C C
V CAi 1 CAi 1 Q VQ
n 1 n 1
CA CA
Thus,
V n
Observability is kept after transformation.
24
10.6 Controllable Canonical Form
x Ax Bu, x (t0 ) x0
y Cx Du
where A Q 1 AQ, B Q 1 B, C CQ, D =D
25
10.6 Controllable Canonical Form
Controllable canonical form(SISO)
0 1 0 0 0
0 0 1 0 0
x x u, x (t0 ) x0
0 0 0 1 0
a a 1
n n 1 an 2 a1
Transfer function
(b1 b0 a1 )s n 1 (b2 b0 a2 )s n 1 (bn b0 an )
G( s) n n 1
b0
s a1s an 1s an
26
10.6 Controllable Canonical Form
Conversion procedure
U [ B AB An1 B ]
27
10.6 Controllable Canonical Form
A Q 1 AQ, B Q 1 B, C CQ, D =D
28
11. Regulator
11.1 State Feedback Control
r u d y
F + + + Plant
-
K x
2
11.2 P-Type Regulator
(Theorem) Consider a SISO LTI system
x Ax Bu , x0
r=0 + u = r - Kx y
Plant
-
K
x
3
11.2 P-Type Regulator
Plant (open-loop)
Regulator
x Ax Bu
u Kx
y Cx Du
Feedback (closed-loop)
x Ax Bu (A BK )x +0r
y Cx Du (C DK )x +0r
4
11.2 P-Type Regulator
u = -Kx.
5
11.2 P-Type Regulator
1. Brute force method
Step 1: Obtain the characteristic polynomial from the given
poles: 1 , 2 , , n
n n-1
( ) ( 1 )( 2 ) ( n ) a1 an
( ) I A n a1 n -1 an
qn B
qn 1 AB a1 B
qn 2 A2 B a1 AB a2 B
q1 An 1 B a1 An 2 B an 1 B
Step 5: Obtain
K KQ 1
9
11.2 P-Type Regulator
3. Ackermann formula:
Step 1: Obtain () from the given poles.
( ) ( 1 )( 2 ) ( n ) n a1 n -1 an
( A) An a1 An -1 an 1 A an I
U [ B AB An1 B ]
11
11.3 PI-Type Regulator
Type-n plant
x Ax Bu G ( s ) C ( sI A) 1 B D
y Cx Du K (1 T1' s )(1 T2' s ) (1 Tn' s )
s n (1 T1s )(1 T2 s ) (1 Tn s )
Type-0 plant(n= 0)
x Ax Bu K (1 T1' s )(1 T2' s ) (1 Tn' s )
G (s)
y Cx Du (1 T1s )(1 T2 s ) (1 Tn s )
12
11.3 PI-Type Regulator
x Ax Bu +Wd , x (0)
y Cx Du
13
11.3 PI-Type Regulator
z ydt
x Ax Bu +Wd
z y Cx Du
x A 0 x B W
z C 0 z D u + 0 d
x
y C 0 Du
z
15
11.3 PI-Type Regulator
That is,
x Ax
B u +W d
y Cx Du
x A 0 B W
where x , A , B ,W ,
z C 0 D 0
C C 0 , D D
x
u Kx K1 k2 K1 x k2 ydt
z
K
where can be obtained by one of the previous methods.
17
12. Tracking Controller
12.1 P-Type Tracking Controller
u = Fr - Kx
1
12.1 P-Type Tracking Controller
d
r + u y
F Plant
-
K x
Plant
x Ax Bu , x (0)
y Cx Du
Tracking controller
u = Fr - Kx
Closed-loop system
x ( A BK ) x BFr
y (C DK )x DFr
3
12.1 P-Type Tracking Controller
1 , 2 , , n
Step 2:
Determine the feedforward gain F so that the output follows the
set point without steady-state error.
4
12.1 P-Type Tracking Controller
Calculation of K u = Fr-Kx
Use one of the following methods with the closed-loop poles
1 , 2 , , n
- Brute force method
- Similarity transformation method
- Ackermann formula
Calculation of F
x ( A BK ) x BFr
y (C DK )x DFr
5
12.1 P-Type Tracking Controller
lim[(C DK )( sI A BK ) 1 BF DF ] 1
s0
(C DK )( A BK ) 1 BF DF 1
x Ax Bu+Wd , x (0)
y Cx Du
u = -K1x + k2(r-y)dt
Output should follow the set point without the steady-state error.
7
12.2 PI-Type Tracking Controller
r + + u y
k2 Plant
- -
K1 x
8
12.2 PI-Type Tracking Controller
In order to design the PI-type tracking controller without steady-
state error for a constant disturbance or the type-0 plant, the
new state variable is defined as follows:
z ( y r )dt
x
By defining the augmented vector as x and rewriting the
equations gives z
B u W d 0 r , x (0)
x Ax
1
y Cx Du
where
A 0 B W
A , B , W , C C 0 , D D
C 0 D 0
10
12.2 PI-Type Tracking Controller
x
K
u Kx 1
z
k2 K1 x k2 (r y )dt
d
r + + u y
k2 Plant
- -
K1 x
11
12.2 PI-Type Tracking Controller
into
Substituting u Kx
B u W d 0 r
x Ax
1
the feedback system becomes
) x W d 0 r
x ( A BK
1
12
12.2 PI-Type Tracking Controller
Design procedure
Step 1: Write the augmented system from the system.
(Augmented)
B u W d 0 r , x (0)
x Ax
1
y Cx Du
where
A 0 B W
A , B , W , C C 0 , D D
C 0 D 0
13
12.2 PI-Type Tracking Controller
14
13. State Estimator
13.2 Full State Observer Design
1
13.2 Full State Observer Design
d
r + + u y
k2 Plant
- -
Observer
K1
x
u K1 xˆ k2 (r y )dt
5
13.4 Asymptotic State Observer
Asymptotic state observer Luenberger observer
xˆ Axˆ Bu L( y Cxˆ ), xˆ (t0 )
• Defining the error between the system state and the observer state as
e x xˆ
(Proof) Refer
9
13.4 Asymptotic State Observer
10
13.4 Asymptotic State Observer
Step 2: Find
( A) An a1 An -1 an I
0
Step 4: 0
Obtain the gain matrix L. L ( A)V 1
1
SISO x Ax Bu
Linear quadratic regulator (LQR)
system y Cx Du
Quadratic 1
function J
2
0
xT Qx uT Rudt
u Kx
where K is given by,
1 T
KR B P
T 1 T
A P PA PBR B P Q 0
Optimal control
Step 1: Find the solution P of Riccatti equation from A, B, Q, and R.
AT P PA PBR 1 BT P Q 0
K R 1 BT P
% MATLAB command
[K, P, E]= lqr(A,B,Q,R) % E are the eigenvalues of (A-BK)
3
14.3 P-Type Optimal Regulator
4
14.4 PI-Type Optimal Regulator
x Ax
B u +W d
y Cx Du
x A 0 B W
where x , A , B ,W ,
z C 0 D 0
C C 0 , D D
6
14.4 PI-Type Optimal Regulator
1
J
2 0
uT Rudt
x T Qx
A T P PA
PB
R 1 B T P Q 0
7
14.4 PI-Type Optimal Regulator
regulator to minimize J
J
2 0
x 2 4 z 2 u 2 dt
8
14.5 PI-Type Tracking Controller
z ( y r )dt
Differentiating z = y r
both sides once gives 9
14.5 PI-Type Tracking Controller
B u +W d 0 r
x Ax
1
y Cx Du
x A 0 B W
where x , A , B ,W ,
z C 0 D 0
C C 0 , D D
10
14.5 PI-Type Tracking Controller
Find a control law for the augumented system in terms of
minimizing the following objective function where Q and R are
user-defined weighting matrices.
1
J
2 0
uT Rudt
xT Qx
x
K
u Kx 1
z
k2 K1 x k2 (r y )dt
d
r + + u y
k2 Plant
- -
K1 x
B u W d 0 r , x (0)1
x Ax
1
(Augmented)
y Cx Du
where
A 0 B W
A , B ,W , C C 0 , D D
C 0 0 0
13
14.5 PI-Type Tracking Controller
u = -K1x - k2z
= -K1x + k2(r - y)dt
14
14.5 PI-Type Tracking Controller
x a 0 x b w 0
From the system, z c u+ d - r
0 z 0 0 1
a = -1, b = 2, w = 1, c =1.
The augmented system is 1 0 x 2 w 0
u+ d - r
1 0 z 0 0 1
A B