0% found this document useful (0 votes)
4 views

7

The document outlines an experiment focused on first-order systems in MATLAB, detailing objectives such as analyzing transient response and steady-state error. It includes examples of first-order system responses, MATLAB code for simulating step and ramp responses, and performance specifications based on varying time constants and gains. Additionally, it presents assignments related to transfer functions and system responses, encouraging further exploration of control system dynamics.

Uploaded by

ali alaa
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)
4 views

7

The document outlines an experiment focused on first-order systems in MATLAB, detailing objectives such as analyzing transient response and steady-state error. It includes examples of first-order system responses, MATLAB code for simulating step and ramp responses, and performance specifications based on varying time constants and gains. Additionally, it presents assignments related to transfer functions and system responses, encouraging further exploration of control system dynamics.

Uploaded by

ali alaa
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/ 13

56

MATLAB Experiment No. (1)


First Order Systems

 Objectives:
The objectives of this experiment are to:
1. Describe quantitatively the transient response of first order systems.
2. See the effect of the gain and time constant on the transient response
and steady state error.
 Time Response:
The time response of a control system consists of two parts: the transient
and the steady-state response as shown in Figure 5.1. By transient
response, we mean that which goes from the initial state to the final state.
By steady-state response, we mean the manner in which the system
output behaves as time approaches infinity.

Figure 5.1: First order lag response specifications.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


57

 Transient Response:
One of the most important characterestics of control systems is their
transient response. The transient response is the response of a system as a
function of time. Because the purpose of control systems is to provide a
desired response, the transient response of control systems often must be
adjusted until it is satisfactory. If an open loop control system does not
provide a satisfactory response, then the process must be replaced with a
more suitable process. By constrast, a closed loop system can often be
adjusted to yield the desired response by the adjusting the feedback loop
parameters. In specifying the transient response characteristics of a control
system to a unit-step input, it is common to specify the following:
1. Time Constant (𝝉): is the time required for the response curve to reach
63.2% of its final value in the phase lag, or 36.8 % in the phase lead.
2. Rise Time (𝑻𝒓 ): is the time required for the response to rise from 10% to
90% of its final value.
3. Settling Time (𝑻𝒔 ): is the time required for the response curve to reach
and stay within a range about 2% or 5% of its final value.
 Steady State Error (𝒆𝒔𝒔 ):
The steady state error is the difference between the input and the output for
a prescribed test input as time → ∞.
 First Order Systems:
The dynamics of many systems of interest to engineers may be represented
by a simple model containing one independent energy storage element. For
example, the braking of an automobile, the discharge of an electronic camera
flash, the flow of fluid from a tank, and the cooling of a cup of coffee may all
be approximated by a first-order differential equation.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


58

1. First-Order System Lag: may represented by an RC circuit where


the output on the capacitor as shown in Figure 5.2 (a) and the output step
response as shown in Figure 5.2(b) . The transfer function is given by:
𝑉𝑜 (𝑠) 𝐾
=
𝑉𝑖 (𝑠) 𝑠 + 𝑎

(a) (b)
Figure 5.2: First order system lag: (a) RC lag circuit, (b) output step response.
2. First-Order System Lead: may represented by an RC circuit. where
the output on the resistor as shown in Figure 5.3 (a) and the output step
response as shown in Figure 5.3(b). The transfer function is given by:
𝑉𝑜 (𝑠) 𝐾𝑠
=
𝑉𝑖 (𝑠) 𝑠 + 𝑎

(a) (b)
Figure 5.3: First order system lead: (a) RC lead circuit, (b) output step response.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


59

Example 5.1: Consider a first order system has the closed loop transfer
function with the unity feedback:

𝑌(𝑠) 1
=
𝑅(𝑠) 𝜏𝑠 + 1

Do the following using MATLAB:


1. Obtain the step response of the system for 𝝉 = 𝟏, 𝟑, and 𝟓 on the same
figure.
2. Repeat part (1) for unit ramp input.

Solution:

% 1. To obtain the step response for tau=1, 3, and 5 %


s=tf('s');
tau=[1 3 5];
hold on
for i=1:3
T=1/(tau(i)*s+1)
step(T)
end
gtext('\tau=1')
gtext('\tau=3')
gtext('\tau=5')

Khaled Mustafa Mahmoud Session: Spring 2017/2018


60

Step Response
1
=1
0.9
=3
0.8
=5
0.7

0.6
Amplitude

0.5

0.4

0.3

0.2

0.1

0
0 5 10 15 20 25 30
Time (sec)

Figure 5.4: Step response for 𝜏 = 1, 3, and 5 of Example 5.1.

% 2. To obtain the ramp response for tau=1,3, and 5 %


s=tf('s');
tau=[1 3 5];
hold on
for i=1:3
T=1/(tau(i)*s+1)
t=0:0.01:30;
r=t;
lsim(T,r,t)
end
gtext('Input')
gtext('\tau=1')
gtext('\tau=3')
gtext('\tau=5')

Khaled Mustafa Mahmoud Session: Spring 2017/2018


61

Linear Simulation Results


30

=1

25

20
Input =3
Amplitude

15
=5

10

0
0 5 10 15 20 25 30
Time (sec)

Figure 5.5: Ramp response for 𝜏 = 1, 3, and 5 of Example 5.1.


Performance specifications for each value of time constant as
shown in the following table:
Performance
𝜏 = 1 sec 𝜏 = 3 sec 𝜏 = 5 sec
Specifications
Rise Time ( Tr ) 2.2 sec 6.59 sec 11 sec

Settling Time ( Ts ) 3.91 sec 11.7 sec 19.6 sec

Error [step input] 0 0 0

Error [ramp input] 1 3 5

What is the effect of the time constant on the system response?

Khaled Mustafa Mahmoud Session: Spring 2017/2018


62

Example 5.2: A tank level control system is shown in Figure 5.6 (a). It is
desired to regulate the level 𝑯 in response to an input change 𝑸𝟏 . The
open loop transfer function is:
∆𝐻 𝑅
𝐺(𝑠) = =
∆𝑄1 𝑅𝐶𝑠 + 1
For closed loop system, a float level sensor and valve may be used. The
valve is controlled so that a reduction in the flow rate ∆𝑸𝟏 , is a
proportional to an increase in head 𝑯. The block diagram of the system
shown in Figure 5.6 (b). Do the following:
1. Write a MATLAB program to obtain the closed loop step response of
the system for K=2, 4, and 10. Assuming: C=1 m2 and R=0.5 sec/m2.
2. Determine the values of time constant, rise time, settling time, and
steady state error for each value of gain.

(a) (b)

Figure 5.6: Tank level system: (a) schematic diagram, (b) block diagram.

Solution:
% 1. To obtain the closed loop step response for K=2,4, and 10 %
s=tf('s');
R=0.5;C=1;
K=[2 4 10];
hold on

Khaled Mustafa Mahmoud Session: Spring 2017/2018


63

for i=1:3
G=K(i)*R/(R*C*s+1);
T=feedback(G,1)
step(T)
xlabel('Time')
ylabel('Height')
title('Step Response')
end
gtext('K=2')
gtext('K=4')
gtext('K=10')

Step Response
0.9

0.8
K=10
0.7

K=4
0.6

0.5
Height

K=2
0.4

0.3

0.2

0.1

0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
Time (sec)

Figure 5.7: Step response for 𝐾 = 2, 4, and 10 of Example 5.2.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


64

2. Performance specifications for each value of gain as shown in


the following table:
Performance
𝐾=2 𝐾=4 𝐾 = 10
Specifications
Time Constant (τ) 0.25 sec 0.167 sec 0.0831sec

Rise Time ( Tr ) 0.549 sec 0.366 sec 0.183 sec

Settling Time ( Ts ) 0.978 sec 0.652 sec 0.326 sec

Error(ess ) 0.5 0.33 0.167

Discuss the effect of the system gain on the time constant and steady state
error.
--------------------------------------------------------------------------------------------
Example 5.3: The transfer function of the 𝑅𝐶 network given in Figure 5.8
is:
𝑌(𝑠) 1
=
𝑅(𝑠) 1 + 𝑅𝐶𝑠

Figure 5.8: A first order system.

Do the following:

1. Find the step response when 𝑅 = 1𝐾Ω, 5𝐾Ω, 10𝐾Ω, and 𝐶 = 1µf.
2. Record the values of time constant, rise time, settling time, and steady
state error for each case in parts (1) and (2).

Khaled Mustafa Mahmoud Session: Spring 2017/2018


65

Solution:
% 1. To obtain step response of the RC network for R=1KΩ,5KΩ,10KΩ, and C=1µf %
s=tf('s');
C=1*10^-6;
R=[1*10^3 5*10^3 10*10^3];
hold on
for i=1:3
T=1/(1+R(i)*C*s);
step(T)
end
gtext('R=1K ohm')
gtext('R=5K ohm')
gtext('R=10K ohm')

Step Response

R=1K ohm

R=5K ohm

0.8
R=10K ohm
Amplitude

0.6

0.4

0.2

0
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (sec)

Figure 5.9: Step response of the RC network for R=1KΩ, 5KΩ, 10KΩ, and C=1µf.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


66

Performance specifications for each case as shown in the following table:


Performance C = 1µf C = 1µf C = 1µf
Specifications R = 1KΩ R = 5KΩ R = 10KΩ
Time Constant (τ) 1 msec 5 msec 10 msec
Rise Time ( Tr ) 2.2 msec 11 msec 22 msec
Settling Time ( Ts ) 3.91 msec 19.6 msec 39.1 msec
Error(ess ) 0 0 0
What is the effect of the increasing the value of resistor on the performance
specifications?
--------------------------------------------------------------------------------------------
Assignment 5.1: A useful cirquit, called a lead network is shown in Figure
5.10. Do the following:
1. Determine the transfer function 𝐺(𝑠) = 𝑉𝑜 (𝑠)/𝑉(𝑠).
2. Use MATLAB to obtain the step response of the network.
3. Determine the values of time constant, rise time, settling time, and
steady state error.

Figure 5.10: RC lead network.


--------------------------------------------------------------------------------------------
Assignment 5.2: Consider the feedback control system given in Figure
5.11. Do the following:
1. Find the value of gain 𝑲 such that the step response reaches 98% of
the final value in 1 sec. Verify your answer using MATLAB.
2. Use MATLAB to find the steady state error to a unit step input.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


67

Figure 5.11: A feedback control system of Homework 5.2.


-------------------------------------------------------------------------------------------------
Assignment 5.3: Consider the system with transfer function:
𝐾
𝐺(𝑠) =
𝑠+𝑎
1. Using a “for loop”, develop an m-file to obtain the step resonse in the
single figure of the system 𝑦(𝑡) and tabulate the values of 𝑦(𝑡) for
𝑡 = 0, 1, 2, 3, … 10 sec for:
(𝐚) 𝐾 = 1, 𝑎=1 (𝐛) 𝐾 = 1, 𝑎 = 0.5 (𝐜) 𝐾 = 2, 𝑎 = 1
2. Record the values of time constant and steady state error for each case.
3. Discuss the reasons for any discrepancies. What conclusion can you
draw?
-------------------------------------------------------------------------------------------------
Assignment 5.4: Consider the open loop voltage regulator in Figure 5.12.
1. If 𝑅𝐿 = 100 Ω and if 𝑟(𝑡) is a unit step function, what is the response 𝑣𝑜 (𝑡)?
What is its steady state response? How many seconds will 𝑣𝑜 (𝑡) take to
reach and stay within 1% of its steady state?
2. What is the required reference input if the output voltage is 20 V?
3. If we use the reference signal computed in part (2), and decrease 𝑅𝐿 from
100 Ω to 50 Ω, what is the steady state output voltage?

Figure 5.12: Open loop voltage regulator.

Khaled Mustafa Mahmoud Session: Spring 2017/2018


68

Assignment 5.5: Consider the closed loop voltage regulator as shown in


Figure 5.13.
1. If 𝑅𝐿 = 100 Ω and if 𝑟(𝑡) is a unit step function, what is the response
𝑣𝑜 (𝑡)? What is its steady state response? How many seconds will 𝑣𝑜 (𝑡)
take to reach and stay within 1% of its steady state?
2. What is the required 𝑟(𝑡) if the output voltage is 20 V?
3. If we use 𝑟(𝑡) in part (2), and decrease 𝑅𝐿 from 100 Ω to 50 Ω, what is the
steady state output voltage?

Figure 5.13: Closed loop voltage regulator.


-------------------------------------------------------------------------------------------------
Assignment 5.6: Compare the two systems in problems 3 and 4 in terms of:
a) The time constant or speed of response.
b) The magnitudes of the reference signals.
c) The deviations of the output voltages from 20 V as 𝑅𝐿 decreases
from 100 Ω to 50 Ω. Which system is better?

Khaled Mustafa Mahmoud Session: Spring 2017/2018

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy