1 / 28

Feedback Control For programmers and other strangers

Learn about feedback control, an automated method to choose a system's configuration parameters in order to achieve a desired behavior in the presence of uncertainty and change. Understand how feedback works and the challenges it presents. Discover different types of feedback loop architectures and their implementation. Find out how to tune feedback controllers and why feedback control is important for stable systems. This informative article by Philipp K. Janert from Principal Value, LLC is a must-read for programmers and anyone interested in understanding and implementing feedback control.

Download Presentation

Feedback Control For programmers and other strangers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Feedback ControlFor programmersand other strangers • Philipp K. Janert • Principal Value, LLC

  2. Feedback Control • Whatis feedback control? • Why should I care?

  3. Definition Feedback Control: An automatedmethod to choose a system’s configuration parameters in order to achieve a desired behavior in the presence of uncertainty and change.

  4. Examples Example 1: Cache Configuration Variable (Input): Size (Max number of items) Monitored Metric (Output): Hit rate (Success Rate)

  5. Examples Example 2: Sever Farm Configuration Variable (Input): Number of Instances Online Monitored Metric (Output): Average Response Time

  6. Examples Example 3: Waiting Queue Configuration Variable (Input): Number of Consumer Instances Monitored Metric (Output): Average Holding Time (or: Queue Length)

  7. Examples Example 4: Workflow Configuration Variable (Input): Release Rate or Flow Rate (Number of items released per period) Monitored Metric (Output): Length of Downstream Queue (Number of items pending)

  8. Examples Example 5: Graphics Engine Configuration Variable (Input): Graphics Resolution (Pixels per Game Object) Monitored Metric (Output): Memory Consumption

  9. In Common… • Cache Size • Server Instances • Queue Consumers • Flow Rate • Graphics Resolution Hit Rate Response Time Waiting Time Queue Length Memory Consumption • System transforming Input to Output • Desired Outcome • Uncertainty • Change

  10. Feedforward • Figure it out (Algorithmic-Deterministic) • Trial and Error (Heuristic) • Change on Demand (Firedrill…) Difficulty: How to control in the face of uncertainty and change? Schedule System

  11. Feedback Poor-Man’s Solution: • Pick some value • Check the output • Apply a correction • Repeat! Trial and Error: It’s no longer a bug, now it’s a feature!

  12. Feedback Loop Architecture r : Reference Value (“Setpoint”) e : Tracking Error u : Input (Configuration Parameter) y : Output (Tracked Metric) r e = r - y u y Controller Plant

  13. Feedback Loop Architecture - Cache What does the Controller Do? • Apply a correction in the correct direction… • … and of approximately the right size. Setpoint Error Size Hit Rate Controller Cache

  14. Feedback Loop Architecture - Cache Challenge: Correction must be approximately the right size • Too large: instability and oscillation • Too small: slow and insufficient response r = 0.8 e = r - y Size Hit Rate y = 0.7 Controller Cache (1000)

  15. Review, Part 1 What is Feedback and Why should I care? An automatedmethod to choose a system’s configuration parameters in order to achieve a desired behavior in the presence of uncertainty and change.

  16. Review, Part 2 How does feedback work? Feedback works by repeatedly comparing the output to the setpoint, and applying a corrective action in the correct direction. What are the challenges? Corrections must be approximately the right size: • Small enough to avoid instability and oscillation • Large enough to provide sufficiently quick response and compensation

  17. Controller Implementation Feedback controllers can be simple, because of the self-correcting nature of the loop architecture. (Feedforward controllers tend to be complex, by contrast.) Setpoint Error Input Output Controller Plant

  18. Controller Implementation Typical Choice: Cumulative Error (“Integral Control”) cumul += error action = gain * cumul Setpoint Error Input Output Controller Plant

  19. Controller Implementation Integral Controller Controller gain k = 1000

  20. Controller Implementation PI Controller (Proportional-Integral Controller) cumul += error action = kp * error + ki * cumul With two gain parameters: kp and ki (proportional and integral) 95% of all installed controllers are PI Controllers!

  21. Controller Tuning How does one find values for the gain parameters? • Theoretical Description (if available) • Inspection • Experiments and Formulas (Heuristics) Why is this better than finding the system parameters directly? • Controller gains need only be known approximately. • Feedback architecture gives robustness to change.

  22. Results - Cache

  23. Results - Cache

  24. Results - Cache

  25. Summary Feedback Control is an automatedmethod to choose a system’s configuration parameters in order to achieve a desired behavior in the presence of uncertainty and change. Feedback works by repeatedly comparing the output to the setpoint, and applying a corrective action in the correct direction.

  26. Summary Stable systems rely on feedback everywhere… • Electrical Engineering • Aeronautics • Process Control • Biological Processes • Economy • Relationships • … … isn’t it time we programmers give it a try?

  27. Philipp K. Janert Principal Value, LLC janert@principal-value.com

More Related