reminder: hw11: assigned but not to be graded, not to be ... · reading. 3 closed-loop ... p sk ib...
TRANSCRIPT
0
Lecture 27: Tue Dec 5, 2017
Reminder:
HW11: assigned but not to be graded, not to be turned in.
final exam is Thursday Dec 14, 8am – 10:50am
Control
1
Quiz 1 + Quiz 2
3
9
6
11
80 100 120 140 160 180 200min = 62
max = 192mean = 152
median = 158
SCORE
2
60
192189189187185184183182181180180178177168163161160158154152149146144143142142139138136116113 90 89 68 62
22
2
Reading
3
Closed-Loop Controllers
Gc( s )r( t ) e( t ) y( t )
+
–
Gp( s )
PPIPDPID
Kp
Kp + Ki/s
Kp + Kds
Kp +Ki/s + Kds
Gc( s )
H( s ) =Gc( s )Gp( s )
1 + Gc( s )Gp( s )
4
P Controller for 1st order Gp(s) =
• P control ⇒ Gc( s ) = Kp
⇒ H( s ) =
• moves pole location from –a to – (a + Kpb)
• Can stabilize an unstable system!
• Nonzero steady-state tracking error y∞= H0 = , can make arbitrarily small
bs a+------------
Kbs a Kb+ +-----------------------------
1
1aKb--------+
-----------------
1
H0
0 t
STEADY-STATE TRACKING ERROR
5
A Plant that IntegratesVery common, e.g. a wheeled vehicle:
⇒ plant is Gp( s ) = = (observe built-in integrator)
Pop Quiz:(a) Is the plant stable?
(b) Can it be stabilized via P controller?
force x( t ) position y( t )
applied force friction
x( t ) – d y( t ) = m y( t ) d2
dt2--------d
dt-----
1/ms s d/m+ ------------------------------ b
s s a+ ---------------------
6
P Control for Gp(s) =
P control:
⇒ H(s) = = =
DC gain is H( 0 ) = 1 ⇒ no steady-state tracking error!
In fact, any time the “open loop transfer function” Gc( s )Gp( s ) has a pole at the origin, the closed-loop system will have zero steady-state tracking error.
This makes you think ... if the plant doesn’t have a pole at s = 0, why not put one in the controller?
bs s 1+ ---------------------
Kbs s 1+ --------------------
1 Kbs s 1+ --------------------+
---------------------------- Kbs s 1+ Kb+------------------------------------- Kb
s2 s Kb+ +-------------------------------
7
PI Controller
Gc( s ) = Kp + :
⇒ input to plant is x( t ) = Kpe( t ) + Ki e( )d
Interesting property: Error need not be nonzero to drive plant!
How to choose the parameters {Kp, Ki}?
to put poles where we want them.
e( t ) x( t )
Ki
s------
Kp
Ki
s------
0
t
8
Closed-Loop with PI and 1st-ord Plant
Suppose Gp( s ) = and Gc( s ) = Kp +
⇒ H( s ) = =
⇒ a 2nd-order system with steady-state step response H0 = 1:
How to choose the parameters {Kp, Ki}?
to get desired overshoot
to get desired settling time, etc.
bs a+-------------
Ki
s------
GG1 GG+-------------------
Kps Ki+ bs s a+ Kps Ki+ b+--------------------------------------------------------------
H0 = 1 PERFECT TRACKING!
9
PI Analysis
H( s ) = = .
Three equivalent questions:
How to choose the parameters {Kp, Ki}?
How to choose the parameters {, n}?
Where to place the poles?
A common strategy: Start with a desired settling time, and desired overshoot:
Choose Kp to get desired settling time ts ≈
Choose Ki = to get desired overshoot
Kp s Ki+ bs2 a P0aKp+ s Ki b+ +------------------------------------------------------------------ Kps Ki+ b
s2 2n s n2+ +
----------------------------------------------
4
n
----------
16
b2ts2---------------
10
Relationships2n = a + bKp
n2 = Kib
⇒ can solve for Ki and Kp as a function of desired n and
11
Example
Gp( s ) = and Gc( s ) = Kp +
Find Kp and Ki so that settling time is ts = 0.5 sec, and overshoot is 4.2%.
4s 3+-------------
Ki
s------
12
Solution
H( s ) = =
1. equate coeffs of s1:
2n = 3 + 4Kp ⇒ Kp = (2n – 3) = ( – 3) = .
2. Equate coeffs of s0, using fact that 4.2% overshoot means that = 0.707:
n2 = 4Ki ⇒ Ki = n
2 = = = .
4 Kp s Ki+ s2 3 4Kp+ s 4Ki+ +-------------------------------------------------------- 4 Kps Ki+
s2 2n s n2+ +
--------------------------------------------
14--- 1
4--- 8ts---- Kp = 3.25
14--- 1
4--- 4
ts--------
2 14--- 4
0.707 0.5 ------------------------------- 2 Ki = 32
13
A Linear Amplifier
-4 -2 2 4
-10
10y( t )
x( t )
y( t ) = 10x( t )
14
A Nonlinear Amplifier
How to get both linear behavior and large outputs?
10tanh( )x( t ) y( t )
-4 -2 2 4
-10
10y( t )
x( t )
A memoryless system that is ≈linear for small inputs (less than ±0.3),amplifying by a factor of 10, yielding small outputs (less than ±3):
15
Open Loop Options
2 4 6 8 10
-10
10 r( t )
t
OPEN 1
LARGE, BUT NOT LINEAR
16
Open Loop Options
OPEN 1
2 4 6 8 10
-10
10 r( t )
OPEN 2
t
LINEAR, BUT NOT LARGE
17
Linearize it using Integral Controller:Ki
r( t ) e( t ) y( t )
+
–
x( t )
s
18
Linearize it using Integral Controller:
OPEN 2
OPEN 1
Kir( t ) e( t ) y( t )
+
–
x( t )
2 4 6 8 10
-10
10 r( t )
t
y( t )(CLOSED)
(Ki = 100)
s
19
Scatter Plots
-1 1
-10
10 CLOSED
OPEN 1
OPEN 2
LOOP
20
Examples of Controllers
Gc( s )R( s ) E( s ) Y( s )
+
–
Gp( s )
PPIPDPID
Kp
Kp + Ki/s
Kp + Kds
Kp +Ki/s + Kds
Gc( s )
Also: On-Off control (not considered)
21
So FarFor a 2nd-order plant:
• P control: imperfect tracking, oscillations & overshoot
• PI control: perfect tracking, oscillations & overshoot
22
Error Prediction?
⇒ PD controller: Gc( s ) = Kp + Kds ... it predicts errors
⇒ input to plant is x( t ) = Kpe( t ) +Kd e( t )
Impact on performance:
reduces overshoot
dampens oscillations
t
t + T
e( t ) TIME
e(t + T ) ≈ e( t ) + T e( t )ddt-----
Linear extrapolation:
ddt-----
23
PD Control: 1st-Order Plant
⇒ H( s ) = =
⇒ a 1st-order system with steady-state step response H0 = :
r( t ) y( t )
+
–
bs + a
Kp + Kds
GcGp
1 GcGp+-----------------------
Kp Kds+ bs a b Kp Kds+ + +---------------------------------------------------
1
1 1KP0
-----------+------------------
1
H0
0 t
STEADY-STATE TRACKING ERROR
24
Proportional-Integral-Derivative (PID) Control
Gc( s ) = Kp + + Kds
⇒ input to plant is x( t ) = Kpe( t ) +Ki e( )d + Kd e( t )
Ki
s------
0
t
ddt-----
25
PID Control: 1st-Order Plant
What is order of closed-loop system?
Is there any steady-state tracking error?
r( t ) y( t )
+
–
bs + a
Kp + Ki/s + Kds
26
PID Tuning Not Easy: Trial & Error!Heuristic strategies common, e.g.:
• Set Ki = Kd = 0
• Increase Kp until oscillates; back off 50%
• Increase Ki to get good steady-state tracking, overshoot OK
• Increase Kd to reduce overshoot, damp oscillations
27
Impact of Increasing Gains
28
PID Demohttps://goo.gl/tF881V
29
Example: Move to Desired Position
x( t )
y( t )
k
mINPUT
OUTPUT
yd DESIRED POSITION
30
Example
x( t )
y( t )
k
mINPUT
OUTPUT
yd
e( t ) ERROR
DESIRED POSITION
CONTROLLER
FEEDBACKCONTROL
31
Example
x( t )
y( t )
my..
= k(x – y)
k
mINPUT
OUTPUT
⇒ Gp( s ) = 02
s2 +02
where 0 = k/m
yd
e( t ) ERROR
DESIRED POSITION
CONTROLLER
32
Equivalent Block Diagram
What controller will both stabilize and provide perfect tracking?
• P control? No, not stable. Merely shifts resonance freq.
• PI? No, not stable. (Missing s2 term in denom ⇒ pole on j axis.)
• PD? It stabilizes, but with tracking error: H0 = .
• PID?
r( t ) = yd y( t )+
–
Gc( s )02
s2+02
11 1/Kp+-----------------------
33
Does P Control Stabilize and Track?
34
Does PI Control Stabilize and Track?
35
Does PD Control Stabilize and Track?
36
Does PID Control Stabilize and Track?
37
PID Does it All
H( s ) = =
=
= .
We have enough degrees of freedom (three “knobs”) to stabilize system.
And with perfect tracking(!):
H0 = = 1
GG1 GG+-------------------
Kp Ki/s Kds+ + 0
2
s2 02+
-------------------
1 ...+---------------------------------------------------------------------
Kps Ki Kds2+ + 0
2
s s2 02+ Kps Ki Kds
2+ + 02+
------------------------------------------------------------------------------------------
Kps Ki Kds2+ +
s3/02 Kds
2 1 Kp+ s Ki+ + +---------------------------------------------------------------------------------
Ki
Ki
------
38
Example: w0 = 2, Kp = Ki = 10, Kd = 1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50
0.2
0.4
0.6
0.8
1
1.2
TIME (s)
y( t )
39
Example: Electric Water HeaterA 10-V signal applied at time zero to an electric heating element in water leads to the following experimentally measured water temperature response:
Design a control system that “settles” water as quickly as possible to 200°.
0 t
70°
100°89°
10 s
WATER TEMPERATURE