CDS 101/110a: Lecture 9-1 PID Control: Richard M. Murray 24 November 2008
CDS 101/110a: Lecture 9-1 PID Control: Richard M. Murray 24 November 2008
CDS 101/110a: Lecture 9-1 PID Control: Richard M. Murray 24 November 2008
PID Control
Richard M. Murray
24 November 2008
Goals:
Show how to use loop shaping using PID to achieve a performance
specification
Discuss the use of integral feedback and antiwindup compensation
Reading:
strm and Murray, Feedback Systems, Ch 10
Advanced: Lewis, Chapters 12-13
Bandwidth
Relative stability
-50
-100
100
-100
-200
-300
10
-1
10
10
10
phase independently
Frequency (rad/sec)
PID
P(s)
u = kp e + ki
-1
e dt + kd e
Intuition
Proportional term: provides inputs that correct for current errors
Integral term: insures steady state error goes to zero
Derivative term: provides anticipation of upcoming changes
Utility of PID
PID control is most common feedback structure in engineering systems
For many systems, only need PI or PD (special case)
Many tools for tuning PID loops and designing gains
Proportional Feedback
Simplest controller choice: u = kpe
desired bandwidth
Bode: shift gain up by factor of kp
e
-
kp
P(s)
kp > 0
50
0
-50
-100
-150
0
-100
-200
-300
-1
10
10
10
10
e
-
kp +
ki
s
kp > 0,
P(s)
ki > 0
100
50
0
-50
-100
0
-100
-200
-300
-2
10
-1
10
10
10
10
C(s)
1
+ kd s
s
1
= k(1 +
+ Td s)
Ti s
kTd (s + 1/Ti )(s + 1/Td )
=
Ti
s
C(s) = kp + ki
P(s)
-1
Bode Diagrams
50
40
30
20
10
0
100
50
0
-50
-100
-3
10
-2
10
-1
10
10
10
10
10
Frequency (rad/sec)
C(s)
kp
ki
s
kd s
Bode Diagrams
80
60
40
20
0
-4
10
a
s+a
-1
Magnitude (dB)
P(s)
-2
10
10
10
10
Frequency (rad/sec)
50
0
-50
Observations
Purely proportional gain wont work: to
get gain above desired level will not
leave adequate phase margine
Need to increase the phase from ~0.5
to 2 rad/sec and increase gain as well
-100
-150
0
-50
-100
-150
-200
-2
10
-1
10
10
10
10
Frequency (rad/sec)
150
100
Controller
Ti = 1/0.1; Td = 1/1; k = 2000
50
0
-50
-100
100
-100
-200
-3
10
-2
10
-1
10
Frequency (rad/sec)
10
10
10
8
6
To: Y(1)
2
0
-2
150
-4
100
-6
-8
50
0
-10
-8
-6
-4
-2
Real Axis
Step Response
-50
From: U(1)
1.4
-100
1.2
100
-100
-200
-3
10
-2
10
-1
10
Frequency (rad/sec)
10
0.8
To: Y(1)
Amplitude
Imaginary Axis
Observations
Very fast response (probably
too aggressive)
Back off on Ti to get
something more reasonable
0.6
0.4
10
0.2
0
0
0.5
1.5
2.5
3.5
4.5
Time (sec.)
10
PID Tuning
Zeigler-Nichols step response method
Design PID gains based on step response
Measure maximum slope + intercept
Works OK for many plants (but underdamped)
Good way to get a first cut controller
11
0.4
step
0.3
0.2
slope
0.1
-0.1
10
20
30
40
50
Bode Diagrams
100
Step Response
1.5
Amplitude
50
-50
-100
100
0.5
K = 1.2/a
0
0
-100
10
20
Ti = 2
30
40
Td = /2
50
60
Time (sec.)
-200
-3
10
-2
10
-1
10
Frequency (rad/sec)
10
10
12
PID
uc
ua
P(s)
-1
Problem
Limited magnitude input (saturation)
Integrator winds up => overshoot
Solution
Compare commanded input to actual
Subtract off difference from integrator
13
Main ideas
Performance specs give bounds on
loop transfer function
Use controller to shape response
Gain/phase relationships constrain
design approach
Standard compensators:
proportional, PI, PID
150
100
50
0
-50
-100
100
-100
-200
-3
10
10
-2
10
-1
10
10
Frequency (rad/sec)
14