You are on page 1of 7

1

CSE 520S
Feedback Control Theory
-A Tutorial from Computer Systems Perspective
Guest Lecturer: Xiaorui Wang
Washington University in St. Louis
10/17/2005
2005-12-29 Control Tutorial -- Xiaorui Wang 2
Outline
Introduction
What is feedback control?
Why feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
2005-12-29 Control Tutorial -- Xiaorui Wang 3
What Is Feedback Control?
Definition
Applying input to cause the system variable to
conform to a desired value called the reference.
Everyday examples
Car cruise-control: gas input speed=60 mph
Air Conditioning: power input temperature = 80 F
2005-12-29 Control Tutorial -- Xiaorui Wang 4
Traditionally: Open-Loop Control
What if no cruise control is on your car?
Control the gas by looking at the speed meter?
You are the controller!
Open-loop
Dont look at the meter at all and try to maintain 60mph
Need to estimate everything accurately
Road friction, ramp slope, traffic condition
Precise computation to decide how much gas is necessary
Open-loop control fails because
We dont know everything
We make errors in estimation/modeling
Variations -- things change
2005-12-29 Control Tutorial -- Xiaorui Wang 5
Feedback (Closed-Loop) Control
Actuator
Monitor
Reference
60 mph
control
input
Controlled variable :
Car speed
Manipulated variable :
Gas
Cruise Control
System
+
-
error
control
function
Controller
sample
engine
revolution
2005-12-29 Control Tutorial -- Xiaorui Wang 6
Why Feedback Control in Computing Systems?
Robust Quality of Service (QoS) in
unpredictable environments
10 sec stock trade
guarantee!
Internet
Control # of customers?
Control # of web servers?
2
2005-12-29 Control Tutorial -- Xiaorui Wang 7
CPU Utilization Control in Real-Time Systems
Why CPU utilization control?
Overload protection
Real-time priorities > system
priority
Utilization100% Operating
system freezes
Meet deadlines for periodical
real-time tasks
CPU utilization < schedulable
threshold
meet all deadlines
Control method
Reference: CPU utilization = 70%
Actuation: Task period
Task 1 (30%)
Task 2 (20%)
Task 3 (30%)
Ref:
70%
CPU utilization in a
real-time server
100%
CPU utilization of each task
period task
time execution
=
2005-12-29 Control Tutorial -- Xiaorui Wang 8
Heuristics Based Control???
Utilization >70% uincrease task period? How much???
Too little slow convergence; Too large oscillation
How to find the best parameters?
By exhaustively testing all possible values???
How often do we see this kind of papers?
No confidence in face of untested environments
Is it still the best parameter for a different processor?
Parameter K =2000 Parameter K =100000 Best parameter K =8000
What about 7000, 9000?
2005-12-29 Control Tutorial -- Xiaorui Wang 9
Advantages of Feedback Control Theory
A science with over 100 years of history
Has been successfully applied in all engineering fields
Car cruise control, air conditioning and more
Why feedback control theory?
Best way to design control loops
Well-established algorithms to choose control parameters
Guaranteed stability
Control design based on requirements
steady state error, settling time
Quantitative way to analyze the impact of system variation on
control performance
2005-12-29 Control Tutorial -- Xiaorui Wang 10
Outline
Introduction
What is feedback control?
Why feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
2005-12-29 Control Tutorial -- Xiaorui Wang 11
Control Design Methodology
System Model
Performance
Specifications
Control
Algorithm
Control
Algorithm
Modeling
Modeling
Controller
Design
Controller
Design
Requirement
Analysis
Requirement
Analysis
1
2
3 4
2005-12-29 Control Tutorial -- Xiaorui Wang 12
CPU Utilization Modeling
CPU utilization is the sum of the
utilizations of all tasks
In the k
th
time period
The differential utilization
model
new = old + change
period task
time execution
=
Task 1
Task 2
Task 3
70%
CPU utilization in a
real-time server
100%
CPU utilization of task i
(k) u (k) u (k) u u(k)
T3 T2 T1
+ + =
(k) (k)r e (k) (k)r e (k) (k)r e
3 3 2 2 1 1
+ + =
i i
r e
rate task time execution
=
=
1) - u(k 1) - u(k u(k) + =
1) - (k r 1) - (k e 1) - (k r 1) - (k e
1) - (k r 1) - (k e 1) - u(k
3 3 2 2
1 1
+ +
+ =
3
2005-12-29 Control Tutorial -- Xiaorui Wang 13
Possible Variation in Execution Times
Real task execution times differ from their
estimations in a ratio G:
Running on a different processor
Execution times are influenced by external inputs
1)) - (k r e 1) - (k r e 1) - (k r G(e 1) - u(k u(k)
3 3 2 2 1 1
+ + + =
1) - (k r 1) - (k e 1) - (k r 1) - (k e 1) - (k r 1) - (k e 1) - u(k u(k)
3 3 2 2 1 1
+ + + =
1) - d(k
i i
Ge (k) e =
1) - Gd(k 1) - u(k u(k) + = System model:
Assuming all execution times vary uniformly
2005-12-29 Control Tutorial -- Xiaorui Wang 14
Z-Transforms and Transfer Function
Why Z-transforms?
Easier control analysis
Stability, steady-state error
Simpler manipulation
Time series (i.e. k, k-1, k-2) -> multiplication
How to transform to Z-domain
1) - Gd(k 1) - u(k u(k) + =
GD(z) z U(z) z U(z)
-1 -1
+ =
D(z) z 1) - d(k U(z); z 1) - u(k U(z); u(k)
-1 -1

1 - z
G
D(z)
U(z)
=
Transfer
function:
Transfer function describes how the input
D(z) is transformed into the output U(z)
System model:
Z-transform
2005-12-29 Control Tutorial -- Xiaorui Wang 15
Open Loop Block Diagram
A pictorial tool to represent a system based
on transfer functions and signal flows
D(z) U(z) G/(z-1)
1 - z
G
D(z)
U(z)
=
Transfer
function:
system output input
2005-12-29 Control Tutorial -- Xiaorui Wang 16
Control Design Methodology
System Model
Performance
Specifications
Control
Algorithm
Control
Algorithm
Modeling
Modeling
Controller
Design
Controller
Design
Requirement
Analysis
Requirement
Analysis
1
2
3 4
2005-12-29 Control Tutorial -- Xiaorui Wang 17
Design Goals
Performance Specifications
Settling time
Overshoot
Controlled
Variable
(Utilization)
Time
Reference
(70% CPU
utilization)
%
Steady State Transient State
Steady state error
Unstable
system:
2%
2005-12-29 Control Tutorial -- Xiaorui Wang 18
Performance Specs
Steady-State Error
Steady state error of a CPU-utilization control system
U(t)
e
ss
=-20%
U
s
4
2005-12-29 Control Tutorial -- Xiaorui Wang 19
Example: Control & Response in an
Email Server (IBM)
Control
(MaxUsers)
Response
(queue length)
Good
Slow
Bad
Useless
2005-12-29 Control Tutorial -- Xiaorui Wang 20
Controller Design Requirements
Stability
Zero steady state error
Short settling time
Robust to variations
2005-12-29 Control Tutorial -- Xiaorui Wang 21
Control Design Methodology
System Model
Performance
Specifications
Control
Algorithm
Control
Algorithm
Modeling
Modeling
Controller
Design
Controller
Design
Requirement
Analysis
Requirement
Analysis
1
2
3 4
2005-12-29 Control Tutorial -- Xiaorui Wang 22
Close the Loop Closed Loop Block Diagram
Open loop diagram
Closed loop diagram
D(z) U(z) G/(z-1)
1 - z
G
D(z)
U(z)
=
Transfer
function:
system output input
D(z)
U(z)
G/(z-1) C(z) U
s
(z) +
_
U
s
(z)-U(z)
2005-12-29 Control Tutorial -- Xiaorui Wang 23
Closed-Loop Transfer Function
Standard equation
Deriving directly from the block diagram
GC(z)U(z) 1)U(z) - (z (z) GC(z)U
s
+ =
D(z)
U(z)
G/(z-1) C(z) U
s
(z) +
_
U
s
(z)-U(z)
GC(z)) - (1 - z
GC(z)
(z) U
U(z)
s
=
U(z)
1 - z
G
U(z))C(z) - (z) (U
s
=
Closed-loop
transfer function:
1 z
G
S(z) where ;
C(z)S(z) 1
C(z)S(z)
(z) U
U(z)
s

=
+
=
2005-12-29 Control Tutorial -- Xiaorui Wang 24
Controller Design - PID Control
Proportional-Integral-Derivative (PID) Control
z
z K
z C k e k e K k d
) 1 (
) ( )) 1 ( ) ( ( ) (

= =
K z C k Ke k u U K k d
s
= = = ) ( ) ( )) ( ( ) (
1
) ( ) ( ) 1 ( ) (

= + =
z
Kz
z C k Ke k d k d
Proportional control
(Look at now)
Integral control
(Look at the past)
Derivative control
(Predict the future)
Combination of P, I, D controllers: PI, PD, PID controllers
D(z)
U(z)
G/(z-1) C(z) U
s
(z) +
_
U
s
(z)-U(z)
5
2005-12-29 Control Tutorial -- Xiaorui Wang 25
Proportional Controller
Is the closed-loop system stable?
What is the steady state error?
D(z)
U(z)
G/(z-1) K U
s
(z) +
_
U
s
(z)-U(z)
GC(z)) - (1 - z
GC(z)
(z) U
U(z)
s
=
Closed-loop
transfer function: GK) - (1 - z
GK
=
2005-12-29 Control Tutorial -- Xiaorui Wang 26
Stability
Poles: Values of z for which the denominator is 0
Determine stability
Major effect on settling time, overshoot
Dominant pole
Pole with the largest magnitude
Determines the transient response
(z) U
U(z)
s
Closed-loop
transfer function: GK) - (1 - z
GK
=
Pole: 1-GK
|1-GK| < 1 e 0 < K < 2/G
G: the ratio between real execution
time and estimated execution time
i i
Ge (k) e =
To guarantee stability, derive the worst case G
A
= MAX{G(k)} by
system experiments and select K to guarantee 0 < K < 2/G
A
2005-12-29 Control Tutorial -- Xiaorui Wang 27
Effect of Poles
Re(z)
Im(z)
1.0 1.0
|z|=1
Longer settling time
Re(s)
Im(s)
Unstable
Stable
Higher-frequency
response
2005-12-29 Control Tutorial -- Xiaorui Wang 28
Steady State Error
Steady state (tracking) error of a stable system
)) ( ( lim ) ( lim k u U k e e
s
k k
ss
= =

U
s
is the desired utilization, u(k) is the real utilization.
How accurately can a system achieve the desired state?
Final value theorem: if all poles of the system are inside the
unit circle, then
) ( ) 1 ( lim ) ( lim
1
z U z k u
z k
=

(z) U
U(z)
s
Closed-loop
transfer function:
s s
U
1 - z
z
(z) U where ,
GK) - (1 - z
GK
= =
s s
z z
U
GK z
GK
U
z
z
z z U z =

=

) 1 ( 1
) 1 ( lim ) ( ) 1 ( lim
1 1
Zero steady state error no matter what G and K are!!
2005-12-29 Control Tutorial -- Xiaorui Wang 29
Final Control Algorithm
G
A
=0.447, K is selected as 0.185 to guarantee stability
Settling time can be calculated based on K and G
A
Control algorithm
FC-U (Us, K) {
// Monitor
U = utilization in the last sampling period;
// Controller
E = Us U;
D = K*E; //the P controller
// Actuator
AdjustTaskRate(D);
}
2005-12-29 Control Tutorial -- Xiaorui Wang 30
Empirical Results on a Linux System
0.00
0.10
0.20
0.30
0.40
0.50
0.60
0.70
0.80
0.90
1.00
0 50 100 150 200 250 300 350 400
Time (4sec)
U(k)
B(k)
M(k)
Same CPU utilization and zero deadline misses despite
changes in execution times
0.00
0.10
0.20
0.30
0.40
0.50
0.60
0.70
0.80
0.90
1.00
0 50 100 150 200 250 300 350 400
Time (4sec)
U(k)
M(k)
Open-loop system Closed-loop system
6
2005-12-29 Control Tutorial -- Xiaorui Wang 31
Outline
Introduction
What is feedback control?
Why feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
2005-12-29 Control Tutorial -- Xiaorui Wang 32
Controller Design - Summary
PID control: simple, works well in many systems
P control: may have non-zero steady-state error
I control: improves steady-state tracking
D control: may improve stability & transient response
PI, PD, PID: combines the advantages of P, I, D
2005-12-29 Control Tutorial -- Xiaorui Wang 33
Overview of Some Common Control Techniques
Distributed peer-to-
peer control; scalable;
fault-tolerant
DMPC MIMO Distributed Model
Predictive Control
(DEUCON)
Deal with actuation
constraints naturally
MPC MIMO Model Predictive
Control (EUCON)
Outer loop controls the
set point of inner loop
Cascade
control
Automatically optimize
the model parameters
Adaptive
control
Advanced PID
control
Advanced
control
PID
PI/PD/I
Capture the interaction
between multi control
variables
P MIMO (multi-input
multi-output)
(SIMO, MISO)
control
PID
Better control
performance for higher
order systems
PI/PD/I
Utilization control P SISO control Classical
control
(PID control)
Proportional-
Integral-
Derivative
2005-12-29 Control Tutorial -- Xiaorui Wang 34
More Control Topics
System modeling
System Identification
For computing systems where analytical model is too hard to build
Other control techniques
Robust Control: Handle modeling errors
Stochastic Control: Controller minimizes variance
Hybrid control: Finite number of possible control input
Nonlinear systems: Neuro-fuzzy control
Output 1
Y1(k)
Output 2
Y2(k)
Systeminput
U(k)
[ ] 1) - U(k
1) - Y2(k
1) - Y1(k
Y2(k)
Y1(k)
B A +

Target system
2005-12-29 Control Tutorial -- Xiaorui Wang 35
An Emerging Field
Computer Systems
Real-time scheduling
Real-time embedded middleware
Internet servers: web server, proxy, E-mail server
Internet routers
Storage systems
Teams
Caltech
IBM T J Watson
Lund @ Sweden
UIUC
University of Virginia
Washington University

2005-12-29 Control Tutorial -- Xiaorui Wang 36
Conclusion
Software Performance Control
Promising empirical results on a variety of
computing systems
An emerging field of interdisciplinary research
Many open questions and opportunities
7
2005-12-29 Control Tutorial -- Xiaorui Wang 37
Questions?
Yingming will give more details in the design of
other FCS algorithms in next week
Recommended control textbook
Feedback Control of Computing
Systems,
by Joseph L. Hellerstein, Yixin Diao,
Sujay Parekh, Dawn M. Tilbury,
Wiley-IEEE Press,
August, 2004
2005-12-29 Control Tutorial -- Xiaorui Wang 38
Acknowledgement
Some slides are copied from Dr. Chenyang Lus control tutorial
slides in 2003.
Some slides are copied from An Introduction to Control Theory
and Its Application to Computer Science and Feedback Control
of Computing System by Joe Hellerstein, Sujay Parekh.