Via Automation - a tour of automatic control: Optimal control
Previously, we discussed the basics of regulation, that is, driving a system to some reference point and keeping it there (in our example, how a cow keeps their calcium levels stable after giving birth). This is at the core of automatic control. Indeed, moving from A to B, can be understood as driving a system to a new reference point (ie deciding how you want things and then keeping them that way). However, just that is not the crux of this post.
To make our point, should start with a small experiment. Grab a keycord and attach something sufficiently heavy, or alternatively, fill up a totebag. Now, while holding only the top of the keycord or bag, move the heavy object to any wall around you. What did you observe? Did your object hit the wall? Or perhaps, you were very careful and it took quite a while before you reached the wall? Now, if you have ever taken a gondola you may have noticed that besides a smooth ride, you can experience significant swings or seemingly extremely slow motion.
The point is that going from A to B (in our case, from the valley and onto the mountain) is rarely the only thing we care about. We may also care about safety, comfort, efficiency and so forth. What is more, we typically need to find some trade-off, there is rarely a uniformly ‘bestʼ way. Again, if we think of our gondola, going slowly is a good plan if we want to avoid motion sickness, but we also like to arrive at our destination sufficiently quickly, and do so in an energy-efficient manner. Then, how to select an appropriate strategy?
Integrating these type of trade-offs into automatic control brings us into the realm of what is called optimal control. Optimal control emerged in physics, as physical systems can be understood to take optimal paths in some abstract sense. We will not make it precise here, but if you have visited Technorama and seen the travelling ball exhibit, this is a visualisation of the ‘Brachystochrone problemʼ, as posed by the Swiss mathematician Johann Bernoulli in the late 1600s. We have a ball at point A, and we want to find the curve that would allow it to roll to a point B in the least amount of time. You might assume that the straight line shown in green (short dashes) below would be the fastest, however, this is a geometric optimal control problem (1). And the solution to Bernoulliʼs problem is different and doesn’t feel logical, as depicted below in dark green (long dashes).

This is fascinating mathematics, but let us consider a question that displays not only optimality but also some trade-offs, a question that might appear during a Christmas dinner: ‘Why are we not driving 200 km/h everywhere?ʼ Clearly, safety is a very important consideration, but there is more. For instance, air resistance grows quadratically with speed, as power is proportional to force times speed, we need 8 times more power to overcome air resistance when we just double the speed! This alone costs a lot of extra energy, and that’s before we even consider other notions of degradation at high speeds. Hence, if we want to get as far as possible using a single tank, the advice is not to drive as fast as possible. Indeed, there is usually an optimal range of cruising speeds (2). How to find this range is a question of optimization, as covered in several NCCR Automation posts before (3).
Now, returning to our gondola. When moving towards any of the intermediate towers or the end station, we cannot only rely on position control. Otherwise, we would probably approach the tower at full speed, abruptly stop and start swinging heavily. So much for your relaxing start of the day. Instead, we must trade off position control and angular control, while also keeping track of time. We cannot move too slowly. Optimal control allows us to handle this in a principled manner.
Differently put, we aim to find some controller such that we not only move from A to B, but we move from A to B optimally.
Now, you could model the gondola as an upside down cart on rails. However, then our model would ignore the swinging of the gondola completely. To include the dominant swinging effect, one can study the gondola through a classic benchmark system in automatic control, the so-called ‘pendulum on a cartʼ (4). This system is relatively simple, yet, it enables the study of a lot of fundamental control principles. For us, the important feature is that the swinging of the gondola is naturally matched to the swinging of the pendulum.
Then, using this model, one can aim to find a controller such that the gondola (the pendulum hanging from a cart) arrives at a tower with zero angular velocity and does not spin, in the least amount of time (5). Such a controller damps out excessive oscillations, but still brings you to your destination in a reasonable time. It is interesting to note that this question is of great importance in all sorts of industries, as cranes on a building site behave similarly.
In the above we followed the assumption that the rope is rigid (2), this makes the underlying computation easier. However, looking back to our previous post on feedback, are the resulting inputs any good when implemented on the real system? Fair question, especially since the resulting inputs are typically discontinuous. In the above we only touched upon ‘open-loopʼ optimal control, a name given to systems where we only consider time, but we will return to feedback when we discuss model-predictive control (MPC) in a later post. First, letʼs grab a coffee?
References
(1) For more historical remarks, in relation to today, see the following classic paper by Sussmann and Willems https://ieeexplore.ieee.org/document/588098
(2) To not refer to any particular manufacturers, we link to Wikipedia for further details: https://en.wikipedia.org/wiki/Fuel_economy _in_automobiles
(3) See for instance, What is gradient descent and why should I care? , Getting optimal, why convexity matters and Unprecedented overflow, why progress in his fiels alarms Yurii Nesterov.
(4) E.g., see https://ctms.engin.umich.edu/CTMS/index.php?example=InvertedPendulum§ion=SystemModeling
(5) See for instance the following conference paper by Ermidoro and coworkers https://ieeexplore.ieee.org/document/6858939
(6) In general, how to model these systems is far from obvious, one typically resorts to involved mass-springer-damper systems, with the gondola itself behaving like a pendulum. See for instance the following paper by Brownjohn https://www.sciencedirect.com/science/article/pii/S0141029697001132