Problem understanding MATLAB 'feedback' command documentation
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am having some trouble understanding the documentation for the 'feedback' command in MATLAB and I would appreciate some help. This question may be long so please bear with me!
The link to the documentation is here: https://www.mathworks.com/help/control/ref/feedback.html
In the first example: 'Plant and Controller with Unit Feedback', the diagram has two blocks connected in series. The loop is then closed in unity, negative feedback.
The example explains that to create the negative feedback loop, the following command should be used:
sys = feedback(G*C,-1)
where 'G' and 'C' are the two blocks connected in series.
However I have tried to do this myself and I cannot make sense of the results.
For example, suppose there is a plant 'H' with transfer function:
and a simple proportional controller with unit gain:
.
These can be set up with the following code:
H = tf([1],[1 1 0])
W = pid(1,0,0,0) % standard pid input is: pid(Kp,Ki,Kd,Tf)
Suppose the blocks are connected in series and the loop closed with unity, negative feedback. Then the transfer function between the input and output should be:
For this system, this becomes:
=
=
.
= However if I run the unity negative feedback command suggested:
cl_sys = feedback(W*H,-1)
I get 
Where have I gone wrong? I'd appreciate any help. Thanks.
0 件のコメント
採用された回答
Ameer Hamza
2020 年 4 月 26 日
In your hand-calculations, you didn't consider the feedback gain. The actual transfer function of a closed-loop function is this
In your case, you considered G(s) = H(s)W(s), but you didn't consider H(s) = -1. If you take it into account, then you will get the same result as MATLAB.
7 件のコメント
Ameer Hamza
2020 年 4 月 29 日
Good that it finally got noticed. It will avoid a lot of confusion for the readers.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!