Feedback command for MIMO systems in MATLAB

I have a state space model with 12 outputs and 4 inputs. I want to close the loop of 8th output with 3 input. then in outer loop i want to close outer loop for 1 output and 3 input again (Quadrotor Pitch and X position states). I have designed PD controller for both loops which is in feedforward.
states = {'x' 'y' 'z' 'u' 'v' 'w' 'Phi' 'Theta' 'Psi' 'p' 'q' 'r'};
inputs = {'Thrust' 'Roll Torque' 'Pitch Torque' 'Yaw Torque'};
outputs = {'x' 'y' 'z' 'u' 'v' 'w' 'Phi' 'Theta' 'Psi' 'p' 'q' 'r'};
STATE_SPACE_MODEL = ss(A,B,C,D,'statename',states,'inputname',inputs,'outputname',outputs);
Now, I can close the first inner loop this way
Pitch_State=STATE_SPACE_MODEL('Theta','Pitch Torque');
PITCH_CL=feedback(Pitch_State*P_PD,1);
now, i want to close the outer loop that contains 'x' state and have a seperate PD controller. I cant find out how to close the outer loop using feeback command can anyone help me out?

 採用された回答

Paul
Paul 2021 年 1 月 25 日

0 投票

I think this does what you want (assuming negative feedback)
Pitch_State = STATE_SPACE_MODEL({'x';'Theta'},'Pitch Torque')
PITCH_CL = feedback(Pitch_State*P_PDinner,1,2);
PITHC_CL = feedback(PITCH_CL,P_PDOuter,1,1);
PITCH_CL will have one input and two outputs still named 'Pitch Torque' and 'x' / 'Theta' respectively. You'll probably want to rename that input.

6 件のコメント

Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2021 年 1 月 25 日
let suppose
N=100;
Pinner_PD=0.15+(0.32*N/(1+(N/s)));
P_outter=0.15+(0.32*N/(1+(N/s)));
and if we run the code below
Pitch_State = STATE_SPACE_MODEL({'x';'Theta'},'Pitch Torque')
PITCH_CL = feedback(Pitch_State*P_PDinner,1,2);
PITHC_CL = feedback(PITCH_CL,P_PDOuter,1,1);
then i get this error
Error using * (line 80)
Model I/O dimensions must agree.
Error in Untitled3 (line 3)
PITCH_CL = feedback(Pitch_State*P_PD,1,2);
Paul
Paul 2021 年 1 月 26 日
編集済み: Paul 2021 年 1 月 26 日
Transcription and typo errors on my part:
Pitch_State = STATE_SPACE_MODEL({'x';'Theta'},'Pitch Torque')
PITCH_CL = feedback(Pitch_State*P_PDinner,1,1,2);
PITCH_CL = feedback(PITCH_CL*P_PDOuter,1,1,1);
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2021 年 1 月 26 日
Thanks alot!!!
It worked!
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2021 年 1 月 26 日
can you tell me how can i plot the margins/bode of open loop (X outer)?
Paul
Paul 2021 年 1 月 26 日
What have you tried so far?
After you close the inner loop, how would you form the open loop transfer function for the outer loop?
Muhammad Adeel Ahsan Awan
Muhammad Adeel Ahsan Awan 2021 年 1 月 26 日
I tried and i obtained the required bode plot

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeControl System Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by