MATLAB Feedback

1.1k Views Asked by At

I am trying to use the feedback function in matlab and for the most part I understand it. But I came across this syntax:

[x1 x2] = feedback(sys1, sys2, 1, 1, -1);

I have a vague idea of what this is doing but could someone explain this to me. Right now I understand that the sys1, sys2, 1 part represents a system like so:

enter image description here

But I don't understand what the extra ..1, -1); are doing and why it's outputing to x1 and x2.

1

There are 1 best solutions below

0
On

Can you explain what you don't understand? I think this documentation is really clear...

You can read it at http://mathworks.com/help/control/ref/feedback.html or by using help feedback

M = feedback(M1,M2,FEEDIN,FEEDOUT,SIGN) builds the more general feedback 
interconnection:

                   +------+
       v --------->|      |--------> z
                   |  M1  |
       u --->O---->|      |----+---> y
             |     +------+    |
             |                 |
             +-----[  M2  ]<---+

The vector FEEDIN contains indices into the input vector of M1 and
specifies which inputs u are involved in the feedback loop. Similarly, 
FEEDOUT specifies which outputs y of M1 are used for feedback. If SIGN=1 
then positive feedback is used. If SIGN=-1 or SIGN is omitted, then 
negative feedback is used. In all cases, the resulting model M has the 
same inputs and outputs as M1 (with their order preserved).

So as an example M1 is a MIMO system, with two inputs (v,u) and outputs (z,y) and M2 is a SISO system, then with feedback(M1,M2,1,1,-1);, you will get

                       +------+
       v -->O--------->|      |-------------+--> z
            |          |  M1  |             |
            |   u ---->|      |--------> y  |
            |          +------+             |
            |                               |
            +----------[  M2  ]<------------+

with feedback(M1,M2,2,2,-1);, you will get

                   +------+
       v --------->|      |--------> z
                   |  M1  |
       u --->O---->|      |----+---> y
             |     +------+    |
             |                 |
             +-----[  M2  ]<---+

with feedback(M1,M2,1,2,-1);, you will get

                       +------+
       v -->O--------->|      |--------> z
            |          |  M1  |           
            |   u ---->|      |-----+--> y
            |          +------+     |
            |                       |
            +----------[  M2  ]<----+

with feedback(M1,M2,2,1,-1);, you will get

                   +------+
       v --------->|      |-----------+---> z
                   |  M1  |           |
       u --->O---->|      |------> y  |
             |     +------+           |
             |                        |
             +-----[  M2  ]<----------+