4. Review – Controllers
• Error is: the different between the system input (SP) and output (PV)
• The purpose of feedback is to reduce system error
• The purpose of a controller to process the system error in such a way
that it reduces error quickly and efficiently
• Proportional controllers work by multiplying the error by some scaling
constant 𝐾𝑃, this is fairly effective but has limitations (creates offset
and/or overshoot)
5. PID Control
• P – Proportional
• I – Integral
• D – Derivative
• A controller can consist of 1 or more of these elements together,
depending on the type of system/performance required
• P controller
• PI controller
• PD controller
• PID controller
• We can use multiple types of controllers in parallel, and sum the outputs of
each controller
6. Integrals
• An integral describes the area under a function
• The area “S” describes the integral of the
function f(x), integrated from a to b
• Mathematically, this looks like this:
𝑎
𝑏
𝑓(𝑥) 𝑑𝑥
• a and b are the “integration limits”
7. Integrals
• Integrals can be computed directly using the
methods of calculus, this will not be
covered in this class
• Integrals can also be approximated by
dividing the area under a curve into boxes
• Height of the box is the function value
• Width of the box is some selected constant
Δx
• The smaller the Δx, the more accurate the
approximation
8. Integral Controllers
• For our purposes, the word “integral” can be used interchangeably
with “accumulated sum”
• An integral controller accumulates the error over time
• If there is any steady state error in a system, the integral controller
will continue to accumulate this error, and eventually drive it to zero
• Because integral controllers only operate on accumulated changes in
error, they are slower to respond to error than a proportional or
derivative controller
9. Integral Controllers
• Similar to a Proportional Controller, the amount of integral control is
set by a constant 𝐾𝑖
• In some controllers, the constant 𝜏𝑖 is used, rather than 𝐾𝑖
• 𝐾𝑖 =
1
𝜏𝑖
10. Integral Control
• Highly effective at controlling processes due to its ability to
completely remove all system error
• Slower response than proportional control (accumulating error takes
time)
• Too much integral control can cause oscillation
• If 𝐾𝑖 is set too high (or 𝜏𝑖 too low, in other words), the integral
controller’s output can saturate or “windup”
• Integral “windup” can also occur if some external factor prevents the
setpoint from being reached. In this case, the integral controller will
continue accumulating, and eventually reach it’s maximum value
11. Derivatives
• A derivative is mathematical function that describes the slope of
another mathematical function
• Ex #1:
𝑦 = 3𝑥
𝑦′ = 3
• Ex #2:
𝑦 = 5𝑥 + 3
𝑦′ = 5
12. Derivatives
• You can take multiple derivatives of the same function, called 2nd
derivative, 3rd derivative, etc.
• There are several types of notation for the derivative of a function
𝑦 = 𝑥2
𝑦′ =
𝑑y
𝑑𝑥
= 𝑦 = 2𝑥
𝑦′′ =
𝑑2y
𝑑𝑥2
= 𝑦 = 2
13. Derivatives
• Several functions can have the same derivative, in fact every
derivative has a “family” of anti-derivatives
• Ex:
𝑦 = 𝑥2
𝑦′ = 2𝑥
𝑦 = 𝑥2 + 2
𝑦′ = 2𝑥
14. Derivatives – sines and cosines
• 𝑦 = sin 𝑥
• 𝑦′ = cos 𝑥
• 𝑦′′ = −sin 𝑥
• 𝑦′′′ = −cos 𝑥
• 𝑦′′′′
= sin 𝑥
• 𝑦′′′′′
= cos 𝑥
• Etc.
17. Derivatives
• For our purposes, the word “derivative” can be used interchangeably
with the word “slope”
• Looking at the slope of the error allows our derivative controller to
respond if there is a sudden change in error
• This could be caused by a change in setpoint, a system switching on
quickly, or a sudden disturbance in the system
18. Derivative Controller
• While a proportional (P) controller is looking at the actual value of the
system error, a derivative controller is looking at the slope of the error
• Error is increasing quickly lots of derivative control
• Error is stable very little derivative control
• The amount of derivative control is set by the constant 𝐾𝐷, (or 𝜏𝑑)
• Differential controllers are often used to respond to quick changes in error,
and prevent the error from changing too quickly
• This can help reduce overshoot coming from the P or I controller
• Since the D controller is “keeping an eye out” for sudden changes, we can
“get away with” more P and I than we could otherwise (and still avoid
overshoot)
19. Derivative Controller
• Differential controllers are often used to respond to quick changes in
error, and prevent the error from changing too quickly
• This can help reduce overshoot coming from the P or I controller
• Since the D controller is “keeping an eye out” for sudden changes, we
can “get away with” more P and I than we could otherwise (and still
avoid overshoot)
• Since D controllers respond to the error’s rate of change, they are
more susceptible to high frequency noise – so be careful when
implementing them!
20. PID Control
• A PID controller is really just 3 controllers in parallel, a P, an I, and a D
21. PID Control
• Proportional:
• Reacts to error in the present
• Good for performing the bulk of error reduction
• Results in “proportional-only offset”, which can reduced, but never eliminated with
proportional only control
• Integral:
• Reacts to error in the past
• Excellent at removing steady state errors
• Slow to respond due to time needed to accumulate error
• Derivatives:
• Reacts to error in the future (anticipates error by looking at slope)
• Starts working when error is changing quickly
• Stops working when error is constant
• Not good at eliminating steady state errors – if error is constant, D controller doesn’t
care
23. PID Control – some frightening math
• Proportional Controller:
• PI Controller:
• PID Controller:
24. PID controllers – different configurations
• P: Removes bulk of error, will always have offset (in a loaded system)
• I: Completely removes offset (eventually), slower response
• PI: Removes error quickly, and eliminates offset, may overshoot
• PD: Removes bulk of error, D corrects for overshoot, will have offset
• PID: Completely removes offset, responds quickly, D corrects for
overshoot