User:Vkadakkal
From Wikipedia, the free encyclopedia
[edit] LQR Controller with Preview (i/p depends on prev. i/p)
xk + 1 = Axk + Buk + fk
Performance Measure

Augment the system
![\left[\begin{array}{c}
x_{k+1}\\
v_{k+1}
\end{array}\right] =
\left[\begin{array}{c c}
A & 0\\
0 & 0
\end{array}\right]
\left[\begin{array}{c}
x_k\\
v_k
\end{array}\right]
+
\left[\begin{array}{c}
B\\
I
\end{array}\right]
u_k
+
f_{a_k}](../../../../math/1/c/9/1c95075a293493a383240e010fa76f25.png)
![x_{a_k} = \left[\begin{array}{c}
x_k\\
v_k
\end{array}\right]](../../../../math/3/4/b/34b7062ab855fec28235f7ad75681acb.png)
Performance measure is now:

where
,
![M =
\left[\begin{array}{c c}
0 & -T
\end{array}\right]](../../../../math/1/9/6/196840799b6006e04fc0355d1c79590c.png)
and
RA = R + T
Let
be the cost for moving the state from
to

![g[x_{a_k}] = min \left( \frac{1}{2} x_{ak}^TQ_Ax_k + u_k^TMx_{a_k} + \frac{1}{2}
u_k^TR_Au_k + g[x_{k+1}] \right)](../../../../math/d/d/1/dd1765a837186e704f8f806912f40a7d.png)
Assume it's solution to be
![g[x_{a_k}] = \frac{1}{2}x_{a_k}^TW_{N-k}x_{a_k} + x_{a_k}^TV_{N-k} + Z_{N-k}](../../../../math/a/3/4/a34eebca19b26b6ca4edd27eff51bee1.png)

![= min \left(\frac{1}{2}x_{a_k}^T[Q_A + A_A^TW_{N-k-1}A_A]x_{a_k} +
\frac{1}{2}u_k^T[R_A + B_A^TW_{N-k-1}B_A]u_k \right)+ ...](../../../../math/e/a/d/eadcba031887da879dc977541d940c21.png)


Differentiating w.r.t uk and equating it to 0, the optimal control
is found to be:
![u_k^* = -[R_A + B_A^TW_{N-k-1}B_A]^{-1}
\left[ (M + B_A^TW_{N-k-1}A_A)x_{a_k} + B_A^TV_{N-k-1} +
B_A^TW_{N-k-1}f_{a_k} \right]](../../../../math/f/1/b/f1bd9d67e2e27b65bf6d986f4566921a.png)
Let

where,
![S = [R_A + B_A^TW_{N-k-1}B_A]^{-1}](../../../../math/6/d/a/6da1cb8462ae9b04d5ad436b457e7302.png)



Feeding
back into the expression for
, we
get:
![RHS = \frac{1}{2}x_{a_k}^T[Q_A + A_A^TW_{N-k-1}A_A]x_{a_k} +
\frac{1}{2}u_k^TS^{-1}u_k - u_k^TS^{-1}u_k +
x_{a_k}^T [A_A^TW_{N-k-1}f_{a_k} + A_A^TV_{N-k-1}] +...](../../../../math/8/6/1/861711ed67c40eea88ecf168e4ad7fb3.png)

![= \frac{1}{2}x_{a_k}^T[Q_A + A_A^TW_{N-k-1}A_A - K_x^TS^{-1}K_x]x_{a_k} +
x_{a_k}^T [A_A^TW_{N-k-1}f_{a_k} + A_A^TV_{N-k-1}
- \frac{1}{2}K_x^TS^{-1}(U_v + K_f f_{a_k})] +...](../../../../math/3/4/a/34a6fd02b13d8bc6ff7d3205864e979a.png)

Grouping terms in the format for g[xk] and comparing, we get:


ZN − k = All Other terms...
VN − k and WN − k are solved iteratively. ZN − k is not needed for computation of control
, so is left
untouched!
[edit] LQR Controller with Preview
xk + 1 = Axk + Buk + fk
Performance Measure

Let g[xk] be the cost for moving the state from xk to
xN
![g[x_k] = min \left( \frac{1}{2} x_k^TQx_k + \frac{1}{2} u_k^TRu_k + g[x_{k+1}] \right)](../../../../math/3/b/1/3b133fedf5b1bc5863f10bc889dd7dba.png)
Assume it's solution to be
![g[x_k] = \frac{1}{2}x_k^TW_{N-k}x_k + x_k^TV_{N-k} + Z_{N-k}](../../../../math/b/b/e/bbe8a497a1222862be6759e2cfd8acdd.png)

![= min \left(\frac{1}{2}x_k^T[Q + A^TW_{N-k-1}A]x_k +
\frac{1}{2}u_k^T[R + B^TW_{N-k-1}B]u_k \right)+ ...](../../../../math/a/9/0/a90f52b67635ff14cc177ea0ef725eed.png)


Differentiating w.r.t uk and equating it to 0, the optimal control
is found to be:
![u_k^* = -[R + B^TW_{N-k-1}B]^{-1}B^T \left[ V_{N-k-1} + W_{N-k-1}Ax_k + W_{N-k-1}f_k
\right]](../../../../math/d/b/4/db441f865042e74bd5ecac7710688be3.png)
Let

where,
S = [R + BTWN − k − 1B] − 1
Uv = SBTVN − k − 1
Kx = SBTWN − k − 1A
Kf = SBTWN − k − 1
Feeding
back into the expression for g[xk], we get:
![RHS = \frac{1}{2}x_k^T[Q+A^TWA]x_k +
\frac{1}{2}[U_v^T + x_k^TK_x^T + f_k^TK_f^T][R + B^TWB][U_v + K_x x_k + K_f f_k]+
...](../../../../math/b/a/f/baf1c9b3caf89a12bdfc28c188e090de.png)
![- [U_v^T + x_k^TK_x^T + f_k^TK_f^T][B^TWAx_k + B^TV + B^TWf_k] +
...](../../../../math/2/8/e/28e0826c060168b92bb1e7643ccb4f87.png)
![x_k^T[A^TWf_k + A^TV] + f_K^TV + \frac{1}{2}f_k^TWf_k + Z](../../../../math/1/c/8/1c8e7503f2b30720b854d9ef3154ac9b.png)
Grouping terms in the format for g[xk] and comparing, we get:
![W_{N-k} = Q + A^TW_{N-k-1}A + K_x^T[R+B^TW_{N-k-1}B]K_x - 2K_x^TB^TW_{N-k-1}A](../../../../math/f/4/8/f4851447634d74d2325a826321254390.png)
But 
So


ZN − k = All Other terms...
VN − k and WN − k are solved iteratively. ZN − k is not needed for computation of control
, so is left
untouched!

