Feedback Control Theory: A Computer System's Perspective
Feedback Control Theory: A Computer System's Perspective
Chenyang Lu
Department of Computer Science
University of Virginia
chenyang@cs.virginia.edu
http://www.cs.virginia.edu/~cl7v
Outline
Introduction
What is feedback control?
Why do computer systems need feedback control?
Control design methodology
System modeling
Performance specs/metrics
Controller design
Summary
Control
Controlled System
Controller
control manipulated
control Actuator
input variable
function
error
sample controlled
+ Monitor
- variable
reference
Feedback (close-loop) Control
Measure variables and use it to compute control input
More complicated (so we need control theory)
Continuously measure & correct
Cruise-control car: measure speed & change engine force
Ecommerce server: measure response time & admission control
Embedded network: measure collision & 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
Why feedback control?
Open, unpredictable environments
Controller
Modeling Design
analytical Dynamic model Root-Locus PI
Control algorithm
system IDs Control
Satisfy
Requirement
Performance Specifications
Analysis
System Models
• Error: E(t)=Us-U(t)
t
Ra(t)
- Us
C?
U(t)
CPU
Rc(t)
A Diverge to Math
System representations
F ( s ) L[ f (t )] f (t )e st
dt
0
Basic translations
Impulse function f(t)=(t) F(s)=1
Step signal f(t)=a•1(t) F(s)=1/s
Ramp signal f(t)=a•t F(s)=a/s2
Exp signal f(t)=eat F(s)=1/(s-a)
Sinusoid signal f(t)=sin(at) F(s)=a/(s2+a2)
Composition rules
Linearity L[af(t)+bg(t)] = aL[f(t)]+bL[g(t)]
Differentiation L[df(t)/dt] = sF(s) – f(0-)
Integration L[tf()d] = F(s)/s
A Diverge to Math
Transfer function
{pi} are poles of the function and decide the system behavior
A Diverge to Math
Time response vs. pole location
Stable Unstable
C ( s )Go ( s )
Gc
R(s) Gc(s) Y(s) 1 C ( s )Go ( s )
Y ( s ) Gc ( s ) R ( s )
Back to
Our utilization control example
• Error: E(t)=Us-U(t)
t
Ra(t)
- Us
C?
U(t)
CPU
Rc(t)
Model
Transfer func. & block diag.
Ra(s) Go
Us/s C(s) U(s)
Control design methodology
Controller
Modeling Design
analytical Dynamic model Root-Locus PI
Control algorithm
system IDs Control
Satisfy
Requirement
Performance Specifications
Analysis
Design Goals
Performance Specifications
Stability
Transient response
Steady-state error
Robustness
Disturbance rejection
Sensitivity
Performance Specs
Stability
im1 ( s zi ) C1 C2 Cn
Y ( s ) G ( s )U ( s ) K n ...
i 1 ( s pi ) s p1 s p2 s pn
n
y (t ) Ci e pi t
i 1
t
Note : Ci e pi t
if Re[ pi ] 0
Performance Specs
Stability
Stable Unstable
Performance specifications
Controlled
variable
Overshoot
Steady state error
%
Reference
Time
Settling time
Example: Control & Response
in an Email Server (IBM)
Response
(queue length)
Good
Control Bad
(MaxUsers)
Slow Useless
Performance Specs
Steady-state error
lim f (t ) lim sF ( s )
t s 0
Us
ess=-20%
Performance Specs
Robustness
Guarantee stability
Improve transient response
Short settling time
Small overshoot
Small steady state error
Improve robustness wrt uncertainties
Disturbance rejection
Low sensitivity
Control design methodology
Controller
Modeling Design
analytical Dynamic model Root-Locus
Control algorithm
system IDs PID Control
Satisfy
Requirement
Performance Specifications
Analysis
Controller Design
PID control
E(s) X(s)
R(s) C(s) Go(s) Y(s)
-
Controller Design
CPU Utilization Control
Ra(s) Go
Us/s C(s) U(s)
Proportional Control
Stability
Proportional Controller
ra(t)=Ke(t); C(s) = K
Transfer functions
Us/s as input: G1(s) = K/(s+K)
Rc(s) as input: G2(s) = 1/(s+K)
Stability
Pole p0 = -K<0 System is BIBO stable iff K>0
Note: System may shoot to 100% if K<0!
Rc(s)
Ra(s) Go
Us/s C(s) U(s)
Proportional Control
Steady-state error
Assume completion rate Rc(t) keeps constant for a time
period longer than the settling time: Rc(s)=Rc/s
System response is
U s G1 ( s ) Rc G2 ( s ) KU s Rc
U ( s)
s s s(s K )
• Compute steady-state err using final value theorem,
KU s Rc Rc Rc
limU (t ) lim sU ( s ) lim Us ess 0
t s 0 s 0 sK K K
• P-control cannot achieve the desired CPU utilization Us; instead
it will end up lower by Rc/K Oops!
• The larger the proportional gain K is, the closer will CPU
utilization approach to Us
CPU Utilization
Proportional Control
U(t)
Us
ess=-20%
Proportional-Integral Control
Stability
Proportional Controller
ra(t)=K(e(t)+Ki•te()d) C(s) = K(1+Ki/s)
Transfer functions
Us/s as input: G1(s) = (Ks+KKi)/(s2+Ks+KKi)
Rc(s) as input: G2(s) = s/(s2+Ks+KKi)
Stability
Poles Re[p0]<0, Re[p0]<0
System is BIBO stable iff K>0 & Ki>0
Rc(s)
Ra(s) Go
Us/s C(s) U(s)
Proportional Control
Steady-state error
Assume completion rate Rc(t) keeps constant for a time
period longer than the settling time: Rc(s)=Rc/s
System response is
U s G1 ( s ) Rc G2 ( s ) ( KU s Rc ) s KK iU s
U ( s)
s s s ( s 2 Ks KK i )
• Compute steady-state err using final value theorem,
( KU s Rc ) s KK iU s
limU (t ) lim sU ( s ) lim Us ess 0
t s 0 s 0 s Ks KK i
2
U(t)
Mp=0
Us
ess=0
t s tr t p
Controller Design
Summary & pointers
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
Linear continuous time control
Root-locus design
Frequency-response design
State-space design
G. F. Franklin et. al., Feedback control of dynamic systems
Discrete Control
More useful for computer systems
Time is discrete; sampled system
denoted k instead of t
Main tool is z-transform
Z[ f (k )] F ( z ) f (k ) z k
k 0
f(k) F(z) , where z is complex
Analogous to Laplace transform for s-domain
Discrete Modeling
Difference equation
V(m) = a1V(m-1) + a2V(m-2) + b1U(m-1) + b2U(m-2)
z domain: V(z) = a1z-1V(z) + a2z-2V(z) + b1z-1U(z) + b2z-2U(z)
Transfer function G(z) = (b1z + b2)/(z2-a1z - a2)
V(m): output in mth sampling window
U(m): input in mth sampling window
Order n: #sampling-periods in history affects current
performance
SP = 30 sec, and n = 2 Current system performance
depends on previous 60 sec
Root Locus analysis of
Discrete Systems
Higher-frequency
response
Longer settling time
Re(s)
Stable
Unstable |z|=1
Intuition : z e Ts
Feedback control works in CS
U.Mass: network flow controllers (TCP/IP – RED)
IBM: Lotus Notes admission control
UIUC: Distributed visual tracking
UVA
Web Caching QoS
Apache Web Server QoS differentiation
Active queue management in networks
Processor thermal control
Online data migration in network storage (with HP)
Real-time embedded networking
Control middleware
Feedback control real-time scheduling
Advanced Control Topics
Robust Control
Can the system tolerate noise?
Adaptive Control
Controller changes over time (adapts)
MIMO Control
Multiple inputs and/or outputs
Stochastic Control
Controller minimizes variance
Optimal Control
Controller minimizes a cost function of error and control energy
Nonlinear systems
Neuro-fuzzy control
Challenging to derive analytic results
Issues for Computer
Science
Most systems are non-linear
But linear approximations may do
eg, fluid approximations
First-principles modeling is difficult
Use empirical techniques
Mapping control objectives to feedback control
loops
ControlWare paper
Deeply embedded networking
Massively decentralized control problem
Modelling
Node failures
Acknowledgements
UVA
Jack Stankovic
Tarek F. Abdelzaher
Sang H. Son
Gang Tao
HP Labs
Guillermo Alvarez
IBM TJ Watson
Joseph Hellerstein
Sujay Parekh