Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
198 views

EE3512 - C and I Lab Manual-Student

Uploaded by

purushoth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views

EE3512 - C and I Lab Manual-Student

Uploaded by

purushoth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

DEPARTMENT OF ELECTRICAL AND ELECTRONICS

ENGINEERING

EE3512 – CONTROL AND INSTRUMENTATION


LABORATORY
(REGULATION - 2021)

Name of the Student :


Register No. :

Branch :
Batch : 2022 - 2026

Year / Semester : III / V


Academic Year : 2024 – 2025 (Odd)
BONAFIDE CERTIFICATE

University Register Number

This is to certify that this is a bonafide record work done by

Mr. / Miss. studying B.E. / B.Tech.,

Department in the

Laboratory for semester.

Staff-in-charge Head of the Department

Submitted for the university practical examination held on at

Velammal Institute of Technology.

Internal Examiner External Examiner


INSTITUTE VISION

To be a leader in imparting quality technical education, research & enterprising skills in


pursuit of professional excellence

INSTITUTE MISSION

To promote quality education & technical skills to meet the industry requirements
To incorporate team work, leadership skills & lifelong learning
To facilitate career development & higher education assistance
To encourage innovative ideas for research & development and entrepreneurship for societal
needs
To inculcate ethical responsibility & human values

VISION OF THE DEPARTMENT

To produce highly competent Electrical Engineers and Researchers to fulfil the


technological needs of society through innovation and product development

MISSION OF THE DEPARTMENT

To educate graduates with fundamental principles to acquire advanced technical knowledge


in domains of Electrical and Electronics Engineering
To provide a progressive environment for innovative creations and rigorous practical
training through creative activities in conventional and thrust areas of Electrical and
Electronics Engineering.
To inculcate Societal and Ethical values among the faculties and students.
PROGRAMME OUTCOMES (POs)

1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems
and design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
7. Environment and sustainability: understand the impact of the professional engineering
solutions in societal and environmental contexts, demonstrate the knowledge of, and need
for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics, responsibilities, and
norms of the engineering practice.
9. Individual and teamwork: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and
receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage
independent and life-long learning in the broadest context of technological change.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)

1. Graduates of the program will have successful technical and professional career.
2. Graduates of the program will reveal life-long learning to enhance technical skills and
Managerial skills.
3. Graduates of the program will undertake societal responsibilities with ethical practice.

PROGRAMME SPECIFIC OUTCOMES (PSOs)

1. Ability to design and solve problems in the field of Electrical & Electronics Engineering by
applying the knowledge acquired from Circuit & Field theory, Control theory, Electric Power
Systems, Analog and Digital Electronics & other allied topics.
2. Ability to understand the recent technological developments in Electrical & Electronics
Engineering and develop products/software to cater the societal & Industrial needs.
VELAMMAL INSTITUTE OF TECHNOLOGY, CHENNAI- 601204
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
Subject Code : EE3512 Class : III Year / V Semester
Subject : Control and Instrumentation Laboratory
Faculty : Ms.G.Selvamathi Academic Year : 2024-2025 (Odd)
Course Objectives
The student should be made to:
 To make the students familiarize with various representations of systems 
 To make the students analyze the stability of linear systems in the time domain and frequency
domain 
 To make the students design compensator based on the time and frequency domain Specifications 
 To develop linear models mainly state variable model and transfer function model 
 To make the students to design a complete closed loop control system for the physical systems 
Course Outcomes:
Students will be able to
CO1 To model and analyze simple physical systems and simulate the performance
Apply (K3)
in analog and digital platform
CO2 To design and implement simple controllers in standard forms Analyze(K4)
CO3 To design compensators based on time and frequency domain specifications Analyze(K4)
CO4 To design a complete closed control loop and evaluate its performance for
Analyze(K4)
simple physical systems
CO5 To analyze the stability of a physical system in both continuous and discrete
Apply(K3)
domains
CO6 To analyze the stability of the transfer function using Nyquist stability
analysis Apply(K3)
CO-PO Mapping
PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO
K-level K3 K4 K5 K5 K6 K4 K2 K3 K3 K2 K3 K3
CO1 K3 3 3 3 3 3 - - 1.5 - - - 2
CO2 K4 3 3 3 3 3 - - 1.5 - - - 2
CO3 K4 3 3 3 3 3 - - 1.5 - - - 2
CO4 K4 3 3 3 3 3 - - 1.5 - - - 2
CO5 K3 3 3 3 3 3 - - 1.5 - - - 2
CO6 K3 3 3 3 3 3 - - 1.5 - - - 2
Before - -
3 3 3 3 3 1.5 - - - 2
CBS
BE3273
After - -
3 3 3 3 3 1.5 - - - 2
CBS
CO – PSO Mapping
CO PSO1 PSO2
CO1 2 2
CO2 2 2
CO3 2 2 3 Strong Contribution
CO4 2 2 2 Moderate Contribution
CO5 2 2 1 Weak Contribution

CO6 2 2
BE3273 2 2

Course In-charge Module Coordinator HOD/EEE


EE3512 – CONTROL AND INSTRUMENTATION LABORATORY

LIST OF EXPERIMENTS:

CYCLE - 1

1. Analog (op amp based) simulation of linear differential equations.


2. Numerical Simulation of given nonlinear differential equations.
3. Real time simulation of differential equations.
4. Mathematical modeling and simulation of physical systems in at least two fields.
 Mechanical
 Electrical
 Chemical process
5. System Identification through process reaction curve.
6. Stability analysis using Pole zero maps and Routh Hurwitz Criterion in simulation platform.
7. Root Locus based analysis in simulation platform.
8. Determination of transfer function of a physical system using frequency response and Bode’s
asymptotes.

CYCLE - 2

9. Design of Lag, lead compensators and evaluation of closed loop performance.


10. Design of PID controllers and evaluation of closed loop performance.
11. Discretization of continuous system and effect of sampling.
12. Test of controllability and observability in continuous and discrete domain in simulation platform.
13. State feedback and state observer design and evaluation of closed loop performance.
14. Mini Project 1: Simulation of complete closed loop control systems including sensor and actuator
dynamics.
15. Mini Project 2: Demonstration of a closed loop system in hardware.

CONTENT BEYOND SYLLABUS

Nyquist based analysis in simulation


EE3512 – CONTROL AND INSTRUMENTATION LABORATORY

INDEX

Ex. No. Name of the Experiment Page No. Date Signature


1a Introduction to MATLAB Tools
Analog (op amp based) simulation of linear
1b
differential equations
Numerical Simulation of given linear differential
2a
equations
Numerical Simulation of given nonlinear
2b
differential equations
3 Real time simulation of differential equations
Mathematical modeling and simulation of
4a
Mechanical systems
Mathematical modeling and simulation of
4b
Electrical systems
System Identification through process reaction
5
curve
Stability analysis using Pole zero maps in
6a
simulation
Stability analysis using Routh Hurwitz Criterion in
6b
simulation
7 Root Locus based analysis in simulation
8 Bode plot based analysis in simulation
9a Design of Lag compensators
9b Design of Lead compensators
10 a Design of PID controllers using Program
10 b Design of PID controllers using Simulink Model
Discretization of Continuous System and Effect of
11
Sampling
Test of Controllability and Observability in
12
Simulation
13 State Feedback and State Observer Design
Mini Project 1: Simulation of closed loop control
14
systems including sensor and actuator dynamics
Mini Project 2: DC position control system in
15 a
hardware.
Mini Project 2: AC position control system in
15 b
hardware.
Content Beyond Syllabus
Nyquist based analysis in simulation
Ex. No.:- 1(a)

DATE:-

INTRODUCTION TO MATLAB TOOLS

AIM:

To study the basic introduction to MATLAB tools.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

Simulink is a simulation and model-based design environment for dynamic and embedded systems, which
are integrated with MATLAB. Simulink was developed by a computer software company MathWorks. It
is a data flow graphical programming language tool for modelling, simulating and analysing multi-
domain dynamic systems. It is basically a graphical block diagramming tool with a customisable set of
block libraries. Furthermore, it allows you to incorporate MATLAB algorithms into models as well as
export the simulation results into MATLAB for further analysis.
Simulink supports the following:
 System-level design.
 Simulation.
 Automatic code generation.
 Testing and verification of embedded systems.

To get started with Simulink, click on MATLAB icon and open as shown below:
Double click chirp signal and change the initial frequency from 0.1 to 0.05 and click on Ok button.

The other blocks are kept as the default values. Now, click on run to see the output inscope as shown
below
RESULT:

Thus the MATLAB basic tools have been studied.


Ex. No.:- 1(b)

Date:-

OPAMP BASED SIMULATION OF LINEAR DIFFERENTIAL EQUATION


AIM:

To design an opamp based linear differential equation in simulink model.

APPARATUS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

CIRCUIT DIAGRAM:

Assume Vs = 4 V ; R f = 10 kΩ ; C = 1μϜ ; f = 1000 Hz

dVin
V0ut = −R F C = −250 V
dt

Vin = Vm sin ωt = 4 sin ωt

ω = 2πf

PROCEDURE:

1. Open the simulink model.


2. Select the elements or components needed for designing.
3. Determine the input values.
4. Run the simulink model.
5. Open the scope to see the output.
SIMULINK MODEL:
OUTPUT:

RESULT:
Ex. No.:- 2(a)

Date:-

SIMULATION OF LINEAR DIFFERENTIAL EQUATIONS


AIM:

To simulate the linear differential equation using MATLAB simulink.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

MODEL THE DIFFERENTIAL EQUATION FOR THE FOLLOWING:

d2 y 2𝑑𝑦
+ + 5𝑦 = 10
dt 2 𝑑𝑦

y ′′ + 2y ′ + 5y = 10

By re-arranging,

y ′′ = 10 − 2y ′ − 5y

PROCEDURE:

1. Open the simulink model.


2. Select the elements or components needed for designing.
3. Determine the input values.
4. Run the simulink model.
5. Open the scope to see the output
SIMULINK MODEL:
OUTPUT:

RESULT:
Ex. No.:- 2(b)

Date:-

SIMULATION OF NON-LINEAR DIFFERENTIAL EQUATIONS

AIM:

To simulate the non-linear differential equation (pendulum) using MATLAB simulink.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

A PENDULUM DIFFERENTIAL EQUATION IS

1  x2
x&
g k l
2 
x& sin( x1 )  x2  u
l ml ml 2

PROCEDURE:

1. Open the simulink model

2. Select the elements or components needed for designing.

3. Determine the input variables:

4. Right click on the simulink model page  model properties  callbacks  InitFcn* 
(enter the data)  l=0.5; m=0.1; g=9.80; k=25e-3; x0=[pi/4;0]; u=1e-3;

5. Enter the gain values: G1 = -g/l ; G2 = 1/(m*l^2) ; G3 = -1/(m*l^2)

6. Select the step block  step time =0 , final value = u

7. Select the integrator  initial condition  x0(1) ------------ > for both integrators

8. Right click on the simulink model page  model configuration parameters  Refine
factor =10

9. Run the simulink model.

10. Open the scope to see the output.


SIMULINK DIAGRAM:
OUTPUT:

RESULT:
Ex. No.:- 3

Date:-

REAL TIME SIMULATION OF DIFFERENTIAL EQUATIONS

AIM:
To simulate the real time differential equation using MATLAB simulink.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open the simulink model.


2. Select the elements or components needed for designing.
3. Determine the input values.
V = 100 V ; R =1000 Ω ; C = 5e-3 ; ideal switch internal resistance = 0.001 , snubber
resistance = inf ; pulse generator  amplitude = 1 , period = 1000 , pulse width = 99 ,
phase delay = 1 ; real time simulation  sample time = 0.01 , max. missed tricks = 1000,
√ show missed tricks port , √ yield CPU when waiting.
Simulink library  knob  click on it and select DC voltage source in the simulink
diagram  connect.
4. Run the simulink model.
5. Open the scope to see the output
SIMULATION DIAGRAM:
OUTPUT:

RESULT:
Ex. No.:- 4(a)

Date:-

MATHEMATICAL MODELING AND SIMULATION OF MECHANICAL SYSTEMS

AIM:
To simulate the mathematical modeling and simulation of mechanical systems using
MATLAB simulation.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.

MECHANICAL MODEL:
MATLAB PROGRAM:

% mathematical modeling and simulation of mechanical systems

% Assume M1=4kg , M2=2kg , K1=20 N/m , K2=10 N/m , B=0.5

num=[10]

den=[8 1 100 5 200]

G=tf(num,den)

stepplot(G)
OUTPUT:
THEORETICAL CALCULATION:
RESULT:
Ex. No:- 4(b)

Date:-

MATHEMATICAL MODELING AND SIMULATION OF ELECTRICAL SYSTEMS

AIM:
To simulate the mathematical modeling and simulation of electrical systems using
MATLAB simulation.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.

ELECTRICAL MODEL:
MATLAB PROGRAM:

% mathematical modeling and simulation of electrical systems

% Assume R1=1 , R2=2 , C1=0.3 , C2=0.6

num=[1]

den=[0.36 2.1 1]

G=tf(num,den)

stepplot(G)
OUTPUT:
THEORETICAL CALCULATION:
RESULT:
Ex. No:- 5

Date:-

SYSTEM IDENTIFICATION THROUGH PROCESS REACTION CURVE (PID)

AIM:
To write the MATLAB program for system identification through process reaction curve
(Ziegler-Nichols method for tuning PID controller).

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  simulink  create blank model.


2. Select the elements needed for designing from simulink library.
3. Connect the elements using connecting lines.
4. Determine the input values for L, K, T from the process reaction curve
5. Run the model.
6. Open scope to see the output waveform.
7. The suggested values of Kp, Ti and Kd according Ziegler-Nichols method for such a
case are given in the Table
MATLAB PROGRAM:

% process reaction curve using PID tuning

% ziegler-nichols method

s=tf('s');

sys=1/[(s+10)*(s+20)];

figure(1);

step(sys);

% find the L,K,T from PRC

% L=step curve intersecting at starting with Line(time),

% K=max.value in the y axis, T= second intersecting point(time)-L

L=0.01;

K=5e-3;

T=0.22-L;

% calculate Kp,Ki,Kd from table

Kp=1.2*(T/L);

Ki=Kp/(2*L);

Kd=Kp*0.5*L;

PID_contoller=pid(Kp,Ki,Kd)

opensys=series(PID_contoller,sys);

closesys=feedback(opensys,1);

figure(2);

step(closesys)
OUTPUT:
Process Reaction Curve (PRC)

Opensys
Closesys

RESULT:
Ex. No.:-6(a)

Date:

STABILITY ANALYSIS USING POLE ZERO MAPS

AIM:

To design a system for the stability analysis using pole zero maps method in MATLAB
simulation.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Plot the pole-zero configuration in s-plane for the given transfer function

% G(s)= (5s^2 + 15s + 10)/(2s^4 + 7s^3 + 20s^2 + 24s)

num=[5 15 10]; %Numerator array of Transfer Function

den=[2 7 20 24 0]; %Denominator array of Transfer Function

Transfer_Function=tf(num,den) %Determining the Transfer Function

G=zpk(Transfer_Function) %Converts the Transfer Function into the format


showing in pole, zero and gain form

[z,p,k]=tf2zp(num,den) %Provides the values of Zeros(z), Poles(p) and Gain


constant for Transfer Function

[n1,d1]=zp2tf(z,p,k) %Provides the Numerator and Denominator arrays of Transfer


Function from the values of Zeros(z), Poles(p) and Gain constant

pzmap(num,den) %Plot the poles and zeros on s-plane

ltiview(G)
OUTPUT:

RESULT:
Expt. No.:-6(b)

Date :

STABILITY ANALYSIS USING ROUTH HURWITZ CRITERION

AIM:
To design a system for the stability analysis using Routh Hurwitz criterion method in
MATLAB simulation.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% perform stability analysis using Routh-Hurwitz criterion

clear all;

clc;

equation=[1 8 18 16 5]

l=length(equation);

m=mod(l,2);

if m==0

a=rand(1,(l/2));

b=rand(1,(l/2));

for i=1:(l/2)

a(i)=equation((2*i)-1);

b(i)=equation(2*i);

end

else e1=[equation 0];

a=rand(1,((l+1)/2));

b=[rand(1,((l-1)/2)),0];

for i=1:((l+1)/2)

a(i)=e1((2*i)-1);

b(i)=e1(2*i);

end

end
l1=length(a);

c=zeros(l,l1);

c(1,:)=a;

c(2,:)=b;

for m=3:l

for n=1:l1-1

c(m,n)=-(1/c(m-1,1))*det([c((m-2),1) c((m-2),(n+1),1);c((m-1),1) c((m-1),(n+1))]);

end

end

disp('the routh matrix:')

disp(c)

if c(:,1)>0

disp('System is Stable')

else

disp('System is Unstable')

end
OUTPUT:

RESULT:
Expt. No.:- 7

Date:-

ROOT LOCUS BASED ANALYSIS IN SIMULATION

AIM:
To write a MATLAB program and to draw the root locus for the open loop systems
given.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Root Locus : The open loop transfer function of a unity feedback system

% G(s)=K/s(s+1)(s+2) (Assume K=1)

% Rootlocus of the transfer function G(s)=1/(s+1)(s+2)

num=[1];

den=[1 3 2 0];

display('The given Transfer function is')

Gs=tf(num,den)

rlocus(num,den);

title('Root Locus for the transfer function G(s)=1/s(s+1)(s+2)')

grid on;
OUTPUT:

RESULT:
Ex. No.:- 8

Date:-
BODE PLOT BASED ANALYSIS IN SIMULATION

AIM:
To write a MATLAB program and to draw the bode plot for the open loop systems is
given by G(S)=1/S(S2+2S+3)

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

%Draw the Bode Plot for the given transfer functionG(S)=1/S(S2+2S+3)

%Find (i)Gain Margin (ii) Phase Margin (iii) Gain Cross over Frequency

%(iv) Phase Cross over Frequency (v)Resonant Peak (vi)Resonant

%Frequency (vii)Bandwidth

num=[1];

den=[1 2 3 0];

sys=tf(num,den)

w=logspace(-1,3,100);

title('Bode Plot for the given transfer function G(s)=1/s(s^2+2s+3)')

[Gm Pm Wcg Wcp] =margin(num,den)

Gain_Margin_dB=20*log10(Gm)

Phase_Margin=Pm

Gaincrossover_Frequency=Wcp

Phasecrossover_Frequency=Wcg

[Mp i]=max(M)

Resonant_PeakdB=20*log10(Mp)

bode(sys)

grid on;
OUTPUT:

RESULT:
Expt. No.:- 9(a)

Date:-
DESIGN OF LAG COMPENSATORS

AIM:
To write a MATLAB program for lag compensator and to draw the bode plot for the for
the unity feedback transfer function G(s) = K/s(s+1)(s+4)

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Design a Lag compensator for a TF that has Phase Margin ≥40 % b. The steady
state error for ramp input ≤ 0.2. Assume K=20
num=[20]

den=[1 5 4 0]

G=tf(num,den)

figure(1);

bode(G)

title('Bode plot for Lag uncompensated system G(s)=20/s(s+1)(s+4)')

grid on;

[Gm,Pm,Wcg,Wcp]=margin(num,den);

Gmdb=20*log10(Gm);

W=logspace(-1,1,100);

[mag,ph]=bode(G,W);

ph=reshape(ph,100,1);

mag=reshape(mag,100,1);

PM=-180+40+5

Wg=interp1(ph,W,PM);

beta=interp1(ph,mag,PM);

tau=8/Wg;

D=tf([tau 1],[beta*tau 1]);

Gc=D*G

figure(2);

bode(Gc)

title('Bode Plot for Lag compensated System G(s)=20/s(s+1)(s+4)')

grid on;

[Gm1,Pm1,Wcg1,Wcp1]=margin(Gc)
OUTPUT:

RESULT:
Ex. No.:- 9(b)

Date:-
DESIGN OF LEAD COMPENSATORS

AIM:
To write a MATLAB program for lead compensator and to draw the bode plot for the for
the unity feedback transfer function G(s) = K/s(s+2)

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Design a Phase Lead compensator for the unity feedback.

% transfer function G(s)=K/s(s+2) has specifications :

% a. Phase Margin>_ 20

% b. The steady state error for ramp input is less than or equal to 0.33.

% Assume K=5

num=[5]

den=[1 2 0]

G=tf(num,den)

figure(1);

bode(G)

title('Bode Plot for uncompensated system G(s)=5/s(s+2)')

grid on;

[Gm,Pm,Wcg,Wcp]=margin(num,den)

GmdB=20*log10(Gm);

w=logspace(-1,100,100);

[mag1,phase1]=bode(G,w);

PM=20-Pm+5

alpha=(1-sin(PM/180))/(1+sin(PM/180))

Gm=-20*log10(1/sqrt(alpha))

mag=20*log10(mag1);
magdB=reshape(mag,100,1);

Wm=interp1(magdB,w,(-20)*log10(1/sqrt(alpha)))

tau=1/(Wm*sqrt(alpha))

D=tf([tau 1],[alpha*tau 1])

Gc=D*G

figure(2);

bode(Gc)

title('Bode Plot for Lead Compensated System G(s)=5/s(s+2)')

grid on;

[Gm1,Pm1,Wcg1,Wcp1]=margin(Gc)
OUTPUT:

RESULT:
Ex. No.:- 10(a)

Date:-
DESIGN OF PID CONTROLLERS USING PROGRAM

AIM:
To write a MATLAB program for PID controllers.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Step response of open loop transfer function

num=[1]

den=[1 10 20]

G=tf(num,den)

step(G)

MATLAB PROGRAM:

% Proportional Controller

Kp=300

num=[Kp]

den=[1 10 20+Kp]

t=0:0.01:2;

G=tf(num,den)

step(G,t)
OUTPUT FOR STEP RESPONSE:

OUTPUT FOR PROPORTIONAL CONTROLLER:


MATLAB PROGRAM:

% Proportional Derivative Controller

Kp=300;

Kd=10;

num=[Kd Kp]

den=[1 10+Kd 20+Kp]

t=0:0.01:2;

G=tf(num,den)

step(G)

grid;

MATLAB PROGRAM:

% Proportional Integral Controller

Kpi=30;

Ki=70;

num=[Kpi Ki]

den=[1 10+Kd 20+Kpi Ki]

t=0:0.01:2;

G=tf(num,den)

step(G,t)

grid;
OUTPUT FOR PROPORTIONAL DERIVATIVE CONTROLLER:

OUTPUT FOR PROPORTIONAL INTEGRAL CONTROLLER:


MATLAB PROGRAM:

% Proportional Integral Derivative Controller

Kp=350;

Kd=50;

Ki=300;

num=[Kd Kp Ki]

den=[1 10 20+Kp Ki]

t=0:0.01:2;

G=tf(num,den)

step(G,t)

grid;
OUTPUT:

RESULT:

.
Ex. No.:- 10(b)

Date:-
DESIGN OF PID CONTROLLERS USING SIMULINK MODEL

AIM:
To design PID controllers using MATLAB simulink model.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  simulink  create blank model.


2. Select the elements needed for designing from simulink library.
3. Connect the elements using connecting lines.
4. Determine the input values:
P = 3 ; I = 0.5 , D = 0.5
5. Run the model.
6. Open scope to see the output waveform.
SIMULINK DIAGRAM:
OUTPUT:

For P Controller, P = 3

For PI Controller, P = 3 , I = 0.5


For PI Controller, P = 3 , D = 0.5

For PI Controller, P = 3 , I = 0.5 , D = 0.5


RESULT:
Ex. No.:- 11

Date:-
DISCRETIZATION OF CONTINUOUS SYSTEM AND EFFECT OF SAMPLING

AIM:
To write a MATLAB program for discretization of continuous system and effect of
sampling

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% discretization of continuous system and effect of sampling

% Define the continuous-time system (example)

A = [-1 1; -1 -1];

B = [0; 1];

C = [1 0];

D = 0;

Ts = 0.1; % Choose an appropriate sampling period

% Discretize the continuous-time system using zero-order hold (ZOH) method

sys_ct = ss(A, B, C, D);

sys_dt_zoh = c2d(sys_ct, Ts, 'zoh'); % Discretize using ZOH method

% Simulate the continuous-time system

t_ct = 0:Ts:5; % Time vector for continuous-time simulation

[y_ct, ~, x_ct] = lsim(sys_ct, zeros(size(t_ct)), t_ct); % Simulate with zero input

% Simulate the discrete-time system

t_dt = 0:Ts:5; % Time vector for discrete-time simulation

[y_dt, t_dt, x_dt] = lsim(sys_dt_zoh, zeros(size(t_dt)), t_dt); % Simulate with zero


input

% Plot continuous-time and discrete-time system responses

figure;

% Plot continuous-time system response

subplot(2, 1, 1);
plot(t_ct, y_ct, 'b-', 'LineWidth', 1.5);

title('Continuous-Time System Response');

xlabel('Time (s)');

ylabel('Output y(t)');

grid on;

% Plot discrete-time system response

subplot(2, 1, 2);

stem(t_dt, y_dt, 'r-', 'LineWidth', 1.5);

title('Discrete-Time System Response (Sampled)');

xlabel('Time (s)');

ylabel('Output y[n]');

grid on;

% Adjust subplot spacing

sgtitle('Comparison of Continuous-Time and Discrete-Time System Responses');


OUTPUT:

RESULT:
Ex. No.:- 12

Date:-
TEST OF CONTROLLABILITY AND OBSERVABILITY IN SIMULATION

AIM:
To write a MATLAB program to test the Controllability and Observability for the given
matrix.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Kalmans test for controllability and observability

% x* = Ax + Bu

% y = Cx + Du

% Controllability condition Q = [B AB A2B]

% Observability condition T=[CT ATCT (AT)2CT]

clear all

A=[0 0 1; -2 -3 0; 0 2 -3]

B=[0; 2; 0]

C=[1 0 0]

D=0

Q=[B,A*B,(A^2)*B]

t1=transpose(C);

t2=transpose(A);

T=[t1,t2*t1,((t2)^2)*t1]

if rank(Q)==3

disp('Controllable')

else

disp('Not controllable')

end

if rank(T)==3

disp('Observable')

else

disp('Not Observable')

end
OUTPUT:

RESULT:
Ex. No.:- 13

Date:-
STATE FEEDBACK AND STATE OBSERVER DESIGN

AIM:
To write a MATLAB program for state feedback and state observer of a close loop
system

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% state feedback of a close loop system

% Define the system matrices

A = [-1 0; 1 -2];

B = [1; 0];

C = [0 1];

desired_poles = [-1 -2]; % Desired eigenvalues for closed-loop system

K = place(A, B, desired_poles); % Compute state feedback gain K

% Define the closed-loop state-space system

A_cl = A - B*K;

B_cl = B;

C_cl = C;

D_cl = 0;

sys_cl = ss(A_cl, B_cl, C_cl, D_cl);

t = 0:0.01:5; % Simulate the response to an initial condition

x0 = [1; 1]; % Initial state

[y_cl, t_cl, x_cl] = initial(sys_cl, x0);

figure;

subplot(2, 1, 1);

plot(t_cl, y_cl);

title('Output response with State Feedback');

xlabel('Time');
ylabel('Output y(t)');

grid on;

subplot(2, 1, 2);

plot(t_cl, x_cl(:,1), 'b', t_cl, x_cl(:,2), 'r');

title('State response with State Feedback');

xlabel('Time');

ylabel('State x(t)');

legend('x1', 'x2');

grid on;
OUTPUT FOR STATE FEEDBACK:
MATLAB PROGRAM:

% state observer of a close loop system

% Define the system matrices

A = [-1 0; 1 -2];

B = [1; 0];

C = [0 1];

observer_poles = [-5, -6]; % Desired observer poles

L = place(A', C', observer_poles)'; % Compute observer gain L using pole placement


method

% Define the observer dynamics

A_obs = A - L*C;

B_obs = B;

C_obs = eye(size(A, 1)); % Output all states

D_obs = 0;

sys_obs = ss(A_obs, B_obs, C_obs, D_obs); % Define the observer state-space


system

t = 0:0.01:5; % Simulate the response to an initial condition

x0 = [1; 1]; % Initial state

u = 0; % No input for observer

observer_dynamics = @(t, x) A_obs*x + B_obs*u; % Function handle for observer


dynamics

[t_obs, x_obs] = ode45(observer_dynamics, t, x0); % Simulate using ode45 solver


y_obs = C*x_obs'; % Compute the estimated output

figure;

subplot(2, 1, 1);

plot(t_obs, y_obs);

title('Output estimation with State Observer');

xlabel('Time');

ylabel('Output y(t)');

grid on;

subplot(2, 1, 2);

plot(t_obs, x_obs(:, 1), 'b', t_obs, x_obs(:, 2), 'r');

title('State estimation with State Observer');

xlabel('Time');

ylabel('State x(t)');

legend('x1', 'x2');

grid on;
OUTPUT FOR STATE OBSERVER:

RESULT:
Ex. No.:- 14

Date:-
MINI PROJECT 1:

SIMULATION OF CLOSED LOOP CONTROL SYSTEMS INCLUDING SENSOR


AND ACTUATOR DYNAMICS

AIM:
To write a MATLAB program for closed loop control systems including sensor and
actuator dynamics

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% closed loop control systems including sensor and actuator dynamics

% Parameters of the system

M = 1; % Mass

D = 0.1; % Damping coefficient

K = 5; % Spring constant

G = tf(1, [M D K]); % Transfer function of the system

% PID controller gains

Kp = 100;

Ki = 10;

Kd = 20;

C = pid(Kp, Ki, Kd);

% Transfer function of the actuator dynamics

tau_a = 0.1; % Actuator time constant

G_a = tf(1, [tau_a 1]);

% Closed-loop system (including sensor and actuator dynamics)

T = feedback(C*G, G_a);

t = 0:0.01:5; % Simulation time

% Step input (desired position)

r = 1 * ones(size(t)); % Step command (desired position)

[y, ~] = lsim(T, r, t); % Simulate the closed-loop response

figure;
plot(t, r, 'k--', 'LineWidth', 1.5); % Desired position

hold on;

plot(t, y, 'b', 'LineWidth', 1.5); % Actual position

xlabel('Time (s)');

ylabel('Position');

title('Closed-Loop System including sensor and actuator');

legend('Desired Position', 'Actual Position');

grid on;
OUTPUT:

RESULT:
Ex. No.:- 15(a)

Date:-
MINI PROJECT 2:

DC POSITION CONTROL SYSTEM

AIM:
To study the operation of DC servomotor position control with PI controller using dc
positioncontrol trainer module (PEC01)

APPARATUS REQUIRED:

1. PEC 01 Module
2. Motor set up
3. Patch Chords
PRECAUTIONS:
1. Check whether power ON/OFF Switch is in OFF Condition
2. Check whether 230 V DC ON/OFF Switch is in OFF Condition

CONNECTION PROCEDURE:
1. Connect the terminal P1 to P6
2. Connect the motor actual position terminal P2 to P7
3. Connect the terminal P8 to P10 and P9 to P11
4. Connect the terminal P12 to P14 and P13 to P15
5. Dc output of P24 and P25 is connected to the input of PMDC motor

EXPERIMENTAL PROCEDURE

1. Connect the circuit as per circuit diagram


2. Set the pulse release switch in OFF position
3. Switch on the power supply
4. Vary the set position knob and set the motor position at any position
5. Select the SPDT switch in upward direction and note the input position in
the digital display
6. Select the SPDT switch in downward direction and note the output
position in the digital display
7. Tabulate the input and output position in the tabular column
FORMULA:

Error = Actual position – Set position


BLOCK DIAGRAM FOR DC POSITION CONTROL SYSTEM

TABULATION:

S.No Set Position Actual Position Error


MODEL GRAPH

RESULT:
Ex. No.:- 15(b)

Date:-
MINI PROJECT 2:

AC POSITION CONTROL SYSTEM


AIM:
To study the operation of AC servomotor position control with PI controller using PEC02
Module

APPARATUS REQUIRED:
1. PEC 02 Module
2. Motor set up
3. Patch Chords

BLOCK DIAGRAM

PRECAUTIONS:
1. Check whether power ON/OFF Switch is in OFF Condition
2. Check whether 230 V AC ON/OFF Switch is in OFF Condition

CONNECTION PROCEDURE:

1. Connect terminal P7 (Pulse input -1) to P3 ( pulse output) and P10 (Pulse
input -2) to P4 ( Pulse output)
2. Connect gate terminal P8 to P19 and P11 to P21
3. Connect MT (1) terminal P9 to P20 and MT (2) terminal P12 to P22
4. Connect terminals P23 to P24, P25 to P26 and P27 to P28
5. Connect terminal P15 to P17 and P16 to P18
6. Connect terminal P1 (SP input ) to P13 (SP output) and connect terminal
P2 (PV input) to P14 (PV output)
7. Connect servomotor to P31 by using serial cable
8. Connect the main winding of motor to 230 V AC supply through a PC
Power Chord

EXPERIMENTAL PROCEDURE

1. Check whether the connection are made as per circuit diagram


2. Switch ON the trainer kit
3. Switch ON the constant 230V AC main winding voltage to the servo
motor
4. Set the motor position using set position knob (Pot 1) and take the reading
for set position and actual position (by giving pulse Input) and tabulate the
reading
5. Repeat the same procedure step by step up to 340 deg.
6. For each step note down the set position and actual position and tabulate
it in table
FORMULA:

Error = Actual position – Set position

TABULATION

S.NO Set Position Actual Position Error


MODEL GRAPH

RESULT:
CONTENT BEYOND SYLLABUS
NYQUIST BASED ANALYSIS IN SIMULATION

AIM:
To write a MATLAB program and to draw the nyquist for the given open loop systems.

COMPONENTS REQUIRED:

S.No. Components Required Software Tool


1 Personal Computer (PC) MATLAB 22 b

PROCEDURE:

1. Open MATLAB  new  script.


2. Generate the transfer function.
3. Generate the corresponding formulas to get required function.
4. Plot the output.
5. Stop the program.
MATLAB PROGRAM:

% Nyquist plot for G(s)= 240/s(s+2)(s+10)

clear all

clc

s=tf('s');

disp('The given transfer function is');

Gs=240/(s*(s+2)*(s+10))

nyquist (Gs,'k');

axis([-4 0.5 -2 2]);

grid;
OUTPUT:

RESULT:

You might also like