19
Brief Review of Brief Review of Control Theory Control Theory E0397 Lecture. E0397 Lecture. Some PPT slides based on Columbia Course Some PPT slides based on Columbia Course by authors of the book by authors of the book Feedback Control of Computing Systems Feedback Control of Computing Systems Hellerstein, Diao, Parekh, Tilbury Hellerstein, Diao, Parekh, Tilbury

Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Embed Size (px)

Citation preview

Page 1: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Brief Review of Brief Review of Control Theory Control Theory

E0397 Lecture.E0397 Lecture.Some PPT slides based on Columbia Course by Some PPT slides based on Columbia Course by

authors of the bookauthors of the bookFeedback Control of Computing SystemsFeedback Control of Computing Systems

Hellerstein, Diao, Parekh, TilburyHellerstein, Diao, Parekh, Tilbury

Page 2: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

A Feedback Control System A Feedback Control System

Error

Data•Reference input: objective•Control input: manipulated to affect output•Disturbance input: other factors that affect the target system•Transduced output: result of manipulation

Components•Target system: what is controlled•Controller: exercises control•Transducer: translates measured outputs

Given target system, transducer, Control theory finds controller that adjusts control input to achieve given measured output in the presence of disturbances.

Page 3: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Control System ExamplesControl System Examples

AC temperature controlAC temperature control– Controlled Variable: temperatureControlled Variable: temperature– Control variables: fan speed, time for which Control variables: fan speed, time for which

compressor is on?compressor is on?

Car cruise controlCar cruise control– Controlled variable: Car speedControlled variable: Car speed– Control variable: Angle of pushing of accelerator Control variable: Angle of pushing of accelerator

and brakeand brake

Page 4: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

A Feedback Control System A Feedback Control System

Error

Embedded System

that does cruise control

Car

Road surface, gradient

Distance Travelled,

Time taken

PedalAngle Setting

Speed calculatorSpeed

DesiredSpeed

Sensor: the entity

that measures the output

Actuator:The entity

that implements the control

Odometer,Car clock

MechanicalDevice that

Changes pedal angle

Random variation

Feedback!

Page 5: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

A virtual machine as a FBCSA virtual machine as a FBCS

Error

Controller: Process in

Domain 0 that periodically

changesCap value of

Guest Domain

Xen VM(Guest Domain)With applications

running

Other Virtual Machines Doing some

interfering work

Response Time (of

Applications)CPU Cap Value

E.g.Smoothing

“filter”

SmoothedResponse

time

DesiredResponse

time

Sensor: the entity

that measures the output

Actuator:The entity

that implements the control

E.g. a “proxy” thatCan measure

Time taken

Xen hypervisorscheduler

Random variation

Feedback!

Page 6: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

A Feedback Control System A Feedback Control System

Error

Data•Reference input: objective•Control input: manipulated to affect output•Disturbance input: other factors that affect the target system•Transduced output: result of manipulation

Components•Target system: what is controlled•Controller: exercises control•Transducer: translates measured outputs

Given target system, transducer, Control theory finds controller that adjusts control input to achieve given measured output in the presence of disturbances.

Page 7: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Control System GoalsControl System Goals

Reference TrackingReference Tracking– Ensure that measured output “follows” (tracks) a target Ensure that measured output “follows” (tracks) a target

desired leveldesired level Disturbance RejectionDisturbance Rejection

– Maintain measured output at a given stable level even in Maintain measured output at a given stable level even in presence of “disturbances”presence of “disturbances”

OptimizationOptimization– No reference input may be given. Maintain measured No reference input may be given. Maintain measured

output and control input at “optimal” levelsoutput and control input at “optimal” levels Minimize petrol consumption, maximize speed (Minimize petrol consumption, maximize speed (not available in not available in

reality!!)reality!!) Minimize power consumed by CPU, maximize performanceMinimize power consumed by CPU, maximize performance

Page 8: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Control System: Basic WorkingControl System: Basic Working

“Control Loop” executed every T time units. – y(k): Value of measure at time instant k– u(k): Value of control input at time instant k– r(k): Value of “reference” at time instant k– e(k): Error between reference and measured value

Next value of control input, i.e. u(k+1) to be computed based on feedback: e(k)

u(k) x(k)

y(k)

r(k)e(k)

Page 9: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Determining Change in Control InputDetermining Change in Control Input Change in Change in uu should depend on relationship should depend on relationship

between between y y and and uu Relationship should be knownRelationship should be known

– If known, then why feedback? Why not:If known, then why feedback? Why not: y = f(u) y = f(u)

– (Car speed as function of accelerator pedal angle)(Car speed as function of accelerator pedal angle)

u = fu = f-1-1(y). For a desired reference, just calculate (y). For a desired reference, just calculate the control input required by using inverse. This is the control input required by using inverse. This is called called feed forwardfeed forward

Feed-forward

Page 10: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Feedforward (model based)Feedforward (model based) Problems:Problems:

– Need accurate modelNeed accurate model If model wrong, control input can be totally wrong If model wrong, control input can be totally wrong

– Imagine wrong model b/w accel. pedal and car speedImagine wrong model b/w accel. pedal and car speed

– Does not take into account time-dependent behaviourDoes not take into account time-dependent behaviour E.g. how long will system require to attain desired valueE.g. how long will system require to attain desired value

– If car was at speed S1, we set cruise control to speed S2, if we set pedal If car was at speed S1, we set cruise control to speed S2, if we set pedal angle to fangle to f-1-1(S2), will it immediately go to speed S2?(S2), will it immediately go to speed S2?

– Cannot take care of “disturbances”Cannot take care of “disturbances” E.g. if environmental conditions change, model may not be applicable. E.g. if environmental conditions change, model may not be applicable.

– What if car was climbing a slope? (And angle was measured on flat What if car was climbing a slope? (And angle was measured on flat ground?)ground?)

Feedback Feedback addresses many of these problems.addresses many of these problems.

Page 11: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Feedback ControlFeedback Control Rather than use Rather than use onlyonly some offline model, also take into account some offline model, also take into account

the immediate measured effect of the value of your control variablethe immediate measured effect of the value of your control variable– If car at S1, want to go to S2, S1 < S2 (positive error), pedal must be pushed If car at S1, want to go to S2, S1 < S2 (positive error), pedal must be pushed

further down.further down. We still need some idea of the relationship between “input” and We still need some idea of the relationship between “input” and

“output” “output” – Pedal should be pushed? Or released? If pushed – by what angle?Pedal should be pushed? Or released? If pushed – by what angle?

(Intuitively, for larger S2 - S1, angle of pushing in must be larger)(Intuitively, for larger S2 - S1, angle of pushing in must be larger)

– Another e.g. if e(k) = r(k) – y(k) is positiveAnother e.g. if e(k) = r(k) – y(k) is positive Should u(k) increase or decrease?Should u(k) increase or decrease?

– If If uu is CPU frequency, is CPU frequency, yy is response time. If e(k) is positive, is response time. If e(k) is positive, u u should?should? Increase/Decrease by how much?Increase/Decrease by how much?

If increase/decrease too much:If increase/decrease too much:– Measured output will keep on oscillating above and below reference: Measured output will keep on oscillating above and below reference:

Unstable behaviorUnstable behavior

Page 12: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

……Feedback controlFeedback control

Since we want control to work in a timely manner Since we want control to work in a timely manner (not only in “steady-state”), relationship should be (not only in “steady-state”), relationship should be time dependenttime dependent

New value of New value of y: y(k+1)y: y(k+1) will generally depend on will generally depend on y(k)y(k) and and u(k)u(k)– Speed of car at this instant, will depend on what speed Speed of car at this instant, will depend on what speed

was at the beginning of previous interval, and the pedal was at the beginning of previous interval, and the pedal angle in the previous intervalangle in the previous interval

– Similarly, queuing delay at this intv’l will depend on Similarly, queuing delay at this intv’l will depend on queuing delay of previous instant, and CPU frequency queuing delay of previous instant, and CPU frequency setting of previous intervalsetting of previous interval

Page 13: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Need a model to capture this Need a model to capture this relationship over relationship over timetime– Can be first order (depending on 1 previous value), or Can be first order (depending on 1 previous value), or

higher order (more than 1 previous values). higher order (more than 1 previous values). – First Order Linear model: First Order Linear model: y(k+1) = a y(k) + b u(k)y(k+1) = a y(k) + b u(k)

Can be done by “first principles” or “analytical Can be done by “first principles” or “analytical modeling”modeling”– E.g. If E.g. If y y is response time of queueing system, is response time of queueing system, uu is is

service time, it may be possible to find an equation to service time, it may be possible to find an equation to relate relate y(k+1)y(k+1) to to y(k)y(k) and and u(k)u(k)

System ModelingSystem Modeling

Page 14: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

System ModelingSystem Modeling

If “first principles” difficult: If “first principles” difficult: empiricalempirical model model Run controlled experiments on target Run controlled experiments on target

system, record values of y(k), u(k), run system, record values of y(k), u(k), run regression models to find regression models to find a a and and bb. . – How to do this correctly is a field called “system How to do this correctly is a field called “system

identification”identification”

Main issues:Main issues:– Relationship may not be actually be linearRelationship may not be actually be linear

Page 15: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Number in System

Non-linear relationshipsNon-linear relationships

K

{

Utilization Response Time

N

K

Operating point:Operating range

Values of N,K for which model applies.

Offset valueDifference from operating point

( , )N K

y N N

u K K

•E.g. number in queueing system vs buffer size•Relationship can be “linearized” in certain regions. Centre of such a region: Operating Point

Linear Relationship is made between y and u defined as “offsets”

Page 16: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Control “Laws”Control “Laws”

Once system model is made, need to design “control laws”Once system model is made, need to design “control laws” Control LawsControl Laws relate error to new value of control input: relate error to new value of control input:

– From From e(k)e(k) determine value of determine value of u(k)u(k) Controllers should have good SASO properties:Controllers should have good SASO properties:

– STABILITY - ACCURACY - SETTLING TIME - OVERSHOOTSTABILITY - ACCURACY - SETTLING TIME - OVERSHOOT Deeply mathematical theory for deriving these lawsDeeply mathematical theory for deriving these laws

– Transfer functions, PolesTransfer functions, Poles– Estimating SASO properties of control lawsEstimating SASO properties of control laws– Using this understanding to Using this understanding to designdesign good control laws which have good control laws which have

good SASO propertiesgood SASO properties

Cannot go into details

Page 17: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Unstable System

Stability Accuracy Short settling Small overshootProperties of Control SystemsProperties of Control Systems

Page 18: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

Types of Controllers (Control Laws)Types of Controllers (Control Laws) Proportional Control LawProportional Control Law

– u(k) = Ku(k) = Kppe(k) e(k) (K(Kpp is a constant, called is a constant, called controller gaincontroller gain))

– Can be made stable, short settling time, less overshoot – but Can be made stable, short settling time, less overshoot – but may be inaccuratemay be inaccurate

Integral Control LawIntegral Control Law– u(k) = u(k-1) + Ku(k) = u(k-1) + KII e(k) e(k) (K(KII is is controller gaincontroller gain))

=u(k-2) + K=u(k-2) + KI I e(k-1) + Ke(k-1) + KII e(k) e(k)

= u(0) +…+ K= u(0) +…+ KII * [ e(1) + e(2) + … +e(k) ] * [ e(1) + e(2) + … +e(k) ]

– Keeps reacting to previous errors alsoKeeps reacting to previous errors also

– Can show that this law will lead to zero errorCan show that this law will lead to zero error

– Has longer settling timeHas longer settling time

Page 19: Brief Review of Control Theory E0397 Lecture. Some PPT slides based on Columbia Course by authors of the book Feedback Control of Computing Systems Hellerstein,

ConclusionConclusion

Padala paper uses integral control law in Padala paper uses integral control law in most places.most places.

It uses empirical methods for generating It uses empirical methods for generating system model system model

Slides gave just enough required Slides gave just enough required background.background.

Control theory is a huge field with lots of Control theory is a huge field with lots of books (mainly used in EE, MECH, CHEM)books (mainly used in EE, MECH, CHEM)– Read books/papers/if further interestedRead books/papers/if further interested