Feedback Control Theory Control a Computer Systemʼs Perspective
Total Page:16
File Type:pdf, Size:1020Kb
Feedback Control Theory Control a Computer Systemʼs Perspective Introduction Applying input to cause system variables to conform to desired values called What is feedback control? the reference. Why do computer systems need feedback control? Cruise-control car: f_engine(t)=? speed=60 mph Control design methodology E-commerce server: Resource allocation? T_response=5 sec System modeling Embedded networks: Flow rate? Delay = 1 sec Performance specs/metrics Computer systems: QoS guarantees Controller design Summary Feedback (close-loop) Control Open-loop control Compute control input without continuous variable measurement Controlled System Simple Controller Need to know EVERYTHING ACCURATELY to work right Cruise-control car: friction(t), ramp_angle(t) control control manipulated E-commerce server: Workload (request arrival rate? resource input Actuator consumption?); system (service time? failures?) function variable Open-loop control fails when We donʼt know everything error sample controlled We make errors in estimation/modeling + Monitor Things change - variable reference Why feedback control? Open, unpredictable environments Feedback (close-loop) Control Measure variables and use it to compute control input More complicated (so we need control theory) Deeply embedded networks: interaction with physical environments Continuously measure & correct Number of working nodes Cruise-control car: measure speed & change engine force Number of interesting events Ecommerce server: measure response time & admission control Number of hops Embedded network: measure collision & change backoff window Connectivity Feedback control theory makes it possible to control well even if Available bandwidth We donʼt know everything Congested area We make errors in estimation/modeling Things change Internet: E-business, on-line stock broker Unpredictable off-the-shelf hardware 1 Why feedback control? Advantage of feedback control theory We want QoS guarantees Deeply embedded networks Adaptive resource management heuristics Update intruder position every 30 sec Laborious design/tuning/testing iterations Report fire <= 1 min Not enough confidence in face of untested workload E-business server Queuing theory Purchase completion time <= 5 sec Doesnʼt handle feedbacks Throughput >= 1000 transaction/sec Not good at characterizing transient behavior in overload The problem: provide QoS guarantees in open, unpredictable Feedback control theory environments Systematic theoretical approach for analysis and design Predict system response and stability to input Outline Control design methodology Introduction What is feedback control? Why do todayʼs computer systems need feedback control? Controller Control design methodology Modeling Design System modeling analytical Dynamic model Root-Locus Control algorithm Performance specs/metrics system IDs Controller design PI Control Summary Satisfy Requirement Performance Specifications Analysis System Models Dynamic Model Computer systems are dynamic Linear vs. non-linear (differential eqns) Linear vs. non-linear (differential eqns) Current output depends on “history” Deterministic vs. Stochastic Characterize relationships among system variables • Differential equations (time domain) Time-invariant vs. Time-varying Are coefficients functions of time? •• • • a2 y(t) + a1 y(t) + a0 y(t) = b1 u(t) + b0u(t) Continuous-time vs. Discrete-time • Transfer functions (frequency domain) System ID vs. First Principle Y(s) = G(s)U(s) b1s + b0 c1 c2 G(s) = 2 = + a2s + a1s + a0 s ! p1 s ! p2 • Block diagram (pictorial) R(s) C(s) G(s) Y(s) - 2 Example Utilization control in a video server Model Differential equation Periodic task Ti corresponding to each video stream i • Error: E(t)=Us-U(t) c[i]: processing time, p[i]: period t Stream iʼs requested CPU utilization: u[i]=c[i]/p[i] U (t) (R ( ) R ( ))d Total CPU utilization: U(t)=Σ{k}u[k], {k} is the set of active streams • Model (differential equation): = ! a # " c # # # =0 Completion rate: Rc(t)= (Σ{kc}u[m])/Δt, where {m} is the set of terminated video streams during [t, t+Δt] • Controller C? E(t) ⇒ Ra(t) Unknown Admission rate: Ra(t)= (Σ{ka}u[j])/Δt, where {j} is the set of admitted streams during [t, t+Δt] Ra(t) U Problem: design an admission controller to guarantee U(t)=Us regardless of Rc(t) - s C? U(t) CPU Rc(t) A Diversion to Math A Diversion to Math System representations Laplace transform Three ways of system modeling Laplace transform of a signal f(t) • Time domain: convolution; differential equations. " t F(s) = L[ f (t)] = f (t)e#st dt u(t) g(t) y(t) y(t) = g(t)*u(t) = g(t "# )u(# )d# ! ! 0# 0 • s (frequency) domain: multiplication where s=σ+iω is a complex variable. U(s) G(s) Y(s) Y (s) = G(s)U (s) • Laplace transform is a translation from time-domain to s-domain • Block diagram: pictorial • Differential equation ⇒ Polynomial function •• • • a2 y(t) + a1 y(t) + a0 y(t) = b1 u(t) + b0u(t) s-domain is a simple & powerful “language” for control analysis b1s + b0 ! Y (s) = 2 •U (s) a2s + a1s + a0 A Diversion to Math A Diversion to Math Laplace transform Transfer function Basic translations Modeling a linear time-invariant (LTI) system Impulse function f(t)=δ(t) ⇔ F(s)=1 G(s) = Y(s)/U(s) ⇒ Y(s) = G(s)U(s) 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)] U(s) G(s) Y(s) Differentiation L[df(t)/dt] = sF(s) – f(0-) Integration L[∫tf(τ)dτ] = F(s)/s E.g., a second order system with poles p1 and p2 b1s + b0 c1 c2 G(s) = 2 = + a2s + a1s + a0 s ! p1 s ! p2 3 A Diversion to Math A Diversion to Math Poles and Zeros Time response vs. pole location The response of a linear time-invariant (LTI) system Stable Unstable m m"1 bms + bm"1s +...+ b0 F(s) = n n"1 ans + an"1s +...+ a0 m $i=1(s " zi ) C1 C2 Cn = K n = + +...+ $i=1(s " pi ) s " p1 s " p2 s " pn n pit # f (t) = !Cie i=1 pt {pi} are poles of the function and decide the system behavior •f’(t) = e , p = a+bj A Diversion to Math Back to Block diagram Our utilization control example A pictorial tool to represent a system based on transfer functions and signal • Error: E(t)=U -U(t) flows s t Represent a feedback control system • Model (differential equation): U (t) = !(Ra (# ) " Rc (# ))d# # =0 • Controller C? E(t) ⇒ Ra(t) R(s) C(s) G (s) Y(s) - o R (t) U a - s C(s)G (s) C? G o c = U(t) R(s) Gc(s) Y(s) 1+ C(s)Go (s) CPU Y (s) = Gc (s)R(s) Rc(t) Model Control design methodology Transfer func. & block diag. • CPU is modeled as an integrator t Ra (s) " Ra (s) 1 U (t) = #(Ra ($ ) " Rc ($ ))d$ !U (s) = ! Go (s) = Controller $ =0 s s Inputs: reference Us(s) = Us/s; completion rate Rc(s) Modeling Design Close-loop system transfer functions analytical Dynamic model Root-Locus Control algorithm U (s) as input: G (s) = C(s)G (s)/(1+C(s)G (s)) s 1 o o system IDs PI Control Rc(s) as input: G2(s) = Go(s)/(1+C(s)Go(s)) Output: U(s)=G1(s)Us/s+G2(s)Rc(s) Satisfy Requirement Performance Specifications Rc(s) Analysis Ra(s) C(s) Go Us/s U(s) 4 Design Goals Performance Specs: bounded input,bounded output stability Performance Specifications Stability BIBO stability: bounded input results in bounded output. A LTI system is BIBO stable if all poles of its transfer function are in the LHP ( p , Transient response ∀ i Re[pi]<0). Steady-state error Robustness Disturbance rejection Sensitivity m &i=1(s % zi ) C1 C2 Cn Y (s) = G(s)U (s) = K n = + +...+ &i=1(s % pi ) s % p1 s % p2 s % pn n pit $ y(t) = 'Cie i=1 pit t#! Note: Cie """#! if Re[ pi ] > 0 Performance Specs Performance specifications Stability Controlled variable Overshoot Stable Unstable Steady state error±ε% Reference Transient State Steady State Time Settling time Example: Control & Response in an Email Server (IBM) Performance Specs Steady-state error Response (queue length) Steady state (tracking) error of a stable system ess = lime(t) = lim(r(t) ! y(t)) Good t t Control Bad #" #" (MaxUsers) 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 left-half of the s-plane, then lim f (t) = lim sF(s) t!" s!0 Slow Useless • Easy to evaluate system long term behavior without solving it ess = lime(t) = lim sE(s) t!" s!0 5 Performance Specs Performance Specs Robustness Steady-state error Disturbance rejection: steady-state error caused by external Steady state error of a CPU-utilization control system disturbances Can a system track the reference input despite of external disturbances? U(t) Denial-of-service attacks Sensitivity: relative change in steady-state output divided by the relative change of a system parameter Us ess=-20% Can a system track the reference input despite of variations in the system? Increased task execution times Device failures Performance Specs Control design methodology Goal of Feedback Control Guarantee stability Improve transient response Short settling time Controller Small overshoot Modeling Small steady state error Design Dynamic model Control algorithm Improve robustness wrt uncertainties analytical Root-Locus system IDs Disturbance rejection PID Control Low sensitivity Satisfy Requirement Performance Specifications Analysis Controller Design Controller Design PID control CPU Utilization Control Proportional-Integral-Derivative (PID) Control • CPU is modeled as an integrator