Function Reference    
feedback

Feedback connection of two LTI models

Syntax

Description

sys = feedback(sys1,sys2) returns an LTI model sys for the negative feedback interconnection.

The closed-loop model sys has as input vector and as output vector. The LTI models sys1 and sys2 must be both continuous or both discrete with identical sample times. Precedence rules are used to determine the resulting model type (see Precedence Rules).

To apply positive feedback, use the syntax

By default, feedback(sys1,sys2) assumes negative feedback and is equivalent to feedback(sys1,sys2,-1).

Finally,

computes a closed-loop model sys for the more general feedback loop.

The vector feedin contains indices into the input vector of sys1 and specifies which inputs are involved in the feedback loop. Similarly, feedout specifies which outputs of sys1 are used for feedback. The resulting LTI model sys has the same inputs and outputs as sys1 (with their order preserved). As before, negative feedback is applied by default and you must use

to apply positive feedback.

For more complicated feedback structures, use append and connect.

Remark

You can specify static gains as regular matrices, for example,

However, at least one of the two arguments sys1 and sys2 should be an LTI object. For feedback loops involving two static gains k1 and k2, use the syntax

Examples

Example 1




To connect the plant

with the controller

using negative feedback, type

and MATLAB returns

The result is a zero-pole-gain model as expected from the precedence rules. Note that Cloop inherited the input and output names from G.

Example 2

Consider a state-space plant P with five inputs and four outputs and a state-space feedback controller K with three inputs and two outputs. To connect outputs 1, 3, and 4 of the plant to the controller inputs, and the controller outputs to inputs 4 and 2 of the plant, use

Example 3

You can form the following negative-feedback loops

by

Limitations

The feedback connection should be free of algebraic loop. If and are the feedthrough matrices of sys1 and sys2, this condition is equivalent to:

See Also
series      Series connection

parallel    Parallel connection

connect     Derive state-space model for block diagram interconnection


  evalfr filt