Professional Documents
Culture Documents
FBCS Lab Manual Fall 2019-1 PDF
FBCS Lab Manual Fall 2019-1 PDF
NAME: _______________________________________________
TEACHER: ____________________________________________
_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/113
Feedback Control Systems (EL-205) Laboratory Manual
LAB CONTENTS
12 To sketch the root locus of the given system using MATLAB 4 3,4,5,10
______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/113
Feedback Control Systems (EL-205) Laboratory Manual
INDEX
1 Introduction to MATLAB
______________________________________________________________________________________
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
THEORY
_______________________________________________________________________________________
Electrical Engineering Department
Sir Syed University of Engineering and Technology
SSUET/QR/114
Feedback Control Systems (EL-205) 3 Laboratory Manual
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
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
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 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:
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)=
𝑺𝟒+𝟑𝑺𝟐+𝟒
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.
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.
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
𝑆𝑌𝑆1
In Form of Transfer Function: SYS=
1+𝑆𝑌𝑆1∗ 𝑆𝑌𝑆2
It solves the equations equation 1 to n with respect to the variables var1 to varn.
𝐶 𝑔
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
___________________________________________________________________
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
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:
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
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
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.
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
___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 16 Laboratory Manual
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
THEORY
In this lab we will learn how to model electrical systems in terms of 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.
Syms
Define Symbolic Variables
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
𝑉
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
THEORY
In this lab we will learn how to model mechanical systems in terms of transfer functions.
A mechanical system manages power to accomplish a task that involves forces and movement. Following are the basic
types of 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
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
𝒅𝒕𝟐
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
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
𝒅𝒕
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.
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)
F(S)=KX(S)
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
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.
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
𝑑𝑡
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:
___________________________________________________________________
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.
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 (𝑡)
𝜏(𝑡) = 𝐵 [ - ]
𝑑𝑡 𝑑𝑡
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.5. Example
___________________________________________________________________
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
>>
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
___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 31 Laboratory Manual
___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 32 Laboratory Manual
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
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:
𝑒𝑔 = 𝐾𝑔 𝑖𝑓
___________________________________________________________________
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
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:
𝑑𝜃
𝑒𝑚 = 𝐾𝑚
𝑑𝑡
𝑑𝑖𝑎
𝑒𝑎 = 𝑅𝑚 𝑖𝑎 + 𝐿𝑚 + 𝑒𝑚
𝑑𝑡
𝜏(𝑡) = 𝐾𝜏 𝑖𝑎
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
___________________________________________________________________
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:
𝒙̇ (𝒕) = 𝑨𝒙(𝒕) + 𝑩𝒖(𝒕)
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.
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).
[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
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
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.
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.
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
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
𝟐
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
RESULT
___________________________________________________________________
Department of Electrical Engineering
Sir Syed University of Engineering and Technology Karachi
SSUET/QR/114
Feedback Control Systems (EL-205) 42 Laboratory Manual
𝟐.𝟓
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
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.
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.
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: 𝑇𝑠 = 𝜁𝜔
𝑛
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
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
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 ) … …
(𝑗𝜔 − 𝑍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
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
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
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.
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
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).
___________________________________________________________________
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
THEORY
“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.”
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
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:
___________________________________________________________________
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
THEORY
A PID controller (Proportional, Integral and Differential) is used to control devices, such as drives to maintain control of a
varying system.
The transfer function of the PID controller looks like the following:
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 𝑑𝑡
___________________________________________________________________
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.
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.
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
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)
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
THEORY
A PID controller (Proportional, Integral and Differential) is used to control devices, such as drives to maintain control of a
varying system.
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
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
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
All PID
Controllers(Kp, Kd &
Ki) are present for
Control of Motor
All PID
Controllers(Kp, Kd &
Ki) are present for
Control of Light
___________________________________________________________________
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