0% found this document useful (0 votes)
13 views472 pages

Lectures

Uploaded by

Kai Chigwidden
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)
13 views472 pages

Lectures

Uploaded by

Kai Chigwidden
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/ 472

MECH365

Control of Machines and


Processes

Snr Prof Weihua Li


weihuali@uow.edu.au
8.110

MECH365 - Control of Machines and Processes, 2022


Information about this subject
Lecture/Tutorial/Practical

Lectures: Wednesday 10.30 - 12.30 35.G45

Tutorials: (Weeks 2, 3, 5, 8,10,12-13)


Group 1: Wednesday, 15.30 - 17.30, 8.G10
Group 2: Friday, 12.30 - 14.30, 8.G10
Group 3: Friday, 14.30 - 16.30, online

Practicals: (Weeks 4,6,7)


Group 1: Wednesday, 15.30 - 17.30, 8.G10
Group 2: Friday, 12.30 - 14.30, 8.G10
Group 3: Friday, 14.30 - 15.30, online

MECH365 – Week 1 Lecture Notes


Text Book
K. Ogata, Modern Control Engineering - 5th Edition, Prentice Hall, 2010

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

MECH365 – Week 1 Lecture Notes


Assessment Summary

Tutorial hand-ins (work in pair): 14%


Mid-session quiz: 20%
Practical report: 20%
Final exam : 46%

MECH365 – Week 1 Lecture Notes


MECH365 – Week 1 Lecture Notes
Objectives of the subject
• To understand and be able to apply the
principles of classical system analysis and
controller design
• To be able to solve a simple practical control
problem with a Programmable Logic
Controller (PLC)

MECH365 – Week 1 Lecture Notes


Outline & topics
• Analyse the behaviour of a dynamic system in the time and
frequency domains
• Design a controller using Frequency Response Analysis
• Design a controller using Root-Locus Analysis
• Implement and evaluate the performance of controllers in
practice
• Write and implement a ladder diagram in a program logic
controller (PLC) and evaluate it in practice

MECH365 – Week 1 Lecture Notes


Control System Terminology

The object of any control system is to control a process or


a plant or a system.
Broadly, a system is any device or a process that takes a
given input and provides a desired output.
For example, a DC motor takes some voltage as input and
produces some rotary motion as output. A chemical plant
takes in some raw material and produces a required
product.

MECH365 – Week 1 Lecture Notes


There are two types of control techniques; open loop
control and closed loop (feedback) control.

Open loop control

A controller / compensator is an algorithm which


generates appropriate inputs for the system such that the
system produces a desired output.

MECH365 – Week 1 Lecture Notes


 The output has no effect on the control action; the output
is neither measured nor feedback for comparison with the
input.

 The accuracy of the system depends on calibration.

 In the presence of disturbances, it is unlikely that an


open-loop control system will provide the desired output.

Examples: a washing machine, a toaster


MECH365 – Week 1 Lecture Notes
Open-loop control examples: washing machine, toaster, oven

MECH365 – Week 1 Lecture Notes


The closed-loop control always implies the feedback of the
system output.

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

MECH365 – Week 1 Lecture Notes


𝐶𝐶 𝑠𝑠 = E s G s
𝐸𝐸 𝑠𝑠 = 𝑅𝑅 𝑠𝑠 − 𝐵𝐵(𝑠𝑠) = 𝑅𝑅 𝑠𝑠 − 𝐻𝐻 𝑠𝑠 𝐺𝐺 𝑠𝑠
Eliminating E(s)
𝐶𝐶 𝑠𝑠 = 𝐺𝐺 𝑠𝑠 𝑅𝑅 𝑠𝑠 − 𝐻𝐻 𝑠𝑠 𝐶𝐶 𝑠𝑠

𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
or =
𝑅𝑅(𝑠𝑠) 1+𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)

𝐵𝐵(𝑠𝑠)
Open-Loop Transfer Function = = 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)
𝐸𝐸(𝑠𝑠)

𝐶𝐶(𝑠𝑠)
Feedforward Transfer Function = = 𝐺𝐺(𝑠𝑠)
𝐸𝐸(𝑠𝑠)

𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
Closed-Loop Transfer Function = =
𝑅𝑅(𝑠𝑠) 1+𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)

MECH365 – Week 1 Lecture Notes


Advantages of Feedback Control Systems

 Increased accuracy; the error between desired and


actual output can be reduced to zero
 Reduced sensitivity to changes in system parameter
variations
 Reduced effects of disturbances
 Increased speed of response

MECH365 – Week 1 Lecture Notes


Classification of Control System
Design Methods
Broadly speaking, there are two control system design
methods;
1. Classical / Conventional / Transform Control System
Design Methods

2. Modern Control System Design Methods– State-Variable


or State-Space Methods

MECH365 – Week 1 Lecture Notes


1. Classical / Conventional / Transform Control
System Design Methods
 They include Frequency Response (Bode Diagram)
and Root-Locus.
 They were based on hand calculations and careful
hand drawings since they were made available before
computers were introduced.
 They are quite useful for analysis and design of SISO
control systems.

MECH365 – Week 1 Lecture Notes


 They are based on a linear transfer function (input-
output relationship) representation of dynamic systems.

 Laplace transforms are used for control system


analysis and design.

 They don’t need to have an accurate model of the


system. Experimental frequency-response curves can
be used to describe the input-output relationship of the
system.

MECH365 – Week 1 Lecture Notes


2. Modern Control System Design Methods– State-
Variable or State-Space Methods
 No need to use the transfer function representation of the
system/plant
 First order differential equations are used to represent the
system
 These are known as state equations that are very
suitable for numerical solutions using a computer
 These methods are very suitable for analysis and design
of MIMO control systems

MECH365 – Week 1 Lecture Notes


Requirements of a Control System
 A control system must be absolutely stable.

 A control system must be able to reduce command


following errors to some acceptable level or ideally to
zero.
 A control system must have an acceptable speed of
response.
MECH365 – Week 1 Lecture Notes
 A control system must have a reasonable relative
stability – not too close to neutral stability. The system
damping must be such that the transient response
decays out in an acceptable time

MECH365 – Week 1 Lecture Notes


Example: Vehicle Steering Control System

Adapted from Dorf/Bishop Modern Control System 10/E

MECH365 – Week 1 Lecture Notes


Automobile steering control system

Typical direction-of-travel response

MECH365 – Week 1 Lecture Notes


Control System Design
Like any other design process, control system design is
also an iterative and nonlinear process! The process
consists of seven major blocks, which are categorised
three major groups:

1. Establishment of goals and variables to be controlled, and


definition of specification against which to measure
performance
2. System definition and modelling
3. Control system design and integrated system simulation and
analysis

MECH365 – Week 1 Lecture Notes


Adapted from Dorf/Bishop Modern Control System 10/E
MECH365 – Week 1 Lecture Notes
Summary
 The mathematical model of the system (including its sensors
and actuators) to be controlled is known, and a set of
design/control goals are given
 The aim of the control design is to find a suitable controller. The
designer should consider the physics of the system to be
controlled, the structure of the controller– what type of the
controller, the selection of the controller parameters (gains) to
be adjusted to meet the performance specifications
 The controller is implemented in hardware using analog
electronics or in a digital form using microcontroller or a
computer

MECH365 – Week 1 Lecture Notes


Classification of Industrial Controllers
Please recall that a controller
- compares the measured real output with the desired input,
- determines the tracking error,
- generates a suitably amplified actuation signal such that the
system produces a desired output.
There are two types of controllers widely used in industry:
1. On-off (two-position) controllers,
2. Various forms of Proportional-plus-Integral-plus-Derivative (PID)
controllers.

MECH365 – Week 1 Lecture Notes


Review of Assumed Previous Knowledge

Mainly covered in MECH321, which is a pre-requisite for MECH365

MECH365 – Week 1 Lecture Notes


Review of Laplace Transform Method
 The Laplace transform method is an operational method to
solve linear differential equations, which are the
mathematical representation of dynamic dynamics systems.

Definition:

L[ f (t )] = F ( s ) = ∫ f (t )e − st
⋅ dt
0

MECH365 – Week 1 Lecture Notes


Laplace Transform Theorems
Real differentiation theorem:
 dn  n −1 n−2 
( n −1)
L  n f (t )  = s F ( s ) − s f (0) − s
n
f (0) − ⋅ ⋅ ⋅ f (0)
 dt 
Final value theorem:
f (∞) = lim f (t ) = lim s ⋅ F ( s )
t →∞ s →0

Initial value theorem:


f (0+) = lim f (t ) = lim s ⋅ F ( s )
t →0 + s →∞

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 𝐹𝐹𝑛𝑛 (𝑠𝑠)

MECH365 – Week 1 Lecture Notes


Solving linear, time-invariant differential equations
 Step 1: Laplace transform of each item
 Step 2: Substitution of initial conditions and simplify
 Step 3: Inverse Laplace transform

MECH365 – Week 1 Lecture Notes


Example: Find the solution 𝑥𝑥(𝑡𝑡) of the differential equation

𝑥𝑥̈ + 2𝑥𝑥̇ + 5𝑥𝑥 = 3, 𝑥𝑥 0 = 0, 𝑥𝑥̇ 0 = 0

Solution: Step 1: Laplace transform of each item


3
𝑠𝑠 2 𝑋𝑋 𝑠𝑠 − 𝑠𝑠𝑠𝑠 0 − 𝑥𝑥̇ 0 + 2 𝑠𝑠𝑠𝑠 𝑠𝑠 − 𝑥𝑥 0 + 5 𝑋𝑋(𝑠𝑠) =
𝑠𝑠

Step 2: Substitute initial conditions and simplify


3
𝑠𝑠 2 𝑋𝑋 𝑠𝑠 − 0 − 0 + 2 𝑠𝑠𝑠𝑠 𝑠𝑠 − 0 + 5 𝑋𝑋(𝑠𝑠) =
𝑠𝑠
3
(𝑠𝑠 2 + 2𝑠𝑠 + 5)𝑋𝑋 𝑠𝑠 =
𝑠𝑠
3 𝑎𝑎1 𝑎𝑎2 𝑠𝑠 + 𝑎𝑎3 (𝑎𝑎1 +𝑎𝑎2 )𝑠𝑠 2 + 2𝑎𝑎1 + 𝑎𝑎3 𝑠𝑠 + 5𝑎𝑎1
𝑋𝑋 𝑠𝑠 = = + =
𝑠𝑠(𝑠𝑠 2 + 2𝑠𝑠 + 5) 𝑠𝑠 𝑠𝑠 2 + 2𝑠𝑠 + 5 𝑠𝑠(𝑠𝑠 2 + 2𝑠𝑠 + 5)
𝑎𝑎1 + 𝑎𝑎2 = 0 𝑎𝑎1 = 3/5
�2𝑎𝑎1 + 𝑎𝑎3 = 0 ⇒ �𝑎𝑎2 = −3/5
5𝑎𝑎1 = 3 𝑎𝑎3 = −6/5

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

Step 3: Inverse Laplace transform


3 3 −𝑡𝑡 3
𝑥𝑥 𝑡𝑡 = 𝐿𝐿−1 𝐹𝐹(𝑠𝑠) = − 𝑒𝑒 cos 2𝑡𝑡 − 𝑒𝑒 −𝑡𝑡 sin 2𝑡𝑡
5 5 10

MECH365 – Week 1 Lecture Notes


Transfer Function (TF) Representation
The transfer function representation is perhaps the most
important tool needed in the design and analysis of
dynamic systems. It describes the output/input
relationship of any system described by Linear, Time-
Invariant (LTI) differential equations.
The TF of a SISO system with the output 𝑦𝑦(𝑡𝑡) and the
input 𝑥𝑥(𝑡𝑡) is given by

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 𝑦𝑦̇ + 𝑎𝑎𝑛𝑛 𝑦𝑦

= 𝑏𝑏0 𝑥𝑥𝑚𝑚 + 𝑏𝑏1 𝑥𝑥𝑚𝑚−1 + ⋯ + 𝑏𝑏𝑚𝑚−1 𝑥𝑥̇ + 𝑏𝑏𝑚𝑚 𝑥𝑥 (𝑛𝑛 ≥ 𝑚𝑚)

The transfer function for this equation, in other words, for an


‘n’th order dynamic system, is;
𝐿𝐿 𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜
𝐺𝐺 𝑠𝑠 = �
𝐿𝐿 𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 𝑧𝑧𝑧𝑧𝑧𝑧𝑧𝑧 𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐
𝑌𝑌(𝑠𝑠) 𝑏𝑏0 𝑠𝑠 𝑚𝑚 + 𝑏𝑏1 𝑠𝑠 𝑚𝑚−1 + ⋯ + 𝑏𝑏𝑚𝑚−1 𝑠𝑠 + 𝑏𝑏𝑚𝑚
= =
𝑋𝑋(𝑠𝑠) 𝑎𝑎0 𝑠𝑠 𝑛𝑛 + 𝑎𝑎1 𝑠𝑠 𝑛𝑛−1 + ⋯ + 𝑎𝑎𝑛𝑛−1 𝑠𝑠 + 𝑎𝑎𝑛𝑛

MECH365 – Week 1 Lecture Notes


Features of the TF Representation
• It is valid for systems described by LTI differential equations,
• It is basically a mathematical model relating the output
variable to the input variable,
• It is just a representation method; it does not provide any
direct information about the physical configuration of the
system,
• It can be used to determine the output of a system, if it is
known, for some types of inputs,
• It can experimentally be determined if it is problematic to
obtain it analytically.
MECH365 – Week 1 Lecture Notes
Example: find the TF for the following mass-spring-damper
system
The differential equation of the mbk system is:
k
F
b
𝑚𝑚𝑥𝑥̈ + 𝑏𝑏𝑥𝑥̇ + 𝑘𝑘𝑘𝑘 = 𝐹𝐹
m
The TF is obtained as;
x

𝑋𝑋 𝑠𝑠 1
𝐺𝐺 𝑠𝑠 = =
𝐹𝐹 𝑠𝑠 𝑚𝑚𝑠𝑠 2 + 𝑏𝑏𝑏𝑏 + 𝑘𝑘

MECH365 – Week 1 Lecture Notes


Block Diagrams
Block diagrams are used to
 Describe the arrangement of the components of a
system and the signal flow within the system,

 Determine the effect of each component on the system


response or performance.

The basic elements of a typical block diagram are a block, a


summer or a summing point, a junction or branch point.

MECH365 – Week 1 Lecture Notes


A summing point can have more than two inputs with different
signs (plus or minus)

A branch point can have more than one output

MECH365 – Week 1 Lecture Notes


In manipulating the block diagram, the overall relationship
between the input and the output must always be maintained.
We need to follow some rules for block diagram reduction;

Rule 1: Combining serial blocks

MECH365 – Week 1 Lecture Notes


Rule 2: Combining parallel blocks

𝑮𝑮𝟏𝟏 + 𝑮𝑮𝟐𝟐

𝑮𝑮𝟏𝟏 − 𝑮𝑮𝟐𝟐

MECH365 – Week 1 Lecture Notes


Rule 3: Moving a summing point behind a block

Rule 4: Moving a branch point ahead of a block

MECH365 – Week 1 Lecture Notes


Rule 5: Moving a branch point behind a block

Rule 6: Moving a summing point ahead of a block

MECH365 – Week 1 Lecture Notes


Rule 7: Eliminating a feedback loop

A rule of thumb for block diagram simplification; move


summing points, branch points and interchange summing
points such that internal feedback loops are formed and
eliminated.
Let us solve the example with multi-loops;

MECH365 – Week 1 Lecture Notes


MECH365 – Week 1 Lecture Notes
MECH365 – Week 1 Lecture Notes
MATLAB can be used after a multi-loop block diagram is
brought into a feedback loop or parallel-connected blocks or
serial-connected blocks. Here are the MATLAB commands;
For rule 1;
Transfer_function=series(g1,g2)
g1 and g2 can be described in terms of numerator
and denominator polynomials;
g1=tf(num1,den1), g2=tf(num2,den2)
For example consider the numerator and denominator
polynomials
num1 = s + 2 s + 3s + 4, den1 = 2 s + 2
3 2 2

MECH365 – Week 1 Lecture Notes


The MATLAB script to describe num1 and den1 are
num1=[1 2 3 4];
den1=[2 0 2];

For rule 2 (for G1+G2);


Transfer_function=parallel(g1,g2);

For rule 2 (for G1-G2);


Transfer_function=parallel(g1,-g2);

MECH365 – Week 1 Lecture Notes


For rule 7 (For negative feedback);
Transfer_function=feedback(g,h);

For rule 7 (For positive feedback);

Transfer_function=feedback(g,-h); OR
Transfer_function=feedback(g,h,+1);

For rule 7 (For unity feedback, H=1);


Transfer_function=feedback(g,[1]);

MECH365 – Week 1 Lecture Notes


MECH365 – Week 1 Lecture Notes
MECH365 – Week 1 Lecture Notes
Response of a Dynamic System from Its
Mathematical Model
Consider the following differential equation describing the
behaviour of a linear system under the input function p(t);

(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.

MECH365 – Week 1 Lecture Notes


x(t ) = xc (t ) + x p (t )
(n) ( n −1)
a0 x + a1 x +  + an −1 x + an x = p (t ) ⇒ x p
(n) ( n −1)
a0 x + a1 x +  + an −1 x + an x = 0 ⇒ xc
While the complimentary solution depends on the initial
conditions, the particular solution depends on the form of the
input 𝑝𝑝(𝑡𝑡). That is why, the complimentary solution is known as
the natural response, and the particular solution is known as the
forced response.
MECH365 – Week 1 Lecture Notes
As the time 𝑡𝑡 approaches infinity, while the natural
response decays to zero or a constant value, the forced
response remains.

t
lim ∞
x (t ) = t
lim ∞
x p (t )

Both responses consist of a transient part and a steady-state


part. As the time 𝑡𝑡 approaches infinity, the former decays out
and the later remains.

MECH365 – Week 1 Lecture Notes


The transient component of the forced response contains
significant information about the performance of a dynamic
system. That is why, the performance specification of a
control system is based on the transient response of the
system.

MECH365 – Week 1 Lecture Notes


Test Inputs / Signals
As the type of the input function 𝑝𝑝(𝑡𝑡) the system is going to
be subjected to is unknown, we use a standard test signal to
evaluate the performance of a control system. The
performance is quantified in terms of some specifications
based on the system’s response to the standard test signal.
Standard test signals include step input, the ramp input, the
parabolic input, the impulse input, and the sinusoidal input.
The step input is the most commonly used one in the time
domain.

MECH365 – Week 1 Lecture Notes


Since higher systems can be considered as the combination of
1st and 2nd order systems, understanding the behaviour of 1st
and 2nd order systems is of crucial importance to understand
the behaviour of higher order systems.
That is why we will focus on the transient response analyses of
1st and 2nd order systems

MECH365 – Week 1 Lecture Notes


Transient Response Analysis of 1st -Order
Systems
This analysis is valid for any system represented with a first order
linear, time-invariant differential equation.
𝑑𝑑𝑑𝑑
𝑇𝑇 + 𝑐𝑐 = 𝑟𝑟
𝑑𝑑𝑑𝑑
Here, 𝑟𝑟(𝑡𝑡) and 𝑐𝑐(𝑡𝑡) are system input and output, respectively.
The transfer function of the first-order system is obtained as

𝐶𝐶(𝑠𝑠) 1
=
𝑅𝑅(𝑠𝑠) 𝑇𝑇𝑇𝑇 + 1

MECH365 – Week 1 Lecture Notes


T which is the time constant of a first order-system indicates
how fast the system tends to reach the steady-state value.

1
, 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑇𝑇

MECH365 – Week 1 Lecture Notes


Typical First-Order Systems
• Pneumatic system
• Thermal system
• RC circuit
• Liquid level system
• Damper-spring system

MECH365 – Week 1 Lecture Notes


Step Response of First-Order Systems
𝐵𝐵
The input function is 𝑟𝑟(𝑡𝑡)=B (step input), ⟶ 𝑅𝑅 𝑆𝑆 =
𝑠𝑠

Hence,

𝐵𝐵 1 𝐵𝐵 𝐵𝐵
C 𝑠𝑠 = = − 1
𝑠𝑠 𝑇𝑇𝑇𝑇+1 𝑠𝑠 𝑠𝑠+
𝑇𝑇

Inverse LT:
−𝑡𝑡�
c 𝑡𝑡 = 1 − 𝑒𝑒 𝑇𝑇 B

MECH365 – Week 1 Lecture Notes


The error between the input and the output/response is

𝑒𝑒 𝑡𝑡 = 𝑟𝑟 𝑡𝑡 − 𝑐𝑐 𝑡𝑡
−𝑡𝑡� −𝑡𝑡�
= 𝐵𝐵 − 𝐵𝐵 1 − 𝑒𝑒 𝑇𝑇 = 𝐵𝐵𝑒𝑒 𝑇𝑇

Steady-state error is given by


−∞⁄
𝑒𝑒(∞)= 𝐵𝐵𝑒𝑒 𝑇𝑇 =0

MECH365 – Week 1 Lecture Notes


Under a unit step input, 𝑟𝑟(𝑡𝑡) =1, the system response is:

MECH365 – Week 1 Lecture Notes


The response of the first-order system is calculated using
the response expression.

 When 𝑡𝑡 = 𝑇𝑇, 𝑐𝑐(𝑡𝑡)=0.632


 When 𝑡𝑡 = 4𝑇𝑇, 𝑐𝑐(𝑡𝑡)=0.982. This follows that the steady-state
value is within the 2% of the final value when 𝑡𝑡 = 4𝑇𝑇. This is a
tolerable error. That is why, the response time or settling time is
accepted to be 4𝑇𝑇.
 When 𝑡𝑡 goes infinity, the response reaches the steady-state
value with no steady-state error.

MECH365 – Week 1 Lecture Notes


Ramp Response of First-Order Systems
The input function is 𝑟𝑟(𝑡𝑡) = 𝐵𝐵𝐵𝐵, whose Laplace Transform is 𝑅𝑅 𝑠𝑠
𝐵𝐵
= 2
𝑠𝑠

𝐵𝐵 1 𝑎𝑎1 𝑎𝑎2 𝑎𝑎 −𝐵𝐵𝐵𝐵 𝐵𝐵 𝐵𝐵𝑇𝑇 2


Thus, 𝑋𝑋 𝑠𝑠 = = + + 3 = + 2 +
𝑠𝑠 2 𝑇𝑇𝑇𝑇+1 𝑠𝑠 𝑠𝑠 2 𝑇𝑇𝑇𝑇+1 𝑠𝑠 𝑠𝑠 𝑇𝑇𝑇𝑇+1

1 𝑇𝑇 𝑇𝑇
= 𝐵𝐵( 2 − + 1 )
𝑠𝑠 𝑠𝑠 𝑠𝑠+
𝑇𝑇

The inverse Laplace transform produces


𝑡𝑡

𝑥𝑥 𝑡𝑡 = 𝐿𝐿−1 𝑋𝑋 𝑠𝑠 = 𝐵𝐵(𝑡𝑡 − 𝑇𝑇 + 𝑇𝑇𝑒𝑒 𝑇𝑇 )

MECH365 – Week 1 Lecture Notes


The error between the input and the output (i.e., response) is

𝑡𝑡 𝑡𝑡
−𝑇𝑇 −𝑇𝑇
𝑒𝑒 𝑡𝑡 = 𝐵𝐵𝐵𝐵 − 𝐵𝐵(𝑡𝑡 − 𝑇𝑇 + 𝑇𝑇𝑒𝑒 ) = 𝐵𝐵𝑇𝑇(1 − 𝑒𝑒 )

The steady-state error becomes

𝑡𝑡
−𝑇𝑇
lim 𝑒𝑒 𝑡𝑡 = lim 𝐵𝐵𝐵𝐵(1 − 𝑒𝑒 ) = 𝐵𝐵𝐵𝐵
𝑡𝑡→∞ 𝑡𝑡→∞

Therefore, the response and the input has a


steady-state error, BT, as the time is long enough.
The smaller the time constant T, the smaller the
steady-state error

MECH365 – Week 1 Lecture Notes


Transient Response Analysis of 2nd Order Systems

The mass-spring-damper system is a typical second-order


system.

k b
F

𝑚𝑚𝑥𝑥̈ + 𝑏𝑏𝑥𝑥̇ + 𝑘𝑘𝑘𝑘 = 𝐹𝐹


MECH365 – Week 1 Lecture Notes
The transfer function for this systems is given by

𝑋𝑋(𝑠𝑠) 1
𝐺𝐺 𝑠𝑠 = =
𝐹𝐹(𝑠𝑠) 𝑚𝑚𝑠𝑠 2 + 𝑏𝑏𝑏𝑏 + 𝑘𝑘

The denominator of a transfer function is called the


characteristic equation of the system, which contains significant
information about the system’s response.

The characteristic equation of such a second order system


is given by

MECH365 – Week 1 Lecture Notes


𝑚𝑚𝑠𝑠 2 + 𝑏𝑏𝑏𝑏 + 𝑘𝑘 = 0
The roots of this equation are obtained as
−𝑏𝑏 ± 𝑏𝑏 2 − 4𝑚𝑚𝑚𝑚
𝑠𝑠 =
2𝑚𝑚
Case 1: b2 < 4mk, two complex conjugate roots, underdamped
system
Case 2: b2 > 4mk, two distinct real roots, overdamped system
Case 3: b2 = 4mk, two equal real roots, critically damped
system
Case 4: b = 0, two complex conjugate roots on the imaginary
axis, undamped system
MECH365 – Week 1 Lecture Notes
With reference to Case 4, the system will oscillate/vibrate
with its undamped natural frequency defined as

𝑘𝑘
𝜔𝜔𝑛𝑛 =
𝑚𝑚

With reference to Case 3, the critical damping coefficient is

𝑏𝑏𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 = 2 𝑘𝑘𝑘𝑘

The damping ratio is described as


𝑏𝑏 𝑏𝑏
ζ = 𝑏𝑏 =
2 𝑘𝑘𝑘𝑘
𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐

MECH365 – Week 1 Lecture Notes


The characteristic equation of a second order system can be re-
written in terms of the undamped natural frequency, 𝜔𝜔𝑛𝑛 , and
the damping ratio, ζ
𝑠𝑠 2 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛2 = 0

The four Cases given above can be also described as


Case 1: 0<ζ <1, underdamped
Case 2: ζ >1, overdamped
Case 3: ζ =1, critically damped
Case 4: ζ =0, undamped

MECH365 – Week 1 Lecture Notes


The step-response is plotted as a function of the damping ratio.

MECH365 – Week 1 Lecture Notes


Transient-Response Specifications
In the study of dynamic systems, the performance of a
dynamic such as a control system is described in terms of
transient response specifications, which are based on the unit
step response of a second-order system.

MECH365 – Week 1 Lecture Notes


Delay time, td : the time needed for the response to reach
half the final value the very first time

MECH365 – Week 1 Lecture Notes


Rise time, tr : the time needed for the response to rise from
0% to 100% of its final value

Peak time, tp : the time needed for the response to reach the
first peak of the overshoot,

Maximum overshoot, Mp (%) : the maximum peak value of


the response curve measured from the final value
c(t p ) − c(∞ )
M p [% ] = × 100%
c(∞ )
Settling time, ts : the time required for the response curve to
reach and stay within 2% of the final value

MECH365 – Week 1 Lecture Notes


𝜋𝜋 − 𝑐𝑐𝑐𝑐𝑐𝑐 −1 ζ𝜋𝜋 − 𝛽𝛽
Rise Time: 𝑡𝑡𝑟𝑟 = =
𝜔𝜔𝑑𝑑
𝜔𝜔𝑛𝑛 1 − ζ2

𝜋𝜋 𝜋𝜋
Peak Time: 𝑡𝑡𝑝𝑝 = =
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ2

−ζπ� 1−ζ2
Maximum Overshoot: 𝑀𝑀𝑝𝑝 = 𝑒𝑒

4
Settling Time: 𝑡𝑡𝑠𝑠 =
ζ𝜔𝜔𝑛𝑛

MECH365 – Week 1 Lecture Notes


Summary:
 The rise time and the peak time indicate the speed of the response, the
percent overshoot and the settling time indicate how close is the
response to the desired input.
 The rise time and settling time should be as short as possible; the
overshoot generally doesn’t exceed 10-15 % though some systems can
tolerate up to 25 % overshoot.
 It must be noted that both overshoot and rise time cannot be minimised
simultaneously. The solution is to reach a compromise between them.
 For a given damping ratio, the speed of response increases by
increasing the natural frequency.
 The damping ratio should be between 0.4 and 0.8 because small values
of damping ratio yield excessive overshoot and large ones induce
sluggish system response.
MECH365 – Week 1 Lecture Notes
MECH365 – Week 1 Lecture Notes
MECH365 – Week 1 Lecture Notes
Example: Consider the following unity-feedback control
system subjected to a unit step input. With reference to the
step-response, determine the numerical values of K and T.

R(s) C(s)
𝐾𝐾
𝐺𝐺 (𝑠𝑠) =
𝑠𝑠(𝑇𝑇𝑠𝑠 + 1)

MECH365 – Week 1 Lecture Notes


−ζ𝜋𝜋� 1−ζ 2
𝑀𝑀𝑝𝑝 = 𝑒𝑒 = 0.254 ⇒ ζ=0.4

𝜋𝜋 𝜋𝜋
𝑡𝑡𝑝𝑝 = = = 3 ⇒ 𝜔𝜔𝑛𝑛 = 1.143 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ 2

The closed-loop transfer function is obtained as


𝐾𝐾
𝐶𝐶(𝑠𝑠) 𝐾𝐾 𝑇𝑇
= 2 =
𝑅𝑅(𝑠𝑠) 𝑇𝑇𝑠𝑠 + 𝑠𝑠 + 𝐾𝐾 𝑠𝑠 2 + 1 𝑠𝑠 + 𝐾𝐾
𝑇𝑇 𝑇𝑇

MECH365 – Week 1 Lecture Notes


Comparing the closed-loop TF with the normalised TF

𝐶𝐶(𝑠𝑠) 𝜔𝜔𝑛𝑛2
= 2
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛2

gives

1 𝐾𝐾
2ζ𝜔𝜔𝑛𝑛 = , 𝜔𝜔𝑛𝑛 =
𝑇𝑇 𝑇𝑇

⇒ 𝑇𝑇 = 1.094, 𝐾𝐾 = 1.429

MECH365 – Week 1 Lecture Notes


𝐶𝐶(𝑠𝑠) 𝐾𝐾
Let us verify the answer using MATLAB = 2
𝑅𝑅(𝑠𝑠) 𝑇𝑇𝑠𝑠 + 𝑠𝑠 + 𝐾𝐾
Step Response
1.4

1.2

0.8
Amplitude

0.6

0.4

0.2

0 2 4 6 8 10 12 14

Time (seconds)

MECH365 – Week 1 Lecture Notes


Week 2

Steady-State Error Analysis


of Control Systems
(Chapter 5, Section 5-8)

MECH365 - Control of Machines and Processes, 2022


Background
One of the most important characteristics of control system
is their transient response. The transient response is the
response of a system as a function of time.
If an open-loop control system does not provide a
satisfactory response, a closed-loop system is often
replaced to yield the desired response by adjusting the
feedback loop parameters.
The closed-loop control can reduce the effect of
disturbances significantly
But it usually reduce the system sensitivity

MECH365 – Week 2 Lecture Notes


Background
A steady-sate error is the error after the transient response has
decayed, leaving only the continuous response.
A control system can have a steady-state error in tracking various
inputs. The magnitude of the error is an indication of how good
the system is following various inputs.
A step input, a ramp input and a parabolic (acceleration) input are
generally used to evaluate the performance of a control system in
terms of the steady-state error. The error can be
eliminated/reduced by modifying the structure of the system.
Further, the error constants can be utilised to determine certain
parameters of a control system.
MECH365 – Week 2 Lecture Notes
Classification of Control Systems

Consider a feedback control system with the following open-loop


transfer function (OLTF)
𝑲𝑲(𝑻𝑻𝒂𝒂 𝒔𝒔 + 𝟏𝟏)(𝑻𝑻𝒃𝒃 𝒔𝒔 + 𝟏𝟏) ⋯ (𝑻𝑻𝒎𝒎 𝒔𝒔 + 𝟏𝟏)
𝑮𝑮 𝒔𝒔 𝑯𝑯 𝒔𝒔 = 𝑵𝑵
𝒔𝒔 (𝑻𝑻𝟏𝟏 𝒔𝒔 + 𝟏𝟏)(𝑻𝑻𝟐𝟐 𝒔𝒔 + 𝟏𝟏) ⋯ (𝑻𝑻𝒑𝒑 𝒔𝒔 + 𝟏𝟏)

It involves the term 𝑠𝑠 𝑁𝑁 in the denominator


The number of N represents the number of integrations
A system type is determined by the number N
MECH365 – Week 2 Lecture Notes
When N=0, the system is a Type 0 system
When N=1, the system is a Type 1 system
When N=2, the system is a Type 2 system

The higher the system type is, the smaller the steady-state
error is.
But the relative stability of the system becomes worse.

MECH365 – Week 2 Lecture Notes


Steady-state error

The closed-loop transfer function of the system is


𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
=
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)

The tracking error is given by


𝐺𝐺(𝑠𝑠)
𝐸𝐸 𝑠𝑠 = 𝑅𝑅 𝑠𝑠 − 𝐶𝐶 𝑠𝑠 = 𝑅𝑅 𝑠𝑠 − 𝑅𝑅(𝑠𝑠)
1 + 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)
𝐺𝐺(𝑠𝑠)
= 𝑅𝑅(𝑠𝑠) 1 −
1 + 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)

MECH365 – Week 2 Lecture Notes


For H(s) =1
1
𝐸𝐸 𝑠𝑠 = 𝑅𝑅(𝑠𝑠)
1 + 𝐺𝐺 𝑠𝑠

The steady-state error is

𝑠𝑠𝑠𝑠(𝑠𝑠)
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑒𝑒 𝑡𝑡 = lim 𝑠𝑠𝑠𝑠 𝑠𝑠 = lim
𝑡𝑡→∞ 𝑠𝑠→0 𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠)

We will use static error constants to evaluate the input


following ability of control systems. The input to a control
system can be position, velocity, temperature, pressure etc.

MECH365 – Week 2 Lecture Notes


Static Position Error Constant Kp
1
Under a unit-step input, i.e, 𝑅𝑅 𝑠𝑠 = , the steady-sate error is
𝑠𝑠
1
𝑠𝑠𝑠𝑠(𝑠𝑠) 𝑠𝑠 1
𝑒𝑒𝑠𝑠𝑠𝑠 = lim = lim 𝑠𝑠 = lim
𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠)

1
=
1 + 𝐺𝐺(0)

The static position error constant is defined by


𝐾𝐾𝑝𝑝 = lim 𝐺𝐺 𝑠𝑠 = 𝐺𝐺(0)
𝑠𝑠→0

Thus, the steady-state error in terms of 𝐾𝐾𝑝𝑝 is given


1
𝑒𝑒𝑠𝑠𝑠𝑠 =
1 + 𝐾𝐾𝑝𝑝
MECH365 – Week 2 Lecture Notes
For a type 0 system,
𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
𝐾𝐾𝑝𝑝 = lim 0 = 𝐾𝐾
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

For a type 1 or a higher system,


𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1) 𝐾𝐾
𝐾𝐾𝑝𝑝 = lim 𝑁𝑁 = =∞
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1) 0

Hence, the steady-state errors under a unit-step input are


1
𝑒𝑒𝑠𝑠𝑠𝑠 = , for type 0 systems
1 + 𝐾𝐾𝑝𝑝
𝑒𝑒𝑠𝑠𝑠𝑠 = 0,
for type 1 or higher systems
MECH365 – Week 2 Lecture Notes
If there is no integration in the feedforward path, the response
of a feedback control system to a step input involves a steady-
state error.
If small errors for step inputs can be tolerated, then a type 0
system may be permissible, provided the gain K is sufficiently
large.
If zero steady-state error for a step input is desired, the type of
the system must be one or higher, i.e., N≥1.

MECH365 – Week 2 Lecture Notes


Static Velocity Error Constant Kv
under a unit ramp input, the steady-state error of the system is

1 1 1 1
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑠𝑠 2
= lim = lim
𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠 𝑠𝑠→0 𝑠𝑠 + 𝑠𝑠𝑠𝑠(𝑠𝑠) 𝑠𝑠→0 𝑠𝑠𝑠𝑠(𝑠𝑠)

The static velocity error constant is defined by


𝐾𝐾𝑣𝑣 = lim 𝑠𝑠𝑠𝑠(𝑠𝑠)
𝑠𝑠→0

Thus, the steady-state error in terms of 𝐾𝐾𝑣𝑣 is given by


1
𝑒𝑒𝑠𝑠𝑠𝑠 =
𝐾𝐾𝑣𝑣

MECH365 – Week 2 Lecture Notes


For a type 0 system,
𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 =0
𝑠𝑠→0 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

For a type 1 system,


𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 = 𝐾𝐾
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

For a type 2 or higher system,


𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1) 𝐾𝐾
𝐾𝐾𝑣𝑣 = lim 𝑁𝑁 = =∞
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1) 0

MECH365 – Week 2 Lecture Notes


The summary of the steady-state errors under a unit-ramp input are

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.

MECH365 – Week 2 Lecture Notes


Static Acceleration Error Constant Ka
Under a unit-parabolic input 𝑡𝑡 2
𝑟𝑟 𝑡𝑡 = � 2 , 𝑓𝑓𝑓𝑓𝑓𝑓 𝑡𝑡 ≥ 0
0, 𝑓𝑓𝑓𝑓𝑓𝑓 𝑡𝑡 < 0

The steady-state error of the system is given by


1 1 1
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑠𝑠 3
= lim 2
𝑠𝑠→0 1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠 𝑠𝑠→0 𝑠𝑠 𝐺𝐺(𝑠𝑠)

The static acceleration error constant is defined by


𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 2 𝐺𝐺(𝑠𝑠)
𝑠𝑠→0

Thus, the steady-state error in terms of 𝐾𝐾𝑎𝑎 is given by


1
𝑒𝑒𝑠𝑠𝑠𝑠 =
𝐾𝐾𝑎𝑎
MECH365 – Week 2 Lecture Notes
For a type 0 or 1 system,
𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
2
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 0/1 =0
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

For a type 2 system,


𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 2 2
= 𝐾𝐾
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

For a type 3 or higher system,


2
𝐾𝐾(𝑇𝑇𝑎𝑎 𝑠𝑠 + 1)(𝑇𝑇𝑏𝑏 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑚𝑚 𝑠𝑠 + 1)
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 𝑁𝑁 =∞
𝑠𝑠→0 𝑠𝑠 (𝑇𝑇1 𝑠𝑠 + 1)(𝑇𝑇2 𝑠𝑠 + 1) ⋯ (𝑇𝑇𝑝𝑝 𝑠𝑠 + 1)

MECH365 – Week 2 Lecture Notes


The summary of the steady-state errors under a unit-parabolic
input are
1
𝑒𝑒𝑠𝑠𝑠𝑠 =
𝐾𝐾𝑎𝑎
=∞, for type 0 and 1 systems
1 1
𝑒𝑒𝑠𝑠𝑠𝑠 = = ,
𝐾𝐾𝑎𝑎 𝐾𝐾 for type 2 systems
1
𝑒𝑒𝑠𝑠𝑠𝑠 = = 0,
𝐾𝐾𝑎𝑎 for type 3 or higher systems

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.

MECH365 – Week 2 Lecture Notes


Summary of steady-state errors for types 0, 1 and 2 systems
under unit-step, unit-ramp and unit-parabolic inputs

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

MECH365 – Week 2 Lecture Notes


Table 5-1 Steady-state error in terms of Gain K

MECH365 – Week 2 Lecture Notes


Example 1: For a unity-feedback control system given below,
determine the steady-state errors under a unit-step input, a
unit-ramp input and a unit-acceleration or parabolic input. Verify
your results using MATLAB for t=10 second with time increment
of 0.1 second.

15(𝑠𝑠 + 4)
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)

MECH365 – Week 2 Lecture Notes


Solution: 15(𝑠𝑠 + 4)
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)
The transfer function indicates that it is a type 1 system. The
error constants 𝐾𝐾𝑝𝑝 , 𝐾𝐾𝑣𝑣 𝑎𝑎𝑎𝑎𝑎𝑎 𝐾𝐾𝑎𝑎 are calculated below:
15(𝑠𝑠 + 4)
𝐾𝐾𝑝𝑝 = lim =∞
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)

15(𝑠𝑠 + 4) 60 5
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 = =
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9) 72 6

15(𝑠𝑠 + 4)
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 2 =0
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 4)(𝑠𝑠 + 9)

MECH365 – Week 2 Lecture Notes


Therefore, the steady-state errors of the system under the unit-
step, unit-ramp and unit-parabolic inputs are calculated:
1
Under unit-step input: 𝑒𝑒𝑠𝑠𝑠𝑠 = =0
1 + 𝐾𝐾𝑝𝑝

1 6
Under unit-ramp input: 𝑒𝑒𝑠𝑠𝑠𝑠 = = = 1.2
𝐾𝐾𝑣𝑣 5

1
Under unit-parabolic input: 𝑒𝑒𝑠𝑠𝑠𝑠 = =∞
𝐾𝐾𝑎𝑎

MECH365 – Week 2 Lecture Notes


Unit-step response
2

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

MECH365 – Week 2 Lecture Notes


MECH365 – Week 2 Lecture Notes
Example 2: Assume a unity-feedback system has the closed-
loop transfer function
𝐶𝐶(𝑠𝑠) 𝑠𝑠 + 4
= 2
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 2𝑠𝑠 + 4

Find the open-loop transfer function 𝐺𝐺 𝑠𝑠 . Determine the


steady-state error under a unit-ramp input.

MECH365 – Week 2 Lecture Notes


Solution:
Solve the equation to get G(s)
𝐺𝐺(𝑠𝑠) 𝑠𝑠 + 4 𝑠𝑠 + 4
= 2 ⇒ 𝐺𝐺 𝑠𝑠 =
1 + 𝐺𝐺(𝑠𝑠) 𝑠𝑠 + 2𝑠𝑠 + 4 𝑠𝑠(𝑠𝑠 + 1)

This is a type 1 system. The static velocity error constant 𝐾𝐾𝑣𝑣 is


calculated as
𝑠𝑠 + 4
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 =4
𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 1)

Hence, the steady-sate error under a unit-ramp input, is given by


1
𝑒𝑒𝑠𝑠𝑠𝑠 = = 0.25
𝐾𝐾𝑣𝑣

MECH365 – Week 2 Lecture Notes


Example 3: For the following control system, determine the value
of gain K such that the steady-state error is zero for a unit-step
input.

MECH365 – Week 2 Lecture Notes


Solution:
The closed-loop transfer function of the system is
𝐶𝐶(𝑠𝑠) 5𝐾𝐾(𝑠𝑠 + 0.1)
= 𝑇𝑇(𝑠𝑠) =
𝑅𝑅(𝑠𝑠) 𝑠𝑠(𝑠𝑠 + 3)(𝑠𝑠 + 0.1) + 5(𝑠𝑠 + 2)

The tracking error signal E(s) is given by


𝐸𝐸 𝑠𝑠 = 𝑅𝑅 𝑠𝑠 − 𝐶𝐶 𝑠𝑠 = 𝑅𝑅(𝑠𝑠) 1 − 𝑇𝑇(𝑠𝑠)

Hence, the steady-state error under a unit-step is


1
𝑒𝑒𝑠𝑠𝑠𝑠 = lim 𝑠𝑠𝑠𝑠 𝑠𝑠 = lim 𝑠𝑠 1 − 𝑇𝑇(𝑠𝑠) = 1 − 𝑇𝑇 0 = 0
𝑠𝑠→0 𝑠𝑠→0 𝑠𝑠

0.5𝐾𝐾
1− = 0 ⇒ 𝐾𝐾 = 20
10

MECH365 – Week 2 Lecture Notes


Appendix

Closed-loop System Subject to a Disturbance

MECH365 – Week 2 Lecture Notes


Advantages of Feedback Control Systems

 Increased accuracy; the error between desired and


actual output can be reduced to zero
 Reduced sensitivity to changes in system parameter
variations
 Reduced effects of disturbances
 Increased speed of response

MECH365 – Week 2 Lecture Notes


A Closed-loop system subjected to a disturbance

 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

MECH365 – Week 2 Lecture Notes


A Closed-loop system subjected to a disturbance
Case a: no disturbance 𝑪𝑪𝑹𝑹 (𝒔𝒔)

𝐶𝐶𝑅𝑅 (𝑠𝑠) 𝐺𝐺1 (𝑠𝑠)𝐺𝐺2 (𝑠𝑠)


=
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠)

Case b: no reference input


𝑪𝑪𝑫𝑫 (𝒔𝒔)

𝐶𝐶𝐷𝐷 (𝑠𝑠) 𝐺𝐺2 (𝑠𝑠)


=
𝐷𝐷(𝑠𝑠) 1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠)

MECH365 – Week 2 Lecture Notes


A Closed-loop system subjected to a disturbance
 The total system response due to the simultaneous application of
reference input and disturbances is:
𝐶𝐶 𝑠𝑠 = 𝐶𝐶𝑅𝑅 𝑠𝑠 + 𝐶𝐶𝐷𝐷 𝑠𝑠
𝐺𝐺1 𝑠𝑠 𝐺𝐺2 (𝑠𝑠) 𝐺𝐺2 𝑠𝑠
= 𝑅𝑅 𝑠𝑠 + 𝐷𝐷 𝑠𝑠
1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠) 1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠)

Consider the case 𝐺𝐺1 𝑠𝑠 𝐻𝐻(𝑠𝑠) ≫ 1 𝑎𝑎𝑎𝑎𝑎𝑎 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠) ≫ 1

𝐺𝐺2 𝑠𝑠 D s 𝐺𝐺2 𝑠𝑠 D s D(s)


𝐶𝐶𝐷𝐷 𝑠𝑠 = ≈ = ≈0
1+𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻 𝑠𝑠 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻 𝑠𝑠 𝐺𝐺1 𝑠𝑠 𝐻𝐻 𝑠𝑠

Thus in the closed-loop control system, the effect of disturbance is


suppressed

MECH365 – Week 2 Lecture Notes


Week 3

Stability Analysis of Control


Systems
(Chapter 5, Section 5-6)

MECH365 - Control of Machines and Processes, 2022


Background

𝑪𝑪(𝒔𝒔) 𝑮𝑮(𝒔𝒔)
=
𝑹𝑹(𝒔𝒔) 𝟏𝟏 + 𝑮𝑮 𝒔𝒔 𝑯𝑯(𝒔𝒔)

The denominator of the transfer function is called the


characteristic equation of the system, which is 1+G(s)H(s)=0.

MECH365 – Week 3 Lecture Notes


Background
If all roots or poles of the characteristic equation of the system
are in the left-half plane, the system will be stable.
If at least one of its roots are in the right half-plane, the system
will be unstable.
If at least one of its roots are on the imaginary axis, the system
will be critically stable.
Please note that all the roots of the closed loop control system
need to be found to evaluate its stability.

MECH365 – Week 3 Lecture Notes


MECH365 – Week 3 Lecture Notes
Background
Nyquist Stability Criterion (NSC) and Routh-Hurwitz
Criterion (RHC) do not require to find the roots of the
characteristic equation or the poles of the closed-loop
transfer function. NSC is covered in MECH321.
In this subject, we will cover the RHC, which is an
algebraic method to determine whether the roots of the
closed loop characteristic equation lie in the LHP (left half
plane), RHP (right half plane) or on the imaginary axis.
Further, it can be used as a control system design method
to determine certain system parameters (gains) resulting in
a stable response.

MECH365 – Week 3 Lecture Notes


The closed-loop transfer function is expressed as

𝐶𝐶(𝑠𝑠) 𝑏𝑏0 𝑠𝑠 𝑚𝑚 + 𝑏𝑏1 𝑠𝑠 𝑚𝑚−1 + ⋯ + 𝑏𝑏𝑚𝑚−1 𝑠𝑠 + 𝑏𝑏𝑚𝑚 𝐵𝐵(𝑠𝑠)


= 𝑛𝑛 𝑛𝑛−1
=
𝑅𝑅(𝑠𝑠) 𝑎𝑎0 𝑠𝑠 + 𝑎𝑎1 𝑠𝑠 + ⋯ + 𝑎𝑎𝑛𝑛−1 𝑠𝑠 + 𝑎𝑎𝑛𝑛 𝐴𝐴(𝑠𝑠)

The characteristic equation of the transfer function is an n-th


order polynomial

𝐴𝐴 𝑠𝑠 = 𝑎𝑎0 𝑠𝑠 𝑛𝑛 + 𝑎𝑎1 𝑠𝑠 𝑛𝑛−1 + ⋯ + 𝑎𝑎𝑛𝑛−1 𝑠𝑠 + 𝑎𝑎𝑛𝑛 = 0

MECH365 – Week 3 Lecture Notes


Necessary condition for a stable system: all the coefficients
of the characteristic equation are real, have the same sign,
and none of the coefficient is zero.

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

The system is unstable though A(s) satisfies the necessary


condition.
MECH365 – Week 3 Lecture Notes
Routh-Hurwitz Criterion (RHC)
The RHC is a necessary and sufficient criterion to evaluate
whether a control system is stable, unstable, or marginally
stable.
When the criterion is applied to a control system, information
about system stability can be obtained directly from the
coefficients of the characteristic equation.
The coefficients of the characteristic equation are used to form
the Routh-Hurwitz (RH) array.
𝑎𝑎0 𝑠𝑠 𝑛𝑛 + 𝑎𝑎1 𝑠𝑠 𝑛𝑛−1 + ⋯ + 𝑎𝑎𝑛𝑛−1 𝑠𝑠 + 𝑎𝑎𝑛𝑛 = 0

MECH365 – Week 3 Lecture Notes


Routh-Hurwitz (RH) Array

sn 𝒂𝒂𝟎𝟎 𝒂𝒂𝟐𝟐 𝒂𝒂𝟒𝟒 … 0


sn-1 𝒂𝒂𝟏𝟏 𝒂𝒂𝟑𝟑 𝒂𝒂𝟓𝟓 … 0
sn-2 𝑏𝑏1 𝑏𝑏2 𝑏𝑏3 …
sn-3 𝑐𝑐1 𝑐𝑐2 𝑐𝑐3 …
sn-4 𝑑𝑑1 𝑑𝑑2 𝑑𝑑3 …
. . .
. . .
. . .

s2 𝑒𝑒1 𝑒𝑒2 0
s1 𝑓𝑓1 0
s0 𝑔𝑔1

MECH365 – Week 3 Lecture Notes


Steps for generating the RH Array
1. Label the rows with powers of s from the highest power of the
characteristic equation (𝑠𝑠 𝑛𝑛 ) to 𝑠𝑠 0
2. In the first row, or the 𝑠𝑠 𝑛𝑛 row, start with the coefficient of 𝑠𝑠 𝑛𝑛 and list
horizontally every other coefficient of 𝑠𝑠 𝑛𝑛−2 , 𝑠𝑠 𝑛𝑛−4 , …; in the second
row (𝑠𝑠 𝑛𝑛−1 row), list the coefficient of 𝑠𝑠 𝑛𝑛−1 , 𝑠𝑠 𝑛𝑛−3 , ….
3. The remaining entries are filled as follows. Each entry is a negative
determinant of entries in the previous two rows divided by the entry
in the first column directly above the calculated row. The left-hand
column of the determinant is always the first column of the previous
two rows, and the right-hand column is the elements of the column
above and to the right. The array is completed when all of the rows
are completed down to 𝑠𝑠 0 . The total number of rows is 𝑛𝑛 + 1.

MECH365 – Week 3 Lecture Notes


The coefficients 𝑏𝑏1 , 𝑏𝑏2 , 𝑏𝑏3 in row 3 are evaluated as below:
𝑎𝑎1 𝑎𝑎2 − 𝑎𝑎0 𝑎𝑎3 𝑎𝑎1 𝑎𝑎4 − 𝑎𝑎0 𝑎𝑎5 𝑎𝑎1 𝑎𝑎6 − 𝑎𝑎0 𝑎𝑎7
𝑏𝑏1 = , 𝑏𝑏2 = , 𝑏𝑏3 = ,⋯
𝑎𝑎1 𝑎𝑎1 𝑎𝑎1

Similarly, the coefficients c’s,d’s, … in rows 4,5,… are evaluated as well


𝑏𝑏1 𝑎𝑎3 − 𝑎𝑎1 𝑏𝑏2 𝑏𝑏1 𝑎𝑎5 − 𝑎𝑎1 𝑏𝑏3 𝑏𝑏1 𝑎𝑎7 − 𝑎𝑎1 𝑏𝑏4
𝑐𝑐1 = , 𝑐𝑐2 = , 𝑐𝑐3 = ,⋯
𝑏𝑏1 𝑏𝑏1 𝑏𝑏1
𝑐𝑐1 𝑏𝑏2 − 𝑏𝑏1 𝑐𝑐2 𝑐𝑐1 𝑏𝑏3 − 𝑏𝑏1 𝑐𝑐3 𝑐𝑐1 𝑏𝑏4 − 𝑏𝑏1 𝑐𝑐4
𝑑𝑑1 = , 𝑑𝑑2 = , 𝑑𝑑3 = ,⋯
𝑐𝑐1 𝑐𝑐1 𝑐𝑐1

The process in continued until the nth row has been completed
𝑓𝑓1 𝑒𝑒2 − 0
𝑔𝑔1 = = 𝑒𝑒2
𝑓𝑓1

The complete array of coefficient is triangular


MECH365 – Week 3 Lecture Notes
RHC: the number of closed loop poles in the RHP is the
number of sign changes in the first column of the RH
array. No sign changes indicates a stable system.

MECH365 – Week 3 Lecture Notes


Example: A robot manipulator is controlled through unity-feedback control
system with a high gain proportional controller, K. Assume that the
numerical values of the system parameters and the gain K are selected
such that the characteristic equation of the closed loop transfer function is
obtained as 1 + 𝐾𝐾𝐾𝐾 𝑠𝑠 = 𝐴𝐴 𝑠𝑠 = 𝑠𝑠 4 + 2𝑠𝑠 3 + 3𝑠𝑠 2 + 4𝑠𝑠 + 5 = 0.
Use HSC to evaluate the stability of the system.

𝐶𝐶(𝑠𝑠) 𝐾𝐾𝐾𝐾(𝑠𝑠)
=
𝑅𝑅(𝑠𝑠) 1 + 𝐾𝐾𝐾𝐾(𝑠𝑠)

MECH365 – Week 3 Lecture Notes


Solution: use the coefficients of the characteristic equation to
form and then complete the RH array

𝐴𝐴 𝑠𝑠 = 𝑠𝑠 4 + 2𝑠𝑠 3 + 3𝑠𝑠 2 + 4𝑠𝑠 + 5

𝑠𝑠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

Two sign changes ⇒ two RHP poles ⇒ unstable


MECH365 – Week 3 Lecture Notes
Use MATLAB commands to verify the results

MECH365 – Week 3 Lecture Notes


Special Case 1: only the first term in a row is zero
If a first-column term in any row is zero, but the remaining terms
are non-zero or there is no remaining term, then the zero term is
replaced with a very small ε > 0 and proceed as before

Example: assume that the closed-loop transfer function of a


control system has the following characteristic equation

𝐴𝐴 𝑠𝑠 = 3𝑠𝑠 4 + 6𝑠𝑠 3 + 2𝑠𝑠 2 + 4𝑠𝑠 + 5 = 0

Evaluate the stability of this system.

MECH365 – Week 3 Lecture Notes


Solution: use the coefficients of the characteristic equation to
form the RH array
𝐴𝐴 𝑠𝑠 = 3𝑠𝑠 4 + 6𝑠𝑠 3 + 2𝑠𝑠 2 + 4𝑠𝑠 + 5

𝑠𝑠4 3 2 5
𝑠𝑠3 6 4
𝑠𝑠𝑠 0≈ε 5
𝑠𝑠1 (4ε-30)/ ε
𝑠𝑠0 5

𝜀𝜀 is a very small positive number. ⇒ (4𝜀𝜀−30)⁄𝜀𝜀 → −∞.


Thus, there are two sign changes ⇒ two RHP poles ⇒ unstable

MECH365 – Week 3 Lecture Notes


Use MATLAB commands to verify the results

MECH365 – Week 3 Lecture Notes


Special Case 2: occurrence of entire row of zeros
If a whole row of the array is zero, these will exist pairs of
roots which are mirror images with respect to the imaginary
axis. There are three basic types of factors possible.
i.e. (-σ, +σ), or (-jω, jω), or (-σ±jω, +σ±jω)

jω jω jω
× × ×
× × σ
σ σ
× × ×

MECH365 – Week 3 Lecture Notes


Consider a closed-loop control system with the following
characteristic polynomial
𝐴𝐴 𝑠𝑠 = 𝑠𝑠 5 + 2𝑠𝑠 4 + 24𝑠𝑠 3 + 48𝑠𝑠 2 − 25𝑠𝑠 − 50 = 0
The array of coefficients is
𝑠𝑠5 1 24 -25
𝑠𝑠4 2 48 -50 ← auxiliary polynomial
𝑠𝑠3 0 0 ← whole row of zeros

The auxiliary polynomial is formed from the coefficients of the


row immediately above the all zeros row (i.e. 𝑠𝑠4)

MECH365 – Week 3 Lecture Notes


The auxiliary polynomial 𝑃𝑃(𝑠𝑠) is
𝑃𝑃 𝑠𝑠 = 2𝑠𝑠 4 + 48𝑠𝑠 2 − 50

This indicates that there are two pairs of roots of equal


magnitude and opposite signs, which can be obtained by solving
𝑃𝑃 𝑠𝑠 = 0

To carry on with the Routh array, differentiate 𝑃𝑃(𝑠𝑠) with


respect to 𝑠𝑠
𝑑𝑑𝑑𝑑(𝑠𝑠)
= 8𝑠𝑠 3 + 96𝑠𝑠
𝑑𝑑𝑑𝑑

MECH365 – Week 3 Lecture Notes


𝑑𝑑𝑑𝑑(𝑠𝑠)
Replace the all zero row (𝑠𝑠𝑠) terms by coefficients, then
𝑑𝑑𝑑𝑑
continue to complete the RH array
𝑠𝑠5 1 24 -25
𝑠𝑠4 2 48 -50
𝑠𝑠3 8 96
𝑠𝑠2 24 -50
𝑠𝑠1 112.7 0
𝑠𝑠0 -50

There is one sign change ⇒ one RHP pole ⇒ unstable

MECH365 – Week 3 Lecture Notes


The roots of the auxiliary polynomial exist as conjugate pairs,
which are either +𝜎𝜎, −𝜎𝜎 or +𝑗𝑗𝜔𝜔, −𝑗𝑗𝑗𝑗

𝑃𝑃 𝑠𝑠 = 2𝑠𝑠 4 + 48𝑠𝑠 2 − 50 = 2 𝑠𝑠 2 − 1 𝑠𝑠 2 + 25
= 2(𝑠𝑠 + 1)(𝑠𝑠 − 1)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗)

The characterisation equation A(s)=0 ban be factored as


(𝑠𝑠 + 1)(𝑠𝑠 − 1)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗) 𝑠𝑠 + 2 = 0

The five roots are: ±1, ±𝑗𝑗𝑗, −2

MECH365 – Week 3 Lecture Notes


Use MATLAB commands to verify the results

MECH365 – Week 3 Lecture Notes


RHC used for control system analysis
RHC is able to determine the stability range of one or two
parameters of a system. In other words, the effects of the system
parameter(s) on the stability can be analysed with RHC.

Example 1: For the following unity feedback system, determine


the range of the gain 𝐾𝐾 for stability. Assume that 𝐾𝐾 > 0.

MECH365 – Week 3 Lecture Notes


Solution: the closed-loop transfer function of the system is
given by
𝐶𝐶(𝑠𝑠) 𝐾𝐾(𝑠𝑠 − 2)
=
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 1 𝑠𝑠 2 + 6𝑠𝑠 + 25 + 𝐾𝐾(𝑠𝑠 − 2)
𝐾𝐾(𝑠𝑠 − 2)
= 3
𝑠𝑠 + 7𝑠𝑠 2 + 31 + 𝐾𝐾 𝑠𝑠 + (25 − 2𝐾𝐾)

The characteristic equation of the system is

𝐴𝐴 𝑠𝑠 = 𝑠𝑠 3 + 7𝑠𝑠 2 + 31 + 𝐾𝐾 𝑠𝑠 + 25 − 2𝐾𝐾 = 0

MECH365 – Week 3 Lecture Notes


The RH array is formed as
𝑠𝑠3 1 31 + 𝐾𝐾
𝑠𝑠2 7 25 − 2𝐾𝐾
192 + 9𝐾𝐾
𝑠𝑠1 0
7
𝑠𝑠0 25 − 2𝐾𝐾

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

MECH365 – Week 3 Lecture Notes


Example 2: Two tracks are operated at different speeds to turn a
vehicle. The design of a turning control for the tracked vehicle involves
the selection of two parameters: 𝐾𝐾 and 𝑎𝑎.
Use HSC to determine the range of these two parameters such that the
system is stable.
Find the steady-state error of the system under a unit-ramp input when
𝐾𝐾 = 70 and 𝑎𝑎 = 0.6.

Adapted from Modern Control Systems, 13E, p. 413, Dorf&Bishop


MECH365 – Week 3 Lecture Notes
Solution: the closed-loop transfer function of the system is given by
𝐶𝐶(𝑠𝑠) 𝐾𝐾(𝑠𝑠 + 𝑎𝑎)
= 4
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 8𝑠𝑠 3 + 17𝑠𝑠 2 + 𝐾𝐾 + 10 𝑠𝑠 + 𝐾𝐾𝐾𝐾

The characteristic polynomial of the system is


𝐴𝐴 𝑠𝑠 = 𝑠𝑠 4 +8𝑠𝑠 3 + 17𝑠𝑠 2 + 𝐾𝐾 + 10 𝑠𝑠 + 𝐾𝐾𝐾𝐾

The RH array is as below


𝑠𝑠4 1 17 𝐾𝐾𝐾𝐾
𝑠𝑠3 8 𝐾𝐾 + 10
126 − 𝐾𝐾
126−𝐾𝐾 𝐾𝐾 + 10 − 8𝐾𝐾𝐾𝐾
𝑠𝑠𝑠 𝐾𝐾𝐾𝐾 𝑥𝑥 = 8
126 − 𝐾𝐾
8
8
𝑠𝑠1 𝑥𝑥 =
126 − 𝐾𝐾 𝐾𝐾 + 10 − 64𝐾𝐾𝐾𝐾
126 − 𝐾𝐾
𝑠𝑠
MECH365 0
𝐾𝐾𝐾𝐾
– Week 3 Lecture Notes
For a stable system, all coefficients in the first column must be
positive. Therefore,
126 − 𝐾𝐾
> 0 ⇒ 0 < 𝐾𝐾 < 126
8

126 − 𝐾𝐾 𝐾𝐾 + 10 − 64𝐾𝐾𝐾𝐾 (126 − 𝐾𝐾)(𝐾𝐾 + 8)


𝑥𝑥 = > 0 ⇒ 𝑎𝑎 <
126 − 𝐾𝐾 64𝐾𝐾

• for K=50, a < 1.3775


• for K=70, a < 0.975
• for K=100, a < 0.4388

MECH365 – Week 3 Lecture Notes


The static velocity error constant is
𝑠𝑠 + 𝑎𝑎 𝐾𝐾 𝐾𝐾𝐾𝐾
𝐾𝐾𝑣𝑣 = lim 𝑠𝑠 =
𝑠𝑠→0 𝑠𝑠 + 1 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 5) 10

Thus, the steady-state error is

1 10 10
𝑒𝑒𝑠𝑠𝑠𝑠 = = = = 0.238 = 23.8%
𝐾𝐾𝑣𝑣 𝐾𝐾𝐾𝐾 70 × 0.6

MECH365 – Week 3 Lecture Notes


Matlab verification

MECH365 – Week 3 Lecture Notes


Week 4

Control System Design Using


Frequency Response Analysis
(Chapter 5, Section 7-11)

MECH365 - Control of Machines and Processes, 2022


Review of Relative stability
The control system must be stable and has adequate
relative stability

Gain margin and phase margin are used to quantify


relative stability
Gain margin and phase margin can be determined
from
- polar plot
- bode plot
MECH365 – Week 4 Lecture Notes
Polar plot
𝐾𝐾
𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = (𝐾𝐾 = 40,80)
(𝑠𝑠 + 1)(𝑠𝑠 + 2)(𝑠𝑠 + 3)

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

MECH365 – Week 4 Lecture Notes


Phase and gain margin

• Closed loop is marginally stable for |G|=1 & ∠G=-1800 or


polar plot cuts (-1,0)

• In general, the closer the polar plot is closer to (-1,0), the


more oscillatory

• This closeness or margins can be used as a measure of


relative stability

MECH365 – Week 4 Lecture Notes


Gain margin, 𝐾𝐾𝑔𝑔
Im[G]
• 𝐾𝐾𝑔𝑔 is the increase in |𝐺𝐺| when
ωcp Unit
circle
∠𝐺𝐺= − 1800 to make the closed
1/Kg loop system unstable

0
× • 𝐾𝐾𝑔𝑔 =1/|𝐺𝐺(𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 )|
-1 γ
∠G=φ Re[G] =−20 log |𝐺𝐺(𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 )| 𝑑𝑑𝑑𝑑

• 𝜔𝜔𝑐𝑐𝑐𝑐 = phase crossover frequency


|G|=1

ω = +0

MECH365 – Week 4 Lecture Notes


Phase margin, γ
Im[G]
• γ is the additional phase lag added
ωcp Unit to ∠𝐺𝐺 when |𝐺𝐺| = 1 to make the
circle
1/Kg closed loop system unstable

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ω

• Locate ω𝑐𝑐𝑐𝑐 at which ∠G= - 1800; ω𝑐𝑐𝑐𝑐 is the phase


crossover frequency

• Find 20log |𝐺𝐺(𝑗𝑗ω𝑐𝑐𝑐𝑐)|


• Kg = - 20log |𝐺𝐺(𝑗𝑗ω𝑐𝑐𝑐𝑐)| dB
MECH365 – Week 4 Lecture Notes
Finding γ on bode plot
|G|

0 dB
* logω
∠G

γ
-1800
ωcg logω

• Locate ω𝑐𝑐𝑐𝑐 for |G|= 0 dB; ω𝑐𝑐𝑐𝑐 is the gain crossover


frequency

• 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

MECH365 – Week 4 Lecture Notes


Example 1: Consider a unity-feedback control system
whose open-loop transfer function is
𝑎𝑎𝑎𝑎 + 1
𝐺𝐺 𝑠𝑠 =
𝑠𝑠 2
Determine the value of 𝑎𝑎 so that the phase margin is 450
Im[G]

ωcp Unit
circle
1/Kg

0
×
-1 γ
∠G=φ Re[G]

|G|=1

ωcg
ω = +0

MECH365 – Week 4 Lecture Notes


Solution: 𝐺𝐺 𝑗𝑗𝜔𝜔 = 𝑎𝑎𝑎𝑎𝑎𝑎+1 ⇒
(𝑗𝑗𝑗𝑗)2

𝑎𝑎2 𝜔𝜔2 +1
𝐺𝐺 𝑗𝑗𝜔𝜔 = , ∠𝐺𝐺 𝑗𝑗𝑗𝑗 = 𝑡𝑡𝑡𝑡𝑡𝑡−1 𝑎𝑎𝑎𝑎 − 1800
𝜔𝜔2

The phase margin of 450 at ω = ω𝑐𝑐𝑐𝑐 requires that


2
𝑎𝑎2 𝜔𝜔𝑐𝑐𝑐𝑐 +1
2 =1
𝜔𝜔𝑐𝑐𝑐𝑐
1800 + 𝑡𝑡𝑡𝑡𝑡𝑡−1 𝑎𝑎𝜔𝜔𝑐𝑐𝑐𝑐 − 1800 = 450
Thus, we have
2
𝑎𝑎2 𝜔𝜔𝑐𝑐𝑐𝑐 4
+ 1 = 𝜔𝜔𝑐𝑐𝑐𝑐

𝑎𝑎𝜔𝜔𝑐𝑐𝑐𝑐 = 1
1
Solving for 𝑎𝑎, we obtain 𝑎𝑎 = 4 = 0.841
2
MECH365 – Week 4 Lecture Notes
Example 2: Consider a remotely controlled pick up arm for
collecting waste bags. The tip position of the hydraulic arm is
controlled through a unity feedback control system, where an
integral controller is employed as the controller.

(Picture adapted from “Modern Control Systems”, 10E, page 569, Dorf&Bishop.)

MECH365 – Week 4 Lecture Notes


Determine the value of the integral gain, 𝐾𝐾𝐼𝐼 , such that the
phase margin is 50º

MECH365 – Week 4 Lecture Notes


Solution:
The open-loop transfer function is obtained as
𝐾𝐾𝐼𝐼
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 2 + 2𝑠𝑠 + 4)

𝐾𝐾𝐼𝐼 𝐾𝐾𝐼𝐼
𝐺𝐺 𝑗𝑗𝜔𝜔 = =
𝑗𝑗𝜔𝜔(𝑗𝑗 2 𝜔𝜔 2 + 2𝑗𝑗𝜔𝜔 + 4) 𝑗𝑗𝜔𝜔((4 − 𝜔𝜔 2 ) + 𝑗𝑗𝑗𝑗𝑗)

The magnitude and phase angle are:


𝐾𝐾𝐼𝐼 𝜋𝜋 −1
2𝜔𝜔
𝐺𝐺(𝑗𝑗𝜔𝜔) = , ∠𝐺𝐺 𝑗𝑗𝑗𝑗 = − − tan
2 2
𝜔𝜔 (4 − 𝜔𝜔 ) +4𝜔𝜔 2 2 4 − 𝜔𝜔 2

The phase margin is:


𝜋𝜋 −1
2𝜔𝜔𝑐𝑐𝑐𝑐
𝑃𝑃𝑃𝑃 = 𝜋𝜋 + ∠𝐺𝐺 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = − − tan 2
2 4 − 𝜔𝜔𝑐𝑐𝑐𝑐

MECH365 – Week 4 Lecture Notes


50
Substitute 𝑃𝑃𝑃𝑃 = 500 = 𝜋𝜋 into the above equation and
180
solve 𝜔𝜔𝑐𝑐𝑐𝑐
𝜋𝜋 −1
2𝜔𝜔𝑐𝑐𝑐𝑐 50 −1
2𝜔𝜔𝑐𝑐𝑐𝑐 40
− tan 2 = 180 𝜋𝜋 ⇒ tan 2 = 180 𝜋𝜋 ⇒
2 4 − 𝜔𝜔𝑐𝑐𝑐𝑐 4 − 𝜔𝜔𝑐𝑐𝑐𝑐
2𝜔𝜔𝑐𝑐𝑐𝑐 2 + 2.3835𝜔𝜔 − 4 = 0
2 = 0.8391 ⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐
4 − 𝜔𝜔𝑐𝑐𝑐𝑐

⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 = 1.1364 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 𝑜𝑜𝑜𝑜 𝜔𝜔𝑐𝑐𝑐𝑐 = −3.52 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 (invalid)

At the gain crossover frequency


𝐾𝐾𝐼𝐼
𝐺𝐺(𝑗𝑗𝑗.1364) = =1
1.1364 (4 − 1.13642 )2 +4 × 1.13642

⇒ 𝐾𝐾𝐼𝐼 = 4.0181

MECH365 – Week 4 Lecture Notes


Controller Design Using Frequency
Response
The performance specifications in the frequency domain are
described in terms of phase margin, gain margin, and bandwidth.
Determining control parameters (gains) is done using the open
loop transfer function of the system. After finding the gains, the
time-domain performance characteristics such as rise time,
settling time, and overshoot etc are determined using the closed-
loop transfer function. If they are not satisfactory, the
compensator must be modified until a satisfactory performance is
obtained.

MECH365 – Week 4 Lecture Notes


There are series compensation and parallel (feedback)
compensation, which have different types of compensators: lag,
lead, lag and lead compensators, etc.

Series compensation: the compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠) is placed


in series with the plant 𝐺𝐺(𝑠𝑠)

Parallel compensation or feedback compensation: the


compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠) is placed in parallel with the plant 𝐺𝐺2 (𝑠𝑠)

MECH365 – Week 4 Lecture Notes


These compensators reshape the open-loop transfer function
such that not only the phase margin and gain margin
specifications but also other performance specifications such as
error constants, rise time, and settling time etc are satisfied.

 Lead compensator increases the speed of response of the system


with a minor decrease in the steady-state accuracy.
 Lag compensator increases the steady-state accuracy with making
the system a bit sluggish.
 Lag-lead compensator combines the features of lag and lead
compensators. These three compensators can be used to improve
the system performance.

MECH365 – Week 4 Lecture Notes


Lead compensator
1
𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛼𝛼 = 𝐾𝐾𝑐𝑐 𝑇𝑇 0 < 𝛼𝛼 < 1
𝛼𝛼𝑇𝑇𝑇𝑇 + 1 1
𝑠𝑠 +
𝛼𝛼𝛼𝛼

Lag compensator
1
𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽 = 𝐾𝐾𝑐𝑐 𝑇𝑇 β>1
𝛽𝛽𝑇𝑇𝑇𝑇 + 1 1
𝑠𝑠 +
𝛽𝛽𝑇𝑇

Lag-lead compensator
1 1
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝑇𝑇2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 γ β > 1, γ > 1
𝑠𝑠 + 1
𝑇𝑇1 𝑠𝑠 +
𝛽𝛽𝑇𝑇2

MECH365 – Week 4 Lecture Notes


Lead Compensation Based on
Frequency Response

1
𝑠𝑠 + 𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 𝐾𝐾𝑐𝑐 𝛼𝛼 0 < 𝛼𝛼 < 1
1 𝛼𝛼𝛼𝛼𝛼𝛼 + 1
𝑠𝑠 +
𝛼𝛼𝛼𝛼

MECH365 – Week 4 Lecture Notes


Typical Lead Networks

𝑏𝑏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

 The corner frequencies are 𝜔𝜔 =


1/𝑇𝑇 and 𝜔𝜔 = 1/(α𝑇𝑇)

Polar plot  The lead compensator is a high-pass


filter
 𝛼𝛼 is the attenuation factor; its
miminum value is limited by the
physical construction of the lead
compensator
 The maximum phase-lead angle is
Bode plot 𝜙𝜙𝑚𝑚 at 𝜔𝜔 = 𝜔𝜔𝑚𝑚
MECH365 – Week 4 Lecture Notes
The relationship between the maximum phase-lead angle 𝜙𝜙𝑚𝑚 and
the attenuation factor 𝛼𝛼 is
1 − 𝛼𝛼
2 1 − 𝛼𝛼
sin 𝜙𝜙m = =
1 + 𝛼𝛼 1 + 𝛼𝛼
2

The maximum phase lead occurs at 𝜔𝜔 = 𝜔𝜔𝑚𝑚 , where 𝜔𝜔𝑚𝑚 is


the geometric mean of the two corner frequencies
1 1 1
log𝜔𝜔𝑚𝑚 = log + log
2 𝑇𝑇 𝛼𝛼𝑇𝑇

1
⇒ 𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼

MECH365 – Week 4 Lecture Notes


The performance specifications of a dynamic system are gain
margin, phase margin, and static error constant. Let us
implement the procedure to design a lead compensator for the
following hydraulic actuator.

𝑌𝑌(𝑠𝑠) 𝐾𝐾
The transfer function is: =
𝑋𝑋(𝑠𝑠) 𝑠𝑠(𝑀𝑀𝑀𝑀 + 𝐵𝐵)

MECH365 – Week 4 Lecture Notes


Example: assume the hydraulic actuator system with the
4
transfer function 𝐺𝐺 𝑠𝑠 = is controlled through a unity-
𝑠𝑠(𝑠𝑠+2)
feedback control system. Design a lead compensator, 𝐺𝐺𝑐𝑐 (𝑠𝑠),
so that the system performance specifications are:
𝐾𝐾𝑉𝑉 = 20, 𝑃𝑃𝑃𝑃 = 500 , 𝑎𝑎𝑎𝑎𝑎𝑎 𝐺𝐺𝐺𝐺 = 10 𝑑𝑑𝑑𝑑

MECH365 – Week 4 Lecture Notes


The lead compensator is described by

1
𝑠𝑠 + 𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 𝐾𝐾𝑐𝑐 𝛼𝛼 0 < 𝛼𝛼 < 1
1 𝛼𝛼𝛼𝛼𝛼𝛼 + 1
𝑠𝑠 +
𝛼𝛼𝛼𝛼

MECH365 – Week 4 Lecture Notes


Step 1: Define 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼 and calculate the gain K satisfying
the static velocity error constant 𝐾𝐾𝑉𝑉
𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠)
𝑠𝑠→0
𝑇𝑇𝑇𝑇 + 1 4
= lim 𝑠𝑠𝑠𝑠 = 2𝐾𝐾 = 20
𝑠𝑠→0 𝛼𝛼𝛼𝛼𝛼𝛼 + 1 𝑠𝑠(𝑠𝑠 + 2)

⇒ 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼 = 10

The system is represented as below


𝐺𝐺1 (𝑠𝑠)

MECH365 – Week 4 Lecture Notes


Step 2: Calculate the phase margin of the system 𝐺𝐺1 𝑠𝑠 = 𝐾𝐾𝐾𝐾(𝑠𝑠)
40
𝐺𝐺1 𝑗𝑗𝜔𝜔 =
𝑗𝑗𝜔𝜔(𝑗𝑗𝑗𝑗 + 2)

The magnitude of phase angle of 𝐺𝐺1 (𝑗𝑗𝜔𝜔) are:


40 𝜋𝜋 −1
𝜔𝜔
𝐺𝐺1 (𝑗𝑗𝜔𝜔 = , ∠𝐺𝐺1 𝑗𝑗𝑗𝑗 = − − tan
𝜔𝜔 𝜔𝜔 2 + 4 2 2
40 2 2
𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 ) = = 1 ⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 𝜔𝜔𝑐𝑐𝑐𝑐 + 4 − 1600 = 0
2
𝜔𝜔𝑐𝑐𝑐𝑐 𝜔𝜔𝑐𝑐𝑐𝑐 +4
2 2
⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 = 38.05 𝑜𝑜𝑜𝑜 𝜔𝜔𝑐𝑐𝑐𝑐 = −42.05 (neglected)
Thus, 𝜔𝜔𝑐𝑐𝑐𝑐 = 38.05 = 6.1685 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
𝜋𝜋 −1
6.1685
𝑃𝑃𝑃𝑃 = 𝜋𝜋 + ∠𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = − tan = 0.3135 = 17.960
2 2
MECH365 – Week 4 Lecture Notes
The target phase margin is 50º; an additional ~32º (50º-17.96º≈32º) of
phase lead is needed. As the gain K cannot provide phase lead, the
solution is to use a lead compensator to provide the necessary phase
lead.
MECH365 – Week 4 Lecture Notes
Step 3: Determine the necessary phase lead by considering 5º to
12º additional phase lead. The total phase lead needed is 𝜙𝜙𝑚𝑚
Let us assume that the additional phase lead is 6º. The needed
phase lead is 38º i.e., 𝜙𝜙𝑚𝑚 = 38º

Please note that this phase lead occurs at 𝜔𝜔 = 𝜔𝜔𝑚𝑚 , which is


given by
1
𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼

MECH365 – Week 4 Lecture Notes


Step 4: Determine the attenuation factor 𝛼𝛼 from

1 − 𝛼𝛼
sin 𝜙𝜙m =
1 + 𝛼𝛼

1 − 𝛼𝛼 1 − sin380
sin380 = ⇒ 𝛼𝛼 = 0
= 0.24
1 + 𝛼𝛼 1 + sin38

and calculate the corresponding modification in the magnitude


curve due to the inclusion of the term in the OLTF
𝑇𝑇𝑇𝑇 + 1
𝛼𝛼𝑇𝑇𝑇𝑇 + 1 𝑠𝑠=𝑗𝑗𝜔𝜔𝑚𝑚

MECH365 – Week 4 Lecture Notes


1
The amount of modification in the magnitude at 𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼
1
𝑗𝑗𝑗𝑗𝜔𝜔𝑚𝑚 +1 𝑗𝑗 +1 1
𝛼𝛼
= 1 =
𝑗𝑗𝛼𝛼𝑇𝑇𝜔𝜔𝑚𝑚 +1 𝑗𝑗𝛼𝛼 +1 𝛼𝛼
𝛼𝛼

Magnitude modification is

1 1
= = 2.0412 = 6.1979 𝑑𝑑𝑑𝑑
𝛼𝛼 0.24

MECH365 – Week 4 Lecture Notes


Step 5: Determine the new gain crossover frequency, i.e., 𝜔𝜔𝑐𝑐𝑐𝑐 =𝜔𝜔𝑚𝑚
𝑗𝑗𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 +1 1
� 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = 1 𝑜𝑜𝑜𝑜 � 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 =1
𝑗𝑗𝛼𝛼𝑇𝑇𝜔𝜔𝑐𝑐𝑐𝑐 +1 𝛼𝛼

⇒ 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = 𝛼𝛼 = 0.24 = 0.4899

40
or 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = = 0.4899
𝜔𝜔𝑐𝑐𝑐𝑐 � 2 +22
𝜔𝜔𝑐𝑐𝑐𝑐

4 2
𝜔𝜔𝑐𝑐𝑐𝑐 + 4𝜔𝜔𝑐𝑐𝑐𝑐 − 6666.2253 = 0

2 2
𝜔𝜔𝑐𝑐𝑐𝑐 = 79.6741 𝑜𝑜𝑜𝑜 𝜔𝜔𝑐𝑐𝑐𝑐 =-83.6741 (neglect)

⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 = 𝜔𝜔𝑚𝑚 = 79.6741 = 8.9260 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠

MECH365 – Week 4 Lecture Notes


Step 6: Determine 𝑇𝑇, 𝐾𝐾𝑐𝑐 and finalise 𝐺𝐺𝑐𝑐 (𝑠𝑠)
1
𝜔𝜔𝑚𝑚 = = 8.9260 ⇒
𝑇𝑇 𝛼𝛼
1
= 𝜔𝜔𝑚𝑚 𝛼𝛼 = 8.9260 × 0.24 = 4.3728
𝑇𝑇

10
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼 ⇒ 𝐾𝐾𝑐𝑐 = = 41.7
0.24

1
𝑠𝑠 + 𝑠𝑠 + 4.3728
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 41.7
1 𝑠𝑠 + 18.22
𝑠𝑠 +
𝛼𝛼𝛼𝛼

MECH365 – Week 4 Lecture Notes


The OLTF of the compensated system is

𝑠𝑠 + 4.3728 4
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠) = 41.7
𝑠𝑠 + 18.22 𝑠𝑠(𝑠𝑠 + 2)

MECH365 – Week 4 Lecture Notes


Use MATLAB to verify the results

𝑠𝑠 + 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)

MECH365 – Week 4 Lecture Notes


clc
clear
Unit-step responses of uncompensated and compensated systems
1.4
num=[4];
uncompensated
compensated den=[1,2,0];
1.2
g1=tf(num,den);
cl_g1=feedback(g1,1);
1

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')

MECH365 – Week 4 Lecture Notes


clc
clear

Unit-ramp responses of uncompensated and compensated systems num=[4];


8
den=[1,2,0];
input g1=tf(num,den);
7
uncompensated cl_g1=feedback(g1,1);
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')

MECH365 – Week 4 Lecture Notes


Week 5

Control System Design Using


Frequency Response Analysis
(cont’)
(Chapter 5, Section 7-11)

MECH365 - Control of Machines and Processes, 2022


Review: steps for lead compensator design
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼
1 − 𝑠𝑠𝑠𝑠𝑠𝑠𝜙𝜙𝑚𝑚
𝛼𝛼 =
1 + 𝑠𝑠𝑠𝑠𝑠𝑠𝜙𝜙𝑚𝑚
1
𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼
𝑇𝑇𝑇𝑇+1 𝑗𝑗𝑗𝑗𝜔𝜔𝑚𝑚 +1 1
= =
𝛼𝛼𝑇𝑇𝑇𝑇+1 𝑠𝑠=𝑗𝑗𝜔𝜔𝑚𝑚 𝑗𝑗𝛼𝛼𝑇𝑇𝜔𝜔𝑚𝑚 +1 𝛼𝛼

Step 1: use the static error constant to find 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼


Step 2: Let 𝐺𝐺1 𝑠𝑠 = 𝐾𝐾𝐾𝐾(𝑠𝑠). Find the phase margin of 𝐺𝐺1 (𝑗𝑗𝜔𝜔). Then find the phase
lead deficiency, i.e., the difference between required PM and the PM of 𝐺𝐺1 (𝑗𝑗𝜔𝜔). Plus
1−𝑠𝑠𝑠𝑠𝑠𝑠∅𝑚𝑚
additional phase lead to get ∅𝑚𝑚 . Use the formula 𝛼𝛼 = to get 𝛼𝛼.
1+𝑠𝑠𝑠𝑠𝑠𝑠∅𝑚𝑚
Step 3: Determine the new gain crossover frequency, 𝜔𝜔𝑐𝑐𝑐𝑐 = 𝜔𝜔𝑚𝑚 , by solving the
equation, 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 = 𝛼𝛼.
1 𝐾𝐾
Step 4: Use the formula 𝜔𝜔𝑚𝑚 = to determine T. Determine 𝐾𝐾𝑐𝑐 = and finalise the
𝑇𝑇 𝛼𝛼 𝛼𝛼
lead compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠).
MECH365 – Week 5 Lecture Notes
Lag compensator

The lag compensator is given by


1
𝑇𝑇𝑇𝑇 + 1 𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽 = 𝐾𝐾𝑐𝑐 𝑇𝑇 (𝛽𝛽 > 1)
𝛽𝛽𝛽𝛽𝛽𝛽 + 1 1
𝑠𝑠 +
𝛽𝛽𝛽𝛽

MECH365 – Week 5 Lecture Notes


Polar plot and Bode diagram of a lead compensator

𝑗𝑗𝑗𝑗𝑗𝑗 + 1
𝐺𝐺𝑐𝑐 𝑗𝑗𝑗𝑗 = 𝐾𝐾𝑐𝑐 𝛽𝛽 𝛽𝛽 > 1
𝑗𝑗𝑗𝑗𝑗𝑗𝑗𝑗 + 1

 The corner frequencies are ω=1/T


and ω=1/(βT)
Polar plot
 The lag compensator is essentially
a low-pass filter
 The primary function of a lag
compensator is to provide
attenuation in the high-frequency
range to give a system sufficient
phase margin
Bode plot (Kc =1 and β=10)
MECH365 – Week 5 Lecture Notes
Example: A numerically controlled (NC) milling machine with
two axes powered with two servomotors can be represented
by a transfer function:

2
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

It is required to design and implement a lag compensator such


that the system has the following specifications:
𝐾𝐾𝑉𝑉 = 5 𝑠𝑠 −1 , 𝑃𝑃𝑃𝑃 = 400 𝑎𝑎𝑎𝑎𝑎𝑎 𝐺𝐺𝐺𝐺 = 10𝑑𝑑𝑑𝑑

MECH365 – Week 5 Lecture Notes


Lag Compensator System
R(s) C(s)
𝑮𝑮𝒄𝒄 (𝒔𝒔) 𝑮𝑮(𝒔𝒔)

𝑇𝑇𝑇𝑇 + 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽
𝛽𝛽𝛽𝛽𝛽𝛽 + 1
2
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

So the open-loop transfer function of the compensated system is


𝑇𝑇𝑇𝑇 + 1 2
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽
𝛽𝛽𝛽𝛽𝛽𝛽 + 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

MECH365 – Week 5 Lecture Notes


Step 1: Define 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽 and calculate the gain 𝐾𝐾 satisfying
the static velocity error constant: 𝑲𝑲𝑽𝑽

𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠


𝑠𝑠→0

𝑇𝑇𝑇𝑇 + 1 2
= lim 𝑠𝑠𝑠𝑠 = 𝐾𝐾 = 5
𝑠𝑠→0 𝛽𝛽𝛽𝛽𝛽𝛽 + 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

Note: the open-loop transfer function of the compensated system can be


𝑻𝑻𝑻𝑻+𝟏𝟏
rewritten as: � 𝐾𝐾𝐾𝐾(𝑠𝑠)
𝜷𝜷𝜷𝜷𝜷𝜷+𝟏𝟏
𝑮𝑮𝟏𝟏 (𝒔𝒔)

MECH365 – Week 5 Lecture Notes


Step 2: Calculate the phase margin and gain margin of the
gain-adjusted but uncompensated system, 𝐺𝐺1 𝑠𝑠 = 𝐾𝐾𝐾𝐾 𝑠𝑠
2 10
𝐺𝐺1 𝑠𝑠 = 𝐾𝐾𝐾𝐾 𝑠𝑠 = 5 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2) 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

so

10
𝐺𝐺1 𝑗𝑗𝜔𝜔 =
𝑗𝑗𝜔𝜔(𝑗𝑗𝜔𝜔 + 1)(𝑗𝑗𝜔𝜔 + 2)

MECH365 – Week 5 Lecture Notes


The magnitude and phase angle are given by
10
𝐺𝐺1 (𝑗𝑗𝜔𝜔) =
𝜔𝜔 𝜔𝜔 2 + 1 𝜔𝜔 2 + 4

𝜋𝜋 −1 𝜔𝜔 −1 𝜔𝜔
∠𝐺𝐺1 𝑗𝑗𝑗𝑗 = − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡
2 1 2

- Step for finding the phase margin, PM


10
𝐺𝐺1 (𝑗𝑗𝜔𝜔) = =1 ⇒
𝜔𝜔 𝜔𝜔2 +1 𝜔𝜔2 +4

𝜔𝜔2 𝜔𝜔2 + 1 𝜔𝜔2 + 4 = 100 ⇒


𝜔𝜔6 + 5𝜔𝜔4 + 4𝜔𝜔2 =100
let z = 𝜔𝜔2 ⇒ 𝑧𝑧 3 + 5𝑧𝑧 2 + 4𝑧𝑧 = 100 ⇒ z=3.2479
⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 = 3.2479 = 1.8022 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠

MECH365 – Week 5 Lecture Notes


𝜋𝜋 −1 1.8022 −1 1.8022
∠𝐺𝐺1 (j𝜔𝜔𝑐𝑐𝑐𝑐 )= − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡 =-3.3684 rad
2 1 2
So 𝑃𝑃𝑃𝑃=𝜋𝜋 − 3.3644 = −0.2268 𝑟𝑟𝑟𝑟𝑟𝑟 = −12.99690

A negative PM indicates that the system is unstable!

- Step for finding the gain margin, GM

The gain margin is calculated after finding the phase crossover


frequency, 𝜔𝜔𝑐𝑐𝑝𝑝

𝜋𝜋 −1 𝜔𝜔𝑐𝑐𝑐𝑐 −1 𝜔𝜔𝑐𝑐𝑐𝑐
∠𝐺𝐺1 (j𝜔𝜔𝑐𝑐𝑐𝑐 )= − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡 =-𝜋𝜋 ⇒
2 1 2
−1 𝜔𝜔𝑐𝑐𝑐𝑐 +𝑡𝑡𝑡𝑡𝑡𝑡−1 𝜔𝜔𝑐𝑐𝑐𝑐 =𝜋𝜋 ⇒ 𝜔𝜔
𝑡𝑡𝑡𝑡𝑡𝑡 𝑐𝑐𝑐𝑐 = 1.4142 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
1 2 2

MECH365 – Week 5 Lecture Notes


10
𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 ) = = 1.6667 = 4.437𝑑𝑑𝑑𝑑
𝜔𝜔𝑐𝑐𝑐𝑐 𝜔𝜔𝑐𝑐𝑐𝑐 2 + 1 𝜔𝜔𝑐𝑐𝑐𝑐 2 + 4
⇒ GM=- 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 ) =-4.437dB !!

A negative GM indicates that the system is unstable!

MECH365 – Week 5 Lecture Notes


Bode Diagram
100

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 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = −𝜋𝜋 + 𝑃𝑃𝑃𝑃𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡
Assume that the additional phase lag is 12º to account for the
phase lag introduced by the lag compensator. The total required
phase lag is 𝑃𝑃𝑃𝑃𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡 = 400 + 120 = 520 . Therefore,

∠𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = −1800 + 520 = −1280

MECH365 – Week 5 Lecture Notes


𝜋𝜋 −1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 −1 𝜔𝜔𝑐𝑐𝑔𝑔,𝑛𝑛𝑛𝑛𝑛𝑛 𝜋𝜋
∠𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 )= − − 𝑡𝑡𝑡𝑡𝑡𝑡 − 𝑡𝑡𝑡𝑡𝑡𝑡 =−128
2 1 2 180

−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

⟹ 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = 0.464 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠 𝑜𝑜𝑜𝑜 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = −4.31 (𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛)


MECH365 – Week 5 Lecture Notes
Please note that it is normally not straightforward to determine
the new gain crossover frequency, 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 . We may use
MATLAB to help calculate the magnitude, and phase angle at
various values of 𝜔𝜔.

Frequency Magnitude(dB) Phase Angle


0.4095 20.8829 -123.8398
0.4292 20.3965 -125.3405
0.4498 19.9035 -126.8964
0.4640 19.5745 -127.9900

⟹ 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = 0.464 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠

MECH365 – Week 5 Lecture Notes


Step 4: Determine the attenuation necessary to bring the
magnitude down to 1 or 0 dB at this new gain crossover frequency.
This attenuation is equal to -20*logβ, from which β is calculated.

MECH365 – Week 5 Lecture Notes


𝑇𝑇𝑇𝑇 + 1
Review: the Bode plots of 𝛽𝛽𝛽𝛽𝛽𝛽 + 1
with T=10, β= 5, 10, 20
Bode Diagram
0

𝑇𝑇𝑇𝑇𝜔𝜔 + 1 𝑇𝑇 2 𝜔𝜔 2 + 1
=
-10

β=5 𝛽𝛽𝑇𝑇𝑇𝑇𝑇𝑇 + 1 𝛽𝛽2 𝑇𝑇 2 𝜔𝜔 2 + 1


Magnitude (dB)

-20 β = 10 𝑇𝑇 2 𝜔𝜔 2 𝑇𝑇𝑇𝑇 1
β = 20 ≈ = =
𝛽𝛽2 𝑇𝑇 2 𝜔𝜔 2 𝛽𝛽𝑇𝑇𝑇𝑇 𝛽𝛽
-30

(𝑇𝑇 2 𝜔𝜔2 ≫ 1)
0

-30

Thus, the magnitude contribution of


Phase (deg)

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)

MECH365 – Week 5 Lecture Notes


𝑇𝑇𝑇𝑇𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 + 1 1
� 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = 1 𝑜𝑜𝑜𝑜 𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 =1
𝛽𝛽𝑇𝑇𝑇𝑇𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 + 1 𝛽𝛽

⇒ 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) = 𝛽𝛽

Substitute 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 =0.464 rad/sec into the above equation

5
𝛽𝛽 = 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) =
2 2
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 � 1 + 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 � 1 + 0.25𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
5
= = 9.52
0.464 � 1 + 0.4642 � 1+ 0.25×0.4642

= 19.57dB

MECH365 – Week 5 Lecture Notes


Step 5: Choose the corner frequency ω=1/T one decade
below the gain crossover frequency;

1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 0.464
= = = 0.0464
𝑇𝑇 10 10

Then calculate

𝐾𝐾 5
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽 ⇒ 𝐾𝐾𝑐𝑐 = = = 0.525
𝛽𝛽 9.52

MECH365 – Week 5 Lecture Notes


The transfer function of the lag compensator is

1
𝑠𝑠 + 𝑠𝑠 + 0.0464
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇 = 0.525
1 𝑠𝑠 + 0.00487
𝑠𝑠 +
𝛽𝛽𝛽𝛽

MECH365 – Week 5 Lecture Notes


The OLTF of the compensated system is
𝑠𝑠 + 0.0464 2
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠) = 0.525
𝑠𝑠 + 0.00487 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

Use MATLAB to verify the results:

Gm =14.5794 dB numc=0.525*2*[1,0.0464];
Pm =46.8258 degrees denc=conv([1,0.00487],[1,3,2,0]);

Wcp =1.3694 rad/sec gc=tf(numc,denc);


[Gm,Pm,Wcp,Wcg]=margin(gc)
Wcg =0.4658 rad/sec

The design satisfies the given design specifications

MECH365 – Week 5 Lecture Notes


A lag compensator makes a system slower; reduces the
bandwidth of the system.
The bandwidths of the uncompensated and compensated
closed-loop control systems.

wb_u =1.2620 rad/sec, wb_c =0.8397 rad/sec.


num=[2];
den=[1,3,2,0];
g1=tf(num,den);
cl_g1=feedback(g1,1);

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)

MECH365 – Week 5 Lecture Notes


Unit-step responses of uncompensated and compensated systems num=[2];
1.4
den=[1,3,2,0];
uncompensated
g1=tf(num,den);
compensated
1.2 cl_g1=feedback(g1,1);

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')

MECH365 – Week 5 Lecture Notes


num=[2];
den=[1,3,2,0];
Unit-ramp responses of uncompensated and compensated systems
50 g1=tf(num,den);
cl_g1=feedback(g1,1);
45 input
uncompensated
40 compensated numc=0.525*2*[1,0.0464];
denc=conv([1,0.00487],[1,3,2,0]);
35
gc=tf(numc,denc);
30 cl_gc=feedback(gc,1);
Outputs

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')

MECH365 – Week 5 Lecture Notes


50

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

MECH365 – Week 5 Lecture Notes


We normally select the case of γ=𝛽𝛽 for designing the lag-lead
compensator, so the lag-lead compensator has the form:

1 1
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1)
𝑠𝑠+𝑇𝑇 𝑠𝑠+𝑇𝑇
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇1 =𝐾𝐾𝑐𝑐 𝛽𝛽 1
2
(𝛽𝛽 > 1)
𝛽𝛽
𝑠𝑠+1 (𝛽𝛽𝑇𝑇2 𝑠𝑠+1) 𝑠𝑠+𝑇𝑇 𝑠𝑠+𝛽𝛽𝑇𝑇
1 2

The lag-lead compensator has four parameters for determining:


𝐾𝐾𝑐𝑐 , 𝛽𝛽, 𝑇𝑇1 𝑎𝑎𝑎𝑎𝑎𝑎 𝑇𝑇2

MECH365 – Week 5 Lecture Notes


The compensator acts as a lag compensator for 0 < 𝜔𝜔 < 𝜔𝜔1 and
a lead compensator for𝜔𝜔1 < 𝜔𝜔 < ∞
1
The phase angle is 0 at 𝜔𝜔1 =
𝑇𝑇1 𝑇𝑇2

Polar plot (Kc =1 and 𝛾𝛾=β)


Bode plot (Kc =1, 𝛾𝛾= β=10 and
𝑇𝑇2 = 10𝑇𝑇1 )
MECH365 – Week 5 Lecture Notes
Example: A numerically controlled (NC) milling machine with
two axes powered with two servomotors can be represented
by a transfer function:

𝐾𝐾
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

It is required to design and implement a lag-lead compensator


such that the system has the following specifications:
𝐾𝐾𝑉𝑉 = 10 𝑠𝑠 −1 , 𝑃𝑃𝑃𝑃 = 500 𝑎𝑎𝑎𝑎𝑎𝑎 𝐺𝐺𝐺𝐺 ≥ 10𝑑𝑑𝑑𝑑

MECH365 – Week 5 Lecture Notes


1 1
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝑇𝑇2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 (𝛽𝛽 > 1)
𝛽𝛽 1
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝛽𝛽𝑇𝑇2
𝐾𝐾
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
The open-loop transfer function of the compensated system is
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 . As the K of the system is adjustable, let us assume 𝐾𝐾𝑐𝑐 =
1, thus
1 1
𝑠𝑠 +𝑠𝑠 + 𝐾𝐾
𝑇𝑇1 𝑇𝑇2
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 =
𝛽𝛽 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝛽𝛽𝑇𝑇2
MECH365 – Week 5 Lecture Notes
Step 1: Calculate the gain K satisfying the static velocity error
constant: 𝑲𝑲𝑽𝑽

𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠


𝑠𝑠→0

1 1
𝑠𝑠 + 𝑠𝑠 + 𝐾𝐾
𝑇𝑇1 𝑇𝑇2
= lim 𝑠𝑠
𝑠𝑠→0 𝛽𝛽 1 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝑠𝑠 + 𝑠𝑠 +
𝑇𝑇1 𝛽𝛽𝑇𝑇2

𝐾𝐾
= = 10 ⇒ 𝐾𝐾 = 20
2

MECH365 – Week 5 Lecture Notes


Step 2: Calculate the phase margin and gain margin of the
gain-adjusted but uncompensated system
20
𝐺𝐺1 𝑠𝑠 = 𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

so
20
𝐺𝐺1 𝑗𝑗𝜔𝜔 =
𝑗𝑗𝜔𝜔(𝑗𝑗𝜔𝜔 + 1)(𝑗𝑗𝜔𝜔 + 2)

MECH365 – Week 5 Lecture Notes


The magnitude and phase angle are given by
20
𝐺𝐺1 (𝑗𝑗𝜔𝜔) =
𝜔𝜔 𝜔𝜔 2 + 1 𝜔𝜔 2 + 4

𝜋𝜋 −1 𝜔𝜔 −1 𝜔𝜔
∠𝐺𝐺1 𝑗𝑗𝑗𝑗 = − −𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡
2 1 2

- Step for finding the phase margin, PM


20
𝐺𝐺1 (𝑗𝑗𝜔𝜔) = =1 ⇒
𝜔𝜔 𝜔𝜔2 +1 𝜔𝜔2 +4

𝜔𝜔2 𝜔𝜔2 + 1 𝜔𝜔2 + 4 = 400 ⇒


𝜔𝜔6 + 5𝜔𝜔4 + 4𝜔𝜔2 =400
let z = 𝜔𝜔2 ⇒ 𝑧𝑧 3 + 5𝑧𝑧 2 + 4𝑧𝑧 = 400 ⇒ z=5.8819
⇒ 𝜔𝜔𝑐𝑐𝑐𝑐 = 5.8819 = 2.4253 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠

MECH365 – Week 5 Lecture Notes


𝜋𝜋 −1 2.4253 −1 2.4253
∠𝐺𝐺1 (j𝜔𝜔𝑐𝑐𝑐𝑐 )= − − 𝑡𝑡𝑡𝑡𝑡𝑡 -𝑡𝑡𝑡𝑡𝑡𝑡 =-3.6317 rad
2 1 2
So 𝑃𝑃𝑃𝑃 = 𝜋𝜋 − 3.6317 = −0.49 rad=-28.090

A negative PM indicates that the system is unstable!


Bode Diagram
Gm = -10.5 dB (at 1.41 rad/s) , Pm = -28.1 deg (at 2.43 rad/s)
100

50
Magnitude (dB)

-50

-100
-90
Phase (deg)

-180

-270
-2 -1 1 2
10 10 10 0 10 10
Frequency (rad/s)

MECH365 – Week 5 Lecture Notes


Step 3: choose a new gain crossover frequency by calculating
∠𝐺𝐺1 (j𝜔𝜔)=- 180º
𝜋𝜋 𝜔𝜔 𝜔𝜔
∠𝐺𝐺1 (j𝜔𝜔)= − − 𝑡𝑡𝑡𝑡𝑡𝑡−1 -𝑡𝑡𝑡𝑡𝑡𝑡−1 =-𝜋𝜋 ⇒
2 1 2
−1 𝜔𝜔 −1 𝜔𝜔 𝜋𝜋
𝑡𝑡𝑡𝑡𝑡𝑡 +𝑡𝑡𝑡𝑡𝑡𝑡 = ⇒ 𝜔𝜔 = 1.4142 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
1 2 2

We then choose this frequency of 1.4142 rad/s as the new gain


crossover frequency: 𝜔𝜔𝑐𝑐𝑐𝑐 = 1.4142 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠.
The phase angle at this frequency is about 50º

MECH365 – Week 5 Lecture Notes


Step 4: To determine the phase-lag portion of the lag-lead
1
compensator. This can be done by choosing 𝜔𝜔 = , which is 1
𝑇𝑇2
decade below the new gain crossover frequency: 𝜔𝜔 = 0.14 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
Recall the equation for calculating that the maximum phase-lead
1−𝛼𝛼
angle in the lead compensation is: sin 𝜙𝜙𝑚𝑚 = . In the lag-lead
1+𝛼𝛼
1
1−𝛽𝛽 𝛽𝛽−1
compensator, α=1/𝛽𝛽, so sin 𝜙𝜙𝑚𝑚 = 1 =
1+𝛽𝛽 𝛽𝛽+1

When 𝛽𝛽=10, 𝜙𝜙𝑚𝑚 =54.90 , which is close to the phase margin. So


1
we can choose 𝛽𝛽=10, then another corner frequency 𝜔𝜔 = =
𝛽𝛽𝑇𝑇2
0.014 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠. Thus, the phase-lag portion of the compensator is:
𝑠𝑠 + 0.14 7.14𝑠𝑠 + 1
= 10
𝑠𝑠 + 0.014 71.4𝑠𝑠 + 1
MECH365 – Week 5 Lecture Notes
Step 5: to determine the phase-lead portion of the lag-lead
compensator. Currently the lag-lead compensator is rewritten as:
1
𝑠𝑠 + 𝑇𝑇 𝑠𝑠 + 0.14 20
1
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 =
10 )
𝑠𝑠 + 𝑠𝑠 + 0.014 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2
𝑇𝑇1

By solving the equation 𝐺𝐺𝑐𝑐 𝑗𝑗𝑗.4142 𝐺𝐺(𝑗𝑗𝑗.4142) = 1, we can


1
get = 0.5. Thus, the phase-lead portion transfer function is:
𝑇𝑇

𝑠𝑠 + 0.5 1 2𝑠𝑠 + 1
=
𝑠𝑠 + 5 10 0.2𝑠𝑠 + 1

MECH365 – Week 5 Lecture Notes


The OLTF of the compensated system is

𝑠𝑠 + 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)

MECH365 – Week 5 Lecture Notes


Week 6

PID Controllers
(Chapter 8, Section 1-4)

Revision & Mid-Session Quiz

MECH365 - Control of Machines and Processes, 2022


PID Controllers
A PID controller is perhaps the most commonly used controller in
industry.
PID controllers have proven their usefulness in providing satisfied
control; particularly when the mathematical model of a system is
unknown and therefore no analytical design methods are available.

𝟏𝟏
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

MECH365 – Week 6 Lecture Notes


Comments on PID controller features
 The proportional gain is used to improve the steady-
state accuracy

 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

PID Gain Rise Time Percent Setting Time Steady-State


Overshoot Error
Increasing Decrease Increase Small change Decrease
𝐾𝐾𝑝𝑝
Increasing Decrease Increase Increase Eliminate
𝐾𝐾𝑖𝑖
Increasing Small change Decrease Decrease Small change
𝐾𝐾𝑑𝑑

Adapted from Modern Control Systems, 13E, p. 482, Dorf&Bishop

MECH365 – Week 6 Lecture Notes


Summary of PID controller characteristics
 A PD controller is like a lead compensator; increases the
system bandwidth; improves stability and transient
response
 A PI controller is like a lag compensator; increases the
steady-state characteristics; smaller speed of response
 A PID controller is like a lag-lead compensator; improves
both transient and steady-state characteristics

MECH365 – Week 6 Lecture Notes


Ziegler-Nichols (ZN) Rules for Tuning PID
Controllers
 Determine values of Kp, Ti, and Td based on the transient
response characteristics of a given plant
 Parameter determination or tuning of PID controllers can be
made on-site by experiments on the plant
 Two methods, Ziegler-Nichols tuning rules:
- the first method
- the second method

MECH365 – Week 6 Lecture Notes


First Method
• The unit-step response of a plant exhibits an S-shaped curve, which is
characterized by two constants: delay time L and time constant T

Inflection point

Delay time Time constant

MECH365 – Week 6 Lecture Notes


First Method
• The values of Kp, Ti, and Td can be determined according to
formula shown in Table 8-1

MECH365 – Week 6 Lecture Notes


First Method
• The PID controller tuned by the first method gives
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠
𝑇𝑇 1
= 1.2 1+ + 0.5𝐿𝐿𝐿𝐿
𝐿𝐿 2𝐿𝐿𝐿𝐿
2
1
𝑠𝑠 + 𝐿𝐿
= 0.6𝑇𝑇
𝑠𝑠
• Thus, the PID controller has a pole at the origin and double
1
zeros at 𝑠𝑠 = −
𝐿𝐿

MECH365 – Week 6 Lecture Notes


Example 1
Consider the control system shown below in which a PID
controller is used to control the system. The PID controller has
the transfer function
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1+ + 𝑇𝑇𝑑𝑑 𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠

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.

MECH365 – Week 6 Lecture Notes


1. To find the unit-step response of the system without PID controller
Step Response
0.7

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)

MECH365 – Week 6 Lecture Notes


2. From Table 8-1, we obtain
1.2𝑇𝑇
𝐾𝐾𝑝𝑝 = = 1.2 × 0.798 ÷ 0.053 = 18.068
𝐿𝐿
𝑇𝑇𝑖𝑖 = 2𝐿𝐿 = 2 ×0.053=0.106
𝑇𝑇𝑑𝑑 = 0.5𝐿𝐿 = 0.5 ×0.053=0.0265
Hence
1 𝑠𝑠 + 1⁄𝐿𝐿 2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠 = 0.6𝑇𝑇
𝑇𝑇𝑖𝑖 𝑠𝑠 𝑠𝑠
𝑠𝑠 + 18.8679 2
= 0.4788
𝑠𝑠
So the OLTF is
𝑠𝑠 + 18.8679 2 10
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 = 0.4788
𝑠𝑠 (𝑠𝑠 + 1)(𝑠𝑠 + 5)

MECH365 – Week 6 Lecture Notes


clc;clear
t=0:0.01:5;
num1=[1 2*18.8679
18.8679^2];
den1=[0 1 0];
g1=tf(num1,den1);
num2=[10];
den2=[1 6 5];
g2=tf(num2,den2);
g=series(g1,g2);
c1=feedback(g,1);
step(c1,t);
grid
title('\bfUnit-step response')
xlabel('\bf Time')
ylabel('\bf Amplitude')

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

Maximum overshoot is about 25%


clc;clear
t=0:0.01:5;
num1=[0 19.152 361.36
1704.535];
den1=[1 25.152 366.36
1704.535];
step(num1,den1,t);
grid
title('\bfUnit-step response')
xlabel('\bf Time')
ylabel('\bf Amplitude')

MECH365 – Week 6 Lecture Notes


Second Method
• Set Ti =∞, Td =0 and use proportional control only to find a
critical value of gain, Kcr, where the output exhibits sustained
oscillations. At this critical gain the corresponding period, Pcr,
will be determined

MECH365 – Week 6 Lecture Notes


Second Method
• After determining Kcr and Pcr, the values of Kp, Ti, and Td can
be determined according to formula shown in Table 8-2

MECH365 – Week 6 Lecture Notes


Second Method
• The PID controller tuned by the second method gives
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠
1
= 0.6𝐾𝐾𝑐𝑐𝑐𝑐 1 + + 0.125𝑃𝑃𝑐𝑐𝑐𝑐 𝑠𝑠
0.5𝑃𝑃𝑐𝑐𝑐𝑐 𝑠𝑠
2
4
𝑠𝑠 +
𝑃𝑃𝑐𝑐𝑐𝑐
= 0.075𝐾𝐾𝑐𝑐𝑐𝑐 𝑃𝑃𝑐𝑐𝑐𝑐
𝑠𝑠
• Thus, the PID controller has a pole at the origin and double
4
zeros at 𝑠𝑠 = −
𝑃𝑃𝑐𝑐𝑐𝑐

MECH365 – Week 6 Lecture Notes


It is noted that the gains selected through the ZN methods usually result
in stable step responses, but with excessive overshoots. The ZN gains
should be re-tuned or finely tuned to determine the most appropriate
gains satisfying the requirements.

The first method of ZN is valid for a dynamic system with an s


shaped open-loop step response, which can be generated by
𝟏𝟏
systems not having integrators ( ) in their mathematical model and
𝒔𝒔
not having any dominant complex conjugate poles.
The second method of ZN can not be applied to tuning, if the
response of the system does not contain any continuous oscillations
for any value of the proportional gain.

MECH365 – Week 6 Lecture Notes


Example 2
Consider the control system shown below in which a PID
controller is used to control the system. The PID controller has
the transfer function
1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1+ + 𝑇𝑇𝑑𝑑 𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠

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

Hence, the period of sustained oscillation is


2𝜋𝜋
𝑃𝑃𝑐𝑐𝑐𝑐 = = 2.8099
5

MECH365 – Week 6 Lecture Notes


4. To determine Kp, Ti, and Td based on Table 8-2, and then to determine
the PID controller
𝐾𝐾𝑝𝑝 = 0.6𝐾𝐾𝑐𝑐𝑐𝑐 = 18,
𝑇𝑇𝑖𝑖 = 0.5𝑃𝑃𝑐𝑐𝑐𝑐 = 1.405,
𝑇𝑇𝑑𝑑 = 0.125𝑃𝑃𝑐𝑐𝑐𝑐 = 0.35124

So the transfer function of the PID controller is

1 1
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑝𝑝 1 + + 𝑇𝑇𝑑𝑑 𝑠𝑠 =18 1 + + 0.35124𝑠𝑠
𝑇𝑇𝑖𝑖 𝑠𝑠 1.405𝑠𝑠

6.3223(𝑠𝑠+1.4235)2
=
𝑠𝑠

MECH365 – Week 6 Lecture Notes


5. To examine the unit-step response using MATLAB and to check the
overshoot

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)

MECH365 – Week 6 Lecture Notes


6. Fine tune: move the double zero to -0.65 with Kp kept at 18
Ti=4Td

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
𝑠𝑠

MECH365 – Week 6 Lecture Notes


Unit-step response
1.2
Overshoot = 18%

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)

MECH365 – Week 6 Lecture Notes


7. Fine tune again: increase 𝐾𝐾𝑝𝑝 to 39.42 without changing double zeros (-
0.65) 2 2
(𝑠𝑠 + 0.65) (𝑠𝑠 + 0.65)
𝐺𝐺𝑐𝑐 𝑠𝑠 = 39.72 × 0.7692 = 30.322
𝑠𝑠 𝑠𝑠
Unit-step response
1.4

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)

MECH365 – Week 6 Lecture Notes


Topics
1. MECH321 review: 1st- and 2nd-order system step-input
responses (time domain); phase margin and gain
margin (frequency domain)
2. Steady-state error analysis
3. Stability analysis – Routh’s criterion
4. Control design using frequency response analysis: lead
compensator; lag compensator
5. PID controllers

MECH365 – Week 6 Lecture Notes


1.1: 1st-order system step-input response

𝐾𝐾
𝐺𝐺 𝑠𝑠 =
𝑇𝑇𝑇𝑇 + 1

MECH365 – Week 6 Lecture Notes


1.2: 2nd-order system step-input response

𝐾𝐾𝜔𝜔𝑛𝑛2
𝐺𝐺 𝑠𝑠 = 2
𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛2

MECH365 – Week 6 Lecture Notes


𝜋𝜋 − 𝑐𝑐𝑐𝑐𝑐𝑐 −1 ζ𝜋𝜋 − 𝛽𝛽
Rise Time: 𝑡𝑡𝑟𝑟 = =
𝜔𝜔𝑑𝑑
𝜔𝜔𝑛𝑛 1 − ζ2

𝜋𝜋 𝜋𝜋
Peak Time: 𝑡𝑡𝑝𝑝 = =
𝜔𝜔𝑑𝑑 𝜔𝜔𝑛𝑛 1 − ζ2

−ζπ� 1−ζ2
Maximum Overshoot: 𝑀𝑀𝑝𝑝 = 𝑒𝑒

4
Settling Time: 𝑡𝑡𝑠𝑠 =
ζ𝜔𝜔𝑛𝑛

MECH365 – Week 6 Lecture Notes


1.3: Phase margin (𝛾𝛾) and gain margin (𝐾𝐾𝑔𝑔 )

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

𝐾𝐾𝑔𝑔 = −20 𝑙𝑙𝑙𝑙𝑙𝑙 𝐺𝐺 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 𝑑𝑑𝑑𝑑


𝛾𝛾 = 1800 + ∠𝐺𝐺 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐

MECH365 – Week 6 Lecture Notes


2: Steady-state error analysis

𝐾𝐾𝑝𝑝 = lim 𝐺𝐺(𝑠𝑠)


𝑠𝑠→0
𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝑠𝑠(𝑠𝑠)
𝑠𝑠→0
𝐾𝐾𝑎𝑎 = lim 𝑠𝑠 2 𝐺𝐺(𝑠𝑠)
𝑠𝑠→0

MECH365 – Week 6 Lecture Notes


3: RHC
C.E.: 𝐴𝐴 𝑠𝑠 = 𝑎𝑎0 𝑠𝑠 𝑛𝑛 + 𝑎𝑎1 𝑠𝑠 𝑛𝑛−1 + ⋯ + 𝑎𝑎𝑛𝑛−1 𝑠𝑠 + 𝑎𝑎𝑛𝑛 = 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

MECH365 – Week 6 Lecture Notes


4.1: Lead compensator design
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼
1 − 𝑠𝑠𝑠𝑠𝑠𝑠𝜙𝜙𝑚𝑚
𝛼𝛼 =
1 + 𝑠𝑠𝑠𝑠𝑠𝑠𝜙𝜙𝑚𝑚
𝑮𝑮𝟏𝟏 (𝒔𝒔) 1
𝜔𝜔𝑚𝑚 =
𝑇𝑇 𝛼𝛼
𝑇𝑇𝑇𝑇+1 𝑗𝑗𝑗𝑗𝜔𝜔𝑚𝑚 +1 1
= =
𝛼𝛼𝑇𝑇𝑇𝑇+1 𝑠𝑠=𝑗𝑗𝜔𝜔𝑚𝑚 𝑗𝑗𝛼𝛼𝑇𝑇𝜔𝜔𝑚𝑚 +1 𝛼𝛼

Step 1: use the static error constant to find 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛼𝛼


Step 2: Let 𝐺𝐺1 𝑠𝑠 = 𝐾𝐾𝐾𝐾(𝑠𝑠). Find the phase margin of 𝐺𝐺1 (𝑗𝑗𝜔𝜔). Then find the phase
lead deficiency, i.e., the difference between required PM and the PM of 𝐺𝐺1 (𝑗𝑗𝜔𝜔). Plus
1−𝑠𝑠𝑠𝑠𝑠𝑠∅𝑚𝑚
additional phase lead to get ∅𝑚𝑚 . Use the formula 𝛼𝛼 = to get 𝛼𝛼.
1+𝑠𝑠𝑠𝑠𝑠𝑠∅𝑚𝑚
Step 3: Determine the new gain crossover frequency, 𝜔𝜔𝑐𝑐𝑐𝑐 = 𝜔𝜔𝑚𝑚 , by solving the
equation, |𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐 | = 𝛼𝛼.
1 𝐾𝐾
Step 4: Use the formula 𝜔𝜔𝑚𝑚 = to determine T. Determine 𝐾𝐾𝑐𝑐 = and finalise the
𝑇𝑇 𝛼𝛼 𝛼𝛼
lead compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠).
MECH365 – Week 6 Lecture Notes
4.2: Lag compensator design
Lag Compensator System
R(s) C(s)
𝑮𝑮(𝒔𝒔) 𝑇𝑇𝑇𝑇 + 1
𝑮𝑮𝒄𝒄 (𝒔𝒔) 𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝛽𝛽
𝛽𝛽𝛽𝛽𝛽𝛽 + 1

𝑮𝑮𝟏𝟏 (𝒔𝒔)
𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽

Step 1: Use the static error constant condition to find 𝐾𝐾 = 𝐾𝐾𝑐𝑐 𝛽𝛽


Step 2: Use the PM condition to find new gain crossover frequency,
𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 , by solving the equation ∠𝐺𝐺1 𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 = −𝜋𝜋 + 𝑃𝑃𝑃𝑃𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡
1 𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛
Step 3: Find 𝛽𝛽= 𝐺𝐺1 (𝑗𝑗𝜔𝜔𝑐𝑐𝑐𝑐,𝑛𝑛𝑛𝑛𝑛𝑛 ) and =
𝑇𝑇 10

MECH365 – Week 6 Lecture Notes


5: PID controllers
ZN tuning rules:
Method 1: Table 8-1
Method 2: Table 8-2

MECH365 – Week 6 Lecture Notes


Information for online Mid-Session Quiz
When: Week 7 Wednesday, 7 September 2022, at 10:30am

Quiz via Moodle in the MECH365 Moodle site


- The quiz link is in week 7 Moodle folder
- 3 questions; open book exam
- Quiz duration: 90 minutes; extra 15 minutes for scanning and
submission handwritten solutions in the Moodle site

Contents: all week 1 to 5 topics may be covered, such as:


steady-state error analysis, stability analysis, lead
compensator design, lag compensator design

MECH365 – Week 6 Lecture Notes


Week 8

Root Locus Analysis


(Chapter 6, Section 1-3)

MECH365 - Control of Machines and Processes, 2022


Preliminaries: recall from work so far:
• The problem of analysis of linear systems is to locate
the closed loop poles in s plane
• The closed loop poles are the roots of the
characteristic equation (C.E.)
• To find the roots of C.E. requires factoring the
characteristic polynomial
• Classical techniques of factoring polynomials are
inconvenient because of the influence of the gain term

MECH365 – Week 8 Lecture Notes


Root locus technique

• The root locus technique is a graphical method of


finding the roots of any polynomial
• In our particular case, the roots of the characteristic
polynomial with gain as the variable is found
• Being a graphical method it yields approximate results
quickly and provides an insight into system
performance

MECH365 – Week 8 Lecture Notes


Closed-loop response

• The closed-loop transfer function is


𝐶𝐶(𝑠𝑠) 𝐺𝐺(𝑠𝑠)
=
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠)

• The characteristic equation (CE) is:


1 + 𝐺𝐺(𝑠𝑠)𝐻𝐻(𝑠𝑠) = 0

MECH365 – Week 8 Lecture Notes


Closed-loop poles

• The roots of the equation


1 + 𝐺𝐺(𝑠𝑠)𝐻𝐻(𝑠𝑠) = 0
are the system closed-loop poles

♦ they determine the system closed-loop stability


♦ they dictate speed & shape of its response

MECH365 – Week 8 Lecture Notes


Example
Consider the video camera tracking system
Subject’s Camera
position Sensors Amplifier Motor & camera position

R(s) K2 C(s)
+ K1
- s(s + 10)

• Closed-loop transfer function is


𝐶𝐶(𝑠𝑠) 𝐾𝐾
= 2 (𝐾𝐾 = 𝐾𝐾1 𝐾𝐾2 )
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 10𝑠𝑠 + 𝐾𝐾

• C.E. is: 𝑠𝑠2 + 10𝑠𝑠 + 𝐾𝐾 = 0


MECH365 – Week 8 Lecture Notes
Root locations as a function of 𝐾𝐾

K Root no. 1 Root no. 2


0 -10 0
5 -9.47 -0.53
10 -8.87 -1.13
15 -8.16 -1.84
20 -7.24 -2.76
25 -5 -5
30 -5+j2.24 -5-j2.24

MECH365 – Week 8 Lecture Notes


Root locations as a function of K

K = 50
K=∞
10

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=∞

MECH365 – Week 8 Lecture Notes


Question: How to plot the locus of roots without
solving C.E.?

MECH365 – Week 8 Lecture Notes


Root locus: path of the closed-loop poles as the
gain K is varied

• If G(s)H(S) has constant gain K, then as K varies


from 0 to ∞, the roots or the closed poles will vary

• The locus of each root as K varies is a smooth


graph in the complex s-plane

• A graphical method can be used to plot the locus of


the roots without solving equations

MECH365 – Week 8 Lecture Notes


Consider the characteristic equation

1 + G(s)H(s) = 0 (1)
G(s)H(s) = -1 (2)

if s0 is a root, the G(s0)H(s0) is a complex number and this


number must satisfy characteristic equation (1) or (2)

MECH365 – Week 8 Lecture Notes


Magnitude and angle conditions

• Since a complex number has phase and magnitude,


the C.E. (1) or (2) are satisfied by

♦ |G(s0)H(s0)| = |-1| = 1
magnitude condition

♦ ∠ G(s0)H(s0) = ∠ -1 = ± 1800 (2k+1), k =0,1,…


angle condition

MECH365 – Week 8 Lecture Notes


Let the open-loop transfer function 𝐺𝐺(𝑠𝑠)𝐻𝐻(𝑠𝑠) be
represented by
𝐵𝐵(𝑠𝑠)
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) ≡ 𝐾𝐾
𝐴𝐴(𝑠𝑠)

where 𝐵𝐵(𝑠𝑠) and 𝐴𝐴(𝑠𝑠) are finite polynomials in the complex


variables s and K is the open-loop gain

MECH365 – Week 8 Lecture Notes


• since
𝐵𝐵(𝑠𝑠)
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) ≡ 𝐾𝐾
𝐴𝐴(𝑠𝑠)
• Poles of 𝐺𝐺(𝑠𝑠)𝐻𝐻(𝑠𝑠) are called open-loop poles, pi ,
i =1,2,… n
• Zeros of 𝐺𝐺(𝑠𝑠)𝐻𝐻(𝑠𝑠) are called open-loop zeros, zj, j
=1,2,… m
• Hence 𝐵𝐵(𝑧𝑧𝑗𝑗) = 0 and 𝐴𝐴(𝑝𝑝𝑖𝑖) = 0

MECH365 – Week 8 Lecture Notes


• Magnitude of the complex function

𝐵𝐵(𝑠𝑠)
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) = 𝐾𝐾
𝐴𝐴(𝑠𝑠)

• Angle of the complex function

∠𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = ∠𝐵𝐵 𝑠𝑠 − ∠𝐴𝐴(𝑠𝑠)

MECH365 – Week 8 Lecture Notes


Example Test point

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

MECH365 – Week 8 Lecture Notes


Angle criterion
As s0 is the root of the equation, the angle condition is
∠𝑮𝑮 𝒔𝒔𝟎𝟎 𝑯𝑯 𝒔𝒔𝟎𝟎 = ±𝟏𝟏𝟏𝟏𝟏𝟏𝟎𝟎 (𝟐𝟐𝟐𝟐 + 𝟏𝟏)
or
𝐾𝐾(𝑠𝑠0 + 𝑧𝑧1 )
∠ = ±1800 2𝑘𝑘 + 1
(𝑠𝑠0 + 𝑝𝑝1 )(𝑠𝑠0 + 𝑝𝑝2 )(𝑠𝑠0 + 𝑝𝑝3 )(𝑠𝑠0 + 𝑝𝑝4 )
𝑜𝑜𝑜𝑜
∠ 𝑠𝑠0 + 𝑧𝑧1 − ∠ 𝑠𝑠0 + 𝑝𝑝1 − ∠ 𝑠𝑠0 + 𝑝𝑝2 − ∠ 𝑠𝑠0 + 𝑝𝑝3 − ∠ 𝑠𝑠0 + 𝑝𝑝4
= ±1800 , ±5400 , ⋯

The angle ∠(𝑠𝑠0 +𝑧𝑧𝑖𝑖 ) is measured from – 𝑧𝑧𝑖𝑖 to 𝑠𝑠0,→ φ𝑖𝑖


The angle ∠(𝑠𝑠0 +𝑝𝑝𝑖𝑖 ) is measured from – 𝑝𝑝𝑖𝑖 to 𝑠𝑠0,→ 𝜃𝜃𝑖𝑖 jω
Test point

Hence, for this example


s0
A2 θ2
×
-p2

∠𝐺𝐺 𝑠𝑠0 𝐻𝐻 𝑠𝑠0 = φ1 − 𝜃𝜃1 − 𝜃𝜃2 − 𝜃𝜃3 − 𝜃𝜃4


A4
B1 A1
θ4 φ1 θ1
× ×
-p4 -z1 -p1

where φ1 , 𝜃𝜃1 , 𝜃𝜃2 , 𝜃𝜃3 , 𝜃𝜃4 are measured counterclockwise


A3
σ
θ3
×
MECH365 – Week 8 Lecture Notes -p3
Magnitude criterion

Test point

The magnitude of the system is


s0
A2 θ2
×
-p2
A4
𝑮𝑮 𝒔𝒔𝟎𝟎 𝑯𝑯(𝒔𝒔𝟎𝟎 ) = 𝟏𝟏 θ4
B1
φ1
A1
θ1
× ×
-p4 -z1 A3 -p1
σ
θ3
𝐾𝐾 𝑠𝑠0 + 𝑧𝑧1 ×
=1 -p3

𝑠𝑠0 + 𝑝𝑝1 𝑠𝑠0 + 𝑝𝑝2 𝑠𝑠0 + 𝑝𝑝3 𝑠𝑠0 + 𝑝𝑝4

𝐾𝐾𝐵𝐵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

MECH365 – Week 8 Lecture Notes


Example 6-1

Consider the system shown below, assume that the


gain K is non-negative
Sketch the root locus

𝐾𝐾
For this system, 𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

Note: transfer function of a numerically controlled milling machine


MECH365 – Week 8 Lecture Notes
Angle & magnitude conditions
• Angle criterion
𝐾𝐾
∠𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = ∠
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
= −∠𝑠𝑠 − ∠ 𝑠𝑠 + 1 − ∠ 𝑠𝑠 + 2

= ±1800 , ±5400 , ⋯

• Magnitude criterion

𝐾𝐾
𝐺𝐺 𝑠𝑠 𝐻𝐻(𝑠𝑠) = =1
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

MECH365 – Week 8 Lecture Notes


A Typical procedure for
sketching the root-locus plot

MECH365 – Week 8 Lecture Notes


1.Starting and ending points
𝐵𝐵 𝑠𝑠 𝐾𝐾
𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 ≡ 𝐾𝐾 =
𝐴𝐴 𝑠𝑠 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
• Starting points are open-loop poles
(roots of 𝐴𝐴(𝑠𝑠) =0)

s=0, -1, & -2

• Ending points are open-loop zeros


(roots of 𝐵𝐵(𝑠𝑠) = 0)

s= ∞, ∞, ∞
MECH365 – Week 8 Lecture Notes
• These are open-loop poles and zeros; mark the poles by
crosses and zeros by small circles

× × ×
-2 -1 0
σ

MECH365 – Week 8 Lecture Notes


2.Locus on the real axis

• Use the angle condition to test for locus on the real axis

• A point s0 to the left of odd numbers of 𝑝𝑝𝑖𝑖 and 𝑧𝑧𝑗𝑗 would


satisfy ∠𝐺𝐺(𝑠𝑠0) = ±1800(2𝑘𝑘 + 1)

• Hence the root loci exist on the negative real axis between
0 → − 1, and – 2 → ∞

MECH365 – Week 8 Lecture Notes


× × ×
-2 -1 0
σ

MECH365 – Week 8 Lecture Notes


3.Find the asymptotes of the root loci

• Asymptotes of the root loci as s approaches infinity can be


determined from
±1800 (2𝑘𝑘 + 1)
Angle of asymptotes = 𝑛𝑛 − 𝑚𝑚
𝑘𝑘 = 0, ±1, ±2, ⋯

±1800 (2𝑘𝑘 + 1)
=
3−0
0
= ±60 2𝑘𝑘 + 1

= 600 , −600 𝑎𝑎𝑎𝑎𝑎𝑎 − 1800

MECH365 – Week 8 Lecture Notes


• The angles for the asymptotes are determined as 600 , -600
and 1800 (negative real axis)

1800 600
× × ×
-1 0
-2 -600 σ

intersection

• We also need to determine the point where the asymptotes


intersect the real axis
MECH365 – Week 8 Lecture Notes
• The abscissa of the intersection of the asymptotes at the
real axis is σa

∑ 𝑝𝑝𝑖𝑖 − ∑ 𝑧𝑧𝑗𝑗 −0 − 1 − 2
𝜎𝜎𝑎𝑎 = = = −1
𝑛𝑛 − 𝑚𝑚 3−0

where 𝑛𝑛 and 𝑚𝑚 are number of open-loop poles and number of open-loop


zeros, respectively.

MECH365 – Week 8 Lecture Notes


4.Find the breakaway and break-in points

• Root loci are symmetrical about the negative real axis (σ


axis)
• Break-out and break-in points lie on the real axis or occur
in complex-conjugate pairs

• They are points where multiple roots occur. A break-away


point corresponds to a point in the 𝑠𝑠 plane where multiple
roots of the C.E. occur
• Let C.E. =0
𝐵𝐵(𝑠𝑠) 𝐴𝐴(𝑠𝑠)
1 + 𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = 0 𝑜𝑜𝑜𝑜 1 + 𝐾𝐾 = 0 ⇒ 𝐾𝐾 = −
𝐴𝐴(𝑠𝑠) 𝐵𝐵(𝑠𝑠)
MECH365 – Week 8 Lecture Notes
𝐴𝐴(𝑠𝑠)
𝑓𝑓𝑓𝑓𝑓𝑓 𝐾𝐾 = −
𝐵𝐵(𝑠𝑠)
𝑑𝑑𝑑𝑑 𝐴𝐴′ 𝑠𝑠 𝐵𝐵 𝑠𝑠 − 𝐴𝐴 𝑠𝑠 𝐵𝐵𝐵(𝑠𝑠)
=−
𝑑𝑑𝑑𝑑 𝐵𝐵2 (𝑠𝑠)

• So the breakaway or break-in points can be simply


determined from the roots of
𝑑𝑑𝑑𝑑
=0
𝑑𝑑𝑑𝑑

• for the present example, the C. E. is


𝐾𝐾
1+ =0⇒
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
𝐾𝐾 = −𝑠𝑠 𝑠𝑠 + 1 𝑠𝑠 + 2 = −𝑠𝑠 3 − 3𝑠𝑠 2 − 2𝑠𝑠
MECH365 – Week 8 Lecture Notes
𝑑𝑑𝑑𝑑
• setting =0
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
= − 3𝑠𝑠 2 + 6𝑠𝑠 + 2 = 0 ⇒
𝑑𝑑𝑑𝑑
𝑠𝑠 = −0.4226, 𝑠𝑠 = −1.5774 (neglect, why? Check step 2)

• Substituting 𝑠𝑠 = −0.4226 into the equation 𝐾𝐾 = −𝑠𝑠 3 −


3𝑠𝑠 2 − 2𝑠𝑠

𝐾𝐾 = 0.42263 − 3 × 0.42262 + 2 × 0.4226 = 0.3849

MECH365 – Week 8 Lecture Notes


5.Find the imaginary axis crossing points
• Let 𝑠𝑠 = 𝑗𝑗𝜔𝜔 and solve for 𝜔𝜔 in the C.E.
𝑠𝑠 3 + 3𝑠𝑠 2 + 2𝑠𝑠 + 𝐾𝐾 = 0
(𝑗𝑗𝜔𝜔)3 +3(𝑗𝑗𝜔𝜔)2 +2 𝑗𝑗𝜔𝜔 + 𝐾𝐾 = 0

𝐾𝐾 − 3𝜔𝜔2 + 𝑗𝑗 2𝜔𝜔 − 𝜔𝜔3 = 0

• By equating both real and imaginary part = 0, the imaginary


crossing points can be determined
2
� 𝐾𝐾 − 3𝜔𝜔 = 0 ⇒ 𝜔𝜔 = ± 2, 𝐾𝐾 = 6 𝑜𝑜𝑜𝑜 𝜔𝜔 = 0, 𝐾𝐾 = 0
2𝜔𝜔 − 3𝜔𝜔3 = 0

Therefore, the imaginary crossing points are: 𝑗𝑗𝑗, 𝑗𝑗 2, −𝑗𝑗 2

MECH365 – Week 8 Lecture Notes


Alternatively, the RH array can be used to find the imaginary
crossing points as well as the critical gain
C.E. 𝑠𝑠 3 + 3𝑠𝑠 2 + 2𝑠𝑠 + 𝐾𝐾 = 0
𝑠𝑠 3 1 2
𝑠𝑠 2 3 𝐾𝐾
1 6−𝐾𝐾
𝑠𝑠
3
𝑠𝑠 0 𝐾𝐾

𝐾𝐾𝑐𝑐𝑐𝑐 = 6 ⇒ 𝜔𝜔 = ±𝑗𝑗 2
𝐾𝐾𝑐𝑐𝑐𝑐 = 0 ⇒ 𝜔𝜔 = 𝑗𝑗𝑗
Therefore, the imaginary crossing points are: 𝑗𝑗𝑗, 𝑗𝑗 2, −𝑗𝑗 2

MECH365 – Week 8 Lecture Notes


6.Choose a test point in the broad
neighborhood of 𝒋𝒋𝝎𝝎 axis & the origin

θ2 θ1
θ3
× × ×
-2 -1 0
σ

Apply the angle condition: θ1 + θ2 + θ3 = 1800

MECH365 – Week 8 Lecture Notes


7.Draw the root loci

• Based on the information from step 1 to step 6, the root loci


can be drawn


K

K=6
K=6 β
∞ K × × ×
-3 -2 -1 0 σ

K=6

MECH365 – Week 8 Lecture Notes


System analysis based on root loci

• 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 β

MECH365 – Week 8 Lecture Notes


Summary: General rules for sketching root loci

• Step 1: locate open-loop poles and zeros


• Step 2: determine root-loci in the real axis
• Step 3: determine the asymptotes for K → ∞
• Step 4: find break away and break-in points in real axis
• Step 5: find the departure (arrival) angle from complex pole
(zero)
• Step 6: find the points crossing imaginary axis
• Step 7: find more points
• Step 8: draw the root loci

MECH365 – Week 8 Lecture Notes


Example 6-2

Consider the system with complex-conjugate


opening poles, 𝐾𝐾≥0
Sketch the root locus

𝐾𝐾(𝑠𝑠 + 2)
For this system, 𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 = 2
𝑠𝑠 + 2𝑠𝑠 + 3

MECH365 – Week 8 Lecture Notes


1.locate poles and zeros
𝐵𝐵 𝑠𝑠 𝑠𝑠 + 2
𝐺𝐺 𝑠𝑠 𝐻𝐻 𝑠𝑠 ≡ 𝐾𝐾 = 𝐾𝐾
𝐴𝐴 𝑠𝑠 (𝑠𝑠 + 1)2 +( 2)2

• Starting points are two complex-conjugate poles

𝑠𝑠 = −1 + 𝑗𝑗 2 𝑎𝑎𝑎𝑎𝑎𝑎 𝑠𝑠 = −1 − 𝑗𝑗 2

• Ending points are two zeros


𝑠𝑠 = −2 𝑎𝑎𝑎𝑎𝑎𝑎 ∞

MECH365 – Week 8 Lecture Notes


• These are open-loop poles and zeros; mark the poles by
crosses and zeros by small circles

-2 -1 0
σ

MECH365 – Week 8 Lecture Notes


2.Locus on the real axis

• The two complex-conjugate contribution is 0. Points s0 at


(- ∞, -2) meet the angle condition

θ1
× θ1 +θ2 =3600

s0 φ1 =1800
-2 -1 0
σ

θ2
×

MECH365 – Week 8 Lecture Notes


3.Find the asymptotes of the root loci
± 1800 (2k + 1) 0
• Angle of asymptotes = = ± 180 (2k + 1)
2 −1
• The abscissa of the asymptote intersection
− 1 − 1 − (−2)
σa = =0 jω
2 −1 θ1
×

s0 φ1 =1800
-2 -1 0
σ

θ2
×

MECH365 – Week 8 Lecture Notes


4.Find the breakaway and break-in points to the
real axis
𝐾𝐾(𝑠𝑠 + 2) 𝑠𝑠 2 + 2𝑠𝑠 + 3
𝐶𝐶. 𝐸𝐸: 1 + 2 = 0 ⇒ 𝐾𝐾 = −
𝑠𝑠 + 2𝑠𝑠 + 3 𝑠𝑠 + 2

𝑑𝑑𝑑𝑑 2𝑠𝑠 + 2 𝑠𝑠 + 2 − 𝑠𝑠 2 + 2𝑠𝑠 + 3


=− 2
=0
𝑑𝑑𝑑𝑑 𝑠𝑠 + 2

⇒ 𝑠𝑠 2 + 4𝑠𝑠 + 1 = 0
⇒ 𝑠𝑠 = −3.732, 𝑠𝑠 = −0.268 (𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛)

• The corresponding value K at point s= -3.7320 is


𝑠𝑠 2 + 2𝑠𝑠 + 3
𝐾𝐾 = − � = 5.4641
𝑠𝑠 + 2
𝑠𝑠=−3.732

MECH365 – Week 8 Lecture Notes


K=5.4641

-4 -3 -2 -1 0
σ

break-in point ×

s0 = -3.7320

MECH365 – Week 8 Lecture Notes


5.Determine the departure angle from the
complex-conjugate poles
𝜃𝜃𝑖𝑖 = 1800 − � 𝜃𝜃𝑝𝑝 + � ∅𝑞𝑞 (𝑝𝑝 ≠ 𝑖𝑖)

Thus

𝜃𝜃1 = 1800 − 𝜃𝜃2 + ∅1


= 1800 − 900 + 550 = 1450

Since the root locus is symmetric


about the real axis, the angle of
departure from the pole s=-p2 is -1450

MECH365 – Week 8 Lecture Notes


6.Find the imaginary axis crossing points
• Let s=jω and solve for ω in the C.E.
𝑠𝑠 2 + 2 + 𝐾𝐾 𝑠𝑠 + 2𝐾𝐾 + 3 = 0
(𝑗𝑗𝜔𝜔)2 + 2 + 𝐾𝐾 𝑗𝑗𝜔𝜔 + 2𝐾𝐾 + 3 = 0
2𝐾𝐾 + 3 − 𝜔𝜔2 + 𝑗𝑗𝜔𝜔 2 + 𝐾𝐾 = 0

• Equate both real and imaginary part = 0


2𝐾𝐾 + 3 − 𝜔𝜔2 = 0

𝜔𝜔 2 + 𝐾𝐾 = 0

Obviously, there is no solution with K>0, thus no imaginary


axis crossing points
MECH365 – Week 8 Lecture Notes
7. Determine more points and plot the root-loci
with above information

1450
×

K=5.4641

-4 -3 -2 -1 0
σ

break-in point ×

s0 = -3.7320

MECH365 – Week 8 Lecture Notes


8.Discussion
• Relationship between K and ζ

ζ line jω
1450
×

K=5.4641
β=cos-1ζ

-4 -3 -2 -1 0
σ

break-in point ×

s0 = -3.7320

MECH365 – Week 8 Lecture Notes


Week 10

Control System Design Using


Root Locus Analysis
(Chapter 6, Section 5-9)

MECH365 - Control of Machines and Processes, 2022


Revision: Dynamic Characteristics and s plane
• The C.E. of a typical 2nd-order system is

2 2
𝑠𝑠 + 2ζ𝜔𝜔𝑛𝑛 𝑠𝑠 + 𝜔𝜔𝑛𝑛 =0
jω ζ <1

ζ >1
×
s =-σ1, -σ2 s =-σ ± jω
ωn
φ
× ×
-σ 2 -σ 1
σ σ

𝜎𝜎 = ζ𝜔𝜔𝑛𝑛 ×

MECH365 – Week 10 Lecture Notes


Revision …

• 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

MECH365 – Week 10 Lecture Notes


Revision …
jω • One can increase the undamped
ζ =0.2 natural frequency, 𝜔𝜔𝑛𝑛 , without
ζ =0.5
ζ =0.7 changing the damping ratio by
ζ =0.8 ζ <0 moving the roots radially from the
ζ =0.9 origin
ζ≥1
ω n =1
ω n =2 0 σ • One can increase the damping ratio,
ζ =0.9
ζ <0 ζ, without changing the undamped
ζ =0.8
ζ =0.7 natural frequency by moving the roots
ζ =0.5
ζ =0.2
along the circular constant frequency
path towards the real axis

MECH365 – Week 10 Lecture Notes


performance specifications
• Accuracy
• Relative stability
• Speed of response
Time Domain:
- Rise time
- Maximum overshoot
- Setting time

Frequency Domain:
- Phase margin
- Gain margin
- Resonant peak value bandwidth
MECH365 – Week 10 Lecture Notes
Modification of Plant Dynamics

• Firstly try to adjust the plant parameters. This may provide a


simple inexpensive solution
• However, this is not always possible, so we need to add
additional components or devices to modify the composite
system’s performance, known as compensators

MECH365 – Week 10 Lecture Notes


System Compensation
• The first step is to adjust the gain. If this places the closed
loop poles at desirable positions then well and good:
finished!
• Usually simply adjusting the gain may lead to instability
• Hence, some additional compensator is needed

MECH365 – Week 10 Lecture Notes


Series Compensation and Parallel (Feedback)
Compensation

Series compensation: the compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠) is placed


in series with the plant 𝐺𝐺(𝑠𝑠)

Parallel compensation or feedback compensation: the


compensator 𝐺𝐺𝑐𝑐 (𝑠𝑠) is placed in parallel with the plant 𝐺𝐺2 (𝑠𝑠)

MECH365 – Week 10 Lecture Notes


Types of Compensators
• Lead compensator
• Lag compensator
• Lag-lead compensator
• Parallel compensator
Any or all of the following fields can be used for assembling
compensators:
- Electrical components
- Mechanical components
- Pneumatic components
- Hydraulic components

MECH365 – Week 10 Lecture Notes


Preliminary Design Considerations
• Assume the plant is fixed. i.e. an existing
unalterable system
• Just add poles and/or zeros to improve the overall
system performance
• Design lead, lag, lag-lead, parallel compensators
using the root-locus technique

MECH365 – Week 10 Lecture Notes


General effect of adding poles to the OLTF

Add a pole Add a pole

• Pulling the root-locus to the right


• Tends to lower the system’s relative stability
• Slows down the setting of the response
MECH365 – Week 10 Lecture Notes
General effect of adding zeros to the OLTF

Add a zero

• Pulling the root-locus to the left


• Tends to make the system more stable
• Speeds up the setting of the response
MECH365 – Week 10 Lecture Notes
Lead compensator design

MECH365 – Week 10 Lecture Notes


Typical Lead Networks

𝑏𝑏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

∠𝐺𝐺𝑐𝑐 𝑠𝑠 = ∠ 𝑠𝑠 + 𝑧𝑧1 − ∠ 𝑠𝑠 + 𝑝𝑝1


= 𝜃𝜃𝑧𝑧 − 𝜃𝜃𝑝𝑝 = 𝜃𝜃𝐿𝐿𝐿𝐿𝐿𝐿𝐿𝐿 > 0

MECH365 – Week 10 Lecture Notes


General rules of lead compensation design
using the root-locus method
• Find the desired location for the dominant closed loop poles
from the performance specification
• Draw the root locus plot: (a) can the gain be adjusted to yield
desired closed loop poles? (b) if not, calculate the angle
deficiency
• If the static error coefficients can be ignored, find the pole-
zero locations to give a lead network that will contribute the
necessary angle
• Determine the open loop gain of the compensated system
from the magnitude condition

MECH365 – Week 10 Lecture Notes


Example
• Consider a radar tracking system with OLTF
4
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 2)

and ω𝑛𝑛 = 2 and ζ = 0.5


• It is desired to increase ω𝑛𝑛 = 4 without changing the
damping ratio

MECH365 – Week 10 Lecture Notes


Pre-analysis
Closed-loop transfer function:
𝐶𝐶(𝑠𝑠) 4
= 2
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 2𝑠𝑠 + 4
4
= 2
2
(𝑠𝑠 + 1) + 3

The poles are located at


𝑠𝑠 = −1 ± 𝑗𝑗 3

Damping ratio ζ = 0.5 and φ= 600

MECH365 – Week 10 Lecture Notes


Pre-analysis


s = −2 ± j2 3 • To increase ω𝑛𝑛 from 2 to 4
j4

ωn = 4 j3 • The root locus must be


j2 moved to left with new poles
j1 ωn =2 position
600 𝑠𝑠 = −2 ± 𝑗𝑗𝑗 3
×
-2 -1 ×
-4 -3
-j1
1 σ • A lead compensator is
-j2 needed
-j3 1
𝑠𝑠 +
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝑇𝑇
-j4 1
𝑠𝑠 +
𝛼𝛼𝑇𝑇

MECH365 – Week 10 Lecture Notes


Solution procedure
• Step 1:
− Find the sum of the angles at the desired location of one of
the dominate closed-loop poles with the open loop poles and
zeros of the original system
− Determine the necessary angle φ to be added so that the
total sum of the angles is equal to ±1800(2k+1).
− The lead compensator must contribute to this angle φ

MECH365 – Week 10 Lecture Notes


Solution procedure
4
Angle of 𝑎𝑎𝑎𝑎 𝑠𝑠 = −2 + 𝑗𝑗𝑗 3
𝑠𝑠(𝑠𝑠+2)

4
∠ � = 00 − 𝜃𝜃1 − 𝜃𝜃2
𝑠𝑠(𝑠𝑠 + 2) 𝑠𝑠=−2+𝑗𝑗𝑗 3

= 00 − 1200 −900 = −2100

Let −2100 + φ =−1800

So the angle deficiency φ =300

MECH365 – Week 10 Lecture Notes


Solution procedure
• Step 2: Determine the locations of the pole and zero of the
lead network
- Draw a horizontal line passing through point P, the desired location of
one of the dominate closed loop poles (PA)
- Draw a line from P to the original (PO)
- Bisection the angle APO (PB)
- Distribute half of the required angle φ to either side of PB (CD)
- PC locates the pole -1/(αT), PD locate the zero -1/T

NB: The approach for determining the pole and zero locations is
called Method 1

MECH365 – Week 10 Lecture Notes


Solution procedure

In this case, zero at s = -2.9, pole at s = -5.4


1 1
So = 2.9, = 5.4, and α = 0.537
𝑇𝑇 𝛼𝛼𝑇𝑇
Thus 𝑠𝑠 + 2.9
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐
𝑠𝑠 + 5.4
MECH365 – Week 10 Lecture Notes
Solution procedure
• Step 3: Determine the gain constant of the lead 𝐶𝐶
−𝟓𝟓. 𝟒𝟒
𝐷𝐷−𝟐𝟐. 𝟗𝟗× 𝐸𝐸
−𝟐𝟐
compensator, Kc, using magnitude condition
- The compensated system becomes
𝑠𝑠 + 2.9 4 4𝐾𝐾𝑐𝑐 (𝑠𝑠 + 2.9)
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 = 𝐾𝐾𝑐𝑐 =
𝑠𝑠 + 5.4 𝑠𝑠(𝑠𝑠 + 2) 𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 5.4)
- The gain 𝐾𝐾𝑐𝑐 can be evaluated from the magnitude condition

4𝐾𝐾𝑐𝑐 (𝑠𝑠 + 2.9)


= 1 ⇒ 𝐾𝐾𝑐𝑐 = 4.68
𝑠𝑠(𝑠𝑠 + 2)(𝑠𝑠 + 5.4) 𝑠𝑠=−2+𝑗𝑗 3
*In addition, the gain 𝐾𝐾𝑐𝑐 can also be graphically determined
4𝐾𝐾𝑐𝑐 𝑃𝑃𝑃𝑃 𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃
= 1 ⇒ 𝐾𝐾𝑐𝑐 =
𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃𝑃 4𝑃𝑃𝑃𝑃
𝑠𝑠 + 2.9 0.345𝑠𝑠 + 1
- So the lead compensator is: 𝐺𝐺𝑐𝑐 𝑠𝑠 = 4.68 = 2.51
𝑠𝑠 + 5.4 0.185𝑠𝑠 + 1
MECH365 – Week 10 Lecture Notes
Root locus comparison

Root Locus Root Locus


2 6

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

MECH365 – Week 10 Lecture Notes


Comparison of step responses of the compensated and
uncompensated systems
Uncompensated system %Unit-step responses of compensated
C(s ) 4 %and uncompendsated systesm
= 2
R (s) s + 2s + 4 num=[4];
den=[1 2 4];
Compensated system
numc=18.7*[1 2.9];
denc=conv([1 2 0],[1 5.4])+18.7*[0 0 1 2.9];
C(s ) 18.7(s + 2.9)
= t=0:0.05:5;
R (s) s(s + 2)(s + 5.4) + 18.7(s + 2.9)
[c1]=step(num,den,t);
[c2]=step(numc,denc,t);
plot(t,c1,'r',t,c2,'g')
grid
title('Unit-Step Responses of Compensated and
Uncompensated Systems')
xlabel('\bft Sec')
ylabel('\bfOutput c1 and c2')
legend('Uncompensated system', 'Compensated
system')
MECH365 – Week 10 Lecture Notes
Comparison of step responses of the compensated and
uncompensated systems
Unit-Step Responses of Compensated and Uncompensated Systems
1.4
Uncompensated system
Compensated system
1.2

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

the lead compensator becomes


𝑠𝑠 + 2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐
𝑠𝑠 + 4
• The value of 𝐾𝐾𝑐𝑐 can be determined from the
magnitude condition
𝑠𝑠+2 4
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺(𝑠𝑠) 𝑠𝑠=−2+𝑗𝑗𝑗 3 = 𝐾𝐾𝑐𝑐 =1
𝑠𝑠+4 𝑠𝑠(𝑠𝑠+2) 𝑠𝑠=−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

Compensated system (method 1) Uncompensated


1
Method 2
𝐶𝐶(𝑠𝑠) 18.7(𝑠𝑠 + 2.9)
=
𝑅𝑅(𝑠𝑠) 𝑠𝑠 𝑠𝑠 + 2 𝑠𝑠 + 5.4 + 18.7(𝑠𝑠 +0.82.9)

Compensated system (method 2)


0.6
𝐶𝐶(𝑠𝑠) 16
= 2
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 4𝑠𝑠 + 16
0.4

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

den2=[1 4 16 0]; 4 Input


t=0:0.05:5;
3.5
[c1]=step(num1,den1,t);

Response for input and Methods 1 and 2


3
[c2]=step(num2,den2,t);
plot(t,c1,'r',t,c2,'g',t,t,'-')
2.5 Method 1
grid 2

title('Unit-Ramp Responses of 1.5


Method 2
compensated Systems') 1

xlabel('\bft Sec') 0.5

ylabel('\bfResponse for input and Methods


0
1 and 2') 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
t Sec

Under a ramp input, the system response by Method 1 has a smaller steady-state error
than the compensated system designed by Method 2

MECH365 – Week 10 Lecture Notes


Lag compensator design

MECH365 – Week 10 Lecture Notes


Typical Lag Networks

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
𝛽𝛽𝛽𝛽 𝛽𝛽𝛽𝛽

MECH365 – Week 10 Lecture Notes


Characteristics of lag 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 zero is to the far left of the pole
i.e. o ---------- ×
• A lag network is basically a lowpass filter
• To avoid appreciable changes in the root loci limit the angle derivation
to less than 50 by placing the pole and zero of the lag network close
together and near the origin. Hence, the transient response
characteristics will be changed only slightly.
MECH365 – Week 10 Lecture Notes
Negative angle contribution of a lag compensator
Test point jω
𝑠𝑠 •
𝜃𝜃𝐿𝐿𝐿𝐿𝐿𝐿
𝑠𝑠 + 𝑧𝑧2
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐 𝜃𝜃𝑧𝑧 𝜃𝜃𝑝𝑝
𝑠𝑠 + 𝑝𝑝2 O × σ
−𝑧𝑧2 −𝑝𝑝2

∠𝐺𝐺𝑐𝑐 𝑠𝑠 = ∠ 𝑠𝑠 + 𝑧𝑧2 − ∠ 𝑠𝑠 + 𝑝𝑝2


= 𝜃𝜃𝑧𝑧 − 𝜃𝜃𝑝𝑝 = 𝜃𝜃𝐿𝐿𝐿𝐿𝐿𝐿 < 0

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 𝑐𝑐
𝑠𝑠 +
𝛽𝛽𝛽𝛽

• The angle contribution of the lag compensator is required


1
𝑠𝑠 +
−50 < ∠ 𝐾𝐾𝑐𝑐 𝑇𝑇 < 00
1
𝑠𝑠 +
𝛽𝛽𝛽𝛽

• As the gain of the compensator is set to 1, i.e. 𝐾𝐾𝑐𝑐 ≈ 1, the alteration


in the transient-response characteristics will be very small.
• The main negative of the lag compensation is that the compensator
zero near the origin creates a closed-loop pole near the origin. This
will generate a long tail of small amplitude in the step response, thus
increasing the settling time.
MECH365 – Week 10 Lecture Notes
General rules of lag compensation using the
root-locus method
• Draw the root locus for the uncompensated system
• Determine the open loop gain by the use of the magnitude
condition
• Evaluate the particular error coefficient specified in the problem
• Determine the amount of increase in the error coefficient
necessary to satisfy the specification
• Determine the pole and zero of the lag network
• Draw a new root loci plot for the compensated system

MECH365 – Week 10 Lecture Notes


Example
• Consider the system with OLTF
1.06
𝐺𝐺 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)

It is desired to increase the static velocity error coefficient


𝐾𝐾𝑉𝑉 of the system to 5 sec-1 without appreciably changing
the location of dominant closed loop poles

MECH365 – Week 10 Lecture Notes


Pre-analysis
𝐶𝐶(𝑠𝑠) 1.06
=
𝑅𝑅(𝑠𝑠) 𝑠𝑠 𝑠𝑠 + 1 𝑠𝑠 + 2 + 1.06
Characteristic equation:
𝑠𝑠 3 + 3𝑠𝑠 2 + 2𝑠𝑠 + 1.06 = 0
Solve the C.E. to get closed-loop poles:
𝑠𝑠 = −0.33 ± 𝑗𝑗𝑗.59, −2.34
where 𝑠𝑠 = −0.33 ± 𝑗𝑗𝑗.59 are dominate closed-
loop poles.
Undamped nature frequency:
𝜔𝜔𝑛𝑛 = 0.332 + 0.592 = 0.68 𝑟𝑟𝑟𝑟𝑟𝑟/𝑠𝑠
0.33
The damping ratio: ζ= ≈ 0.5 → φ = 600
0.68
1.06
𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝑠𝑠 𝑠𝑠 = lim 𝑠𝑠 = 0.53
𝑠𝑠→0 𝑠𝑠→0 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2)
MECH365 – Week 10 Lecture Notes
Solution:
1. To increase the static velocity error Kv from 0.53 sec-1 to 5.3
sec-1, the increasing factor is about 10, here choose β =10
2. Place the zero and pole of the lag compensator at s = -0.05
and s = -0.005, respectively. The transfer function of the lag
compensator becomes
𝑠𝑠 + 0.05
𝐺𝐺𝑐𝑐 𝑠𝑠 = 𝐾𝐾𝑐𝑐
𝑠𝑠 + 0.005
3. The block diagram of the compensated system is shown
below

MECH365 – Week 10 Lecture Notes


Root-locus plot near the origin

0.25

0.2

0.15

0.1

0.05

Imaginary Axis
0

-0.05

-0.1

-0.15

-0.2

-0.25

-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1


Real Axis

The OLTF of the compensated system is:


𝑠𝑠 + 0.05 1.06 𝐾𝐾(𝑠𝑠 + 0.05)
𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺 𝑠𝑠 = 𝐾𝐾𝑐𝑐 =
𝑠𝑠 + 0.005 𝑠𝑠(𝑠𝑠 + 1)(𝑠𝑠 + 2) 𝑠𝑠(𝑠𝑠 + 0.005)(𝑠𝑠 + 1)(𝑠𝑠 + 2)

where 𝐾𝐾 = 1.06𝐾𝐾𝑐𝑐

MECH365 – Week 10 Lecture Notes


4. Scale off at constant damping ratio to find new dominant
closed loop poles
𝑠𝑠1 = −0.31 + 𝑗𝑗𝑗.55, 𝑠𝑠2 = −0.31 − 𝑗𝑗𝑗.55

5. Find the open loop gain from the magnitude condition

𝐾𝐾(𝑠𝑠 + 0.05)
=1
𝑠𝑠(𝑠𝑠 + 0.005)(𝑠𝑠 + 1)(𝑠𝑠 + 2) 𝑠𝑠=−0.31+𝑗𝑗𝑗.55

⇒ 𝐾𝐾 = 1.0235

MECH365 – Week 10 Lecture Notes


6. The lag compensator gain is derived, and the lag
compensator transfer function is obtained consequently
𝐾𝐾 1.0235
𝐾𝐾𝑐𝑐 = = = 0.9656
1.06 1.06
𝑠𝑠 + 0.05
𝐺𝐺𝑐𝑐 𝑠𝑠 = 0.9656
𝑠𝑠 + 0.005

7. The compensated OLTF becomes


1.0235(𝑠𝑠 + 0.05)
𝐺𝐺1 𝑠𝑠 =
𝑠𝑠(𝑠𝑠 + 0.005)(𝑠𝑠 + 1)(𝑠𝑠 + 2)

8. The static velocity constant 𝐾𝐾𝑉𝑉 is


𝐾𝐾𝑉𝑉 = lim 𝑠𝑠𝐺𝐺1 𝑠𝑠 = 5.12
𝑠𝑠→0
MECH365 – Week 10 Lecture Notes
Comparison of unit-ramp responses of the
compensated and uncompensated systems
Unit-Ramp Responses of Compensated and Uncompensated Systems %Unit-ramp responses of compensated
50 %and uncompendsated systesm
Uncompensated system num=[1.06];
45 Compensated system
den=[1 3 2 0];
g1=tf(num,den);
40
g1_cl=feedback(g1,1);

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')

MECH365 – Week 10 Lecture Notes


Comparison of unit-step responses of the
compensated and uncompensated systems
%Unit-step responses of compensated
Unit-Step Responses of Compensated and Uncompensated Systems %and uncompendsated systesm
1.4
num=[1.06];
Uncompensated system den=[1 3 2 0];
Compensated system
1.2 g1=tf(num,den);
g1_cl=feedback(g1,1);

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

MECH365 – Week 10 Lecture Notes


Week 11

Control System Design Using


Root Locus Analysis (cont’)
(Chapter 6, Section 9)

Programmable Logic
Controllers (PLCs)
MECH365 - Control of Machines and Processes, 2022
Parallel Compensation

MECH365 – Week 11 Lecture Notes


Background
The compensator is the parallel compensation in a minor loop
We need to rewrite the characteristic equation to be of the same format as
that in series compensation

MECH365 – Week 11 Lecture Notes


Background
The closed-loop transfer function of the system

𝐺𝐺1 𝐺𝐺2
𝐶𝐶(𝑠𝑠) 1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐 𝐺𝐺1 𝐺𝐺2
= =
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺 𝐺𝐺
1 2
𝐻𝐻 1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐 + 𝐺𝐺1 𝐺𝐺2 𝐻𝐻
1 + 𝐺𝐺2 𝐺𝐺𝑐𝑐

𝐶𝐶(𝑠𝑠) 𝐺𝐺1 (𝑠𝑠)𝐺𝐺2 (𝑠𝑠)


=
𝑅𝑅(𝑠𝑠) 1 + 𝐺𝐺2 (𝑠𝑠)𝐺𝐺𝑐𝑐 (𝑠𝑠) + 𝐺𝐺1 (𝑠𝑠)𝐺𝐺2 (𝑠𝑠)𝐻𝐻(𝑠𝑠)

MECH365 – Week 11 Lecture Notes


Characteristic Equation
The C.E. of the parallel compensation is
1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻 𝑠𝑠 + 𝐺𝐺𝑐𝑐 𝑠𝑠 𝐺𝐺2 𝑠𝑠 = 0

Divide the C.E. with (1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻 𝑠𝑠 )


𝐺𝐺𝑐𝑐 (𝑠𝑠)𝐺𝐺2 (𝑠𝑠)
1+ =0
1 + 𝐺𝐺1 𝑠𝑠 𝐺𝐺2 𝑠𝑠 𝐻𝐻(𝑠𝑠)

Define 𝐺𝐺𝑓𝑓 𝑠𝑠 = 1+𝐺𝐺 𝐺𝐺2 (𝑠𝑠)


, the C.E. equation becomes
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.

MECH365 – Week 11 Lecture Notes


Example
Consider a system involving velocity feedback.
(a) draw a root-locus diagram;
(b) (b) determine the value of 𝑘𝑘 such that the damping ratio of
the dominant closed-loop pole is 0.4

MECH365 – Week 11 Lecture Notes


Solution
The open loop transfer function, 𝐺𝐺(𝑠𝑠), of the system is:
20
(𝑠𝑠 + 1)(𝑠𝑠 + 4) 1 20 1 20
𝐺𝐺(𝑠𝑠) = = = 3
20𝑘𝑘 𝑠𝑠 𝑠𝑠 + 1 𝑠𝑠 + 4 + 20𝑘𝑘 𝑠𝑠 𝑠𝑠 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20𝑘𝑘𝑘𝑘
1+
(𝑠𝑠 + 1)(𝑠𝑠 + 4)

Thus the C.E. of the system (1 + 𝐺𝐺(𝑠𝑠) = 0) is:


𝑠𝑠 3 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20𝑘𝑘𝑘𝑘 + 20 = 0

Rewrite the C.E. by dividing 𝐺𝐺𝑓𝑓 𝑠𝑠 = 𝑠𝑠 3 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20

𝐾𝐾𝐾𝐾
1+ 3 = 0 (𝐾𝐾 = 20𝑘𝑘𝑘𝑘)
𝑠𝑠 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20

Follow the general rule to get root-loci of the


above system
𝑠𝑠 𝑠𝑠
=
𝑠𝑠 3 + 5𝑠𝑠 2 + 4𝑠𝑠 + 20 (𝑠𝑠 + 5)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗)

Poles: −5, 𝑗𝑗𝑗, −𝑗𝑗𝑗; zeros: 0, ∞, ∞


MECH365 – Week 11 Lecture Notes
Root loci

MECH365 – Week 11 Lecture Notes


Note that the closed-loop poles with ζ=0.4 must lie on straight lines passing
the origin and making the angles ±66.420 with the negative real axis. In this
case, two intersection points, P and Q, are determined.

At point 𝑃𝑃 = −1.049 + 𝑗𝑗𝑗.4065, the value of 𝐾𝐾 is

(𝑠𝑠 + 5)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗)


𝐾𝐾 = = 8.98
𝑠𝑠 𝑠𝑠=−1.049+𝑗𝑗𝑗.4065
𝐾𝐾
⇒ 𝑘𝑘 = = 0.449
20
At point 𝑄𝑄 = −2.1589 + 𝑗𝑗𝑗.9652, the value of 𝐾𝐾 is

(𝑠𝑠 + 5)(𝑠𝑠 + 𝑗𝑗𝑗)(𝑠𝑠 − 𝑗𝑗𝑗)


𝐾𝐾 = = 28.26
𝑠𝑠 𝑠𝑠=−2.1589+𝑗𝑗𝑗.9652
𝐾𝐾
⇒ 𝑘𝑘 = = 1.413
20
MECH365 – Week 11 Lecture Notes
The CLTF with 𝑘𝑘 = 0.449 is:
𝐶𝐶(𝑠𝑠) 20
= 3
𝑅𝑅(𝑠𝑠) 𝑠𝑠 + 5𝑠𝑠 2 + 12.98𝑠𝑠 + 20

The system with 𝑘𝑘 = 0.449 has a pair of dominate


complex-conjugate closed-loop poles at 𝑠𝑠 = −1.0490 ±
𝑗𝑗𝑗.4065 and another real closed-loop pole at 𝑠𝑠 =
− 2.9021

The CLTF with 𝑘𝑘 = 1.413 is:


𝐶𝐶(𝑠𝑠) 20
=
𝑅𝑅(𝑠𝑠) 𝑠𝑠 3 + 5𝑠𝑠 2 + 32.26𝑠𝑠 + 20

The system with 𝑘𝑘 = 1.413 has a pair of complex-


conjugate closed-loop poles at 𝑠𝑠 = −2.1589 ± 𝑗𝑗𝑗.9652
and another real closed-loop pole at 𝑠𝑠 = −.6823, which
primarily determine the system response
MECH365 – Week 11 Lecture Notes
Unit-step response of two systems
1.4
System response analysis:
1.2  the system with k=0.449 is
k=0.449 oscillatory with a faster
1 response and relatively small
overshoot;
Outputs C1 and C2

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

MECH365 – Week 11 Lecture Notes


Programmable Logic Controllers
(PLCs)

MECH365 – Week 11 Lecture Notes


Objectives

• To have knowledge and understanding of PLCs and


their place in industry, and how they work
• To learn the steps involved in using PLCs
• To design ladder diagrams and use them to control
practical systems

MECH365 – Week 11 Lecture Notes


References
• ‘Programmable logic controllers’, Pearson Prentice-Hall,
2007
• ‘Programmable logic controller, principles and applications’,
5th edition, Prentice-Hall, 2003
• ‘MicroLogix 1100Lab Notes’, Rockwell automation, 2006
• ‘Programmable logic controllers and their engineering
applications’, 2nd edition, McGraw-Hill, 1997

MECH365 – Week 11 Lecture Notes


Outline

• Overview of PLCs
- history, components, manufacturers, etc.

• Programming – the ladder diagram


- contacts, coils, ladder diagram, branching, basic
PLC functions (timers, counters), applications

MECH365 – Week 11 Lecture Notes


What is a PLC?
• A PLC is a user-friendly, microprocessor-based
specialized computer that carries out control functions of
many types and levels of complexity.
• It is used to monitor crucial process parameters and
adjust process operations.
• It accepts inputs from switches and sensors, evaluates
these in accordance with a stored program, and generates
outputs to control machines and processes

MECH365 – Week 11 Lecture Notes


What are PLCs used for?
• These are the backbone of control and automation in all
industries.
• PLCs are basically a hub that connects sensor inputs to
output devices using internal relays through some
program to perform a set of desired tasks.

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.

A mechanical relay A button


MECH365 – Week 11 Lecture Notes
PLC Basics

Inputs Outputs

Programmable
Controller
C
R

MECH365 – Week 11 Lecture Notes


Packaged PLC

MECH365 – Week 11 Lecture Notes


Packaged PLC with expansion

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.

MECH365 – Week 11 Lecture Notes


Where do PID, LEAD/LAG fit in?
• Levels of process automation form the ‘automation pyramid’.
• At high levels, automation involves corporate decisions,
management, process monitoring, and supervision.

MECH365 – Week 11 Lecture Notes


Where do PID, LEAD/LAG fit in?
• The control level (making systems do what we want) is where
we use PLCs.
• Below that, the field level involves the control of how our
sensors and actuators behave, using control strategies like
PID, lead/ lag, etc.

MECH365 – Week 11 Lecture Notes


PLC Applications
• Conveyor control
• Printed circuit board handling equipment
• SCADA(Supervisory Control And Data Acquisition)
• remote pump/lift station (water/wastewater)
• Flow monitoring for leak detection (oil&gas)
• Strapping machinery / trash compactors
• Palletisers
• Compressor control
• Replace hard-wired relay panels or SBCs
• Many, many more

MECH365 – Week 11 Lecture Notes


PLC Applications

MECH365 – Week 11 Lecture Notes


PLC Advantages
• Ease of programming
• Ease of maintenance
• Designed for industrial environment
• Quick installation
• Adaptable to change

MECH365 – Week 11 Lecture Notes


History of PLC
• First developed in the late 1960’s by GM to replace the
hard wired logic relays
• In the 1970’s, communications abilities began to appear,
that is, the PLC could talk to other
• The 1980’s saw an attempt to standardise
communications with GM’s manufacturing automation
protocol
• The market for PLCs grew from $80 million in 1978 to
about $12.4 billion in 2020
• Over 2000 companies are developing PLC solutions

MECH365 – Week 11 Lecture Notes


Main PLC Manufacturers
• Allen-Bradley http://ab.rockwellautomation.com/
• Automation Direct www.automationdirect.com.au/
• GM-Fanuc http://www.fanuc.co.jp/eindex.htm
• Mitsubishi Electric http://www.mitsubishielectric.com.au/
• Omron Electronics LLC www.omron.com/
• Panasonic http://pewa.panasonic.com/automation-controls/plc/
• Parker http://www.parker.com
• Rockwell Automation http://www.rockwellautomation.com/
• Schneider Electric http://www2.schneider-electric.com
• Siemens http://www.automation.siemens.com/mcms/programmable-
logic-controller/en/pages/default.aspx

• Our tutorials use Allen-Bradley

MECH365 – Week 11 Lecture Notes


PLC Components
• A power supply
• Input section
− Input devices: switch, push button, sensor
− Input module: receive signals from input devices and
send them to CPU
• Central processing unit (CPU)
− A logic unit, ‘the brain’ of a PLC
• Output section
− output module: provide output signals to output devices
− output device: solenoids, relays, motors, displays, etc.

MECH365 – Week 11 Lecture Notes


PLC Components
Communications

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

MECH365 – Week 11 Lecture Notes


PLC Operation
• A PLC works by continuously scanning a programs, 3
important step involved

Check Input Status

Execute Program

Update Output Status

MECH365 – Week 11 Lecture Notes


Ladder Diagram

• A “programming language” of the PLC


• Ladder diagram is graphical representation of
electric logic connections

MECH365 – Week 11 Lecture Notes


Ladder Diagram Symbols
The main function of a PLC is to control outputs based on the
condition of inputs. The symbols used in ladder logic
programming can be divided into two categories:

• Contacts or switches (inputs)


• Coils (outputs)
• Allen-Bradley symbols

MECH365 – Week 11 Lecture Notes


Contacts or Switches
Most inputs to a PLC are simple devices are either on or off.
These inputs are sensors and switches that detect part
presence, empty or full, and so on.

Normally open contact Normally closed contact

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

 Push button switches

 Selector switches: 2,3 or 4-position switches with different knob


options

MECH365 – Week 11 Lecture Notes


Coils
A coil is simply an output, which can take various forms: motors,
lights, pumps, counters, timers, relays, etc.

Physically, it is made with a continuous winding of wire, like a


helical spring. It carries electric current to activate a relay, hence
changes the status of its corresponding contacts

MECH365 – Week 11 Lecture Notes


Allen-Bradley contacts and coils
Examine-on instruction (XIC): examine if closed,
normally open contact
I:1/0
][
Examine-off instruction (XIO): examine if open,
normally close contact
I:1/1
]/[
Output energize (OTE): normal output instruction
O:0/1
( )
MECH365 – Week 11 Lecture Notes
Ladder Diagram
Rung Coil
Switch

Left power Power flow Right


rail power rail
• It represents the logic operation of a control system. The
logic flow is from left to right.
• The contacts/switches/relays and the coils are placed to
the left and to the right of each rung, respectively.
MECH365 – Week 11 Lecture Notes
Ladder Diagram
• Each section of a ladder diagram is called a rung, like the
rungs of a ladder. Each rung contains a number of input
instructions which produces a single output instruction.
• “Ladder diagram programming allows PLCs to perform
several different types of tasks, including Boolean logic,
timing, counting, arithmetic, and special functions.”

MECH365 – Week 11 Lecture Notes


Input Wiring

Terminal Isolation
Block Barrier

Input Devices
1
2
3
L1 4
5 P
L1 6 L
C
7
8
9
10
L2 COM

MECH365 – Week 11 Lecture Notes


Output Wiring

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 A2 X1 The AND switch


X1: = A1 AND A2

A1 X1
Branching, the OR switch
X1:= A1 OR A2
A2

MECH365 – Week 11 Lecture Notes


Relay logic examples
Examine the rungs below and determine the output is on
or off
Off
On
Off
On
Off
off
MECH365 – Week 11 Lecture Notes
Relay logic examples
Examine the rungs below and determine the output is on or off
Off

On

Off

off

MECH365 – Week 11 Lecture Notes


Latch circuit
Latch circuit is used to safely power machine tools such as
milling, turning, drilling, grinding machines.
For example, when the power is cut off or a fuse is blown off,
the ‘hold on’ circuit will drop out automatically. In order to
restart machine, the operator has to depress the start button
again. This is important when the power is cut and then
restored. Of course, the power to the motor can be cut through
the ‘stop’ button.

MECH365 – Week 11 Lecture Notes


Start Stop

A1 Coil A

“Hold on” circuit

Start Stop A

A1
“Hold on” circuit

MECH365 – Week 11 Lecture Notes


• When the start switch is pressed, the current goes to
coil A which closes normally open contact A1,
• The ‘Motor’ operates through the current supplied by
Contact A1.
• Contact A1 (hold on contact) continuously supply
current to Coil A. Please note that even the start button
is off, the motor keeps operating.
• When the ‘stop’ button is pressed or the power is cut,
no current flows through contact A1. The coil is de-
energised, the motor turns off.

MECH365 – Week 11 Lecture Notes


PLC registers
• In the ladder diagram, each symbol (or instruction) has an
address. This address sets aside a certain storage area in
the PLCs data files so that the status of the instruction
(True(1)/False(0)) can be stored

• Many PLCs uses 16 slot or bit storage locations

• Input starts with “I”, output starts with “O”

MECH365 – Week 11 Lecture Notes


Bits, bytes, words
• A single binary digit is a bit, eight bits are a byte, two bytes or
16-bits is a word.

MECH365 – Week 11 Lecture Notes


Memory
• Memory is organized into blocks of consecutive bytes or
words

MECH365 – Week 11 Lecture Notes


PLC data files
0
1

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)

MECH365 – Week 11 Lecture Notes


PLC data files used in this subject
• Output (file 0): stores the on or off condition at the output terminals for the
output module associated with this memory register
• Input (file 1): stores the on or off condition at the input terminals for the
input module
• Timer (file 4): stores the data for each timer used in a program. The data
includes timer accumulator and preset values, plus all status and output
bits
• Counter (file 5): stores the data for each counter used in a program. The
data includes counter accumulator and preset values, plus all status and
output bits

MECH365 – Week 11 Lecture Notes


Input & output files
Word
File #0 File Type
Bit Number
(0-9,0-15)

O0:0/0
0
Outputs
File contains
10 or 16 Outputs File Number 15 9 0

(bases only) Word 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

File #1 File Type Word


Input Number
(0-13,0-23)

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

MECH365 – Week 11 Lecture Notes


Ladder diagram – latching
I 1: 0/0 I 1: 0/1 O 0: 0/0

O 0: 0/0

• Push one button (I 1: 0/0) to turn on the output


• This continues until another push button (I 1: 0/1) to turn off
the output

MECH365 – Week 11 Lecture Notes


PLC programming procedures

Step 1: assign individual identification numbers to the inputs and


outputs. Inputs normally have the prefix I, while outputs normally
have the prefix O.
Step 2: sketch a ladder diagram to represent the operational
circuit
Step 3: figure out how the inputs and outputs will be connected
to the input and output modules

MECH365 – Week 11 Lecture Notes


PLC programming example 1
Design an alarm system in which there are three
hazard inputs to the alarm system, the system
operates as follows:
♦ If one input is on, a red pilot light goes on
♦ If any two inputs are on, an alarm siren sounds
♦ If all three are on, the fire apartment is notified

MECH365 – Week 11 Lecture Notes


Solution:
♦ Step 1: assign all input/output identification numbers
Input listing:
I1: 0/0: input A
I1: 0/1: input B
I1: 0/2: input C

Output listing:
O0: 0/0: red pilot light
O0: 0/1: alarm (siren)
O0: 0/2: fire department notify

MECH365 – Week 11 Lecture Notes


♦ Step 2: sketch the ladder diagram

MECH365 – Week 11 Lecture Notes


Week 12

Programmable Logic
Controllers (PLCs) (cont’)

MECH365 - Control of Machines and Processes, 2022


Ladder Diagram
Rung Coil
Switch

Left power Power flow Right


rail power rail
• It represents the logic operation of a control system. The
logic flow is from left to right.
• The contacts/switches/relays and the coils are placed to
the left and to the right of each rung, respectively.
MECH365 – Week 12 Lecture Notes
Ladder diagram – latching
I 1: 0/0 I 1: 0/1 O 0: 0/0

O 0: 0/0

• Push one button (I 1: 0/0) to turn on the output


• This continues until another push button (I 1: 0/1) to turn off
the output

MECH365 – Week 12 Lecture Notes


PLC data files used in this subject
• Output (file 0)

• Input (file 1)

• Timer (file 4)

• Counter (file 5)

MECH365 – Week 12 Lecture Notes


PLC programming procedures

Step 1: assign individual identification numbers to the inputs and


outputs. Inputs normally have the prefix I, while outputs normally
have the prefix O.
Step 2: sketch a ladder diagram to represent the operational
circuit
Step 3: figure out how the inputs and outputs will be connected
to the input and output modules

MECH365 – Week 12 Lecture Notes


PLC programming example 1
Design an alarm system in which there are three
hazard inputs to the alarm system, the system
operates as follows:
♦ If one input is on, a red pilot light goes on
♦ If any two inputs are on, an alarm siren sounds
♦ If all three are on, the fire apartment is notified

MECH365 – Week 12 Lecture Notes


Solution:
♦ Step 1: assign all input/output identification numbers
Input listing:
I1: 0/0: input A
I1: 0/1: input B
I1: 0/2: input C

Output listing:
O0: 0/0: red pilot light
O0: 0/1: alarm (siren)
O0: 0/2: fire department notify

MECH365 – Week 12 Lecture Notes


♦ Step 2: sketch the ladder diagram

MECH365 – Week 12 Lecture Notes


♦ Revising the ladder diagram

MECH365 – Week 12 Lecture Notes


PLC programming example 2
Design a standard forward-reverse circuit to meet
with the following specifications
♦ Each direction’s coil has its own start button
♦ The single stop button stops either coil’s operation. In this
circuit you must push stop before changing direction
♦ Interlocks are provided so that both outputs cannot be
energised at the same time

MECH365 – Week 12 Lecture Notes


Solution:
♦ Step 1: assign all input/output identification numbers
Input listing:
I1: 0/0 start forward (if not in reverse)
I1: 0/1 start reverse (if not in forward)
I1: 0/2 stop either direction (either direction)

Output listing:
O0: 0/0 forward coil
O0: 0/1 reverse coil

MECH365 – Week 12 Lecture Notes


♦ Step 2: sketch the ladder diagram

Interlocks

MECH365 – Week 12 Lecture Notes


PLC Timer Functions
• After coils and contacts, timers are mostly used to
control devices
• It is an instruction that waits a preset amount of time
before doing something
• Different types of timers are available with different
manufactures. They are classified as:
- On-Delay timer
- Off-Delay timer
- Retentive On-Delay timer

MECH365 – Week 12 Lecture Notes


PLC Timer Functions
• In Allen-Bradley, the Timer file number is #4

File Type
Timer Number
(0-255)

T4:0
4
Timers

File contains File Number


256 timers

• the Timer file #4 contains 256 timers


− TON, TOF, and RTO
− .001, .01 and 1 second time base

MECH365 – Week 12 Lecture Notes


On-Delay Timer: (TON)
• On-delay timer simply delays turning on. After the input is
enabled/turned on, the output will wait a preset amount of
time (seconds) before being activated

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

Preset T4:0.PRE How long the timer should time for.


Accumulated T4:0.ACC How long the timer has timed for already.
Done T4:0/DN Set to “1” when accumulated value > preset value.
Timer Timing T4:0/TT Set to “1” when accumulated value < preset value.
Enable T4:0/EN Set to “1” when the rung containing the timer is true.
MECH365 – Week 12 Lecture Notes
Timer Values

• Time Base: the unit of time used by a timer to time an event. Eg.
0.01 seconds and 1 second

• Preset Value: works in conjunction with the time base by


specifying the number of times that the timer must count the time
base. It is also referred to as the number of ticks. Eg. Assume a
target value of 2 seconds and a timer base of 0.01 seconds, the
preset value should be 200

MECH365 – Week 12 Lecture Notes
Timer Values

• Accumulated Value: keeps track of how many times the time


base has occurred since the timer instruction is energized.
When the accumulated value equals the preset value, the
timer will time out as it has reached its target value.

MECH365 – Week 12 Lecture Notes


Timer Addressing

Each timer has three associated words: word 0, 1 & 2


- Word 0 holds control data about the status of the timer’s enable output,
whether the timer is actively timing, and the status of the timer’s done
output (DN). The control word stores this information in bits 15, 14,
and 13, respectively
- Word 1 stores the timer’s preset value
- Word 2 holds the accumulated value
MECH365 – Week 12 Lecture Notes
How a On-Delay Timer works

MECH365 – Week 12 Lecture Notes


How a On-Delay Timer works
• When the timer’s input turns on, it will cause the timer’s enable output to
turn on. When this happens, the timer will start timing, but the done
output (DN) coil will remain off. The time between the timer being
energized and the done output being energized is the four-second delay
implemented by the timer.
• The timer will stop timing as soon as the accumulated value equals the
preset value.
• When the accumulated and preset values are equal, the done output will
turn on, causing the output coil that drives the pilot light to turn on.
• The done output—and hence, the pilot light—will stay on until the timer
block’s input turns off. At that time, everything in the ladder rung will turn
off, and the timer’s accumulated value will be reset to 0.

MECH365 – Week 12 Lecture Notes


On-Delay Timing program

Input
Enable bit

Timing bit
Done bit
Delay

MECH365 – Week 12 Lecture Notes


Example with On-Delay Timer

• For a grinding operation on a metal part, the coolent flow on


the part must be on for an interval before the grinding process
starts. Design a ladder diagram to meet with the following
specifications:
- When the process circuit is turned on, the coolent motor is
turned on.
- 8 seconds later the grinding process starts.

MECH365 – Week 12 Lecture Notes


Solution:
I1: 0/0 I1: 0/1 O0:0/0
Coolent
Motor
O0:0/0

O0: 0/0 TON


Timer On Delay

Timer T4:0
(EN)
Time Base 0.1 (DN)
Preset 80

Accum 0

T4:0/DN I1: 0/2 O0:0/1


Grinding

O0:0/1

MECH365 – Week 12 Lecture Notes


Off-Delay Timer (TOF)

• This type of timer simply delays turning off. The output is


turned on immediately when the input is enabled (turned
on). However, the output remains on for a specified period
of time after the input has been turned off. After the
specified period of time, the output also turns off

TOF
Timer Off Delay
Timer T4:1
(EN)
Time Base
Preset
0.1
200
(DN)
Accum 0

MECH365 – Week 12 Lecture Notes


How a Off-Delay Timer works

MECH365 – Week 12 Lecture Notes


How a OFF-Delay Timer works
• When the input logic turns on, both the block’s EN and DN will turn on.
However, the timer will not start timing because it is waiting for
an OFF input signal instead of an ON signal.
• When the block’s input turns off, the EN will turn off and the timer will start
timing (TT on). DN will stay on because it is waiting for the timer to time
out before it will turn off.
• Once ACC equals PRE, the timer will stop timing (TT off) and DN will turn
off, implementing the OFF-delay de-energise function.
• Therefore, the DN bit’s action follows the action of the timer’s input signal,
except that the DN bit remains on for the specified delay period after the
input turns off. All of the timer’s outputs will now remain off until the input
logic turns on again. At this point, the accumulated value is reset to 0.

MECH365 – Week 12 Lecture Notes


Off-Delay Timing program

Input

Enable bit

Timing bit

Done bit
Delay

MECH365 – Week 12 Lecture Notes


Example with Off-Delay Timer
• For a motor and its lubrication pump motor system,
lubrication for main motor bearings is required during motor
shut-down. Design a ladder diagram to meet with the
following specification:
- After the main motor is shut off, the lubricating pump
remains on for 20 seconds

MECH365 – Week 12 Lecture Notes


Solution
I1: 0/0 I1: 0/1 O0: 0/0
Motor

O0:0/0

I1:0/1 TOF
Timer Off Delay

Timer T4:1
(EN) Logic

Time Base 0.1 (DN)


Preset 200

Accum 0
O0: 0/1
I1: 0/0 T4:1/DN
Lubricating

O0: 0/1 Pump

MECH365 – Week 12 Lecture Notes


Retentive On-Delay Timer (RTO)

MECH365 – Week 12 Lecture Notes


Retentive On-Delay Timer (RTO)

• 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

MECH365 – Week 12 Lecture Notes


Counters
File Type
Counter Number
(0-255)

C5:0
5
Counters

File contains
File Number
256 counters

MECH365 – Week 12 Lecture Notes


Counter data storage

Each counter uses three words to store information: control


(word 0), preset value (word 1) and accumulated value
(word 2)
MECH365 – Week 12 Lecture Notes
Counter data storage

• 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

MECH365 – Week 12 Lecture Notes


Two Counter Functions

• Count up Instruction
CTU
COUNT UP (CU)
Counter
Preset
C5: 2
3
(DN)
Accum 0

• Count Down Instruction


CTD
COUNT DOWN (CD)
Counter
Preset
C5: 2
2
(DN)
Accum 4

MECH365 – Week 12 Lecture Notes


Counter up Instruction (CTU)

• The function of a count up instruction is to increase its accumulated value by


one every time the block’s input makes an OFF-to-ON transition.
• After a certain number of OFF-to-ON transitions have occurred, the count up
instruction will energise its output.
• A count up block has two output coils:
- a count up output coil (CU), which indicates that the counter block is energised
- a done output coil (DN), which indicates that the count is complete

MECH365 – Week 12 Lecture Notes


Simple LD with Counter Up

• 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.

MECH365 – Week 12 Lecture Notes


Counter Down Instruction (CTD)

• 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

MECH365 – Week 12 Lecture Notes


Simple LD with CUD

• 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.

MECH365 – Week 12 Lecture Notes


UP/Down Counter

• A count down instruction is most


often used with a count up
instruction to form an up/down
counter.
• Both counters share the same
address and the same preset and
accumulated values
• As a result, the up counter
increases the accumulated value
every time a certain event occurs,
while the down counter decreases
the same accumulated value if
another event occurs.

MECH365 – Week 12 Lecture Notes


Reset Instruction (RES)

• A reset instruction is a coil instruction


that can reset either a timing or counting
instruction.
• When a reset instruction is energised, it
sets the accumulated value of its
corresponding timer or counter to 0. It also
resets all of the control bits in word 0 of
the timer or counter’s memory location
• When the reset coil’s input is energised,
the reset instruction will set the up
counter’s accumulated value to 0. At the
same time, it will reset all of the bits in the
counter’s control word. This will turn the
done output off.

MECH365 – Week 12 Lecture Notes


Cascaded Counter
• A counter instruction’s accumulated value has a range from –32,768 to
+32,767. Once a counter reaches a count of +32,767, it cannot go any
higher
• Cascading two counters can count past the +32,767 count value
• Make sure two counters can self-reset in each scan
• When two counters are cascaded, they are programmed so that one
counter provides the input to the other counter

MECH365 – Week 12 Lecture Notes


Cascaded Counter Example
• This LD example shows two cascaded counters that implement a count
to 100,000. These cascaded counters have addresses C5:10 and C5:11

MECH365 – Week 12 Lecture Notes


Cascaded Counter Example

• 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

MECH365 – Week 12 Lecture Notes


Another counter example
Design a system for the use of a combination of two counters.
Suppose that we want an output indicator to go on when six of part A’s
and eight of part B’s are on a conveyor. I1:0/0 and I1: 0/1 are proximity
devices that pulse on/off when a part goes by them. Note that the
system does not indicate more than 6 or 8 parts; It would only indicate
when there are enough parts.

Conveyor
B

MECH365 – Week 12 Lecture Notes


Solution
I1: 0/0 CTU
COUNT UP
(CU) Part A count
Counter C5: 1

Preset 6 (DN)
Accum 0

I1: 0/1 CTU


COUNT UP
(CU) Part B count
Counter C5: 2

Preset 8 (DN)
Accum 0

C5:1/DN C5:2/DN O0: 0/0

Count complete

MECH365 – Week 12 Lecture Notes


Exercise 1
Design a system for detecting and sorting two geometrically different
parts travelling along a conveyor.

MECH365 – Week 12 Lecture Notes


Problem description
Two parts labelled A and B travel along a conveyor. Part B is to be
detected by a sort solenoid while part A is to be allowed to pass the
sort area.
Two proximity switches, S1 and S2, are located at different heights
to produce a sorting signal. When part A is in the sort area both
proximity turn on. When part B is in the sort area only switch S1 is
turned on.
The sort solenoid is to be energised for 1 second to deflect all part
B’s along an alternative cross conveyor.

MECH365 – Week 12 Lecture Notes


Solution
Step 1: assign all input/output addresses with suitable
identification names
Input listing:
I1: 0/0 S1 proximity switch (“sees” Part A and B)
I1: 0/1 S2 proximity switch (“sees” part A only)

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)

MECH365 – Week 12 Lecture Notes


Step 2: LD diagram

I1: 0/0 I1: 0/1 O0:0/0

Detects Part B
O0:0/0

O0: 0/0 TON


Timer On Delay
(EN) 1 second time
delay
Timer T4:0

Time Base 0.1 (DN)


Preset 10

Accum 0

T4:0/DN O0: 0/1

Deflects Part B

MECH365 – Week 12 Lecture Notes


Exercise 2
Design a system for checking for a missing bottle cap

MECH365 – Week 12 Lecture Notes


Problem description
Two retro-reflective photoelectric switches, S1 and S2, are used to
detect bottle caps. S1 detects the presence of a bottle, and S2 detects
the presence of a cap.
S1 is mechanically mounted so that it is trigged just before S2. So S1
starts timer TON1 while S2 resets it
If a cap signal is not detected within 2 seconds once the timer TON1 has
been triggered with a bottle signal the solenoid-driven reject piston is
energized by TON1.
The reject solenoid is held energised for 1 second by the timer TON2.

MECH365 – Week 12 Lecture Notes


Solution
Step 1: assign all input/output addresses with suitable
identification names and add notes where required
Input listing:
I1: 0/0 S1 switch (bottle present)
I1: 0/1 S2 switch (cap present)

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

Detects bottle no cap


O0:0/0

O0: 0/0 TON


Timer On Delay
Timer T4:0
(EN) 2 seconds time delay
Time Base
Preset
0.1
20
(DN)
Accum 0

T4:0/DN I1: 0/1 O0: 0/1

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

You might also like