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

Lab 2 Notes

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

Lab 2 Notes

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

Chapter 3

System Characteristics and


Responses

In this chapter methods for calculating the response of a system to different inputs (step,
impulse, arbitrary) are presented. In addition, the different characteristics of the transient
(rise time, overshoot, settling time) and steady state response (steady state error) of first
and second order systems are presented.

3.1 System Characteristics


Some of the most basic characteristics that play an important role in system analysis are
of course the poles and the zeros of a system. In order to obtain these, one can use the
following commands:

pole(sys) Poles of the transfer function


zero(sys) Zeros of the transfer function
[w,z,p]=damp(sys) Returns the natural frequency and damping factor of
each pole in the vector p
pzmap(sys) Pole-Zero map of the transfer function

The last two commands are especially interesting, since the damp command can give
useful information for the frequency and damping factor of the system poles. The pzmap
although interesting, is usually not used, since rlocus has much more interesting features.

Example 3.1.1. Find the poles and zeros of the following transfer function and plot
them in the Complex plane.
s+2
H(s) =
(s + 1)2 (s + 3)
Solution.

25
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 26

z=[-2]; % This is the same as z=-2


p=[-1 -1 -3];
k=1;
sys=zpk(z,p,k) % You can also try the command tf(sys)
pole(sys); % in order to obtain the poles
zero(sys); % in order to obtain the zeros
pzmap(sys);
grid

3.2 Responses
The signals received by a system are called excitations or inputs of the system and the
signals generated by the system because of these excitations are called responses or out-
puts of the system. Some of the basic responses are the following:

Step Response: It’s the dynamic response of the system (assuming zero initial
conditions) when the input is the step function u(t) = 1, t > 0. In order to obtain the
step response of the system, the command step is used with its variations
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 27

step(sys) Plots the step response of the system sys


step(sys, Tfinal) Plots the step response from t = 0 to the final time
t = T f inal
step(sys, t) uses the user-supplied time vector t for simulation
data=stepinfo('sys') Computes the step response characteristics
v=step(sys) Saves the response in a vector
Example 3.2.1. Consider a system with transfer function:
s+2
G(s) =
s2 + 4s + 3
Find the step response of the system.

Solution.

sys=tf([1 2],[1 4 3]);


step(sys)

Impulse Response: It’s the dynamic response of the system when our input is the
impulse function δ(t). In order to obtain the step response of the system, the command
step is used with its variations
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 28

impulse(sys) Plots the impulse response of the system sys


impulse(sys, Tfinal) Plots the impulse response from t = 0 to the final time
t = T f inal
impulse(sys, t) uses the user-supplied time vector t for simulation

Example 3.2.2. Consider the following transfer function:


s+2
G(s) =
s2 + 4s + 3
Find the impulse response of the system.

Solution.

sys=tf([1 2],[1 4 3]);


impulse(sys)

Arbitrary Response: We can compute the response of a system to any desired


signal, by creating our own input. In order to do so, we first need to specify the time vector
t and the input vector u. After these vectors are defined, the command lsim(sys,u,t)
along with its variations, simulates the response of the system to the given input.
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 29

lsim(sys,u,t) Response of the system to input u


lsim(sys,u,t,x0) Response of the system to input u with initial conditions
x0
v=lsim(sys,u,t) Saves the response in a vector

Example 3.2.3. Consider the following transfer function:


s+2
G(s) =
s2 + 4s + 3
Find the arbitrary response of the system, with t = 0 : 0.1 : 10 and u = sin(1.2 · t).

Solution.

sys=tf([1 2],[1 4 3]);


% Create time variable
t=0:0.1:10
% Create input
u=sin(1.2*t)
% Plot the response
lsim(sys,u,t)
grid
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 30

3.3 Examples
Example 3.3.1. Consider the following transfer function
1
G1 (s) =
(s + 2)(s + 3)
Design the step response of the system.
Then consider a new transfer function
10
G2 (s) =
(s + 2)(s + 3)(s + 10)
and design on the same diagram the step response for the second system.
Solution.

z=[];
p=[-2 -3];
k=1;
G1=zpk(z,p,k)
step(G1)
hold on
G2=zpk([],[-2 -3 -10],10)
step(G2)
grid
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 31

Example 3.3.2. Consider a system with transfer function


s −2s
H(s) = −2 2
= 3
(s + 2)(s + 2s + 2) s + 4s2 + 6s + 4
Define the transfer function to Matlab. Then in a tab with two sub-windows design the
impulse and step response of the system.
Solution.

Hsys=tf([-2 0],[1 4 6 4])


subplot(1,2,1)
step(Hsys,10)
grid
subplot(1,2,2)
impulse(Hsys,10)
grid

Example 3.3.3. Consider a system with the following transfer function:


s2 + 2s + 1
G(s) =
s3 + 3.8s2 + 8.76s + 5.96
Find the poles and zeros of the system and then in a tab with 3 sub-windows plot:
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 32

1. The impulse response of the system

2. The step response of the system

3. The response when we have as input the signal 2cos(1.6t), in the interval [0, 10].

Solution.

% Define transfer function model


sys=tf([1 2 1],[1 3.8 8.76 5.96])
p=pole(sys) % The poles are -1.4+2i, -1.4-2i, -1
z=zero(sys) % The zeros are -1,-1
% Define time vector and the desired input
t=0:0.1:10;
u=2*cos(1.6*t);
% Begin plotting
% Create a 1-by-3 figure
subplot(1,3,1) %First plot
impulse(sys)
grid
subplot(1,3,2) %Second plot
step(sys)
grid
subplot(1,3,3) %Third plot
lsim(sys,u,t)
grid
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 33

Example 3.3.4. [Nise, 2013, Stefani, 1973] During an experiment, a human sitting in
front of a switch reacts to an optical signal by lowering the switch. The transfer function
which connects the human response P (s) (output) to the optical stimulus V (s) is

P (s) s + 0.5
G(s) = = (3.1)
V (s) (s + 2)(s + 5)
What is the step response of the above system and after find the system’s features
(overshoot, rise time, peak time, settling time)

Solution.

z=-0.5;
p=[-2 -5];
k=1;
sys=zpk(z,p,k)
step(sys)
grid
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 34

Example 3.3.5. [Nise, 2013, Schneider, 1992] An industrial robot is used in the factory
to move 55 pounds of salt bags by using a head of compressed air. Such a robot can move
up to 12 bags per minute. Consider that the model describing the rotating control head
is:
ωo (s) 100
G(s) = =
Vi (s) (s + 10)(s2 + 4s + 10)

Where ω(s) the Laplace transform of the rotational speed of the robot and V (s) the
voltage applied to the controller.

1. Can the system be approximated by a second order system?

2. Find rise time, peak time, settling time.

Solution. To find if the system can be approximated by a second order system, we need to
find the system poles and study their relations in order to find out if there exist dominant
poles. Using the command roots([1 4 10]) we find that the system has 3 poles, -10
and -2± 2.4495i. It is obvious that the pole at -10 is five times further on the left that the
other two complex poles. So, according to [Nise, 2013], an approximation can be made
using just the dominant poles.
So we will define a new system that has only these two complex poles. In addition,
using the final value theorem, we must find the numerator such that these two systems
have the same steady state response.

es = lim sG(s)U (s) = 1


s→0
K
eapr = lim sGapr (s)U (s) = lim = 1 ⇒ K = 10
s→0 s→0 s2 + 4s + 10
So overall, the approximate system is
10
Gapr = (3.2)
s2 + 4s + 10

roots([1 4 10]) % to find the polynomial roots


sys=zpk([],[-10, -2+2.4495i, -2-2.4495i],100)
sys app=zpk([],[-2+2.4495i, -2-2.4495i],10)
step(sys)
hold on
step(sys app,'r')
grid
legend('original system','approximation')
data1=stepinfo(sys)
data2=stepinfo(sys app)
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 35

System Approximation
RiseTime 0.6492 0.614
SettlingTime 2.0020 1.8951
Overshoot 7.2125 7.6894
Undershoot 0 0
Peak 1.0721 1.0769
PeakTime 1.4046 1.2894

Example 3.3.6. [Nise, 2013, Kuo et al., 2008] A crosslapper is a machine that takes as
an input a light fiber fabric and produces a heavier fabric by laying the original fabric
in layers rotated by 90 degrees. A feedback system is required in order to maintain
consistent product width and thickness by controlling its carriage velocity. The transfer
function from servomotor torque, T(s), to carriage velocity, Y(s) , was developed for such
a machine. Assume that the transfer function is:
Y (s) 33s4 + 202s3 + 10061s2 + 24332s + 170704
G(s) = = 7
T (s) s + 8s6 + 464s5 + 2411s4 + 52899s3 + 167829s2 + 913599s + 1076555

Find an approximation of the above system using its real pole and plot the step response
of the two systems.
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 36

Solution. In order to make an approximation of the above system by a first order system,
we must first compute its poles. Using pole we find that the only real pole is at -1.3839.
So the first order system is
K
Gapr =
s + 1.3839
using the final value theorem, we must find the numerator such that these two systems
have the same steady state response.

es = lim sG(s)U (s) = 0.159


s→0
K
eapr = lim sGapr (s)U (s) = lim = 0.159 ⇒ K = 0.22
s→0 s→0 s + 1.3839

num=[33 202 10061 24332 170704];


den=[1 8 464 2411 52899 167829 913599 1076555];
sys= tf( num,den)
[ c,p,k]=residue( num,den)
step(sys) % in order to check the steady-state.
sys app= zpk([],[ -1.3839],0.159*1.3839)
hold on
step( sys app,'r')
grid
legend('original system','approximation')
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 37

Example 3.3.7. [Nise, 2013, Linkens, 1992] Anesthesia induces muscle relaxation (paral-
ysis) and unconsciousness in the patient. Muscle relaxation can be monitored using elec-
tromyogram signals from nerves in the hand; unconsciousness can be monitored using the
cardiovascular systems mean arterial pressure. The anesthetic drug is a mixture of isoflu-
rane and atracurium. An approximate model relating muscle relaxation to the percent
isoflurane in the mixture is
P (s) 0.0763
G(s) = = 2
U (s) s + 1.15s + 0.28

where P(s) is muscle relaxation measured as a fraction of total paralysis (normalized to


unity) and U(s) is the percent mixture of isoflurane.

1. Plot the step response of paralysis if a 2% mixture of isoflurane is used.

2. What percent isoflurane would have to be used for 100% paralysis?

Solution. After we define the system in simulink, we will plot its step response for an
input of u=2%, which is equivalent to a step command of the system with an added gain
value of 2. For this dosage we observe that the paralysis rises at 54.5%
Now, in order to find the amount of dosage required for complete paralysis, we will
use the final value theorem
pf inal (t) = lim sG(s)U (s) = 1
t→0
0.0763
lim s ks s2 +1.15s+0.28 =1
t→0
k0.0763
0.28
=1
k = 3.67%

So a dosage of 3.67% is required for full paralysis. Now we will plot the two responses in
Matlab and verify the results.

sys=tf([0.0763],[1 1.15 0.28])


step(2*sys) % first dosage
hold all
step(3.67*sys) % second dosage
legend('2% dosage','3.67% dosage')
CHAPTER 3. SYSTEM CHARACTERISTICS AND RESPONSES 38
Chapter 4

Dynamic Behavior of First-Order


and Second-Order Systems

We shall begin by describing some basic features of first-order and second-order systems
and then we will give examples of them.

4.1 First-Order and Second-Order System’s Features


First-order systems are, by definition, systems whose input-output relationship is a
first-order differential equation. A first-order differential equation contains a first-order
derivative but no derivative higher than first-order. The order of a differential equation
is the order of the highest order derivative present in the equation.

First-order systems contain a single energy storage element. In general, the order of
the input-output differential equation will be the same as the number of independent
energy storage elements in the system. Independent energy storage cannot be combined
with other energy storage elements to form a single equivalent energy storage element.

First-order systems are the simplest dynamic systems to analyse. Some common
examples include cruise control systems and RC circuits.

The general form of the first-order’s differential equation is as follows

ẏ + ay = bu

39
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS40

The first-order’s transfer function is


b
G(s) =
s+a

Second-order systems are commonly encountered in practice, and are the simplest
type of dynamic system to exhibit oscillations. In fact many real higher order systems
are modelled as second-order to facilitate analysis. Typical examples are the mass-spring-
damper systems and RLC circuits.
The second-order’s transfer function is:
ωn2
G(s) = 2
s + 2ζωn s + ωn2
where ωn is natural frequency and ζ the damping ratio. Depending on the value of the
damping ratio the system exhibits different behavior.
ζ = 0 Undamping The system has two imaginary poles. There is no damp-
ing
0 < ζ < 1 Under-damping The system has stable imaginary poles. Quickly tends
to equilibrium, but with oscillation
ζ > 1 Over-damping The system has stable real poles. Tends slower to equi-
librium, but when it reach, remains in balance
ζ = 1 Critical damping The system has a double real stable pole. Tends to
balance the maximum possible time without oscillation.
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS41

The qualitative analysis of first and second order systems regards the characteristics
of the transient response and the steady state errors. The analysis of these characteris-
tics helps determine the quality of the response regarding specific design requirements.
For example, when controlling the flow of a water tank, we want to stabilize the water
capacity to a steady level before the tank overflows. This in control theory terms is the
minimization of the overshoot. If in addition we desire this transition to a specific water
lever to be done in as little time as possible, then we must study the rise and settling time
of the system.
As another example, when we design a remote controlled navigation system, it is our
aim to input specific coordinates for the system to follow. So in this case we want to
minimize the difference between input and output, i.e. the steady state error.
Overall, the basic characteristics that we study are the following:
Overshoot: Describe the difference in the response of the system between the tran-
sitional and permanent state, when the system is stimulated by the unit step input. We
are interested in the maximum elevation as well as the time it happens.
Rise time: The time required to switch the system’s response (in step input)from
10% to 90% of it’s final value.
Settling time: The time needed to switch the system’s response (in step input) and
remain within a certain range of the final price (typically ±2%).
Peak time: The time required to reach the first, or maximum peak.

4.2 Examples
Example 4.2.1. Create a program that will plot the step response of the following
transfer function
a
G(s) = .
s+a
for a=1,2,..5

Solution.

leg=[];
for i=1:5
sys=zpk([],[-i],i);
hold all
step(sys);
line=horzcat('poles= -',num2str(i));
leg=strvcat(leg,line);
end
legend(leg)
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS42

Example 4.2.2. Create a program that will plot the step response and pole-zero map of
the following transfer function
|a + 5i|2
G(s) =
(s + a + 5i)(s + a − 5i)

for a = 1, ..., 8 (fixed complex part to ±5i).

Solution.

leg=[];
for j=1:8
sys=zpk([],[-j+5*i, -j-5*i],abs(-j+5*i)ˆ2);
figure(1)
hold all
step(sys)
line=horzcat('poles= -',num2str(j), '+-5', 'i');
leg=strvcat(leg,line);
legend(leg)
figure(2)
hold all
pzmap(sys)
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS43

pause
end
% Keep pressing enter till you have the desirable result (1-8).
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS44

Example 4.2.3. Create a program that will plot the step response and pole-zero map of
the following transfer function
|2 + wi|2
G(s) =
(s + 2 + wi)(s + 2 − wi)

for w = 1, ..., 8 (constant real part to −2).

Solution.

for j=1:8
sys=zpk([],[-2+j*i, -2-j*i],abs(-2+j*i)ˆ2)
figure(1)
hold all
step(sys)
figure(2)
hold all
pzmap(sys)
pause
end
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS45

Example 4.2.4. Create a program that will plot the step response and pole-zero map of
the following transfer function

|w + 2wi|2
G(s) =
(s + w + 2wi)(s + w − 2wi)

for w = 1, ..., 8.

Solution.

leg=[];
for j=1:8
sys=zpk([],[-j+2*j*i, -j-2*j*i],abs(j+2*j*i)ˆ2);
figure(1)
hold all
step(sys)
% In order to create the legend string:
line=horzcat('poles= -',num2str(j), '+-', num2str(2*j), 'i');
leg=strvcat(leg,line);
legend(leg)
figure(2)
hold all
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS46

pzmap(sys)
pause
end

You might also like