0% found this document useful (0 votes)
26 views26 pages

Labrepo

The document describes modeling and simulating the time response of first order systems in MATLAB. It defines the transfer function of a first order system and discusses its time constant. The code simulates three first order systems with different time constants using step, impulse, ramp and parabolic inputs and plots the output responses.

Uploaded by

sujantomar82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views26 pages

Labrepo

The document describes modeling and simulating the time response of first order systems in MATLAB. It defines the transfer function of a first order system and discusses its time constant. The code simulates three first order systems with different time constants using step, impulse, ramp and parabolic inputs and plots the output responses.

Uploaded by

sujantomar82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Lab Report

Control Systems
ECC 402

BACHELOR OF TECHNOLOGY
ELECTRONICS & COMMUNICATION ENGINEERING

By
Sujan singh 22253

SCHOOL OF ELECTRONICS
INDIAN INSTITUTE OF INFORMATION TECHNOLOGY, UNA
HIMACHAL PRADESH
2024

School of Electronics, IIITU 1


TABLE OF CONTENTS
S No Name of Experiment Page no.
1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

17.

18.

School of Electronics, IIITU 2


Experiment No.1

Aim of the Experiment:


Dynamic modeling of a mass spring damper system using MATLAB and Simulink.

Software:
MATLAB and Simulink

Background:
A mass-spring-damper system, also known as a harmonic oscillator, is a common mechanical system
used to model various physical phenomena such as vibrations, oscillations, and mechanical structures
subject to external forces.

Figure 1: Schematic diagram of a Mass spring damper system

The general form of the equation of motion for a mass-spring-damper system is:

Where:

• m is the mass of the object.


• x is the displacement of the mass from its equilibrium position.
• t is time.
• c is the damping coefficient.
• k is the spring constant.
F(t) represents any external forces acting on the system.Applications:

School of Electronics, IIITU 3


In control systems, mass damper systems are employed to stabilize structures prone to vibrations
or oscillations. By counteracting unwanted motion, they enhance control system performance,
ensuring smoother operation and reducing structural fatigue. Applications include aerospace
vehicles, industrial machinery, and precision instruments, optimizing stability and functionality.
Characteristics of MSD Systems:
1. Resonance Control: Mass-spring-damper systems mitigate resonance, preventing
excessive oscillations by utilizing damping forces.
2. Dynamic Stability: Balancing inertia, spring stiffness, and damping, the system maintains
stability under varying conditions.

3. Energy Dissipation: Damping dissipates energy, reducing oscillation amplitudes and


preventing prolonged vibrations in mechanical and structural systems.

Impact of Damping and Spring Constant:


Increasing the damping ratio reduces both the displacement amplitude and oscillation frequency.
Conversely, raising the spring constant enhances the system's natural frequency.
Table 1: Various parameters of the MSD system
Parameter Symbol Value

Mass M 0.25 Kg

Damping Coefficient B, B1,B2 0, 0.9, 2 N s/m

Spring Coefficient K 1 N/m

Procedure:
1. Design the model using MATLAB Simulink as shown in Figure 2.
2. Make three subsystems of the model designed above as shown in Figure 3, with three different values of
damping constant (B, B1, B2).
3. Put the above specified values in the command window.
4. Run and obtain the required plots i.e. displacement in x-direction w.r.t time.

School of Electronics, IIITU 4


Figure 2: Simulink Model of the Spring Mass Damper System

Figure 3: Simulink model for three different subsystems

Result and Discussion:

Figure 3: Graph between Displacement and time


School of Electronics, IIITU 5
A network of springs and dampers connects discrete mass nodes that are dispersed across an object
according to the mass-spring-damper paradigm. Modeling objects with intricate material
characteristics like viscoelasticity and nonlinearity is well suited for this approach.

Conclusion:
Thus, using the Simulink and the mathematical model of Spring Mass Damper System, plot between
displacement in x-direction w.r.t time can be evaluated. And also we got relation betweendamping
coefficient and system oscillation means if we increases the damping coefficient then itsdecreases
the system oscillations.

School of Electronics, IIITU 6


Experiment No.2

Aim of the Experiment:


Dynamic modeling of a speed control of a Dc motor using MATLAB and Simulink.

Software:
MATLAB and Simulink

Background:
DC motors, utilizing pre-existing power infrastructure and operating on direct current, are easily
manageable. Their speed is regulated by the flow of current through the wiring, directly impacting
their performance. Functioning by converting DC power into mechanical energy, these motors
require a conductor carrying current to interact with a magnetic field, resulting in mechanical force
as per Fleming's left-hand rule.
DC motor systems find extensive applications across various real-world scenarios such as vacuum
cleaners, traction systems, sewing machines, cranes, and robots. They excel in providing high
starting torque, variable speed, and efficiency, particularly in air compression tasks.

These motors are typically characterized as an amalgamation of electrical and mechanical systems,
with parameters including armature resistance, armature inductance, back EMF constant, torque
constant, and friction coefficient.

A second-order differential equation can be derived to model the dynamics of a DC motor speed
control system. The equation relates the speed of the motor to the applied voltage and the
mechanical parameters of the motor. The equation is given as follows:

School of Electronics, IIITU 7


Table 1: Various parameters of dc motor

Parameters Symbol Values


Moment of inertia of the rotor J 0.01 Kg.m2
Motor viscous friction b 0.1 N.m.s
constant
Electromotive force constant Ke 0.01 V/rad/sec
Motor torque constant Kt 0.01 N.m/Amp
Electric resistance R 1 ohm
Electric inductance L 0.5 H

Procedure:
1. Design the model using MATLAB Simulink as shown in Figure 1.
2. Put the above specified values in the command window.
3. Run and obtain the required plots for Number of rotations w.r.t time.

School of Electronics, IIITU 8


Figure 1: Simulink Model of DC motor speed control system

Result and Discussion:

Figure 2: Graph between angular angle v/s time for DC system and signal builder

School of Electronics, IIITU 9


Conclusion:

The relation between Current and damping coefficient is that if we increase the damping coefficient
then the current decreases. And when the damping coefficient is b = 0 then also currentis increasing.
Also the angle vs time graph always remains constant in every case.

School of Electronics, IIITU 10


Experiment 3
Aim of the Experiment:
Study the time response of 1st order systems with standard test signals.

Software:
MATLAB

Background:
The time response of the system is defined as the output of the system obtained by providing specific
input to the system, where both input and output must be the function of time. Time response of the
system provides an idea about the variation in output when a certain input is provided with respect to
time.
The time response of the system is combination of steady-state response and transient response.
The transient response is the part of the output which tends to zero as time tends to infinity and the
remaining part of the output represents steady state response.

Transfer function of a first order system is given as G(S)=1/sc+1


Where, Ƭ is the time constant. The time constant represents the time required for the system to
attain 63.2% of its steady-state value.

Procedure:
1. Write a MATLAB code for a 1st order system with different values of Ƭ.
2. Make three systems with time constant as Ƭ, Ƭ/2 and 2Ƭ.
3. Plot all the systems with different standard input signals such as impulse signal, step signal,
ramp signal and parabolic signal.

MATLAB Code:
tau=25;
sys=tf(1,[tau 1]);
tau2=44;
sys1=tf(1,[tau2 1]);
tau3=40;
sys2=tf(1,[tau3 1]);
s=tf("s");

%step response
step(sys, sys1, sys2)
title("Step Response")
legend("sys","sys2","sys3")
figure()

School of Electronics, IIITU 11


%impulse response
step(s*sys, s*sys1, s*sys2);
title("Impulse Response")
legend("sys","sys1","sys2")
figure()

%ramp response
step(sys/s, sys1/s, sys2/s);
title("Ramp Response")
legend("sys","sys2","sys3")
figure()

%parabolic response
step(1/(s^2), sys/(s^2), sys1/(s^2), sys2/(s^2), 30);
title("Parabolic Response")
legend("sys","sys1","sys2","1/s^2")
figure ()
Result and Discussion:

Figure 1: Graphs of step response for sys_1, sys_2 and sys_3

School of Electronics, IIITU 12


Figure 2: Graph of impulse response for sys, sys1, sys2

Figure 3: Graph of ramp response for sys, sys1, sys2

School of Electronics, IIITU 13


Figure 4: Graph of parabolic response for sys, sys1, sys2 and 1/s^2

Conclusion:

With the help of MATLAB for different systems and different standard signals (like Unit step,
Impulse response, unit ramp, parabolic response) we get the graphs.

School of Electronics, IIITU 14


Experiment 4
Aim of the experiment:
Study the time domain performance parameters of the 1st order systems.

Software:
MATLAB

Background:
In control systems, the time-domain performance of first-order systems refers to how these systems
behave over time. These systems are characterized by a single pole in their transfer function, resulting in
an exponential response to a step input.

Transfer function of 1st order system is G(s)=1/sc+1

Where, Ƭ is the time constant. The time constant represents the time required for the system to attain
63.2% of its steady-state value.
First-order systems exhibit exponential decay or growth in their response to a step input.
The key parameters that describe the time-domain performance of first-order systems include rise
time, settling time, overshoot, and steady-state error.
Rise time is the time taken for the system's response to rise from 10% to 90% of its final value.
Settling time is the time required for the system's response to reach and remain within a specified
percentage (usually 5%) of its final value.
Overshoot represents the maximum percentage by which the response exceeds its final value
before settling.
Steady-state error refers to the difference between the desired and actual output values once the
system has reached a steady-state condition.

Procedure:
1. Write a MATLAB code for a 1st order system with different values of Ƭ.
2. Make three systems with time constant as Ƭ, Ƭ/2 and 2Ƭ, where Ƭ is last two digits of your
roll number i.e.22.
3. Plot all the systems with different standard input signals such as impulse signal, step
signal,ramp signal and parabolic signal and also calculate various parameters of different
systems.

School of Electronics, IIITU 15


MATLAB Code:

sys1 = tf(1,[53 1]);


stepinfo(sys1)
sys2 = tf(1,[44 1]);
stepinfo(sys2)
sys3 = tf(1,[11 1]);
stepinfo(sys3)
step(sys1,sys2,sys3)
legend("sys1","sys2","sys3")
hold on

Result and Discussion:

Table 1: Various parameters for first order system


Parameters Tau=53 Tau=11 Tau=44
Rise Time 48.33 24.16 96.66
SettlingTime 86.06 43.03 172.13
Overshoot % 0 0 0
SSE 0 0 0
Peak Value 1 1 1
Peak Time 232.005 116.042 464.019

School of Electronics, IIITU 16


Observations:
Parameters First order system (with increase in )
Rise Time (tr) Decreases
Settling Time (ts) Decreases
Overshoot % Constant (0)
Steady State Error Constant (0)
(ess)
Peak Value Constant (0.99)
Peak Time (tp) Decreases

Conclusion:

1. We observe a direct relationship between the rise time and the parameter " 𝑟 "; as " 𝑟 " increases,
both the rise time and settling time increase.
2. Additionally, we generate the step response graph for various values of " 𝑟 using MATLAB.

School of Electronics, IIITU 17


Experiment 5
Aim of the experiment:
Study the time response of the 2nd order systems with standard signals.

Software:
MATLAB

Background:
The time response of second-order systems to standard signals typically involves analyzing how the
system behaves when subjected to different types of input signals, such as step, impulse, ramp.

Transfer function of 2nd order system is:

Where, wn is the natural frequency of the system and Ç is the damping ratio.
Here are the standard signals commonly used to analyze the time response of second-order systems:

1. Unit Step signal:


Unit step function is denoted by u(t). It is defined as :
u(t) = 1 , when t > = 0
u(t) = 0 , when t <0

Figure 1: Unit step signal

2. Impulse signal:
Impulse function is denoted by δ(t). It is defined as :

δ(t) = 1 , when t = 0
δ(t) = 0 , when t≠0

School of Electronics, IIITU 18


Figure 2: Impulse signal
3. Ramp signal:
Ramp signal is denoted by r(t), and it is defined as:
r(t) = t, when t > = 0
r(t) = 0, when t < 0

Figure 3: Unit Ramp signal

4. Parabolic Signal:
Parabolic signal can be defined as: x(t) = 𝑡^2/2 when t >=0 , x(t) = 0 when t < 0

Figure 4: Parabolic signal

School of Electronics, IIITU 19


Procedure:
1. Write a MATLAB code for a 2nd order system with different values of Ç.

2. Make four systems with different values of Ç and wn as last two digits of your roll number
i.e.22.

3. Plot and analysis all the systems.

MATLAB Code:
w=22
s=tf('s')
%Impulse response
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
step(s*sys,1)
hold on
end
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")
title("Impulse Response")
figure()
% Step response
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
step(sys,1)
hold on
end
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")
title("Step Response")
figure()
% Ramp response
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
step(sys/s,1)
hold on
end
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")
title("Ramp Response")
figure()
% Parabolic response
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
step(sys/s^2,1)
hold on
end
title("Parabolic Response")
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")

School of Electronics, IIITU 20


Result and Discussion:

Fig 5: Impulse response for 2nd Order System

Fig 6: Step response for 2nd Order System


School of Electronics, IIITU 21
Fig 7: Ramp response for 2nd Order System

Fig 8:Parabolic response for 2nd Order System

School of Electronics, IIITU 22


Conclusion:

We get all the graphs using MATLAB. We get step response, impulse response, ramp response , Parabolic
response for different value of 𝜻(damping ratio) means different system(like underdamped , undamped ,
critically damped , overdamped system).

School of Electronics, IIITU 23


Experiment 6
Aim of the experiment:
Study the time domain performance of the 2nd order systems and determine the performance of
the system response time with respect to the location of the poles.

Software:
MATLAB

Background:
Transfer function of 2nd order system is:

Where, wn is the natural frequency of the system and Ç is the damping ratio .
The time-domain performance of second-order systems is influenced by the location of the poles in the
system's transfer function. The poles determine the system's natural frequency (wn) and damping ratio
(ζ). These parameters play a crucial role in shaping the system's response characteristics, including rise
time, settling time, overshoot, and stability.
Here's how the location of the poles affects the performance of the system's response time:
Natural Frequency (ωn): The distance of the poles from the origin of the complex plane determines the
natural frequency of the system. A higher natural frequency results in faster oscillations and shorter rise
time. As the poles move further from the origin, the natural frequency increases, leading to a faster
response time.
Damping Ratio (ζ): The angle of the poles with respect to the negative real axis determines the damping
ratio of the system. A higher damping ratio results in faster settling time and reduced overshoot. Poles
closer to the real axis indicate higher damping, leading to faster convergence to the steady state without
overshooting or oscillations.
In summary, for second-order systems:
• Poles closer to the origin of the complex plane result in lower natural frequency and longer rise
time.
• Poles further from the origin lead to higher natural frequency and shorter rise time.
• Poles closer to the real axis result in higher damping ratio and faster settling time.
• Poles further from the real axis result in lower damping ratio, potentially leading to oscillatory
behavior and longer settling time.

Characteristic Equation:
School of Electronics, IIITU 24
𝜻𝑚𝒏 ± 𝜔𝑛√𝟏 − 𝜻2

Response of 2nd order systems is mainly dependent on the value of 𝜻 {damping ratio}.

Table 1: Damping and its type:

𝜻>1 Over damped system


0<𝜻<1 Under damped system
𝜻=1 Critically Damped Systems
𝜻=0 Undamped Systems

MATLAB Code:
w=22
s=tf('s')
figure()
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
step(sys,1)
stepinfo(sys)
hold on
end
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")
figure()
for z=[0,0.75,1,1.5]
sys=tf(w^2,[1,2*z*w,w^2])
pzmap(sys)
hold on
end
legend("\zeta=0","\zeta=0.75","\zeta=1","\zeta=1.5")

Result and Discussion:


Table 1: Various parameters for first order system

Parameters Ç =0 Ç =0.75 Ç =1 Ç =1.5

Rise time Nan 0.10 0.15 0.26


Settling time Nan 0.26 0.26 0.4843
Overshoot percentage Nan 2.8369 0 0
SSE 0 0 0 0
Peak value Inf 1.0284 0.99 0.99
Peak time Inf 0.2149 0.54 1.1817

School of Electronics, IIITU 25


Fig 1: Step response of 2nd Order System

Fig 2: Pole Zero Map for 2nd Order System

Conclusion:

We got the step response graphs for 2nd order system for different value of 𝜁 𝑢sing MATLAB. Also we get
the pole zero map for 2nd order system at different value of 𝜁.

School of Electronics, IIITU 26

You might also like