Friday, December 30, 2011

On Model Predictive Control (My recent quest)

Well, winter break hardly began and it is already coming to a close. I’ll have to write a more journal-like post to document the trip up to Snoeshoe, WV, but today I want to discuss one technique of control theory that I recently came to know and love. Model Predictive Control (MPC) has always fascinated me and been something of an enigma to me since I knew little about it. However, the more I read about the subject matter, the more I wanted to share some of my findings with the interwebs. I’ll go over the basics of the theory and then I’ll wrap up with a little example that I coded in Matlab yesterday. 

MPC is, in a nutshell, an practical implementation of numerical optimal control. All good control graduate students are exposed to optimal control at one point or another, but usually to the analytic (archaic at this point) calculus of variations (COV) version. In the COV incarnation, optimal control is difficult and adding constraints (limits and room boundaries), makes analytic computations nearly impossible. Numerical implementations of optimal control can solve this however.


 I should mention, before I delve to deep into the theory, that optimal control at its core is a open loop control strategy… we find the optimal controller values and then run the system. If our system is not perfect or we hit a wall, optimal control is now confused and more or less screwed! So we run into the classic justification of closed loop control… where we watch what is going on and change accordingly. This, of course, is where MPC comes in the picture. With MPC, we implement optimal control at ever time step ( every second, say) and use only the next step of the resulting control… if something were to happen, we re-optimize accordingly! 

In the following example, we have a three state system with state constraints and control constraints. In other words, if we think of this as a robot, the robot has a maximum speed, and is contained in a room. This system attempts to follow a desired path, shown in the figure below. The optimization window for MPC is adjusted and we show that by having an extended window, the path of the MPC controller approaches the optimal path (as given by a purely optimal controller).

Tuesday, December 6, 2011

Estimating uncertain parameters

One of the current problems for model-based prediction with uncertain parameters is establishing the uncertainty on the parameters in the first place! There are a few ways, some better than others, to establish some sort of probabilistic bounds on parameters, and I’ll discuss a few here. Before I delve into techniques for estimating the parameters, I should honestly reintroduce a topic that I’ve discussed on this blog in the past. Although the notation is somewhat academic, I believe the concepts of aleatory and epistemic uncertainty do help clarify certain concepts in stochastic/uncertain system. Epistemic uncertainty relates to uncertainty introduced by lack of model fidelity. Imagine a system that operates as a sine wave, but we model it as just a linear curve. At low (absolute) values, the curves look nearly identical, but at higher magnitude values a divergence occurs. In the case of our model, we introduce higher uncertainty than actually exists in the system. Aleatory uncertainty, on the other hand, remains nearly impossible to eliminate. Statistical variations in the environment and setup contribute to the uncertainty in the system.

 Now that we have some concepts clarified, I’ll discuss more detailed problems with trying to quantify these said uncertain parameters. If we have an experimental setup in a controlled environment, we can easily run many experiments and statistically quantify the range of values of a parameter. However, if we’re operating a robot in a complex environment, the parameters that we encounter might vary according to time or position. Experimentally determined values would ignore the change in model operation. To update the estimate of the parameter, we can use a real-time state/parameter observer. The Wikipedia article on observers is actually quite excellent, and I recommend it to anyone interested in learning more! Essentially, we can update our estimate for the parameter in real time as the robot traverses terrain. However, this only reveals the instantaneous value of the parameter. For prediction we want to use historical data to more accurately assess a future operational status.

The quick example that I was working on today is a simple mass-spring-damper system with uncertain damping. An extended Luemberger observer estimates the current value of the damping parameter given some uncertainty. Using this estimator, we’re able to estimate the values of the damping coefficient (even if bimodally distributed) as shown in the figure above.



Saturday, December 3, 2011

Week links in review

This week I stumble across quite a few fantastical links… most of which I already shared with the world via twitter. Here are a few things that I think are worthy of a second share or that never quite made it to twitter in the first place.

Political

Illustrated Guide to the Eurozone
Quite a comical (yet heavily biased toward the north) map of the Eurozone. Of course, we’re all aware of the sovereign depth crisis experienced in the south, but the extent of the widespread currency use across such varied nations is really the core of the problem… also why is Finland so creepy??

History

Rise of civilization and beer
I always thought this was more of a fringe theory than this documentary seems to indicate… then again, it is from the Discovery channel.

Art

The whiteboard as a canvas
I always wish I could use my whiteboard for something more than deriving dynamic equations and silly stick figures… this guy put me in my place.

Dragonborn Cover
Since part of my life recently has been spent in the realm of Tamriel, I figure I’d give some sort of shout out to the realm of the dragon-born.

Science

Build your own microbio Lab
I've always wish I could learn more about the biological sciences... just think, I could do some polymerase chain reaction analysis... I'd definitely check the surfaces in our basement lab... there would certainly be never discovered forms of life there... guarenteed!