Feedback Control Theory Introduction - A Tutorial from Computer - - PDF document

feedback control theory
SMART_READER_LITE
LIVE PREVIEW

Feedback Control Theory Introduction - A Tutorial from Computer - - PDF document

Xiaorui Wang Outline CSE 520S Feedback Control Theory Introduction - A Tutorial from Computer Systems Perspective What is feedback control? Why feedback control? Control design methodology System modeling Performance


slide-1
SLIDE 1

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 1

CSE 520S

Feedback Control Theory

  • A Tutorial from Computer System’s Perspective

Xiaorui Wang Washington University in St. Louis

10/17/2005

2005-10-24 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

2005-10-24 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 cruise-control: gas input speed=60 mph Air Conditioning: power input temperature = 80 F

2005-10-24 Control Tutorial -- Xiaorui Wang 4

Traditionally: Open-Loop Control

What if no cruise control is on your car?

Control the gas by looking at the speed meter?

You are the controller!

Open-loop

Don’t look at the meter at all and try to maintain 60mph Need to estimate everything accurately

Road friction, ramp angle, traffic condition Precise computation to decide how much gas is necessary

Open-loop control fails because

We don’t know everything We make errors in estimation/modeling Things change

2005-10-24 Control Tutorial -- Xiaorui Wang 5

Feedback (Closed-Loop) Control

Actuator Monitor Reference 60 mph

control input

Controlled variable : Car speed Manipulated variable : Gas Cruise Control System

+ -

error control function Controller

sample

2005-10-24 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

admission control??? resource requirement???

slide-2
SLIDE 2

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 2

2005-10-24 Control Tutorial -- Xiaorui Wang 7

CPU Utilization Control in Real-Time Systems

Why CPU utilization control?

Overload protection

Real-time priorities > system priority Utilization≈100% Operating system freezes

Meet deadlines for periodical real-time tasks

CPU utilization < schedulable threshold meet all deadlines on this processor

Control method

Reference: CPU utilization = 70% Handling unpredicted execution time variations Actuation: Task period

Task 1 (30%) Task 2 (20%) Task 3 (30%) Ref: 70% CPU utilization in a real-time server 100% CPU utilization of each task period task time execution =

2005-10-24 Control Tutorial -- Xiaorui Wang 8

Heuristics Based Control???

Laborious design/tuning/testing iterations

How much do you change the task periods?

Too little slow convergence; Too large system oscillation

How often do we see this kind of papers?

Not enough confidence in face of untested workload

Parameter K = 2000 Parameter K = 100000 Best parameter K = 8000

What about 7000, 9000…?

2005-10-24 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

Well-established algorithms to choose control parameters

Predictable system response Guaranteed stability Quantitative way to analyze the impact of system variation

  • n control performance

2005-10-24 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

2005-10-24 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

2005-10-24 Control Tutorial -- Xiaorui Wang 12

CPU Utilization Modeling

CPU utilization is the sum of the utilizations of all tasks In the kth time period The differential utilization model

period task time execution = Task 1 Task 2 Task 3 70% CPU utilization in a real-time 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 ir

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

Δ + Δ + Δ + =

slide-3
SLIDE 3

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 3

2005-10-24 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

2005-10-24 Control Tutorial -- Xiaorui Wang 14

Z-Transforms and Transfer Function

Why Z-transforms?

Easier control analysis

Stability, steady-state error, settling time

Simpler manipulations

Time series (i.e. k, k-1, k-2) -> multiplication

How to transform to Z-domain

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: Z-transform

2005-10-24 Control Tutorial -- Xiaorui Wang 15

Open Loop Block Diagram

A pictorial tool to represent a system based

  • n transfer functions and signal flows

D(z) U(z) G/(z-1) 1

  • z

G D(z) U(z) =

Transfer function: system

  • utput

input

2005-10-24 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

2005-10-24 Control Tutorial -- Xiaorui Wang 17

Design Goals

Performance Specifications

Settling time Overshoot Controlled variable Time

Reference

±ε% Steady State Transient State Steady state error

Unstable system:

2005-10-24 Control Tutorial -- Xiaorui Wang 18

Performance Specs

Steady-State Error

Steady state error of a CPU-utilization control system

U(t) ess= -20% Us

slide-4
SLIDE 4

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 4

2005-10-24 Control Tutorial -- Xiaorui Wang 19

Example: Control & Response in an Email Server (IBM)

Control

(MaxUsers)

Response

(queue length)

Good Slow Bad Useless

2005-10-24 Control Tutorial -- Xiaorui Wang 20

Controller Design Requirements

Stability Zero steady state error Short settling time Robust to variations

2005-10-24 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

2005-10-24 Control Tutorial -- Xiaorui Wang 22

Close the Loop – Closed Loop Diagram

Open loop diagram Closed loop diagram

D(z) U(z) G/(z-1) 1

  • z

G D(z) U(z) =

Transfer function: system

  • utput

input

D(z) U(z) G/(z-1) C(z) Us(z) +

_

Us-U(z)

2005-10-24 Control Tutorial -- Xiaorui Wang 23

Closed-Loop Transfer Function

  • Standard equation
  • Deriving from the block diagram

GC(z)U(z) 1)U(z)

  • (z

(z) GC(z)Us + = D(z) U(z) G/(z-1) C(z) Us(z) +

_

Us-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

=

Closed-loop transfer function: 1 z G S(z) where ; C(z)S(z) 1 C(z)S(z) (z) U U(z)

s

− = + =

2005-10-24 Control Tutorial -- Xiaorui Wang 24

Controller Design - PID Control

Proportional-Integral-Derivative (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

(Look at the future; predict)

  • Combination of P, I, D controller: PI, PD, PID controllers

D(z) U(z) G/(z-1) C(z) Us(z) +

_

Us-U(z)

slide-5
SLIDE 5

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 5

2005-10-24 Control Tutorial -- Xiaorui Wang 25

Proportional Controller

Is the closed-loop system stable? What is the steady state error?

D(z) U(z) G/(z-1) K Us(z) +

_

Us-U(z) GC(z))

  • (1
  • z

GC(z) (z) U U(z)

s

= Closed-loop transfer function: GK)

  • (1
  • z

GK =

2005-10-24 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 that determines the transient response (z) U U(z)

s

Closed-loop transfer function: GK)

  • (1
  • z

GK =

Pole: 1-GK

|1-GK| < 1 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 GA = MAX{G(k)} by system experiments and select K to guarantee 0 < K < 2/GA

2005-10-24 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 Higher-frequency response 2005-10-24 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

− = =

∞ → ∞ →

Us 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 (z-1)U(z) are inside the

unit circle, then

) ( ) 1 ( lim ) ( lim

1

z U z k u

z k

− =

→ ∞ →

(z) U U(z)

s

Closed-loop 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 no matter what G and K are!!

2005-10-24 Control Tutorial -- Xiaorui Wang 29

Final Control Algorithm

GA=0.447, K is selected as 0.185 to guarantee stability Settling time can be calculated based on K and GA Control algorithm

FC-U (Us, K) { // Monitor U = utilization in the last sampling period; // Controller E = Us – U; D = K*E; //the P controller // Actuator AdjustTaskRate(D); }

2005-10-24 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 50 100 150 200 250 300 350 400 Time (4 sec) U(k) B(k) M(k)

Same CPU utilization and zero deadline misses despite changes in execution times

0.00 0.1 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1 .00 50 1 00 1 50 200 250 300 350 400 Time (4 sec) U(k) M (k)

Open-loop system Closed-loop system

slide-6
SLIDE 6

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 6

2005-10-24 Control Tutorial -- Xiaorui Wang 31

Controller Design - Summary

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 PI, PD, PID: combines the advantages of P, I, D

2005-10-24 Control Tutorial -- Xiaorui Wang 32

Overview of Some Common Control Techniques

Distributed peer-to- peer control; scalable; fault-tolerant 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 (SIMO, MISO) control PID Better control performance for higher

  • rder systems

PI/PD/I Utilization control P SISO control Classical control (PID control) Proportional- Integral- Derivative

2005-10-24 Control Tutorial -- Xiaorui Wang 33

More Control Topics

System modeling

System Identification: Estimate dynamic model based on experimental data

Especially useful 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: Neuro-fuzzy control

2005-10-24 Control Tutorial -- Xiaorui Wang 34

An Emerging Field

Computer Systems

  • Real-time scheduling
  • Real-time embedded middleware
  • Internet Servers: Web server, proxy, E-mail server
  • Internet routers
  • Storage Systems

Teams

  • Caltech
  • IBM T J Watson
  • Lund @ Sweden
  • UIUC
  • University of Virginia
  • Washington University in St. Louis
  • … …

2005-10-24 Control Tutorial -- Xiaorui Wang 35

Conclusion

Software Performance Control

  • Promising empirical results on a variety of

computing systems

  • An emerging field of interdisciplinary

research

  • Many open questions and opportunities

2005-10-24 Control Tutorial -- Xiaorui Wang 36

Questions

Yingming will give more details in the design of

  • ther FCS algorithms in next week

Recommended control textbook

Feedback Control of Computing Systems,

by Joseph L. Hellerstein, Yixin Diao, Sujay Parekh, Dawn M. Tilbury, Wiley-IEEE Press, August, 2004

slide-7
SLIDE 7

Xiaorui Wang Feedback Control Theory from a Computer System Perspective 7

2005-10-24 Control Tutorial -- Xiaorui Wang 37

Acknowledgement

  • Some slides are copied from Dr. Chenyang Lu’s control tutorial

in 2003.

  • Some slides are copied from “An Introduction to Control Theory

and Its Application to Computer Science” and “Feedback Control

  • f Computing System” by Joe Hellerstein, Sujay Parekh, et al.