0% found this document useful (0 votes)
66 views

T6 - PID Controller - 2021

This document provides an overview of PID controller design and tuning. It discusses establishing design specifications, choosing a controller configuration, and selecting the basic PID controller family. Methods for tuning PID controllers like trial-and-error and Ziegler-Nichols are also covered at a high level. The goal is to select the simplest controller that meets design requirements while maintaining good performance.

Uploaded by

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

T6 - PID Controller - 2021

This document provides an overview of PID controller design and tuning. It discusses establishing design specifications, choosing a controller configuration, and selecting the basic PID controller family. Methods for tuning PID controllers like trial-and-error and Ziegler-Nichols are also covered at a high level. The goal is to select the simplest controller that meets design requirements while maintaining good performance.

Uploaded by

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

Control Systems ELEC3114

PID Controller
Analysis and DesignV

Dr. Arash Khatamianfar

School of Electrical Engineering and Telecommunications


T2 2021
Content
• Design of control systems
• Design specifications
• Controller configurations Mainly from:
• Basic principles of design Dorf textbook,
• PID controller family Chapter 7 and some
• P controller other resources

• PD controller
• PI controller
• PID
• PID controller tuning methods
• Trial-and-error
• Manual
• Ziegler-Nichols

Page 1
Design of control systems
• The design process of a control system consists of seven main building
blocks, which are arranged into three groups:
Establish the control goals
• Establishment of goals, variables to be
controlled, and
Identify the variables to be controlled requirements/specifications.
• To determine what the system should do
Write the design requirements/ and how to do it.
specifications

Establish the system configuration


• System configuration and modelling.
(control system block diagram) • To determine the control system
configuration, identifying how the
Obtain a model of the process, the components are connected together, and
actuator, and the sensor finding a low-order dynamic model for the
process.
Choose a controller and select key • Controller design, simulation, and
parameters to be adjusted
analysis.
Optimise the controller parameters and • To determine the parameter values of the
Otherwise analyse the performance chosen controller to achieve the design
goals through iteration.
If the If the performance
performance meet themeets the
requirements/
Page 2
requirements/specifications,
specifications, finalise finalise the design.
the design.
Design specifications
• They are used to describe the expected performance of a system for a given
reference input.
• They are unique to individual applications:
• Stability
• Robustness
• Sensitivity to parameter variations, disturbance and noise rejection.
• Transient-response characteristics (time-domain specification)
• Maximum overshoot, peak time, rise time (step response)
• Steady-state characteristics (time-domain specification)
• Settling time and steady-state error (step response or ramp and parabolic responses)
• Frequency-response characteristics (frequency-domain specification)
• Gain margin, phase margin (Bode plot, Nyquist plot, etc.)

• For a general second-order system, the time-domain and the frequency- domain
characteristics are analytically related (you’ll see in the frequency response topic).
• But for a higher-order system, it is much more difficult to establish that.

• The final measure of a system performance is usually given in the time domain rather
than in the frequency domain (more intuitive).
• E.g., does a gain margin of 20 dB guarantee a maximum overshoot of less than 10%? Page 3
Design specifications (2)
• Historically, frequency-domain design techniques were mostly used for
LTI systems.
• The wealth of approximate graphical sketching tools like Root Locus, Bode
plot, Nyquist plot, and Nichols chart have made it relatively easy to analyse
and design controllers traditionally.
• For certain types of controllers, a design procedure in the frequency domain
is available to reduce the trial-and-error effort (lead-lag compensators
using Bode plot).
• However, they are not that intuitive, and for other types of controllers, it might
involve lots of trial and error.
• With powerful software like MATLAB and LabView, time-domain design
methods have overtaken frequency-domain design approaches.
• For example, the Control System Designer and PID Tuner tools in MATLAB provide
a convenient graphical tool to design controllers in time domain as well as in
Frequency domain (see MATLAB Control Systems design and analyse apps).
• State feedback approach is the only technique that uses time-domain
specifications with the powerful linear algebra tools for both linear and
nonlinear control system design.

Page 4
Controller configurations
• The ultimate design objective is to have the system’s output 𝑦 𝑡 behave in a
desired way (only SISO systems are considered in this course).
• The main problem is how to determine the control input 𝑢 𝑡 over a prescribed
time interval to have the design requirements all satisfied.
• Conventionally, there are fixed-configuration design forms in closed loop
where the relative position of the controller with respect to the process is already
known (the sensor in the feedback could be assumed to be ideal).
• The designer would then have to design the elements of the controller, i.e., determining
the controller parameter values (this is also called ‘compensation’)

• Series or cascade compensation (most-commonly used configuration)

Controller Process
r(t) + e(t) u(t) y(t)
Gc(s) G(s)

• State feedback configurations can be fit into this form, but they could be different in
implementation (you’ll see them in the state feedback design topic). Page 5
Controller configurations (2)
• In the cascade form, there is only one controller which may not be able to satisfy all the
requirements at the same time (1 degree of freedom), even though you might have more
than one variable to adjust in the controller.
• In 2 DoF configurations, two controllers are located at different places to provide more
flexibility in the design (it also brings more complexity!).

• Pre-filter compensation (2 DoF)


Pre-filter Controller Process
r(t) + e(t) u(t) y(t)
Gp(s) Gc(s) G(s)

• Feedforward compensation (2 DoF)


Feedforward
Gff (s)

Controller + Process
r(t) + e(t) + u(t) y(t)
Gc(s) G(s)

Page 6
Controller configurations (3)
• Inner-loop feedback compensation (1 DoF)

Process
r(t) + e(t) + u(t) y(t)
G(s)

Controller
Gc(s)

• Series-Feedback compensation (2 DoF)

Controller 1 Process
r(t) + e(t) + u(t) y(t)
Gc(s) G(s)

Controller 2

Gc(s)

Page 7
Principles of controller design
• After choosing a suitable configuration, we need to choose a controller type that will
satisfy all the design requirements/specifications.
• There are as many controller types as one can imagine (power of mathematics and
engineering art !)
• A good engineering practice is to choose the simplest controller type that meets all
the design requirements/specifications.
• The more complex a controller is, the more it costs, the less reliable it is, and the
more difficult it is to design.
• With experience and sometimes intuition, a designer can come up with suitable choice
of the controller.
• In summary:

A good control system should be simple


yet effective without compromising the
performance.

Page 8
Principles of controller design (2)
• After choosing a suitable controller, we need to determine the values of
the controller parameters needed to satisfy the design specifications.
• These parameters are typically coefficients of a transfer function
describing the controller.
• The analytical tools we have learned so far can be usually used to find
each individual parameters (provided that we have enough information
about the specifications).
• This may not always be straightforward.
• The parameters interact with each other and a change in one can dramatically
affect the choice of the others.
• Designing these parameters will requires iterations as the analytical solution is
always based on some assumptions that may not be met (e.g., all the system
can be approximated with a 2nd-order system).
• So, it is important to have some basic design guidelines.
• Trial-and-error is part of the iteration in the design procedure.
• But having some initial controller values to begin with (from the
analytical design solution) and using the basic design rules will help
reducing the trial-and-error effort. Page 9
Principles of controller design (3)
• Summary of the time-domain and frequency-domain characteristics to be used as a set of
guidelines for design purposes:

Closed-loop transfer function characteristics:


1. Complex-conjugate pole pairs Underdamped-type step response
2. All real poles and on the LHP Overdamped-type step response
• Provided that there is no zero in the closed-loop system (zeros can cause unwanted overshoot).
3. Dominant poles (closest poles to the origin) are heavily affecting the response.
• Poles at least 10 times to the left of dominant poles have negligible transient impact on the
response.
4. Dominant poles farther to the left of 𝑠-plane Faster response
• This means greater system bandwidth.
5. Moving the dominant poles farther to the left of 𝑠-plane will require more input energy
to be injected into the system.
• This means larger control input signal which may not be feasible due to actuator and process
input constraints.
6. Pole-zero cancellation can be intentionally used to reduce the impact of a particular
pole or zero in the response.
7. Rise time and bandwidth are inversely proportional. (loosely!)
8. Larger gain margin and phase margin Larger damping in the response.

Page 10
PID controller family: Proportional-Integral-Derivative controller
• The three-term PID controller is widely used in industrial
systems. PID
• PID controller is mostly used in a unity feedback R(s) + E(s)
Gc(s)
U(s)
G(s)
Y(s)
closed-loop system with the error signal as its input. − Uc (s)

• There are two standard forms used to describe a


PID controller:

𝑢𝑐 𝑡 = 𝐾𝑃 𝑒 𝑡 + 𝐾𝐼 න 𝑒 𝑡 𝑑𝑡 + 𝐾𝐷
𝑑𝑒 𝑡 𝐾𝐼
𝑑𝑡 𝐺𝑐 𝑠 = 𝐾𝑃 + + 𝐾𝐷 𝑠
𝑠

1 𝑑𝑒 𝑡 1
𝑢𝑐 𝑡 = 𝐾𝑃 𝑒 𝑡 + න 𝑒 𝑡 𝑑𝑡 + 𝑇𝐷
𝑇𝐼 𝑑𝑡
𝐺𝑐 𝑠 = 𝐾𝑃 1+ + 𝑇𝐷 𝑠
𝑇𝐼 𝑠

• 𝐾𝑃 is the proportional gain,


• 𝑇𝐼 is the integration time or reset time, 𝐾𝐷 = 𝐾𝑃 𝑇𝐷
• 𝑇𝐷 is the derivative time. 𝐾𝑃
• 𝐾𝐼 is the integral gain. 𝐾𝐼 =
𝑇𝐼
• 𝐾𝐷 is the derivative gain.
Page 11
PID controller family
• Either of the PID controller forms can be used as we can
always convert one form to another.
• In this topic, we will focus on the three-term PID controller 𝐾𝐼
with 𝐾𝑃 , 𝐾𝐼 , and 𝐾𝐷 gains.
𝐺𝑐 𝑠 = 𝐾𝑃 + + 𝐾𝐷 𝑠
𝑠
• If we simplify the PID transfer function, it will have one pole
at the origin due to integral action, and two zeros:

𝐾𝐼 𝐾𝐷 𝑠 2 + 𝐾𝑃 𝑠 + 𝐾𝐼
𝐺𝑐 𝑠 = 𝐾𝑃 + + 𝐾𝐷 𝑠 ⟹ 𝐺𝑐 𝑠 =
𝑠 𝑠
• We may not always use all the three terms in the If the control system design
controller and we can set some gains to zero: specification or requirement
• P Controller (set 𝐾𝐼 = 𝐾𝐷 = 0) can be satisfied by a simpler
• PD Controller (set 𝐾𝐼 = 0) version of PID, there is no
• PI Controller (set 𝐾𝐷 = 0) need to complicate the control
operation.
• PID controller
For example, if PD can satisfy
Note: Position error constant is a lowercase subscript letter 𝑝, 𝐾𝑝 , the requirements, we don’t add
whereas proportional gain is a uppercase subscript letter 𝑃, 𝐾𝑃 . the integral action.
Page 12
Proportional controller – 1st-order system
• Let’s see how a simple gain of 𝐾𝑝 can affect the
response of a simple 1st-order and 2nd-order system
R(s) + E(s) U(s) Y(s)
in closed-loop form: 𝐾𝑃
Uc (s)
𝐺(𝑠)

𝐾 𝑌 𝑠 𝐾𝑃 𝐺 𝑠
𝐺 𝑠 = ⟹ 𝑇 𝑠 = =
𝑠+𝑎 𝑅 𝑠 1 + 𝐾𝑃 𝐺 𝑠
𝑗𝜔
𝐾𝑃 𝐾 𝑅 𝑠 = 1/𝑠 𝐾𝑃 𝐾
𝑇(𝑠) = ⟹ 𝑦 𝑡 = (1 − 𝑒 −(𝑎+𝐾𝑃 𝐾)𝑡 )
𝑠 + (𝑎 + 𝐾𝑃 𝐾) 𝑎 + 𝐾𝑃 𝐾

𝜎
• By increasing 𝐾𝑃 :
−(𝑎 + 𝐾𝑃 𝐾) −𝑎
• The closed-loop pole moves further to the left-hand side as 𝑠-plane
𝐾𝑃 increases. The output response becomes faster.
• The DC gain of the closed-loop system is always less than one
(only one when 𝐾𝑃 → ∞).
1
• The steady-state error becomes smaller, 𝑒𝑠𝑠 = 𝐾 𝐾 . So, the
1+ 𝑃
𝑎
steady-state value increases.
• However, note that the increase in speed and steady-state
value comes at a price of increase in the control input
signal to the process (can the process tolerate a rise in its
Page 13
input?).
Proportional controller – 2nd-order system
• Adding and increasing 𝐾𝑃 in a 2nd-order system acts
similarly to a 1st-order system with a twist:
R(s) + E(s) U(s) Y(s)
𝐾𝑃 𝐺(𝑠)
− Uc (s)
𝐾 𝑌 𝑠 𝐾𝑃 𝐺 𝑠
𝐺 𝑠 = ⟹ 𝑇 𝑠 = =
(𝑠 + 𝑎)(𝑠 + 𝑏) 𝑅 𝑠 1 + 𝐾𝑃 𝐺 𝑠 𝑗𝜔

𝐾𝑃 𝐾 𝐾𝑃 𝐾
𝑇(𝑠) = 2 =
𝑠 + 𝑎 + 𝑏 𝑠 + (𝑎𝑏 + 𝐾𝑃 𝐾) 𝑠 2 + 2𝜁𝜔𝑛 𝑠 + 𝜔𝑛2
𝜎
𝑎+𝑏 1 2 −𝑏 −𝑎
𝑠1,2 = − ± 𝑎+𝑏 − 4(𝑎𝑏 + 𝐾𝑝 𝐾)
2 2 𝑠-plane

• By increasing the gain 𝐾𝑃 , if the system is overdamped,


the poles would get closer to each other and meet at a
breaking point (critically damped), then they split and the
system becomes underdamped (Remember Lab 1 !!).
• Faster response, less steady-state error, but higher
overshoot.

Page 14
PD controller
• With only a proportional controller, we don’t have enough flexibility,
particularly for controlling 2nd-order systems.
• So we need to add another control variable to increase the level of
flexibility to be able to adjust the behaviour of the system for both
transient response and steady state response.
• To this end, we can use either a PD or a PI controller.
• So let’s begin with PD first.

R(s) + E(s) Uc (s) Y(s)


𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)

𝐺𝑐 𝑠 = 𝐾𝑃 + 𝐾𝐷 𝑠

Page 15
PD controller – 2nd-order system
• Consider a 2nd-order system (open-loop R(s) + E(s) Uc (s) Y(s)
𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)
poles could be anywhere): −
𝐾
𝐺 𝑠 =
𝑠 2 + 𝑎1 𝑠 + 𝑎0
𝐾
𝑌 𝑠 (𝐾𝑃 + 𝐾𝐷 𝑠)𝐺 𝑠 𝐾𝐾𝐷 (𝑠 + 𝐾𝑃 )
⟹ 𝑇𝑠 = = ⟹ 𝐷
𝑅 𝑠 1 + (𝐾𝑃 + 𝐾𝐷 𝑠)𝐺 𝑠 𝑇 𝑠 =
𝑠2 + (𝑎1 + 𝐾𝐾𝐷 )𝑠 + (𝑎0 + 𝐾𝐾𝑃 )
• PD control gives full control of the location
of closed-loop poles of a second order
system by adjusting 𝐾𝑃 and 𝐾𝐷 . This analytical design
approach is known as the
• If we wish to have the closed-loop poles at Pole Placement technique.
(−𝑝1 , −𝑝2 ), we can equate the desired characteristic
equation with the denominator of 𝑇 𝑠 :
𝑠 2 + 𝑎1 + 𝐾𝐾𝐷 𝑠 + 𝑎0 + 𝐾𝐾𝑃 = (𝑠 + 𝑝1 )(𝑠 + 𝑝2 )
= 𝑠 2 + (𝑝1 + 𝑝2 )𝑠 + 𝑝1 𝑝2
𝑎0 + 𝐾𝐾𝑃 = 𝑝1 𝑝2
𝐾𝑃 = (𝑝1 𝑝2 − 𝑎0 )/𝐾
𝑎1 + 𝐾𝐾𝐷 = 𝑝1 + 𝑝2
𝐾𝐷 = (𝑝1 + 𝑝2 − 𝑎1 )/𝐾
Page 16
PD controller – 2nd-order system
• How do the PD gains influence the unit step R(s) + E(s) Uc (s) Y(s)
𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)
response characteristics, %𝑂𝑆, 𝑇𝑠 , 𝑇𝑝 , and 𝑒𝑠𝑠 ? −

𝐾
• Starting with steady-state error (assuming Type 0 system 𝐺 𝑠 =
𝑠 2 + 𝑎1 𝑠 + 𝑎0
with a unit step as 𝑅(𝑠)):

1 1
𝑒𝑠𝑠_step = =
1 + lim 𝐺𝑐 𝑠 𝐺 𝑠 𝐾(𝐾 + 𝐾𝐷 𝑠)
𝑠→0 1+ 2 𝑃 ȁ
𝑠 + 𝑎1 𝑠 + 𝑎0 𝑠→0

1 • Increasing the proportional gain


𝑒𝑠𝑠_step =
𝐾𝐾 𝐾𝑃 reduces the steady-state error
1+ 𝑎 𝑃
0 due to a step reference input.
• The derivative gain 𝐾𝐷 has no
effect on the steady-state error.

Page 17
PD controller – 2nd-order system
• For %𝑂𝑆, 𝑇𝑠 , and 𝑇𝑝 , we can write the R(s) + E(s) Uc (s) Y(s)
𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)
denominator of 𝑇 𝑠 in terms of damping ratio 𝜁 −
and natural frequency 𝜔𝑛 :
𝐾𝑃 𝐾
𝐾𝐾𝐷 (𝑠 +
) 𝐺 𝑠 =
𝐾𝐷 𝑠 2 + 𝑎1 𝑠 + 𝑎0
𝑇 𝑠 = 2
𝑠 + (𝑎1 + 𝐾𝐾𝐷 )𝑠 + (𝑎0 + 𝐾𝐾𝑃 )
2𝜁𝜔𝑛 2
𝜔𝑛 Note: The PD controller adds a
𝐾
zero at − 𝑃 , so increasing 𝐾𝑃
• Increasing 𝐾𝑃 would result in the following: 𝐾𝐷

• 𝜔𝑛 would increase, but since 2𝜁𝜔𝑛 should remain constant (it is not changing moves the zero to the left half-
with 𝐾𝑝 ), it causes 𝜁 to drop, meaning less damping and consequently plane which makes the step
higher overshoot. response closer to an ideal
2nd-order system, but
• 𝑇𝑠 would remain fairly unchanged since 𝜁𝜔𝑛 does not change.
increasing 𝐾𝐷 moves it back.
• 𝑇𝑝 would be reduced since 𝜔𝑛 1 − 𝜁 2 increases, meaning a faster
So the relative location of the
transient response (higher frequency of oscillation 𝜔𝑑 ).
zero with respect to the
• Increasing 𝐾𝐷 would: closed-loop poles could
• Increase 𝜁 (as 𝜔𝑛 only changes with 𝐾𝑝 ) creating more damping and change these impacts.
consequently less overshoot.
• 𝑇𝑠 would be reduced (4/𝜁𝜔𝑛 with 𝜁 increasing).
• 𝑇𝑝 would be slightly increased (a bit slower response). Page 18
Example 1
• Consider the unity feedback system shown below.
• Determine the stability of the process transfer function 𝐺(𝑠).
• Determine the characteristic equation of the closed-loop system.
• Design the PD controller to meet %𝑂𝑆 ≤ 5% and 𝑇𝑠 ≤ 1𝑠.

Page 19
PD controller – Time-domain interpretation
• In the time domain with a step reference input: R(s) + E(s) Uc (s) Y(s)
𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)

𝑑𝑒 𝑡
𝑢𝑐 𝑡 = 𝐾𝑃 𝑒 𝑡 + 𝐾𝐷 , 𝑒 𝑡 = 𝐴𝑢(𝑡) − 𝑦(𝑡)
𝑑𝑡
Assuming that 𝑟 = 𝐴 is constant for 𝑡 > 0:
𝑑𝑦 𝑡 8
𝑢𝑐 𝑡 = 𝐾𝑃 𝑒 𝑡 − 𝐾𝐷 𝐺 𝑠 =
𝑑𝑡 𝑠 2 + 6𝑠 + 8
• This means that in a step response, the rate of change of the output
is subtracted from the amplified error signal. 𝐺𝑐1 𝑠 = 10
max 𝑦ሶ
• So at the beginning of the response, 𝑒 0+ = 𝐴 − 𝑦(0+ ) which is 𝐺𝑐2 𝑠 = 10 + 0.5𝑠
mostly a large value, but 𝑦ሶ 0+ is small, so the proportional gain is
acting more strongly to reduce the error.
• As the output starts to exponentially increase, its rate of change
grows simultaneously while the error is reduced.
Initial error
• The maximum value for 𝑦ሶ 𝑡 happens close to the first time the
response reaches its final value, and that’s where −𝐾𝐷 𝑦ሶ can
reduce overshoot since it reduces the value of the control input,
acting like a brake in the system.

small 𝑦ሶ
Page 20
PD controller – Noise amplification and delay
• Differentiation can be implemented using the
R(s) + E(s) Uc (s) Y(s)
backward difference approximation: 𝐾𝑃 + 𝐾𝐷 𝑠 𝐺(𝑠)

++
𝑦 𝑡 − 𝑦 𝑡 − Δ𝑡 N (s)
𝑦ሶ 𝑡 ≅
Δ𝑡
• But the delay operator in the control loop can cause instability.
• The controller may have to wait for the differentiation to complete before
calculating the control input, which by then the output may have grown
uncontrollably.
The proportional term is
• Output sensors generate high frequency noise, differentiation commonly combined with the
of the output amplifies the measurement noise in the loop. derivative term to:
Assuming that noise can be modelled as a high • improve transient stability
frequency sinusoid, 𝑛 𝑡 = 𝐴0 sin 𝜔0 𝑡, 𝜔0 ≫ 1:
• reduce steady-state error
𝑑𝑒 𝑡
𝑒 𝑡 = 𝑟(𝑡) − 𝑦 𝑡 + 𝑛 𝑡 ⟹ 𝑢𝑐 𝑡 = 𝐾𝑃 𝑒 𝑡 + 𝐾𝐷 𝑑𝑡 + 𝐾𝐷 𝐴0 𝜔0 cos 𝜔0 𝑡 • reduce the effect of noise.

• To avoid this, we use a first-order filter to implement


differentiation: 𝐾𝐷 𝑠
• 𝜏𝐷 is the filter time constant and it should be much smaller
𝐺𝐷 𝑠 =
𝜏𝐷 𝑠 + 1
than the time constants of the process itself to be ignored.
Page 21
PI controller – 1st-order system
• If we need to eliminate steady state error as part of
the design specification, we need to increase the
system type.
• So we need to add integrators to the forward-path 𝐾𝐼
transfer function via the controller. This is where the 𝐺𝑐 𝑠 = 𝐾𝑃 +
𝑠
PI controller is used.
• Let’s consider a 1st-order system: R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + 𝐺(𝑠)
− 𝑠
𝐾
𝐺 𝑠 =
𝑠+𝑎

𝐾(𝐾𝑃 𝑠 + 𝐾𝐼 )
⟹ 𝐺𝑐 𝑠 𝐺 𝑠 = ⟹ Type 1 system, so 𝑒𝑠𝑠_step = 0
𝑠(𝑠 + 𝑎)

𝐾(𝐾𝑃 𝑠 + 𝐾𝐼 ) DC gain of 1:
𝐾
𝑇 𝑠 =
𝑌 𝑠
=
𝑠(𝑠 + 𝑎) 𝐾𝐾𝑃 (𝑠 + 𝐾𝐼 )
⟹ 𝑅 𝑠 𝐾(𝐾𝑃 𝑠 + 𝐾𝐼 ) ⟹ 𝑃 𝑌 𝑠 →𝑅 𝑠 ቚ
1+ 𝑇 𝑠 = 𝑠→0
𝑠(𝑠 + 𝑎) 𝑠 2 + (𝑎 + 𝐾𝐾𝑃 )𝑠 + 𝐾𝐾𝐼 so 𝑒𝑠𝑠_step = 0

Page 22
PI controller – 1st-order system
• For %𝑂𝑆, 𝑇𝑠 , and 𝑇𝑝 , we can write the R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + 𝐺(𝑠)
denominator of 𝑇 𝑠 in terms of damping ratio 𝜁 − 𝑠
and natural frequency 𝜔𝑛 :
𝐾𝐼
𝐾𝐾𝑃 (𝑠 +
) 𝐾
𝐾𝑃 𝐺 𝑠 =
𝑠+𝑎
𝑇 𝑠 = 2
𝑠 + (𝑎 + 𝐾𝐾𝑃 )𝑠 + 𝐾𝐾
ต𝐼 Note: A PI controller also
2 𝐾
2𝜁𝜔𝑛 𝜔𝑛 adds a zero at − 𝐼 . So
𝐾𝑃
• Increasing 𝐾𝐼 would result in the following: increasing 𝐾𝑃 and 𝐾𝐼 can
• 𝜔𝑛 would increase, but since 2𝜁𝜔𝑛 should remain constant (it is not easily change the relative
changing with 𝐾𝐼 ), it causes 𝜁 to drop, meaning less damping and location of the zero with
consequently higher overshoot. respect to the closed-
• 𝑇𝑠 would remain fairly unchanged since 𝜁𝜔𝑛 does not change (it may loop poles.
slightly increase due to larger oscillations). This can affect the behaviour
• 𝑇𝑝 would be reduced (faster transient response due to higher of the system compared to an
oscillation 𝜔𝑑 ). ideal 2nd-order one.

• Increasing 𝐾𝑃 would: We can use the Pole


• Increase 𝜁 (as 𝜔𝑛 only changes with 𝐾𝐼 ) creating more damping and Placement technique to
consequently less overshoot (just for 1st-order). find the gains for the
desired location of the
• 𝑇𝑠 would be reduced (4/𝜁𝜔𝑛 with 𝜁 increasing).
closed-loop poles.
• 𝑇𝑝 would be reduced (more energy to the system 𝑈𝑐 = 𝐾𝑃 𝐸(𝑠)) Page 23
PI controller – 2nd-order system
• For a 2nd-order system: R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + 𝐺(𝑠)
− 𝑠
𝐾
𝐺 𝑠 = 2
𝑠 + 𝑎1 𝑠 + 𝑎0

𝐾𝑃 𝑠 + 𝐾𝐼 𝐾
𝑌 𝑠 𝑠
𝐺 𝑠 𝐾𝐾𝑃 (𝑠 + 𝐾𝐼 )
⟹ 𝑇𝑠 = =
𝐾 𝑠 + 𝐾𝐼
⟹ 𝑇 𝑠 = 𝑃
𝑅 𝑠 1+( 𝑃
𝑠
)𝐺 𝑠 𝑠3 + 𝑎1 𝑠2 + (𝑎0 + 𝐾𝐾𝑃 )𝑠 + 𝐾𝐾𝐼

• The closed-loop system becomes third order (adding We can still have some intuitive idea on how 𝐾𝑃
an integrator increases the order of the system). and 𝐾𝐼 can affect the response:
• The transient response (impact of changing gains on • Increasing 𝐾𝑃 would increase the speed of
%𝑂𝑆, 𝑇𝑠 , and 𝑇𝑝 ) would depend on the location of the the transient response as well as overshoot.
third closed-loop pole and the additional zero. • Increasing 𝐾𝐼 would increase overshoot,
and in general slows down the response.
• The steady state error due to step reference input is • Increasing 𝐾𝐼 is in general risky since any
zero (type 1 system). integration means time delay in the response,
• We can use the Pole Placement technique to find the which can destabilize the system. This is why
it is usually used with 𝐾𝑃 .
gains for the desired location of the closed-loop poles.

Page 24
Example 2
• A control system with a PI controller is shown in Figure 2. Select 𝐾𝑃 and 𝐾𝐼 such the
percent overshoot to a step input is %OS = 4% and the velocity error constant is 𝐾𝑣 = 10.

Page 25
PID controller
• If we want the benefits of both the damping of PD and 𝐾𝐼
the steady state error elimination of PI, we would use 𝐺𝑐 𝑠 = 𝐾𝑃 + + 𝐾𝐷 𝑠
𝑠
PID.
• A PID controller can be implemented in cascade form or 𝐾𝑃
in parallel form.
• We have total control on placing the closed-loop E(s) 𝐾𝐼 + + Uc (s)
poles wherever the design specification requires us. 𝑠 +

• For a 2nd-order system: 𝐾


𝐺 𝑠 = 𝐾𝐷 𝑠
𝑠 2 + 𝑎1 𝑠 + 𝑎0
𝐾𝐷 𝑠 2 + 𝐾𝑃 𝑠 + 𝐾𝐼
𝑌 𝑠 𝐺 𝑠
⟹ 𝑇𝑠 = = 𝑠 𝐸 𝑠 𝐾𝐼 𝑈𝑐 𝑠
𝑅 𝑠 𝐾𝐷 𝑠 2 + 𝐾𝑃 𝑠 + 𝐾𝐼 𝐾𝑃 + + 𝐾𝐷 𝑠
1+( )𝐺 𝑠 𝑠
𝑠
Type 1 system, so 𝑒𝑠𝑠_step = 0
𝐾(𝐾𝐷 𝑠 2 + 𝐾𝑃 𝑠 + 𝐾𝐼 )
𝑇 𝑠 = 3
DC gain of 1: 𝑠 + (𝑎1 + 𝐾𝐾𝐷 )𝑠 2 + (𝑎0 + 𝐾𝐾𝑃 )𝑠 + 𝐾𝐾𝐼
𝑌 𝑠 → 𝑅 𝑠 ȁ𝑠→0 so 𝑒𝑠𝑠_step = 0

Note that PID adds two zeros to the closed-loop system which makes it harder to
analyse the behaviour of the system analytically (many assumptions may not be valid!) Page 26
PID Tuning Methods
• PID tuning refers to the methods to identify the right values for the
parameters of the PID controller (analytically or experimentally).
• In other words, PID tuning involves finding the gains to satisfy the
design specifications.
• One method is known as the trial-and-error approach.
• This works alright for not very complicated systems.
• Based on our understanding of the impact of each gain on the step
response, we can summarize them in the table below.

• Pole-placement can be used but it may not always be feasible.


• Having zeros may not guarantee the behaviour based on the location of closed-loop poles.
• Ziegler-Nichols is an empirical method which we will discuss here. Page 27
Manual PID tuning using step response.
• This PID tuning technique requires the PID
controller to be in the control loop (closed-loop R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + + 𝐾𝐷 𝑠 𝐺(𝑠)
technique). − 𝑠

• It does not necessarily require us to have a


precise knowledge of the system model (𝐺(𝑠) can
be unknown) if the tuning process to be done on Forcing the output of the actual plant to reach
the actual system (not advised!). pure oscillation is risky as it could easily
damage the equipment or create hazards.

• Manual PID tuning:


• Set 𝐾𝐼 = 0 and 𝐾𝐷 = 0.
• Apply a suitable step input (𝑅 𝑠 = 𝐴/𝑠) for a small value of 𝐾𝑃 .
• Slowly increase the gain 𝐾𝑃 until the output of the closed-loop system oscillates just on
the edge of instability (marginally stable closed-loop system).
• Reduce the value of the gain 𝐾𝑃 until the second peak of the underdamped response is
approximately one-forth of the maximum peak value. This is known as quarter
amplitude decay.
• A rule-of-thumb: First reduce 𝐾𝑃 by one-half and you would get close to quarter amplitude
decay (reduce it further if it is not at quarter amplitude decay).
• Once the quarter amplitude decay gain is found, increase 𝐾𝐼 and 𝐾𝐷 to achieve the
desired step response.
Page 28
Manual PID tuning using step response.
• In-class exercise:
• Consider the closed-loop system with 𝐺 𝑠 R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + + 𝐾𝐷 𝑠 𝐺(𝑠)
as below: − 𝑠

1
𝐺 𝑠 =
𝑠 𝑠 + 10 𝑠 + 5.66

• The closed-loop characteristic equation assuming 𝐾𝐼 = 0


and 𝐾𝐷 = 0 is:
𝑌 𝑠 𝐾𝑃
𝑇 𝑠 = = 3
𝑅 𝑠 𝑠 + 15.66𝑠 2 + 56.6𝑠 + 𝐾𝑃

• Apply the Routh-Hurwitz criteria to find the critical gain which


makes the closed-loop system to reach the boundary of
instability, which causes the system to be marginally stable
(𝑎2 𝑎1 ≥ 𝑎3 𝑎0 ): s = tf('s');
G = 1/(s*(s+10)*(s+5.66));
15.66 × 56.6 ≥ 𝐾𝑃 ⟹ 𝐾𝑃 = 886.356 Kp_critical = 886.356;
Kp = Kp_critical/2
• Now use the following MATLAB program and first find the quarter Ki = 0;
amplitude decay (start with 𝐾𝑃 /2) and then adjust 𝐾𝐷 and 𝐾𝐼 to Kd = 0;
Gc = pid(Kp, Ki, Kd);
achieve %𝑂𝑆 ≤ 13% and 𝑇𝑠 ≤ 2.5 s. T = feedback(Gc*G,1),
step(T) Page 29
grid on
Ziegler-Nichols PID tuning
• In 1942, John G. Ziegler and Nathaniel B. Nichols created two important
PID controller tuning methods, which are still used in industry, to achieve:
• A fast closed-loop step response without excessive oscillations
• Designed for strong disturbance rejection (robustness against disturbances).
• The first approach is based on closed-loop concepts (similar to the
manual tuning method)
• The second method is based on open-loop concepts.
• The model does not have to be precisely known, making it quite
practical in process control applications.
• Ziegler-Nichols PID tuning technique is mostly used to obtain the initial
controller design.
• You need to test the controller (preferably in simulation) to properly
adjustment it to achieve the desired performance.
• The Ziegler-Nichols technique will not work for all plants and processes.

Page 30
Ziegler-Nichols PID tuning – Closed-loop method
• Similar to manual tuning, the PID controller
needs to be in the control loop. It can be R(s) + E(s) 𝐾𝐼 Uc (s) Y(s)
𝐾𝑃 + + 𝐾𝐷 𝑠 𝐺(𝑠)
done either in simulation or on the actual plant − 𝑠

(not advised on the actual plant!)

• Closed-loop Ziegler-Nichols PID tuning (for 2nd-order systems and higher):


• Set 𝐾𝐼 = 0 and 𝐾𝐷 = 0.
• Apply a suitable step input (𝑅 𝑠 = 𝐴/𝑠) for a small value of 𝐾𝑃 .
• Slowly increase the gain 𝐾𝑃 until the output of the closed-loop system oscillates just on the
edge of instability (marginally stable closed-loop system).
• This gain is called the ultimate gain 𝐾𝑢 .
• Measure the period of the pure oscillation which is called the ultimate period 𝑃𝑢 .
• Once 𝐾𝑢 and 𝑃𝑢 are obtained, use the following table to find 𝐾𝑃 , 𝐾𝐼 , and 𝐾𝐷 .

Page 31
Ziegler-Nichols PID tuning – Open-loop method
• Very similar to step response modelling, this method
requires the open-loop step response of the process (take
the controller off-line or out of the control loop), which is
called the reaction curve.
• It is based on the assumption that the process behaves
similarly to a first-order system.
• That’s why this approach is well suited for slow and Step
sluggish systems like process control applications. Response 𝑦 𝑡
• The step response (reaction curve) is characterized by a yss
transport delay Δ𝑇 and the reaction rate 𝑅 (slope of the
response).
Slope of 𝑅

Test signal

0 Δ𝑇 𝜏𝑠 t
A 𝑋 𝑠 𝐾𝑑𝑐 𝑒 −𝑠Δ𝑇 𝑌 𝑠
𝜏𝑠 + 1
𝑦𝑠𝑠
𝑅=
Approximate model 𝜏𝑠 Page 32
0 t
Ziegler-Nichols PID tuning – Open-loop method

• Open-loop Ziegler-Nichols PID tuning:


• Apply a suitable step input to the open-loop system.
• Estimate the values of transport delay Δ𝑇, final value (steady-state
value) of the step response 𝑦𝑠𝑠 , and the time where the response has the
highest slope (steepest tangent) after the transport delay 𝜏𝑠 .
• Calculate the reaction rate 𝑅 (or the slope of the response) using 𝑦𝑠𝑠 and
𝑦
𝜏𝑠 (𝑅 = 𝑠𝑠 ).
𝜏𝑠
• Once Δ𝑇 and 𝑅 are obtained, use the following table to find 𝐾𝑃 , 𝐾𝐼 , and 𝐾𝐷 .
𝑦𝑠𝑠
𝑅=
𝜏𝑠

Page 33
Example 1
𝐺 𝑠 =
• Re-consider the same 3rd-order system: 𝑠 𝑠 + 10 𝑠 + 5.66
• Having the critical gain 886.356 and the period of sustained
oscillation 𝑡𝑝 = 0.83𝑠, we calculate the ultimate gain 𝐾𝑈 and
the ultimate period 𝑃𝑈 , and subsequently the PID controller
gains using the closed-loop Ziegler Nichols table:

𝐾𝑈 = 886.356 𝑃𝑈 = 0.83
1.2𝐾𝑈 0.6𝐾𝑈 𝑇𝑈
⟹ 𝐾𝑃 = 0.6𝐾𝑈 = 531.81, 𝐾𝐼 = = 12815, 𝐾𝐷 = = 55.17
𝑇𝑈 8

Unit step response with the Ziegler Nichols PID Disturbance response for the Ziegler Nichols PID tuning Page 34
tuning method method vs the manual tuning
Questions?

Page 35

You might also like