Posted 2017-09-13
I want to say this is a folk theorem (borrowing terminology from game theory) in that everyone who does optimal control theory knows about this stuff, probably,[1] but I haven't really seen it stated explicitly anywhere. If anyone does indeed work on optimal control, I'd love to know your thoughts! (even if you don't, I'd still like to know your thoughts on it!)
For context, I'm currently leading a team on path planning for fixed-wing UAVs (I still don't really know who put me in charge of this stuff, or why for that matter–-overall, it seems pretty terrifying for them, but kinda fun for me), and I wondered why I hadn't actually seen least squares in many papers on fixed-wing control. I still haven't gotten an answer to the question, to be honest, but I did waste some potentially productive time showing that PID LS. Some quick definitions: let be our control input and allow to be the error of the function (that is, where is the desired position and is the current position), then a PID controller is defined as
where each of the variables are a gain or proportionality constant. Say is the proportional constant (i.e. how much of is proportional to the current error), is the integral proportionality constant (i.e. how much of is proportional to the integral of the error), and is the derivative constant (i.e. ditto). For a more thorough explanation for what each of these means intuitively, see the PID wikipedia page.
Anyways, I'll likely make a separate (more introductory) post to least squares but, for now, I define an LS problem to be an optimization problem of the form, for arbitrary but given
where the norm is the usual -norm (i.e. ). It's notable that this problem has an analytical solution (not that you'd necessarily want the analytical solution for most big-enough scenarios) and is extremely well-behaved for most optimization methods.[2] Now, consider the following objective function with trivial equality constraints (e.g. , for convenience, by setting ) and being some proportionality constant (I'll make the connection to the original variables above, soon):
Minimizing this function by setting its gradient to zero (this is necessary and sufficient by differentiability, convexity, and coerciveness [that is, , whenever ]) gives the solution[3]
or, after rearranging
which allows the following correspondence between the original PID and the LS problem to be
So, now we've given the condition we wanted and we're done!
Anyways, you may ask, why is this useful? I guess it kind of extends the framework to add constraints from your control surface, or secondary objectives. To be completely honest, though? I have no idea.
[1] | I mostly know people who do hardware work, etc. on UAVs, so I don't really have a representative sample of control people. |
[2] | PolitiFact: Mostly true. I mean the usual cases (e.g. first-order methods, second-order methods, or conjugate gradient/quasi-newton methods). It's horribly behaved in conic program (SOCP) solvers. |
[3] | There's an immediate generalization here: any control of the form can be immediately written as the minimizer to an energy function . We can actually go further and note there's yet another generalization to any control of the form , where each is symmetric and (strictly) positive definite. This is true as each has an inverse and a 'square root' matrix (e.g. let, be some positive-definite matrix. We know for and diagonal , thus ), such that the energy function is written in terms of these. Though it's somewhat enlightening (I guess), I leave the derivation as an exercise for the reader. |