Hi everyone,
I'm trying to design an lqr controller for a linear state space model. I have found my feedback gain matrix k: my problem is how to get the states 'x' from the state space model output for the equation:
u=-kx
I have read the matlab help on State Estimator Design but could not apply this to my problem. I found 'L' and created a second state-space model like in the help file with equations:
[x.] = [A-BK BK][x] [e.] = [0 A_LC][e]
e=x-estimatedX
Does this output not show the difference between the actual state 'x' and the estimated state?
When entering this into simulink, an error occurred saying invalid parameter for C... When B was changed, C would be accepted as 0.
I also read about the function augstate but do not understand how to retrieve the 'x' states from this new system either.
Any help on how to obtain the states 'x' from the state space model output would be greatly appreciated!
Thanks, Declan

 채택된 답변

Arkadiy Turevskiy
Arkadiy Turevskiy 2012년 2월 13일
편집: Arkadiy Turevskiy 2014년 6월 11일

0 개 추천

If I understand correctly, you are trying to simulate your LQR controller in Simulink. LQR controller uses full state vector x for feedback, so to get x, use state-space block, and set C to be a unity matrx and D to be zero.
If you already have your A matrix defined in a variable a, you can do this like that:
>>c=eye(size(a));
>>d=zeros(size(a))
Now if you use State-Space block in Simulink and specify a,b,c,d (where c and d are created as shown above), the output of this block is your state x.
In real-life implementation LQR assumes that you are actually measuring x and using it in feedback control. If you cannot measure x, but can only measure some outputs (y), then you need to design an estimator and use LQG control.
This doc page might help:
HTH.
Arkadiy

댓글 수: 2

Declan
Declan 2012년 2월 13일
Arkadiy thank you for your help!
So obvious when someone tells you...
Thanks again
Declan
nadin geies ahmed geies
nadin geies ahmed geies 2017년 12월 11일
how can i simulate the u on matlab

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

sameh bdran
sameh bdran 2015년 9월 17일

0 개 추천

i want ask about lqr for x= Ax+Bu+Fw how make mfile control

Community Treasure Hunt

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

Start Hunting!

Translated by