MATLAB
Assignment 8:
Ex1: Control systems open loop and closed loop:
For the following RC circuit find its transfer function. R=10 000 ohm, C= 500*10-6 f .
- Find the open loop time constant.
- Design a control system to drive this circuit such that the control algorithm is 𝑣𝑖 = 𝑒 ∗ 𝑘, where 𝑒 =
𝑣𝑖𝑑 − 𝑣𝑜 and 𝑣𝑖𝑑 is the set point.
- Find k that makes the closed loop time constant is 2 sec.
- Find k that makes the system pole at -10 ;
- Draw the root locus plot for the system.
- Find the final value for the closed loop system with step input.
- Use Matlab to show the step response for both the open loop and closed loop systems.
- Use Simulink to simulate the closed loop system and the open loop system.
𝑇𝑠 = 𝜋𝜏 = 4
𝜁𝜔𝑛
𝑃. 𝑂. = 100𝑒−𝜁𝜋/√1−𝜁 2
Overview Second Order Systems:
Consider the following Mass-Spring system shown in the Figure 2. Where K is the spring
constant, B is the friction coefficient, x(t) is the displacement and F(t) is the applied force:
Figure 2. Mass-Spring system
The differential equation for the above Mass-Spring system can be derived as follows
𝑀 𝑑2𝑥(𝑡)
𝑑𝑡2 + 𝐵
𝜕𝑥(𝑡)
𝜕𝑡 + 𝐾𝑥(𝑡) = 𝐹(𝑡)
Applying the Laplace transformation we get
(𝑀𝑠2 + 𝐵𝑠 + 𝐾) ∗ 𝑋(𝑠) = 𝐹(𝑠)
provided that, all the initial conditions are zeros. Then the transfer function representation of the
system is given by
𝑇𝐹 = 𝑂𝑢𝑡𝑝𝑢𝑡
𝐼𝑛𝑝𝑢𝑡 =
𝑋(𝑠)
𝐹(𝑠) =
1
(𝑀𝑠2 + 𝐵𝑠 + 𝐾)
The above system is known as a second order system.
The generalized notation for a second order system described above can be written as
2
2 2 ( ) ( )
2
n
n n
Y s R s s s
=
+ +
With the step input applied to the system, we obtain
2
2 2 ( )
( 2 )
n
n n
Y s s s s
=
+ +
for which the transient output, as obtained from the Laplace transform table (Table 2.3,
Textbook), is
2 1
2
1 ( ) 1 sin( 1 cos ( ))
1
nt
n y t e t
− − = − − +
−
K
M
B
F(t)
x(t)
where 0 < ζ < 1. The transient response of the system changes for different values of damping
ratio, ζ. Standard performance measures for a second order feedback system are defined in terms
of step response of a system. Where, the response of the second order system is shown below.
The performance measures could be described as follows:
Rise Time: The time for a system to respond to a step input and attains a response equal to a
percentage of the magnitude of the input. The 0-100% rise time, Tr, measures the time to 100%
of the magnitude of the input. Alternatively, Tr1, measures the time from 10% to 90% of the
response to the step input.
Peak Time: The time for a system to respond to a step input and rise to peak response.
Overshoot: The amount by which the system output response proceeds beyond the desired
response. It is calculated as
P.O.= 100%t p
M f
f
−
where MPt is the peak value of the time response, and fv is the final value of the response. And it
is approximately equal to
𝑃. 𝑂. = 100𝑒−𝜁𝜋/√1−𝜁 2
Settling Time: The time required for the system’s output to settle within a certain percentage of
the input amplitude (which is usually taken as 2%). Then, settling time, Ts, is calculated as
4 s
n
T
=
Exercise 2: Effect of damping ratio ζ on performance measures. For a single-loop second order feedback system given below
Find the step response of the system for values of ωn = 1 and ζ = 0.1, 0.4, 0.7, 1.0 and 2.0. Plot
all the results in the same figure window and fill the following table. Use “stepinfo”
ζ Rise time Peak Time % Overshoot Settling time Steady state value
0.1
0.4
0.7
1.0
2.0
R(s) E(s)
Y(s) +
-
Exercise 3: Design of a Second order feedback system based on performances.
For the motor system given below, we need to design feedback such that the overshoot is limited
and there is less oscillatory nature in the response based on the specifications provided in the
table. Assume no disturbance (D(s)=0).
Table: Specifications for the Transient
Response
Performance Measure
Desired Value
Percent overshoot Less than 8%
Settling time Less than 400ms
Use MATLAB, to find the system performance for different values of Ka and find which value of
the gain Ka satisfies the design condition specified. Use the following table. (hint use “stepinfo”)
Ka 20 30 50 60 80
Percent
Overshoot
Settling
time
Ka 5 1
𝑠(𝑠 + 20)
R(s)
-
+
+
- Y(s)
Amplifier
Motor
Constant Load D(s)
(optional) Ex4: second order system: for the following mass spring damper system. k=1, c=0.1, m=10.
The system open loop transfer function is
𝑇 = 𝑥(𝑠)
𝑓𝑎(𝑠) =
1
𝑚𝑠2 + 𝑐𝑠 + 𝑘
- Rewrite the system to be in the form 𝐺𝑎𝑖𝑛
𝑠2+2𝜁𝑤𝑛𝑠+𝑤𝑛 2
- Find the settling time using the following relation 𝑇𝑠 = 𝜋𝜏 = 4
𝜁𝜔𝑛 ;
- Find the percentage overshoot using the following relation 𝑃. 𝑂. = 100𝑒−𝜁𝜋/√1−𝜁 2 .
- Find the steady state value with step input using the final value theorem. - Find the open loop overshoot, rise time, settling time. Using “stepinfo”
- Design a control system to drive this circuit such that the control algorithm is 𝑓𝑎 = 𝑒 ∗ 𝑘, where 𝑒 =
𝑥𝑑 − 𝑥 and 𝑥𝑑 is the set point. And find its transfer function.
- Find k that makes the settling time less that the half of its value in the open loop.
- Find k that makes the percentage overshoot less than half that in the open loop.
- Draw the root locus plot for the system.
k
m
c
fa(t)
x(t)