You are on page 1of 52

Feedback Control Theory

a Computer 8ystem's Perspective


Chenyang Lu
Department of Computer Science
University of virginia
chenyang@cs.virginia.edu
http://www.cs.virginia.edu/~cl7v
utline
ntroduction
What is feedback control?
Why do computer systems need feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
Control
pplying input to cause system variables to
conform to desired values called the reference.
Cruisecontrol car: f_engine(t)=? speed=60 mph
Ecommerce server: Resource allocation? T_response=S sec
Embedded networks: Flow rate? Delay = 1 sec
Computer systems: QoS guarantees
pen-loop control
Compute control input without continuous variable
measurement
Simple
Need to know EvERYTH!NC ACCURATELY to work right
Cruisecontrol car: friction(t), ramp_angle(t)
Ecommerce server: Workload (request arrival rate? resource
consumption?), system (service time? failures?)
Openloop control fails when
We don't know everything
We make errors in estimation/modeling
Things change
Feedback {close-loop_ Control
Actuator
Monitor
reIerence
control
input
controlled
variable
manipulated
variable
ontrolled System
+
-
error
control
Iunction
ontroller
sample
Feedback {close-loop_ Control
easure variables and use it to compute control input
ore complicated (so we need control theory)
Continuously measure S correct
Cruisecontrol car: measure speed S change engine force
Ecommerce server: measure response time S admission control
Embedded network: measure collision S change backoff window
Feedback control theory makes it possible to control well
even if
We don't know everything
We make errors in estimation/modeling
Things change
hy feedback control?
pen, unpredictable environments
Deeply embedded networks: interaction with
physical environments
Number of working nodes
Number of interesting events
Number of hops
Connectivity
vailable bandwidth
Congested area
nternet: Ebusiness, online stock broker
Unpredictable offtheshelf hardware
hy feedback control?
e want Oo8 guarantees
Deeply embedded networks
Update intruder position every 30 sec
Report fire <= 1 min
Ebusiness server
Purchase completion time <= S sec
Throughput >= 1000 transaction/sec
The problem: provide QoS guarantees in
open, unpredictable environments
dvantage of feedback
control theory
daptive resource management heuristics
Laborious design/tuning/testing iterations
Not enough confidence in face of untested workload
Queuing theory
Doesn't handle feedbacks
Not good at characterizing transient behavior in
overload
Feedback control theory
Systematic theoretical approach for analysis and design
Predict system response and stability to input
utline
ntroduction
What is feedback control?
Why do today's computer systems need feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
Control design methodology
ontroller
Design
Root-Locus PI
ontrol
Requirement
Analysis
Modeling
analytical
system IDs
Dynamic model ontrol algorithm
Performance Specifications
Satisfy
8ystem Models
Linear vs. nonlinear (differential eqns)
eterministic vs. Stochastic
Timeinvariant vs. Timevarying
re coefficients functions of time?
Continuoustime vs. Discretetime
System D vs. First Principle
ynamic Model
Computer systems are dynamic
Current output depends on history"
Characterize relationships among system variables
- Differential equations (time domain)
) ( ) ( ) ( ) ( ) (
0 1 0 1 2
t u b t u b t y a t y a t y a
O O O O
- Transfer functions (frequency domain)
Y(s) = C(s)U(s)
2
2
1
1
0 1
2
2
0 1
) (
p s
c
p s
c
a s a s a
b s b
s G

- Block diagram (pictorial)


C(s)
R(s)
Y(s)

C(s)
ample
Utilization control in a video server
Periodic task T
i
corresponding to each video stream i
c|i]: processing time, p|i]: period
Stream i's requested CPU utilization: u|i]=c|i]/p|i]
Total CPU utilization: U(t)=%
<k}
u|k], <k} is the set of
active streams
Completion rate: R
c
(t)= (%
<kc}
u|m])/t, where <m} is
the set of terminated video streams during |t, t+t]
Unknown
dmission rate: R
a
(t)= (%
<ka}
u|j])/t, where <j} is the
set of admitted streams during |t, t+t]
Problem: design an admission controller to guarantee
U(t)=U
s
regardless of R
c
(t)
Model
ifferential equation
&(t)
R
a
(t)
C?
&
s

CPU
R
c
(t)
- odel (differential equation):


t
c a
d R R t U
0
)) ( ) ( ( ) (
:
: : :
- Error: E(t)=U
s
U(t)
- Controller C? E(t) R
a
(t)
Three ways of system modeling
iverge to Math
8ystem representations
u(t)
g(t) y(t)

t
d u t g t u t g t y
0
) ( ) ( ) ( * ) ( ) ( : : :
- Time domain: convolution, differential equations.
U(s) C(s) Y(s)
) ( ) ( ) ( s U s G s Y
- s (frequency) domain: multiplication
s-domain is a simple & powerIul 'language Ior control analysis
- Block diagram: pictorial
Laplace transform of a signal f(t)
iverge to Math
Laplace transform


0
) ( )| ( | ) ( dt e t f t f L s F
st
where s=9+i is a complex variable.
- Laplace transform is a translation from timedomain to
sdomain
- Differential equation Polynomial function
) ( ) ( ) ( ) ( ) (
0 1 0 1 2
t u b t u b t y a t y a t y a
O O O O
) ( ) (
0 1
2
2
0 1
s U
a s a s a
b s b
s Y O


Basic translations
mpulse function f(t)=0(t) F(s)=1
Step signal f(t)=a-1(t) F(s)=1/s
Ramp signal f(t)=a-t F(s)=a/s
2
Exp signal f(t)=e
at
F(s)=1/(sa)
Sinusoid signal f(t)=sin(at) F(s)=a/(s
2
+a
2
)
Composition rules
Linearity L|af(t)+bg(t)] = aL|f(t)]+bL|g(t)]
Differentiation L|df(t)/dt] = sF(s) - f(0

)
ntegration L|
t
f(:)d:] = F(s)/s
iverge to Math
Laplace transform
iverge to Math
Transfer function
odeling a linear timeinvariant (LT)
system
C(s) = Y(s)/U(s) Y(s) = C(s)U(s)
U(s) C(s) Y(s)
2
2
1
1
0 1
2
2
0 1
) (
p s
c
p s
c
a s a s a
b s b
s G

E.g., a second order system with poles p


1
and p
2
iverge to Math
Poles and Zeros
The response of a linear timeinvariant (LT) system

"
"

t p

3
3

3
3
3
3
2
2
2
2

e C t f
p s
C
p s
C
p s
C
p s
: s
K
a s a s a
b s b s b
s F
1
2
2
1
1
1
1
0
1
1
0
1
1
) (
...
) (
) (
...
...
) (
<p
i
} are poles of the function and decide the system behavior
iverge to Math
Time response vs. pole location
-f'(t) = e
pt
, p = a+bj
Unstable Stable
iverge to Math
Block diagram
pictorial tool to represent a system based on transfer
functions and signal flows
Represent a feedback control system
C(s)
R(s)
Y(s)

C
o
(s)
R(s) Y(s) C
c
(s)
) ( ) ( ) (
) ( ) ( 1
) ( ) (
s R s G s Y
s G s C
s G s C
G
c
o
o
c

Back to
ur utilization control eample
&(t)
R
a
(t)
C?
&
s

CPU
R
c
(t)
- odel (differential equation):


t
c a
d R R t U
0
)) ( ) ( ( ) (
:
: : :
- Error: E(t)=U
s
U(t)
- Controller C? E(t) R
a
(t)
Model
Transfer func. & block diag.
nputs: reference U
s
(s) = U
s
/s, completion rate R
c
(s)
Closeloop system transfer functions
U
s
(s) as input: C
1
(s) = C(s)C
o
(s)/(1+C(s)C
o
(s))
R
c
(s) as input: C
2
(s) = C
o
(s)/(1+C(s)C
o
(s))
Output: U(s)=C
1
(s)U
s
/s+C
2
(s)R
c
(s)
s
s G
s
s R s R
s U d R R t U
o
a a
t
c a
1
) (
) ( ) (
) ( )) ( ) ( ( ) (
0


:
: : :
- CPU is modeled as an integrator
R
c
(s)
C
o
U
s
/s
R
a
(s)
U(s)
C(s)
Control design methodology
ontroller
Design
Root-Locus PI
ontrol
Requirement
Analysis
Modeling
analytical
system IDs
Dynamic model ontrol algorithm
Performance Specifications
Satisfy
esign Goals
Performance 8pecifications
Stability
Transient response
Steadystate error
Robustness
Disturbance rejection
Sensitivity
Performance 8pecs
8tability
BBO stability: bounded input results in bounded output.
LT system is BBO stable if all poles of its transfer function
are in the LHP (p
i
, Re|p
i
]<0).
0 | Re| :
) (
...
) (
) (
) ( ) ( ) (
1
2
2
1
1
1
1
C P P F P

"
"

C F

t
t p

t p

3
3

p f e C Note
e C t y
p s
C
p s
C
p s
C
p s
: s
K s U s G s Y

Performance 8pecs
8tability
Unstable Stable
Performance specifications
Settling time
Overshoot
ontrolled
variable
Time
Reference
I1
Steady State Transient State
Steady state error
ample: Control & Response
in an mail 8erver {BM_
Control
(axUsers)
Response
(queue length)
Cood
Slow
Bad
Useless
Performance 8pecs
8teady-state error
Steady state (tracking) error of a stable system
)) ( ) ( ( lim ) ( lim t y t r t e e
t t
ss

C F C F
r(t) is the reference input, y(t) is the system output.
- How accurately can a system achieve the desired state?
- Final value theorem: if all poles of sF(s) are in the open lefthalf
of the splane, then
) ( lim ) ( lim
0
s sF t f
s t F C F

- Easy to evaluate system long term behavior without solving it


) ( lim ) ( lim
0
s sE t e e
s t
ss
F C F

Performance 8pecs
8teady-state error
$teady state error oI a CP&-utilization control system
U(t)
e
ss
=20
U
s
Performance 8pecs
Robustness
Disturbance rejection: steadystate error caused by
external disturbances
Can a system track the reference input despite of external
disturbances?
Denialofservice attacks
Sensitivity: relative change in steadystate output
divided by the relative change of a system parameter
Can a system track the reference input despite of variations in
the system?
ncreased task execution times
Device failures
Performance 8pecs
Goal of Feedback Control
Cuarantee stability
mprove transient response
Short settling time
Small overshoot
Small steady state error
mprove robustness wrt uncertainties
Disturbance rejection
Low sensitivity
Control design methodology
ontroller
Design
Root-Locus
PID ontrol
Requirement
Analysis
Modeling
analytical
system IDs
Dynamic model ontrol algorithm
Performance Specifications
Satisfy
Controller esign
P control
ProportionalntegralDerivative (PD) Control
C(s)
R(s)
Y(s)

C
o
(s)
E(s) X(s)
s KK s C t e KK t x
d d

O
) ( ) ( ) (
K s C t Ke t x ) ( ) ( ) (
s
KK
s C d e KK t x

t

) ( ) ( ) (
0
: :
- Proportional Control
- ntegral control
- Derivative control
- Classical controllers with wellstudied properties and tuning rules
Controller esign
CPU Utilization Control
nputs: setpoint U
s
(s) = U
s
/s, task completion R
c
(s)
Closeloop system transfer functions
U
s
(s) as input: C
1
(s) = C(s)C
o
(s)/(1+C(s)C
o
(s))
R
c
(s) as input: C
2
(s) = C
o
(s)/(1+C(s)C
o
(s))
C(s)=? to achieve zero steadystate error: U(t) F U
s
s
s G
s
s R s R
s U d R R t U
o
a a
t
c a
1
) (
) ( ) (
) ( )) ( ) ( ( ) (
0


:
: : :
- CPU is modeled as an integrator
R
c
(s)
C
o
U
s
/s
R
a
(s)
U(s)
C(s)
Proportional Control
8tability
Proportional Controller
r
a
(t)=Ke(t), C(s) = K
Transfer functions
U
s
/s as input: C
1
(s) = K/(s+K)
R
c
(s) as input: C
2
(s) = 1/(s+K)
Stability
Pole p
0
= K<0 System is BBO stable iff K>0
Note: System may shoot to 100 if K<0!
R
c
(s)
C
o
U
s
/s
R
a
(s)
U(s)
C(s)
Proportional Control
8teady-state error
ssume completion rate R
c
(t) keeps constant for a time
period longer than the settling time: R
c
(s)=R
c
/s
System response is
) (
) ( ) (
) (
2 1
K s s
R KU
s
s G R
s
s G U
s U
c s c s


- Compute steadystate err using final value theorem,
0 lim ) ( lim ) ( lim
0 0


F F C F
K
R
e
K
R
U
K s
R KU
s sU t U
c
ss
c
s
c s
s s t
- Pcontrol cannot achieve the desired CPU utilization U
s
, instead
it will end up lower by R
c
/K Oops!
- The larger the proportional gain K is, the closer will CPU
utilization approach to U
s
CPU Utilization
Proportional Control
U(t)
e
ss
=20
U
s
Proportional-ntegral Control
8tability
Proportional Controller
r
a
(t)=K(e(t)+K
i
-
t
e(:)d:) C(s) = K(1+K
i
/s)
Transfer functions
U
s
/s as input: C
1
(s) = (Ks+KK
i
)/(s
2
+Ks+KK
i
)
R
c
(s) as input: C
2
(s) = s/(s
2
+Ks+KK
i
)
Stability
Poles Re|p
0
]<0, Re|p
0
]<0
System is BBO stable iff K>0 S K
i
>0
R
c
(s)
C
o
U
s
/s
R
a
(s)
U(s)
C(s)
Proportional Control
8teady-state error
ssume completion rate R
c
(t) keeps constant for a time
period longer than the settling time: R
c
(s)=R
c
/s
System response is
- Compute steadystate err using final value theorem,
- P control can accurately achieve the desired CPU utilization U
s
b
- Control analysis gives design guidance
) (
) ( ) ( ) (
) (
2
2 1

s c s c s
KK Ks s s
U KK s R KU
s
s G R
s
s G U
s U



0
) (
lim ) ( lim ) ( lim
2
0 0




F F C F
ss s

s c s
s s t
e U
KK Ks s
U KK s R KU
s sU t U
CPU Utilization
Proportional-ntegral Control
U(t)
e
ss
=0
t
s
t
r
t
p

p
=
0 U
s
Controller esign
8ummary & pointers
PD control: simple, works well in many systems
P control: may have nonzero steadystate error
control: improves steadystate tracking
D control: may improve stability S transient response
Linear continuous time control
Rootlocus design
Frequencyresponse design
Statespace design
C. F. Franklin et. al., Feedback control of dynamic systems
iscrete Control
ore useful for computer systems
Time is discrete, sampled system
denoted k instead of t
ain tool is ztransform
f(k) FF(:) , where : is complex
nalogous to Laplace transform for sdomain


0
) ( ) ( )| ( |
k
k
: k f : F k f
iscrete Modeling
Difference equation
v(m) = a
1
v(m1) + a
2
v(m2) + b
1
U(m1) + b
2
U(m2)
z domain: v(z) = a
1
z
1
v(z) + a
2
z
2
v(z) + b
1
z
1
U(z) + b
2
z
2
U(z)
Transfer function C(z) = (b
1
z + b
2
)/(z
2
a
1
z a
2
)
v(m): output in m
th
sampling window
U(m): input in m
th
sampling window
Order n: #samplingperiods in history affects current
performance
SP = 30 sec, and n = 2 Current system performance
depends on previous 60 sec
Root Locus analysis of
iscrete 8ystems
Stability boundary: :1 (Unit circle)
Settling time = distance from Origin
Speed = location relative to m axis
Right half = slower
Left half = faster
ffect of discrete poles
:1
Longer settling time
Re(s)
I2(s)
Unstable
Stable
Higherfrequency
response
Ts
e : : ntuition
Feedback control works in C8
U.ass: network flow controllers (TCP/P - RED)
B: Lotus Notes admission control
UUC: Distributed visual tracking
Uv
Web Caching QoS
pache Web Server QoS differentiation
ctive queue management in networks
Processor thermal control
Online data migration in network storage (with HP)
Realtime embedded networking
Control middleware
Feedback control realtime scheduling
dvanced Control Topics
Robust Control
Can the system tolerate noise?
daptive Control
Controller changes over time (adapts)
O Control
ultiple inputs and/or outputs
Stochastic Control
Controller minimizes variance
Optimal Control
Controller minimizes a cost function of error and control energy
Nonlinear systems
Neurofuzzy control
Challenging to derive analytic results
ssues for Computer
8cience
ost systems are nonlinear
But linear approximations may do
eg, fluid approximations
Firstprinciples modeling is difficult
Use empirical techniques
apping control objectives to feedback control
loops
ControlWare paper
Deeply embedded networking
assively decentralized control problem
odelling
Node failures
cknowledgements
Uv
ack Stankovic
Tarek F. bdelzaher
Sang H. Son
Cang Tao
HP Labs
Cuillermo lvarez
B T Watson
oseph Hellerstein
Sujay Parekh

You might also like