Controller Design Techniques Observer based state feedback controller
Linear Systems and Control - Week 10
Observer based state feedback controller design
September 9, 2020
Controller Design Techniques Observer based state feedback controller
Controller Design Methods
Controller Design Techniques
Recalling again, we know that there are 3 types of techniques to design
controllers which are:
Full-state feedback controller or state feedback controller
Observer-based state feedback controller
PID controller
Controller Design Techniques Observer based state feedback controller
Controller Design Methods
Controller Design Techniques
Recalling again, we know that there are 3 types of techniques to design
controllers which are:
Full-state feedback controller or state feedback controller
Observer-based state feedback controller
PID controller
Before Mid Exam, we studied the design of full-state feedback controller
and its pre-requisites.
In week 9, we studied the design and pre-requisites of observer-based state
feedback controller.
In this week, we will do simulation of observer-based state feedback con-
troller
Controller Design Techniques Observer based state feedback controller
Controller Design Methods
Observer based state feedback controller
There are 3 pre-requisites to full-fill before we can proceed to design of
observer-based state feedback controller.
Matrix C must NOT be equal to identity and matrix D must be
equal to zero (or absent)
The system must pass controllability test.
The system must pass observability test.
Controller Design Techniques Observer based state feedback controller
Controller Design Methods
Observer based state feedback controller
There are 3 pre-requisites to full-fill before we can proceed to design of
observer-based state feedback controller.
Matrix C must NOT be equal to identity and matrix D must be
equal to zero (or absent)
The system must pass controllability test.
The system must pass observability test.
The first 2 pre-requisites seem easy or familiar but what is observability
test. Let us study observability test.
Controller Design Techniques Observer based state feedback controller
Controller Design Methods
Pre-req 3: Observability Test
A system is observable or it passes observability test if the following criteria
is satisfied:
First, determine the order of the system and call it n.
Second, using n, construct matrix Q follows:
C
CA
2
Q = CA (1)
..
.
CAn−1
Third, compute rank of matrix Q
Finally, check if rank of matrix Q is equal to n or not.
If rank(Q) = n, then the system is observable and we can proceed to
design of controller, otherwise STOP. No controller can be designed.
Controller Design Techniques Observer based state feedback controller
Observer Design using MATLAB
Check whether do we need to design a controller for the following system:
dx1
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x 2 2
x1
y= 1 0
x2
If we need a controller, identify which controller to design, and then design
it and place the eigenvalues at (−3, −5). If you need observer, then place
observer eigen values at (−10, −20).
Controller Design Techniques Observer based state feedback controller
Checking Stability by hand
First, we check stability of this system. The eigenvalues of this system can
be obtained from det(λI − A) = 0
Controller Design Techniques Observer based state feedback controller
Checking Stability by hand
First, we check stability of this system. The eigenvalues of this system can
be obtained from det(λI − A) = 0
λ 0 2 3
det(λI − A) = det −
0 λ 0 5
λ−2 −3
= det
0 λ−5
= (λ − 2)(λ − 5) − (0)(−3)
= (λ − 2)(λ − 5) − (0)
= (λ − 2)(λ − 5)
The eigenvalues of matrix A are at 2 and 5, which indicates it is an
unstable system.
Controller Design Techniques Observer based state feedback controller
Checking Stability using MATLAB
The MATLAB code is as follows: MATLAB code for designing state feed-
back controller
clear;
clc;
A=[2 3; 0 5 ];
disp(’The eigenvalues of matrix A are’)
eig(A)
Controller Design Techniques Observer based state feedback controller
Deciding controller type
Now, which controller to choose?
dx1
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x2 2
x1
y= 1 0
x2
Controller Design Techniques Observer based state feedback controller
Deciding controller type
Now, which controller to choose?
dx1
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x2 2
x1
y= 1 0
x2
As matrix C is NOT equal to identity matrix, we proceed to design of
observer-based state feedback controller.
Controller Design Techniques Observer based state feedback controller
Prerequisite 2- Controllability Test
Let us compute now pre-requisite number 2 which is the controllability
test.
In this case n =
Controller Design Techniques Observer based state feedback controller
Prerequisite 2- Controllability Test
Let us compute now pre-requisite number 2 which is the controllability
test.
In this case n = 2, we matrix P would have the following shape:
P = B AB
Controller Design Techniques Observer based state feedback controller
Prerequisite 2- Controllability Test
Let us compute now pre-requisite number 2 which is the controllability
test.
In this case n = 2, we matrix P would have the following shape:
P = B AB
1 8
P =
2 10
det(P ) = −6
As determinant P is non-zero, so rank(P ) = 2, and it passes control-
lability test.
Controller Design Techniques Observer based state feedback controller
Prerequisite 2- Controllability Test
Let us compute now pre-requisite number 2 which is the controllability
test.
In this case n = 2, we matrix P would have the following shape:
P = B AB
1 8
P =
2 10
det(P ) = −6
As determinant P is non-zero, so rank(P ) = 2, and it passes control-
lability test.
Let us proceed to Observability Test.
Controller Design Techniques Observer based state feedback controller
Solution - Pre requisite 2 - MATLAB Calculations
A=[2 3; 0 5 ];
B=[1; 2];
P=[B A*B]
disp(’The rank of matrix P is ’)
rank(P)
Controller Design Techniques Observer based state feedback controller
Prerequisite 3 - Observability Test
Let us compute now pre-requisite number 3 which is the observability test.
In this case n =
Controller Design Techniques Observer based state feedback controller
Prerequisite 3 - Observability Test
Let us compute now pre-requisite number 3 which is the observability test.
In this case n = 2, we matrix Q would have the following shape:
C 1 0
Q= = (2)
CA 2 3
det(Q) = 3
As determinant Q is non-zero, so rank(Q) = 2, and it passes observ-
ability test.
Controller Design Techniques Observer based state feedback controller
Prerequisite 3 - Observability Test
Let us compute now pre-requisite number 3 which is the observability test.
In this case n = 2, we matrix Q would have the following shape:
C 1 0
Q= = (2)
CA 2 3
det(Q) = 3
As determinant Q is non-zero, so rank(Q) = 2, and it passes observ-
ability test.
Let us proceed to design of controller now.
Controller Design Techniques Observer based state feedback controller
Solution - Pre requisite 3 - MATLAB Calculations
A=[2 3; 0 5 ];
C=[1 0] ;
Q=[C; C*A]
disp(’The rank of matrix Q is ’)
rank(Q)
Controller Design Techniques Observer based state feedback controller
Design Steps - Observer Design
To design controller, first we need to design observer and then state feed-
back controller as follows:
Observer:
Construct matrix L whose size is transpose the size of C
Populate matrix L with elements starting from l1 , l2 and so on
Post-multiply C with L to obtain LC, and then compute
det sI − A − LC
Obtain the desired characteristic equation for observer and compare
coefficients to obtain the values of l1 , l2 , and so on
Controller Design Techniques Observer based state feedback controller
Design Steps - Controller Design
State feedback Controller:
Construct matrix K whose size is transpose the size of B
Populate matrix K with elements starting from k1 , k2 and so on
Pre-multiply B with K to obtain BK, and then compute
det sI − A − BK
Obtain the desired characteristic equation and compare coefficients
to obtain the values of k1 , k2 , k3 and so on
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 1
l
L= 1
l2
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 1
l
L= 1
l2
l1 0
LC =
l2 0
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 1
l
L= 1
l2
l1 0
LC =
l2 0
2 3 l 0
A − LC = − 1
0 5 l2 0
2 − l1 3
A − LC =
−l2 −5
s 0 2 − l1 3
sI − (A − LC) = −
0 s −l2 −5
s − 2 + l1 −3
sI − (A − LC) =
l2 s−5
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 2
s − 2 − l1 −3
sI − (A − LC) =
−l2 s−5
det(sI − (A − LC)) =
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 2
s − 2 − l1 −3
sI − (A − LC) =
−l2 s−5
det(sI − (A − LC)) = s2 + (l1 − 7)s + (−5l1 + 3l2 + 10)
Now lets compare it with desired characteristic equation:
(s + 10)(s + 20) = s2 + 30s + 200
Compare coefficients to obtain values of l1 and l2 .
Controller Design Techniques Observer based state feedback controller
Solution - Observer Design Slide 2
s − 2 − l1 −3
sI − (A − LC) =
−l2 s−5
det(sI − (A − LC)) = s2 + (l1 − 7)s + (−5l1 + 3l2 + 10)
Now lets compare it with desired characteristic equation:
(s + 10)(s + 20) = s2 + 30s + 200
Compare coefficients to obtain values of l1 and l2 .
We obtain l1 = 37 and l2 = 125
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 1
K = k1 k2
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 1
K = k1 k2
k1 k2
BK =
2k1 2k2
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 1
K = k1 k2
k1 k2
BK =
2k1 2k2
2 − k1 3 − k2
A − BK =
0 − 2k1 5 − 2k2
s 0 2 − k1 3 − k2
sI − (A − BK) = −
0 s 0 − 2k1 5 − 2k2
s − 2 + k1 −3 + k2
sI − (A − BK) =
2k1 2k2 + s − 5
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 2
s − 2 + k1 −3 + k2
sI − (A − BK) =
2k1 2k2 + s − 5
det(sI − (A − BK)) =
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 2
s − 2 + k1 −3 + k2
sI − (A − BK) =
2k1 2k2 + s − 5
det(sI − (A − BK)) = s2 + (k1 + 2k2 − 7)s + (−4k2 + 10)
Now lets compare it with desired characteristic equation:
(s + 3)(s + 5) = s2 + 8s + 15
Compare coefficients to obtain values of k1 and k2 .
Controller Design Techniques Observer based state feedback controller
Solution - State Feedback Controller - Slide 2
s − 2 + k1 −3 + k2
sI − (A − BK) =
2k1 2k2 + s − 5
det(sI − (A − BK)) = s2 + (k1 + 2k2 − 7)s + (−4k2 + 10)
Now lets compare it with desired characteristic equation:
(s + 3)(s + 5) = s2 + 8s + 15
Compare coefficients to obtain values of k1 and k2 .
We obtain k1 = 11.67 and k2 = 1.67
Controller Design Techniques Observer based state feedback controller
Complete Solution of Controller Design
clear;
clc;
A=[2 3; 0 5 ];
B=[1; 2];
C=[1 0];
P=[B A*B];
disp(’The rank of matrix P is ’)
rank(P)
Q=[C; C*A];
disp(’The rank of matrix Q is ’)
rank(Q)
desiredObegn=[-10 -20];
L=place(A’,C’,desiredObegn)’
desiredCONegn=[-3 -5];
K=place(A,B,desiredCONegn)
Controller Design Techniques Observer based state feedback controller
More functions of MATLAB
D=[0];
step(A,B,C,D)
title(’Step response of the system’)
ylabel(’Amplitude in response to unit step’);
[num, den]=ss2tf(A,B,C,D);
polesTf=roots(den);
disp(’The poles of the transfer function are ’);
polesTf