CSE 520S
Feedback Control Theory
A Tutorial from Computer Systems Perspective
Guest Lecturer: Xiaorui Wang
Washington University in St. Louis
10/17/2005
20051229 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
20051229 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 cruisecontrol: gas input speed=60 mph
Air Conditioning: power input temperature = 80 F
20051229 Control Tutorial  Xiaorui Wang 4
Traditionally: OpenLoop Control
What if no cruise control is on your car?
Control the gas by looking at the speed meter?
You are the controller!
Openloop
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
Openloop control fails because
We dont know everything
We make errors in estimation/modeling
Variations  things change
20051229 Control Tutorial  Xiaorui Wang 5
Feedback (ClosedLoop) 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
20051229 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
20051229 Control Tutorial  Xiaorui Wang 7
CPU Utilization Control in RealTime Systems
Why CPU utilization control?
Overload protection
Realtime priorities > system
priority
Utilization100% Operating
system freezes
Meet deadlines for periodical
realtime 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
realtime server
100%
CPU utilization of each task
period task
time execution
=
20051229 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?
20051229 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
Wellestablished 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
20051229 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
20051229 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
20051229 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
realtime 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
20051229 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
20051229 Control Tutorial  Xiaorui Wang 14
ZTransforms and Transfer Function
Why Ztransforms?
Easier control analysis
Stability, steadystate error
Simpler manipulation
Time series (i.e. k, k1, k2) > multiplication
How to transform to Zdomain
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:
Ztransform
20051229 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/(z1)
1  z
G
D(z)
U(z)
=
Transfer
function:
system output input
20051229 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
20051229 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%
20051229 Control Tutorial  Xiaorui Wang 18
Performance Specs
SteadyState Error
Steady state error of a CPUutilization control system
U(t)
e
ss
=20%
U
s
4
20051229 Control Tutorial  Xiaorui Wang 19
Example: Control & Response in an
Email Server (IBM)
Control
(MaxUsers)
Response
(queue length)
Good
Slow
Bad
Useless
20051229 Control Tutorial  Xiaorui Wang 20
Controller Design Requirements
Stability
Zero steady state error
Short settling time
Robust to variations
20051229 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
20051229 Control Tutorial  Xiaorui Wang 22
Close the Loop Closed Loop Block Diagram
Open loop diagram
Closed loop diagram
D(z) U(z) G/(z1)
1  z
G
D(z)
U(z)
=
Transfer
function:
system output input
D(z)
U(z)
G/(z1) C(z) U
s
(z) +
_
U
s
(z)U(z)
20051229 Control Tutorial  Xiaorui Wang 23
ClosedLoop 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/(z1) 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
=
Closedloop
transfer function:
1 z
G
S(z) where ;
C(z)S(z) 1
C(z)S(z)
(z) U
U(z)
s
=
+
=
20051229 Control Tutorial  Xiaorui Wang 24
Controller Design  PID Control
ProportionalIntegralDerivative (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/(z1) C(z) U
s
(z) +
_
U
s
(z)U(z)
5
20051229 Control Tutorial  Xiaorui Wang 25
Proportional Controller
Is the closedloop system stable?
What is the steady state error?
D(z)
U(z)
G/(z1) K U
s
(z) +
_
U
s
(z)U(z)
GC(z))  (1  z
GC(z)
(z) U
U(z)
s
=
Closedloop
transfer function: GK)  (1  z
GK
=
20051229 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
Closedloop
transfer function: GK)  (1  z
GK
=
Pole: 1GK
1GK < 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
20051229 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
Higherfrequency
response
20051229 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
Closedloop
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!!
20051229 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
FCU (Us, K) {
// Monitor
U = utilization in the last sampling period;
// Controller
E = Us U;
D = K*E; //the P controller
// Actuator
AdjustTaskRate(D);
}
20051229 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)
Openloop system Closedloop system
6
20051229 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
20051229 Control Tutorial  Xiaorui Wang 32
Controller Design  Summary
PID control: simple, works well in many systems
P control: may have nonzero steadystate error
I control: improves steadystate tracking
D control: may improve stability & transient response
PI, PD, PID: combines the advantages of P, I, D
20051229 Control Tutorial  Xiaorui Wang 33
Overview of Some Common Control Techniques
Distributed peerto
peer control; scalable;
faulttolerant
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 (multiinput
multioutput)
(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
20051229 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: Neurofuzzy 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
20051229 Control Tutorial  Xiaorui Wang 35
An Emerging Field
Computer Systems
Realtime scheduling
Realtime embedded middleware
Internet servers: web server, proxy, Email server
Internet routers
Storage systems
Teams
Caltech
IBM T J Watson
Lund @ Sweden
UIUC
University of Virginia
Washington University
20051229 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
20051229 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,
WileyIEEE Press,
August, 2004
20051229 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.
Much more than documents.
Discover everything Scribd has to offer, including books and audiobooks from major publishers.
Cancel anytime.