フィルターのクリア

icare function doesn't return the value for X_lqr, K_lqr.

4 ビュー (過去 30 日間)
규연
규연 2024 年 3 月 28 日
コメント済み: 규연 2024 年 3 月 28 日
I using icare function for the lqr controller.
Alift is 9x9 matrix, Blift is 9x1 matrix, Q is 9x9 identity matrix, and R is 1.
Alift, Blift matrix is work well.
But it only return the L_lqr(9x1) matrix.
What is the problem?
Below is my code.
x_ref = [5 5]';
x_ref_lift = liftFtn(x_ref);
Unrecognized function or variable 'liftFtn'.
[X_lqr, K_lqr, L_lqr] = icare(Alift, Blift, Q, R);
for m = 1 : Nsim - 1
u = -K_lqr * (xlift2(:, end) - x_ref_lift);
xlift2 = [xlift2, Alift * xlift2(:, end) + Blift * u]; % Lifted dynamics
end
  1 件のコメント
규연
규연 2024 年 3 月 28 日
I don't know why, but L_lqr(9x1) matrix's components are all complex number.

サインインしてコメントする。

採用された回答

Sam Chak
Sam Chak 2024 年 3 月 28 日
OP: I don't know why, but L_lqr(9x1) matrix's components are all complex number.
The description in icare() documentation says that the syntax "[X,K,L] = icare(A,B,Q,R,S,E,G)" computes the unique stabilizing solution X, state-feedback gain K, and the closed-loop eigenvalues L of the following continuous-time algebraic Riccati equation.
  2 件のコメント
Sam Chak
Sam Chak 2024 年 3 月 28 日
%% Double Integrator system, x" = u
A = [0 1;
0 0];
B = [0;
1];
%% Settings to force the Controller for a critically-damped response, u = – 2·x' – x
Q = diag([1 2]);
R = 1;
%% Tuning by LQR method
[K, X, L] = lqr(A, B, Q, R)
K = 1×2
1.0000 2.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
X = 2×2
2.0000 1.0000 1.0000 2.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
L = 2×1
-1.0000 -1.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
%% Tuning by solving Continuous-time Algebraic Riccati Equations
[X, K, L] = icare(A, B, Q, R)
X = 2×2
2.0000 1.0000 1.0000 2.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
K = 1×2
1.0000 2.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
L = 2×1
-1.0000 -1.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
규연
규연 2024 年 3 月 28 日
i think the system has the problem.
i'll try lqr controller for another system.
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Computations についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by