100% found this document useful (1 vote)
438 views

Lab Manual Control Systems Final

This document is a lab manual for a control systems course. It contains instructions and procedures for experiments involving MATLAB, Simulink, Laplace transforms, modeling linear time-invariant systems, and analyzing system response and stability. The major topics covered in the course are introduced and the learning outcomes, grading policy, list of experiments, and safety regulations are outlined. Detailed steps are provided for experiments on introducing MATLAB and Simulink, using them to perform Laplace transforms and model first and higher order systems, and analyzing system response through MATLAB and Simulink simulations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
438 views

Lab Manual Control Systems Final

This document is a lab manual for a control systems course. It contains instructions and procedures for experiments involving MATLAB, Simulink, Laplace transforms, modeling linear time-invariant systems, and analyzing system response and stability. The major topics covered in the course are introduced and the learning outcomes, grading policy, list of experiments, and safety regulations are outlined. Detailed steps are provided for experiments on introducing MATLAB and Simulink, using them to perform Laplace transforms and model first and higher order systems, and analyzing system response through MATLAB and Simulink simulations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 109

Lab Manual

Control Systems
Lab Manual Control Systems

COMSATS Institute of Information Technology


Sahiwal
Electrical Engineering Department

EEE 325 Control Systems


Lab Manual

Name: __________________________

Registration No: __________________________

Department of Electrical Engineering Page ii


Lab Manual Control Systems

Control Systems Laboratory Manual


EEE 325

Prepared by:

Engr. Rida Maamoor


Lab Engineer
CIIT, Sahiwal

Signature:

Supervised by:

Engr. Aminah Hina


Lecturer
CIIT, Sahiwal
Signature:

Engr. Abubakar
Lecturer
CIIT, Sahiwal
Signature:

Approved by:

Engr. Dr. Saeeda


Incharge/ Assistant Professor
CIIT, Sahiwal
Signature:

DEPARTMENT OF ELECTRICAL ENGINEERING


COMSATS INSTITUTE OF INFORMATION TECHNOLOGY
SAHIWAL

Department of Electrical Engineering Page iii


Lab Manual Control Systems

PREFACE
Scope of the Course
To introduce modeling and linearization of dynamic systems. To introduce frequency
based controller design and analysis techniques.

Major Topics in the Course


System modeling, modeling of electrical, mechanical, thermal, hydraulic and biological
systems, transfer functions, open- and closed-loop control systems, block diagrams,
block-diagram reduction, signal flow graphs, continuous-time system response of 1st, 2nd
and higher order systems, response components, stability, poles and zeroes, Routh-
Hurwitz test, performance specifications, type number, system sensitivity, Step and
impulse response, analysis and design with the root-locus method, Frequency domain
analysis and design, Nyquist criterion, gain and phase margins, PID controller
implementation and tuning, introduction to State space method, state equations, state
transformations and diagonalization, time response from state equations, industrial
applications of control systems, basic concept of PLC.

BOOKS
Text Books
1. Modern Control Engineering by K. Ogata, 4th edition, Prentice Hall

Reference Books
1. Feedback Control Systems, 3rd edition, by Stefani, Savant, et. al., 4th Edition,
Oxford University Press
2. Feedback control of dynamic systems by Franklin and Powel, 5th edition,
Pearson

LEARNING OUTCOMES

GRADING POLICY
Lab Work & Viva Voce Exam 100Marks
 Performance of Experiments, Assignments 25%
 Sessional –I Viva/Practical 10%
 Sessional –II Viva/Practical 15%
 Terminal Examination/Viva/Lab Project 50%

Department of Electrical Engineering Page iv


Lab Manual Control Systems

Each experiment performance will be included in the grading. Lab project can be
assigned in groups or to individuals.

Department of Electrical Engineering Page v


Lab Manual Control Systems

TABLE OF CONTENTS

Preface................................................................................................................................ iv
Books ................................................................................................................................. iv
Learning Outcomes ............................................................................................................ iv
Grading Policy ................................................................................................................... iv
List of Equipment .............................................................. Error! Bookmark not defined.
List of Experiments ..............................................................................................................1
Experiments Relevant to Learning Outcomes .....................................................................2
Basic Requirements and Safety Regulations ..................... Error! Bookmark not defined.
Experiment No.1 Introduction to MATLAB and Simulink .................................................3
1.1 Objective ....................................................................................................3
1.2 Introduction to MATLAB ..............................................................................3
1.2.1 The MATLAB Interface .....................................................................................3
1.2.2 Variables .............................................................................................................5
1.2.3 Built-In Functions and Variables ........................................................................5
1.2.4 Binary Operations in MATLAB .........................................................................6
1.2.5 The Help Section.................................................................................................7
1.2.6 Vectors/Arrays ....................................................................................................9
1.2.7 Matrices.............................................................................................................11
1.2.8 Lab Tasks ..........................................................................................................12
1.3 Introduction to Simulink ............................................................................ 13
1.3.1 The Simulink Interface .....................................................................................13
1.3.2 Lab Task............................................................................................................16
Experiment No.2 Laplace Transform Using MATLAB, LTI Viewer and Modelling of
First Order System in Simulink .........................................................................................18
2.1 Objective ................................................................................................. 18
2.2 Laplace Transform Using MATLAB ............................................................ 18
2.2.1 Inverse Laplace Transform Using MATLAB ...................................................18

Department of Electrical Engineering Page vi


Lab Manual Control Systems

2.2.2 Lab Tasks ..........................................................................................................18


2.3 LTI Viewer & Simulink Modelling ............................................................... 19
2.3.1 Lab Tasks ..........................................................................................................21
2.4 Modelling of First Order System in Simulink................................................. 21
2.4.1 Free Body Diagram and System Equation ........................................................21
2.4.2 Building System Model ....................................................................................22
2.4.3 Step Input ..........................................................................................................25
Experiment No.3 LTI System Analysis in MATLAB and Modelling in Simulink ...........28
3.1 Objectives ............................................................................................... 28
3.2 LTI System Analysis .................................................................................. 28
3.2.1 System Definition In Matlab .............................................................................28
3.2.2 Model Interconnections ....................................................................................29
3.2.3 Catalogue of Model Interconnections ...............................................................29
3.2.4 In-Lab Exercise .................................................................................................31
3.2.5 Impulse Response .............................................................................................33
3.2.6 Step Response ...................................................................................................33
3.2.7 System Response for Arbitrary Input ...............................................................33
3.2.8 Stability Analysis ..............................................................................................34
3.2.9 Lab Tasks ..........................................................................................................34
3.3 Modelling in Simulink ............................................................................... 35
3.3.1 System Definition in Simulink..........................................................................35
3.3.2 In-Lab Experiments ..........................................................................................35
3.3.3 Practice Problem ...............................................................................................36
3.3.4 Lab Task............................................................................................................37
Experiment No.4 State Space Representation Using MATLAB .......................................39
4.1 Objective ................................................................................................. 39
4.2 State Space Representation ........................................................................ 39
4.2.1 Components of a State Space Representation ...................................................39
4.2.2 Exact Representation ........................................................................................40
4.2.3 Input of the State Space Model in MATLAB ...................................................40

Department of Electrical Engineering Page vii


Lab Manual Control Systems

4.2.4 Extracting A, B, C and D Matrices from a State Space Model ........................40


4.2.5 Step Response using State Space Model ..........................................................40
4.3 State Space Modelling using Simulink .......................................................... 41
4.3.1 Conversion from Other Models to State Space Representation in MATLAB..41
4.4 Lab Task ................................................................................................. 42
Experiment No.5 Response of Second Order System and Analysis of Steady State Error
Using MATLAB ................................................................................................................44
5.1 Objective ................................................................................................. 44
5.2 Response of Second Order System ............................................................... 44
5.2.1 DC Gain ............................................................................................................44
5.2.2 Damping Ratio ..................................................................................................44
5.2.3 Natural Frequency.............................................................................................44
5.2.4 Poles/Zeros ........................................................................................................44
5.2.5 Under Damped System .....................................................................................45
5.2.6 Percent Overshoot .............................................................................................45
5.2.7 Over Damped Systems ......................................................................................45
5.2.8 Critically Damped Systems...............................................................................45
5.2.9 Un-damped Systems .........................................................................................45
5.2.10 Bode Plot .........................................................................................................45
5.3 Lab Tasks ................................................................................................ 46
5.4 Analysis of Steady State Error using MATLAB .............................................. 46
5.4.1 Calculating steady-state errors ..........................................................................46
5.4.2 System type and steady-state error ...................................................................47
5.4.3 Meeting steady-state error requirements ...........................................................48
5.5 Lab Tasks ................................................................................................ 50
Experiment No.6 Routh Hurwitz Criteria using MATLAB ..............................................52
6.1 Objective ................................................................................................. 52
6.2 Theory .................................................................................................... 52
6.2.1 Routh Hurwitz criterion for second, third and fourth order polynomials .........52
6.2.2 Higher Order Example ......................................................................................53

Department of Electrical Engineering Page viii


Lab Manual Control Systems

6.3 In-Lab Experiment .................................................................................... 54


6.3.1 Routh Stability Criterion (State Space Representation)....................................54
6.4 Lab Tasks ................................................................................................ 55
Experiment No.7 Analysis and Controller Design via Root Locus Method and Lead/Lag
Compensator ......................................................................................................................57
7.1 Objective ................................................................................................. 57
7.2 Theory .................................................................................................... 57
7.2.1 Obtaining a Root Locus Plot .............................................................................57
7.2.2 Continuous Root Locus Plot .............................................................................58
7.2.3 Comments on the Root Locus Plot ...................................................................59
7.2.4 Constant ζ and Constant wn Loci .....................................................................59
7.2.5 Plotting Polar Grids in the Root Locus Diagram ..............................................59
7.2.6 Preliminary Design Considerations ..................................................................60
7.2.7 System Compensation .......................................................................................61
7.2.8 Types of Compensators.....................................................................................61
7.2.9 Root Locus Approach to Control System Design .............................................62
7.2.10 Effects of Addition of Poles and Zeros ...........................................................62
7.2.11 Lead Compensator Design ..............................................................................62
7.2.12 Solving Ball and Beam Problem using Lead Compensator ............................63
7.2.13 Lag Compensator Design ................................................................................65
7.2.14 DC Motor Speed Control using Lag Compensator .........................................65
7.3 In Lab Experiment .................................................................................... 66
7.3.1 Design using Root Locus ..................................................................................66
7.3.2 Analysis of Designed Lead Compensator on MATLAB ..................................66
7.3.3 Analysis of Designed Lag Compensator on MATLAB ....................................66
7.4 Lab Tasks ................................................................................................ 66
Experiment No.8 Design and Analysis of PID Controller .................................................70
8.1 Objective ................................................................................................. 70
8.2 Theory .................................................................................................... 70
8.2.1 Theory of three term Controller ........................................................................70

Department of Electrical Engineering Page ix


Lab Manual Control Systems

8.2.2 Characteristics of P, I and D Controller ............................................................71


8.2.3 General Tips for Designing PID Controller ......................................................71
8.3 In-Lab Experiment .................................................................................... 72
8.3.1 Mass Spring Damper Model .............................................................................72
8.3.2 Design Problem: Ball & Beam System .............................................................72
8.4 Lab Tasks ................................................................................................ 73
Experiment No.9 Frequency Domain Analysis of Control Systems .................................76
9.1 Objective ................................................................................................. 76
9.2 Theory .................................................................................................... 76
9.2.1 Frequency Response Representation ................................................................76
9.2.2 Bode Plots .........................................................................................................76
9.2.3 Plotting Bode Diagrams ....................................................................................77
9.2.4 Logrithmic Frequency Range ...........................................................................77
9.2.5 Indicating Gain and Phase Angles on the BODE Diagrams .............................79
9.2.6 BODE Diagram for State Space Representation ..............................................79
9.2.7 Polar Plots .........................................................................................................79
9.2.8 Nyquist Plots .....................................................................................................80
9.2.9 Nyquist Plots for State Space System ...............................................................80
9.3 Lab Tasks ................................................................................................ 81
Experiment No.10 Closed Loop Proportional Control of the Pressure .............................83
10.1 Objectives .............................................................................................. 83
10.2 Apparatus .............................................................................................. 83
10.3 Figure ................................................................................................... 83
10.4 Procedure .............................................................................................. 83
10.5 Observations .......................................................................................... 84
10.6 Graph ................................................................................................... 85
Experiment No.11 Closed Loop Proportional – Integral Control of the Pressure .............87
11.1 Objectives .............................................................................................. 87
11.2 Apparatus .............................................................................................. 87

Department of Electrical Engineering Page x


Lab Manual Control Systems

11.3 Figure ................................................................................................... 87


11.4 Procedure .............................................................................................. 88
11.5 Observations .......................................................................................... 89
11.6 Graph ................................................................................................... 89
Experiment No.12 Closed Loop Proportional – Derivative Control of the Pressure.........91
12.1 Objectives .............................................................................................. 91
12.2 Apparatus .............................................................................................. 91
12.3 Figure ................................................................................................... 91
12.4 Procedure .............................................................................................. 91
12.5 Observations .......................................................................................... 92
12.6 Graph ................................................................................................... 93
Experiment No.13 Closed Loop Proportional – Integral – Derivative Control of the
Pressure ..............................................................................................................................95
13.1 Objectives .............................................................................................. 95
13.2 Apparatus .............................................................................................. 95
13.3 Procedure .............................................................................................. 95
13.4 Figure ................................................................................................... 95
13.5 Observations .......................................................................................... 96
13.6 Graph ................................................................................................... 97

Department of Electrical Engineering Page xi


Lab Manual Control Systems

LIST OF EXPERIMENTS

Sr. No. Experiment Names

1. Introduction to MATLAB and Simulink


Laplace Transform using MATLAB, LTI Viewer and Modelling of 1st Order System in
2.
Simulink
3. LTI System Analysis in MATLAB and Modelling in Simulink
4. State Space Representation using MATLAB
5. Response of Second Order System and Analysis of Steady State Error using MATLAB
6. Routh Hurwitz Criteria using MATLAB
7. Analysis and Controller Design via Root Locus Method and Lead/Lag Compensator

8. Design and Analysis of PID Controller


9. Frequency Domain Analysis of Control Systems
10. Closed Loop Proportional Control of the Pressure
11. Closed Loop Proportional - Integral Control of the Pressure
12. Closed Loop Proportional - Derivative Control of the Pressure
13. Closed Loop Proportional – Integral - Derivative Control of the Pressure

Department of Electrical Engineering Page 1


Lab Manual Control Systems

EXPERIMENTS RELEVANT TO LEARNING OUTCOMES

Learning Outcome Relevant Experiment


1. Understanding the operation on MATLAB Experiment No. 1
2. Representation of 1st LTI system in Experiment No. 2-3
MATLAB
3. Understanding the state space Experiment No. 4
representation
4. Understanding the error and stability of Experiment No. 5-6
higher order systems
5. Designing of controller Experiment No. 7-8

6. Analyze the systems in frequency domain Experiment No. 9

7. Analyzing the PID controller Experiment No. 10-13

Department of Electrical Engineering Page 2


Lab Manual Control Systems

Experiment No.1 INTRODUCTION TO MATLAB AND


SIMULINK
1.1 Objective
To familiarize students with MATLAB and Simulink interface

1.2 Introduction to MATLAB


1.2.1 The MATLAB Interface
1.2.1.1 The Prompt
Open MATLAB on your computer. You will be greeted by an interface similar to this
one:

The >> symbol indicates that MATLAB is ready to accept input and it is called a prompt.
Type in the following and press enter:
>> x = 3
You will see two changes: First, MATLAB will output the value now stored in x.
Second, on the right, x will appear in the list of variables. When there is a long process
taking place, the prompt will disappear and appear again when the calculation has
completed. Usually when you add a semicolon after a statement, it means that the output
won’t be shown on the screen.
1.2.1.2 The MATLAB Editor
When writing long programs, or writing programs you may want to edit or run over and
over, it is better to create a script in the editor. Click “New Script” near the top left to
open the editor.

Department of Electrical Engineering Page 3


Lab Manual Control Systems

The editor is where you will write and save all your programs. For example, type the
following code in the editor:
clc;
x = inv(x);
disp(x);
And press “Run”. Once you do that, it will ask you where to save your script. Save it
somewhere. You should see something similar to the following:

Department of Electrical Engineering Page 4


Lab Manual Control Systems

1.2.1.3 Using MATLAB as a Calculator


Try entering the following in MATLAB:
>> 3 + 5
ans =
8
>> 3 - 5
ans =
-2
Experiment with MATLAB. Do the same as we have done above with different numbers
and also *, / and ^.

Apart from normal division in MATLAB, there is also the left-division operator, \. It
divides the second number (on its right) by the first and gives the result.
You can use parentheses in MATLAB as you would in normal mathematics, or on your
calculator. For example,
>> (3 + 5) * 8
ans =
64
>> 3 + 5 * 8
ans =
43
Note that MATLAB does not simply evaluate expressions from left to right, but it
respects the order of operations, which means that it does multiplication and division
first, then addition and subtraction.
1.2.2 Variables

In MATLAB, you can store the results of any calculation in a variable. Try the following
in MATLAB:
>> x = 1 / 2
x =
0.5000
>>x = 3;
If you look on the right side of MATLAB in the Workspace, you will see at least two
variables defined. You will see x with the value of 3 that you just assigned, and you will
see ans, which stores the result of the last calculation you did. Just keep in mind a few
rules, MATLAB variables always start with a letter, and can have letters, numbers or
underscores in them.
1.2.3 Built-In Functions and Variables

MATLAB has a big library of built-in functions that can do special jobs. For example,

Department of Electrical Engineering Page 5


Lab Manual Control Systems

>> theta = pi;


>> x = cos(theta);
>> y = sin(theta);
Check the workspace and you will see that it has three new variables: theta, x, and y. In the
table below you will find some common functions used in calculations and their explanation.
Note also that the semicolon after a statement means it won’t show the output, but it will store it.
MATLAB Expression Meaning
sqrt(x)
nthroot(x, n)
log(x)
log10(x)
log(x)/log(b)
exp(x)
pi
sin(x)
cos(x)
tan(x)
csc(x)
sec(x)
cot(x)
asin(x)
acos(x)
atan(x)
atan2(y,x) (takes care of the quadrant)
sinh(x)
cosh(x)
tanh(x)
i
real(z)
imag(z)
abs(z)
angle(z)
conj(z)
rand Random number between 0 and 1.
randn Random number that follows a standard
Normal (Gaussian) distribution.
randi([min max]) Random integer between min and max.

1.2.4 Binary Operations in MATLAB

MATLAB has a lot of operators and functions you can use to check relationships
between two numbers. Each of them returns 0 or 1, for false and true, respectively.

Department of Electrical Engineering Page 6


Lab Manual Control Systems

MATLAB Expression Explanation

a == b Is a equal to b?
a > b Is a greater than b?
a >= b Is a greater than or equal to b?
a < b Is a less than b?
a <= b Is a less than or equal to b?
a ~= b Opposite of a == b.
a && b Returns true if both a and b are true.
a || b Returns true if one or both of a and b are true.
xor(a, b) Returns true if exactly one of a and b are true.
~a Returns the opposite of a.
true Always true.
false Always false.
We can use these as follows:
>> 5 > 3
ans =
1
>> 5 < 3
ans =
0
>> 5 > 3 && 3 < 5
ans =
1

1.2.5 The Help Section

Are you stuck somewhere? There’s always the MATLAB help. Please attempt to solve
your own problems before asking the instructor; that’s how you learn. There are two
main ways to access the help. The first is by pressing F1 on your keyboard. This should
bring up a window like the following in which you can search for in-built functions or
help, or look up the syntax of a function:

Department of Electrical Engineering Page 7


Lab Manual Control Systems

The second way is to type in help<function name>. This way, you can quickly look
up the syntax or what a function does without opening the Help Centre. Type in help
inv. You will see something like the following:

Department of Electrical Engineering Page 8


Lab Manual Control Systems

You can also jump directly to the help section of a function by typing doc <function
name>.

1.2.6 Vectors/Arrays

Row vectors, also known as 1-D arrays, are defined in MATLAB like this:

>> x = [2 5 4 3 1]
x =
2 5 4 3 1
>> x = [2, 5, 4, 3, 1]
x =
2 5 4 3 1
To access one element of a row vector, you can do this:
>> x(3)
ans =
4
Note that the numbering of an array starts at 1 in MATLAB. Many of the functions we
studied above can be applied to arrays as well. For example,
>> sqrt(x)
ans =
1.4142 2.2361 2.0000 1.7321 1.0000
If arrays are of the same length, addition and subtraction works as usual. You can also
multiply/divide an array by a number (also known as a scalar) with * and /. However, if
you want to multiply two arrays or divide them element by element, you need to use the
operators.* and . /, along with .\, for example:

>> x .* x
ans =
4 25 16 9 1
You can do something similar for exponentiation:

>> x .^ 3
ans =
8 125 64 27 1
A similar thing applies for binary operators. You need to use & instead of && and |
instead of || when working with arrays.
Here are some special commands for generating arrays, along with their explanation.
Note that commands that have a different behavior as compared to scalars are repeated
below for clarity.

Department of Electrical Engineering Page 9


Lab Manual Control Systems

MATLAB Expression Explanation

a:b An array starting at a and ending at b with


steps of 1.
a:step:b An array starting at a and ending at b with a
step size of step.
linspace(a, b, n) An array starting at a, ending at b, with a total
of n points.
rand([1 n]) An array of n points where each element is a
random number between 0 and 1.
randn([1 n]) An array of n points where each element is a
sample from a standard normal distribution.
randi([min max], [1 n]) An array of random integers with n points,
each of them between min and max.
true([1 n]) An array of n points, all containing true.
false([1 n]) An array of n points, all containing false.
zeros([1 n]) An array of n points, all containing 0.
ones([1 n]) An array of n points, all containing 1.
mean(a) Mean of all elements of a.
median(a) Median of all elements of a.
sort(a) Sorts the elements of a.
Sort(a, 'descend'); Sorts the elements of a in descending order.
max(a) Maximum of all elements of a.
min(a) Minimum of all elements of a.
[m, i] = max(a) Stores the maximum of a in m and its index in
i.
[m, i] = min(a) Stores the minimum of a in m and its index in
i.
sum(a) Sum of all elements of a.
cumsum(a) Cumulative sum, where each element is the
sum of all previous elements.
prod(a) Product of all elements of a.
diff(a) Difference between successive elements of a.
find(a) Returns the indexes where the array a is not 0
or false.
x(a) Returns x only where a is not false. For
example, if x = [1 2 3 4 5] and a =
[true false true false true], then
x(a) will return [1 3 5].
You can also combine indexing and arrays. For example,

>> x(1:3)
ans =
1 2 3
>> x(1:2:5)
ans =
1 3 5
>> x(4:end)

Department of Electrical Engineering Page 10


Lab Manual Control Systems

ans =
4 5
>> x(end-2:end)
ans =
3 4 5

1.2.7 Matrices

First, we will go through some basic operations in MATLAB. Basic programming


knowledge is assumed. If the matrix is defined as

We write this in MATLAB as


>>x = [1 2; 3 4];
or, equivalently
>> x = [1, 2; 3, 4]
x =
1 2
3 4
Below are some MATLAB expressions relating matrices and their explanation.

MATLAB Expression Explanation

A * B The matrix multiplication of A and B.


A.' The transpose of the matrix A.
A' The conjugate-transpose of the matrix A.
A^n The square matrix A to the power of n.
rand([m n]) An matrix of order where each element
is a random number between 0 and 1.
randn([m n]) An matrix of order where each element
is a sample from a standard normal
distribution.
randi([min max], [m n]) An matrix of random integers of order ,
each of them between min and max.
true([m n]) An matrix of order , all containing true.
false([m n]) An matrix of order , all containing
false.
zeros([m n]) An matrix of order , all containing 0.
ones([m n]) An matrix of order , all containing 1.
eye(n) An identity matrix of order .
inv(x) The inverse of square matrix x.
det(x) The determinant of the square matrix x.
size(x) Returns [m n] if x is

Department of Electrical Engineering Page 11


Lab Manual Control Systems
diag(x) If x is a matrix, this returns an array with the
diagonal elements of x. If x is an array, this
creates a diagonal matrix where the elements of
x lie along the diagonal and the rest are zeroes.
A\B or B/A Solves the matrix equation for the
matrix . More efficient than doing inv(A) *
B.
x(a) Returns x only where a is not false. For
example, if x = [1 2; 3 4] and a =
[true false; false true], then x(a)
will return [1 4].

1.2.8 Lab Tasks

1.2.8.1 Question 1
Create a vector and a vector .
Compute the following:

a. where .
b. where
c. The element-wise product of and .
d. The dot product of and .
You should submit:

 A MATLAB script (*.m file).


 A text file containing the output of your script.
1.2.8.2 Question 2
Create a matrix with all its elements randomly distributed in . Compute:

a. The inverse matrix.


b. The transpose of the matrix.
c. The determinant of the matrix.
d. The size of the matrix.
You should submit:

 A MATLAB script (*.m file).


 A text file containing the output of your script.
1.2.8.3 Question 3
Use the built-in function eig to find the eigenvalues and eigenvectors of the matrix ,
where

Hint: If you are stuck, use help eig to find out all the different things eig can do.

Department of Electrical Engineering Page 12


Lab Manual Control Systems

You should submit:

 A MATLAB script (*.m file).


 A text file containing the output of your script.
1.2.8.4 Question 4
a. Create a function that plots the function .
b. Plot, using your function, the graph of in the interval .
You should submit:

 A MATLAB function (*.m file).


 A MATLAB script that calls the function.
 If applicable, images of the graph plotted.
1.2.8.5 Question 5
a. Find out, how functions are written in MATLAB? Write a function that performs
the convolution of two input signals without using any built-in functions, other
than those we have covered in this lab manual.
b. Compare the output of your function with the built-in conv function for multiple
inputs to see that it produces the same output.
You should submit:

 Your own convcustom.m file which contains the function


 A file that has a few hard-coded inputs and it compares the outputs of your
function with the conv function. Name this file main.m.
Hint: Use all (A == B) to compare two arrays.

1.3 Introduction to Simulink


1.3.1 The Simulink Interface

To start using Simulink, type in simulink at the MATLAB prompt and press enter.
Some time will pass, and you will be presented with a window similar to this one:

Department of Electrical Engineering Page 13


Lab Manual Control Systems

Click on the (new model) icon, near the top center of the window. A new window will
pop up in which you can view and edit your model.
In the Simulink Library Browser, click on Sources under Simulink, and drag the Sine
wave generator onto your model. Your model and window will look something like this:

Department of Electrical Engineering Page 14


Lab Manual Control Systems

Department of Electrical Engineering Page 15


Lab Manual Control Systems

The outwards pointing arrow from the sine-wave generator is an output of the Sine Wave
block. You can take the input of this block and feed it to another block. Double-clicking
the block brings up different properties related to it you can modify.
Drag out a Scope block from Sinks, and connect it to the Sine Wave block by selecting the
Sine Wave block, holding down the Ctrl key, and clicking the Scope block. Then click the
button, and double-click on the scope. Observe the output.

1.3.2 Lab Task

Implement the transfer function

In Simulink. Observe its

 Impulse response
 Step Response
In Simulink. You should submit:

 One Simulink model (*.slx file)


 Two separate screenshots of each type of response.
You may use any blocks or functions available in MATLAB or Simulink.
Hint: You will need the Step, Scope, Derivative and Transfer Function blocks.

Department of Electrical Engineering Page 16


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 17


Lab Manual Control Systems

Experiment No.2 LAPLACE TRANSFORM USING


MATLAB, LTI VIEWER AND MODELLING OF FIRST
ORDER SYSTEM IN SIMULINK
2.1 Objective
To grasp the important role mathematical models of physical systems in the design and
analysis of control systems

2.2 Laplace Transform Using MATLAB


You can compute Laplace transform using the symbolic toolbox of MATLAB. If you
want to compute the Laplace transform of , you can use the following MATLAB
program.
>> syms f t
>> f=t;
>> laplace(f)
ans =1/s^2
where f and t are the symbolic variables, f the function, t the time variable.
2.2.1 Inverse Laplace Transform Using MATLAB
The command one uses to comput the inverse laplace is ‘ilaplace’. One also needs to
define the symbols t and s. Lets calculate the inverse of the previous function F(s),

>> syms t s
>> F=(s-5)/(s*(s+2)^2);
>> ilaplace(F)
ans =
-5/4+(7/2*t+5/4)*exp(-2*t)
>> simplify(ans)
ans =
-5/4+7/2*t*exp(-2*t)+5/4*exp(-2*t)
>> pretty(ans)
- 5/4 + 7/2 t exp(-2 t) + 5/4 exp(-2 t)

Which corresponds to f(t)

Alternatively one can write


>> ilaplace ((s-5)/(s*(s+2)^2))
2.2.2 Lab Tasks
Find the Laplace Transform of following functions

1.

Department of Electrical Engineering Page 18


Lab Manual Control Systems

2.
3.
4.
Find the Inverse Laplace Transform of following transfer functions

1.
2.
3.
4.

2.3 LTI Viewer & Simulink Modelling


MATLAB Control System toolbox offers a wonderful interface where the user may
obtain information about a system response by just a click on the mouse button. LTI
Viewer allows the user to obtain the time and frequency information of LTI transfer
functions that can be used to create plots of step and impulse responses, Bode, Nyquist,
Nichols and pole-zero plots. With a right click on the mouse the information such as peak
-time and settling time can be obtained.
1. Transfer Function input to MATLAB: You may choose to enter the TF's in either
MATLAB Command window or MATLAB Editor Window.

T1=tf(10,[1 4 10]);T2=tf(200,conv([1 10],[1 4 24]));


T3=tf(60,conv([1 3],[1 1.5 24])); Ltiview
2. Click on FILE menu on the LTI Viewer window and select IMPORT. An LTI
Browser window will pop up. Press down the SHIFT key and select all the TFs.

Figure 2-1

Department of Electrical Engineering Page 19


Lab Manual Control Systems

Click OK to plot all TF's. The step response of the three imported TF will be
displayed in the LTI Viewer window as shown below

Figure 2-2
As noted in the instruction below the plots, use the right button on the mouse with
the cursor placed on the axis of the figure to bring up the menu as show below

Figure 2-3
Note that alternately, you may use the step command in MATLAB to obtain the
same response to step input. For example, let's take the second transfer function
T2. The step response to this TF can be obtained with the following commands:
>> [y2, t2]= step(T2)
Assuming, T2 has been entered previously. The step command as described above
will produce two arrays containing the magnitude and time values of the step

Department of Electrical Engineering Page 20


Lab Manual Control Systems

response for T2. You may use the plot command to graphically show the
response. If step command is used without the array forming in the left hand side
of the entry above, a plot of the step command will result from the step command:
>> step (T2)

2.3.1 Lab Tasks

Question No 1: Determine the transfer function when,


1. There is no zero, P1 = -1+2j, P2 = -1-2j, k = 10.
2. Zero is at zero, P1 = -1+2j, P2 = -1-2j, k = 10.
3. z = -1, p1 = -2, p2 = -4, p3 = -8, k=12.
Question No 2: Build and simulate the following models using Simulink

Question No 3: Build and simulate a model which is able to convert Fahrenheit to degree
Celsius.

2.4 Modelling of First Order System in Simulink


2.4.1 Free Body Diagram and System Equation
To demonstrate how Simulink can be used to investigate a real-world system, we will
look at a simplified, first-order model of the motion of a car. If we assume the car to be
travelling on a flat road, then the horizontal forces on the car can be represented by:

Department of Electrical Engineering Page 21


Lab Manual Control Systems

Figure 2-4
In this diagram:
 v is the horizontal velocity of the car (units of m/s).
 F is the force created by the car's engine to propel it forward (units of N).
 b is the damping coefficient for the car, which is dependent on wind resistance,
wheel friction, etc. (units of N*s/m) We have assumed the damping force to be
proportional to the car's velocity.
 M is the mass of the car (units of kg).
Writing Newton's Second Law for the horizontal direction thus gives:

For our system, we will assume that:


M = 1000 kg (a Dodge Neon has a mass of about 1100 kg), b = 40 N*sec/m
2.4.2 Building System Model
This system will be modeled in Simulink by using the system equation derived above.
This equation indicates that the car's acceleration (dv/dt) is equal to the sum of the forces
acting on the car (F-bv) divided by the car's mass:

To model this equation, we begin by inserting a Sum block and a Gain block into a new
model window. The Sum block represents adding together the forces and the Gain block
symbolizes dividing by the mass. Connecting the blocks with a line gives the following in
the model window:

Department of Electrical Engineering Page 22


Lab Manual Control Systems

Figure 2-5
Next, we modify these blocks to properly represent our system. The Sum block needs to
add the motor force (F) and subtract the damping force (bv). Thus, we double-click on
this block and change the second "+" in the "List of signs" box into a "-". The Sum Block
Parameters window should now look like:

Figure 2-6
We also modify the Gain block so that it divides by the car's mass. Double-click on the
block and change the Gain to 1/1000. To keep our block diagram organized and easy to
understand, we next add labels to the signals and blocks we have included so far. A block
is labeled by clicking on the text underneath it and editing the description. Draw lines to
the open input terminals of the Sum block and open output terminal of the Gain block and
label the signals and blocks in the model so that they look like:

Department of Electrical Engineering Page 23


Lab Manual Control Systems

Figure 2-7
To relate the car's acceleration to its velocity-dependent damping force, we will integrate
the v_dot signal. Place an Integrator block in the model, draw and label the velocity
signal so that the model looks like:

Figure 2-8
To obtain the damping force from the velocity, we need to branch the velocity signal and
multiply it by the damping coefficient (b). The velocity signal is branched by clicking the
right mouse button anywhere on its line (or hold down CTRL and use the left mouse
button) and dragging away a new signal. A Gain block is then used to multiply the
velocity by the damping coefficient. Finally, edit the Gain block's parameters so that its
gain equals the damping coefficient of the system (40 N*sec/m). These additions to the
model should cause it to look like:

Department of Electrical Engineering Page 24


Lab Manual Control Systems

Figure 2-9
Note that the block diagram is now set up with input F (engine force) and output v (car
velocity).

2.4.3 Step Input


To be able to successfully simulate the system, we need to specify an applied input, F.
Let us assume the car is initially at rest, and that the engine applies a step input of F =
400 N at t = 0. Insert a Step block from the Sources into the model and also add a Scope
block from the Sinks to monitor the system's velocity, v. The Simulink model window
should now look like:

Figure 2-10
The Step block must be modified to correctly represent our system. Double-click on it,
and change the Step Time to 0 and the Final Value to 400. The Initial Value can be left as

Department of Electrical Engineering Page 25


Lab Manual Control Systems

0, since the F step input starts from 0 at t = 0. The Sample Time should remain 0 so that
the Step block's input is monitored continuously during simulation.
Next, run a simulation of the system. Once the simulation has finished, double-click on
the Scope block to view the velocity response to the step input. Clicking on the
"Autoscale" in the Scope window will produce the following graph:

Figure 2-11
Note that this graph does not appear to show the velocity approaching a steady-state
value, as we would expect for the first-order response to a step input. This result is due to
the settling time of the system being greater than the 10 seconds the simulation was run.
To observe the system reaching steady-state, click Simulation, Parameters in the model
window, and change the Stop Time to 150 seconds. Now, re-run the simulation and note
the difference in the velocity graph:

Figure 2-12

Department of Electrical Engineering Page 26


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 27


Lab Manual Control Systems

Experiment No.3 LTI SYSTEM ANALYSIS IN MATLAB


AND MODELLING IN SIMULINK
3.1 Objectives
System definition, model interconnections, Impulse and Step response using LTI viewer
and Stability analysis of system in MATLAB and System Modeling in Simulink using
Direct form I and Direct form II

3.2 LTI System Analysis


3.2.1 System Definition In Matlab
Here are some examples to explain how to define a system in MATLAB.
1. sys = tf(num, den) creates a continuous-time transfer function with numerator(s)
and denominator(s) specified by num and den. The output sys is A tf model
object, when num and den are numeric arrays, continuous-time transfer function.
>> r=tf([1 0 1],[1 2 1])

2. To use a rational expression to create a SISO TF model, type


s = tf('s');
H = s/(s^2 + 2*s +10); //This produces the same transfer function as
h = tf([1 0],[1 2 10]);
3. sys = zpk(z,p,k) creates a continuous-time zero-pole-gain model with zeros z,
poles p, and gain(s) k. The output sys is a zpk model object storing the model
data. In the SISO case, z and p are the vectors of real- or complex-valued zeros
and poles, and k is the real- or complex-valued scalar gain, Continuous-time
zero/pole/gain model.
tr=zpk([1 3],[1 2 4],[1])

4. Tf commands also converts zpk form of system to tf form same holds for zpk
command.
5. In Simulink, a block labelled “LTI System” is available in control system toolbox.
Write above commands (tf, zpk) in input space of block to define a linear system.
6. pzmap(sys) plots the pole-zero map of the continuous- or discrete-time LTI model
sys. For SISO systems, pzmap plots the transfer function poles and zeros. The
poles are plotted as x's and the zeros are plotted as o's. pzmap(sys1,sys2,...,sysN)
plots the pole-zero map of several LTI models on a single figure. The LTI models
can have different numbers of inputs and outputs. When invoked with left-hand
arguments,
[p,z] = pzmap(sys)
It returns the system poles and zeros in p and z. No plot is drawn on the screen. You
can use the functions sgrid or zgrid to plot lines of constant damping ratio and natural
frequency in the s- or z- plane.
pzmap(sys)

Department of Electrical Engineering Page 28


Lab Manual Control Systems
pzmap(sys1,sys2,...,sysN)
[p,z] = pzmap(sys)
e.g.

>>H = tf([2 5 1],[1 2 3]);


>>sgrid
>>pzmap(H)

3.2.2 Model Interconnections


Interconnecting models of components allows you to construct models of control
systems. You can conceptualize your control system as a block diagram containing
multiple interconnected components, such as a plant or a controller. Using model
arithmetic or interconnection commands, you combine models of each of these
components into a single model representing the entire block diagram.
For example, you can interconnect dynamic system models of a plant G(s), a controller
C(s), sensor dynamics S(s), and a pre filter F(s) to construct a single model that
represents the entire closed-loop control system in the following illustration:

Figure 3-1
3.2.3 Catalogue of Model Interconnections
Each type of block diagram connection corresponds to a model interconnection command
or arithmetic expression. The following table summarizes the block diagram connections
with the corresponding interconnection command and arithmetic expression:

Department of Electrical Engineering Page 29


Lab Manual Control Systems

Figure 3-2
The connect command lets you connect systems in any configuration given in above
figure. To use connect, specify the input and output channel names of the components of
the block diagram. Connect automatically joins ports that have the same name, as shown
in the following figure:

Figure 3-3

Department of Electrical Engineering Page 30


Lab Manual Control Systems

Figure 3-4
3.2.4 In-Lab Exercise
We will define above system in Matlab

3.2.4.1 Example 1
We will define above system in Matlab
1) We assume following values for these models
G = zpk( [ ] , [ - 1 , - 1 ] , 1 ) ;
C = pid( 2 , 1 . 3 , 0 . 3 , 0 . 5 ) ;
S = tf( 5 , [ 1 4 ] ) ;
F = tf( 1 , [ 1 1 ] ) ;
The plant G is a zero-pole-gain (zpk) model with a double pole at s =–1. Model
object C is a PID controller. The models F and S are transfer functions
2) Connect the controller and plant models.
H = G*C;
To combine models using the multiplication operator *, enter the models in
reverse order compared to the block diagram. Alternatively, construct H(s) using
the series command.
H = series(C,G);
3) Construct the unfiltered closed-loop response T HS) .
Do not use model arithmetic to construct T algebraically:
T = H/(1+H*S)
This computation duplicates the poles of H, which inflates the model order and
might lead to computational inaccuracy
4) Construct the entire closed-loop system response from r to y.
T_ry = T*F;
T_ry is a Numeric LTI Model representing the aggregate closed-loop system.
T_ry does not keep track of the coefficients of the components G, C, F, and S.

Department of Electrical Engineering Page 31


Lab Manual Control Systems

You can operate on T_ry with any Control System Toolbox control design or
analysis commands

3.2.4.2 Example 2

Figure 3-5
Input = ysp , Output = y
1) Create the components of the block diagram: the process model P, the predictor
model Gp, the delay model Dp, the filter F, and the PI controller C. Specify
names for the input and output channels of each model so that connect can
automatically join them to build the block diagram.
s=tf('s');
P = e x p ( - 93.9*s )*5.6 / ( 40.2*s + 1 ) ;
P.InputName = 'u' ;
P.OutputName = ' y ' ;
Gp = 5.6/ ( 40.2*s + 1 ) ;
Gp.InputName = ' u ' ;
Gp.OutputName = ' yp ' ;
Dp = exp ( - 9 3.9*s ) ;
Dp.InputName = ' yp ' ;
Dp.OutputName = ' y1 ' ;
F = 1 / ( 2 0 *s + 1 ) ;
F.InputName = ' dy' ;
F.OutputName = ' dp ' ;
C = pidstd ( 0.574 , 40.1 ) ;
C.InputName = ' e ' ; C.InputName = ' u ' ;
2) Create the summing junctions needed to complete the block diagram
sum1 = sumblk( ' e = ysp - ym ' ) ;
sum2 = sumblk( ' ym = yp + dp ' ) ;

Department of Electrical Engineering Page 32


Lab Manual Control Systems

sum3 = sumblk( ' dy = y - y1 ' ) ;


The argument to sumblk is a formula specified as a string. This string relates the
input and output signals of the summing junction. Sumblk creates a summing
junction with the input and output signal names specified in the formula. For
example, in sum1, the string 'e = ysp - ym' specifies an output signal named e,
which is the difference between input signals named ysp and ym
3) Assemble the complete model from ysp to y.
T = connect(P,Gp,Dp,C,F,sum1,sum2,sum3,'ysp','y');
You can list the models and summing junctions in any order because connect
automatically interconnects them using their input and output channel names.

3.2.5 Impulse Response


Impulse (sys) plots the impulse response of the dynamic system model sys. This model
can be continuous or discrete, and SISO or MIMO. The impulse response of multi-input
systems is the collection of impulse responses for each input channel. Impulse (sys,
Tfinal) simulates the impulse response from t = 0 to the final time t = Tfinal.
>> H = tf([2 5 1],[1 2 3]);
>>impulse(H)

3.2.6 Step Response


Step (sys) plots the step response of an arbitrary dynamic system model sys. This model
can be continuous or discrete, and SISO or MIMO. The step response of multi-input
systems is the collection of step responses for each input channel. In Simulink step block
is available S = stepinfo (y,t,yfinal) takes step response data (t,y) and a steady-state value
yfinal and returns a structure S containing the following performance indicators:
RiseTime — Rise time
SettlingTime — settling time
Overshoot — Percentage overshoot (relative to yfinal)
Undershoot — Percentage undershoot
Peak — Peak absolute value of y
PeakTime — Time at which this peak is reached
>> H = tf([2 5 1],[1 2 3]);
>>step(H)
3.2.7 System Response for Arbitrary Input
lsim simulates the (time) response of continuous or discrete linear systems to arbitrary
inputs. When invoked without left-hand arguments, lsim plots the response on the screen.
lsim(sys,u,t) produces a plot of the time response of the dynamic system model sys to the
input time history t,u. The vector t specifies the time samples for the simulation (in
system time units, specified in the TimeUnit property of sys), and consists of regularly
spaced time samples. The matrix u must have as many rows as time samples (length(t))
and as many columns as system inputs. Each row u(i,:) specifies the input value(s) at the
time sample t(i).
S = lsiminfo( y,t,yfinal) takes the response data (t,y) and a steady-state value yfinal and
returns a structure S containing the following performance indicators:
SettlingTime — settling time
Min — Minimum value of Y

Department of Electrical Engineering Page 33


Lab Manual Control Systems

MinTime — Time at which the min value is reached


Max — Maximum value of Y
MaxTime — Time at which the max value is reached
All of the above responses can be viewed in LTI VIEW TOOL
3.2.8 Stability Analysis
1. Pole (sys) computes the poles p of the SISO or MIMO dynamic system model
sys.
2. z = zero(sys) returns the zeros of the single-input, single-output (SISO) dynamic
system model sys
3. [Wn, zeta] = damp(sys) returns the natural frequencies, Wn , and damping ratios,
zeta, of the poles of sys.(check this command for higher order systems)
4. h = pzplot(sys) computes the poles and (transmission) zeros of the dynamic
system model sys and plots them in the complex plane. The poles are plotted as
x's and the zeros are plotted as o's. It also returns the plot handle h. You can use
this handle to customize the plot with the “getoptions” and “setoptions”
commands. Type “help pzoptions “for a list of available plot options.
5. p = poly(A) where A is an n-by-n matrix returns an n+1 element row vector
whose elements are the coefficients of the characteristic polynomial, det(λI – A).
The coefficients are ordered in descending powers: if a vector c has n+1
components, the polynomial it represents is c1λn + c2λn-1 + … + cn λ + cn+1, p =
poly(r) where r is a vector returns a row vector whose elements are the
coefficients of the polynomial whose roots are the elements of r.
6. r = roots(c) returns a column vector whose elements are the roots of the
polynomial c. Row vector c contains the coefficients of a polynomial, ordered in
descending powers. If c has n+1 components the polynomial it represents is c1sn +
… + cns + cn + 1.
7. pzmap(sys) creates a pole-zero plot of the continuous- or discrete-time dynamic
system model sys. For SISO systems, pzmap plots the transfer function poles and
zeros. For MIMO systems, it plots the system poles and transmission zeros. The
poles are plotted as x's and the zeros are plotted as o's.
3.2.9 Lab Tasks
1. System Definition in Matlab: Use all of above mentioned commands to define a
fifth order system.
2. Model Interconnections: Define following system given in MATLAB
a. example 1
b. example 2
c. DC Motor Position:
J = 3.2284E-6;
b = 3.5077E-6;
K = 0.0274;
R = 4;
L = 2.75E-6;
s = tf('s');
P_motor = K/(s*((J*s+b)*(L*s+R)+K^2))

Department of Electrical Engineering Page 34


Lab Manual Control Systems

3. Impulse Response, Step Response: View impulse response, step response, impulse
response characteristics and step response characteristics of systems given in
task2. Repeat task 3 using LTIVIEW TOOL.
4. Impulse Response, Step Response: Obtain the unit impulse response for the following
system

Obtain the unit step response for the following system

Also explain why the results in above systems are same.


5. Stability Analysis: Do stability analysis of systems given in task two.

3.3 Modelling in Simulink


3.3.1 System Definition in Simulink
LTI system block in control system toolbox allows you to define any LTI system using
MATLAB commands tf, zpk and ss. You can define LTI system using basic blocks of
Simulink for example differentiator, integrator, summer and gain block

3.3.2 In-Lab Experiments


In following figure the system is defined in many ways

Figure 3-6

Direct Form I Realization

Department of Electrical Engineering Page 35


Lab Manual Control Systems

Figure 3-7

Direct Form II Realization

Figure 3-8
3.3.3 Practice Problem
DC Motor Model
J = 3.2284E-6;
b = 3.5077E-6;
K = 0.0274;
R = 4;

Department of Electrical Engineering Page 36


Lab Manual Control Systems
L = 2.75E-6;
s = tf('s');
P_motor = K/(s*((J*s+b)*(L*s+R)+K^2))

3.3.4 Lab Task


Define the following system using direct form I and direct form II.

Figure 3-9

Department of Electrical Engineering Page 37


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 38


Lab Manual Control Systems

Experiment No.4 STATE SPACE REPRESENTATION USING


MATLAB
4.1 Objective
To enable the students to analyse state space representation using MATLAB and
Simulink

4.2 State Space Representation


The state space model represents a physical system as n first order differential equations.
This form is better suited for computer simulation than an nth order input-output
differential equation.
Vector matrix format generally is given by:

Where, y is the output equation, and x is the state vector.


4.2.1 Components of a State Space Representation
1. State Variables: A subset of system variables which if known at an initial time t0
along with subsequent inputs are determined for all time t>t0+
2. State Equations: n linearly independent first order differential equations relating
the first derivatives of the state variables to functions of the state variables and the
inputs.
3. Output equations: algebraic equations relating the state variables to the system
outputs.
The equation gathered from the free body diagram is:
+b
Substituting the definitions of the states into the equation results in:
+b
Solving for v' gives the state equation:

The desired output is for the position, x, so:

Now the derivatives of the state variables are in terms of the state variables, the
inputs, and constants.

Our state vector consists of two variables, x and v so our vector-matrix will be in
the form:

Department of Electrical Engineering Page 39


Lab Manual Control Systems

4.2.2 Exact Representation

4.2.3 Input of the State Space Model in MATLAB


In order to enter a state space model into MATLAB, enter the coefficient matrices A, B,
C, and D into MATLAB. The syntax for defining a state space model in MATLAB is:

statespace = ss(A, B, C, D)
where A, B, C, and D are from the standard vector-matrix form of a state space model.
e.g.
>>m = 2; b = 5; k = 3;
>>A = [0 1; -k/m –b/m];
>>B = [0;1/m];
>>C = [1 0];
>>D = 0;
>>statespace_ss = ss(A,B,C,D)
4.2.4 Extracting A, B, C and D Matrices from a State Space Model
In order to extract the A, B, C, and D matrices from a previously defined state space
model, use MATLAB's ssdata command.
[A, B, C, D] = ssdata(statespace)
Where, statespace is the name of the state space system. e.g.
>> [A, B, C, D] = ssdata(statespace_ss)
The MATLAB output will be:
A=
-2.5000 -0.3750
4.0000 0

4.2.5 Step Response using State Space Model


Once the state space model is entered into MATLAB it is easy to calculate the response
to a step input. To calculate the response to a unit step input, use:
step(statespace)
Where, statespace is the name of the state space system. For steps with magnitude other
than one, calculate the step response using:
step(u * statespace)
Where, u is the magnitude of the step and statespace is the name of the state space
system.

Department of Electrical Engineering Page 40


Lab Manual Control Systems

4.3 State Space Modelling using Simulink


The state-space method is convenient for breaking down a higher-order differential
equation into a series of first-order equations for easier solution by matrix methods. To
begin, select the State-Space block from the Continuous sub-menu of the Simulink
library. Complete the model with the Step and Scope blocks as shown in Figure.

Figure 4-1

Figure 4-2
Observe the step response and comment.

4.3.1 Conversion from Other Models to State Space Representation in


MATLAB
There are two commands to represent system in to state space form
1. TF2SS
2. ZP2SS

4.3.1.1 TF2SS Command


[A,B,C,D] = TF2SS(NUM,DEN)

Department of Electrical Engineering Page 41


Lab Manual Control Systems

One important fact to note is that although there is only one transfer function that
describes a system, you can have multiple state-space equations that describe a system.
The tf2ss command returns the state-space matrices in control canonical form. Therefore,
if you take a set of state-space equations, convert them into a transfer function, and then
convert it back, you will not have the same set of state-space equations you started with
unless you started with matrices in control canonical form.
4.3.1.2 ZP2SS Command
[A,B,C,D] = zp2ss(z,p,k)
Again, it is important to note that more than one set of state-space matrices can describe a
system. The state-space matrices returned from this command are also in control
canonical form

4.4 Lab Task


Using MATLAB, obtain the transfer function for the control system in the figure below.

Figure 4-3
Hint: Use the commands of “series” and “feedback”.

Department of Electrical Engineering Page 42


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 43


Lab Manual Control Systems

Experiment No.5 RESPONSE OF SECOND ORDER SYSTEM


AND ANALYSIS OF STEADY STATE ERROR USING
MATLAB
5.1 Objective
To enable the students how to analyse higher (2nd) order system and steady state error
using MATLAB

5.2 Response of Second Order System


Second order systems are commonly encountered in practice, and are the simplest type of
dynamic system to exhibit oscillations. In fact many real higher order systems are
modeled as second order to facilitate analysis. Examples include mass-spring-damper
systems and RLC circuits.
The general form of the second order differential equation is as follows

The second order transfer function is

5.2.1 DC Gain
The DC gain again is the ratio of the magnitude of the steady-state step response to
the magnitude of the step input, and for stable systems it is the value of the transfer
function when . For second order systems

5.2.2 Damping Ratio


The damping ratio is a dimensionless quantity charaterizing the energy losses in the
system due to such effects as viscous friction or electrical resistance. From the above
definitions,

5.2.3 Natural Frequency


The natural frequency is the frequency (in rad/s) that the system will oscillate at when
there is no damping .

5.2.4 Poles/Zeros
The second order transfer function has two poles at:

Department of Electrical Engineering Page 44


Lab Manual Control Systems

5.2.5 Under Damped System


If , then the system is under damped. Both poles are complex valued with negative
real parts; therefore the system is stable but oscillates while approaching the steady-state
value.

5.2.6 Percent Overshoot


The percent overshoot is the percent by which a system exceeds its final steady-state
value. For a second order under damped system, the percent overshoot is directly related
to the damping ratio by the following equation:

For second order under damped systems, the 2% settling time, , rise time, , and
percent overshoot, %OS, are related to the damping and natural frequency as shown
below.

5.2.7 Over Damped Systems


If , then the system is over damped. Both poles are real and negative; therefore the
system is stable and does not oscillate.

5.2.8 Critically Damped Systems


If , then the system is critically damped. Both poles are real and have the same
magnitude . Critically damped systems approach steady-state quickest without
oscillating.

5.2.9 Un-damped Systems


If , then the system is un-damped. In this case, the poles are purely imaginary;
therefore the system is marginally stable and oscillates indefinitely.

5.2.10 Bode Plot


We show the Bode Magnitude and Phase Plots for all damping conditions of a second
order system below:
bode(G1,G2,G3,G4)
legend('under damped: zeta < 1','over damped: zeta >
1','critically damped: zeta = 1','undamped: zeta = 0')
The magnitude of the bode plot of a second order system drops off at -40dB per decade,
while the relative phase changes from 0 to -180 degrees at -90 degrees per decade. For
the under damped systems, we also see a resonance peak near the natural frequency, = 10

Department of Electrical Engineering Page 45


Lab Manual Control Systems

rad/s. The sharpness of the peak depends on the damping in the system, and is
characterized by the quality factor, or Q-Factor, defined below.

5.3 Lab Tasks


Make the pole zero plot and the step response of the following system to ensure that it is
an

1. under-damped system and


2. over-damped system and
3. critically-damped system and
4. un-damped system and

5.4 Analysis of Steady State Error using MATLAB


Steady-state error is defined as the difference between the input (command) and the
output of a system in the limit as time goes to infinity (i.e. when the response has reached
steady state). The steady-state error will depend on the type of input (step, ramp, etc.) as
well as the system type (0, I, or II).
Note: Steady-state error analysis is only useful for stable systems. You should always
check the system for stability before performing a steady-state error analysis.

5.4.1 Calculating steady-state errors


Before talking about the relationships between steady-state error and system type, we will
show how to calculate error regardless of system type or input. Then, we will start
deriving formulas we can apply when the system has a specific structure and the input is
one of our standard functions. Steady-state error can be calculated from the open or
closed-loop transfer function for unity feedback systems. For example, let's say that we
have the system given below.

Figure 5-1

Department of Electrical Engineering Page 46


Lab Manual Control Systems

We can calculate the steady-state error for this system from either the open- or closed-
loop transfer function using the Final Value Theorem. Recall that this theorem can only
be applied if the subject of the limit (sE(s) in this case) has poles with negative real part.

Now, let's plug in the Laplace transforms for some standard inputs and determine
equations to calculate steady-state error from the open-loop transfer function in each
case.
 Step Input (R(s) = 1 / s):

 Ramp Input (R(s) = 1 / s^2):

 Parabolic Input (R(s) = 1 / s^3):

5.4.2 System type and steady-state error


If you refer back to the equations for calculating steady-state errors for unity feedback
systems, you will find that we have defined certain constants (known as the static error
constants). These constants are the position constant , the velocity constant , and the
acceleration constant . Knowing the value of these constants, as well as the system
type, we can predict if our system is going to have a finite steady-state error.
First, let's talk about system type. The system type is defined as the number of pure
integrators in the forward path of a unity-feedback system. That is, the system type is
equal to the value of n when the system is represented as in the following figure. It does
not matter if the integrators are part of the controller or the plant.

Figure 5-2

Department of Electrical Engineering Page 47


Lab Manual Control Systems

Therefore, a system can be type 0, type 1, etc. The following tables summarize how
steady-state error varies with system type.

Figure 5-3
5.4.3 Meeting steady-state error requirements
Consider a system of the form shown below.

Figure 5-4
For this example, let G(s) equal the following.

Department of Electrical Engineering Page 48


Lab Manual Control Systems

Since this system is type 1, there will be no steady-state error for a step input and there
will be infinite error for a parabolic input. The only input that will yield a finite steady-
state error in this system is a ramp input. We wish to choose K such that the closed-loop
system has a steady-state error of 0.1 in response to a ramp reference. Let's first examine
the ramp input response for a gain of K = 1.

Figure 5-5
Now let's modify the problem a little bit and say that our system has the form shown
below.

Figure 5-6

Department of Electrical Engineering Page 49


Lab Manual Control Systems

From our tables, we know that a system of type 2 gives us zero steady-state error for a
ramp input. Therefore, we can get zero steady-state error by simply adding an integrator
(a pole at the origin). Let's view the ramp input response for a step input if we add an
integrator and employ a gain K = 1.

5.5 Lab Tasks


1. Determine the steady state error of the resultant signal and state weather it is
equal to or greater than 0.1? Also determine the value of K for which the
system will have 0.1 steady state error? Verify by viewing the plot (Refer to
Fig-5.5).
2. Analyze the plot and see if the system attains a steady state error equal to zero
as it reaches final/steady state value (Refer to Fig-5.6).

Department of Electrical Engineering Page 50


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 51


Lab Manual Control Systems

Experiment No.6 ROUTH HURWITZ CRITERIA USING


MATLAB
6.1 Objective
To analyse the stability of a system using Routh Hurwitz criterion

6.2 Theory
For an LTI system to be stable it has to satisfy the following conditions:
1. It should produce bounded output for bounded input
2. Response should approach towards zero for zero input as t→∞
The Routh Hurwitz stability criterion is a mathematical test that is a necessary and
sufficient condition for the stability of a linear time invariant (LTI) control system. The
Routh test is an efficient recursive algorithm that English mathematician Edward John
Routh proposed in 1876 to determine whether all the roots of the characteristic
polynomial of a linear system have negative real parts. German mathematician Adolf
Hurwitz independently proposed in 1895 to arrange the coefficients of the polynomial
into a square matrix, called the Hurwitz matrix, and showed that the polynomial is stable
if and only if the sequence of determinants of its principal submatrices are all positive.
The two procedures are equivalent, with the Routh test providing a more efficient way to
compute the Hurwitz determinants then computing them directly. A polynomial
satisfying the Routh-Hurwitz criterion is called a Hurwitz polynomial.

The importance of the criterion is that the roots p of the characteristic equation of a linear
system with negative real parts represents solutions ept of the system that are stable
(bounded). Thus the criterion provides a way to determine if the equations of motion of a
linear system have only stable solutions, without solving the system directly. For discrete
systems, the corresponding stability test can be handled by the Schur-Cohn criterion, the
Jury test and the Bistritz test.

6.2.1 Routh Hurwitz criterion for second, third and fourth order
polynomials

In the following, we assume the coefficient of the highest order (e.g. in a second order
polynomial) to be positive. If necessary, this can always be achieved by multiplication of
the polynomial with -1.

 For a second order polynomial, , all the roots are in


the left half plane (and the system with characteristics equation P(s) is stable) if
all the coefficients satisfy an>0.
 For a third order polynomial , all the
coefficients must satisfy an>0, and
 For a fourth order polynomial , all
the coefficients must satisfy an>0, and and

Department of Electrical Engineering Page 52


Lab Manual Control Systems

6.2.2 Higher Order Example

A tabular method can be used to determine the stability when the roots of a higher order
characteristic polynomial are difficult to obtain. For an nth-degree polynomial

The table has n+1 row and the following structure:

Where the elements bi and ci can be computed as follows:

When completed, the number of sign changes in the first column will be the number of
non-negative poles. Consider a system with a characteristic polynomial

We have the following table

Department of Electrical Engineering Page 53


Lab Manual Control Systems

In the first column, there are two sign changes (0.75 → −3, and −3 → 3), thus there are
two non-negative roots where the system is unstable." Sometimes the presence of poles
on the imaginary axis creates a situation of marginal stability. In that case the coefficients
of the "Routh Array" become zero and thus further solution of the polynomial for finding
changes in sign is not possible. Then another approach comes into play. The row of
polynomial which is just above the row containing the zeroes is called "Auxiliary
Polynomial".

We have the following table

In such a case the auxiliary polynomial is A(s) = 2s4+12s2+16 which is again equal to
zero. The next step is to differentiate the above equation which yields the following
polynomial. B(s) = 8s3+24s1. The coefficients of the row containing zero now become
"8" and "24". The process of Routh array is preceded using these values which yield two
points on the imaginary axis. These two points on the imaginary axis are the prime cause
of marginal stability.

6.3 In-Lab Experiment


Using MATLAB & Routh Hurwitz criterion, check whether system is stable or not.

And verify your answer by using the built-in command for Routh Hurwitz criterion. For
example
P = [1 6 11 3];
Routh(p)
6.3.1 Routh Stability Criterion (State Space Representation)
The dynamics of a system is represented by the vector matrix differential equation:

Department of Electrical Engineering Page 54


Lab Manual Control Systems

Find its characteristics equation and check its stability using Routh Hurwitz criterion and
compare your results with built-in command's results.
Hint: convert states space into polynomial and then analyse its stability using Routh
Hurwitz criterion.

6.4 Lab Tasks


1. Write code for Routh Hurwitz for fifth order polynomial
2. Using the above code and build-in command check the stability of following
system:

3. The state equations for linear systems are as following, is this a stable system?

4. Using MATLAB commands for Routh Hurwitz criterion determine whether or


not unity feedback control system having the following transfer function is stable
or not?

Department of Electrical Engineering Page 55


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 56


Lab Manual Control Systems

Experiment No.7 ANALYSIS AND CONTROLLER DESIGN


VIA ROOT LOCUS METHOD AND LEAD/LAG
COMPENSATOR
7.1 Objective
To facilitate the students in drawing root locus and to enable the students to design
proportional-gain controller, in compliance with the performance parameters set forth

7.2 Theory
In the previous sessions, we discussed absolute stability of a closed-loop feedback control
system using Routh-Hurwitz method. We also studied how the performance of a
feedback system can be described in terms of the location of the roots of the
characteristic equation in the s-plane. We know that the response of a closed-loop
feedback control system can be adjusted to achieve the desired performance by judicious
selection of one or more system parameters. It is, therefore, very useful to determine how
the roots of the characteristic equation move around the s-plane as we change one
parameter.
The Root Locus method, as the name suggests, looks at the loci of the roots as some
parameter of interest, within the system, is varied. Since we already know that the
position of the roots of the characteristic equation strongly influence the step response of
the system, we can find values of the parameter which will position the roots
appropriately, using the method of Root Locus. This method involves root locus diagrams
which the students are expected to have learnt in the theory class. In this lab we will use
Matlab’s powerful computing capability to find and trace root locus of a given system.

7.2.1 Obtaining a Root Locus Plot

Let we have a unity feedback system as shown in figure 6.1. In plotting root loci with
Matlab we need the characteristics equation of this system defined as

Figure 7-1 A unity Feedback System

Department of Electrical Engineering Page 57


Lab Manual Control Systems

7.2.2 Continuous Root Locus Plot

Matlab provides us with rlocus command to compute and display root locus of any
system. The syntax of this command is as follows
>> rlocus(num,den)
Here num is array of open-loop numerator coefficients and den is array of open-loop
denominator coefficients. Using this command, the root locus is plotted on the figure
window as shown in figure 6.2. The gain vector K is automatically determined and
contains all the gain values for which the closed-loop poles are to be computed. However,
we can define vector K as per our own will and provide it to rlocus command as
>> rlocus (num,den,K)
If this command is invoked with left-hand arguments, like
[r,k] = rlocus(num,den)
[r,k] = rlocus(num,den,k)
[r,k] = rlocus(sys)
the command window will show the matrix r and gain vector K. The columns of matrix r
are equal to length of K and its rows are den-1, containing the complex root locations.
Each row of the matrix corresponds to a gain from vector K. We can then plot the loci by
using the plot command
>> plot(r,’-’)

Figure 7-2 Root Locus of the System

Department of Electrical Engineering Page 58


Lab Manual Control Systems

7.2.3 Comments on the Root Locus Plot

In root locus, we examine system’s stability against all possible values of K. No matter
what we pick K to be, the closed-loop system must always have n poles, where n is the
number of poles of open-loop transfer function, G(s)H(s). The root locus must have n
branches; each branch starts at a pole of G(s)H(s) and goes to a zero of G(s)H(s). If
G(s)H(s)has more poles than zeros (as is often the case), m < n, we say that G(s)H(s) has
zeros at infinity. In this case, the limit of G(s)H(s) as → ∞ is zero. The number of zeros
at infinity is n-m and is the number of branches of the root locus that go to infinity
(asymptotes). Since the root locus is actually the locations of all possible closed-loop
poles, from the root locus we can select a gain such that our closed-loop system will
perform the way we want. If any of the selected poles is on the right half plane, the
closed-loop system will be unstable. The poles that are closest to the imaginary axis have
the greatest influence on the closed-loop response, so even though the system has three or
four poles, it may still act like a second or even first order system depending on the
location(s) of the dominant pole(s).

7.2.4 Constant ζ and Constant wn Loci

Recall that in the complex plane the damping ratio ζ of a pair of complex-conjugate poles
can be expressed in terms of the angle φ, which is measured from the negative real axis.

In other words, lines of constant damping ratio are radial lines passing through the origin
as shown in figure. For example, a damping ratio of 0.5 requires that the complex poles
lie on the lines drawn through the origin making angles of ± 60o with negative real axis.
If the real part of a pair of complex poles is positive, which means that the system is
unstable, the corresponding ζ is negative. The damping ratio determines the angular
location of the poles, while the distance of the pole from the origin is determined by the
undamped natural frequency . The constant loci are circles.

7.2.5 Plotting Polar Grids in the Root Locus Diagram

To draw constant ζ lines and constant circles on the root locus diagram with Matlab,
we use the sgrid command. This command overlays lines of constant damping ratio (ζ = 0
~ 1 with 0.1 increment) and circles of constant on the root locus plot. Run the
following code in Matlab and observe the output.
sgrid
axis ([-2 2 -2 2])
axis ('square')
title ('Constant \zeta Lines and Constant \omega_n Circles')
xlabel ('Real Axis')
ylabel('Imaginary Axis')
If only a particular constant ζ lines and particular constant circles are desired, we may
use the following variant of sgrid command
>> sgrid ([0.5, 0.707],[ 0.5, 1, 1.5])
Enter the following code into Matlab and show that the resulting plot is similar to the one
shown in figure 6.5.

Department of Electrical Engineering Page 59


Lab Manual Control Systems

num = [ 0 0 0 1 ]
den = [ 1 4 5 0 ]
axis ('square')
rlocus (num , den)
axis ([- 3 1 -2 2])
sgrid ([0.5 , 0.707],[0.5 , 1.0 , 1.5])
title ('Root Locus Plot with \zeta = 0.5 and 0.707 Lines and \omega_n = 0.5, 1.0 and 1.5
Circles')

Figure 7-3 Root Locus Plot

If we want to omit either the entire constant ζ lines or entire constant circles, we may
use empty brackets [] in the arguments of the sgrid command. For example, if we want to
overlay only the constant damping ratio lines corresponding to ζ = 0.5 and no constant
circles to the root locus plot shown in figure 6.5, then we may use the command
sgrid (0.5,[])
And if you want to get the value of poles and gain at any particular point in root locus,
you may use the following command.
[k,poles]=rlocfind(num,den)
Click on any point in the root locus, you will get the value of Gain and Poles at that point.

7.2.6 Preliminary Design Considerations

Control systems are designed to perform specific tasks. The requirements imposed on the
control systems are usually spelled out as performance specifications. These
specifications are given before the design process begins and are generally in terms of

Department of Electrical Engineering Page 60


Lab Manual Control Systems

transient response requirements (such as the maximum overshoot and settling time in step
response) and of steady-state requirements (such as steady-state error in following a ramp
input).

For routine design problems, the performance specifications (which relate to accuracy,
relative stability, and speed of response) may be given in terms of precise numerical
values or in terms of qualitative statements. In latter case the specifications may have to
be modified during the course of design, since the given specifications may never be
satisfied (because of conflicting requirements) or may lead to a very expensive system.
Generally, the performance specifications should not be more stringent than necessary to
perform the given task.

7.2.7 System Compensation

Altering a control system to meet relative stability and performance specifications is


called compensation and a device inserted into the system for the purpose of satisfying
the specifications is called compensator. Figure 6.4 (a) and (b) show compensation
schemes commonly used for feedback control system. The choice between cascade
compensation and feedback compensation depends in the nature of the signals in the
system, the power levels at various points, available components, the designer’s
experience, and economic considerations etc.

Figure 7-4 (a) Cascade Compensation; (b) Feedback Compensation


Normally, cascade (or series) compensation may be simpler than feedback (or parallel)
compensation; however, series compensation frequently requires additional amplifiers to
increase the gain and/or to provide isolation. Note that, in general, the number of
components required in parallel compensation will be less than the number of
components in series compensation, provided a suitable signal is available. In this lab we
will discuss series compensation in detail.

7.2.8 Types of Compensators

If a compensator is needed to meet the performance specifications, the designer must


realize a physical device that has the prescribed transfer function of the compensator.
If a sinusoidal input is applied to a network, and the steady-state output (which is also
sinusoidal) has a phase lead, then the network is called a lead network and the device to
eliminate this phase lead is called lead compensator. The amount of phase lead angle is a

Department of Electrical Engineering Page 61


Lab Manual Control Systems

function of the input frequency. If the steady-state output has a phase lag, then the
network is called a lag network and the corresponding device to remove this phase lag is
called lag compensator. These compensators may be electronic devices, such as
operational amplifiers, or RC networks and amplifiers.

7.2.9 Root Locus Approach to Control System Design

As discussed earlier, the root locus plot of a system may indicate that the desired
performance or stability cannot be achieved just by the adjustment of gain. Then it is
necessary to reshape the root loci to meet the performance specifications.
In designing a control system, if other than a gain adjustment is required, we must modify
the original root loci by inserting a suitable compensator so that a pair of dominant
closed-loop poles can be placed at the desired location. Often, the damping ratio and
undamped natural frequency of a pair of dominant closed loop poles are specified.

7.2.10 Effects of Addition of Poles and Zeros

When we add a pole to the open-loop transfer function of a system it


 Pulls the root locus to the right
 Tends to lower the system’s relative stability
 Slows down the settling of the response
On the contrary, addition of a zero to the open-loop transfer function
 Pulls the root locus to the left
 Tends to make the system more stable
 Speeds up the settling of the response

7.2.11 Lead Compensator Design

A first-order lead compensator can be designed using the root locus. The transfer function
of a lead compensator is given by

Where the magnitude of z is less than the magnitude of p. A phase-lead compensator


tends to shift the root locus toward the left-half plane. This results in an improvement in
the system's stability and an increase in the response speed. How is this accomplished? If
you recall finding the asymptotes of the root locus that lead to the zeros at infinity, the
equation to determine the intersection of the asymptotes along the real axis is:

When a lead compensator is added to a system, the value of this intersection will be a
larger negative number than it was before. The net number of zeros and poles will be the
same (one zero and one pole are added), but the added pole is a larger negative number
than the added zero. Thus, the result of a lead compensator is that the asymptotes'

Department of Electrical Engineering Page 62


Lab Manual Control Systems

intersection is moved further into the left half plane, and the entire root locus will be
shifted to the left. This can increase the region of stability as well as the response speed.

7.2.12 Solving Ball and Beam Problem using Lead Compensator

The ball and beam system is one of the most enduringly popular and important laboratory
models for teaching control systems engineering. The ball and beam system is widely
used because it is very simple to understand as a system, and yet the techniques that can
be studies to control it cover many important classical and modern design methods. It has
a very important property – it is open-loop unstable.

Figure 7-5 The Ball and Beam System


The system is shown in figure 6.5. A steel ball is rolling on top of a long beam. The beam
is mounted on the output shaft of an electric motor and so the beam can be tilted about its
center axis by applying an electrical control signal to the motor amplifier. The position of
the ball on the beam can be measured using a special sensor.
The control job is to automatically regulate the position of the ball on the beam by
changing the angle of the beam. This is a difficult task because the ball does not stay in
one place on the beam but moves with an acceleration that is proportional to the tilt of the
beam. In control technology this system is open-loop unstable because the system output
(the ball position) increases without limit for a fixed input (beam angle).
Feedback control must be used to keep the ball in desired position on the beam.
The complete description of the dynamics of the ball rolling on the beam is quite
complicated and for control system perspective a simplified derivation is used to give a
model that is good for controller design.
The force that accelerates the ball as it rolls on the beam comes from the component of
gravity that acts parallel to the beam. The dotted line in figure shows this force to be
. The ball actually accelerates along the beam by rolling, but we can simplify the
derivation by assuming that the ball is sliding without friction along the beam. Then,
using the second law of Newton, the simplified ball and beam model is,

Department of Electrical Engineering Page 63


Lab Manual Control Systems

Figure 7-6 The Beam and Ball System Dynamics

Where m is the mass of the ball, g is the gravitational constant, is the beam angle and x
is the position of the ball on the beam.
For small angles, ≈ , so the model becomes,

This simple model of the ball and beam is a good approximation to the true system
dynamics, and is the one normally used in text books and design studies for controller
design. Combining actuator and sensor constants with the gravity constant, we get a
single constant b. This represents the overall gain of the response from control voltage
input to measured output acceleration. The transfer function representation of the above
equation is

Where

Let’s now set the design criteria and system parameter of this problem as,
 Settling time less than 3 seconds
 Overshoot less than 5%
And the parameters are
= 0.111
= 0.015
= −9.8
= 1.0
= 0.03
= 9.99 × 10-6

Department of Electrical Engineering Page 64


Lab Manual Control Systems

Theoretically, design a lead compensator for the above ball and beam system which
meets the given design criteria.

7.2.13 Lag Compensator Design

A first-order lag compensator can be designed using the root locus. A lag compensator in
root locus form is given by

where the magnitude of z is greater than the magnitude of p. A lag compensator tends to
shift the root locus to the right, which is undesirable. For this reason, the pole and zero of
a lag compensator must be placed close together (usually near the origin) so they do not
appreciably change the transient response or stability characteristics of the system.
How does the lag controller shift the root locus to the right? The answer is the same as
that to lead compensator. Again recall finding the asymptotes of the root locus that lead
to the zeros at infinity, the equation to determine the intersection of the asymptotes along
the real axis is

When a lag compensator is added to a system, the value of this intersection will be a
smaller negative number than it was before. The net number of zeros and poles will be
the same (one zero and one pole are added), but the added pole is a smaller negative
number than the added zero. Thus, the result of a lag compensator is that the asymptotes'
intersection is moved closer to the right-half plane, and the entire root locus will be
shifted to the right.
It was previously stated that that lag controller should only minimally change the
transient response because of its negative effect. If the phase-lag compensator is not
supposed to change the transient response noticeably, what is it good for? The answer is
that a phase-lag compensator can improve the system's steady-state response. It works in
the following manner. At high frequencies, the lag controller will have unity gain.
At low frequencies, the gain will be z/p which is greater than 1. This factor z/p will
multiply the position, velocity, or acceleration constant (Kp, Kv, or Ka) and the steady
state error will thus decrease by the factor z/p.

7.2.14 DC Motor Speed Control using Lag Compensator

The open-loop transfer function of a DC motor speed is given by

And the schematic looks like figure 6.7

Department of Electrical Engineering Page 65


Lab Manual Control Systems

Figure 7-7 DC Motor Speed Control System


With a 1 rad/sec step reference, the design criteria are:
 Settling time less than 2 seconds
 Overshoot less than 5%
 Steady-state error less than 1%
Keeping the above criteria in consideration, design a Lag Compensator.

7.3 In Lab Experiment


7.3.1 Design using Root Locus

Consider an open-loop system which has a transfer function of

We want to design a feed-back controller for the system by using the root locus method
and our design criteria are 5% overshoot and 1 second rise time.
 Design a controller in MATLAB which meets the given criteria

7.3.2 Analysis of Designed Lead Compensator on MATLAB

 For the system defined by equation 1, implement the designed compensator in


MATLAB and verify the results

7.3.3 Analysis of Designed Lag Compensator on MATLAB

 For the Lag Compensator Designed in Pre-Lab session, analyze the compensator
on MATLAB.

7.4 Lab Tasks


Exercise 1
Given is a plant described by the transfer function

Department of Electrical Engineering Page 66


Lab Manual Control Systems

For this plant a controller must be designed, such that the step response of the closed loop
shows the following properties:
P.O = 16% and tr, 50 =0.6s

Exercise 2
Lasers can be used to drill the hip socket for the appropriate insertion of an artificial hip
joint. The use of the laser surgery requires high accuracy for position and velocity
response. Let us consider the system shown below which uses a DC motor manipulator
for the laser.
The amplifier gain K must be adjusted so that the steady state error for a ramp input, r(t)
= At (where A = 1mm/s), is less than or equal to 0.1 mm, while a stable response is
maintained.
To obtain the steady-state error required and a good response, we select motor with a
field time constant τ1 = 0.1 sec and a motor-plus-load time constant τ2 = 0.2 sec.
a) Find the value of K for which ess is less than 0.1 mm. Expression for ess for ramp
input is

b) Find the range of K for which the system is stable using root locus.
Apply a ramp input and observe the output for t = 0 sec to t = 6 sec

Exercise 3
Consider the following unity feedback system,

Design a Compensator to tailor the transient response as per the given criteria
 Percent Overshoot < 10 %
 Settling Time < 2 sec

Exercise 4
You would notice that although the transient response of the above system is adapted as
per the given specifications, yet its steady-state error is beyond any tolerance range. Now

Department of Electrical Engineering Page 67


Lab Manual Control Systems

design another compensator and cascade it with the previous one to reduce the steady-
state error to less than 5 %.
Note: Exercise 1 and 2 employ both lead compensator and lag compensator on a plant.
Such controller that compensates both lead effect and lag effect is called lead-lag
compensator.

Exercise 5
Design Simulink model of the system given above. Apply both lead and lag compensator
in cascaded fashion to the plant validate the results obtained in exercise 1 and 2.

Department of Electrical Engineering Page 68


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 69


Lab Manual Control Systems

Experiment No.8 DESIGN AND ANALYSIS OF PID


CONTROLLER
8.1 Objective
To investigate the characteristics of each of proportional (P), integral (I), and derivative
(D) Controls, and learn how to use them to obtain a desired response

8.2 Theory
A proportional–integral–derivative controller (PID controller) is the most commonly used
feedback controller in industrial control systems. A PID controller calculates an error
value as the difference between measured output and a desired set point. The controller
attempts to minimize the error by adjusting the process control inputs.
The popularity of PID controller can be attributed partly to their robust performance in a
wide range of operating conditions and partly to their functional simplicity, which allows
engineers to operate them in a simple and straightforward manner.

8.2.1 Theory of three term Controller

The transfer function of the PID controller looks like the following;

Here,
Kp = Proportional Gain
Ki = Integral Gain
Kd = Derivative Gain
First, let’s take a look at how the PID controller works in a closed-loop system using the
schematic shown below.

Figure 8-1
The signal e(t) represents the tracking error, the difference between the reference input
r(t) and the actual output y(t). This error signal will be sent to the PID controller, and the
controller computes both the derivative and integral of this error signal. The signal u(t)
just past the controller is now equal to the proportional gain (Kp) times the magnitude of

Department of Electrical Engineering Page 70


Lab Manual Control Systems

the error signal plus the integral gain (Ki) times the integral of the error signal plus the
derivative gain (Kd) times the derivative of the error signal.

This signal, u(t), will now be sent to the plant, and the new output, y(t), will be obtained.
This new output will be sent back to the sensor again to find the new error signal. The
controller takes this new error signal and computes its derivative and it’s integral again.
This process goes on and on.

8.2.2 Characteristics of P, I and D Controller

A proportional controller (Kp) will have the effect of reducing the rise time and will
reduce but never eliminate the steady-state error. An integral control (Ki) will have the
effect of eliminating the steady-state error, but it may make the transient response worse.
A derivative control (Kd) increases the stability of the system, reduces the overshoot, and
improves the transient response. Effects of each controller on closed loop system are
summarized in the table below.

Note that these correlations may not be exactly accurate, because Kp, Ki, and Kd are
dependent on each other. In fact, changing one of these variables can change the effect of
the other two. For this reason, the table should only be used as a reference when you are
determining the values for Ki, Kp and Kd.

8.2.3 General Tips for Designing PID Controller

When you are designing a PID controller for a given system, follow the steps shown
below to obtain a desired response.
1. Obtain an open-loop response and determine what needs to be improved
2. Add a proportional control to improve the rise time
3. Add a derivative control to improve the overshoot
4. Add an integral control to eliminate the steady-state error
5. Adjust each of Kp, Ki, and Kd until you obtain a desired overall response. You
can always refer to the table shown above to find out which controller controls
what characteristics.

Department of Electrical Engineering Page 71


Lab Manual Control Systems

Figure 8-2
Lastly, keep in mind that you do not need to implement all three controllers (proportional,
derivative, and integral) into a single system, if not necessary. For example, if a PI
controller gives a good enough response (like the above example), then you don't need to
implement a derivative controller on the system. Keep the controller as simple as
possible.

8.3 In-Lab Experiment


8.3.1 Mass Spring Damper Model
Consider the Mass Spring System as discussed in Lab 2, with transfer function

Let the system parameters be,


M = 1 kg
b = 10 N.s/m
k = 20 N/m
Fa(s) = 1 N
 Design a PID controller using any technique learned in this course to achieve the
following
 Fast Rise Time
 Minimum Overshoot
 No Steady-State Error
 Implement the designed controller in MATLAB and analyze the response of your
system before and after designing the controller.

8.3.2 Design Problem: Ball & Beam System

As derived in the previous lab, the open-loop transfer functions of the plant for the ball
and beam experiment is:

Department of Electrical Engineering Page 72


Lab Manual Control Systems

The design criteria for this problem are:


 Settling time less than 3 seconds
 Overshoot less than 5%

Figure 8-3
 Design a PID Controller to achieve the above criteria
 Implement the designed controller in MATLAB and analyze the response of your
system before and after designing the controller.

8.4 Lab Tasks


Exercise 1:
Consider a process given below to be controlled by a PID controller,

a) Obtain the unit step response of Gp(s).


b) Try PI controllers with (Kp = 2, 10, 100), and Ki = Kp/10. Investigate the unit
step response in each case, compare the results and comment.
c) Let Kp = 100, Ki = 10, and add a derivative term with (Kd = 0.1, 0.9, 2).
Investigate the unit step response in each case, compare the results and comment.
Based on your results in parts b) and c) above what do you conclude as a suitable PID
controller for this process and give your justification.

Exercise 2:
The open-loop transfer function of the DC Motor speed is

Department of Electrical Engineering Page 73


Lab Manual Control Systems

For a 1 rad/sec step input, design a PID controller that gives:


 Settling time less than 2 seconds
 Overshoot less than 5%
 Steady-stage error less than 1%

Exercise 3:
The open-loop transfer function of the DC Motor position is

With a 1 rad/sec step reference, the design criteria are:


 Settling time less than 0.04 seconds
 Overshoot less than 16%
 No steady-state error
 No steady-state error due to a disturbance
Design a PID controller that satisfies the given criteria. Note: For exercise 2 and 3 refer
to the figure below.

Figure 8-4
The open-loop transfer function of the DC Motor speed is

For a 1 rad/sec step input, design a PID controller that gives:


 Settling time less than 2 seconds
 Overshoot less than 5%
 Steady stage error less than 1%

Department of Electrical Engineering Page 74


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 75


Lab Manual Control Systems

Experiment No.9 FREQUENCY DOMAIN ANALYSIS OF


CONTROL SYSTEMS
9.1 Objective
To analyse the control systems and frequency domain using bode plots, bode plots for
state space, polar plots, nyquist plots, nyquist plots for state space

9.2 Theory
The frequency domain analysis is generally done by using a sinusoidal input signal.
When a sinusoidal input signal is given to a LTI system, the output response consist of
transient and steady state parts, whereas when the transient dies down as t→∞, only the
steady state part remains. The frequency response is the steady state response of a system
to a sinusoidal input signal. The advantage of frequency response analysis is that stability
of a close loop system can be determined from the frequency response of an open loop
system, be it bode plot or nyquist plot.
9.2.1 Frequency Response Representation
The frequency response can be represented in any of the following forms:
1. Bode Plots
2. Nyquist Plots
To plot the frequency response, a vector of frequencies (varying between zero and
infinity) is created and the values of system transfer function at those frequencies are
computed. If G(s) is the open loop transfer function of a system and ω is the frequency
vector, then a graph of G(jω) vs ω is plotted. Since G(jω) is a complex number, frequency
response plots consists of both its magnitude and phase vs ω (i.e Bode plot) or its position
is in the complex plane i.e Nyquist plots.

9.2.2 Bode Plots

Bode diagrams are logarithmic plots. It has two graphs: one is a plot of logarithm of
magnitude of a sinusoidal transfer function and the other is a plot of phase angle, both
plotted against the frequency on a logarithmic scale. The basic advantage of logarithmic
representation is that multiplication and division operations of the pole-zero
representation of a transfer function can be replaced by addition and subtraction
operations and greater range of frequencies can be considered.
Octave and Decade: The frequency in logarithmic terms can be represented as

Or

And

Department of Electrical Engineering Page 76


Lab Manual Control Systems

There are two types of frequency intervals:


1. The octave. For which ω2 = 2ω1 and
2. The decade. For which ω2 = 10ω1. Thus, the octave is a frequency band from ω1 to
2ω1, where ω1 is any frequency value. A decade is frequency band from ω1 to
10ω1.
The slope of straight lines in the Bode plot is expressed in terms of these two frequency
intervals i.e. decade or octave. The relation between decade and octave can be obtained
as
20dB/decade = 6dB/octave
9.2.3 Plotting Bode Diagrams

The commands used to plot the Bode diagrams of LTI system in MATLAB are
bode (n,d)
bode (sys)
where n and d are polynomials representing numerator and denominator of the given
transfer function, and sys is an LTI model of the system, created with either tf,zpk or ss.
The frequency range and number of points are automatically selected. Another similar
command is
bode (n, d, ω)
where ω specifies the user defined frequency range in rad/sec.
When the output response values are to be stored separately in matrices, then the
following command with left hand arguments and frequency vector is used:
[mag, phase, ω] = bode (n, d, ω)
This command will not generate any plot. However, it returns the frequency response of
the system in matrices containing magnitude, phase angle and frequency ω.
Similarly, the following commands can be used to obtain Bode diagrams:
[mag, phase, ω] = bode (n, d)
[mag, phase, ω] = bode (sys)
The magnitude mag can be converted into decibels with the following command”
magdB = 20*log10(mag)
9.2.4 Logrithmic Frequency Range
The following command is used to specify the logarithmic frequency range:

Department of Electrical Engineering Page 77


Lab Manual Control Systems

w = logspace (d1, d2)


The above command generates a vector of 50 points, logarithmically equally spaced
between decades 10d1 and 10d2.
For example, to generate 50 points between the frequencies 0.1 and 100rad/sec, the
command used in
w = logspace(-1, 2)
Where d1 = -1 and d2 = 2.
To generate n points logarithmically equally spaced between decades 10d1 and 10d2, the
following command is used:
logspace(d1, d2, n)
for example, to generate 100 points between 1 and 1000 rad/sec, enter the following
command:
w = logspace (0, 3, 100)
where d1 = 0 and d1 = 3 and number of points n = 100.
For example
Using MATLAB, obtain the Bode plot of the systems whose open loop transfer functions
are given as following:

The following MATLAB commands can be used to plot the BODE diagrams:
n = [10];
d = [1 7 0];
bode (n,d);
grid;
title(‘Bode plot of the function 10/(s2+7s)’);
Obtain the BODE diagrams for the following transfer functions in the specified frequency
range:

, ω = 0.01 to 1000 rad/sec

N = [200 200];
D = [1 10 100 0];
w = logspace(-2, 3, 6);
bode(n, d, w);

Department of Electrical Engineering Page 78


Lab Manual Control Systems

grid;
title(‘Bode plot of the function (200(s+1))/(s(s2+10s+100))’);
9.2.5 Indicating Gain and Phase Angles on the BODE Diagrams
The Bode diagrams obtained using MATLAB programs can alsi be used for marking gain
and phase angle values corresponding to any frequency graphically. This can be done by
clicking the mouse at the desired point on the diagrams. A box indicating values og gain
and frequency or phase and frequency appears in the figure window at the desired point.
Obtain graphically the gain and phase at any desired frequency values on the BODE
diagrams for transfer function .

The following program is used to obtain the desired response:


n = [1 5];
d = [1 2 3 1];
bode (n, d);
grid;
title(‘To illustrate obtaining values from plot of the function (s+5)/(s(s2+3s+1))’);
9.2.6 BODE Diagram for State Space Representation
If the system is defined in state space, the following commands can be used to obtain the
Bode diagrams:
Bode (A, B, C, D)
Bode (A, B, C, D, iu, w)
Where w is user supplied frequency vector. iu is an index specifying which input is to be
used for the response. Obtain the Bode diagram for the following system given in state
space form:

A = [0 1; -20 -2];
B = [0; 20];
C = [1 0];
D = [0];
Bode (A, B, C, D);
grid;
title(‘Bode plot for transfer function in state space form’);
9.2.7 Polar Plots
The polar plot of a sinusoidal transfer function G(jω) is a plot of the magnitude of G(jω)
versus the phase angle of G(jω) on polar co-ordinates as ω is varied from zero to ∞. Thus,
the polar plot is the locus of vectors as ω is varied from 0 to ∞. If the

Department of Electrical Engineering Page 79


Lab Manual Control Systems

angle is measured from positive x-axis, it is positive in anti-clockwise direction,


otherwise it is negative. The polar plot is very useful in determining the stability of a
closed loop system from its open loop frequency response.

MATLAB can be used to obtain a polar plot of G (jω) or to obtain and


accurately for various value of ω in the frequency range of interest.
9.2.8 Nyquist Plots
As mentioned earlier, the nyquist plot is a plot of magnitude versus angle
fir the frequency range -∞<ω<∞. Nyquist plot and Nyquist stability criterion is
useful for determining the stability of the closed loop system from the open loop
frequency response without determining the closed loop poles. The stability of a closed-
loop system is determined by finding out the number of encirclements of (-1 + j0) point
by the Nyquist contour of the open loop frequency response.
In MATLAB, the commands used to obtain Nyquist plot for a continuous LTI system
are:
Nyquist (n, d)
Nyquist (n, d, w)
Where w is the user specified frequency vector.
To obtain the real and imaginary values of transfer function at different values of w, the
following MATLAB commands are used”
[re, im, w] = nyquist(n, d)
[re, im, w] = nyquist(n, d, w)
Using these commands, matrices specifying real and imaginary values are obtained but
no plot is drawn. To get the plot, the plot command has to be used.
Draw a Nyquist plot using MATLAB for the following open loop transfer functions:

n = [0 0 1];
d = [1 1 1];
grid;
nyquist (n, d);
v = [-2 2 -2 2];
axis(v);
title(‘Nyquist plot for G(s) = 1/(s2+s+1)’);
9.2.9 Nyquist Plots for State Space System
If the system is defined in state space, the following commands can be used to obtain the
Nyquist plot:

Department of Electrical Engineering Page 80


Lab Manual Control Systems

nyquist (A, B, C, D)
nyquist (A, B, C, D, iu)
nyquist (A, B, C, D, iu, w)
where A, B, C, D are system matrices, iu is an index which specifies which input to use
for the frequency response, and w is the user-supplied frequency vector. This command
produces a series of Nyquist plots, one for each input and output combination of the
following system. The frequency range is automatically determined until and unless it is
defined by w.
Consider the system given by

Draw a Nyquist plot. This system has a single input u and a single output y.
A = [0 1; -20 -4];
B = [0;10];
C = [1 0];
D = [0];
grid;
title(‘Nyquist Plot for T.F. in State Space Form’);

9.3 Lab Tasks


1. Using MATLAB, obtain the Bode plot of the systems whose open-loop transfer
function is given as follows

2. Obtain the frequency response data (freq, mag, phase)for the following transfer
function for the specified frequency values

3. Obtain the Bode and Nyquist plot for the given state space form:

Department of Electrical Engineering Page 81


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 82


Lab Manual Control Systems

Experiment No.10 CLOSED LOOP PROPORTIONAL


CONTROL OF THE PRESSURE
10.1 Objectives
To verify the effects of the gain of the loop on the dynamic response of the system and
to represent the dynamic response curve of the system

10.2 Apparatus
 Digital multimeter
 Chronometer
 Set of leads

10.3 Figure

Figure 10-1

10.4 Procedure
1. Connect, through leads, bush No. 9 of the WATER PUMP DRIVER to bush No. 9
and bush No. 10 to bush No. 10 (Fig. 8-1(a))
2. Connect bush No. 1 of the Pressure Sensor to bush No. 1 of the relevant interface
and bush No. 2 to bush No. 2 (Fig. 8-1(a))

Department of Electrical Engineering Page 83


Lab Manual Control Systems

3. Connect the bush of SET POINT 1 to bush No. 4 of the PID controller and bush
No. 3 of the pressure interface to bush No. 3 of the PID controller (Fig. 8-1(a))
4. Insert one terminal of the digital voltmeter, set in dc, in the bush of SET POINT 1
and the other one in the earth bush
5. Regulate the voltage on SET POINT 1 at 2V
6. Move the terminal of the digital voltmeter from the bush of SET POINT 1 to bush
No. 3 of the PID controller: the voltage value must be equal to 0V
7. Move the terminal of the digital voltmeter from bush X1 of the PID controller: the
voltage value must be equal to the difference between the voltage applied to bush
No. 4 and that applied to bush No. 3, which is 2V
8. Regulate the PROPORTIONAL knob at 25%.
9. Connect bush No. 5 of the PID controller to bush No. 5 and bush No. 8 to bush
No. 8 of the WATER PUMP DRIVER
10. Move the terminal of the digital voltmeter to bush No.3 of the PID controller:
write down in Table 8-1(a) the voltage value.
11. Write down in Table 8-1(a) the voltage value read every 15 seconds untill the
transitory is completed
12. Move the terminal of the digital voltmeter to bush X1 of the PID controller: the
voltage value, to be written down, represents the steady state error.
13. Regulate the PROPORTIONAL knob to 50% and repeat the procedure from step
No. 9.
14. Repeat the procedure with the PROPORTIONAL knob at 75% and 100%.
15. Put OFF the main switch.
16. Draw the curves of the closed loop dynamic response for all the values of the
PROPORTIONAL knob.

10.5 Observations
Table 10-1

Department of Electrical Engineering Page 84


Lab Manual Control Systems

10.6 Graph

Figure 10-2

Department of Electrical Engineering Page 85


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

In-Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 86


Lab Manual Control Systems

Experiment No.11 CLOSED LOOP PROPORTIONAL –


INTEGRAL CONTROL OF THE PRESSURE
11.1 Objectives
To verify the effects of the gain of the loop on the dynamic response of the system and
to represent the dynamic response curve of the system

11.2 Apparatus
 Digital multimeter
 Chronometer
 Set of leads

11.3 Figure

Figure 11-1

Department of Electrical Engineering Page 87


Lab Manual Control Systems

11.4 Procedure
1. Connect, through leads, bush No. 9 of the WATER PUMP DRIVER to bush No. 9
and bush No. 10 to bush No. 10 (Fig. 8-1(b))
2. Connect bush No. 1 of the Pressure Sensor to bush No. 1 of the relevant interface
and bush No. 2 to bush No. 2 (Fig. 8-1(b))
3. Connect the bush of SET POINT 1 to bush No. 4 of the PID controller and bush
No. 3 of the pressure interface to bush No. 3 of the PID controller (Fig. 8-1(b))
4. Insert one terminal of the digital voltmeter, set in dc, in the bush of SET POINT 1
and the other one in the earth bush
5. Regulate the voltage on SET POINT 1 at 2V
6. Move the terminal of the digital voltmeter from the bush of SET POINT 1 to bush
No. 3 of the PID controller: the voltage value must be equal to 0V

7. Move the terminal of the digital voltmeter from bush X1 of the PID controller: the
voltage value must be equal to the difference between the voltage applied to bush
No. 4 and that applied to bush No. 3, which is 2V
8. Regulate the PROPORTIONAL knob at 25%
9. Connect bush No. 5 of the PID controller to bush No. 5 and bush No. 8 to bush
No. 8 of the WATER PUMP DRIVER
10. Regulate the INTEGRAL knob at 25%
11. Press the RESET button to reset the integrator, that is to discharge the circuit
integrating condensers
12. Connect bush No. 6 of the PID controller to bush No. 6 (Fig. 8-1(b))
13. Move the terminal of the digital voltmeter to bush No.3 of the PID controller:
write down in Table 8-1(b) the voltage value
14. Write down in Table 8-
1(b) the voltage value read every 15 seconds until the
transitory is completed
15. Move the terminal of the digital voltmeter to bush X1 of the PID controller: the
voltage value, to be written down, represents the steady state error
16. Regulate the INTEGRAL knob at 50% leaving the PROPORTIONAL knob at
25% and repeat the procedure from step No. 11
17. Repeat the procedure with the INTEGRAL knob at 75% and 100%
18. To reduce the steady state error, regulate the PROPORTIONAL knob to 50%,
75% and 100% if necessary
19. Put OFF the main switch
20. Draw the curves of the closed loop dynamic response for all the values listed in
the table
21. Analyze the results

Department of Electrical Engineering Page 88


Lab Manual Control Systems

11.5 Observations
Table 11-1

11.6 Graph

Figure 11-2

Department of Electrical Engineering Page 89


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

In-Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 90


Lab Manual Control Systems

Experiment No.12 CLOSED LOOP PROPORTIONAL –


DERIVATIVE CONTROL OF THE PRESSURE
12.1 Objectives
 To verify the effects of the gain of the loop on the dynamic response of the system
 To represent the dynamic response curve of the system

12.2 Apparatus
 Digital multimeter
 Chronometer
 Set of leads

12.3 Figure

Figure 12-1

12.4 Procedure
1. Connect, through leads, bush No. 9 of the WATER PUMP DRIVER to bush No. 9
and bush No. 10 to bush No. 10 (Fig. 9-1)
2. Connect bush No. 1 of the Pressure Sensor to bush No. 1 of the relevant interface
and bush No. 2 to bush No. 2 (Fig. 9-1)
3. Connect the bush of SET POINT 1 to bush No. 4 of the PID controller and bush
No. 3 of the pressure interface to bush No. 3 of the PID controller (Fig.9-1)

Department of Electrical Engineering Page 91


Lab Manual Control Systems

4. Insert one terminal of the digital voltmeter, set in dc, in the bush of SET POINT 1
and the other one in the earth bush
5. Regulate the voltage on SET POINT 1 at 2V
6. Move the terminal of the digital voltmeter from the bush of SET POINT 1 to bush
No. 3 of the PID controller: the voltage value must be equal to 0V
7. Move the terminal of the digital voltmeter from bush X1 of the PID controller: the
voltage value must be equal to the difference between the voltage applied to bush
No. 4 and that applied to bush No. 3, which is 2V
8. Regulate the PROPORTIONAL knob at 25%
9. Connect bush No. 5 of the PID controller to bush No. 5 and bush No. 8 to bush
No. 8 of the WATER PUMP DRIVER
10. Regulate the DERIVATIVE knob at 25%
11. Connect bush No. 7 of the PID controller to bush No. 7 (Fig. 9-1)
12. Move the terminal of the digital voltmeter to bush No.3 of the PID controller:
write down in Table 9-1 the voltage value
13. Write down in Table 9-
1 the voltage value read every 15 seconds until the transitory is completed
14. Move the terminal of the digital voltmeter to bush X1 of the PID controller: the
voltage value, to be written down, represents the steady state error
15. Regulate the DERIVATIVE knob at 50% leaving the PROPORTIONAL knob at
25% and repeat the procedure from step No. 11
16. Repeat the procedure with the DERIVATIVE knob at 75% and 100%
17. To reduce the steady state error, regulate the PROPORTIONAL knob to 50%,
75% and 100% if necessary
18. Put OFF the main switch
19. Draw the curves of the closed loop dynamic response for all the values listed in
the table
20. Analyze the results

12.5 Observations
Table 12-1

Department of Electrical Engineering Page 92


Lab Manual Control Systems

12.6 Graph

Figure 12-2

Department of Electrical Engineering Page 93


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

In-Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 94


Lab Manual Control Systems

Experiment No.13 CLOSED LOOP PROPORTIONAL –


INTEGRAL – DERIVATIVE CONTROL OF THE PRESSURE
13.1 Objectives
To understand the operation of a closed loop control system
To represent the dynamic response curve of the system

13.2 Apparatus
 Digital multimeter
 Chronometer
 Set of leads

13.3 Procedure
1. Determine the value of Kp for which oscillations start through the analysis of
the
curves or repeating the experiment with intermediate values of Kp following
the procedure listed in Experiment 8(a):
The value of the position of Kp, for which
oscillations start, must be reduced by 0.6 times.
2. Once determined the value of Kp and analyzed the curves of Ki drawn during ex
periment 8(b), establish the optimum value of Ki repeating, if necessary, the proced
ure listed in the same Experiment for all the intermediate values.
3. Exclude the integral action without modifying the value chosen for Ki.
4. Determine the optimum value of Kd through the analysis of the curves drawn du
ring Experiment
9 or repeating, if necessary, the procedure listed in the same Experiment.
5. Utilize at the same time the proportional, integral and derivative actions and perf
orm the experiments of Experiment 8(a), 8(b) and 9 (Fig. 10-1)
6. Write down in Table 10-
1 the voltage value read every 15 seconds until the transitory is
completed after its conversion in centimeters (1V = 0.2bar).
7. Draw the curves of the closed loop dynamic response (Fig. 13-2)

13.4 Figure

Department of Electrical Engineering Page 95


Lab Manual Control Systems

Figure 13-1

13.5 Observations
Table 13-1

Department of Electrical Engineering Page 96


Lab Manual Control Systems

13.6 Graph

Figure 13-2

Department of Electrical Engineering Page 97


Lab Manual Control Systems

Performance Viva Total/15

(10 Marks) (5 Marks )

Performance /4

Results /3

Critical Analysis /1

In-Lab Tasks /2

Comments

Signature:

Department of Electrical Engineering Page 98

You might also like