Consider the 3x3 MIMO model P_sys with inputs and outputs as shown:
K is a PI controller that is used to stabilize the third output,i.e., loop 1 is closed first.
I wish to include the dynamics of the controller K in the reduced 2x2 MIMO model with inputs I_1,I_2 and outputs r_g,\nu
Please confirm if I have used the command connect properly in the code as follows:
load P_sys.mat
s = tf('s')
k_p = 1;
k_i = 18.8496;
K = k_p + k_i/s;
K.u = 'e_omega';
K.y = 'T_e';
Sum = sumblk('e_omega = omega_p_ref - \omega_p');
T = connect(P_sys,K,Sum,{'I_1','I_2','omega_p_ref'},{'r_g','\nu'});
I understand that T is now a 3x2 system, but if I simply ignore the input 'omega_p_ref', I end up with a 2x2 system
Someone who has experience of using this command, please confirm if what I have done is correct.
Thanks a bunch!
Edit: Added the P_sys state space information below for convenience
A = [-10.1743147787628 6.33848393443564 2.83053960557233e-05 -2.00486274008812e-05 0.0101156376822215;
-9.16775143671759 0.627823658752316 1.98137772390063e-05 -1.75443812073728e-05 0.00634588061855046;
783220167.460741 -487937375.295125 -2182.46555386313 1545.34164838041 -778703.196403871;
-1627527900.69975 1013931618.56602 4535.35552271822 -3877.96970385813 4820427.94201476;
-404.660712284203 -722.474615698841 0 -0.000665806346950841 -0.139419875340118];
B = [0 0 0;
0 0 0.0220422852001799;
127095767.644570 0 0;
-477713516.049144 2383781669.12079 0;
0 0 4.27350427350427];
C = [1 0 0 0 0
0 1 0 0 0
0 0 0 0 1];
D = 0;
P_sys = ss(A,B,C,D);
P_sys.Inputname = {'I_1','I_2','T_e'};
P_sys.Outputname = {'r_g','\nu','\omega_p'};
P_sys.Statename = {'r_g','\nu','p_p','p_s','\omega_p'};
You can try to omit $\omega_{p,ref}$ as follows:
This will give you a closed loop system with 2 inputs and 2 outputs.
If that is suitable for your needs depends of course on what you are trying to achieve. If you want to keep the third input, your code should be fine (assuming the order of the inputs/outputs is correct as well as the system matrices).