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

Introduction To PID Control

The document provides an introduction to PID control. It begins with an overview of the course plan, which includes explanations of what PID control is, demonstrations of manual and automatic tuning, and exercises. It then discusses the concepts of control, feedback loops, the role of controllers in converting setpoints and measurements into control signals. Proportional control is introduced as the simplest approach, but it has limitations like not eliminating steady state error. Integral control is then presented as a way to solve this by considering past errors over time through integration. Integral time is introduced as a more useful parameter than integral gain.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Introduction To PID Control

The document provides an introduction to PID control. It begins with an overview of the course plan, which includes explanations of what PID control is, demonstrations of manual and automatic tuning, and exercises. It then discusses the concepts of control, feedback loops, the role of controllers in converting setpoints and measurements into control signals. Proportional control is introduced as the simplest approach, but it has limitations like not eliminating steady state error. Integral control is then presented as a way to solve this by considering past errors over time through integration. Integral time is introduced as a more useful parameter than integral gain.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 115

Introduction to PID Control

Brad Schofield, BE ICS AP

05/19/2021 Brad Schofield 2


Course plan
• 09:00-10:00: What is PID control?
• 10:00-10:30: The UNICOS PID controller
• 10:30-10:45: Coffee
• 10:45-11:15: Manual tuning
• 11:15-12:00: Manual tuning exercise
• 12:00-14:00: Lunch
• 14:00-15:00: Autotuning
• 15:00-16:00: Autotuning exercise
• 16:00-16:15: Coffee
• 16:15-17:00: Questions & Wrap-up

05/19/2021 Document reference 3


What is PID Control?
• Let’s take a step back… What is control?
• Control is just making a dynamic process
behave in the way we want
• We need 3 things to do this:
• A way to influence the process
• A way to see how the process behaves
• A way to define how we want it to behave

05/19/2021 Document reference 4


Defining behaviour
• We usually specify a value we want some
output of the system to have
• Usually called the Setpoint (SP)
• Can be the temperature of a room, the level in a
tank, the flow rate in a pipe…
• The value can be fixed, or may change with
time…

05/19/2021 Document reference 5


Influencing the process
• We need some kind of control input which
can create changes in the behavior of the
process
• Can be a heater, a valve, a pump…
• Typically it is not the same physical quantity
as what we are controlling

05/19/2021 Document reference 6


Observing behavior
• If we knew exactly how the process worked,
we would know what the output would be for a
given control input…
• Most of the time we don’t know exactly, so we
need to measure what the process does
• Usually called Measured Variable (MV) or
Process Variable (PV)

05/19/2021 Document reference 7


Feedback Control
• Now we have a measurement (MV), some
value that we want it to be (SP), and some
way to make changes to the process
(control input)
• We can ‘close the loop’

05/19/2021 Document reference 8


The Controller as a System
• Now we can see that any controller can be
thought of as a system that takes a setpoint
and a measured value as inputs, and gives
a control signal as an output
SP
Controller Control
MV

05/19/2021 Document reference 9


The Controller as a System
SP
Controller Control
MV

• The controller needs to convert two signals


of one physical quantity (such as
temperature) into one signal of another
(such as valve position)

05/19/2021 Document reference 10


The Controller as a System
• We know that the process is a dynamic
system:
• Its outputs depend on current inputs as well as its
past state
• For the controller to deal with this, it makes
sense that it should be a dynamic system too

05/19/2021 Document reference 11


The Error Signal
• Very often we can think of the controller
acting on the difference between SP and
MV:
+ Error
SP Σ Controller Control
-

MV

05/19/2021 Document reference 12


The Closed Loop
+ e u
SP Σ Controller Process
-

MV

This is the ‘classic’ closed loop block diagram


representation of a control system

05/19/2021 Document reference 13


A Dynamic Controller
• We said that since the process is dynamic
(dependent on inputs made at different times), it
makes sense that the controller should be too
• How do we usually think of time?
• ‘Present’
• ‘Past’
• ‘Future’

05/19/2021 Document reference 14


Splitting the Controller

Present
+ e u
SP Σ Past Process
-
Future

MV

05/19/2021 Document reference 15


The ‘Present’
•  
This part of the controller is only concerned
with what the error is now
• Let’s take a simple law: let the control signal
be proportional to the error:

05/19/2021 Document reference 16


Proportional Control
•  
This is what is referred to as proportional
control. The control action at any instant is
the same as a constant times the error at the
same instant
• The constant is the Proportional Gain, and
is the first of our controller’s parameters

05/19/2021 Document reference 17


Proportional Control
𝒖=𝒌
  𝒑 ×𝒆
Proportional
+ e u
SP Σ Past Process
-
Future

MV

05/19/2021 Document reference 18


Is Proportional Control enough?
• Intuitively it seems like it should be fine on
its own: when the error is big, the control
input is big to correct it. As the error reduced
so does the control input.
• But there are problems…

05/19/2021 Document reference 19


Problem 1
Think of a pendulum.
If the setpoint is
hanging straight down,
then gravity acts as a
proportional controller
for the position…
Pendulum will oscillate!

05/19/2021 Document reference 20


Problem 2
• What happens when
the error is zero?
• Control input is zero.
• Causes problems if
we need to have a
nonzero control
value while at our
setpoint

05/19/2021 Document reference 21


Problem 2: steady state error
This problem is Easiest to see for tank
normally called steady level control: If there is
state error a constant flow out of
It’s a confusing name. the tank, the controller
The issue is just that must provide the same
the controller can’t flow in, while the level
produce any output is at the setpoint.
when the error is zero.

05/19/2021 Document reference 22


Problem 2: steady state error
•With
  P control, once
the error has reached
a value where is equal
to the flow out, the
level will stabilize. But
it will be different to the
setpoint

05/19/2021 Document reference 23


P control problem summary
• Problem 1: • Problem 2: steady
oscillations state error
• P control will give us • P control cannot
oscillations in some give us a nonzero
processes, value of the control
regardless of the at zero error for
value of the gain some types of
parameter. process

05/19/2021 Document reference 24


Solving P control’s problems
• How to get rid of steady state error?
• Let’s ignore the present for the moment and
concentrate on what has happened in the
past

05/19/2021 Document reference 25


Solving steady state error: ‘the Past’

Proportional
+ e u
SP Σ Past Process
-
Future

MV

• Let’s look at the error in the past

05/19/2021 Document reference 26


Solving steady state error
We can examine how
the controller error has
evolved in the past
If we sum up the past
values of the error, we
can get a value that
increases when there is
a constant error

05/19/2021 Document reference 27


Integral Action
•We can let the control be given by the sum of
past values of the error, scaled by some gain.
In continuous time the sum is an integral:

05/19/2021 Document reference 28


Integral Action
𝒕
 
𝒖= 𝒌 𝒊∫ 𝒆 ( 𝝉 ) 𝒅 𝝉
𝟎
Proportional
+ e u
SP Σ Integral Process
-
Future

MV

05/19/2021 Document reference 29


Integral gain, Integral time
•Here
  is where confusion can start…
We have an integral gain which converts an
integrated error to a control signal
We would actually like to parameterize this as
a time, as in how fast we can remove a steady
state error

05/19/2021 Document reference 30


Integral gain, Integral time
•Let’s
  rewrite:

As:

is our Proportional Gain, and is our Integral


Time

05/19/2021 Document reference 31


The Integral time
  do we use both
•Why and here?

Let’s add the proportional and integral parts:

05/19/2021 Document reference 32


Proportional and Integral Controller 𝒕
  𝒌𝒑
𝒖=𝒌 𝒑 𝒆 ( 𝒕 ) + ∫ 𝒆 ( 𝝉 ) 𝒅 𝝉
𝑻𝒊 𝟎
Proportional
+ e u
SP Σ Integral Process
-
Future

MV

05/19/2021 Document reference 33


Proportional and Integral Controller = PI Controller
•We  can rewrite the control law:

is the gain parameter, is the time it takes to fix


a steady state error

05/19/2021 Document reference 34


Solving P control’s problems revisited
• We solved the steady state error by adding
integral action (summing the past)
• How can we solve the oscillation problem?
• Let’s look at the future!

05/19/2021 Document reference 35


Solving oscillations: ‘the Future’

Proportional
+ e u
SP Σ Integral Process
-
Future

MV

• Let’s look at the error in the future

05/19/2021 Document reference 36


Solving oscillations: ‘the Future’
How do we predict the
future of the error?
Look at its gradient!
If the gradient (the time
derivative) of the error is
in a direction that makes
the error smaller, we can
reduce the control input

05/19/2021 Document reference 37


Damping
It can be easier to think
of this as damping,
something that resists
velocity
Think of the wheel on
your car…

05/19/2021 Document reference 38


Damping
The spring is a
proportional controller
for the wheel position.
The damper adds a
derivative action by
opposing the velocity
of the wheel

05/19/2021 Document reference 39


Derivative action
•Let’s
  let the control be dependent on the
derivative of the error:

Here is the derivative gain. Let’s again split


this into , where is the derivative time

05/19/2021 Document reference 40


Derivative action
  𝒅𝒆 (𝒕 )
𝒖=𝒌 𝒑 𝑻𝒅
𝒅𝒕
Proportional
+ e u
SP Σ Integral Process
-
Derivative

MV

05/19/2021 Document reference 41


PID Controller!
  𝒌𝒑 𝒕 𝒅𝒆(𝒕 )
𝒖=𝒌 𝒑 𝒆 ( 𝒕 ) + ∫ 𝒆 ( 𝝉 ) 𝒅 𝝉 +𝒌 𝒑 𝑻 𝒅
𝑻𝒊 𝟎 𝒅𝒕
Proportional
+ e u
SP Σ Integral Process
-
Derivative

MV

05/19/2021 Document reference 42


Derivative Time
•Why
  do we want as a parameter?
We can think of it as how far ahead we want to
predict!
Easier to relate to process

05/19/2021 Document reference 43


Problems with Derivative action
We know that a
derivative amplifies
quick changes.
We can get problems if
MV is noisy.
Solution is to add low
pass filter

05/19/2021 Document reference 44


Derivative with filter
•We  already have:

Equations will get messy if we add a filter in


time domain! Let’s use Laplace! Then we can
use algebra instead of calculus.

05/19/2021 Document reference 45


Derivative with filter
•Laplace
  transform frequency variable s is also
an operator. Multiplication by s is derivation,
and division is integration. So the derivative
part is now

05/19/2021 Document reference 46


Derivative with filter
•We  add a low pass filter:

Now we have another parameter which is the


filter bandwidth. So introducing derivative
action requires two more parameters!

05/19/2021 Document reference 47


Full PID equation
•The
  complete PID controller now looks like:

05/19/2021 Document reference 48


Full PID equation
•This
  simplifies to:

05/19/2021 Document reference 49


ISA PID Form
•This
  is the ISA ‘standard form’ for a PID

We have one gain, and three time constants

05/19/2021 Document reference 50


The UNICOS PID Controller
Features and quirks

05/19/2021 Document reference 51


UNICOS PID Features
• Uses
  the ISA standard equation we just derived
• Parameterized by , , ,
• Includes limits and ramps on setpoint and
output
• Can use scaling on input, or both input and
output

05/19/2021 Document reference 52


UNICOS PID Modes

Point to note:
Manual Mode is not open loop!

Use Output positioning to set


open loop control output

05/19/2021 Document reference 53


UNICOS PID Output Calculation

Note the scaling!

05/19/2021 Document reference 54


UNICOS PID Scaling
• The scaling features are a little tricky, and
have important consequences when tuning
the controller!
• Need to be very careful when applying
tuning results! (More on this later!)

05/19/2021 Document reference 55


Scaling types
• There are three types of scaling
• No scaling
• Input scaling
• Input and output (Full) scaling

05/19/2021 Document reference 56


No Scaling
• This is the simplest. The inputs and outputs
are applied directly to the PID equation, so it
operates on engineering values. For
example the MV and SP may be
temperatures, and the output a power
command to a heater

05/19/2021 Document reference 57


Input Scaling
• Here the input is scaled from engineering
values to a normalized value in the range 0-
100%. Scaling parameters must be provided.
For example 0 bar and 10 bar could be the
low and high limits, which are then mapped to
0% and 100% as seen by the PID algorithm.

05/19/2021 Document reference 58


Full Scaling (Input and Output)
• The input is converted to a 0-100% signal as
before, and now the output of the controller
is converted from 0-100% to engineering
values before being applied to the process

05/19/2021 Document reference 59


Scaling Pitfalls
•  
Note that the values of SP, MV and
controller output you see in the faceplate are
NOT the same as the PID equation ‘sees’ if
you use scaling!
• If you change the scaling type you MUST
scale your controller parameters ()!

05/19/2021 Document reference 60


Manual PID Tuning

05/19/2021 Document reference 61


P, PI, PD, PID?
•For 
the complete PID controller we have 4
parameters , , ,
But we can also choose to use only parts of the
controller, for example just, PI, giving 2
parameters to choose.
How do we know when to use what?

05/19/2021 Document reference 62


The Process Model
We now know exactly what’s inside our
controller, but so far we haven’t said anything
about what’s inside our process!
To be able to tune the controller, we need to
know something about it.

05/19/2021 Document reference 63


Open Loop Step Response
• A good starting point is to make an open
loop step test on the process
• Note that this is a step on the controller
output, not on the setpoint!

05/19/2021 Document reference 64


Open Loop Step Response
If our step response
looks something like
this, we have a stable
system with a first
order response

05/19/2021 Document reference 65


First Order System
•We  canget 3 pieces of
information about the
process:
• Process Gain
• Time Constant
• Time Delay

05/19/2021 Document reference 66


Process Gain
•This
 
is the ratio of the
change in MV to the
change in control input

In this case is (20-10)/


(5-0) = 2

05/19/2021 Document reference 67


Time Constant
This is the ‘speed’ of
the process.
To read it from the
trend, look for the time
it takes for the MV to
rise to 63% of its final
value

05/19/2021 Document reference 68


Time Constant
•Ok,  why 63%??
Because is about
0.63….
The step response is
so after time
this is

05/19/2021 Document reference 69


Time Delay
This is simpler, it is just
the time it takes from
the start of the step
until the MV starts to
move.

05/19/2021 Document reference 70


First order process model
We
•   have 3 parameters that determine behavior
• determines how big the output change will be
• determines how long the process takes to get
there
• determines how long it takes before the
process starts doing anything at all

05/19/2021 Document reference 71


Implications for control
The
•   key feature is the relation betweenand
• If is small and is big, control using PI is fine
• If is similar in size to , we may need a more
complex controller (PID)
• If is big relative to , PID will struggle; it will integrate
during the delay and then see a large jump!

05/19/2021 Document reference 72


Mini Exercise: PIDSim
• Play with the process
model
• Try open loop steps
• What happens with
large delay times?
• What happens when
adding an integrator?

05/19/2021 Document reference 73


Tuning for a first order process
•We  have a process that looks like

And we know what , and are from our step


test. Let’s say that we want our controlled
system to behave like this, but with a time
constant

05/19/2021 Document reference 74


Tuning for a first order process
•Now
  we know what our closed loop should look
like, and we also know what the process looks
like, and what the controller looks like. We ca
use the closed loop relation:

Where is our controller.

05/19/2021 Document reference 75


Tuning for a first order process
•  
From here we can work out what controller
parameters we need!
This is called Internal Model Control (IMC)

05/19/2021 Document reference 76


Internal Model Control (IMC)
•Once
  we do the math, we get these
parameters for PI:

(this is Skogestad’s IMC, S-IMC)

05/19/2021 Document reference 77


Internal Model Control (IMC)
IMC rules are nice, because they are not just
heuristics: they are calculated from a desired
behavior.

05/19/2021 Document reference 78


Integrating processes
•  What happens
when the step
response is a
ramp?
• Process contains
an integrator!

05/19/2021 Document reference 79


SIMC tuning rules
The rules can be
derived for a number of
different process
models

http://folk.ntnu.no/skoge/publications/2012/skogestad-improved-simc-pid/PIDbook-chapter5.pdf

05/19/2021 Document reference 80


SIMC for UNICOS PID
•Point
  to note: SIMC rules apply for a ‘cascade’
PID structure, not the ISA standard used by
UNICOS. For PI and PD they are the same, but
for the full PID we need to do a transformation
of the parameters:
,,

05/19/2021 Document reference 81


Other tuning rules
• There are MANY other sets of tuning rules!

05/19/2021 Document reference 82


Ziegler-Nichols
• You may have come across Ziegler-Nichols
• Early work (1942)
• Actually developed for fast setpoint tracking, so
they are really too aggressive for process
control!
• We will revisit them later!

05/19/2021 Document reference 83


Tuning rule warning
Lots of tuning rules are based on heuristics,
which might only fit certain process types. In
addition, you need to be sure what controller
structure they are for. You also need to know
what the control aim is (setpoint following,
disturbance rejection)

05/19/2021 Document reference 84


Recommendation: SIMC
• SIMC is good because:
• It forces you to do a step test and learn about
the process
• You can adjust the rules with an intuitive
parameter
• They are easily derived and therefore
understood

05/19/2021 Document reference 85


Recommendation: SIMC
Recommendation is to start with SIMC.
If you’re still not happy, you can use it as a
baseline, and make manual adjustments from
there.

Let’s now make a tuning ‘recipe’!

05/19/2021 Document reference 86


Tuning ‘recipe’
• Step 1: Preparation:
• Make sure it’s ok to put the process into open
loop
• Make sure the process is settled (steady state)
• Make sure you are close to your normal
operating point

05/19/2021 Document reference 87


Tuning ‘recipe’
• Step 2: Open loop step test
• Put the controller into Output Positioning
• Make a small step in the output value
• Observe the MV, make sure it doesn’t hit the limits!
• Once the MV has settled, make a step back to
where you started.
• Put the controller back in regulation

05/19/2021 Document reference 88


Tuning ‘recipe’
•  Step 3: Calculate process parameters
• Find , and
• (watch out for scaling!)
• is the time taken to rise to 0.63
• is the time between your step input and the first
change in MV

05/19/2021 Document reference 89


Tuning ‘recipe’
•  Step 4: Calculate controller parameters
• Use SIMC: choose closed loop time
• Apply tuning rules:

05/19/2021 Document reference 90


Tuning ‘recipe’
• Step
  5: Set parameters and test
• Apply the new parameters in the controller
• Make a small set point change and see how the
controller reacts
• If too aggressive, increase and recalculate
parameters
• If too slow, decrease and recalculate parameters

05/19/2021 Document reference 91


Exercise: Manual tuning in UNICOS

05/19/2021 Document reference 92


Hints! Input and I/O scaling
 
•Input Scaling •I/O  Scaling
• Find from the trend • Find ,
• Calculate new : • Calculate new :

05/19/2021 Document reference 93


Autotuning
The UNICOS Autotuning tool

05/19/2021 Document reference 94


Autotuning
• What is autotuning?
• It is NOT a system which continuously updates
the controller parameters (this is adaptive
control)
• It is just a set of tools to automate the procedure
of finding a set of parameters

05/19/2021 Document reference 95


Open vs Closed Loop
• In our manual tuning we did an open loop
experiment (step test) and found parameters
from there. This procedure can be
automated
• There are also methods that allow us to
keep the loop closed

05/19/2021 Document reference 96


Automated SIMC Tuning
• Let’s revisit the SIMC method
• Doing the calculations and keeping track of
the scaling was a pain
• The UNICOS autotuner automates most of
this for us

05/19/2021 Document reference 97


UNICOS SIMC Autotune
• Open the controller
1

3
faceplate and go to
Autotune
4
• Select SIMC (1)
• First, we need to
2
identify the process
parameters (2)

05/19/2021 Document reference 98


UNICOS SIMC Autotune
• We enter a step
size, and it performs
the step test,
stopping when MV
has settled.

05/19/2021 Document reference 99


UNICOS SIMC Autotune
•• Now
  we select the
1
closed loop response
3
time (3)
• This gives us the
4 proposed parameters (4)
• We can apply them to
2
the controller (unless set
by APAR; these must be
set manually)

05/19/2021 Document reference 100


Closed Loop Autotuning
• What if we want to remain in closed loop
when tuning?
• We can use the Relay Method
• Effectively exchanges the PID for an on/off
control

05/19/2021 Document reference 101


Relay Method
• Control only has 2
values, depending
on whether MV is
higher or lower than
SP
• Gives a square
wave oscillation

05/19/2021 Document reference 102


Relay Method: detail
•  Control goes
between and from
its original value,
with some
hysteresis

05/19/2021 Document reference 103


Relay Method: detail
•  Output oscillates
with an amplitude
• We get two pieces
of information from
this: Ultimate gain
and Ultimate Period

05/19/2021 Document reference 104


Relay Method: calculation
•  
Ultimate gain •  
Ultimate Period is
comes from the just the period of
amplitude of the the resulting
fundamental oscillation
frequency of the
square wave

05/19/2021 Document reference 105


Relay Method: tuning
Again we have MANY rules to choose from.
Ziegler-Nichols are the most well known
Time delay and time constant similar

Integrator and time delay system

Time delay dominated system

05/19/2021 Document reference 106


UNICOS Relay Autotuner
•The
  current version uses the Ziegler-Nichols
rules
• You may find the result too ‘aggressive’
• You can always ‘detune’ by reducing and
increasing by small amounts

05/19/2021 Document reference 107


UNICOS Relay Autotuner
• Select method RELAY
1
and controller type (1)
4
2
• We need to give an
amplitude (2). Before
starting, we should be
in steady state. Then
3
we can input Max and
Min values (ideally
symmetric!)

05/19/2021 Document reference 108


UNICOS Relay Autotuner
• We also need to
1

4
give the number of
2
cycles (2). 3 to 5 is
usually enough.
• Start the relay
3
experiment (3)

05/19/2021 Document reference 109


UNICOS Relay Autotuner
• Popup opens.
Observe that we get a
nice square wave
with fairly constant
period.
• After the given
number of cycles, it
will stop automatically

05/19/2021 Document reference 110


UNICOS Relay Autotuner
• Ziegler-Nichols tuning
1

4
rules are applied
2
internally. There is no
user parameter
• Results are displayed
(4) and we can
3
choose to apply the
new parameters

05/19/2021 Document reference 111


UNICOS Relay Autotuner
Practical notes:
• The experiment begins by checking for
steady state. It may take some time before
the relay cycles start
• If the experiment starts far from steady state,
it can cause problems

05/19/2021 Document reference 112


Iterative Feedback Tuning
• IFT tries to adjust
1 the control
4
2
parameters in order
to minimize a cost
function
• We won’t look at it
3
in detail here

05/19/2021 Document reference 113


Exercise: Autotuning in UNICOS
• Let’s try out the SIMC
and Relay methods
• Compare the results
to your results from
manual tuning
• Can you improve the
autotuning results?

05/19/2021 Document reference 114


Thanks for your attention!

05/19/2021 Document reference 115

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy