# Control Systems/Feedback Loops

## Feedback

A **feedback loop** is a common and powerful tool when designing a
control system. Feedback loops take the system output into
consideration, which enables the system to adjust its performance to
meet a desired output response.

When talking about control systems it is important to keep in mind that
engineers typically are given existing systems such as actuators,
sensors, motors,
and other devices with set parameters, and are asked to adjust the
performance of those systems. In many cases, it may not be possible to
open the system (the \"plant\") and adjust it from the inside:
modifications need to be made external to the system to force the system
response to act as desired. This is performed by adding controllers,
compensators, and feedback structures to the system.

## Basic Feedback Structure

center\|framed
 This is a basic feedback structure.
Here, we are using the output value of the system to help us prepare the
next output value. In this way, we can create systems that correct
errors. Here we see a feedback loop with a value of one. We call this a
**unity feedback**.

**Here is a list of some relevant vocabulary, that will be used in the
following sections:**

Plant:The term \"Plant\" is a carry-over term from chemical engineering to refer to the main system process. The plant is the preexisting system that does not (without the aid of a controller or a compensator) meet the given specifications. Plants are usually given \"as is\", and are not changeable. In the picture above, the plant is denoted with a P.\
Controller:A controller, or a \"compensator\" is an additional system that is added to the plant to control the operation of the plant. The system can have multiple compensators, and they can appear anywhere in the system: Before the pick-off node, after the summer, before or after the plant, and in the feedback loop. In the picture above, our compensator is denoted with a C.


Summer:A summer is a symbol on a system diagram, (denoted above with parenthesis) that conceptually adds two or more input signals, and produces a single sum output signal.\
Pick-off node:A pickoff node is simply a fancy term for a split in a wire.\
Forward Path:The forward path in the feedback loop is the path after the summer, that travels through the plant and towards the system output.\
Reverse Path:The reverse path is the path after the pick-off node, that loops back to the beginning of the system. This is also known as the \"feedback path\".\
Unity feedback:When the multiplicative value of the feedback path is 1.

## Negative vs Positive Feedback

It turns out that negative feedback is almost always the most useful
type of feedback. When we subtract the value of the output from the
value of the input (our desired value), we get a value called the
**error signal**. The error signal shows us how far off our output is
from our desired input.

Positive feedback has the property that signals tend to reinforce
themselves, and grow larger. In a positive feedback system, noise from
the system is added back to the input, and that in turn produces more
noise. As an example of a positive feedback system, consider an audio
amplification system with a speaker and a microphone. Placing the
microphone near the speaker creates a positive feedback loop, and the
result is a sound that grows louder and louder. Because the majority of
noise in an electrical system is high-frequency, the sound output of the
system becomes high-pitched.

### Example: State-Space Equation

{1 - \\frac{1}{s}A} = \\frac{1}{s - A}`</math>`{=html}

Pre-multiplying by the factor B, and post-multiplying by C, we get the
transfer function of the entire lower-half of the loop:

$$T_{lower}(s) = B\left(\frac{1}{s - A}\right)C$$

We can see that the upper path (D) and the lower-path T~lower~ are added
together to produce the final result:

$$T_{total}(s) = B\left(\frac{1}{s - A}\right)C + D$$

Now, for an alternate method, we can assume that **x**\' is the value of
the inner-feedback loop, right before the integrator. This makes sense,
since the integral of **x**\' should be **x** (which we see from the
diagram that it is. Solving for **x**\', with an input of **u**, we get:

$$x' = Ax + Bu$$

This is because the value coming from the feedback branch is equal to
the value **x** times the feedback loop matrix A, and the value coming
from the left of the summer is the input **u** times the matrix B.

If we keep things in terms of **x** and **u**, we can see that the
system output is the sum of **u** times the feed-forward value D, and
the value of **x** times the value C:

$$y = Cx + Du$$

These last two equations are precisely the state-space equations of our
system.}}

## Feedback Loop Transfer Function

We can solve for the output of the system by using a series of
equations:

$$E(s) = X(s) - Y(s)$$

$$Y(s) = G(s)E(s)$$

and when we solve for Y(s) we get:

$$Y(s) =  X(s) \frac{Gp(s)}{1 + Gp(s)}$$

The reader is encouraged to use the above equations to derive the result
by themselves.

The function E(s) is known as the **error signal**. The error signal is
the difference between the system output (Y(s)), and the system input
(X(s)). Notice that the error signal is now the direct input to the
system G(s). X(s) is now called the **reference input**. The purpose of
the negative feedback loop is to make the system output equal to the
system input, by identifying large differences between X(s) and Y(s) and
correcting for them.

### Example: Elevator

Here is a simple example of reference inputs and feedback systems:

### State-Space Feedback Loops

In the state-space representation, the plant is typically defined by the
state-space equations:

$$x'(t) = Ax(t) + Bu(t)$$

$$y(t) = Cx(t) + Du(t)$$

The plant is considered to be pre-existing, and the matrices A, B, C,
and D are considered to be internal to the plant (and therefore
unchangeable). Also, in a typical system, the state variables are either
fictional (in the sense of dummy-variables), or are not measurable. For
these reasons, we need to add external components, such as a gain
element, or a feedback element to the plant to enhance performance.

Consider the addition of a gain matrix K installed at the input of the
plant, and a negative feedback element F that is multiplied by the
system output *y*, and is added to the input signal of the plant. There
are two cases:

1.  The feedback element F is subtracted from the input before
    multiplication of the K gain matrix.
2.  The feedback element F is subtracted from the input after
    multiplication of the K gain matrix.

In case 1, the feedback element F is added to the input before the
multiplicative gain is applied to the input. If *v* is the input to the
entire system, then we can define *u* as:

$$u(t) =  Fv(t) - FKy(t)$$

In case 2, the feeback element F is subtracted from the input after the
multiplicative gain is applied to the input. If *v* is the input to the
entire system, then we can define *u* as:

$$u(t) = Kv(t) - Fy(t)$$

## Open Loop vs Closed Loop

![](System_3_KGpGb.png "System_3_KGpGb.png"){width="600"}

Let\'s say that we have the generalized system shown above. The top
part, Gp(s) represents all the systems and all the controllers on the
forward path. The bottom part, Gb(s) represents all the feedback
processing elements of the system. The letter \"K\" in the beginning of
the system is called the **Gain**. We will talk about the gain more in
later chapters. We can define the **Closed-Loop Transfer Function** as
follows:

$$H_{cl}(s) =  \frac{KGp(s)}{1 + Gp(s)Gb(s)}$$

If we \"open\" the loop, and break the feedback node, we can define the
**Open-Loop Transfer Function**, as:


$$H_{ol}(s) = KGp(s)$$

We can redefine the closed-loop transfer function in terms of this
open-loop transfer function:

$$H_{cl}(s) = \frac{H_{ol}(s)}{1 +Gp(s)Gb(s)}$$

These results are important, and they will be used without further
explanation or derivation throughout the rest of the book.

## Placement of a Controller

There are a number of different places where we could place an
additional controller.

:   {\| class=\"wikitable\"

\|- \|![](System_5_Positions.png "System_5_Positions.png"){width="400"}
\|- \|

1.  In front of the system, before the feedback loop.
2.  Inside the feedback loop, in the forward path, before the plant.
3.  In the forward path, after the plant.
4.  In the feedback loop, in the reverse path.
5.  After the feedback loop.

\|}

Each location has certain benefits and problems, and hopefully we will
get a chance to talk about all of them.

## Second-Order Systems

The general expression of the transfer function of a second order system
is given as:

$\frac{\omega_n^2}{s^2 + 2\zeta\omega_ns + \omega_n^2}$

where $\zeta$ and $\omega_n$ are damping ratio and natural frequency of
the system respectively.

### Damping Ratio

The damping ratio is defined by way of the sign $\zeta$. The damping
ratio gives us an idea about the nature of the transient response
detailing the amount of overshoot & oscillation that the system will
undergo. This is completely regardless of time scaling.

If :

-   $\zeta$ = zero, the system is undamped;
-   $\zeta$ \< 1, the system is underdamped;
-   $\zeta$ = 1, the system is critically damped;
-   $\zeta$ \> 1, the system is overdamped.

$\zeta$ is used in conjunction with the natural frequency to determine
system properties. To find the zeta value you must first find the
natural response!

### Natural Frequency

Natural Frequency, denoted by $\omega_n$ is defined as the frequency
with which the system would oscillate if it were not damped and we
define the damping ratio as $\zeta = \frac{\sigma}{\omega_n}$.

## System Sensitivity

