LQR issues and converting minreal gains to full-state feedback
14 ビュー (過去 30 日間)
古いコメントを表示
I have a 7th order system that I am trying to obtain full-state feedback gains for using LQR.
When I use LQR on the system, I get the following error:
------------------------------------begin error-------------------------------------------------------
The "lqr" command failed to stabilize the plant or find an optimal feedback gain. To remedy this problem:
1. Make sure that all unstable poles of A are controllable through B (use MINREAL to check)
2. Modify the weights Q and R to make [Q N;N' R] positive definite (use EIG to check positivity).
------------------------------------end error-------------------------------------------------------
The unstable poles of the system are controllable and condition 2 is met because I am using Q = I and R = I (of correct size).
If I use minreal on my system with C = I, I am able to use LQR to get a set of gains for the reduced system.
Two questions
- Why isn't the LQR command working with the full system?
- Is there a way to convert the set of gains from the reduced system into full state feedback gains?
I have attached a file containing the full system and reduced system.
0 件のコメント
回答 (2 件)
Sebastian Castro
2015 年 8 月 20 日
編集済み: Sebastian Castro
2015 年 8 月 20 日
For your first question, the full system is not controllable so LQR isn't expected to work. For the system to be controllable, the rank must be 7 (the total number of states), and it isn't.
>> rank(ctrb(sys))
ans = 4
For your second question, it's a little involved. You can look at the controllability staircase form using
[Abar,Bbar,Cbar,T,k] = ctrbf(sys.A,sys.B,sys.C);
Then, you can find an LQR controller on the controllable portion (in this case, states 4:7).
K = lqr(Abar(4:7,4:7),Bbar(4:7,:),eye(4),eye(3))
You can pad the resulting K matrix with a bunch of zeros and then use the transformation matrix to get something that will work on the full system.
Kaug = [zeros(3,3) K];
Ktrans = Kaug*T;
Then, you can string this together as follows:
X = ss((Ap-Bp*Ktrans),zeros(7,3),eye(7),Dp);
(If you want this to be a LQR servo, the B matrix could instead be Bp*Ktrans)
Two of the poles of this system above were basically zero, but slightly positive. I was hoping this was a numerical issue, so I tried to simulate this with an initial condition of 1 for the first state and was happy to see a stable response.
t = (0:0.01:100)';
lsim(X,zeros(3,length(t)),t,[1 0 0 0 0 0 0])
- Sebastian
1 件のコメント
caidan007
2019 年 3 月 13 日
I used this method for a higher order(n=64) MIMO system dx=Ax+Bu,y=Cx. I have attached a file with matrix A,B,C,D data.
sys=ss(A,B,C,D);
>> rank(ctrb(sys))
ans =
8
so,there are 56 uncontrollable states and 8 controllable states. Then
[Abar,Bbar,Cbar,T,k] = ctrbf(sys.A,sys.B,sys.C);
K = lqr(Abar(57:64,57:64),Bbar(57:64,:),eye(8),eye(4));
Kaug = [zeros(4,56) K];
but I found (A-B*Ktrans) has many eigenvalues with positive real part, that means the full system with feedback gain Ktrans is unstable.
So,for a not fully controllable system,how can I get feedback gain Ktrans.
Thanks for your reply!
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!