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

6 次查看(过去 30 天)
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 个评论
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 PID Controller Tuning 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by