PID Basics
PID Basics
1 Introduction
5 Summary
A Brief History of PID Control
▪ 1890’s, PID (Proportional - Integral – Derivative) Control,
originally developed in the form of motor governors, which
were manually adjusted
Cons:
▪ Not optimal for the problems
▪ Can be unstable unless tuned properly
▪ Not dependent on the process
▪ Hunting (oscillation about an operating point)
▪ Derivative noise amplification
Ways to Implement PID Control
Analog PID:
▪ Receives a measured process variable y(t) using an electronic controller;
▪ Compares this value with that of a desired setpoint signal;
▪ Calculates an error value e(t) as the difference between the setpoint
signal and process variable in a PID control circuit;
▪ The correction signal u(t) is then sent to the actuator to apply a
correction.
setpoint w + e
PID Controller
u y process variable
Plant
(output)
-
Digital PID:
▪ Computer/Microcontroller aided;
▪ The computer registers the process variable y(t) via an AD converter, and
produces a numerical value y(k);
▪ Calculates an error value e(k) as the difference between the setpoint signal
and process variable in a discrete-time PID control circuit;
▪ The correction signal u(k) is then sent to the DA converter producing u(t),
followed by the actuator to apply a correction.
process variable
setpoint w + e Discrete-time u y
DAC Plant (output)
PID Controller
-
ADC
Today’s Lecture- PID/1
1 Introduction
5 Summary
Today’s Lecture- PID/1
▪ Textbook form
: integration/reset time
: derivative time
P I D
P Control
▪ Proportional control (P): accounts for present values of the error
— control signal
e(t)
— proportional gain (
1
0 t
— error signal t0
K pe
0 t
t0
▪ Pros&Cons Step response for P control
▪ Rapid response to track the error signal
▪ Steady-state error
▪ Prone to be unstable for large Kp
e(t)
1
— control signal
0 t
t0
— integral gain
1
— control signal
0 t
— derivative gain t0
— error signal
u(t)
▪ In the Laplace domain
0 t
t0
Step response for D control
▪ Pros&Cons
▪ Predicts system behavior and thus improves settling time/transient response and
stability of the system
▪ Helps reduce overshoot, but amplifies noise (derivative kick)
▪ Seldom used in practice, 80% of the employed PID controllers have the D part
switched-off (see Ang et al., 2005)
PD Control
▪ Proportional-Derivative control (PD): a combination of P and I control
▪ D control action is able to predict system behavior and thus improving settling
time/transient response.
Effect of P-I-D Control
▪ We will examine effect of PID control on a canonical 2nd order system to
gain insight.
W + E U Y
Controller (C) Plant (P)
Setpoint: unit step signal
-
Sensor
Transfer function:
Controller: P-I-D
Error signal:
P Control
▪ Effect on steady-state performance
Steady-state error for a unit step reference
▪ Final-value theorem
y(t)
▪ Steady-state error is zero for a step reference, even for small Ki (just takes
longer to reach steady state).
y(t)
1
t
PD Control
▪ Effect on steady-state performance
Steady-state error for a unit step reference
▪ Final-value theorem
0 t
t0
▪ Effect on steady-state performance
y
Kp
characteristics better than the other types of Step response for PID control
Kp=5
setpoint
Kp=1
Kp=0.1
Ti=6
setpoint
Ti=12
Ti=24
%PI control:
Plt = tf(1,[10,7,1]);
No steady-state error in the step
Kp = 2; Ti = [2,6,12,24]; response
for m = 1:4 Ti increases, the overshoot tends
Cpi = tf([Kp,Kp/Ti(m)],[1,0]); to be smaller, but the speed of
sys = feedback(Cpi*Plt,1); response tends to be slower.
step(sys); hold on;
end
Td=0
Td=0.4 setpoint
Td=1
Td=4
%PD control:
Plt = tf(1,[10,7,1]); Td increases, the response has a
Kp = 10; Td = [0,0.4,1,4]; smaller overshoot with a slightly
for m = 1:4
slower rise time but similar settling
Cpd = tf([Kp*Td(m),Kp],[0,1]);
sys = feedback(Cpd*Plt,1); time
step(sys); hold on;
end
▪ Some intuition about effects of the terms:
▪ Increasing Kp: Same amount of error generates a proportionally larger
amount of control, makes system faster, but overshoot more (less stable)
▪ Increasing Ki: Control effort builds as error is integrated over time, helps
reduce steady state error, but can be slow to respond
▪ Increasing Kd: Allows controller to anticipate an increase in error, adds
damping to the system (reduces overshoot), can amplify noise
P I D
▪ Modifications:
▪ P part: setpoint weighting
▪ I part: anti-windup
▪ D part: setpoint weighting and limited gain
Summary
▪ The controller performs the PID mathematical functions on the error and
applies their sum to a process.
▪ We can build a PID controller that works well in practice in most situations
without knowing control theory.
E-mail: [email protected]