Lectures
Lectures
References
R.C. Dorf & R.H. Bishop, Modern Control Systems –9th/10th Edition.
Prentice Hall, 2001/2005, ISBN 0-13-031411-0
N.S. Nise, Control Systems Engineering, - 8th Edition, Wiley, 2019, ISBN
978-1-119-47421-0
The error signal, which is the difference between the input signal and the
feedback signal, is fed to the controller to reduce the error, and hence to
bring the output of the system to a desired value
The output is measured by a measurement element called a sensor or a
transducer
MECH365 – Week 1 Lecture Notes
In general, a control system consists of
A process/system/plant to be controlled
A measurement of the system output
A comparison of the desired and actual outputs
A controller generating a control signal
𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
or =
𝑅𝑅(𝑠𝑠) 1+𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)
𝐵𝐵(𝑠𝑠)
Open-Loop Transfer Function = = 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)
𝐸𝐸(𝑠𝑠)
𝐶𝐶(𝑠𝑠)
Feedforward Transfer Function = = 𝐺𝐺(𝑠𝑠)
𝐸𝐸(𝑠𝑠)
𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
Closed-Loop Transfer Function = =
𝑅𝑅(𝑠𝑠) 1+𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)
Definition:
∞
L[ f (t )] = F ( s ) = ∫ f (t )e − st
⋅ dt
0
Convolution integral:
t
L ∫ f1 ( t − τ) ⋅ f 2 (τ) ⋅ dτ = F1 (s) ⋅ F2 (s)
0
MECH365 – Week 1 Lecture Notes
Inverse Laplace Transform
Definition:
−1
𝑓𝑓 𝑡𝑡 = 𝐿𝐿 𝐹𝐹(𝑠𝑠)
The inverse Laplace transform is obtained by using
- tables of Laplace transform (Table 2-1 and 2-2)
- partial fraction expansion method
𝑓𝑓 𝑡𝑡 = 𝐿𝐿−1 𝐹𝐹(𝑠𝑠) = 𝐿𝐿−1 𝐹𝐹1 (𝑠𝑠) + 𝐿𝐿−1 𝐹𝐹2 (𝑠𝑠) + ⋯ + 𝐿𝐿−1 𝐹𝐹𝑛𝑛 (𝑠𝑠)
3 6 1
− 𝑠𝑠 − 𝑠𝑠 + 1 +
𝑋𝑋 𝑠𝑠 =
31
+ 2 5 5 = 3 1
−
3 𝑠𝑠 + 2
=
3 1
−
3 22
5 𝑠𝑠 𝑠𝑠 + 2𝑠𝑠 + 5 5 𝑠𝑠 5 𝑠𝑠 + 1 2 + 22 5 𝑠𝑠 5 𝑠𝑠 + 1 2 + 22
Y (s )
TF = G (s ) = , provided that all initial
X (s )
conditions are zero.
MECH365 – Week 1 Lecture Notes
Consider the following general liner time invariant (LTI)
differential equation;
𝑎𝑎0 (𝑛𝑛)
𝑦𝑦
+ 𝑎𝑎 (𝑛𝑛−1) + ⋯ + 𝑎𝑎
1 𝑦𝑦 𝑛𝑛−1 𝑦𝑦̇ + 𝑎𝑎𝑛𝑛 𝑦𝑦
𝑋𝑋 𝑠𝑠 1
𝐺𝐺 𝑠𝑠 = =
𝐹𝐹 𝑠𝑠 𝑚𝑚𝑠𝑠 2 + 𝑏𝑏𝑏𝑏 + 𝑘𝑘
𝑮𝑮𝟏𝟏 + 𝑮𝑮𝟐𝟐
𝑮𝑮𝟏𝟏 − 𝑮𝑮𝟐𝟐
Transfer_function=feedback(g,-h); OR
Transfer_function=feedback(g,h,+1);
(n) ( n −1)
a0 x + a1 x + + an −1 x + an x = p (t )
The response or behavior of the system is given by the solution
of the differential equation. The complete solution 𝑥𝑥(𝑡𝑡) consists
of the complimentary solution and the particular solution.
t
lim ∞
x (t ) = t
lim ∞
x p (t )
𝐶𝐶(𝑠𝑠) 1
=
𝑅𝑅(𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1
1
, 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑇𝑇
Hence,
𝐵𝐵 1 𝐵𝐵 𝐵𝐵
C 𝑠𝑠 = = − 1
𝑠𝑠 𝑇𝑇𝑇𝑇+1 𝑠𝑠 𝑠𝑠+
𝑇𝑇
Inverse LT:
−𝑡𝑡�
c 𝑡𝑡 = 1 − 𝑒𝑒 𝑇𝑇 B
𝑒𝑒 𝑡𝑡 = 𝑟𝑟 𝑡𝑡 − 𝑐𝑐 𝑡𝑡
−𝑡𝑡� −𝑡𝑡�
= 𝐵𝐵 − 𝐵𝐵 1 − 𝑒𝑒 𝑇𝑇 = 𝐵𝐵𝑒𝑒 𝑇𝑇
1 𝑇𝑇 𝑇𝑇
= 𝐵𝐵( 2 − + 1 )
𝑠𝑠 𝑠𝑠 𝑠𝑠+
𝑇𝑇
𝑡𝑡 𝑡𝑡
−𝑇𝑇 −𝑇𝑇
𝑒𝑒 𝑡𝑡 = 𝐵𝐵𝐵𝐵 − 𝐵𝐵(𝑡𝑡 − 𝑇𝑇 + 𝑇𝑇𝑒𝑒 ) = 𝐵𝐵𝑇𝑇(1 − 𝑒𝑒 )
𝑡𝑡
−𝑇𝑇
lim 𝑒𝑒 𝑡𝑡 = lim 𝐵𝐵𝐵𝐵(1 − 𝑒𝑒 ) = 𝐵𝐵𝐵𝐵
𝑡𝑡→∞ 𝑡𝑡→∞
k b
F
𝑋𝑋(𝑠𝑠) 1
𝐺𝐺 𝑠𝑠 = =
𝐹𝐹(𝑠𝑠) 𝑚𝑚𝑠𝑠 2 + 𝑏𝑏𝑏𝑏 + 𝑘𝑘
𝑘𝑘
𝜔𝜔𝑛𝑛 =
𝑚𝑚
𝑏𝑏𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 = 2 𝑘𝑘𝑘𝑘
Peak time, tp : the time needed for the response to reach the
first peak of the overshoot,
𝜋𝜋 𝜋𝜋
Peak Time: 𝑡𝑡𝑝𝑝 = =
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ2
−ζπ� 1−ζ2
Maximum Overshoot: 𝑀𝑀𝑝𝑝 = 𝑒𝑒
4
Settling Time: 𝑡𝑡𝑠𝑠 =
ζ𝜔𝜔𝑛𝑛
R(s) C(s)
𝐾𝐾
𝐺𝐺 (𝑠𝑠) =
𝑠𝑠(𝑇𝑇𝑠𝑠 + 1)
𝜋𝜋 𝜋𝜋
𝑡𝑡𝑝𝑝 = = = 3 ⇒ 𝜔𝜔𝑛𝑛 = 1.143 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ 2
𝐶𝐶(𝑠𝑠) 𝜔𝜔𝑛𝑛2
= 2
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛2
gives
1 𝐾𝐾
2ζ𝜔𝜔𝑛𝑛 = , 𝜔𝜔𝑛𝑛 =
𝑇𝑇 𝑇𝑇
⇒ 𝑇𝑇 = 1.094, 𝐾𝐾 = 1.429
1.2
0.8
Amplitude
0.6
0.4
0.2
0 2 4 6 8 10 12 14
Time (seconds)
The higher the system type is, the smaller the steady-state
error is.
But the relative stability of the system becomes worse.
𝑠𝑠𝑠𝑠(𝑠𝑠)
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑒𝑒 𝑡𝑡 = lim 𝑠𝑠𝑠𝑠 𝑠𝑠 = lim
𝑡𝑡→∞ 𝑠𝑠→0 𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠)
1
=
1 + 𝐺𝐺(0)
1 1 1 1
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑠𝑠 2
= lim = lim
𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠 𝑠𝑠→0 𝑠𝑠 + 𝑠𝑠𝑠𝑠(𝑠𝑠) 𝑠𝑠→0 𝑠𝑠𝑠𝑠(𝑠𝑠)
1
𝑒𝑒𝑠𝑠𝑠𝑠 =
𝐾𝐾𝑣𝑣
=∞, for type 0 systems
1 1
𝑒𝑒𝑠𝑠𝑠𝑠 = = ,
𝐾𝐾𝑣𝑣 𝐾𝐾 for type 1 systems
1
𝑒𝑒𝑠𝑠𝑠𝑠 = = 0,
𝐾𝐾𝑣𝑣 for type 2 or higher systems
Note:
A type 0 system is incapable of following a ramp input in the steady state. The type 1
system with unity feedback can follow a ramp input with a finite error signal. The type 2 or
higher with unity feedback follows a ramp input with zero error at steady state.
The velocity error is not an error in velocity, but it is an error in position due to a ramp input.
Note: both type 0 and type 1 systems are incapable of following a parabolic input in the
steady state. The type 2 system with unity feedback can follow a parabolic input with a
finite error signal. The type 3 or higher with unity feedback follows a parabolic input with
zero error at steady state.
The increase of the type of system can improve the steady-state performance. This can be
done by adding integrator(s) to the feedforward path, which, however, induces an
additional stability problem.
It is generally desirable to increase the error constants (𝐾𝐾𝑝𝑝 , 𝐾𝐾𝑣𝑣 , 𝐾𝐾𝑎𝑎 ), while maintaining the
transient response within an acceptable range
15(𝑠𝑠 + 4)
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)
15(𝑠𝑠 + 4) 60 5
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 = =
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9) 72 6
15(𝑠𝑠 + 4)
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 2 =0
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)
1 6
Under unit-ramp input: 𝑒𝑒𝑠𝑠𝑠𝑠 = = = 1.2
𝐾𝐾𝑣𝑣 5
1
Under unit-parabolic input: 𝑒𝑒𝑠𝑠𝑠𝑠 = =∞
𝐾𝐾𝑎𝑎
Response
1
0
0 1 2 3 4 5 6 7 8 9 10
Unit-ramp response
10
Input
Response
5 Response
0
0 1 2 3 4 5 6 7 8 9 10
Unit-parabolic response
50
Input
Response
Response
0
0 1 2 3 4 5 6 7 8 9 10
0.5𝐾𝐾
1− = 0 ⇒ 𝐾𝐾 = 20
10
The control system includes two inputs, reference input R(s) and
disturbance D(s)
Each input can be treated independently: (a) determine the
response to R(s) by assuming D(s)=0; (b) similarly, determine the
response to D(s) by assuming R(s)=0
𝑪𝑪(𝒔𝒔) 𝑮𝑮(𝒔𝒔)
=
𝑹𝑹(𝒔𝒔) 𝟏𝟏 + 𝑮𝑮 𝒔𝒔 𝑯𝑯(𝒔𝒔)
a0 , a1 , an > 0 OR < 0
For a first order and a second order system, if the necessary
condition is satisfied, the system will definitely be stable. For
higher order systems, satisfying the necessary condition is not
sufficient.
𝐴𝐴 𝑠𝑠 = 𝑠𝑠 + 2 𝑠𝑠 2 − 𝑠𝑠 + 4 = 𝑠𝑠 3 + 𝑠𝑠 2 + 2𝑠𝑠 + 8
s2 𝑒𝑒1 𝑒𝑒2 0
s1 𝑓𝑓1 0
s0 𝑔𝑔1
𝐶𝐶(𝑠𝑠) 𝐾𝐾𝐾𝐾(𝑠𝑠)
=
𝑅𝑅(𝑠𝑠) 1 + 𝐾𝐾𝐾𝐾(𝑠𝑠)
𝑠𝑠4 1 3 5 𝑠𝑠4 1 3 5
𝑠𝑠3 2 4 0 𝑠𝑠3 1 2 0
Divided by 2
𝑠𝑠2 1 5 𝑠𝑠2 1 5
𝑠𝑠1 -6 𝑠𝑠1 -3
𝑠𝑠0 5 𝑠𝑠0 5
𝑠𝑠4 3 2 5
𝑠𝑠3 6 4
𝑠𝑠𝑠 0≈ε 5
𝑠𝑠1 (4ε-30)/ ε
𝑠𝑠0 5
jω jω jω
× × ×
× × σ
σ σ
× × ×
𝑃𝑃 𝑠𝑠 = 2𝑠𝑠 4 + 48𝑠𝑠 2 − 50 = 2 𝑠𝑠 2 − 1 𝑠𝑠 2 + 25
= 2(𝑠𝑠 + 1)(𝑠𝑠 − 1)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗)
𝐴𝐴 𝑠𝑠 = 𝑠𝑠 3 + 7𝑠𝑠 2 + 31 + 𝐾𝐾 𝑠𝑠 + 25 − 2𝐾𝐾 = 0
We can see that all elements in the 1st column are always
positive except the last row.
Since 𝐾𝐾 is assumed to be positive, for stability, the range of the
gain 𝐾𝐾 is: 25 − 2𝐾𝐾 > 0 ⇒ 0 < 𝐾𝐾 < 12.5
1 10 10
𝑒𝑒𝑠𝑠𝑠𝑠 = = = = 0.238 = 23.8%
𝐾𝐾𝑣𝑣 𝐾𝐾𝐾𝐾 70 × 0.6
Nyquist Diagram
Nyquist Diagram
10
5
8
4
𝐾𝐾=40
3
2
4 𝐾𝐾=80
2
1
Imaginary Axis
Imaginary Axis
0
0
-2
-1
-4
-2
-6
-3
-8
-4
-10
-5
-4 -2 0 2 4 6 8 10 12 14
-2 -1 0 1 2 3 4 5 6 7
Real Axis
Real Axis
𝑃𝑃 = 0, 𝑁𝑁 = 0 ⇒ 𝑍𝑍 = 0 ⇒ 𝑃𝑃 = 0, 𝑁𝑁 = 2 ⇒ 𝑍𝑍 ≠ 0 ⇒
Stable Unstable
MECH365 – Week 4 Lecture Notes
Relative stability
K: large
K: open-loop
gain
K increasing
∗-1
unstable
K: small
oscillatory stable
0
× • 𝐾𝐾𝑔𝑔 =1/|𝐺𝐺(𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 )|
-1 γ
∠G=φ Re[G] =−20 log |𝐺𝐺(𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 )| 𝑑𝑑𝑑𝑑
ω = +0
0
×
-1 γ • γ =1800 + φ
∠G=φ Re[G]
= 1800 + ∠𝐺𝐺(𝑗𝑗ω𝑐𝑐𝑐𝑐)
|G|=1
• ω𝑐𝑐𝑐𝑐 =gain crossover frequency
ωcg
ω = +0
Both phase & gain margins must be
positive for the system to be stable
MECH365 – Week 4 Lecture Notes
Finding 𝐾𝐾𝑔𝑔 on bode plot
|G|
0 dB
Kg logω
∠G
-1800 ∗
ωcp logω
0 dB
* logω
∠G
γ
-1800
ωcg logω
• Find ∠𝐺𝐺(𝑗𝑗ω𝑐𝑐𝑐𝑐)
• γ = 1800 + ∠𝐺𝐺(𝑗𝑗ω𝑐𝑐𝑐𝑐)
MECH365 – Week 4 Lecture Notes
Kg & γ for closed loop stable system
|G|
dB
Kg logω
∠G
0
γ
-180 ωcp
ωcg logω
• For the closed loop system to be stable, 𝐾𝐾𝑔𝑔 >0 & γ >0
• Stable closed loop needs, 𝐾𝐾𝑔𝑔 > 6dB & 300 <γ <600
• The slope at 𝜔𝜔𝑐𝑐𝑐𝑐 ~ − 20 dB/decade is desirable for stability
MECH365 – Week 4 Lecture Notes
Matlab command
[Gm,pm,wcp,wcg]=margin(num,den)
Gm: gain margin
pm: phase margin
wcp: phase crossover frequency
wcg: gain crossover frequency
ωcp Unit
circle
1/Kg
0
×
-1 γ
∠G=φ Re[G]
|G|=1
ωcg
ω = +0
𝑎𝑎2 𝜔𝜔2 +1
𝐺𝐺 𝑗𝑗𝜔𝜔 = , ∠𝐺𝐺 𝑗𝑗𝑗𝑗 = 𝑡𝑡𝑡𝑡𝑡𝑡−1 𝑎𝑎𝑎𝑎 − 1800
𝜔𝜔2
(Picture adapted from “Modern Control Systems”, 10E, page 569, Dorf&Bishop.)
𝐾𝐾𝐼𝐼 𝐾𝐾𝐼𝐼
𝐺𝐺 𝑗𝑗𝜔𝜔 = =
𝑗𝑗𝜔𝜔(𝑗𝑗 2 𝜔𝜔 2 + 2𝑗𝑗𝜔𝜔 + 4) 𝑗𝑗𝜔𝜔((4 − 𝜔𝜔 2 ) + 𝑗𝑗𝑗𝑗𝑗)
⇒ 𝐾𝐾𝐼𝐼 = 4.0181
Lag compensator
1
𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽 = 𝐾𝐾𝑐𝑐 𝑇𝑇 β>1
𝛽𝛽𝑇𝑇𝑇𝑇 + 1 1
𝑠𝑠 +
𝛽𝛽𝑇𝑇
Lag-lead compensator
1 1
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝑇𝑇2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 γ β > 1, γ > 1
𝑠𝑠 + 1
𝑇𝑇1 𝑠𝑠 +
𝛽𝛽𝑇𝑇2
1
𝑠𝑠 + 𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 𝐾𝐾𝑐𝑐 𝛼𝛼 0 < 𝛼𝛼 < 1
1 𝛼𝛼𝛼𝛼𝛼𝛼 + 1
𝑠𝑠 +
𝛼𝛼𝛼𝛼
𝑏𝑏1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑍𝑍2 𝑅𝑅2 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑏𝑏2 𝑠𝑠
= 𝑘𝑘
= = 𝑏𝑏2 𝑏𝑏1
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝑍𝑍1 + 𝑍𝑍2 𝑅𝑅1 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝑏𝑏1 + 𝑏𝑏2
+ 𝑅𝑅2 𝑠𝑠 + 1
𝑅𝑅1 𝑐𝑐𝑐𝑐 + 1 𝑏𝑏1 + 𝑏𝑏2 𝑘𝑘
𝑅𝑅2 𝑏𝑏1 𝑏𝑏2
𝐿𝐿𝐿𝐿𝐿𝐿 𝑅𝑅1 𝐶𝐶 = 𝑇𝑇, = 𝛼𝛼 < 1 𝐿𝐿𝐿𝐿𝐿𝐿 = 𝑇𝑇, = 𝛼𝛼 < 1
𝑅𝑅1 + 𝑅𝑅2 𝑘𝑘 𝑏𝑏1 + 𝑏𝑏2
1 1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 + 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
⇒ = 𝛼𝛼 = 𝑇𝑇 (𝛼𝛼 < 1) ⇒ = 𝛼𝛼 = 𝑇𝑇 (𝛼𝛼 < 1)
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝑠𝑠 + 1 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝑠𝑠 + 1
𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝛼𝛼𝛼𝛼
MECH365 – Week 4 Lecture Notes
Polar plot and Bode diagram of a lead compensator
(𝐾𝐾𝑐𝑐 = 1, α = 0.1)
𝑗𝑗𝑗𝑗𝑗𝑗 + 1
𝐺𝐺𝑐𝑐 𝑗𝑗𝑗𝑗 = 𝐾𝐾𝑐𝑐 𝛼𝛼 0 < 𝛼𝛼 < 1
𝑗𝑗𝑗𝑗𝑗𝑗𝑗𝑗 + 1
1
⇒ 𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼
𝑌𝑌(𝑠𝑠) 𝐾𝐾
The transfer function is: =
𝑋𝑋(𝑠𝑠) 𝑠𝑠(𝑀𝑀𝑀𝑀 + 𝐵𝐵)
1
𝑠𝑠 + 𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 𝐾𝐾𝑐𝑐 𝛼𝛼 0 < 𝛼𝛼 < 1
1 𝛼𝛼𝛼𝛼𝛼𝛼 + 1
𝑠𝑠 +
𝛼𝛼𝛼𝛼
⇒ 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼 = 10
1 − 𝛼𝛼
sin 𝜙𝜙m =
1 + 𝛼𝛼
1 − 𝛼𝛼 1 − sin380
sin380 = ⇒ 𝛼𝛼 = 0
= 0.24
1 + 𝛼𝛼 1 + sin38
Magnitude modification is
1 1
= = 2.0412 = 6.1979 𝑑𝑑𝑑𝑑
𝛼𝛼 0.24
40
or 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = = 0.4899
𝜔𝜔𝑐𝑐𝑐𝑐 � 2 +22
𝜔𝜔𝑐𝑐𝑐𝑐
4 2
𝜔𝜔𝑐𝑐𝑐𝑐 + 4𝜔𝜔𝑐𝑐𝑐𝑐 − 6666.2253 = 0
2 2
𝜔𝜔𝑐𝑐𝑐𝑐 = 79.6741 𝑜𝑜𝑜𝑜 𝜔𝜔𝑐𝑐𝑐𝑐 =-83.6741 (neglect)
10
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼 ⇒ 𝐾𝐾𝑐𝑐 = = 41.7
0.24
1
𝑠𝑠 + 𝑠𝑠 + 4.3728
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 41.7
1 𝑠𝑠 + 18.22
𝑠𝑠 +
𝛼𝛼𝛼𝛼
𝑠𝑠 + 4.3728 4
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠) = 41.7
𝑠𝑠 + 18.22 𝑠𝑠(𝑠𝑠 + 2)
𝑠𝑠 + 4.3728 4
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠) = 41.7
𝑠𝑠 + 18.22 𝑠𝑠(𝑠𝑠 + 2)
Gm =Inf
Pm =50.4217 degrees numc=41.7*4*[1,4.3728];
denc=conv([1,18.22],[1,2,0]);
Wcp =Inf gc=tf(numc,denc);
Wcg =8.9314 rad/sec [Gm,Pm,Wcp,Wcg]=margin(gc)
numc=41.7*4*[1,4.3728];
0.8
denc=conv([1,18.22],[1,2,0]);
gc=tf(numc,denc);
Outputs
cl_gc=feedback(gc,1);
0.6
t=0:0.1:8;
0.4 c1=step(cl_g1,t);
c2=step(cl_gc,t);
0.2
plot(t,c1,'.',t,c2,'-')
grid
title('Unit-step responses of uncompensated and
0 compensated systems')
0 1 2 3 4 5 6 7 8
xlabel('\bft')
t
ylabel('\bfOutputs')
legend('uncompensated','compensated')
6
numc=41.7*4*[1,4.3728];
denc=conv([1,18.22],[1,2,0]);
5
gc=tf(numc,denc);
cl_gc=feedback(gc,1);
Outputs
t=0:0.1:8;
3
u=t;
2
yramp_u=lsim(cl_g1,u,t);
yramp_c=lsim(cl_gc,u,t);
1
plot(t,u,t,yramp_u,'*',t,yramp_c,'.')
grid
0 title('Unit-ramp responses of uncompensated and
0 1 2 3 4 5 6 7 8 compensated systems')
t xlabel('\bft')
ylabel('\bfOutputs')
legend('input','uncompensated','compensated')
𝑗𝑗𝑗𝑗𝑗𝑗 + 1
𝐺𝐺𝑐𝑐 𝑗𝑗𝑗𝑗 = 𝐾𝐾𝑐𝑐 𝛽𝛽 𝛽𝛽 > 1
𝑗𝑗𝑗𝑗𝑗𝑗𝑗𝑗 + 1
2
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽
𝛽𝛽𝛽𝛽𝛽𝛽 + 1
2
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝑇𝑇𝑇𝑇 + 1 2
= lim 𝑠𝑠𝑠𝑠 = 𝐾𝐾 = 5
𝑠𝑠→0 𝛽𝛽𝛽𝛽𝛽𝛽 + 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
so
10
𝐺𝐺1 𝑗𝑗𝜔𝜔 =
𝑗𝑗𝜔𝜔(𝑗𝑗𝜔𝜔 + 1)(𝑗𝑗𝜔𝜔 + 2)
𝜋𝜋 −1 𝜔𝜔 −1 𝜔𝜔
∠𝐺𝐺1 𝑗𝑗𝑗𝑗 = − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡
2 1 2
𝜋𝜋 −1 𝜔𝜔𝑐𝑐𝑐𝑐 −1 𝜔𝜔𝑐𝑐𝑐𝑐
∠𝐺𝐺1 (j𝜔𝜔𝑐𝑐𝑐𝑐 )= − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡 =-𝜋𝜋 ⇒
2 1 2
−1 𝜔𝜔𝑐𝑐𝑐𝑐 +𝑡𝑡𝑡𝑡𝑡𝑡−1 𝜔𝜔𝑐𝑐𝑐𝑐 =𝜋𝜋 ⇒ 𝜔𝜔
𝑡𝑡𝑡𝑡𝑡𝑡 𝑐𝑐𝑐𝑐 = 1.4142 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
1 2 2
50
Magnitude (dB)
0
-50
-100
-90
Phase (deg)
-180
-270
-2 -1 0 1 2
10 10 10 10 10
Frequency (rad/s)
The target phase margin is 40º, which cannot be achieved by changing the gain K.
One solution is to use a lag compensator to find a new gain crossover frequency for
satisfying the phase margin requirement
The lag compensator determines the attenuation necessary to bring the magnitude
curve down to 0dB at the new gain crossover frequency
MECH365 – Week 5 Lecture Notes
Step 3: As the 𝐺𝐺1 jω does NOT satisfy the PM and GM
specifications, we need to determine a new frequency to satisfy the
required total phase margin. The total required phase margin is
specified: 𝑃𝑃𝑃𝑃𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 = 𝑃𝑃𝑃𝑃 + (50 𝑡𝑡𝑡𝑡 120 ). This frequency is the
new gain crossover frequency, 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 .
−1 −1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 𝜋𝜋
or tan 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 + tan = 38
2 180
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
Let 𝜃𝜃1 = tan−1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 and 𝜃𝜃2 = tan−1 , then tan 𝜃𝜃1 = 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 and
2
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
tan 𝜃𝜃2 =
2
tan 𝜃𝜃1 +tan 𝜃𝜃2
we can use the angle formula tan 𝜃𝜃1 + 𝜃𝜃2 = to determine 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 .
1−tan 𝜃𝜃1 tan 𝜃𝜃2
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 𝜋𝜋
tan(tan−1 (𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) −1
+ tan ( )) = tan(38 )
2 180
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 +
2 = 0.78 ⟹ 0.39𝜔𝜔 2
+ 1.5𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 − 0.78 = 0
2 𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
1−
2
𝑇𝑇𝑇𝑇𝜔𝜔 + 1 𝑇𝑇 2 𝜔𝜔 2 + 1
=
-10
-20 β = 10 𝑇𝑇 2 𝜔𝜔 2 𝑇𝑇𝑇𝑇 1
β = 20 ≈ = =
𝛽𝛽2 𝑇𝑇 2 𝜔𝜔 2 𝛽𝛽𝑇𝑇𝑇𝑇 𝛽𝛽
-30
(𝑇𝑇 2 𝜔𝜔2 ≫ 1)
0
-30
1
-60
the lag compensator is , or
𝛽𝛽
1
-90
20𝑙𝑙𝑙𝑙𝑙𝑙 = −20𝑙𝑙𝑙𝑙𝑙𝑙𝛽𝛽 dB
10
-4
10
-3
10
-2
10
-1
10 0
10
1
𝛽𝛽
Frequency (rad/s)
⇒ 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) = 𝛽𝛽
5
𝛽𝛽 = 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) =
2 2
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 � 1 + 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 � 1 + 0.25𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
5
= = 9.52
0.464 � 1 + 0.4642 � 1+ 0.25×0.4642
= 19.57dB
1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 0.464
= = = 0.0464
𝑇𝑇 10 10
Then calculate
𝐾𝐾 5
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽 ⇒ 𝐾𝐾𝑐𝑐 = = = 0.525
𝛽𝛽 9.52
1
𝑠𝑠 + 𝑠𝑠 + 0.0464
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 0.525
1 𝑠𝑠 + 0.00487
𝑠𝑠 +
𝛽𝛽𝛽𝛽
Gm =14.5794 dB numc=0.525*2*[1,0.0464];
Pm =46.8258 degrees denc=conv([1,0.00487],[1,3,2,0]);
numc=0.525*2*[1,0.0464];
denc=conv([1,0.00487],[1,3,2,0]);
gc=tf(numc,denc);
cl_gc=feedback(gc,1);
wb_u=bandwidth(cl_g1)
wb_c=bandwidth(cl_gc)
1 numc=0.525*2*[1,0.0464];
denc=conv([1,0.00487],[1,3,2,0]);
0.8 gc=tf(numc,denc);
cl_gc=feedback(gc,1);
Outputs
0.6
t=0:0.1:50;
c1=step(cl_g1,t);
0.4
c2=step(cl_gc,t);
plot(t,c1,'.',t,c2,'-')
0.2
grid
title('Unit-step responses of
0 uncompensated and compensated
0 5 10 15 20 25 30 35 40 45 50
systems')
t
xlabel('\bft')
ylabel('\bfOutputs')
legend('uncompensated','compensated')
25
20
t=0:0.1:50;
15 u=t;
yramp_u=lsim(cl_g1,u,t);
10
yramp_c=lsim(cl_gc,u,t);
5 plot(t,u,t,yramp_u,'-',t,yramp_c,'.')
grid
0
0 5 10 15 20 25 30 35 40 45 50 title('Unit-ramp responses of uncompensated
t and compensated systems')
xlabel('\bft')
ylabel('\bfOutputs')
legend('input','uncompensated','compensated')
0
Magnitude (dB)
-50
-100
-150
-90
Phase (deg)
-180
compensated
-270
-2 -1 1 2 Bode Diagram
10 10 10 0 10 10
100
Frequency (rad/s)
50
uncompensated 0
Magnitude (dB)
-50
-100
-150
-90
Phase (deg)
-180
-270
MECH365 – Week 5 Lecture Notes -4 -3 -2 -1 1 2
10 10 10 10 10 0 10 10
Lag-lead compensator
The lag-lead compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠) is defined by
1 1
𝑠𝑠+ 𝑠𝑠+
𝑇𝑇1 𝑇𝑇2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛾𝛾 1 (𝛾𝛾 > 1 𝑎𝑎𝑎𝑎𝑎𝑎 𝛽𝛽 > 1)
𝑠𝑠+ 𝑠𝑠+
𝑇𝑇1 𝛽𝛽𝑇𝑇2
1
𝑠𝑠+𝑇𝑇 1 𝑇𝑇1 𝑠𝑠+1
𝛾𝛾
1
= 𝛾𝛾 > 1 ⟹ lead network
𝑠𝑠+𝑇𝑇 𝛾𝛾 1𝑇𝑇1 𝑠𝑠+1
1 𝛾𝛾
1
𝑠𝑠+𝑇𝑇 𝑇𝑇2 𝑠𝑠+1
1
2
= 𝛽𝛽 (𝛽𝛽 > 1) ⟹ lag network
𝑠𝑠+𝛽𝛽𝑇𝑇 𝛽𝛽𝑇𝑇2 𝑠𝑠+1
2
1 1
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1)
𝑠𝑠+𝑇𝑇 𝑠𝑠+𝑇𝑇
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇1 =𝐾𝐾𝑐𝑐 𝛽𝛽 1
2
(𝛽𝛽 > 1)
𝛽𝛽
𝑠𝑠+1 (𝛽𝛽𝑇𝑇2 𝑠𝑠+1) 𝑠𝑠+𝑇𝑇 𝑠𝑠+𝛽𝛽𝑇𝑇
1 2
𝐾𝐾
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
1 1
𝑠𝑠 + 𝑠𝑠 + 𝐾𝐾
𝑇𝑇1 𝑇𝑇2
= lim 𝑠𝑠
𝑠𝑠→0 𝛽𝛽 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝛽𝛽𝑇𝑇2
𝐾𝐾
= = 10 ⇒ 𝐾𝐾 = 20
2
so
20
𝐺𝐺1 𝑗𝑗𝜔𝜔 =
𝑗𝑗𝜔𝜔(𝑗𝑗𝜔𝜔 + 1)(𝑗𝑗𝜔𝜔 + 2)
𝜋𝜋 −1 𝜔𝜔 −1 𝜔𝜔
∠𝐺𝐺1 𝑗𝑗𝑗𝑗 = − −𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡
2 1 2
50
Magnitude (dB)
-50
-100
-90
Phase (deg)
-180
-270
-2 -1 1 2
10 10 10 0 10 10
Frequency (rad/s)
𝑠𝑠 + 0.5 1 2𝑠𝑠 + 1
=
𝑠𝑠 + 5 10 0.2𝑠𝑠 + 1
𝑠𝑠 + 0.5 𝑠𝑠 + 0.14 20
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 =
𝑠𝑠 + 5 𝑠𝑠 + 0.014 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
Bode Diagram
Gm = 13.1 dB (at 3.53 rad/s) , Pm = 50.9 deg (at 1.37 rad/s)
150
100
50
Magnitude (dB)
-50
-100
-90
Phase (deg)
-180
-270
-4 -3 -2 -1 1 2
10 10 10 10 10 0 10 10
Frequency (rad/s)
PID Controllers
(Chapter 8, Section 1-4)
𝟏𝟏
The PID controller is given by 𝑮𝑮𝒄𝒄 𝒔𝒔 = 𝑲𝑲𝒑𝒑 𝟏𝟏 + + 𝑻𝑻𝒅𝒅 𝒔𝒔
𝑻𝑻𝒊𝒊 𝒔𝒔
where 𝐾𝐾𝑝𝑝 , 𝑇𝑇𝑖𝑖 and 𝑇𝑇𝑑𝑑 are the proportional gain, integral time, and the
derivative time, respectively.
MECH365 – Week 6 Lecture Notes
Alternatively, the transfer function of the PID controller can also be
given as
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 + 𝐾𝐾𝑖𝑖 + 𝐾𝐾𝑑𝑑 𝑠𝑠
𝑠𝑠
where 𝐾𝐾𝑖𝑖 and 𝐾𝐾𝑑𝑑 are the integral gain and the derivative gain,
respectively.
MECH365 – Week 6 Lecture Notes
There are five forms of PID-based controllers. They are P, I,
PI, PD, PID controllers.
When the integral and derivative gains are zero, the PID controller
reduces to a Proportional controller (P)
When the proportional and derivative gains are zero, the PID
controller reduces to an Integral controller (I)
When the derivative gain is zero, the PID controller reduces to a
Proportional-plus-Integral controller (PI)
When the integral gain is zero, the PID controller reduces to a
Proportional-plus-Derivative controller (PD)
Normal PID
1
The integrator or term is to eliminate a steady-state
𝑠𝑠
error in the system’s step response
The derivative or s term is to improve the transient
response. Note: the derivative term is used together with a
P (PD) or and I controller (PID) – it can never be used alone
Though the steady-state accuracy of both PI and I
controllers are very similar, the PI controller gives a
smaller settling time
MECH365 – Week 6 Lecture Notes
Effect of increasing the PID gains 𝐾𝐾𝑝𝑝 , 𝐾𝐾𝑖𝑖 𝑎𝑎𝑎𝑎𝑎𝑎 𝐾𝐾𝑑𝑑
on the step response
Inflection point
Use Ziegler-Nichols (ZN) tuning rules to determine the values of Kp, Ti,
and Td. Then obtain a unit-step response curve and check to see if the
designed system exhibits approximately 25% overshoot.
0.6
0.5
0.4
L = 0.053 sec
Amplitude
0.3
T = 0.798 sec
0.2
0.1
0
0 0.5 1 1.5 2 2.5
Time (seconds)
The system is very oscillatory, because the dominant closed loop poles are
very close to the imaginary axis.
MECH365 – Week 6 Lecture Notes
3. Adjust the values of Kp, Ti, and Td by doubling each value
Kp=36.136, Ti=0.212, Td=0.053
Use ZN tuning rules to determine the values of Kp, Ti, and Td. Then obtain
a unit-step response curve and check to see if the designed system
exhibits approximately 25% overshoot. If the overshoot is excessive (40%
or above) make a fine tuning and reduce the amount of the maximum
overshoot to approximately 25%
MECH365 – Week 6 Lecture Notes
1. Since the plant has an integrator, we use the second method of ZN
tuning rules. By setting 𝑇𝑇𝑖𝑖 = ∞ and 𝑇𝑇𝑑𝑑 = 0, the close loop transfer
function is
𝐶𝐶(𝑠𝑠) 𝐾𝐾𝑝𝑝
=
𝑅𝑅(𝑠𝑠) 𝑠𝑠 𝑠𝑠 + 1 𝑠𝑠 + 5 + 𝐾𝐾𝑝𝑝
2. The characteristic equation of the C.L.T.F. is
𝑠𝑠 3 + 6𝑠𝑠 2 + 5𝑠𝑠 + 𝐾𝐾𝑝𝑝 = 0
Use the Routh array to determine the critical gain 𝐾𝐾𝑐𝑐𝑐𝑐
𝑠𝑠 3 1 5
30 − 𝐾𝐾𝑝𝑝
𝑠𝑠 2 6 𝐾𝐾𝑝𝑝 𝐿𝐿𝐿𝐿𝐿𝐿 =0
6
30−𝐾𝐾𝑝𝑝
𝑠𝑠1 𝐾𝐾𝑐𝑐𝑐𝑐 = 30
6
𝑠𝑠 0 𝐾𝐾𝑝𝑝
MECH365 – Week 6 Lecture Notes
3. To find the frequency of the sustained oscillations by substituting s = jω
into the characteristic equation and equate both real and imaginary parts
to zero simultaneously
𝑗𝑗𝜔𝜔 3 +6 𝑗𝑗𝜔𝜔 2 + 5 𝑗𝑗𝜔𝜔 + 30 = 0
or 30 − 6𝜔𝜔2 +𝑗𝑗(5𝜔𝜔−𝜔𝜔3 )=0
30 − 6𝜔𝜔 2 =0
⇒ � 3 ⇒ 𝜔𝜔 = 5 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
5𝜔𝜔 − 𝜔𝜔 = 0
1 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠 =18 1 + + 0.35124𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠 1.405𝑠𝑠
6.3223(𝑠𝑠+1.4235)2
=
𝑠𝑠
Unit-step response
1.8
Overshoot = 62%
1.6
num1=6.3223*[1 2.847
1.4
1.4235^2];
den1=[1 0];
1.2
g_1=tf(num1,den1);
g_2=tf([1],[1 6 5 0]);
1
g_h=series(g_1,g_2);
Amplitude
cl_tf=feedback(g_h,1);
0.8
t=0:0.1:14;
step(cl_tf,t)
0.6
gtext('Overshoot = 62%')
xlabel('\bfTime (sec)')
0.4
ylabel('\bfAmplitude')
title('\bfUnit-step response')
0.2
0
0 2 4 6 8 10 12 14
Time (sec) (seconds)
1 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠 =𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠 4𝑇𝑇𝑑𝑑 𝑠𝑠
2
1
𝑠𝑠+2𝑇𝑇
=𝐾𝐾𝑝𝑝 𝑇𝑇𝑑𝑑 𝑑𝑑
𝑠𝑠
1 1
𝐿𝐿𝐿𝐿𝐿𝐿 = 0.65 𝑜𝑜𝑜𝑜 𝑇𝑇𝑑𝑑 = = 0.7692
2𝑇𝑇𝑑𝑑 1.3
(𝑠𝑠 + 0.65)2
⇒ 𝐺𝐺𝑐𝑐 𝑠𝑠 = 18 × 0.7692
𝑠𝑠
(𝑠𝑠+0.65) 2
= 13.8456
𝑠𝑠
1 num1=13.8456*[1 1.3
0.65^2];
den1=[1 0];
0.8
g_1=tf(num1,den1);
g_2=tf([1],[1 6 5 0]);
g_h=series(g_1,g_2);
Amplitude
0.6
cl_tf=feedback(g_h,1);
t=0:0.1:14;
0.4 step(cl_tf,t)
gtext('Overshoot = 18%')
0.2
xlabel('\bfTime (sec)')
ylabel('\bfAmplitude')
title('\bfUnit-step response')
0
0 2 4 6 8 10 12 14
Time (sec) (seconds)
Overshoot = 28%
num1=30.322*[1 1.3 0.65^2];
1.2 den1=[1 0];
g_1=tf(num1,den1);
1 g_2=tf([1],[1 6 5 0]);
g_h=series(g_1,g_2);
0.8 cl_tf=feedback(g_h,1);
t=0:0.1:14;
Amplitude
0.6
step(cl_tf,t)
gtext('Overshoot = 28%')
0.4
xlabel('\bfTime (sec)')
ylabel('\bfAmplitude')
title('\bfUnit-step response')
0.2
0
0 2 4 6 8 10 12 14
Time (sec) (seconds)
Though the increase of Kp has increased the maximum overshoot, the speed of response is
increased. As the overshoot is fairly close to 25% and the response is faster, the final tuned
values are: Kp=39.42, Ti=3.077, Td=0.7692
MECH365 – Week 6 Lecture Notes
Revision
(week 1-6)
𝐾𝐾
𝐺𝐺 𝑠𝑠 =
𝑇𝑇𝑇𝑇 + 1
𝐾𝐾𝜔𝜔𝑛𝑛2
𝐺𝐺 𝑠𝑠 = 2
𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛2
𝜋𝜋 𝜋𝜋
Peak Time: 𝑡𝑡𝑝𝑝 = =
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ2
−ζπ� 1−ζ2
Maximum Overshoot: 𝑀𝑀𝑝𝑝 = 𝑒𝑒
4
Settling Time: 𝑡𝑡𝑠𝑠 =
ζ𝜔𝜔𝑛𝑛
Im[G]
ωcp Unit
circle
|G|
1/Kg
dB
0
Kg logω
×
-1 γ
∠G
∠G=φ Re[G]
0
γ
-180 ωcp
|G|=1 ωcg logω
ωcg
ω = +0
sn a0 a2 a4 … 0
sn-1 a1 a3 a5 … 0
sn-2 b1 b2 b3 …
sn-3 c1 c2 c3 …
sn-4 d1 d2 d3 …
. . .
. . .
. . .
s2 e1 e2
s1 f1 0
s0 g1
𝑮𝑮𝟏𝟏 (𝒔𝒔)
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽
R(s) K2 C(s)
+ K1
- s(s + 10)
K = 50
K=∞
10
jω
8
K = 35 6
K=0
2
K=0 5 10 15 20 25 20 15 10
σ
0
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0
-2
K=5
-4
-6
K = 35
-8
K = 50 -10
K=∞
1 + G(s)H(s) = 0 (1)
G(s)H(s) = -1 (2)
♦ |G(s0)H(s0)| = |-1| = 1
magnitude condition
𝐵𝐵(𝑠𝑠)
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) = 𝐾𝐾
𝐴𝐴(𝑠𝑠)
s0
A2 θ2
×
-p2
A4
B1 A1
θ4 φ1 θ1
× ×
-p4 -z1 A3 -p1
σ
θ3
Open-loop transfer function is:
×
𝐾𝐾(𝑠𝑠 + 𝑧𝑧1 ) -p3
𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 =
(𝑠𝑠 + 𝑝𝑝1 )(𝑠𝑠 + 𝑝𝑝2 )(𝑠𝑠 + 𝑝𝑝3 )(𝑠𝑠 + 𝑝𝑝4 )
It has one open-loop zero: 𝑠𝑠 = −𝑧𝑧1 (marked with circle), and four open-loop poles: 𝑠𝑠 =
− 𝑝𝑝1 , −𝑝𝑝2 , −𝑝𝑝3 , −𝑝𝑝4 (marked with cross)
s0 is a test point in the root locus; it must meet both the angle and magnitude conditions
𝐾𝐾𝐵𝐵1
⇒ =1
𝐴𝐴1 𝐴𝐴2 𝐴𝐴3 𝐴𝐴4
where 𝐴𝐴1 , 𝐴𝐴2 , 𝐴𝐴3 , 𝐴𝐴4 , 𝐵𝐵1 are the magnitudes from the poles −𝑝𝑝1 , −𝑝𝑝2 , −𝑝𝑝3 , −𝑝𝑝4 and
zero −𝑧𝑧1 to the test points 𝑠𝑠0
𝐾𝐾
For this system, 𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
= ±1800 , ±5400 , ⋯
• Magnitude criterion
𝐾𝐾
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) = =1
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
s= ∞, ∞, ∞
MECH365 – Week 8 Lecture Notes
• These are open-loop poles and zeros; mark the poles by
crosses and zeros by small circles
jω
× × ×
-2 -1 0
σ
• Use the angle condition to test for locus on the real axis
• Hence the root loci exist on the negative real axis between
0 → − 1, and – 2 → ∞
× × ×
-2 -1 0
σ
±1800 (2𝑘𝑘 + 1)
=
3−0
0
= ±60 2𝑘𝑘 + 1
1800 600
× × ×
-1 0
-2 -600 σ
intersection
∑ 𝑝𝑝𝑖𝑖 − ∑ 𝑧𝑧𝑗𝑗 −0 − 1 − 2
𝜎𝜎𝑎𝑎 = = = −1
𝑛𝑛 − 𝑚𝑚 3−0
𝐾𝐾𝑐𝑐𝑐𝑐 = 6 ⇒ 𝜔𝜔 = ±𝑗𝑗 2
𝐾𝐾𝑐𝑐𝑐𝑐 = 0 ⇒ 𝜔𝜔 = 𝑗𝑗𝑗
Therefore, the imaginary crossing points are: 𝑗𝑗𝑗, 𝑗𝑗 2, −𝑗𝑗 2
θ2 θ1
θ3
× × ×
-2 -1 0
σ
K=6
K=6 β
∞ K × × ×
-3 -2 -1 0 σ
K=6
• System stability
0 < K < 6: stable (all closed-loop poles line on left-hand
plane (LHP)
K = 6: critically stable (poles are on imaginary axis)
K > 6: unstable (poles are RHP)
• Damping coefficient ζ
Angle β = cos-1ζ or ζ = cos β
𝐾𝐾(𝑠𝑠 + 2)
For this system, 𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = 2
𝑠𝑠 + 2𝑠𝑠 + 3
𝑠𝑠 = −1 + 𝑗𝑗 2 𝑎𝑎𝑎𝑎𝑎𝑎 𝑠𝑠 = −1 − 𝑗𝑗 2
-2 -1 0
σ
s0 φ1 =1800
-2 -1 0
σ
θ2
×
s0 φ1 =1800
-2 -1 0
σ
θ2
×
⇒ 𝑠𝑠 2 + 4𝑠𝑠 + 1 = 0
⇒ 𝑠𝑠 = −3.732, 𝑠𝑠 = −0.268 (𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛)
K=5.4641
-4 -3 -2 -1 0
σ
break-in point ×
s0 = -3.7320
Thus
K=5.4641
-4 -3 -2 -1 0
σ
break-in point ×
s0 = -3.7320
ζ line jω
1450
×
K=5.4641
β=cos-1ζ
-4 -3 -2 -1 0
σ
break-in point ×
s0 = -3.7320
2 2
𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛 =0
jω ζ <1
jω
ζ >1
×
s =-σ1, -σ2 s =-σ ± jω
ωn
φ
× ×
-σ 2 -σ 1
σ σ
𝜎𝜎 = ζ𝜔𝜔𝑛𝑛 ×
• As the roots move away from the real axis the frequency
increases
• Roots to the right of the imaginary axis indicate an unstable
system
• Roots along the real axis indicate overdamping; away from
the real axis indicates underdamping; along the imaginary
axis indicate undamping
Frequency Domain:
- Phase margin
- Gain margin
- Resonant peak value bandwidth
MECH365 – Week 10 Lecture Notes
Modification of Plant Dynamics
Add a zero
𝑏𝑏1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑍𝑍2 𝑅𝑅2 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑏𝑏2 𝑠𝑠
= 𝑘𝑘
= = 𝑏𝑏2 𝑏𝑏1
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝑍𝑍1 + 𝑍𝑍2 𝑅𝑅1 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝑏𝑏1 + 𝑏𝑏2
+ 𝑅𝑅2 𝑠𝑠 + 1
𝑅𝑅1 𝑐𝑐𝑐𝑐 + 1 𝑏𝑏1 + 𝑏𝑏2 𝑘𝑘
𝑅𝑅2 𝑏𝑏1 𝑏𝑏2
𝐿𝐿𝐿𝐿𝐿𝐿 𝑅𝑅1 𝐶𝐶 = 𝑇𝑇, = 𝛼𝛼 < 1 𝐿𝐿𝐿𝐿𝐿𝐿 = 𝑇𝑇, = 𝛼𝛼 < 1
𝑅𝑅1 + 𝑅𝑅2 𝑘𝑘 𝑏𝑏1 + 𝑏𝑏2
1 1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 + 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
⇒ = 𝛼𝛼 = 𝑇𝑇 (𝛼𝛼 < 1) ⇒ = 𝛼𝛼 = 𝑇𝑇 (𝛼𝛼 < 1)
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝑠𝑠 + 1 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝑠𝑠 + 1
𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝛼𝛼𝛼𝛼
MECH365 – Week 10 Lecture Notes
Characteristics of lead networks
1 jω
𝑠𝑠 +
𝑇𝑇 𝛼𝛼 < 1
1
𝑠𝑠 + × O
𝛼𝛼𝑇𝑇 −
1
𝛼𝛼𝛼𝛼 −
1 σ
𝑇𝑇
• Have a zero at s = - 1/T
• Have a pole at s = -1/(αT)
• Since α < 1, the pole is to the far left of the zero
i.e. × ---------- o
• A lead network is basically a highpass filter and hence will require
additional gain, 𝐾𝐾𝑐𝑐 , elsewhere to pass low frequencies, thus,
1
𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇
1
𝑠𝑠 +
𝛼𝛼𝑇𝑇
MECH365 – Week 10 Lecture Notes
Positive angle contribution of a lead compensator
Test point 𝑠𝑠 • jω
𝜃𝜃𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿
𝑠𝑠 + 𝑧𝑧1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝜃𝜃𝑝𝑝 𝜃𝜃𝑧𝑧
𝑠𝑠 + 𝑝𝑝1 × O
σ
−𝑝𝑝1 −𝑧𝑧1
jω
s = −2 ± j2 3 • To increase ω𝑛𝑛 from 2 to 4
j4
4
∠ � = 00 − 𝜃𝜃1 − 𝜃𝜃2
𝑠𝑠(𝑠𝑠 + 2) 𝑠𝑠=−2+𝑗𝑗𝑗 3
NB: The approach for determining the pole and zero locations is
called Method 1
1.5
4
2
0.5
Imaginary Axis
Imaginary Axis
0 0
-0.5
-2
-1
-4
-1.5
-2 -6
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 -6 -5 -4 -3 -2 -1 0
Real Axis Real Axis
1
Output c1 and c2
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
t Sec
MECH365 – Week 10 Lecture Notes
Method 2
• Choose the zero of the lead compensator
s=-2 so that it will cancel the plant pole at
s=-2
• From the angle condition,
∠𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠)� = ∅1 − 𝜃𝜃1 − 𝜃𝜃2 − 𝜃𝜃3 = −1800
𝑠𝑠=−2+𝑗𝑗𝑗 3
⇒ 𝐾𝐾𝑐𝑐 = 4
𝑠𝑠+2
Hence 𝐺𝐺𝑐𝑐 𝑠𝑠 = 4 𝑠𝑠+4
MECH365 – Week 10 Lecture Notes
Comparison of step responses of thecompensated
(methods 1 and 2) and uncompensated systems
Uncompensated system 1.4
𝐶𝐶(𝑠𝑠) 4
= 2 Method 1
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 2𝑠𝑠 + 4 1.2
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Under a step input, the system response by Method 1 has a bit higher overshoot than the
compensated system designed by Method 2
MECH365 – Week 10 Lecture Notes
Comparison of ramp responses of the compensated
(methods 1 and 2) systems
num1=18.7*[1 2.9];
den1=[1 7.4 29.5 54.23 0]; 5
Unit-Ramp Responses of compensated Systems
num2=[16]; 4.5
Under a ramp input, the system response by Method 1 has a smaller steady-state error
than the compensated system designed by Method 2
1 𝑏𝑏2
𝑅𝑅2 + 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑏𝑏2 𝑠𝑠 + 𝑘𝑘 𝑠𝑠 + 1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑍𝑍2 𝑅𝑅2 𝐶𝐶2 𝑠𝑠 + 1
𝐶𝐶2 𝑠𝑠 = = 𝑘𝑘
= = = 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝑏𝑏1 + 𝑏𝑏2 𝑠𝑠 + 𝑘𝑘 𝑏𝑏1 + 𝑏𝑏2 𝑠𝑠 + 1
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝑍𝑍1 + 𝑍𝑍2 𝑅𝑅 + 𝑅𝑅 + 1 𝑅𝑅1 + 𝑅𝑅2 𝐶𝐶2 𝑠𝑠 + 1
1 2 𝐶𝐶2 𝑠𝑠 𝑘𝑘
𝑏𝑏2 𝑏𝑏1 +𝑏𝑏2
𝐿𝐿𝐿𝐿𝐿𝐿 𝑅𝑅2 𝐶𝐶2 = 𝑇𝑇,
𝑅𝑅1 +𝑅𝑅2
= 𝛽𝛽 > 1 𝐿𝐿𝐿𝐿𝐿𝐿 = 𝑇𝑇, = 𝛽𝛽 > 1
𝑅𝑅2 𝑘𝑘 𝑏𝑏2
1 1
𝐸𝐸𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 1 𝑠𝑠 + 𝑇𝑇 𝑋𝑋𝑜𝑜 (𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1 1 𝑠𝑠 + 𝑇𝑇
= = (𝛽𝛽 > 1) = = (𝛽𝛽 > 1)
𝐸𝐸𝑖𝑖 (𝑠𝑠) 𝛽𝛽𝛽𝛽𝛽𝛽 + 1 𝛽𝛽 𝑠𝑠 + 1 𝑋𝑋𝑖𝑖 (𝑠𝑠) 𝛽𝛽𝛽𝛽𝛽𝛽 + 1 𝛽𝛽 𝑠𝑠 + 1
𝛽𝛽𝛽𝛽 𝛽𝛽𝛽𝛽
𝑠𝑠 +
𝑇𝑇 𝛽𝛽 > 1
1
𝑠𝑠 + O ×
𝛽𝛽𝑇𝑇 −
1
𝑇𝑇
−
1
𝛽𝛽𝛽𝛽
σ
Note that both the pole and zero are placed very close to each other and
close the origin, which can ensure that the shape of the root locus has
almost no change
MECH365 – Week 10 Lecture Notes
Characteristics of lag networks
• As the pole and zero are placed very close to each other, the
magnitudes 𝑠𝑠 + 1/𝑇𝑇 and 𝑠𝑠 + 1/(β𝑇𝑇) are almost equal
1
𝑠𝑠 +
𝐺𝐺𝑐𝑐 (𝑠𝑠) = 𝐾𝐾𝑐𝑐 𝑇𝑇 ≈ 𝐾𝐾
1 𝑐𝑐
𝑠𝑠 +
𝛽𝛽𝛽𝛽
0.25
0.2
0.15
0.1
0.05
Imaginary Axis
0
-0.05
-0.1
-0.15
-0.2
-0.25
where 𝐾𝐾 = 1.06𝐾𝐾𝑐𝑐
𝐾𝐾(𝑠𝑠 + 0.05)
=1
𝑠𝑠(𝑠𝑠 + 0.005)(𝑠𝑠 + 1)(𝑠𝑠 + 2) 𝑠𝑠=−0.31+𝑗𝑗𝑗.55
⇒ 𝐾𝐾 = 1.0235
35
numc=1.0235*[1 0.05];
denc=conv([1 0.005],[1 3 2 0]);
30
gc=tf(numc,denc);
Output c1 and c2
gc_cl=feedback(gc,1);
25
t=0:0.1:50;
20
uramp=t;
[c1]=lsim(g1_cl,uramp,t);
15
[c2]=lsim(gc_cl,uramp,t);
plot(t,c1,'r',t,c2,'g',t,uramp)
10
grid
5
title('Unit-Ramp Responses of Compensated and
Uncompensated Systems')
xlabel('\bft Sec')
0
0 5 10 15 20 25 30 35 40 45 50 ylabel('\bfOutput c1 and c2')
t Sec
legend('Uncompensated system', 'Compensated
system')
1 numc=1.0235*[1 0.05];
denc=conv([1 0.005],[1 3 2 0]);
gc=tf(numc,denc);
0.8 gc_cl=feedback(gc,1);
Output c1 and c2
t=0:0.1:50;
0.6
Lag-compensated system exhibits a larger [c1]=step(g1_cl,t);
[c2]=step(gc_cl,t);
0.4
maximum overshoot and slower response plot(t,c1,'r',t,c2,'g')
grid
title('Unit-Step Responses of Compensated and
0.2
Uncompensated Systems')
xlabel('\bft Sec')
ylabel('\bfOutput c1 and c2')
0 legend('Uncompensated system', 'Compensated
0 5 10 15 20 25 30 35 40 45 50 system')
t Sec
Programmable Logic
Controllers (PLCs)
MECH365 - Control of Machines and Processes, 2022
Parallel Compensation
𝐺𝐺1 𝐺𝐺2
𝐶𝐶(𝑠𝑠) 1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐 𝐺𝐺1 𝐺𝐺2
= =
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺 𝐺𝐺
1 2
𝐻𝐻 1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐 + 𝐺𝐺1 𝐺𝐺2 𝐻𝐻
1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐
1 + 𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺𝑓𝑓 𝑠𝑠 = 0
As 𝐺𝐺𝑓𝑓 (𝑠𝑠) is a fixed transfer function, the compensator design becomes the
same as the case of series compensation. Thus, similar root locus approach
can be used.
𝐾𝐾𝐾𝐾
1+ 3 = 0 (𝐾𝐾 = 20𝑘𝑘𝑘𝑘)
𝑠𝑠 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20
k=1.413
0.8
the system with k=1.413 exhibits
0.6
a slow overdamped response.
Thus, k=0.449 is preferred for
0.4 the present system
0.2
0
0 1 2 3 4 5 6 7 8 9 10
t Sec
• Overview of PLCs
- history, components, manufacturers, etc.
A mechanical relay
MECH365 – Week 11 Lecture Notes
What do PLCs Automate Tasks?
• Consider turning an output device (e.g. a motor) on or off
with a button or switch. Now consider doing that for 20
different devices at once, all based on various information
given to you, such as time, number of parts counted, etc.
• A PLC can be programmed to do this, automating the
switching of its internal relays.
Inputs Outputs
Programmable
Controller
C
R
Base is identical to the standard Packaged PLC, but it also has the
ability to drive additional I/O. The most common form of expansion
is a block of I/O that uses the same base, or makes use of different
types of expansion “modules”.
MECH365 – Week 11 Lecture Notes
Non-Industry Alternatives
• Industrial PLCs allow us to automate tasks and have been
certified for use in industry.
• These are functionallies similar to micrologic controller boards
such as Arduino or Raspberry Pi.
• Arduino and Raspberry Pi are widely used for automation in
education, research, and hobby use.
C C
I i O i
n r u r
p c Central t c
u u p u
t i
Processor u i
t t t CR
s s
High High
Voltage Isolation
Voltage
Isolation MEMORY Barrier
Barrier
program data
Low Voltage
AC Power Supply External
85-264 VAC, or DC Power Supply
50/60Hz
Execute Program
A normally open contact will not pass current until pressed. (doorbell)
A normally close contact will allow current flow until it is pressed.
(Security)
MECH365 – Week 11 Lecture Notes
Manually operated industrial switches
Toggle switches
Terminal Isolation
Block Barrier
Input Devices
1
2
3
L1 4
5 P
L1 6 L
C
7
8
9
10
L2 COM
Isolation Terminal
Barrier Block
Output Devices
OUT 1 L1
CR
OUT 1 L2
OUT 2
OUT 2
P OUT 3 L1
L OUT 3
OUT 4
L2
C OUT 4
OUT 5
OUT 5
OUT 6
OUT 6
MECH365 – Week 11 Lecture Notes
Relay logic
A1 X1
Branching, the OR switch
X1:= A1 OR A2
A2
On
Off
off
A1 Coil A
Start Stop A
A1
“Hold on” circuit
Output File
Data
2
Input File
Files
MicroLogix 1100 3
Status File
Memory
4
Bit File
5
Timer File
6
Counter File
7
Control File
8
Integer Files
9-255
Float Files
B - Bit
T - Timer
C - Counter
R - Control
N - Integer
F – Float
ST - String
L - Long Word
MG - Message
PD – PID
PLS – Programmable Limit Switch
RI - Routing Information
(1100 only)
O0:0/0
0
Outputs
File contains
10 or 16 Outputs File Number 15 9 0
I1:0/0
1
Inputs
File contains
15 13 0
14 or 24 Inputs File Number Word 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(bases only) Word 1 00000000
23 16
O 0: 0/0
Output listing:
O0: 0/0: red pilot light
O0: 0/1: alarm (siren)
O0: 0/2: fire department notify
Programmable Logic
Controllers (PLCs) (cont’)
O 0: 0/0
• Input (file 1)
• Timer (file 4)
• Counter (file 5)
Output listing:
O0: 0/0: red pilot light
O0: 0/1: alarm (siren)
O0: 0/2: fire department notify
Output listing:
O0: 0/0 forward coil
O0: 0/1 reverse coil
Interlocks
File Type
Timer Number
(0-255)
T4:0
4
Timers
15 14 13
input TON
output Word 0 EN TT DN
TIMER ON DELAY
Timer T4:0
(EN) Word 1 Preset Value
Time Base 1.0 (DN) Word 2 Accumulated Value
Preset 10
Accum 0
• Time Base: the unit of time used by a timer to time an event. Eg.
0.01 seconds and 1 second
Input
Enable bit
Timing bit
Done bit
Delay
Timer T4:0
(EN)
Time Base 0.1 (DN)
Preset 80
Accum 0
O0:0/1
TOF
Timer Off Delay
Timer T4:1
(EN)
Time Base
Preset
0.1
200
(DN)
Accum 0
Input
Enable bit
Timing bit
Done bit
Delay
O0:0/0
I1:0/1 TOF
Timer Off Delay
Timer T4:1
(EN) Logic
Accum 0
O0: 0/1
I1: 0/0 T4:1/DN
Lubricating
• RTO needs two inputs: one for timing, and the other for reset
• This type of timer does NOT reset the accumulated time
when the input condition goes false
• It keeps the last accumulated time in memory, and (if/when
the input goes true again) continues timing from that point
• If the setpoint (preset) time has been reached, the output is
true and stays true until a RES (RESet) instruction is made
true to clear it
C5:0
5
Counters
File contains
File Number
256 counters
• Word 0 is the control word, which stores data about the counter
block’s operation and status. This word holds information about
the status of the count up and count down outputs and data
about the counter’s done, overflow, and underflow status. This
information is stored in bits 11 through 15 of the control word.
• Word 1 stores the counter’s preset value, which is the target
count value
• Word 2 stores the counter’s accumulated value, which is the
actual count value. A counter’s preset and accumulated words,
words 1 and 2, are addressed with the labels PRE and ACC in
the RSLogix software
• Count up Instruction
CTU
COUNT UP (CU)
Counter
Preset
C5: 2
3
(DN)
Accum 0
• When the limit switch turns on for the first time, the count up output will be energised, and the
accumulated value will increase to 1.
• When the limit switch turns off then on again, the accumulated value will increase to 2.
• When the switch makes its third OFF-to-ON transition, the accumulated value will increase to 3
and the done output will turn on because the accumulated value is equal to the preset value.
• When the done output turns on, the solenoid output in the second rung will be energised.
• A count down instruction decreases its accumulated value by one every time the
block’s input makes an OFF-to-ON transition. When the accumulated value
becomes less than the preset value, the count down instruction de-energises its
output. When the counter’s accumulated value is greater than or equal to its preset
value, the counter’s output will be on
• A count down instruction also has two outputs:
- count down output –indicates that the counter is energised
- count down output –indicates that the counter is energised
• The done output is always on because the accumulated value is great than the preset value.
• When the input switch turns from OFF to ON, the accumulated value will decrease to 3
• When the input turns from OFF to ON again, the accumulated value will increase to 2
• When the input makes one more OFF to ON transition, the accumulated value will drop to less
than the preset value and the done output will turn off, deenergerising the done output and output
O: 0/0.
• The first counter’s preset value is set as 1000 while the second counter
is set as 100. They will implement a count to 100,000
• The second counter will increase its value when the first counter’s
accumulated value reaches 1000
• Internal output B3:0/0 indicates when the count has reached 100,000
because this internal turns on when the second counter’s DN turns on
• CLR instruction resets the contents of the first counter’s accumulated
word to 0 every time its DN is enabled, so that the first counter will reset
to 0 every time it reaches a count of 1000…… then it can count the next
1000 etc
Conveyor
B
Preset 6 (DN)
Accum 0
Preset 8 (DN)
Accum 0
Count complete
Output listing:
O0: 0/0 Part B identified (start TON and Sort Coil)
T4: 0 Timer on-delay (Times Sort Coil ON duration)
O0: 0/1 Sort coil Y1 (pushes part B onto cross conveyor)
Detects Part B
O0:0/0
Accum 0
Deflects Part B
Output listing:
T4: 0 timer on-delay 1
T4: 1 timer on-delay 2
O0: 0/0 Uncapped bottle indicator
O0: 0/1 Reject trigger
O0: 0/2 Rejected solenoid
MECH365 – Week 12 Lecture Notes
Step 2: LD diagram
I1: 0/0 I1: 0/1 O0:0/0
Reject trigger
O0: 0/1 TON
Timer On Delay
Timer T4:1
(EN) 1 second time delay
Time Base
Preset
0.1
10
(DN)
Accum 0
T4:1/DN O0:0/2
Reject solenoid
MECH365 – Week 12 Lecture Notes