Conversion from State Space to TF and then back to State Space

6 ビュー (過去 30 日間)
Shilp Dixit
Shilp Dixit 2012 年 10 月 26 日
I created a state space model with 2 inputs 4 outputs 4 states
used the
if true
sys_tf = tf(sys);
end
function to convert SS to tf. sys_tf comes out to a 4 X 2 matrix
Once I obtained this TF I added a PID feedback control to sys_tf(1,2) and sys_tf(3,2). Now when I convert this sys_tf to a state space model using
if true
[A,B,C,D] = ssdata(sys_tf);
sys1 = ss(A,B,C,D);
end
This creates s state space model with 2 inputs, 4 outputs and 30states. Why and how is this happening.
Thanks. Shilp
  2 件のコメント
Arkadiy Turevskiy
Arkadiy Turevskiy 2012 年 10 月 26 日
can you paste your code?
Shilp Dixit
Shilp Dixit 2012 年 10 月 26 日
if true
sys_mimo = SS(A, B, C, D, 'statename',states,...
'inputname',inputs,...
'outputname',outputs);
size(sys_mimo)
sys_mimo_tf = tf(sys_mimo);
Kd = 208025;
Kp = 832100;
Ki = 624075;
C = pid(Kp,Ki,Kd);
sys_mimo_tf(1,2) = sys_mimo_tf(1,2)*feedback(sys_mimo_tf(1,2),C);
% PID control for sys_mimo_tf(3,2)
Kd = 208;
Kp = 83;
Ki = 624;
C = pid(Kp,Ki,Kd);
sys_mimo_tf(3,2) = sys_mimo_tf(3,2)*feedback(sys_mimo_tf(3,2),C);
[A,B,C,D] = SSDATA(sys_mimo_tf);
sys_mimo1 = ss(A,B,C,D);
size(sys_mimo1)
end

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

採用された回答

Jonathan Epperl
Jonathan Epperl 2012 年 10 月 27 日
Some points:
Don't do "algebra" with tf variables, use the functions series, parallel and feedback.
sys_mimo1 = ss(sys_mimo) is going to convert the tf model to a ss model, I don't think there is a need for the extra step with ssdata.
This one here
sys_mimo_tf(1,2) = sys_mimo_tf(1,2)*feedback(sys_mimo_tf(1,2),C);
is probably not doing what you want it to, it will give you the transfer function
sys_mimo_tf(1,2)^2 / 1 + sys_mimo_tf(1,2)*C
so that's probably where many extra states come from. You should expect 2 extra states per added PID.
Lastly, look at the Hankel Singular Values or a similar measure to figure out whether there might be a lot of almost unobservable/almost uncontrollable states in your resulting model. That would indicate numerical issues.
  1 件のコメント
Shilp Dixit
Shilp Dixit 2012 年 10 月 27 日
Thank you... Will do as you suggested.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by