How do I obtain the matrix Q and R in LQR?

조회 수: 130 (최근 30일)
Chin Keat Lim
Chin Keat Lim 2018년 4월 1일
답변: Solomon 2024년 3월 19일
In my state space model, it seems to have some uncontrollable states. As I am using the command of
sys=ss(A,B,C,D),
co = ctrb(sys),
controllability = rank(co),
I found out that it only have 2 controllability but then I have 6 states variable. Is this still possible to design a LQR controller for my system? And how do I obtain the matrices Q and R for the LQR controller?
  댓글 수: 1
Emir Acevedo
Emir Acevedo 2021년 12월 14일
Well, I had the same question few days a go...
You need to review the model's equations and find the size for the matrix Q and R. Check the form of the optimzation eq. The matrix R and Q hit the u and x vector columns (the inputs and the outputs). If you have a column vector x with 6x1 elem,ents in the input your Q matrix must be for 6xm elements. Is similar for R... The conditions to choose a correct Q and R matrix is that both must be definited and have a quadratric form.

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

답변 (3개)

Raj
Raj 2019년 5월 21일
My response is quite late but since nobody has answered this question let me give a try. Maybe it'll benefit other people with similar doubt.
Check whether the uncontrollable states are stable using the Eigen vlaues. There is a difference between controllability and Stability. Its quite possible that the states which are not controllable are already stable. In that case you can design LQR controller to stabilize and control the states which are contollable.
Regarding selection of Q and R, there is no specific rule here. Its just trial and error. You have to start with a nominal guess (I suggest use Bryson's rule here) and then see your system's time response. Retune the matrices to get the desired response.
Hope this helps!!

Emir Acevedo
Emir Acevedo 2021년 12월 14일
Well, I had the same question few days a go...
You need to review the model's equations and find the size for the matrix Q and R. Check the form of the optimzation eq. The matrix R and Q hit the u and x vector columns (the inputs and the outputs). If you have a column vector x with 6x1 elem,ents in the input your Q matrix must be for 6xm elements. Is similar for R... The conditions to choose a correct Q and R matrix is that both must be definited and have a quadratric form.

Solomon
Solomon 2024년 3월 19일
I encountered a difficulty with Genetic Algorithm (GA). I haven't ever used GA. what fitness equation do I use in finding the weighting matrices Q & R. I am waiting your replay.
sincerely yours

Community Treasure Hunt

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

Start Hunting!

Translated by