CS Lab Record
CS Lab Record
19EEE211
CONTROL SYSTEMS LAB RECORD
Submitted By:
A. Navya Santhoshi
CB.EN.U4EEE19004
1
Expt-1
30/12/21
CB.EN.U4EEE19004
EXPERIMENT 1
DESIGN CONTROLLER TO IMPROVE TRANSIENT RESPONSE
AIM
To design a controller to improve the transient response, settling time of a given plant
THEORY
Draw the root locus of the given plant and obtain the settling time represented by point A.
Objective is to have desired transient response, defined by percent overshoot and settling
time, as represented by point B. Thus, our goal is to speed up the response at A to that of B,
without affecting the percent overshoot. This increase in speed cannot be accomplished by a
simple gain adjustment since point B does not lie on the root locus. The faster response has
the same percent overshoot as the slower response. One way to solve is to replace the
existing system with a system whose root locus intersects the desired design point, B.
Unfortunately, this replacement is expensive and counterproductive. Most systems are
chosen for characteristics other than transient response. For example, an elevator cage and
motor are chosen for speed and power. Components chosen for their transient response may
not necessarily meet, for example, power requirements.
Rather than change the existing system, we augment, or compensate, the system with
additional poles and zeros, so that the compensated system has a root locus that goes through
the desired pole location for some value of gain. One of the advantages of compensating a
system in this way is that additional poles and zeros can be added at the low-power end of the
system before the plant. Addition of compensating poles and zeros need not interfere with the
power output requirements of the system or present additional load or design problems. The
compensating poles and zeros can be generated with a passive or an active network.
Figure 1. a. Sample root locus, showing existing response of plant (A) and desired transient
response (B); b. responses from poles at A and B
Proportional Derivative (PD) controller. If the closed-loop pole location is not on the root
locus, then the root locus must be reshaped so that the compensated (new) root locus goes
through the selected closed-loop pole location. This can be achieved by a compensator whose
transfer function is Gc(s) = s + zc. With ideal derivative compensation, a pure differentiator
is added to the forward path of the feedback control system. We will see that the result of
adding differentiation is the addition of a zero to the forward-path transfer function. This type
3
of compensation requires an active network for its realization. Further, differentiation is a
noisy process; although the level of the noise is low, the frequency of the noise is high
compared to the signal. Thus, differentiating high frequency noise yields a large, unwanted
signal.
MATLAB FUNCTIONS
TF, FEEDBACK, RLOCUS, STEP, PLOT, SUBPLOT
PROCEDURE
Part A
25+𝐾
For a given plant 𝐺(𝑠) = , (where K is your date of birth {1,31}). Add
(𝑠+1)(𝑠+2)(𝑠+5)
zeros at -1, -5 and -9 separately. Compute closed loop Unit step response in each case and plot
in same figure. Use subplot to plot the root locus of uncompensated and 3 different cases.
4
From the plot, generate the following table. Write your inference
Name:
Objective: To design a controller to improve the transient response, settling time of a given plant
Inputs: Poles and zeroes of gain function, Feedback
Outputs: Transfer Function, Root Locus, Step Response
CODE:
clc;
close all;
clear all;
num=[0,0,54]; %zeroes%
den=[1,8,17,10]; %poles%
A = tf(num,den); %transfer function of 'A'%
H=feedback(A,1);
figure(1)
rlocus(A); %Root Locus of 'A'%
figure(2)
step(H);%Step Response of 'A'
figure(4)
step(H1);%Step Response of 'B'
figure(6)
step(H2); %Step Response of 'C'%
figure(8)
step(H3);%Step Response of 'D'%
Uncompensated System:
System for Zero At -1:
System for Zero at -5:
System for Zero at -9:
Part B
43.35
Ideal Derivative Compensator design of given plant 𝐺(𝑠) =
. Reduce the
𝑠(𝑠+4)(𝑠+6)
settling time to 1/3rd
Step 1: Compute the peak overshoot (os) of given plant, uncompensated from unit step
2
𝑒 −𝜋𝜁 ⁄√1−𝜁
Step 2: Draw the root locus of uncompensated plant and draw damping ratio line. Determine
the dominant poles (−𝜁𝜔𝑛 ± 𝑗𝜔𝑛√1 − 𝜁2) from the intersection point. Sample plot is shown
below
Step 5: Compute the imaginary part of dominant poles of compensated system. Sample plot is
shown below
Step 6: The sum of the angles to the desired dominant pole by the poles and zeros of the plant and
the compensator zero must be multiple of 180. Hence, the angular contribution required from the
compensator zero for the desired dominant pole to be on the new root locus is +275.6°
−180° = 95.6°.
Step 7: From the figure, (6.193-0)/(3.613-σ) = tan (180° − 95.6°). Thus, location of
compensator zero is σ = 3.006. The complete root locus for the compensated system is shown
below.
Step 8: Draw the Unit step response for both compensated and uncompensated systems.
Sample plot is shown below
clc
clear all;
close all;
sys=tf([0 0 43.35],[1 10 24 0]);
H=feedback(sys,1);
figure(1)
rlocus(sys);%rootlocus of sys
hold on
x=0:-0.01:-2;
y=x*tan(59);
plot(x,y)
figure(2)
step(H); %step response of sys%
Tds: 1.156s
Wn (New): 6.71
New Dominant Pole: -3.46± j5.751
INFERENCE:
Code 5
Inference 10
Submission Date:
Teacher’s Signature:
Expt No: 2
THEORY
An open-loop pole will be placed at the origin to increase the system type and drive the
steady state error to zero. An open-loop zero will be placed very close to the open-loop pole
at the origin so that the original closed-loop poles on the original root locus still remain at
approximately the same points on the compensated root locus
Proportional Integral (PI) controller. The pole and the zero of the compensator are placed
very close together so that the original root locus remains unchanged. This can be achieved
by a
𝑠 + 𝑧𝑐
compensator whose transfer function is Gc(s) = .
𝑆
PROCEDURE
Part A
1
For a given plant 𝐺 (𝑠 ) = , place PI with different values for zero z c.
(𝑠+1)(𝑠+2)(𝑠+10)
Compute closed loop Unit step response in each case. Sample outcome is given below
1
From the plots, generate the following table. Write your inference
CODE
Code must be in Courier New font
Every code, in every lab henceforth must have the prelude as
follows
Name: Step response for varying Zc
Objective: To compute closed loop Unit step response
for different values for zero zc
1
Inputs: Transfer Function 𝐺 (𝑠 ) =
(𝑠+1)(𝑠+2)(𝑠+10)
Outputs: Graphs for step function
clc;
clear all;
close all;
sys = tf([1],[1 13 32 20]); %uncompensated transfer function
H = feedback(sys,1)
sys1 = tf([1 0.1],[1 13 32 20]); % Zc = -0.1
H1 = feedback(sys1,1)
sys2 = tf([1 1],[1 13 32 20]); % Zc = -1
H2 = feedback(sys2,1)
sys3 = tf([1 10],[1 13 32 20]); % Zc = -10
H3 = feedback(sys3,1)
figure(1)
step(H,H1,H2,H3) % step function
Step Response for Uncompensated vs Compensated with Zc = -0.1
Step 1: plot root locus (sample in fig 1) of the uncompensated system and determine the
location of the dominant, second-order poles. assuming the system is operating with a
damping ratio of 0.174.
Step 4: The improvement in 𝐾𝑝𝑜𝑙𝑑 of the uncompensated system to the compensated system is
𝐾𝑜𝑙𝑑
the required ratio of the compensator zero to the compensator pole. 𝑐 𝑍= 𝑝
𝑛𝑒𝑤
𝑝𝑐 𝐾𝑝
Arbitrarily choose pole very close to origin e.g., pc = -0.01 and compute zero of the
compensator zc from the above equation. These values of the pole and zero constitute the lag
compensator that produce the necessary increase in the particular error coefficient
Uncompensated :
Compensated:
INFERENCE
Steady-state error the difference between the input (command) and the output of a system
Steady-state error is defined as the difference between the input 11 (command) and the
output of a system it depends upon the type of input. Steady-state error can be calculated
from the open- or closed-loop transfer function for unity feedback systems.
control system specifications can be improved by changing the static gain K. large gains
can damage the system.
One desired operating point is considered for the system dominant poles, this point do not
lie on the original root locus.
steady state errors can be improved by increasing the type of feedback control system,i.e; ,
by adding a pole at the origin to the closed-loop system transfer function.
The root locus is practically unchanged, the system transient response remains the same
Code 5
Inference 10
Teacher’s Signature:
Experiment 3
PID CONTROLLER TUNING USING ZIEGLER NICHOL’S METHOD
AIM
To determine the PID controller gain values of a given plant using Ziegler Nichol’s
method.
THEORY:
More than half of the industrial controllers in use today utilize PID controllers. If a
mathematical model of the plant is available, Ziegler Nichols (ZN) method can be used to
obtain initial values of PID controller. Fine tuning the proportional (P), integral (I) and
differential (D) gain values can further enhance the system’s transient and steady state
response. We focus on ZN second-method of tuning rule.
Step 1: The integral and differential gains are set to zero. Use only proportional controller Kp
Step 2: The proportional gain is increased from 0 to Ku until the system is marginally stable
i.e., the output exhibits sustained oscillations. (Otherwise, this method will not work). The
time period of oscillation is Tu.
KP KI KD
P controller 0.5 Ku 0 0
PI controller 0.45 Ku Tu/1.2 0
PID controller 0.6 Ku Tu/2 Tu/8
PROCEDURE
1
Step 1: Consider the plant 𝐺 (𝑠 ) =
𝑠(𝑠+1)(𝑠+5)
Step 2: With P controller having gain Kp, the closed loop transfer function is
𝐶(𝑠)
= 𝐾𝑝
𝑅(𝑠) 𝑠(𝑠+1)(𝑠+5) 𝐾𝑝
𝐾𝑝 = 𝑠(𝑠+1)(𝑠+5)+𝐾
1+ 𝑝
𝑠(𝑠+1)(𝑠+5)
Step 3: We will use Routh’s stability criterion to find Ku until the system is marginally stable.
𝑠3 1 5
𝑠2 6 𝐾𝑝
𝑠1 30 −
𝐾𝑝
6
𝑠0 𝐾𝑝
Step 5: Examining the first column of the Routh Table, we notice that sustained oscillation will
Step 6: Substituting this value in the characteristic equation as obtained in step 2, we get
−𝑤3 + 5𝑤 = 0 ⇒ 𝑤(−𝑤2 + 5) = 0 ⇒ 𝑤 = 0 𝑜𝑟 𝑤 =
√5
2
−6𝑤2 + 30 = 0 ⇒ 𝑤 = √5
Step 7: Compute
2𝜋 the time
period 𝑤 = i.e., 𝑇 2𝜋 2𝜋
= 𝑢
=
𝑇𝑢 𝑤 √5
Step 8: Use Table to compute P, I and D gain values.
Step 9: Check step response and steady state response. Fine tune them according to previous
experiments conducted. Write your Inference.
CODE:
clc;
close all;
clear all;
num=[0,0,1]; %zeroes%
den=[1,6,5,0]; %poles%
B= tf(num,den);
H6=feedback(B,1);
figure(1)
step(H6);%Step Response of 'A'
num1=[0,0,30]; %zeroes%
den1=[1,6,5,0]; %poles%
L = tf(num1,den1);
H1=feedback(L,1);
figure(2)
step(H1);%Step Response of 'B'
num2=[0,0,15]; %zeroes%
den2=[1]; %poles%
P = tf(num2,den2);
H2=feedback(P,1);
figure(3)
step(H2);%Step Response of 'P'
num3=[0,13.5,2.33]; %zeroes%
den3=[1,0]; %poles%
PI = tf(num3,den3);
H3=feedback(PI,1);
figure(4)
step(H3);%Step Response of 'PI'
num4=[6.3,18,12.85]; %zeroes%
den4=[1,6,5,0,0]; %poles%
PID = tf(num4,den4);
H4=feedback(PID,1);
figure(5)
step(H4);%Step Response of 'PID'
Pure plant:
Marginal Stability:
P Controller:
PI Controller:
PID Controller:
INFERENCE:
method for tuning P, PI, and PID controllers is the Ziegler–Nichols method
This method starts by zeroing the integral and differential gains and then raising the
proportional gain until the system is unstable
The value of KP at the point of instability is called KMAX
the method then backs off the proportional gain a predetermined amount and sets the
integral and differential gains as a function of f0
The Ziegler-Nichols tuning rule is meant to give your PID loops best disturbance rejection
performance.
PID controllers are implemented primarily for the purpose of holding measured process
value at a set-point, or desired value.
•Gain at which system produces constant oscillations is called ultimate gain and the period of
oscillations is called the ultimate period.•In this experiment the ultimate gain is 30 where the
system produces constant oscillations and when is gain above or below 30 then the system is
unstable.
Code 5
Inference 10
Submission Date:
Teacher’s Signature:
3
Experiment 4
TRANSIENT RESPONSE DESIGN IN FREQUENCY DOMAIN
AIM
To obtain desired peak overshoot using gain adjustment using frequency response.
THEORY:
In the steady state, sinusoidal inputs to a linear system generate sinusoidal responses of the same frequency.
Even though these responses are of the same frequency as the input, they differ in amplitude and phase angle
from the input. These differences are functions of frequency.
Sinusoids can be represented as complex numbers called phasors. The magnitude of the complex
number is the amplitude of the sinusoid, and the angle of the complex number is the phase angle of the sinusoid.
Let the input and output sinusoids be represented by complex numbers, or phasors, Mi(ω)∠ϕi(ω) and
Mo(ω)∠ϕo(ω), respectively. Assume that the system is represented by the complex number, M(ω)∠ϕ(ω). The
output steady-state sinusoid is found by multiplying the complex number representation of the input by the
complex number representation of the system.
Mo (ω)∠ϕo (ω) = Mi (ω)M (ω)∠[ϕi (ω) + ϕ (ω)]
We call M(ω) the magnitude frequency response and ϕ(ω) the phase frequency response. The
combination of the magnitude and phase frequency responses is called the frequency response and is M(ω) ∠
ϕ(ω).
The phase margin is found using the magnitude curve to find the frequency, ω ΦM, where the gain is 0
dB. On the phase curve at that frequency, the phase margin, Φ M, is the difference between the phase value and
180°. The gain margin is found using the phase plot to find the frequency, ω GM, where the phase angle is 180°.
At this frequency, we look at the magnitude plot to determine the gain margin, G M, which is the gain required to
raise the magnitude curve to 0 dB.
Figure 1 Gain and phase margins on the Bode diagrams
If we can vary the phase margin, we can vary the percent overshoot. As shown in Fig. 2, we see that if we desire
a phase margin, ΦM, represented by CD, we would have to raise the magnitude curve by AB. Thus, a simple
gain adjustment can be used to design phase margin and, hence, percent overshoot.
Figure 2. Bode plots showing gain adjustment for a desired phase margin
PROCEDURE
100 K
Step 1: Consider the plant G ( s )= with K = 3.6
s ( s+100)(s +36)
Step 2: Obtain the Bode plots to obtain the gain margin and phase margin of the current plant. Use MATLAB
function margin
−ln ( %OS/100 )
Step 3: Desired peak overshoot is, say 9.5%. Using ζ = the damping ratio, ζ for the
√ π 2 +ln2 ( %OS/100 )
closed-loop dominant poles.
Step 4: Compute the corresponding phase margin as follows
2ζ
Φ M =tan −1
√−2 ζ +√ 1+4 ζ
2 4
Or Φ M =100 ζ
Step 4: Locate on the phase plot the frequency that yields a Φ M phase margin. This frequency is found where
the phase angle is the difference between −180° and Φ M . The value of the phase-margin frequency is ω rad/s.
Step 5: At a frequency of ω rad/s on the magnitude plot, the gain is found to be G dB. This magnitude has to be
raised to 0 dB to yield the required phase margin. Since the log-magnitude plot was drawn for K = 3.6, a G dB
G
increase, or K = 3.6 × K =3.6× 10 20 , would yield the required phase margin for 9.5% overshoot.
new
Step 6: Obtain the new Bode plots with K = Knew. Using the new phase margin, compute the new damping ratio
and the new overshoot. Write your inference.
Name:
Objective:
Inputs:
Outputs:
CODE
clc;
clear all;
close all;
num= [100];
den=[1,136,3600,0];
G1= tf(num,den);
figure(1)
bode(G1);
margin(G1);
num1= [1000];
den1=[1,136,3600,0];
G2= tf(num1,den1);
figure(2)
bode(G2);
margin(G2);
num2= [10000];
den2=[1,136,3600,0];
G3= tf(num2,den2);
figure(3)
bode(G3);
margin(G3);
num3= [360];
den3=[1,136,3600,0];
A= tf(num3,den3);
figure(4)
bode(A);
margin(A);
num4= [59500];
den4=[1,136,3600,0];
B= tf(num4,den4);
figure(5)
bode(B);
margin(B);
For K= 1
For K=10
K=100
K=3.6
New Gain Bode Plot:
INFERENCE:
The Bode phase plot (expressing the phase shift in degrees).The greater the Gain
Margin (GM), the greater the stability of the system.
The gain margin refers to the amount of gain, which can be increased or decreased
without making the system unstable. It is usually expressed as a magnitude in dB.
The vertical distance between the magnitude curve and the x-axis at the frequency
where the Bode phase plot = 180°. This point is known as the phase cross-over
frequency.
The greater the Phase Margin (PM), the greater will be the stability of the system.
The phase margin refers to the amount of phase, which can be increased or decreased
without making the system unstable. It is usually expressed as a phase in degrees.
The phase margin refers to the amount of phase, which can be increased or decreased
without making the system unstable. It is usually expressed as a phase in degrees.
Code 5
Inference 10
Submission Date:
Teacher’s Signature:
Exp No.:5 Date: 07-01-2022
MODELING AND ANALYSIS OF CONTROL SYSTEMS IN LABVIEW
AIM:
To develop transfer function and state space models and analyze the step response in time and
frequency domain.
SOFTWARE:
LABVIEW
PROBLEM:
Develop the transfer function model to represent the system given by
2 s+ 5
Cs ¿ ¿ = 2 and perform time and frequency response analysis for step input.
R(s) s +4 s+ 3
Develop a model to determine the transfer function model from state space
representation for the system given by the following state space model
ẋ1 = −3 1 x 1 + 1 u
[][
ẋ1 ][ ] [ ]
0 −1 x 2 1
Y = [1 1] x1
[]
x2
PROCEDURE:
1. Select suitable blocks to develop transfer function and state space models of control system.
2. Include necessary blocks to analyze system response for step input in time and frequency
domain.
BLOCK DIAGRAM:
OUT
PUT:
INFERENCE:
Design of control system means finding the mathematical model when we know the input and the
output.
The control systems can be represented with a set of mathematical equations known as
mathematical model. These models are useful for analysis and design of control systems. Analysis of
control system means finding the output when we know the input and mathematical mod
RESULT:
The transfer function and state space models of control system is developed and the step response
is analyzed in time and frequency domains.
Code 5
Inference 10
Submission Date:
Teacher’s Signature: