You are on page 1of 8

Control Theory with Applications Example 1: Liquid Level

to Computer Science System


(input flow) Goal: Design the input
qi valve control to maintain a
constant height regardless
Input valve of the setting of the
control output valve

float

R
IBM T.J. Watson Research Center (height) H
(resistance)

(output flow)
V Output
qo
(volume)
valve
2

Example 2: Admission Control Why Control Theory


Goal: Design the controller
to maintain a constant Systematic approach to analysis and design
Users
queue length regardless of Transient response
the workload
Consider sampling times, control frequency
RPCs Taxonomy of basic controls
Select controller based on desired characteristics
Reference Tuning
value
Controller
control
Sensor
Predict system response to some input
Server Speed of response (e.g., adjust to workload
Administrator Server
Log changes)
Oscillations (variability)
Queue
Length Approaches to assessing stability and limit
cycles
3 4

Example: Control & Response in


an Email Server
Examples of CT in CS
Response
(queue length)
Network flow controllers (TCP/IP RED)
Good (U.Mass)
Control Bad
(MaxUsers) Lotus Notes admission control
(IBM )
QoS in Caching
(U.Va )
Apache QoS differentiation
Slow Useless (U.Va )

5 6

1
Outline Feedback Control System
Examples and Motivation
Control Theory Vocabulary and Methodology
Reference Value Disturbance
Modeling Dynamic Systems n(t )
e(t ) = r (t ) b(t )
Standard Control Actions r(t )
+
Transient Behavior Analysis e(t ) u(t ) y(t )
Controller Plant
Advanced Topics

Issues for Computer Systems


b(t )
Bibliography Transducer

7 8

Controller Design Methodology Control System Goals


Start
Regulation
thermostat, target service levels
System Modeling
Controller

Design
Block
diagram
construction
Tracking
Controller
robot movement, adjust TCP window to
Transfer function
Evaluation network bandwidth
formulation and
validation Optimization
Objective
achieved?
Y Stop best mix of chemicals, minimize response
times
N Model Y
Ok?
N

9 10

Approaches to
System Models System Modeling
Linear vs. non-linear (differential eqns) First Principles
eg, a1 y + a 0 y = b2 x + b0 x Based on known laws
Principle of superposition Physics, Queueing theory
Deterministic vs. Stochastic Difficult to do for complex systems
Time-invariant vs. Time-varying Experimental (System ID)
Are coefficients functions of time? Statistical/data-driven models
Requires data
Continuous-time vs. Discrete-time

Is there a good training set?


t R vs k Z

11 12

2
Basic Tool For Continuous
The Complex Plane (review) Time: Laplace Transform
Imaginary axis (j)
L[ f (t )] = F ( s ) = f (t )e st dt
u = x + jy 0
y u = tan 1 y Convert time-domain functions and operations
x into frequency-domain
x
Real axis f(t) F(s) (t;, s)
| u | r | u |= x 2 + y 2

Linear differential equations (LDE) algebraic


y expression in Complex plane
Graphical solution for key LDE characteristics
u = x jy
Discrete systems use the analogous z-transform
(complex) conjugate
13 14

Laplace Transforms of
Common Functions Laplace Transform Properties
Name f(t) F(s) Addition/Scaling L[af1 (t ) bf 2 (t )] = aF1 ( s ) bF2 ( s )
1 t=0
Impulse f (t ) = 1 d
0 t>0 Differentiation L f (t ) = sF ( s ) f (0 )
dt
Step f (t ) = 1
1
s Integration [
L f (t )dt = ]
F (s) 1
s
+ f (t )dt
s
[ t =0
]
t
1
f (t ) = t
Ramp
s2 Convolution f (t )f ( )d = F (s) F (s)
0
1 2 1 2

1
Exponential f (t ) = e at
Initial-value theorem f (0+) = lim sF ( s )
sa s
1
Sine f (t ) = sin(t )
2 + s2 Final-value theorem lim f (t ) = lim sF ( s )
t s 0

15 16

Insights from Laplace


Transforms Transfer Function
What the Laplace Transform says about f(t) Definition X(s) H(s) Y(s)
Value of f(0) H(s) = Y(s) / X(s)
Initial value theorem

Relates the output of a linear system
Does f(t) converge to a finite value?

Poles of F(s)
(or component) to its input
Does f(t) oscillate? Describes how a linear system responds
Poles of F(s) to an impulse
Value of f(t) at steady state (if it converges) All linear operations allowed
Limiting value of F(s) as s->0
Scaling, addition, multiplication

17 18

3
Block Diagrams Block Diagram of System
Pictorially expresses flows and relationships
between elements in system Disturbance

Blocks may recursively be systems Reference Value


N (s)
Rules R(s)
+ G1 (s) G2 (s)
Cascaded (non-loading) elements: convolution E(s) U (s)
Controller Plant
Summation and difference elements Y (s)

Can simplify
B(s)
Transducer

19
H (s) 20

Block Diagram of
Combining Blocks Access Control
Users

Reference Value
Controller Sensor

R(s) + (G1 (s) + N (s)) G2 (s) Server


Server
Log

E(s)
Combined Block
Y (s)

B(s) R(z)
+

E(z)
G(z)
U(z)
N(z)
Q(z)
S(z)
Transducer - Controller Notes Sensor M(z)
Server
H (s) 21 22

Key Transfer Functions Rational Laplace Transforms


Reference A( s )
F ( s) =
R(s)
B( s)
+ G1 (s) G2 (s)
E(s) U (s) A( s ) = a n s n + ... + a1 s + a 0
Controller Plant

Y (s)
H (s)
B( s ) = bm s m + ... + b1 s + b0
B(s)
Transducer Poles : s* B( s*) = 0 (So, F ( s*) = )
Zeroes : s* A( s*) = 0 (So, F ( s*) = 0)
Y ( s) Y ( s) U ( s)
Feedforward : =
E ( s) U ( s) E ( s)
= G1 ( s )G 2 ( s ) Poles and zeroes are complex
B( s ) Y (s) G1 ( s )G 2 ( s ) Order of system = # poles = m
Open - Loop : = G1 ( s)G2 ( s) H ( s ) Feedback : =
E ( s) R ( s ) 1 + G1 ( s )G 2 ( s ) H23( s ) 24

4
First Order System First Order System
Y ( s) K K
= Impulse K Exponential
R ( s ) 1 + K + sT 1 + sT response
Reference 1 + sT
Step response Step,
K K
R (s ) - exponential
E (s ) U (s ) 1 Y (s ) s s +1/ T
K
1 + sT
Ramp response K KT KT Ramp,
- - step,
B (s ) 1 s 2 s s + 1 / T exponential

25 No oscillations (as seen by poles) 26

Second Order System:


Second Order System Parameters
Y ( s) K N2
Impulse response : = 2 = 2 Interpretation of damping ratio
R( s) Js + Bs + K s + 2 N s + N2
= 0 : Undamped oscillatio n (Re = 0, Im 0)
Oscillates if poles have non - zero imaginary part (ie, B 2 4 JK < 0)
0 < < 1 : Underdamped (Re 0 Im)
B
Damping ratio : =
Bc
where Bc = 2 JK 1 : Overdamped (Re 0, Im = 0)

K
Undamped natural frequency : N = Interpretation of undamped natural frequency
J
N gives the frequency of the oscillatio n

27 28

Transient Response
Characteristics Transient Response
2
1.75
1.5
Estimates the shape of the curve based
1.25 on the foregoing points on the x and y
1
axis
0.75
0.5 Typically applied to the following inputs
0.25
Impulse
0.5 1 1.5 2 2.5 3
Step
Ramp
t d : Delay until reach 50% of steady state value
Quadratic (Parabola)
t r : Rise time = delay until first reach steady state value
t p : Time at which peak value is reached
t s : Settling time = stays within specified % of steady state 29 30

5
Effect of pole locations Basic Control Actions: u(t)
Oscillations
U (s)
(higher-freq) Proportional control : u (t ) = K p e(t ) = Kp
Im(s) E (s)
t
U (s) K i
Integral control : u (t ) = K i e(t )dt =
Faster Decay Faster Blowup 0
E (s) s
Re(s)
(e-at) (eat)
d U (s)
Differential control : u (t ) = K d e(t ) = Kd s
dt E (s)

31 32

Effect of Control Actions Basic Controllers


Proportional Action Proportional control is often used by
Adjustable gain (amplifier)

itself
Integral Action
Eliminates bias (steady-state error) Integral and differential control are
Can cause oscillations typically used in combination with at
Derivative Action (rate control) least proportional control
Effective in transient periods eg, Proportional Integral (PI) controller:
Provides faster response (higher sensitivity)
Never used alone U (s) K 1

G (s) = = K p + I = K p 1 +
E (s) s Tis
33 34

Summary of Basic Control Root-locus Analysis


Proportional control Based on characteristic eqn of closed-loop
Multiply e(t) by a constant transfer function
PI control

Plot location of roots of this eqn
Multiply e(t) and its integral by separate constants
Avoids bias for step Same as poles of closed-loop transfer function
PD control Parameter (gain) varied from 0 to
Multiply e(t) and its derivative by separate constants Multiple parameters are ok
Adjust more rapidly to changes Vary one-by-one
PID control Plot a root contour (usually for 2-3 params)
Multiply e(t), its derivative and its integral by separate
Quickly get approximate results

constants
Reduce bias and react quickly Range of parameters that gives desired response
35 36

6
z-Transforms of Common
Digital/Discrete Control Functions
More useful for computer systems Name f(t) F(s) F(z)
1 t=0
Time is discrete Impulse f (t ) = 1 1
0 t>0
denoted k instead of t
1
Main tool is z-transform Step f (t ) = 1
z
s z 1
Z[ f (k )] = F ( z ) = f (k ) z k
1 z
k =0 Ramp f (t ) = t
s2 ( z 1) 2
f(k) F(z) , where z is complex
1 z
Analogous to Laplace transform for s-domain Exponential f (t ) = e at

sa z ea
Root-locus analysis has similar flavor f (t ) = sin(t )
1 z Sin a
Sine z 2 2(Cos a ) z + 1
Insights are slightly different 2 + s2

37 38

Root Locus analysis of


Discrete Systems Effect of discrete poles
Im(s)
Stability boundary: |z|=1 (Unit circle)
Higher-frequency
Settling time = distance from Origin response
Longer settling time

Speed = location relative to Im axis


Right half = slower Stable
Re(s)

Left half = faster Unstable |z|=1

Intuition : z = e Ts
39 40

System ID for Admission Root Locus Analysis of


Control Admission Control
E(z)
+ U(z) Q(z)
R(z) G(z) N(z) S(z)
- Controller Notes Sensor M(z)
Server

Transfer Functions
ARMA Models b0 z
N ( z) =
q (t ) = a1 q (t 1) + b0 u (t ) z a1
m(t ) = c1 m(t 1) + d 0 q (t ) + d1 q (t 1) d 0 z + d1
S ( z) =
z c1
Control Law G( z) =
Ki z 1 Predictions:
u (t ) = u (t 1) + K i e(t ) z 1 z Ki small => No controller-induced oscillations
Ki large => Some oscillations
b0 z d 0 z + d 1 K i z 1 Ki v. large => unstable system (d=2)
Open-Loop: N ( z ) S ( z ) G ( z ) = Usable range of Ki for d=2 is small
z a1 z c1 z 1 z 41 42

7
Experimental Results
Advanced Control Topics
Response
(queue length) Robust Control
Can the system tolerate noise?
Good Bad
Adaptive Control
Control Controller changes over time (adapts)
(MaxUsers)
MIMO Control
Multiple inputs and/or outputs
Stochastic Control
Controller minimizes variance
Optimal Control
Controller minimizes a cost function of error and control energy
Slow Nonlinear systems
Useless Neuro-fuzzy control
Challenging to derive analytic results

43 44

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
Control objectives are different
Optimization rather than regulation
Multiple Controls
State-space techniques
Advanced non-linear techniques (eg, NNs)
45

You might also like