フィルターのクリア

How do I choose the desired final states when i simulate my state space model?

7 ビュー (過去 30 日間)
qwasp
qwasp 2019 年 12 月 26 日
コメント済み: Raj 2019 年 12 月 27 日
I'm trying to simulate a state space model with three inputs (u1,u2,u3) and three disturbances (d1,d2,d3). I'm using lqr for the control design, but i'm not sure how to simulate the response of the system. I've tried both step and lsim but neither of them lets me choose my desired states. The states are 3 angular velocities, 3 angles (roll, pitch, yaw) and three equations that relates u1,u2 and u3 to eachother. How would I tell my system to, for example, change the pitch angle 10 degrees and then plot the results of this?

回答 (1 件)

Raj
Raj 2019 年 12 月 27 日
"How would I tell my system to, for example, change the pitch angle 10 degrees and then plot the results of this?"
It's a quite straightforward case of 'reference tracking'. Whatever are your desired output state values, you have to subtract them from the system state output and feed the error to the LQR controller (or any controller for that matter). The controller will try to minimize the error to zero thus taking your system output to the desired value. For your example case, subtract 10Deg from the output state pitch angle coming from the system and feed the error to LQR controller. Tune the weight matrices 'Q' and 'R' to get desired tracking response. Hope this helps! Get back in case you get stuck or need further clarification.
  4 件のコメント
qwasp
qwasp 2019 年 12 月 27 日
Okey, but that is using Simulink, right? I would want to simulate it through code, do you know how to do that?
Raj
Raj 2019 年 12 月 27 日
It doesn't matter. The logic remains same. 'lsim' gives you the system response. You need to subtract that from 'desired reference value' and multiply the error with LQR gain matrix before giving as input back to the system. The simulink model picture from the link I posted earlier will help to make things clear.

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

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by