Conversion from State Space to TF and then back to State Space
3 次查看(过去 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 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 PID Controller Tuning 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!