S. Y. B.
Tech (ECE/EE)
S. Y. B. Tech Trimester: VI Subject: Control System
Name: Class:
Roll No: Batch:
Experiment No: 02
Name of the Experiment: To obtain transient response 2ND order system using
MATLAB
Marks Teacher’s Signature with date
Performed on:
Submitted on:
Aim: To obtain transient response 2ND order system using MATLAB
Prerequisite:
• knowledge of various types of signals
• Idea about software MATLAB
Objective:
• To understand the various orders of the system.
• To understand the response of the system when nature of input
signal is changing.
THEORY:
1. The time response has utmost importance for the design and analysis
of control systems because these are inherently time domain systems where
time is independent variable. During the analysis of response, the variation
www.mitwpu.edu.in
of output with respect to time can be studied and it is known as time
response.
To obtain satisfactory performance of the system with respect to time must
be within the specified limits. From time response analysis and
corresponding results, the stability of system, accuracy of system and
complete evaluation can be studied easily.
Due to the application of an excitation to a system, the response of the
system is known as time response and it is a function of time. The two parts
of response of any system:
(i) Transient response,
(ii) Steady-state response.
Transient response: The part of the time response which goes to zero after
large interval of time is known as transient response.
Steady state response: The part of response that means even after the
transients have died out is said to be steady state response.
The total response of a system is sum of transient response and steady state
response:
C(t)=Ctr(t)+Css(t)
Time Response Specification Parameters: The transfer function of a 2nd
order system is generally represented by the following transfer function:
G(s) = C(s)/R(s) = wn2/(s2+2ζwns+wn2)
The dynamic behaviour of the second-order system can then be described in
terms of two parameters: the damping ratio and the natural frequency.
If the dumping ratio is between 0 and 1, the system poles are complex
conjugates and lie in the left-half s plane.
The system is then called under damped, and the transient response is
oscillatory.
If the damping ratio is equal to 1 the system is called critically damped,
and when the damping ratio is larger than 1, we have over damped system.
www.mitwpu.edu.in
The transient response of critically damped and overdamped systems do not
oscillate. If the damping ratio is 0, the transient response does not die out.
Delay time (td) :The delay time is the time required for the response to
reach half the final value the very first time.
Rise time (tr):The rise time is the time required for the response to rise
from 10% to 90% of its final value. For under damped second-order systems,
the 0% to 100% rise time is normally used.
For over damped systems, the 10% to 90% rise time is commonly used.
Peak time (tp) : The peak time is the time required for the response to reach
the first peak of the overshoot.
Maximum (percent) overshoot (Mp)
The maximum overshoot is the maximum peak value of the response curve
measured from unity.
If the final steady-state value of the response differs from unity, then it is
common to use the maximum percent overshoot. It is defined by
Settling time (ts): The settling time is the time required for the response
curve to reach and stay within a range about the final value of size specified
by absolute percentage of the final value (usually 2% or 5%). The settling
time is related to the largest time constant of the control system
www.mitwpu.edu.in
2. Introduction: In practice the time response curves of systems higher
than second order is through computer simulation. This experiment
shows us the computational approach to the transient-response with
MATLAB. In particular step response discussed in detail.
3. MATLAB Representation of Linear systems: The transfer function of a
system is represented by two arrays of numbers. Consider the system
G(s) = C(s)/R(s) = wn2/(s2+2ζwns+wn2)
This system can be represented as two arrays, each containing the
coefficients of the polynomials in decreasing powers of s as follows:
Num=[wn2]
Den=[1 2*ζ*wn wn2]
An alternative representation is
Num=[0 0 wn2]
Den=[1 2*ζ*wn wn2]
In this expression zeros is padded, this is to make the dimensions of the
numerator and denominator vector (ie.num and den respectively) the same.
4. Obtaining the unit-step response of the transfer-Function using
MATLAB: By knowing the numerator and denominator of the closed
loop transfer function, commands such as step(num,den),
step(num,den,t) can be used to generate the unit-step response. t in the
step command is the user specified time. Using the step response with
left hand side arguments, the X axis and Y axis labels can be given to
the response curves.
www.mitwpu.edu.in
5. Obtaining the unit-ramp response of the transfer-Function using
MATLAB: As there is no ramp command in MATLAB, We need to use the
step command for the transfer function G(s) = G(s)/s.
C(s) = G(s)*R(s) = (G(s)/s)
To obtain the unit-ramp response, enter the numerator and denominator of
the transfer function G(s) and then use the step function in MATLAB.
6. MATLAB programs
a. To obtain the unit-step response:
clc;
clear all ; zeta=0:0.25:1; % Different values of
zeta is taken for i=1:5 num=1; den=[1 2*zeta(i)
1]; a=tf(num,den); step(a); hold on; end axis([-
1 50 -0.5 2]); grid on; xlabel('Time');
ylabel('Response');
PROCEDURE:
1) Write down program in Editor window.
2) Run the program for unit-step input (a) .
3) Observe the wave form as the value of ‘zeta’ is changing.
4) See the plot on the x-y axis .
CALCULATIONS:
www.mitwpu.edu.in
For the underdamped cases (ζ < 1.0), calculate the theoretical values of delay
time, rise time, peak time, maximum overshoot and settling time using the
following Formulae: take value of ꟺn is 1.
Where 1
T=
n
ꟺd = ꟺn√1-ζ2
Compare the values obtained from the program with the above theoretical
values.
8. CONCLUSIONS:
Post lab questions:
1) Find out the response for the same system with Simulink 2) What
are the various performance parameters in 2nd order system?
www.mitwpu.edu.in
3) What are various types of the systems?
4) What are the various ways of analyzing the system on
MATLAB?
Simulink for second order system :- https://youtu.be/8Ta7khDsqlA
www.mitwpu.edu.in
clc;
clear all;
zeta = 0:0.25:1; % Different values of zeta are taken
wn = 1; % Natural frequency (as per the document)
% Pre-allocate arrays to store results
td = zeros(1, length(zeta));
tr = zeros(1, length(zeta));
tp = zeros(1, length(zeta));
ts = zeros(1, length(zeta));
for i = 1:length(zeta)
num = wn^2; % Numerator
den = [1 2*zeta(i)*wn wn^2]; % Denominator
a = tf(num, den); % Transfer function
% Plot step response
step(a);
hold on;
% Calculating parameters
wd = wn * sqrt(1 - zeta(i)^2); % Damped natural frequency
if zeta(i) < 1 % For underdamped systems
td(i) = 1 / (zeta(i) * wn); % Delay time
tr(i) = (pi - atan(sqrt(1 - zeta(i)^2) / zeta(i))) / wd; % Rise time
tp(i) = pi / wd; % Peak time
ts(i) = 4 / (zeta(i) * wn); % Settling time (for 2% criterion)
else % For critically and overdamped systems
td(i) = NaN; % Delay time is not defined
tr(i) = NaN; % Rise time is not defined
tp(i) = NaN; % Peak time is not defined
ts(i) = 4 / (zeta(i) * wn); % Settling time (approximation)
end
www.mitwpu.edu.in
end
% Configure plot
axis([-1 50 -0.5 2]);
grid on;
xlabel('Time');
ylabel('Response');
legend('Zeta = 0', 'Zeta = 0.25', 'Zeta = 0.5', 'Zeta = 0.75', 'Zeta = 1');
% Display calculated values
disp('Performance Parameters:');
disp(table(zeta', td', tr', tp', ts', 'VariableNames', {'Zeta', 'DelayTime_td',
'RiseTime_tr', 'PeakTime_tp', 'SettlingTime_ts'}));
www.mitwpu.edu.in
www.mitwpu.edu.in