Why does this output gain work best?

36 Views Asked by At

Suppose I have a discrete time LTI system derived from test data that looks like this:

sys = ss([
   1.0000e+00   9.9997e-04;
  -6.6163e-07   9.9983e-01
], [
  -5.1767e-07;
  -1.1265e-04
], [
  -5.0000e-01   1.6724e-03;
  -9.2256e-04  -5.0012e-01
], [
  -9.4466e-07
   3.8677e-05
], 0.001);

I know from trial and error results that output feedback gain $K = [3100, 120]$ and feed-forward gain of ~17 is able to stabilize this system almost perfectly. But why? How would I go about deriving these gains mathematically? The gains btw represent a PD controller (P = 3100 and D = 120).

I have tried using dlqr method to generate optimal gains, but this method gives me gains that are far away from the best ones that I have derived using experiments.

Qc = C * C';
Rc = eye(size(sys.b)(2)) * 1e-4

[K, f, z] = dlqr(A, B, Qc, Rc)

K = K * inv(C)

This results in $K = [99.675, 113.062]$. I suppose the main issue here is that I use C * C' as cost function for state where I should instead use offset weights like [1, 0; 0, 0.001] since tracking performance for x1 is more important than tracking performance for x2 as is evident from manually tweaking the gains. But I don't know this ahead of time. How would I derive the perfect gains knowing only the system model? Is this doable? Is it possible to automate this process and at least eliminate having to tweak Qc and only focus on R?

I also derive output feedback gains by multiplying K with inverse of C since u = -Ky and y = Cx so dlqr returns result that is -KC so therefore if I then multiply it with inverse of C then I get output gains. But why is this never mentioned in literature? Is this even the full picture?

I have also calculated system poles when system is using my experimentally derived output feedback as follows (K = [3100, 120]):

[p, z] = pzmap(ss(A - B * K * C, B * K, C, D * K, 0.001))

This gives poles $p = [0.99643 + 0.01273i, 0.99643 - 0.01273i]$. This does make sense because there are some minor oscillations in the system when using these gains. (note that this is a discrete system so poles that are <1 mean that the system is stable). It seems that tweaking poles in this case would be an easier approach than tweaking Qc and Rc for dlqr. But what other information can I extract from the values of these poles?

What other information can I extract from this system in general that would help me control it better?