Download as pdf or txt
Download as pdf or txt
You are on page 1of 71

SSUET/QR/112

Feedback Control Systems (EL-205) Laboratory Manual

Electrical Engineering Laboratory Manual

FEEDBACK CONTROL SYSTEMS


(EL-205)
4th Semester Electrical Engineering

NAME: _______________________________________________

BATCH: 2018 SECTION: ___________________

SESSION: FALL 2019__________________________

ROLL NO.: ____________________________________________

TEACHER: ____________________________________________

DEPARTMENT OF ELECTRICAL ENGINEERING

SIR SYED UNIVERSITY OF ENGINEERING AND TECHNOLOGY

University Road, Karachi-75300


www.ssuet.edu.pk

_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/113
Feedback Control Systems (EL-205) Laboratory Manual

LAB CONTENTS

LAB # LAB TITLE CLOs # PLOs #

1 Introduction to MATLAB 1 &4 1,2

Implementation of Series, Parallel and Feedback 1 &4


2 2,3,4
command, to solve the block diagram

Perform block diagram reduction &find Transfer Function 1 &4


3 2,5,10
using Append and Connect command

To solve the signal flow graphs and find transfer function


4 by using solve command and verify it through Mason’s 4 4,5
Gain Formula

5 To find the Electrical system’s transfer function 1 &4 2,3

a) To find the Mechanical system’s transfer function


6 b) To find the Electromechanical system’s transfer 1 &4 1,22
function

To convert the transfer function of a system into state 2 &4


7 1,2,3,4
variable representation and vice versa

8 To find out the performance of the 1st order system 4 4,5

9 To find out the performance of the 2nd order system 4 4

To sketch the bode diagrams and Frequency Response of a 4


10 5,10
Control System, find magnitude & phase response

To explore the stability of a control system using pole zero 3


11 2,3,4
map of transfer function by Routh-Hurwitz criteria

12 To sketch the root locus of the given system using MATLAB 4 3,4,5,10

To Study of P, I, D and PID controller on system response 4


13 3,4
(Open Ended)

Analysis of PID controller effects on the system by using 4


14 5,10
IT-4406 Trainer

______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/113
Feedback Control Systems (EL-205) Laboratory Manual

INDEX

LAB # Date LAB TITLE Signature Remarks

1 Introduction to MATLAB

Implementation of Series, Parallel and Feedback


2
command, to solve the block diagram

Perform block diagram reduction &find Transfer


3
Function using Append and Connect command

To solve the signal flow graphs and find transfer function


4 by using solve command and verify it through Mason’s
Gain Formula

5 To find the Electrical system’s transfer function

a) To find the Mechanical system’s transfer


function
6
b) To find the Electromechanical system’s transfer
function

To convert the transfer function of a system into state


7
variable representation and vice versa

8 To find out the performance of the 1st order system

9 To find out the performance of the 2nd order system

To sketch the bode diagrams and Frequency Response of


10
a Control System, find magnitude & phase response

To explore the stability of a control system using pole


11
zero map of transfer function by Routh-Hurwitz criteria

To sketch the root locus of the given system using


12
MATLAB

To Study of P, I, D and PID controller on system


13
response (Open Ended)

Analysis of PID controller effects on the system by using


14
IT-4406 Trainer

______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 2 Laboratory Manual

LABORATORY EXERCISE 1
OBJECTIVE

Introduction to MATLAB

 To Generate scalar, vector, and matrix


 To Find the polynomial from roots and roots of the polynomial
 To Perform multiplication and division of two polynomial
 To Find Poles, zeros and Transfer function

THEORY

1.1. Generation of Scalar, Vector, Matrix And Variables


1.1.1. The Variable
If output variable is not specified, MATLAB uses a default variable ans, to store the results of the
current calculation but if the variable ans is once created it may be overwritten. To avoid this, a
variable name is assigned to the expression. Following are the conditions in writing Variable names:
 It must start with a letter
 May contain only letters, digits, and the underscore “_”
 MATLAB is case sensitive, i.e. one & OnE are different variables.
 MATLAB only recognizes the first 31 characters in a variable name.

1.1.2. Vectors Generation


Following are different types of vector generation:
 Colon notation is used to generate row vectors (with row of the matrix =1), and reference sub-
matrices known as subscripting. An index vector is created by using the colon notation as;
[First: last]
[1:5] Creates the vector >> [1 2 3 4 5]

 A spacing can be introduced between two elements of a vector as;


[First: spacing: last]
[1: 2: 10] Creates the vector >> [1 3 5 7 9]

 The column vector can be generated as ;


[element1; element2;……..; element n] ; Where “n” is the number of elements
[1; 2; 3; 4] Creates the vector 1
2
3
4

_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 3 Laboratory Manual

1.1.3. Defining Matrices


A Matrix array is two-dimensional, having both multiple rows and multiple columns, similar to vector
arrays. It begins with “[“and end with “]”. Spaces or commas are used to separate elements in a row
and semicolon or enter is used to separate column. An example for Matrix generation is given as:

1 2 3
 A= [1 2 3; 4 5 6; 7 8 9]. It generates 3 by 3 matrix as [4 5 6]
7 8 9

1.1.4. Special Functions for Matrices


Following are some MATLAB commands used with Matrix operations:
 Length: Used to find the length of vector or largest array/vector dimension.
 [m,n]=Size(x): Returns the size of matrix X in separate variables m and n.
 Zeros(row, col): Creates Vector or Matrices of all zeros
 Eye(row,col): Generate identity Matrix

1.2. Dealing with Polynomials


Following are some MATLAB commands used to deal with polynomials.
 Defining polynomial vector with the coefficients of given equation as: [Sn + Sn-1 +Sn-2 +……..
S0]
 Example: 2S3- 5S2+3S-7 >> [2 -5 3 -7]
 Conversion of variable to vector of two polynomials and vice versa:
o Poly2sym
o Sym2poly
 For Addition or Subtraction of two polynomials as symbolic equations, convert them in
vector form and then add them. Then again convert the vector answer into Symbolic equation
so the answer that MATLAB returned is now in polynomial symbolic equation form.
 Multiplication and division of two polynomials:
o Multiplication: Conv(p1,p2)
o Division: [Q,R]= deconv(p1,p2)

 Finding the Roots of polynomials and polynomials from roots:


o Roots
o Poly (root1; root2 ;….)
 Evaluating polynomial at each value of X
o POLYVAL (P,X)

1.3. Calculation and plotting of Transfer Function, Poles and Zeros


Following are MATLAB commands used to find and plot Poles and Zeros.

 Transfer function=tf (nem,den): used to generate transfer function of polynomials p1 and p2.
 Zero (Transfer function): Used to find the zeros of given transfer function.
 Poles (Transfer function): Used to find the poles of given transfer function.

_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 4 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)


Task 1(a): Initializes the following Matrices and vectors.
1 2 3 iv. D= Vector of four elements starting
i. A= [9 8 7] with 2 and ends with 11 with spacing
6 7 0 of 3.
ii. B= [2 3 9]
1
iii. C= [3]
8

Task 1(b): Find out length and size of the Matrices given in Task 1.
Task 1(c): Generate the Matrices of zeros and ones of the following matrix sizes.
i. 1×1 iii. 1×4
ii. 3×3 iv. 2 × 14

Task 1(d): Generate Identity Matrices of following size.


i. 2×2 ii. 3×2

Task 2:

a) For the polynomials. U= S3 +3S2 +4, V= S+2. Find the roots of the polynomials.
b) Find the polynomial for the given roots (2, 4).
c) For the given polynomial S4 +3S2 +4 find the value at s=2.

Task 3:

a) By considering the following polynomials U= S4 -3S2 –S+2, V= 4S4-2S3+3S2+11. Perform


their Addition & Subtraction. And also return output in form of polynomial equation
b) By considering the following polynomials U= S3 -3S2+4, V= S+2. Perform their
Multiplication and division. And also return output in form of polynomial equation

Task 4:
a) Find the Transfer function of given polynomials: num= [10 40], den= [1 4 3]
b) Calculate poles and zeros of the following:
𝑺𝟐 +𝟒𝑺+𝟖 𝑺𝟑+𝟒𝑺𝟐 +𝟖𝑺+𝟗
a. H(s)= 𝑺𝟐 +𝟑𝑺+𝟒 ii. H(s)=
𝑺𝟒+𝟑𝑺𝟐+𝟒

Task 5: Plot the following:

a) Square of 10 numbers
b) Z=X2 +2X +3 / X +7
c) Y=log(x)

_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 5 Laboratory Manual

CONCLUSION

______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________

_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 6 Laboratory Manual

LABORATORY EXERCISE 2
OBJECTIVE

Implementation of Series, Parallel and Feedback command to solve the block diagram.

THEORY

2. MATLAB COMMANDS
Following are the MATLAB Commands that we will use to solve the series, parallel and feedback
networks.

2.1. Transfer Function


Syntax: S= TF('S'): specifies the transfer function H(s) = s (Laplace variable). You can then
specify transfer functions directly as rational expressions in S or Z.

2.2. Series: Series Interconnection of The Two LTI Models


Syntax: SYS = SERIES(SYS1, SYS2, OUTPUTS1, INPUTS2)
It connects two LTI models SYS1 and SYS2 in series such that the outputs of SYS1 specified by
OUTPUTS1 are connected to the inputs of SYS2 specified by INPUTS2.

Fig 2.1 Series Interconnection

In Form of Transfer Function: SYS = SYS2 * SYS1

2.3. Parallel: Parallel Interconnection of Two LTI Models


Syntax: SYS = PARALLEL(SYS1, SYS2, IN1, IN2, OUT1, OUT2)

It connects the two LTI models SYS1 and SYS2 in parallel such that the inputs specified by IN1
and IN2 are connected and the outputs specified by OUT1 and OUT2 are summed.

Fig 2.2 Parallel Interconnection

In Form of Transfer Function: SYS = SYS2 + SYS1

2.4. Feedback: Feedback Interconnection of Two LTI Models


Syntax: SYS = FEEDBACK(SYS1, SYS2,+/-)

It computes an LTI model SYS for the closed-loop feedback system. Negative feedback is
assumed and the resulting system SYS maps u to y.
SSUET/QR/114
Feedback Control Systems (EL-205) 7 Laboratory Manual

Fig 2.3Feedback Network

𝑆𝑌𝑆1
In Form of Transfer Function: SYS=
1+𝑆𝑌𝑆1∗ 𝑆𝑌𝑆2

2.5. Solve: Equations And Systems Solver


Syntax: y= solve(eqn1,...,eqnN,var1,...,varN)

It solves the equations equation 1 to n with respect to the variables var1 to varn.

2.6. Pretty: Print Symbolic Expressions


Syntax: pretty(X)

It prints symbolic output of X in a format that resembles typeset mathematics.


SSUET/QR/114
Feedback Control Systems (EL-205) 8 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)


Task 1:
a) Find the value of V1,V2 and V3
o V1+V2-V3=0
o 2V1-V2=2
o 3V1+V2+2V3=0
b) Find the value of A and B using solve command.
o 3-4B-A=0
o 10-B-8=0

Task 2: For the following block diagram

𝐶 𝑔
a) By using Solve command prove that =
𝑅 1+𝑔ℎ
𝟐 𝟑
b) Find the transfer function if 𝑮(𝒔) = 𝒔+𝟏
; 𝑯(𝒔) = 𝒔

Task 3: For the following block diagram, find the transfer function if

𝟏 𝒔+𝟐 𝟏
𝑮𝟏 = ; 𝑮𝟐 = ; 𝑮𝟑 = 𝟓; 𝑯=
𝒔+𝟐 𝒔𝟐 + 𝟑 𝒔

Task 4: For the following block diagram, find the transfer function.
SSUET/QR/114
Feedback Control Systems (EL-205) 7 Laboratory Manual

Task 5: For the following block diagram, find the transfer function. If
𝟑 𝟏 𝟐
𝑮𝟏(𝒔) = ; 𝑮𝟐 = ; 𝑮𝟑 = ; 𝑮𝟒(𝒔) = 𝟑
𝒔+𝟐 𝒔+𝟑 𝒔+𝟏
𝟏
𝑯𝟏(𝒔) = 𝟐; 𝑯𝟐(𝒔) =
𝒔

Task 6: For the following block diagram, find the transfer function. If

𝟏 𝒔+𝟐 𝒔 𝒔
𝑮𝟏(𝒔) = 𝒔+𝟐
; 𝑮𝟐 = 𝒔𝟐+𝟑
; 𝑮𝟑 = 𝟓; 𝑮𝟒(𝒔) = 𝒔+𝟏; 𝑮𝟓(𝒔) = 𝒔𝟐+𝟐𝒔+𝟒

𝟏 𝟏
𝑯𝟏(𝒔) = ; 𝑯𝟐(𝒔) =
𝒔 𝒔𝟐
SSUET/QR/114
Feedback Control Systems (EL-205) 9 Laboratory Manual

CONCLUSION

______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
______________________________________________________________
SSUET/QR/114
Feedback Control Systems (EL-205) 10 Laboratory Manual

LABORATORY EXERCISE 3
OBJECTIVE

Perform block diagram reduction & find Transfer Function using Append and Connect command.

THEORY

3.1. MATLAB COMMANDS


3.1.1. Transfer Function <S= TF('S')>
It specifies the transfer function H(s) = s (Laplace variable). You can then specify transfer functions directly as rational
expressions in S or Z.

3.1.2. Solve <y= solve(eqn1,...,eqnN,var1,...,varN)>


It solves the equations equation 1 to n with respect to the variables var1 to varN.

3.1.3. Append < SYS = APPEND (SYS1, SYS2, SYSN)>


It appends the inputs and outputs of the models sys1,...,sysN indivisually.

3.1.4. Connect <SYSC = CONNECT (SYS, q, INPUTS, OUTPUTS)>


It connect computes an aggregate model for a block diagram interconnection of dynamic systems.

3.2. Finding Transfer Function Using Solve Command

Following is the example code and equations of given block diagram.

Fig 3.1 Example Block Diagram

Following are the equations of nodes:


𝑬𝟏 = 𝑹 − 𝒂 ∗ 𝑯𝟏 − 𝒃 ∗ 𝑯𝟑;
𝒂 = 𝑬𝟏 ∗ 𝑮𝟏;
𝑬𝟐 = 𝒂 ∗ 𝑮𝟐 − 𝒃 ∗ 𝑯𝟐
𝒃 = 𝑬𝟐 ∗ 𝑮𝟑;

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 11 Laboratory Manual

𝑬𝟑 = 𝒃 + 𝒂 ∗ 𝑮𝟒;
𝑪 = 𝑬𝟑

MATLAB CODE:
syms e1e2e3abcrg1g2g3g4h1h2h3
% EQUATIONS FOR RESPECTIVE NODES
w=solve('e1=r-(a*h1)-(b*h3)','a=(e1*g1)','e2=(a*g2)-(b*h2)','b=(e2*g3)','e3=b-(a*g4)','c=e3',e1,e2,e3,a,b,c)
t=w.c/r
pretty(t)

Result:
g1 (g4 - g2 g3 + g3 g4 h2)
- ---------------------------------------------
g1 h1 + g3 h2 + g1 g2 g3 h3 + g1 g3 h1 h2 + 1

3.3. Finding Transfer Function Using Append and Connect


3.3.1. Index-Based Interconnection
In this approach, first combine all system blocks into an aggregate, unconnected model BLKSYS using APPEND. Then
construct a matrix Q where each row specifies one of the connections or summing junctions in terms of the input vector U
and output vector Y of BLKSYS. For example, the row [3 2 0 0] indicates that Y(2) feeds into U(3), while the row [7 2 -
15 6] indicates that Y(2) - Y(15) + Y(6) feeds into U(7).The aggregate model SYS is then obtained by:

SYS = connect(BLKSYS,Q,INPUTS,OUTPUTS), where INPUTS and OUTPUTS are index vectors into U and Y
selecting the block diagram external I/Os. We can construct the closed-loop model T for the block diagram below as
follows:

Fig 3.2Example Block Diagram

Example Code:
s = tf('s')
C=1/(s+2); G=2/(s+3)
BLKSYS = append(C,G);
% U = inputs to C,G. Y = outputs of C,G
% Here Y(1) feeds into U(2) and -Y(2) feeds into U(1)
Q = [1 -2; 2 1]; % External I/Os: r drives U(1) and y is Y(2)
T = connect(BLKSYS,Q,[1],[2])
Result: T= 2
-------------
s^2 + 5 s + 8

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 12 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

Task 1: Find the Transfer Function in terms of G1, G2, G3 and G4 and verify the result manually.

Task 2: Find the Transfer Function in terms of G1, G2, G3, H1 and H2 and verify the result manually.

Task 3: Find the Transfer Function in terms of G1, G2, G3, G4, H1, H2 and H3 and verify the result manually.

𝟐
Task 4: Find the Transfer Function of given block diagram by using append and connect commands if 𝑮(𝒔) = 𝒔+𝟏
;
𝟑
𝑯(𝒔) = 𝒔
and verify the result manually.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 13 Laboratory Manual

Task 5: Find the Transfer Function of given block diagram by using append and connect commands if
𝟑 𝟏 𝟐 𝟏
𝑮𝟏(𝒔) = ; 𝑮𝟐 = ; 𝑮𝟑 = ; 𝑮𝟒(𝒔) = 𝟑; 𝑯𝟏(𝒔) = 𝟐; 𝑯𝟐(𝒔) =
𝒔+𝟐 𝒔+𝟑 𝒔+𝟏 𝒔
And also verify the result manually.

Task 6: Find the Transfer Function of given block diagrams ‘a’ and ‘b’ by using append and connect commands if
𝟑 𝟏 𝟏
𝑪𝒐𝒏𝒕𝒓𝒐𝒍 𝑫𝒆𝒗𝒊𝒄𝒆: 𝑮𝟏(𝒔) = ; 𝑨𝒄𝒕𝒖𝒂𝒕𝒐𝒓: 𝑮𝟐 = ; 𝑷𝒓𝒐𝒄𝒆𝒔𝒔: 𝑮𝟑 = ; 𝑺𝒆𝒏𝒔𝒐𝒓: 𝑯𝟏(𝒔) = 𝟐;
𝒔+𝟐 𝒔+𝟑 𝒔+𝟏
And also verify the result manually.

(a)

(b)

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 14 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 15 Laboratory Manual

LABORATORY EXERCISE 4
OBJECTIVE

To solve the signal flow graphs and find transfer function by using solve command and verify it through Mason’s Gain
Formula

THEORY

7.1. Signal Flow Graphs

For a complex system, the block diagram reduction technique is cumbersome. An alternative method for determining the
relationship between system variables has been developed by Mason and is based on the signal flow graph.
A signal flow graph is a diagram that consists of nodes that are connected by branches. A node is assigned to each variable
of interest in the system and branches are used to relate the different variables.
The main advantage of using signal flow graph is that a straight forward procedure is available for finding the transfer
function in which it is not necessary to move pick off point around or to redraw the system several times as with block
diagram manipulations.

7.2. Masons Gain Formula


𝑃
𝑀𝑘 ∆𝑘
𝑇=∑

𝑘=1

Where,
P = Number of paths from input to output
Mk = Gain of the kth path from input to output
Δ = Determinent of the graph
Δk = Cofactor of the kth path

7.3. MATLAB Commands

Syms Define symbolic variables

Solve <y= solve(eqn1,...,eqnN,var1,...,varN)>


It solves the equations equation 1 to n with respect to the variables var1 to varN.

Finally evaluate answer with respect to transfer function.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 16 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

Task 1: Find the value of ‘a’ and ‘b’:


a) Using Solve command
b) Using Simulink
c) Verify the result through Mathematical proof

Task 2: Find the Transfer Function in terms of G1, G2, G3, G4, G5, G6, H1 and H2 by using solve command and verify
the result through Mathematical proof by using Mason Gain Formula.

Task 3: Find the Transfer Function in terms of G1, G2, G3, G4, H1, H2 and H3 by using solve command and verify the
result through Mathematical proof by using Mason Gain Formula.

Task 4: Find the Transfer Function in terms of G1, G2, G3 and G4 by using solve command and verify the result through
Mathematical proof by using Mason Gain Formula.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 17 Laboratory Manual

Task 5: Find the Transfer Function in terms of G1, G2, G3, G4, H2, and H3 by using solve command and verify the result
through Mathematical proof by using Mason Gain Formula.

Task 6: Find the Transfer Function in terms of G1, G2, and G3 by using solve command and verify the result through
Mathematical proof by using Mason Gain Formula.

Task 7: Find the Transfer Function in terms of G1 and G2 by using solve command and verify the result through
Mathematical proof by using Mason Gain Formula.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 18 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 19 Laboratory Manual

LABORATORY EXERCISE 5
OBJECTIVE

To find the Electrical system’s transfer function.

THEORY

In this lab we will learn how to model electrical systems in terms of transfer functions.

5.1. Electric Network Transfer Functions

For modeling of transfer functions of electric systems the guiding principles to develop the transfer functions are
Kirchhoff’s laws; voltages are summed around loops or current at nodes and equate the result to zero. Table below
summarizes the relationships between voltage and current, and between voltage and charge, for the three passive linear
components: resistors, capacitors, and inductors, provided that initial conditions are zero.

5.2. MATLAB Commands

Syms
Define Symbolic Variables

Solve <y= solve(eqn1,...,eqnN,var1,...,varN)>


It solves the equations equation 1 to n with respect to the variables var1 to varN.

pretty(X)
It prints symbolic output of X in a format that resembles typeset mathematics.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 20 Laboratory Manual

5.3. Example: For the given circuit, find the voltage Transfer Function Vc/V.

Solution
By applying the Kirchhoff’s law:
𝑉𝑖𝑛 = 𝑉𝑅 + 𝑉𝐶 … … … . . (i)

𝑉𝑅 = 𝐼(𝑆) 𝑅 … … … . . (ii)

1
𝑉𝐶 = 𝐶𝑆
𝐼(𝑆) … … … . . (iii) Fig 5.1 Electrical System

1 1 𝑉𝑖𝑛
𝑉𝑖𝑛 = 𝐼(𝑆) 𝑅 + 𝐼(𝑆) =≫ 𝑉𝑖𝑛 = 𝐼(𝑆) [𝑅 + ] =>>𝐼(𝑆) = 1
𝐶𝑆 𝐶𝑆 [𝑅+ ]
𝐶𝑆

1 1
1 𝑉𝑖𝑛 𝑉𝐶 𝐶𝑆 𝑉𝐶 𝐶𝑆
𝑉𝐶 = =≫ = =≫ = 1
𝐶𝑆 [𝑅 + 1 ] 𝑉𝑖𝑛 [𝑅 + ]
1 𝑉𝑖𝑛 [𝑅𝐶𝑆 + 1]
𝐶𝑆 𝐶𝑆 𝐶𝑆

𝑉𝐶 1
=
𝑉𝑖𝑛 [𝑅𝐶𝑆 + 1]

MATLAB Code

clear all
close all
clc
syms VinVrVcIsCRS
w=solve('Vin=Vr+Vc','Vr= Is*R ',' Vc= Is/(C*S)',Vr,Is,Vc)
t=w.Vc/Vin
pretty(t)

Result:
1
---------
C R S + 1

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 21 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)


𝑉
Task 1: Find the voltage Transfer Function 𝑉2 of given circuit and verify the result manually.
1

𝑉
Task 2: Find the voltage Transfer Function 𝑉2 of given circuit and verify the result manually.
1

𝑉
Task 3: Find the voltage Transfer Function 𝑉2 of given circuit and verify the result manually.
1

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 22 Laboratory Manual

𝑉
Task 4: Find the voltage Transfer Function 𝑉0 of given circuit and verify the result manually.
1

𝑉
Task 5: Find the voltage Transfer Function 𝑉2 of given circuit and verify the result manually.
1

𝑉
Task 6: Find the voltage Transfer Function 𝑉2 of given circuit and verify the result manually.
1

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 23 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 24 Laboratory Manual

LABORATORY EXERCISE 6 (a)


OBJECTIVE

To find the Mechanical system’s transfer function.

THEORY

In this lab we will learn how to model mechanical systems in terms of transfer functions.

6.1. Mechanical System

A mechanical system manages power to accomplish a task that involves forces and movement. Following are the basic
types of Mechanical system:

 Translational Mechanical System (Linear Motion)


 Rotational Mechanical System (Rotational Motion)

6.2. Translational Mechanical System

It is comprised of group of mechanical elements that only translate. (Motion is taking place along a straight line).Basic
Elements of translational Mechanical System are:
 Mass
 Friction
 Spring

6.2.1. Translational Mass

Mass is the property of physical system or body, observable and measurable as a resistance to being accelerated by a force.
A mechanical system without mass does not exist. If a force f (t) is applied to a mass ant it is displaced to x (t) meters then
the relation between force and displacement is given by Newton’s law:

𝒅𝟐 𝒙(𝒕)
f (t)=ma(t) => f(t)= m
𝒅𝒕𝟐

By taking Laplace Transform of above equation:

F(S) = MS2X(S)

It is assumed that the mass is rigid. It can store energy but cannot dissipate.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 25 Laboratory Manual

6.2.2. Translational Damper/Friction

Whenever there is a motion, there exists a friction. Friction may be between moving element and fixed support or between
two moving surfaces. Friction is also non-linear in nature. A physical device that is modeled as friction is a shock absorber
on an automobile. The mathematical model of friction is given by:

𝒅𝒙(𝒕)
F(t) = Bv(t) => f(t) = B
𝒅𝒕

By taking Laplace Transform of above equation:

F(S) = BX(S)

Where B is the damping coefficient. Friction is always against the direction of motion. As some
energy is lost due to friction so it is known as dissipative element.

6.2.3. Translational Spring

A mechanical element that can be deformed (shortened or lengthened) by an external force such that the deformation is
directly proportional to the force applied to it. Spring can store energy but cannot dissipate. According to Hook’s Law:

f(t)= Kx(t)

By taking Laplace Transform of above equation:

F(S)=KX(S)

6.2.4. Developing Mathematical Model for Translational Mechanical System

The equations for an interconnection of these mechanical elements using Newton’s law, which may be stated as follows:

“The sum of the forces on a body is equal to the mass of the body times its acceleration”.

𝒑 𝒒
MS2X(S) = F(S) - ∑𝑩=𝟏 𝑩𝑺𝑿(𝑺) - ∑𝑲=𝟏 𝑲𝑿(𝑺)

Where,
F(S) = Applied Force
M = Mass M in the system
p= Number of Dampers attached to mass M
q= Number of springs attached to mass M

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 26 Laboratory Manual

6.3. Rotational Mechanical System

It is comprised of group of mechanical elements that can rotate. (Motion is taking place in rotatory manner). Basic Elements
of Rotational Mechanical System are:
 Moment of Inertia
 Rotational Friction
 Rotational Spring

The quantities used in rotating systems are very similar to those in translating systems. The table below lists the analogous
quantities for rotating and translating systems.

Translating System Rotating System


Quantity Symbol Symbol Unit
Mass M Moment of Inertia J
Force F Torque 𝜏
Displacement X Angular Speed 𝜃
Spring Constant K Spring Constant K
Friction Coefficient B Friction Coefficient B

6.3.1. Inertia Elements/ Rotational Mass

In rotating mechanical systems, the inertia elements are masses that rotate and are characterized by moment of inertia.
Applying Newton’s Second Law to differential mass dm and integrating over the entire body, the time rate of change of the
angular momentum is equal to the summation of the applied torques.

𝑑 𝑑2 𝜃
(𝐽𝑤(𝑡)) = ∑ 𝜏(𝑡) => 𝜏(𝑡) = 𝐽 𝑑𝑡 2
𝑑𝑡

By taking Laplace Transform of above equation:


𝜏(𝑆) = 𝐽𝑆 2 𝜃(𝑆)
Where,
J=Moment of inertia And θ = Angular Speed

6.3.2. Rotational Spring

A rotational spring is an element that is deformed (wound or unwound) in direct proportion to the amount of torque applied.
Ideal springs have no inertia. The relationship between torque, spring constant and angle is given by:

𝜏(𝑡) = 𝐾 [𝜃1 (𝑡)- 𝜃2 (𝑡)]

By taking Laplace Transform of above equation:

𝜏(𝑆) = 𝐾 [𝜃1 (𝑆)-𝜃2 (𝑆)]


Where

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 27 Laboratory Manual

K=Spring Constant
A shaft connected between two elements can also act as a rotational spring.

6.3.3. Rotational Friction

As with the translating systems, friction is the most difficult of the three elements to model accurately and we will generally
only consider viscous friction. The constitutive equation relating angular velocity, torque and friction coefficient is:
𝑑𝜃1 (𝑡) 𝑑𝜃2 (𝑡)
𝜏(𝑡) = 𝐵 [ - ]
𝑑𝑡 𝑑𝑡

By taking Laplace Transform of above equation:

𝜏(𝑆) = 𝐵𝑆 [𝜃1 (𝑆)- 𝜃2 (𝑆)]


Where
B=Damping Coefficient.
A rotation friction element often consists of an object moving in a fluid.

6.3.4. Developing Mathematical Model for Rotational Mechanical System

For Rotating Mechanical System:

JS2θ(S) = τ(S) - ∑𝑵 𝑴
𝑩=𝟏 𝑩𝑺(𝜟𝛉(𝑺)) - ∑𝑲=𝟏 𝑲(𝜟𝛉(𝑺))

Where,
τ (S) = Applied Torque
J= Moment of Inertia J in system
p= Number of Dampers attached to Moment of Inertia J
q= Number of springs attached to Moment of Inertia J

6.4. MATLAB COMMANDS

 Syms: Define Symbolic Variables


 Solve <y= solve(eqn1,...,eqnN,var1,...,varN)>It solves the equations equation 1 to n with respect to the variables
var1 to varN.
 pretty(X): It prints symbolic output of X in a format that resembles typeset mathematics.

6.5. Example

Following are the example of modelling mechanical systems.

6.5.1. Model for Translational Mechanical System

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 28 Laboratory Manual

Number of equations is proportional to the masses present in the system. We can find the system equations from the given
formula:
𝒑 𝒒
MS2X(S) = F(S) - ∑𝑩=𝟏 𝑩𝑺𝑿(𝑺) - ∑𝑲=𝟏 𝑲𝑿(𝑺)

System Equations:
For Mass1: M1S2X1 = F-B1S(X1-X2) Fig 6.1 Translational Mechanical
System
For Mass2: M2S2X2 = 0-B1S(X2-X1)-B2SX2-KX2

MATLAB Code
syms M1M2B1B2KFX1X2S
[X1,X2]=solve(' M1*(S^2)*X1 = F-B1*S*(X1-X2)' , ' M2*(S^2)*X2 = 0-B1*S*(X2-X1)-B2*S*X2-K*X2 ' , X1 , X2);
t1=X1/F;t2=X2/F;
pretty(t1)
pretty(t2)

Result
2
K + M2 S + B1 S + B2 S
X1/F= -------------------------------------------------------------------------------------------------
2 2 2 3
S (B1 K + B1 B2 S + K M1 S + B1 M1 S + B1 M2 S + B2 M1 S + M1 M2 S)

B1
X2/F= -------------------------------------------------------------------------------------------
2 2 2 3
B1 K + B1 B2 S + K M1 S + B1 M1 S + B1 M2 S + B2 M1 S + M1 M2 S
>>

6.5.2. Model for Rotational Mechanical System

Number of equations are proportional to the Moment of Inertia


present in the system. We can find the system equations from
the given formula:

JS2θ(S) = τ(S) - ∑𝑵
𝑩=𝟏 𝑩𝑺(𝜟𝛉(𝑺)) - ∑𝑴
𝑲=𝟏 𝑲(𝜟𝛉(𝑺))
Fig 6.2 Rotational Mechanical System
System Equations:
For Moment of Inertia1: J1S2θ1 = τ-BS (θ1-θ2)
For Moment of Inertia2: J2S2θ2 = 0-BS (θ2-θ1)-Kθ2

MATLAB Code
syms j1j2bkq1q2ts
[q1,q2]=solve( ' j1*s*s*q1=t-b*s*(q1-q2)','j2*s*s*q2=-b*s*(q2-q1)-k*q2',q1,q2);
t1=q1/t;t2=q2/t;
pretty(t1)
pretty(t2)

Result
2

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 29 Laboratory Manual

j2 s + b s + k
θ1/τ= ---------------------------------------------------
3 2 2
s (b k + j1 j2 s + j1 k s + b j1 s + b j2 s )

b
θ2/τ= ---------------------------------------------
3 2 2
b k + j1 j2 s + j1 k s + b j1 s + b j2 s
>>

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 30 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

Task 1: Find the Transfer Function of given Mechanical system.

Task 2: Find the Transfer Function of given Mechanical system.

Task 3: Find the Transfer Function of given Mechanical system.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 31 Laboratory Manual

Task 4: Find the Transfer Function of given Mechanical system.

Task 5: Find the Transfer Function of given Mechanical system.

Task6: Find the Transfer Function of given Mechanical system.

Task 7: Find the Transfer Function of given Mechanical system

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 32 Laboratory Manual

LABORATORY EXERCISE 6 (b)


OBJECTIVE

To find the Electromechanical system’s transfer function.

THEORY

In this lab we will learn how to model two electromechanical (DC generator and Servomotor) systems in terms of transfer
functions.

6.6. DC Generator

It is assumed that the dc generator is driven by an energy source called prime mover, which is of sufficient capacity such
that the electrical load on the generator does not affect the generator speed. It is also assumed that the generator rotates at a
constant speed. A circuit diagram of the generator is given in figure 1.

In this system,
Ra = Resistance of armature
La= Inductance of armature windings in H
Ia = Armature current in A
if = Field current in A
eg = Generated Armature voltage
ef = Applied field voltage
Rf = Resistance of fieldcircuit
Lf= Inductance of field windings in H
Zl= generator’s load Impedance

The equation for the field circuit is


𝑑𝑖𝑓
𝑒𝑓 = 𝑅𝑓 𝑖𝑓 + 𝐿𝑓
𝑑𝑡

Where the functional dependence of the variables on time is omitted for convenience. The equation for the Armature circuit
is:

𝑑𝑖𝑎
𝑒𝑔 = 𝑅𝑎 𝑖𝑎 + 𝐿𝑎 + 𝑒𝑎
𝑑𝑡

The equation that relates the generated voltage 𝑒𝑔 to the field flux ∅ is:

𝑒𝑔 = 𝐾𝑔 𝑖𝑓

The equation for the final output can be written as:

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 33 Laboratory Manual

𝑒𝑎 = 𝑖𝑎 𝑍𝑙

6.7. Servomotor

A servomotor is a dc motor designed specifically to be used in a control system. The circuit diagram of a servomotor is
given in figure.

In this system,
Rm = Resistance of armature in W
Lm= Inductance of armature windings in H
Ia = Armature current in A
ea = Applied armature voltage in V
em = back emf in V
Tm = Torque developed by the motor in Nm
J = Equivalent moment of inertia of motor
B= Equivalent viscous friction coefficient of inertia of motor
θ = Angular speed of Motor

Following are the system equation of servomotor:

The em(t) is the voltage generated in the armature coil because of the motion of the coil in the motor’s magnetic field and is
given as:
𝑑𝜃
𝑒𝑚 = 𝐾𝑚
𝑑𝑡

For Armature circuit we can write:

𝑑𝑖𝑎
𝑒𝑎 = 𝑅𝑚 𝑖𝑎 + 𝐿𝑚 + 𝑒𝑚
𝑑𝑡

The equation for the developed torque is:

𝜏(𝑡) = 𝐾𝜏 𝑖𝑎

The final equation is derived from summing torques on the motor Armature.

𝑑2 𝜃 𝑑𝜃
𝐽 2 = 𝜏(𝑡) − 𝐵
𝑑𝑡 𝑑𝑡

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 34 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

Task 1: Find the Transfer Function of DC Generator.

Task 2: Find the Transfer Function of Servomotor.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 35 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 36 Laboratory Manual

LABORATORY EXERCISE 7
OBJECTIVE

To convert the transfer function of a system into state variable representation and vice versa

THEORY

In control engineering, a state-space representation is a mathematical model of a physical system as a set of input, output
and state variables related by first-order differential equations. The state of the system can be represented as a vector within
that space. To abstract from the number of inputs, outputs and states, these variables are expressed as vectors. Additionally,
if the dynamical system is linear, time-invariant, and finite-dimensional, then the differential and algebraic equations may
be written in matrix form.

The most general state-space representation of a linear system with p inputs, q outputs and n state variables is written in the
following form:
𝒙̇ (𝒕) = 𝑨𝒙(𝒕) + 𝑩𝒖(𝒕)

𝒚(𝒕) = 𝑪𝒙(𝒕) + 𝑫𝒖(𝒕)

X(t)= state vector (𝑛 × 1)


A= System Matrix (𝑛 × 𝑛)
B= Input Matrix (𝑛 × 𝑟)
U(t)= Input Vector (𝑟 × 1)
Y(t)= Input Vector (𝑝 × 1)
C= Output Matrix (𝑝 × 𝑛)
D= Direct coupling Matrix between input and output (𝑝 × 𝑟)

7.1. Stability Of Continuous-Time LTI System

Stability and natural response characteristics of a continuous-time LTI system (i.e., linear with matrices that are constant
with respect to time) can be studied from the eigenvalues of the matrix A.

𝜆(𝑆) = |𝑆𝐼 − 𝐴|

The roots of this polynomial (the eigenvalues) are the system transfer function's poles (i.e., the singularities where the
transfer function's magnitude is unbounded). These poles can be used to analyze whether the system is asymptotically stable
or marginally stable.

7.2. Canonical Realizations

Any given transfer function which is strictly proper can easily be transferred into state-space by the following approach (this
example is for a 4-dimensional, single-input, single-output system):

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 37 Laboratory Manual

Given a transfer function, expand it to reveal all coefficients in both the numerator and denominator. This should result in
the following form:

𝑛1 𝑆 3 + 𝑛2 𝑆 2 + 𝑛3 𝑆 + 𝑛4
𝐺 (𝑠) =
𝑆 4 + 𝑑1 𝑆 3 + 𝑑2 𝑆 2 + 𝑑3 𝑆 + 𝑑4

The coefficients can now be inserted directly into the state-space model by the following approach:

This state-space realization is called controllable canonical form because the resulting model is guaranteed to be
controllable (i.e., because the control enters a chain of integrators, it has the ability to move every state).

7.3. MATLAB Commands

 [A,B,C,D]= tf2ss(n,d)
It converts transfer function whose numerator(n) and denominator(d) vectors are already defined into state space
domain.
 [n,d]= ss2tf(A,B,C,D)
It converts state space domain whose state variables are already defined into state space domain.
 sys= tf(n,d)
It generates transfer function of defined numerator (n) and denominator (d) vectors
 eye(n)
It generates identical matrix of size n
 eig(A)
It calculates Eigen values of matrix of size A

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 38 Laboratory Manual

LAB EXERCISES: (Comments required on each Task)

Task 1:
1
a. Convert the given transfer Function into state space variables 𝐺 (𝑆) = 𝑆 2 +3𝑆+2
b. Find the Eigen values of the system in part a.
c. Verify MATLAB results mathematically.

Task 2:
10𝑆+5
a. Convert the given transfer Function into state space variables 𝐺 (𝑆) = 𝑆 3 +6𝑆 2 +6𝑆+7
b. Find the Eigen values of the system in part a.
c. Verify MATLAB results mathematically.

Task 3:
𝑆 2 +10𝑆+5
a. Convert the given transfer Function into state space variables 𝐺 (𝑆) = 𝑆 2 +5𝑆+6
b. Find the Eigen values of the system in part a.
c. Verify MATLAB results mathematically.

Task 4:
a. Find transfer Function from given state space variables by direct command in MATLAB.
−5 −6 1
𝐴=[ ] 𝐵=[ ] 𝐶 = [5 − 1] 𝐷 = [1]
1 0 0

b. Verify the result by MATLAB through generalized form G(S) =C* (SI-A)-1*B+D.

Task 5:
a. Find transfer Function from given state space variables by direct command in MATLAB.

1 3 1
𝐴=[ ] 𝐵=[ ] 𝐶 = [1 1] 𝐷 = [0]
2 4 0

b. Verify the result by MATLAB through generalized form G(S) =C* (SI-A)-1*B+D.

Task 6:
a. Find transfer Function from given state space variables by direct command in MATLAB.

0 2 1
𝐴=[ ] 𝐵=[ ] 𝐶 = [1 0] 𝐷 = [0]
−2 −5 0

b. Verify the result by MATLAB through generalized form G(S) =C* (SI-A)-1*B+D.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 39 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 40 Laboratory Manual

LABORATORY EXERCISE 8
OBJECTIVE

To find out the performance of the 1st order system

THEORY

8.1. Introduction

This analysis of control system can only be applied when nature of input plus mathematical model of the control system is
known. It is not easy to express the actual input signals by simple equations as the input signals of the control systems are
not fully known. There are two components of any system’s time response, transient response and steady response.

Typical and standard test signals are used to judge the behavior of typical test signals. The characteristics of an input signal
are constant acceleration, constant velocity, a sudden change or a sudden shock. In this lab we will be practicing first order
systems.

8.2. First Order System

The system whose input-output equation is a first order differential equation is called first order system. The order of the
differential equation is the highest degree of derivative present in an equation. First order system contains only one energy
storing element. Most of the practical models are first order systems.

8.3. Step Response of a First Order System

One of the most common test inputs used is the unit step function. The step models are of many types of inputs: a switch
turning on a voltage at t=0; a step change in road surface (e.g., a curb); a sudden change in temperature.
𝐾
The Sandard form of the Transfer Function of First order systems is given as 𝑮(𝒔) =
𝜏𝑆+1
Where, 𝜏 = Time Constant

8.4. MATLAB Commands

 sys= tf(n,d): It generates transfer function of defined numerator (n) and denominator (d) vectors
 Transfer Function: < S= TF ('S')> Specifies the transfer function H(s) = s (Laplace variable).
 Step (sys): computes the step response Y of the dynamic system SYS.
 Hold on: Retains the current graph and adds another graph to it.
 Impulse (sys): computes the impulse response Y of the dynamic system SYS.
 Simulink Blocks : Sources(step), Sinks(scope), Continuous(Transfer fcn), Commonly used(Gain, Sum)

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 41 Laboratory Manual

Example for first order system Response

𝟐
Find the step & impulse response of 1st order system. G(s) =
𝑺+𝟓

MATLAB Code

close all;
clear all;
clc;
s=tf('s')
sys=(2)/(s+5)
subplot(121)
step(sys)
grid on
subplot(122)
impulse(sys)
grid on

Simulink Block diagram

RESULT

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 42 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

𝟐.𝟓
Task 1: Find the impulse and step response of 1st order system. G(s) =
𝟎.𝟓𝑺+𝟏
a) By using MatLab
b) By using Simulink

𝟏𝟎
Task 2: Find the impulse and step response of 1st order system. G(s) =
𝑺+𝟒

a) By using MatLab
b) By using Simulink

𝟐.𝟓
Task 3: Find the impulse and step response of 1st order system. G(s) = at T=0, 0.2, 0.4, 0.6, 0.8, 1 seconds by using
𝑻𝑺+𝟏
for loop. Explain the variation of T on step response and stability of the system.

𝑲
Task 4: Find the impulse and step response of 1st order system. G(s) = at K=0.5, 1, 1.5, 2 and by using for loop.
𝟎.𝟓𝑺+𝟏
Explain the variation of K on step response and of the system.

Task 5: Find the impulse and step response of 1st order following system.

a) By using MatLab
b) By using Simulink.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 43 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 44 Laboratory Manual

LABORATORY EXERCISE 9
OBJECTIVE

To find out the performance of the 2ndorder system

THEORY

9.1. Introduction

The Laplace Transform is used to investigate the response of the first and second order systems. The response of higher
order systems can be finding by summing the responses of first and second order systems, therefore much emphasis is on
placed on understanding the responses of these low order systems.

In the previous lab, all the systems had only one energy storage element, and thus could be modeled by a first-order
differential equation. In the case of the mechanical systems, energy was stored in a spring or inertia. In the case of electrical
systems, energy can be stored either in a capacitance or an inductance. In this lab, we address models with two energy
storage elements. The simple step of adding an additional energy storage element allows much greater variation in the types
of responses we will encounter. The largest difference is that systems can now exhibit oscillations in time in their natural
response.

9.2. Second Order System

Second order systems are important for a number of reasons. They are the simplest systems that exhibit oscillations and
overshoot. Second order behavior is part of the behavior of higher order systems and understanding second order systems
helps us to understand higher order systems. Second order systems can be defined as the system whose input-output
equation is a second order differential equation. The order of the differential equation is the highest degree of derivative
present in an equation.

9.3. Step Response of a Second Order System

One of the most common test inputs used is the unit step function. The transfer function for a second-order system can be
written in one of the two general forms (depending on whether the system has a zero or not). The standard form of the order
system transfer function is given by:
𝜔𝑛 2
𝐺 (𝑠) =
𝑠 2 + 2𝜁𝜔𝑛 + 𝜔𝑛 2
Where,
𝜁 =Damping ratio
𝜔𝑛 = Natural or undamped frequency or the frequency of oscillations when the damping is zero.
The standard equation can be broken into different types of response depending on whether the poles of the system are real
and unequal, real and equal, complex, or purely imaginary. There are four types of motion that are possible in this case.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 45 Laboratory Manual

 If the poles are real and unequal, the response is over-damped with no overshoot. If the poles are widely separated,
the response may be dominated by the smaller (slower) pole.
 If the poles are real and equal, the response is critically damped with no overshoot.
 If the poles are complex the system is under-damped with an overshoot.
 If the poles are purely imaginary, then the system has no damping and the response will be oscillatory with no
reduction in amplitude (harmonic).

𝝎𝒏 𝟐
By comparing the given transfer function with standard form G(s) = and Substitute the vales in following
𝒔𝟐 +𝟐𝜻𝝎𝒏 𝑺+𝝎𝒏 𝟐
formulae we can get the following system parameters.

i. Step response:

1 𝛽
𝑐 (𝑡) = 1 − 𝑒 −𝜉𝜔𝑛 𝑡 sin(𝛽𝜔𝑛 𝑡 + 𝜃) ; 𝛽 = √1 − ζ2 ; 𝜃 = tan−1 ( )
𝛽 𝜔𝑛

ζπ

√1−ζ2
ii. Maximum Peak Amplitude: 𝑀𝑝𝑡 = 1 + e

iii. Steady State Value: 𝐶𝑠𝑠 = lim 𝑆𝐺 (𝑆)𝑅(𝑆) R(S)= 1/S (In case of unit step)
𝑠→0

𝑀𝑝𝑡−𝐶𝑠𝑠
iv. Over Shoot %: 𝑂𝑆% = 𝐶𝑠𝑠
𝜋
v. Peak Time: 𝑇𝑝 =
𝜔𝑛 √1−ζ2
4
vi. Settling Time: 𝑇𝑠 = 𝜁𝜔
𝑛

9.4. MATLAB Commands

 Transfer Function: < S= TF ('S')> Specifies the transfer function H(s) = s (Laplace variable).
 Step (Sys): computes the step response Y of the dynamic system SYS.
 Stepinfo(sys):It gives Rise time, settling time, and other step response characteristics
 Hold on: Retains the current graph and adds another graph to it.
 Impulse (sys): Computes the impulse response Y of the dynamic system SYS.
 Series: SYS = SERIES(SYS1, SYS2, OUTPUTS1, INPUTS2). It connects two LTI models SYS1 and SYS2 in
series such that the outputs of SYS1 specified by OUTPUTS1 are connected to the inputs of SYS2 specified by
INPUTS2.
 Feedback: SYS = FEEDBACK(SYS1, SYS2,+/-). It computes an LTI model SYS for the closed-loop feedback
system. Negative feedback is assumed and the resulting system SYS maps u to y.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 46 Laboratory Manual

 Ltiview(sys): ltiview opens an empty LTI Viewer. The LTI Viewer is an interactive graphical user interface (GUI)
for analyzing the time and frequency responses of linear systems and comparing such systems.
 Simulink Blocks : Sources(step, ramp,), Sinks(scope), Continuous(Transfer fcn), Commonly used(Constant, Gain,
Sum)

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 47 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)


𝝎𝒏 𝟐
Task 1: For the given 2nd order system G(s) = . Plot response at different intervals of zeta, where 𝜁 =
𝒔𝟐 +𝟐𝜻𝝎𝒏 𝑺+𝝎𝒏 𝟐
0, 0.2, 0.5, 1, 2and 𝜔𝑛 = 1. Plot all the results in the same figure window. And explain the responses at all different values
of zeta.

Task 2: For the given 2nd order system, Find the step response of the system for values 𝜔𝑛=1 and 𝜁 = 0.1, 0.4, 0.7, 1.0 and
2.0. Plot all the results in the same figure window. And explain the responses at all different values of zeta.

Task 3: For the given 2nd order system, find the step response of the system for all the values of k=10, 20, 50 and100.

Task 4: For the position control servo mechanism, find the step response, maximum peak amplitude, steady state value,
overshoot %, Peak Time (Tp) and settling time (Ts) by Ltiview. (Also Attach Mathematical proof)

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 48 Laboratory Manual

Task 5: For the given 2nd order system, find out the time domain specification. (Also attach Mathematical proof)

Task 6: Obtain the system response by using Simulink and time domain specification for the step input. (Also attach
Mathematical proof)

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 49 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 50 Laboratory Manual

LABORATORY EXERCISE 10
OBJECTIVE

To sketch the bode diagrams Frequency Response with the magnitude & phase response of Control System.

THEORY

10.1. Frequency Response and Bode Diagrams

Frequency response methods are among the most useful techniques available for system analysis and design. Bode diagram
is a method for plotting a frequency response. This method results in a plot of magnitude versus frequency and phase versus
frequency, but the frequency scale is logarithmic.

The main advantage of the Bode plot over other types of plots for frequency response is that the effect of adding a real pole
or a real zero to a transfer function can be seen rather easily. For this reason, Bode diagrams are very useful in designing
control system. We are interested in the frequency response of an LTI system. The transfer function can be written like this:

(𝑠 − 𝑍1 )(𝑠 − 𝑍2 ) … . .
𝐻(𝑠) = 𝐾
(𝑠 − 𝑝1 )(𝑠 − 𝑝2 )(𝑠 − 𝑝3 ) … …

Such that when we plug in jw for s, we get

(𝑗𝜔 − 𝑍1 )(𝑗𝜔 − 𝑍2 ) … . .
𝐻 (𝑗𝜔) = 𝐾
(𝑗𝜔 − 𝑝1 )(𝑗𝜔 − 𝑝2 )(𝑗𝜔 − 𝑝3 ) … …

Where the z’s are called zeros and the p’s are called poles.

By using bode plot, on a log scale (e.g., dB), the product turns into a sum. Thus, if we plot the behavior of each term, we can
then simply add the plots to find the total behavior. For the poles, we could either plot the behavior of (s - p) and subtract it,
or plot the behavior of 1/(s - p) and add that behavior. We’ll plot the behavior of 1/(s - p), such that we only need to add
terms. In constructing frequency responses; we consider the following types of transfer function factors:
 Constant gain
 Poles and Zeros at origin
 Real Poles and Zeros not at origin
 Complex Poles and Zeros

10.2. MATLAB Commands

 sys= tf(n,d): It generates transfer function of defined numerator (n) and denominator (d) vectors
 bode(sys): It draws the Bode plot of the dynamic system SYS. The frequency range and number of points are
chosen automatically.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 51 Laboratory Manual

LAB EXERCISES :( Comments required on each Task)

Task 1:

𝟐𝟎
Sketch the bode plot for given system: G(s) =
𝑺𝟐 +𝟒𝑺

Task 2:

𝑺+𝟐
Sketch the bode plot for given system: G(s) =
𝑺𝟐 +𝟐𝑺+𝟑

Task 3:

𝑺
Plot the magnitude and phase response for given system: G(s) =
𝑺𝟑 +𝟑𝑺𝟐 +𝟐

Task 4:

𝑺+𝟏
Plot the magnitude and phase response for given system: G(s) =
𝑺𝟑 +𝟒𝟎𝑺𝟐 +𝟒𝟎𝟎𝑺

Task 5:

Find out the minimum stability margin of the given system by using Bode plot.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 52 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 53 Laboratory Manual

LABORATORY EXERCISE 11
OBJECTIVE

To explore the stability of a control system using pole zero map of transfer function by Routh-Hurwitz criteria

THEORY

11.1. Stability of Control System


In all cases we require hat a control system respond in some controlled manner to applied inputs and initials conditions. This
characteristic of the control system is known as Stability. For an unstable system there is little apparent relation between the
system input and the system output. The requirements for a linear time invariant system to be stable, marginally stable and
unstable are given as:

 If all roots of the characteristic equation (poles of the closed loop transfer function) lie in the left half of the s-plane,
system is said to be stable.
 If characteristic equation has roots on the imaginary axis (jw- axis) all other roots on the left half of the s-plane,
system is said to be marginally stable.
 If at least one root of the characteristic equation (pole of the closed loop transfer function) lie in the right half of the
s-plane, system is said to be unstable.

11.2. MATLAB Commands

 sys= tf(n,d): It generates transfer function of defined numerator (n) and denominator (d) vectors
 Transfer Function: < S= TF ('S')> Specifies the transfer function H(s) = s (Laplace variable).
 Series: SYS = SERIES(SYS1, SYS2, OUTPUTS1, INPUTS2). It connects two LTI models SYS1 and SYS2 in
series such that the outputs of SYS1 specified by OUTPUTS1 are connected to the inputs of SYS2 specified by
INPUTS2.
 Parallel: SYS = PARALLEL(SYS1, SYS2, IN1, IN2, OUT1, OUT2). It connects the two LTI models SYS1 and
SYS2 in parallel such that the inputs specified by IN1 and IN2 are connected and the outputs specified by OUT1
and OUT2 are summed.
 Feedback: SYS = FEEDBACK(SYS1, SYS2,+/-). It computes an LTI model SYS for the closed-loop feedback
system. Negative feedback is assumed and the resulting system SYS maps u to y.
 pzmap(sys): It generates and plots system poles and zeros on the s-plane.
 [p,z]= pzmap(sys): It gives the values of poles & zeros taken from pzmap.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 54 Laboratory Manual

LAB EXERCISES: (Comments required on each Task)


Task 1: Find the stability of a system having the characteristic equation and express result in a same window.
a) Q(s)=S3+6S2+12S+8
b) Q(s)=2S4+8S3+10 S2+10S
c) Q(s)= S3-2 S2+4S+6

Task 2: Find the stability of the following system:

Task 3: Find the stability of the following system:

Task 4: Find the system’s poles and zeros and also find the stability of the system using ‘pzmap’ command.
(𝑆+4)
a) G(S)=
(𝑆4+ 𝑆3+ 3𝑆2+2𝑆+2)
(𝑆−2)
b) G(S)=
( S3+ 6S2+12S+8)

Task 5: For what value of K does the polynomial Q(s) have roots with –ve real part axis (Solve Manually).

a) Q(s) =S3+ (4+k)S2+6S+12


b) Q(s) =S4+6S3+11S2+6S+k
c) Q(s) =S4-3S3+3S+1+k

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 55 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 56 Laboratory Manual

LABORATORY EXERCISE 12
OBJECTIVE

To sketch root locus of given system using MATLAB.

THEORY

12.1. Root Locus


The root locus procedure indicates to us the characteristics of a control system’s natural response. In control theory and
stability theory, root locus analysis is a graphical method for examining how the roots of a system change with variation of a
certain system parameter, commonly gain within a feedback system. In addition to determining the stability of the system,
the root locus can be used to design the damping ratio (ζ) and natural frequency (ωn) of a feedback system.

“A root locus of a system is a plot of the roots of the system characteristics equation (the poles of the closed-loop transfer
function) as some parameter of the system is varied.”

12.2. MATLAB Commands

 Transfer Function: < S= TF ('S')> Specifies the transfer function H(s) = s (Laplace variable).
 rlocus(sys): It Evans root locus.
It computes and plots the root locus of the single-input, single-output LTI model SYS. The root locus plot is used to
analyze the negative feedback loop and shows the trajectories of the closed-loop poles when the feedback gain K
varies from 0 to Inf. Locus automatically generates a set of positive gain values that produce a smooth plot.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 57 Laboratory Manual

LAB EXERCISES: (Comments required on each Task)

Task 1:

(𝑺+𝟒)
Find the root locus of the following system: G(s) =
(𝑺+𝟏+𝟐𝒋)(𝑺+𝟏−𝟐𝒋)

Task 2:

𝟏
Find the root locus of the following system: G(s) =
𝑺(𝑺+𝟏)(𝑺+𝟑)

Task 3:

𝟏
Find the root locus of the following system: G(s) =
𝑺(𝑺−𝟏)(𝑺+𝟐)(𝑺+𝟑)

Task 4:

𝟏
Find the root locus of the following system: G(s) =
𝑺(𝑺+𝟒)(𝑺𝟐 +𝟒𝑺+𝟐𝟎)

Task 5:

Find the root locus of the following system:

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 58 Laboratory Manual

CONCLUSION
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 59 Laboratory Manual

LABORATORY EXERCISE 13
OBJECTIVE

Study of P, I, D and PID controller on system response by using MATLAB.

THEORY

13.1. PID Controller

A PID controller (Proportional, Integral and Differential) is used to control devices, such as drives to maintain control of a
varying system.

13.2. Working of PID Controller:

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

 Kp = Proportional gain
 KI = Integral gain
 Kd = Derivative gain

Fig 13.1 PID Controller

The figure shows how the PID controller works in a closed-loop system. The variable (e) represents the tracking error,
the difference between the desired input value (R) and the actual output (Y). This error signal (e) will be sent to the PID
controller, and the controller computes both the derivative and the integral of this error signal. The signal (u) just past
the controller is now equal to the proportional gain (Kp) times the magnitude of the error plus the integral gain (Ki)
times the integral of the error plus the derivative gain (Kd) times the derivative of the error.

𝑡
𝑑
𝑢 (𝑡) = 𝐾𝑝 𝑒(𝑡) + 𝐾𝑖 ∫ 𝑒(𝜏)𝑑𝜏 + 𝐾𝑑 𝑒(𝑡)
0 𝑑𝑡

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 60 Laboratory Manual

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

13.3. The characteristics of P, I, and D controllers

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) will have the effect of increasing the stability of the system,
reducing the overshoot, and improving the transient response. Effects of each of controllers Kp, Kd, and Ki on a closed-
loop system are summarized in the table shown below.

13.4. Matlab Commands

 sys= tf(n,d): It generates transfer function of defined numerator (n) and denominator (d) vectors
 Transfer Function: < S= TF ('S')> Specifies the transfer function H(s) = s (Laplace variable).
 Series: SYS = SERIES (SYS1, SYS2, OUTPUTS1, INPUTS2). It connects two LTI models SYS1 and SYS2 in
series such that the outputs of SYS1 specified by OUTPUTS1 are connected to the inputs of SYS2 specified by
INPUTS2.
 Parallel: SYS = PARALLEL (SYS1, SYS2, IN1, IN2, OUT1, OUT2). It connects the two LTI models SYS1 and
SYS2 in parallel such that the inputs specified by IN1 and IN2 are connected and the outputs specified by OUT1
and OUT2 are summed.
 Feedback: SYS = FEEDBACK (SYS1, SYS2,+/-). It computes an LTI model SYS for the closed-loop feedback
system. Negative feedback is assumed and the resulting system SYS maps u to y.
 Step (Sys): computes the step response Y of the dynamic system SYS.
 Heaviside(Sys): It generate the unit step function

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 61 Laboratory Manual

LAB EXERCISES: (Comments required on each Task)

Task 1: Find proportional to the given system (Determine the step response of PID controller at Kp=300,500,800)

Task 2: Find derivative to the given system (Determine the step response of PD controller taking KP=300, Kd =10S, 20S,
30S)

Task 3: Find Integral to the given system (Determine the step response of PI controller taking KP=300, Ki =100/S, 500/S,
1000/S)

Task 4: Determine the step response of PID controller by taking KP=350, Kd =20S and Ki =500/S

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 62 Laboratory Manual

Task 5:

400
Consider a process given below to be controlled by a PID controller, GP =
𝑆(𝑆+48.5)

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


b) Try PI controllers with (KP=2, 10, 100), and Ki=Kp/10S. Investigate the unit step response in each case, compare
the results and comment.
c) Let KP=100, Ki=10/S, and add a derivative term with (Kd=0.1S, 0.9S, 2S). 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.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 63 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 64 Laboratory Manual

LABORATORY EXERCISE 14
OBJECTIVE

Analysis of PID controller effects on the system by using IT-4406 Trainer.

 To study the effect of Closed Loop Proportional-Integral-Derivative Control of the Motor.


 To study the effect of Closed Loop Proportional-Integral-Derivative Control of the Light.

THEORY

14.1. PID Controller

A PID controller (Proportional, Integral and Differential) is used to control devices, such as drives to maintain control of a
varying system.

14.2. Working of PID Controller

The transfer function of the PID controller looks like the

following:

Whereas;

 Kp = Proportional gain
 KI = Integral gain
 Kd = Derivative gain

The figure shows how the PID controller works in a closed-loop system. The variable (e) represents the tracking error,
the difference between the desired input value (R) and the actual output (Y). This error signal (e) will be sent to the PID
controller, and the controller computes both the derivative and the integral of this error signal. The signal (u) just past
the controller is now equal to the proportional gain (Kp) times the magnitude of the error plus the integral gain (Ki)
times the integral of the error plus the derivative gain (Kd) times the derivative of the error.

𝑡
𝑑
𝑢 (𝑡) = 𝐾𝑝 𝑒(𝑡) + 𝐾𝑖 ∫ 𝑒(𝜏)𝑑𝜏 + 𝐾𝑑 𝑒(𝑡)
0 𝑑𝑡

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

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 65 Laboratory Manual

PROCEDURE

Figure14.1 Closed loop PID Control of the Motor

1. Make all connection as shown in figure 14.1 then press the main switch ON of the IT-4406 PID Controller Trainer
Board.
2. Connect the oscilloscope probe to the output of block TP52.
3. Set the voltage of about 3v at the output of Setpoint1 TP54.
4. The Motor will start to rotate. If not so, turn the Proportional pot to about 25%. Similarly turn the Integral &
Derivative pot to about 25%. Press the RESET button given on the trainer.
5. Observe the waveform of PID block on oscilloscope that will shows some oscillations, try to remove theses ripples
by adjusting proportional pot. When the system is balanced it will give you straight line
6. Try to unstable the system by interrupting the motor with something. It will destabilize the system for some time but
the PID controller will again stabilize it. Note that time taken by the system.
7. Now set the voltages of about 5v & 7v (one by one) at the output of Setpoint1 TP54 and repeat the above steps till
6. Note the readings to fill the observation table14.1 shown below.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 66 Laboratory Manual

Figure14.2 Closed loop PID Control of the Light

8. Make all connection as shown in figure 14.2 then press the main switch ON of the IT-4406 PID Controller Trainer
Board.
9. Connect the oscilloscope probe to the output of block TP52.
10. Set the voltage of about 3v at the output of Setpoint1 TP54.
11. The Lamp will start to illuminate. If not so, turn the Proportional pot to about 25%. Similarly turn the Integral &
Derivative pot to about 25%. Press the RESET button given on the trainer.
12. Observe the waveform of PID block on oscilloscope that will shows some oscillations, try to remove theses ripples
by adjusting proportional pot. When the system is balanced it will give you straight line
13. Try to unstable the system by interrupting the light with disturbance given on the trainer. It will destabilize the
system for some time but the PID controller will again stabilize it. Note that time taken by the system.

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 67 Laboratory Manual

14. Now set the voltages of about 5v & 7v (one by one) at the output of Setpoint1 TP54 and repeat the above steps from
8 till 13. Note the readings to fill the observation table14.1 shown below.

OBSERVATION

Time Taken by the PID Controller for


Set point Voltages
Closed Loop System stabilized Closed Loop System
(volts)
(seconds)

All PID
Controllers(Kp, Kd &
Ki) are present for
Control of Motor

All PID
Controllers(Kp, Kd &
Ki) are present for
Control of Light

Table14.1 Closed Loop PID Control System Observation

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 68 Laboratory Manual

CONCLUSION

______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
__________________________________________________________

___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi

You might also like