Feedback Control for Hackers

Introduction to feedback control in computer science

View project on GitHub

This blog intends to explore the concepts of feedback control applied to computer science. We will make use of the Scala programming language as well as the ReactiveX Framework. The concepts regarding feedback systems, as well as some of the images presented in this blog, are taken from the book Feedback Control for Computer Systems [1] by Philipp K. Janert. Although feedback control can generally be described in terms of complicated mathematics, this blog does not cover those but will rather focus on the higher level concepts and some practical applications related to computer science.

I am thankful for the help and suggestions of a number of people. Without them this blog would not have been written!

Introduction

Enterprise systems are often built to maintain a flow of arbitrary items in a sequence of processing steps. For example, an online retailer wants to manage the flow of packages through its facilities. As a control mechanism the number of pending orders released to the warehouses per time unit is used. The main problem for this control mechanism is how to throttle this flow such that the warehouses are not idle, but are not overflowing either.

A solution for this might be the so called feed-forward control method in which one verifies for each type of order how long the warehouses take to process it and base throttling calculations on these results. This strategy will work, as long as there are no disturbances of the workflow. However, conveyors may run slower or faster than expected, a packing machine may malfunction which makes that one single order takes longer to be processed or the internal workings of a certain part of the process is unknown. All kinds of uncertainties (random effects or lack of knowledge) may happen that cannot be dealt with in feed-forward control.

At this point one might argue that this is an unfair game. We are supposed to maintain a flow of items while neither overwhelming nor starving the downstream processing steps. In fact, we cannot predict when these processing steps are overwhelmed or starved caused by the item flow, given the uncertainties that come with this system.

A solution to this problem that also incorporates this uncertainty is called feedback control. Here a certain metric is continuously measured and compared to a reference signal. The system's output then is adjusted based on the difference between the reference signal and the metric's result. In the retailer example, this metric may well be the number of orders that are currently being processed in the warehouses. Comparing this metric to a certain reference number gives insight in how to throttle the stream, either increasing or decreasing it or keeping it as it currently is.

Since feedback control takes the current state of the system into account, it can easily react to changes and uncertainties. This makes it more robust than feed-forward control.

Important however is that feedback control is not about optimization. Tasks like ''Make the flow through the system as large as possible'' cannot be solved by feedback control alone. These types of tasks instead need an optimization strategy. This however does not infer that feedback control cannot be used in optimization problems. Often the reference signal is determined by the optimization strategy.

[1] Janert, Philipp K. © 2014 Feedback Control for Computer Systems. Published by O'Reilly Media, Inc.