0% found this document useful (0 votes)
63 views25 pages

Linear Systems and Control - Week 8: MATLAB and Simulink Simulation of Controller Design

The document discusses controller design techniques for linear systems. It first motivates the need for controller design by discussing system stability. It then outlines the main types of controller design techniques as full-state feedback controller, observer-based state feedback controller, and PID controller. As an example, it analyzes a sample system to check if it needs a controller, identifies that a full-state feedback controller is suitable, and verifies that the prerequisites for this controller type are met. Finally, it provides the general steps for designing the full-state feedback controller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views25 pages

Linear Systems and Control - Week 8: MATLAB and Simulink Simulation of Controller Design

The document discusses controller design techniques for linear systems. It first motivates the need for controller design by discussing system stability. It then outlines the main types of controller design techniques as full-state feedback controller, observer-based state feedback controller, and PID controller. As an example, it analyzes a sample system to check if it needs a controller, identifies that a full-state feedback controller is suitable, and verifies that the prerequisites for this controller type are met. Finally, it provides the general steps for designing the full-state feedback controller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Controller Design Techniques Design of controller

Linear Systems and Control - Week 8

MATLAB and Simulink Simulation of Controller Design


Controller Design Techniques Design of controller
Controller Design Methods

Motivation for Controller Design

Let us recall a few slides from Week 7. A system is unstable if:


Any/all eigenvalue(s) of matrix A is/are non-negative
Any/all pole(s) of transfer function is/are non-negative
Step response is unbounded
Controller Design Techniques Design of controller
Controller Design Methods

Motivation for Controller Design

Let us recall a few slides from Week 7. A system is unstable if:


Any/all eigenvalue(s) of matrix A is/are non-negative
Any/all pole(s) of transfer function is/are non-negative
Step response is unbounded

If a system is unstable, then what we can do to stabilize it?


Controller Design Techniques Design of controller
Controller Design Methods

Motivation for Controller Design

Let us recall a few slides from Week 7. A system is unstable if:


Any/all eigenvalue(s) of matrix A is/are non-negative
Any/all pole(s) of transfer function is/are non-negative
Step response is unbounded

If a system is unstable, then what we can do to stabilize it?

Solution:
Check the pre-requisites of controller (if pre-requisites full-filled then
goto next step)
Design a suitable controller and
Integrate/connect the controller with the system.
Controller Design Techniques Design of controller
Controller Design Methods

Types of Controller

There are 3 types of techniques to design controllers which are:

Full-state feedback controller or state feedback controller


Observer-based state feedback controller
Proportional, Integral and Derivative (PID) controller
Controller Design Techniques Design of controller
Controller Design Methods

Types of Controller

There are 3 types of techniques to design controllers which are:

Full-state feedback controller or state feedback controller


Observer-based state feedback controller
Proportional, Integral and Derivative (PID) controller

In today lecture, we will check the pre-requisites of full-state feedback


controller, design it and simulate it.
Controller Design Techniques Design of controller

Example

Consider a system having the following state space model:


 dx1      
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x 2 2
  
1 0 x1
y=
0 1 x2

Check the following:


Do we need a controller?
If we need a controller, identify which controller to design
Design that controller and place the eigenvalues at (−3, −5).
Controller Design Techniques Design of controller

Solution - Do we need a controller

First, we check stability of this system. The MATLAB code is as follows:


MATLAB code for designing state feedback controller

clear;

clc;

A=[2 3; 0 5 ];

eig(A)
Controller Design Techniques Design of controller

Solution - Do we need a controller

First, we check stability of this system. The MATLAB code is as follows:


MATLAB code for designing state feedback controller

clear;

clc;

A=[2 3; 0 5 ];

disp(’The eigenvalues of matrix A are’)

eig(A)
Controller Design Techniques Design of controller

Solution - Do we need a controller - By Hand Calculations

   
λ 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 Design of controller

Solution - Which controller to design

Now, which controller to choose?

 dx1      
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x2 2
  
1 0 x1
y=
0 1 x2
Controller Design Techniques Design of controller

Solution - Which controller to design

Now, which controller to choose?

 dx1      
dt
2 3 x1 1
dx2 = + u(t)
dt
0 5 x2 2
  
1 0 x1
y=
0 1 x2
As matrix C is identity matrix, we proceed to design of full state feedback
controller and check the second pre-requisite.
Controller Design Techniques Design of controller

Solution - Pre requisite 2 - Manual Calculations

Let us compute now pre-requisite number 2 which is the controllability


test.

In this case n =
Controller Design Techniques Design of controller

Solution - Pre requisite 2 - Manual Calculations

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 Design of controller

Solution - Pre requisite 2 - Manual Calculations

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 Design of controller

Solution - Pre requisite 2 - Manual Calculations

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 design of controller now.


Controller Design Techniques Design of controller

Solution - Pre requisite 2 - MATLAB Calculations

clear;

clc;

A=[2 3; 0 5 ];

B=[1; 2];

P=[B A*B]

disp(’The rank of matrix P is ’)

rank(P)
Controller Design Techniques Design of controller

Solution - Generalized Steps

To design controller, the steps are as follows:


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 Design of controller

Solution of Controller Design


clear;

clc;

A=[2 3; 0 5 ];

B=[1; 2];

P=[B A*B]

disp(’The rank of matrix P is ’)

rank(P)

desiredegn=[-3 -5];

K=place(A,B,desiredegn)
Controller Design Techniques Design of controller

Solution of Controller Design

Now, let us proceed to Simulink to simulate this system.

We need 3 blocks from Simulink library browser


Step Block - usually in sources
Continuous-time state-space block - usually in Continuous Libraries
Scope block - usually in Sink Libraries
Controller Design Techniques Design of controller

Simulink Schematic of Unstable System

Double-click the state-space block and enter values for A, B, C, D as


follows:
In place of A, write [2 3; 0 5]
In place of B, write [1; 2]
In place of C, write [1 0; 0 1]
In place of D, write [0; 0]
Controller Design Techniques Design of controller

Simulink Schematic for Controller Design


Now, once you simulate the unstable system, then make the following
changes in your schematic (so as to connect or integrate the controller
with the system)
Delete the line connecting step block with the continuous-time
state-space block
Add a Sum block - usually found in Math Operations
Add a Gain block - usually found in Math Operations
Controller Design Techniques Design of controller

Simulink Schematic for Controller Design


Now, once you simulate the unstable system, then make the following
changes in your schematic (so as to connect or integrate the controller
with the system)
Delete the line connecting step block with the continuous-time
state-space block
Add a Sum block - usually found in Math Operations
Add a Gain block - usually found in Math Operations
Now double-click the sum block and make the sign changes as shown below

Figure: Original Sum Block Parameters

Figure: Changes to be made in the parameters of Sum Block


Controller Design Techniques Design of controller

Simulink Schematic for Controller Design


There are 2 changes required in the Gain block - one is in Gain values and
the second change is Multiplication

Figure: Controller Block in Simulink


Controller Design Techniques Design of controller

Simulink Schematic for Controller Design

Figure: Final Schematic of Controller connected with the System

You might also like