feedback(s​ys1,sys2,f​eedin,feed​out) MAYBE incorrect

16 次查看(过去 30 天)
>>sys=[tf(1,[1 1 0]) tf(1,[1 1 0])]
sys =
From input 1 to output:
1
-------
s^2 + s
From input 2 to output:
1
-------
s^2 + s
ITS OK, BUT
>>sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
1
------------
s^2 + s + 10
WHY NOT SO AS
From input 2 to output:
1
-------
s^2 + s

回答(2 个)

Paul
Paul 2020-11-12
It is correct. The plant model, sys, can be written algebraically as:
Y(s) = G1(s)*U1(s) + G2(s)*U2(s)
where G1(s) = G2(s) = 1/(s^2 + s)
Algebraically, the feedback command implements:
U1(s) = R1(s) - 10*Y(s)
Substitute:
Y(s) = G1(s)*(R1(s) - 10*Y(s)) + G2(s)*U2(s)
Solve:
Y(s) = G1(s)/(1+10*G1(s))*R(s) + G2(s)/(1 + 10*G1(s))*U2(s)
So we have
sysf = [G1(s)/(1 + 10*G1(s)) G2(s)/(1 + 10*G1(s))]
which is exactly the result you obtained from the feedback command (because G1(s) == G2(s))
  2 个评论
Gennady
Gennady 2020-11-13
This is not entirely correct from the standpoint of control theory. Often (for example, when plotting a step response), it is necessary to analyze the response to each input separately without summation. In this case, there will be an error.
Paul
Paul 2020-11-13
编辑:Paul 2020-11-14
It is entirely correct from the standpoint of control theory.
The summation is inherent in your definition of sys. You defined sys as 1 x 2 transfer function matrix. In other words, the input/output relationship defined by sys is:
Y(s) = [G1(s) G2(s)] * [U1(s) ; U2(s)] % row x column
which is exactly what I wrote in my answer. If you don't want the summation and would rather keep the outputs of G1 and G2 separate, you need a different transfer function matrix, perhaps:
sys = tf(1,[1 1 0])*eye(2)
which is a 2x2, diagonal transfer function matrix. Then you get the result you were expecting:
>> sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output...
1
1: ------------
s^2 + s + 10
2: 0
From input 2 to output...
1: 0
1
2: -------
s^2 + s
Continuous-time transfer function.
Though in this case you're representing a decoupled system with two inputs and two outputs; hence, the zeros from u1 to y2 and from u2 to y1.
If, instead of a single 2 x 2 system, you really want to be able to operate simultaneously on more than one SISO system, you should look into Tunable Models and Model Arrays.

请先登录,再进行评论。


Gennady
Gennady 2020-11-16
Thanks for the answer! A little clarification, if I may. Did I understand correctly that in MATLA CST the following two schemes are equivalent.
And what do you advise me to use in my case the third scheme
  2 个评论
Paul
Paul 2020-11-16
Those three are all different systems and all require different calculations to compute the input/output relationsship, which in all cases should be a 1 x 2 transfer function matrix (2 inputs, 1 output). Also, in picture #2 you should mark that input as R2, and keep U2 as the input to G2.
Because they are simple examples, the transfer function matrix can be written by inspection, which we can compare to using commands like feedback etc. We will assume that all of the feedback paths are negative feedback (not shown explicilty in your diagrams) and that in case 1 and case 2 the output Y is the sum of the outputs from G1 and G2 respectively.
Case 1:
>> G1 = tf(1,[1 1 0]);G2 = tf(2,[1 1 0]);
>> sys = [G1 G2];
>> sysf = feedback(sys,10,1,1)
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
------------
s^2 + s + 10
Continuous-time transfer function.
>> [minreal(G1/(1 + 10*G1)) minreal(G2/(1 + 10*G1))] % by inspection
ans =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
------------
s^2 + s + 10
Continuous-time transfer function.
Case 2:
>> sys=[G1 G2];
>> sysf = feedback(sys,[10;10])
sysf =
From input 1 to output:
1
------------
s^2 + s + 30
From input 2 to output:
2
------------
s^2 + s + 30
Continuous-time transfer function.
>> [minreal(G1/(1+10*G1+10*G2)) minreal(G2/(1+10*G1+10*G2))] % by inspection
ans =
From input 1 to output:
1
------------
s^2 + s + 30
From input 2 to output:
2
------------
s^2 + s + 30
Continuous-time transfer function.
Case 3:
>> sysf=series(feedback(append(G1,G2),10,1,1),[1 1])
sysf =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
-------
s^2 + s
Continuous-time transfer function.
>> [feedback(G1,10) G2]
ans =
From input 1 to output:
1
------------
s^2 + s + 10
From input 2 to output:
2
-------
s^2 + s
Continuous-time transfer function.
The "by inspection" computations use transfer function algebra, which is generally not recommended, though can come in handy for simple cases and for learning. Instead, use the model interconnection functions like feedback, etc., discussed here.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息

标签

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by