Lab 2 Notes
Lab 2 Notes
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.
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
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
Solution.
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
Solution.
Solution.
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
3. The response when we have as input the signal 2cos(1.6t), in the interval [0, 10].
Solution.
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.
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.
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.
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
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.
We shall begin by describing some basic features of first-order and second-order systems
and then we will give examples of them.
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.
ẏ + ay = bu
39
CHAPTER 4. DYNAMIC BEHAVIOR OF FIRST-ORDER AND SECOND-ORDER SYSTEMS40
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)
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)
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