You are on page 1of 41

CHANAKYA TECHNICAL CAMPUS,JAIPUR

6EE7A
COTROL SYSTEM
LAB
DEPARTMENT OF ELECTRICAL ENGINEERING

LAB-MANUAL
VI SEM EE

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Course outcome:
Learning Outcomes: Through problem solving and laboratory practice, this course provides a
foundation in continuous-time linear control system theory. After successfully completing the
course, students are able to:
1. Represent a dynamic system using ordinary differential equations, transfer functions,
frequency response, and state-space methods.
2. Analyze, design, and synthesize feedback control systems using frequency response, and
state-space methods.
3. Effectively use MATLAB and SIMULINK in the analysis, design, simulation, and real-time
Implementation of closed-loop systems.
4. Perform root locus analysis of a system using matlab to study the influence of poles and
zeroes on the performance of the system
5. Perform frequency response analysis of a system using matlab to study the influence of pole
and zero on the performance of the system

CHANAKYA TECHNICAL CAMPUS,JAIPUR

CHANAKYA TECHNICAL CAMPUS,JAIPUR
DEPARTMENT OF ELECTRICAL ENGINEERING
LAB ETHICS
DO’s

1 Enter the lab on time and leave at proper time.
2 Keep the bags outside in the racks.
3 Utilize lab hours in the corresponding experiment.
4 Make the Supply off the Kits/Equipment’s after completion of Experiments.
5 Maintain the decorum of the lab.

Don’ts
1 Don’t bring any external material in the lab.
2 Don’t make noise in the lab.
3 Don’t bring the mobile in the lab.
4 Don’t enter in Faculty room without permission.
5 Don’t litter in the lab.
6

Don’t carry any lab equipment’s outside the lab

We need your full support and cooperation for smooth functioning of the lab.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
DEPARTMENT OF ELECTRICAL ENGINEERING
INSTRUCTIONS
BEFORE ENTERING IN THE LAB
1 All the students are supposed to prepare the theory regarding the present
Experiment.
2 Students are supposed to bring the practical file and the lab copy.
3 Previous experiment should be written in the practical file.
4 Object, Apparatus Table & Brief Theory of the current practical should be written
in the lab copy.
5 Any student not following these instructions will be denied entry in the lab and
Sessional Marks will be affected.
WHILE WORKING IN THE LAB
1 Adhere to experimental schedule as instructed by the faculty.
2 Record the observations in lab copy & checked by the faculty
3 Each student should work on his assigned table of the lab.
4 Take responsibility of valuable accessories.
5 Concentrate on the assigned practical and be careful.
6 If anyone is caught red-handed carrying any equipment of the lab, then he will have
to face serious consequences.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No-1
OBJECT: Introduction to MATLAB Computing Control Software.
THEORY: MATLAB Computing Control Software
INTRODUCTION

MATLAB (short for MATrixLABoratory) is a programming language for technical computing.
It provides a single platform for computation, visualization, programming and software
development. All problems and solutions in MATLAB are expressed in notation used in linear
algebra and essentially involve operations Using matrices and vectors. You may use MATLAB
to solve problems including:
 Circuits
 Communication systems
 Digital signal processing
 Control systems
 Probability and statistics
In addition, you can use MATLAB to build Graphical User Interfaces (GUIs) so that you can
develop user-friendly custom software, MATLAB software environment has a core module
(called MATLAB) and associated with that are a set of "Toolboxes" that perform specialized
computations.
MATLAB environment contains three main areas:
1. The “Command Window” where you can type commands.
2. The “Workspace” variable browser where you can see which variables exist in MATLAB
workspace and you can also see their value.
3. The “Command History” where you can see which MATLAB commands have been executed
recently.
Vectors and Matrices:
Variables in MATLAB are just like variables in any other programming language (C, C++,…
,etc); only the difference is that you do not have to define them by indicating the type. Also,
variable names case sensitive can be used to refer to a single number (a scalar), a set of numbers
(a vector) or an array of numbers (a matrix). Vectors are nothing but matrices having a single
row (a row vector), or a single column (a column vector). To create a row vector in MATLAB,
do:
r = [1 2 3 4]
A column vector can be created by writing in one of two ways:
c = [1; 2; 3; 4]
or
c=[1 2 3 4]

CHANAKYA TECHNICAL CAMPUS,JAIPUR
On the other hand, you can use the ' operator to have a transpose of the vector:
r= c'
r=1 2 3 4

Matrices:
A matrix can be entered a row at a time, with a semicolon between rows:
A= [1 -2; 1 2]
A=
1 -2
1 2
The identity matrix can be formed with the function eye(n), where n is the size of
the desired matrix:
I=eye(2)
I=
1 0
0 1
We can now do mathematical manipulations of these matrices, including finding the
Inverse of the matrix (A) Recall that A*A-1=I (where A-1 is the inverse matrix of A).
Plotting functions:
MATLAB can be useful as a tool for plotting functions. For example, let’s plot a sinusoidal
function. First, generate a time vector that will be used for plotting:
t=0:0.1:10;
This generates a vector t that goes from 0 to 10 seconds with an incremental value of 0.1
second. Now, let’s create another vector, x1, that is the sine of time t, with a frequency of 2
rad/sec. Then we will plot it by adding the following steps:
x1=sin(2*t);
4
plot(t,x1);
grid
xlabel('Time');
ylabel('x1');
title('x1 vs time');
m-files in MATLAB:

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Executable files in MATLAB are generated by storing a list of MATLAB commands in a file
given the extension .m. These files are called M-files. To create an M-file, use the New...M-file
Option under the File Menu in the Command Window. Type in the following commands in the
M-File Editor Window:
x = [0:0.1:10];
y = cos(x);
plot(x,y);
xlabel('x');
ylabel('y');
title('A plot of Cosine(x)');
Save the file using ‘Save’ Option under the File Menu in the M-File Editor Window.
Call it, say, cosineplot.m. Now, to run this program in MATLAB, move over to the
MATLAB Command Window and just type in:
cosineplot
Control System Toolbox:
MATLAB has a rich collection of functions immediately useful to the control engineer or
system theorist. One of the tools in MATLAB is the Control System Toolbox. The Control
System Toolbox builds on the foundations of MATLAB to provide functions designed for
control engineering. The Control System Toolbox is a collection of algorithms, written mostly
as M-files, that implements common control system design, analysis, and modeling techniques.
Convenient graphical user interfaces (GUIs) simplify typical control engineering tasks. Control
systems can be modeled as transfer functions, in zero-pole-gain or state-space form, allowing
you to use both classical and modern control techniques. You can manipulate both continuoustime and discrete-time systems. Conversions between various model representations are
provided. Time responses, frequency responses, and root loci can be computed and graphed.
Other functions allow pole placement, optimal control, and estimation. Finally, the Control
System Toolbox is open and extensible. You can create custom M-files to suit your particular
application.
Time Response:
Time response analyses include but not limited to:
a. Step Response analysis:

1. Step response is calculated by:
y=step(num,den,t);
wherenum is the numerator of the transfer function, den is the denominator
of the transfer function, and t is a vector contains regularly spaced time
instants.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
2. To plot the step response, add:
plot(y);
or you can just write:
step(num,den,t);

b. Root Locus plot:
1. The root locus is calculated by adding:
R=rlocus(num,den,k);
where k is a vector that contains the range of gain specified by the user.
2. To plot the root locus, add:
plot(R,'x');
where the closed loop roots are indicated by the symbol 'x'.
Frequency Response analyses:
a. Frequency Response analyses include but not limited to:
Bode plot:
1. The magnitude and phase of bode plot will be calculated by the following formula:
w=logspace(d1,d2);
where w is a vector contains the range of frequencies between 10^d1 and
10^d2 . In order to calculate the gain and phase of Bode plot, add:
[mag,phase]=bode(num,den,w);
2. To plot the bode plot, add:
magdb=20*log10(mag);
subplot(211);
semilogx(magdb);
subplot(212);
semilogx(phase);
Alternatively, you can only add:
bode(num,den,w);
3. To find the gain margin, phase margin, the gain cross over frequency and phase cross over
frequency, add:
[gm,pm,wg,wp]=margine(mag,phase,w)
b. Nyquist plot:
The real and imaginary parts will be calculated by:
[re,im]=nyquist(num,den,w);
Polar(re,im);
Simulink:

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Simulink is a tool for modeling, analyzing, and simulating a wide variety of physical and
mathematical systems, including those with nonlinear elements and those which make use of
continuous and discrete time.
Hints:
Tf: Specifies transfer functions or converts LTI model to transfer function form:
sys = tf(num,den)
with numerator(s) (num) and denominator(s) (den). The output SYS is a TFobject.
sysd= tf(num,den,TS)
creates a discrete-time transfer function with sampling time TS; (set TS=-1 if the
sample time is undetermined).
CONV: Convolution and polynomial multiplication:
C = conv(A, B) convolves vectors A and B. The resulting vector is lengthLENGTH(A)
+LENGTH(B). If A and B are vectors of polynomial coefficients, convolving them is equivalent
to multiplying the two polynomials.
tfdata: Quick access to transfer function data:
For a single SISO model SYS, the syntax
[NUM,DEN] = tfdata(sys,'v');
returns the numerator and denominator as row vectors rather than cell arrays.However, you can
use the online help to expand your knowledge about MATLAB.
Procedure:
1. For the following two transfer functions:

A. Draw the unit step response.
B. Draw the root locus plot.
C. Draw the Bode plot.
D. Draw the Nyquist plot;
2. For the following closed loop transfer function shown in Figure (1.1):

CHANAKYA TECHNICAL CAMPUS,JAIPUR

A. Build and run a Simulink model. Apply a step signal of 10 and displays it in a scope.
B. Change the length of the simulation time to be 20 seconds and re-run it.
C. Change the input signal to a sinusoidal input signal and run the simulation. How does the
system’s response differ?
D. Change the frequency of the sin signal so that it is now 10 times larger than the default value.
How does the system’s response differ?
E. Generate the ‘subsystem’ of the Simulink model and repeat step A.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No-2
OBJECT: Defining Systems in TF, ZPK form.
PROGRAM: (a) Defining System in TF form-

>>clear
>>clc
>>num=[8 18 32]
num =
8

18

32

>>den =[1 6 14 24]
den =
1

6

14

24

>> h=tf(num,den)
Transfer function:
8 s^2 + 18 s + 32
----------------------s^3 + 6 s^2 + 14 s + 24

CHANAKYA TECHNICAL CAMPUS,JAIPUR
(b) Defining System in ZPK form>>clear
>>clc
>> z = 0
z=
0
>> p = [ 2 1+i 1-i ]
p=
2.0000

1.0000 + 1.0000i 1.0000 - 1.0000i

>> k = -2
k=
-2
>> H = zpk(z,p,k)
Zero/pole/gain:
-2 s
-------------------(s-2) (s^2 - 2s + 2)

RESULT :Thus we have successfully defined Systems in TF, ZPK form.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No. 3
OBJECT: (a) Plot step response and (b) ramp response of a given TF.
PROGRAM: (a) Plot step response
>>clear
>>clc
>>num=[8 18 32]
num =

8

18

32

>>den =[1 6 14 24]
den =
1

6

14

24

>> h=tf(num,den)
Transfer function:
8 s^2 + 18 s + 32

CHANAKYA TECHNICAL CAMPUS,JAIPUR
-----------------------

Figure: Step response

s^3 + 6 s^2 + 14 s + 24

>>step(num,den)

PROGRAM: (b)
ramp response

plot

>>clear
>>clc
>>num=[8 18 32]
num =
8

18

32

>>den =[1 6 14 24]
den =
1

6

14

24

>> h=tf(num,den)
Transfer function:
8 s^2 + 18 s + 32
-----------------------

Figure: Ramp response

CHANAKYA TECHNICAL CAMPUS,JAIPUR
s^3 + 6 s^2 + 14 s + 24
>> t=0:.01:.5;
>> u = t;
>>lsim(h, u, t)

RESULT :Thus we have successfully plot step response and ramp response of a given TF.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No. 4
OBJECT: For a given 2nd order system plot step response and obtain time response
specification.
PROGRAM:
>>clear
>>clc
>>num=[1 0]
num =
1

0

>>den=[1 2 1]
den =
1

2

1

>> h=tf(num,den)
Transfer function:
s
-------------

Figure: Step response

s^2 + 2 s + 1
>>step(h)

RESULT :Thus we have successfully plot step response of a given 2nd order TF.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No. 5
OBJECT: To design 1st order R-C circuits and observes its response with the following
inputs and traces the curve. (a) Step (b) Ramp (c) Impulse

THEORY:Modeling First Order Systems in Simulink
The RC Circuit is schematically shown in Fig. 1 below.

The differential equation for this is as show in (1) below.

Where (xdot) is the time rate of change of the output voltage, R and C are constants, f(t) is the
forcing function (Input voltage), and x is the output voltage. We are now going to take this piece
by piece. First, we examine what is in the brackets and we notice that we are subtracting the
term x from the term f (t). If we imagine that each of these terms outputs a signal, we can model
this relationship as shown in Fig. 2 below.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Now we notice that the bracketed term [f(t) – x] is multiplied by a constant 1/RC. We do this in
Simulink by passing the signal through a Gain block as in Fig. 3 below. Because all the terms
on the right-side of xdot are accounted for, we know that the output signal must be equal to the
left side of the equation, which is xdot.

However, we are interested in x, not xdot. How can we take the xdotoutput signal and get an x
output? The answer is to use an integrator block as in Fig. 4 below.

Now, we have the desired x output, but we notice that x is also an input of the system. In our
model above, the input x branch is a “dead” branch. In other words, there is no real signal going
in there. How can we make x both an output and input of the system? The answer is to use a
feedback loop by tapping the output x signal and feeding it back into the system at the input
point. After some manipulation of the lines, your model should look like Fig. 5 below.

Fig. 5 Finished simulink model.

CHANAKYA TECHNICAL CAMPUS,JAIPUR

After adding a Scope block, you are ready to set the
block parameters, and run the simulation.
Running Simulation and Analyzing data:
Having completed the Simulink Models for both the first
and second order systems, it is now time to run a simple
simulation and look at the results. We will start first with
the first-order system, and then show the simulation and
results for the second-order system.
Double-click on the Integrator block and set the initial
conditions to zero as shown in Fig. 6 Leave the
remaining fields as they are.

Fig. 6.
block
parameters

Integrator

Now, double
the Gain block
gain to the
shown in Fig.

click
on
and set the
values
7 below.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Fig. 7. Gain block parameters
Open the Step block to familiarize yourself with the parameters. Now, run the simulation and
open the Scope block. Your results should be similar to Fig. 8 below.

Fig. 8.Output from first-order system.

We can easily obtain response of 1st order R-C circuits by changing input signal as ramp &
impulseinput signals in figure 5.

RESULT: Thus we have successfully designed 1st order R-C circuits and observed its response
with the following inputs and traces the curve. (a) Step (b) Ramp (c) Impulse.

Experiment No. 6

CHANAKYA TECHNICAL CAMPUS,JAIPUR
OBJECT: To design 2nd order electrical network and study its transient response for step
input and following cases.
Negative damped system ζ < 0
Undamped system ζ = 0
Underdamped System. 0 <ζ < 1
Critically damped system. ζ = 1
Overdamped System ζ > 1
THEORY:
Transfer function for a second-order system can be written as,

CHANAKYA TECHNICAL CAMPUS,JAIPUR

CHANAKYA TECHNICAL CAMPUS,JAIPUR

CHANAKYA TECHNICAL CAMPUS,JAIPUR

Figure 1: Step-response of Second-order System (ωn = 10)

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Program:
>>wn=5
wn =
5
>>
>>zeta=[-1 0 0.2 1 2]
zeta =
-1.0000

0

0.2000

1.0000

>>for i=1:5
num=[wn*wn];

den=[1 2*zeta(i)*wnwn*wn];
step(num,den)
hold on
set(gca, 'XLim', [0 3],'YLim', [0 2.5])
end

Response:

2.0000

CHANAKYA TECHNICAL CAMPUS,JAIPUR

RESULTS: Thus we have successfully studied of 2nd order system and got its transient response
for step input and following cases.
Negative damped system ζ < 0
Undamped system ζ = 0
Underdamped System. 0 < ζ < 1
Critically damped system. ζ = 1
Overdamped System ζ > 1

CHANAKYA TECHNICAL CAMPUS,JAIPUR

Experiment-7
OBJECT: To Study the frequency response of following compensating Networks, plot the
graph and final out corner frequencies. (a) Lag Network (b) Lead Network (c) Lag-lead
Network.
THEORY:
Introduction to Lead-Lag Compensation
Generally the purpose of the Lead-Lag compensator is to create a controller which has has an
overall magnitude of approximately 1. The lead-lag compensator is largely used for phase
compensation rather than magnitude. A pole is an integrator above the frequency of the pole. A
zero is a derivative above the frequency of the zero.
Adding a pole to the system changes the phase by -90 deg and adding a zero changes the phase
by +90 deg. So if the system needs +90 deg added to the phase in a particular frequency band

CHANAKYA TECHNICAL CAMPUS,JAIPUR
then you can add a zero at a low frequency and follow that zero with a pole at a higher
frequency.
Lead or Lag Control
Lead and lag control are used to add or reduce phase between 2 frequencies. Typically these
frequencies are centered around the open loop crossover frequency. A lead filter typically has
unity gain (0 dB) are low frequencies while the lag provides a no unity gain at low frequencies.

Lead-Lag Control
This is an extension of the Lead and Lag network described above. We can always stick a gain
in front of something so reformulate above to look like this

Then a lead-lag controller would have the form

CHANAKYA TECHNICAL CAMPUS,JAIPUR

Experiment-8
OBJECT:Plot bode plot for a 2nd order system and find GM and PM.
PROGRAM:
>>clear
>>clc
>>num=[16]
num =
16
>>den=[1 2 16]
den =

CHANAKYA TECHNICAL CAMPUS,JAIPUR
1

2

16

>> h=tf(num,den)
Transfer function:
16
-------------s^2 + 2 s + 16
>>bode(h)

We get the bode plot of a given second order transfer function

CHANAKYA TECHNICAL CAMPUS,JAIPUR

RESULT: Thus we have successfully studied bode plot for a 2nd order system and find GM
and PM.

Experiment No. 9

CHANAKYA TECHNICAL CAMPUS,JAIPUR
OBJECT: Check for the stability of a given closed loop system.
PROGRAM:
>>clear
>>clc
>>num=[16]
num =
16
>>den=[1 2 16]
den =
1

2

16

>> h=tf(num,den)
Transfer function:
16
-------------s^2 + 2 s + 16
>>nyquist(h)

We get the nyquist plot of a given second order transfer function

CHANAKYA TECHNICAL CAMPUS,JAIPUR

RESULT: Thus we have successfully studied for checking the stability of a given closed loop
system

Experiment No. 10
OBJECT:-To draw characteristics of ac servomotor.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
APPARATUS REQUIRED: - AC Servo Motor Setup, Digital Multimeter and Connecting
Leads.
THEORY:AC servomotor has best use for low power control applications. Its important parameters are
speed – torque characteristics. An AC servomotor is basically a two phase induction motor
which consist of two stator winding oriented 90*electrically apart. In feedback application
phase A is energized with fixed voltage known as “Reference” and phase B is energized with
variable voltage called “Control voltage”. In this setup AC servomotor is mounted and
mechanically coupled a small PMDC motor loading purpose. When DC supply is fed to DC
motor it runs in reverse direction of servomotor direction to impose load on servomotor. The
resultant torque developed by DC motor to overcome it increase the current through it which is
indicated by panel meter.
CIRCUIT DIAGRAM:-

Fig: 1. Circuit diagram

CHANAKYA TECHNICAL CAMPUS,JAIPUR
PROCEDURE: 1. Switch ON the power supply, switch ON S1. Slowly increase control P1 so that AC
servomotor starts rotating. Connect DVM across DC motor sockets (red & black). Very the
speed of servomotor gradually and note the speed N rpm and corresponding back emfEb across
DC motor.
2. Connect DVM across servo motor control winding socked (yellow) and adjust AC
Servomotor voltage to 70V and note speed N rpm in table.
3. Switch on S2 to impose load on the motor due to which the speed of AC motor decreases.
Increase the load current by means of P2 slowly and note corresponding speed N rpm and Ia.
Calculate P=Ia*Eb and Torque=P*1.019*10460/2.2.14Ngm/cm.
OBSERVATION TABLE:TABLE-1
S.NO

SPEED N rpm

Eb volts

.
1.
2.
3.
4.

TABLE-2
S.NO.
1.

Ia amp

Eb ( Tab 1 )

Speed N

P watt

Torque

CHANAKYA TECHNICAL CAMPUS,JAIPUR
2.
3.
4.

PRECAUTIONS: 1. Apply voltage to servomotor slowly to avoid errors.
2. Impose load by DC motor slowly.
3. Take the reading accurately as the meter fluctuates.
4. Switch OFF the setup when note in use.
GRAPH:-

CHANAKYA TECHNICAL CAMPUS,JAIPUR
RESULT:The graph is plotted between speed and torque. As we reduce the speed of
the motor the torque goes on increasing therefore the graph starts with a
low value and rises to a high value approximately linearly .This rise in the
graph is due to the rising speed- torque characteristics of AC servo motor.

CHANAKYA TECHNICAL CAMPUS,JAIPUR
Experiment No. 11
OBJECT:-To perform experiment on Potentiometer error detector.
APPARATUS REQUIRED: -Potentiometer kit, Dual trace CRO and connecting leads
THEORY:Potentiometric transducers are used in control applications. The set-up has built –in source of
+5V dc and about 2Vpp 400Hz AC output. A DVM is provided to read dc voltage and AC can
be read on CRO. The potentiometers are electrtomechanical devices which contain resistance
and a wiper arrangement for variation in resistance due to displacement. The potentiometers
have three terminals. The reference DC or AC voltage is given at the fixed terminals and
variable is taken from wiper terminal.
CIRCUIT DIAGRAM:-

CHANAKYA TECHNICAL CAMPUS,JAIPUR

Fig. 2 Circuit diagram DC excitation

PROCEDURE: 1. Connect the power and select the excitation switch to DC. Keep Pot.1 to center =180°.
Connect DVM to error output. Turn Pot.2 from 20° to 340° in regular steps. Note displacement
in 0°=θ2 and output voltage E as V0. Plot graph between V0 and θe= θ1- θ2.
2. Switch ON the power and select excitation switch to AC. Connect one of CRO input with
carrier output socket and ground. Connect other input of CRO with error output socket. Keep
pot.1 fixed at 180° and move pot.2 from 20° to 340°. Note displacement in θ° and Demodulator
voltage VDM. Plot graph between displacement and demodulator voltage.
OBSERVATION TABLE:TABLE-1
S.NO
.

TABLE-2

For DC Supply
Pot.2 position in
θ°

For AC Supply

θe= θ1- θ2

Output Voltage =
V0

CHANAKYA TECHNICAL CAMPUS,JAIPUR
S.NO.

Pot.2 position in

θe= θ1- θ2

θ°

Output Voltage =
V0

PRECAUTIONS: 1. Select the excitation switch as required, AC or DC. Wrong selection may cause error in
experiment or damage the setup.
2. Take the reading carefully.
3. Switch OFF the setup when not in use.
GRAPH:-

RESULT:The graph is plotted between displacement angle and output voltage. For DC Excitation the
output voltage increases linearly with positive displacement angle and decreases with negative
displacement angle, but for AC excitation it is reverse. The output voltage increases with
negative displacement and decreases with positive displacement angle.