# Control Systems/Signal Flow Diagrams

## Signal-flow graphs

**Signal-flow graphs** are another method for visually representing a
system. Signal Flow Diagrams are especially useful, because they allow
for particular methods of analysis, such as **Mason\'s Gain Formula**.

Signal flow diagrams typically use curved lines to represent wires *and
systems*, instead of using lines at right-angles, and boxes,
respectively. Every curved line is considered to have a multiplier
value, which can be a constant gain value, or an entire transfer
function. Signals travel from one end of a line to the other, and lines
that are placed in series with one another have their total multiplier
values multiplied together (just like in block diagrams).

Signal flow diagrams help us to identify structures called \"loops\" in
a system, which can be analyzed individually to determine the complete
response of the system.

!An example of a signal flow
diagram.

### Forward Paths

A **forward path** is a path in the signal flow diagram that connects
the input to the output without touching any single node or path more
than once. A single system can have multiple forward paths.

### Loops

A **loop** is a structure in a signal flow diagram that leads back to
itself. A loop does not contain the beginning and ending points, and the
end of the loop is the same node as the beginning of a loop.

Loops are said to touch if they share a node or a line in common.

The **Loop gain** is the total gain of the loop, as you travel from one
point, around the loop, back to the starting point.

### Delta Values

The Delta value of a system, denoted with a Greek Δ is computed as
follows:

$$\Delta = 1 - A + B - C + D - E + F......+ \infty$$

Where:

-   A is the sum of all individual loop gains
-   B is the sum of the products of all the pairs of non-touching loops
-   C is the sum of the products of all the sets of 3 non-touching loops
-   D is the sum of the products of all the sets of 4 non-touching loops
-   et cetera.

If the given system has no pairs of loops that do not touch, for
instance, B and all additional letters after B will be zero.

### Mason\'s Rule

**Mason\'s rule** is a rule for determining the gain of a system.
Mason\'s rule can be used with block diagrams, but it is most commonly
(and most easily) used with signal flow diagrams.


If we have computed our delta values (above), we can then use **Mason\'s
Gain Rule** to find the complete gain of the system:


$$M = \frac{y_{out}}{y_{in}} = \sum_{k=1}^N \frac{M_k \Delta\ _k}{ \Delta\ }$$

Where M is the total gain of the system, represented as the ratio of the
output gain (y~out~) to the input gain (y~in~) of the system. M~k~ is
the gain of the k^th^ forward path, and Δ~k~ is the loop gain of the
k^th^ loop.

## Examples

### Solving a signal-flow graph by systematic reduction : Two interlocking loops

This example shows how a system of five equations in five unknowns is
solved using systematic reduction rules. The independent variable is
$x_{in}$. The dependent variables are $x_1$, $x_2$, $x_3$, $x_4$,
$x_{out}$. The coefficients are labeled $a, b, c, d, e$. Here is the
starting flowgraph:
frameless\|upright=2

$$\begin{align}
 x_1 &= x_\mathrm{in}+e x_3  \\
 x_2 &= b x_1+a x_4  \\
 x_3 &= c x_2 \\
 x_4 &= d x_3 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$

The steps for solving $x_{out}$ follow.

#### Removing edge c from x2 to x3

frameless\|upright=2

$$\begin{align}
 x_1 &= x_\mathrm{in}+e x_3  \\
 x_2 &= b x_1+a x_4  \\
 x_3 &= c x_2 \\
 x_3 &= c (b x_1+a x_4) \\
 x_3 &= bc x_1+ca x_4 \\
 x_4 &= d x_3 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$
frameless\|upright=2

#### Removing node x2 and its inflows

$x_2$ has no outflows, and is not a node of interest.
frameless\|upright=2
frameless\|upright=2

#### Removing edge e from x3 to x1

frameless\|upright=2

$$\begin{align}
 x_1 &= x_\mathrm{in}+e x_3  \\
 x_1 &= x_\mathrm{in}+e (bc x_1+ca x_4)  \\
 x_1 &= x_\mathrm{in}+ bce x_1+ ace x_4  \\
 x_2 &= b x_1+a x_4  \\
 x_3 &= bc x_1+ca x_4 \\
 x_4 &= d x_3 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$
frameless\|upright=2

#### Remove edge d from x3 to x4

frameless\|upright=2

$$\begin{align}
 x_1 &= x_\mathrm{in}+ace x_4 + bce x_1 \\
 x_3 &= bc x_1+ac x_4 \\
 x_4 &= d x_3 \\
 x_4 &= d (bc x_1+ac x_4) \\
 x_4 &= bcd x_1 + acd x_4 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$

Node $x_3$ has no outflows and is not a node of interest. It is deleted
along with its inflows.

$$\begin{align}
 x_1 &= x_\mathrm{in}+ace x_4 + bce x_1 \\
 x_4 &= bcd x_1 + acd x_4 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$
frameless\|upright=2

#### Removing self-loop at x1

frameless\|upright=2

$$\begin{align}
 x_1 &= x_\mathrm{in}+ace x_4 + bce x_1 \\
 x_1 (1-bce) &= x_\mathrm{in}+ace x_4  \\
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} x_4   \\
 x_4 &= bcd x_1 + acd x_4 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$
frameless\|upright=2

#### Removing self-loop at x4

frameless\|upright=2

$$\begin{align}
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} x_4   \\
 x_4 &= bcd x_1 + acd x_4 \\
 x_4 (1-acd) &= bcd x_1 \\
 x_4  &= \frac{bcd}{1-acd} x_1 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$
frameless\|upright=2

#### Remove edge from x4 to x1

frameless\|upright=2

$$\begin{align}
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} x_4   \\
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} \times \frac{bcd}{1-acd} x_1   \\
 x_4  &= \frac{bcd}{1-acd} x_1 \\
 x_\mathrm{out} &= x_4 \\
\end{align}$$

#### Remove outflow from x4 to x~out~

$$\begin{align}
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} \times \frac{bcd}{1-acd} x_1   \\
 x_\mathrm{out}  &= \frac{bcd}{1-acd} x_1 \\
\end{align}$$ $x_4$\'s outflow is then eliminated: $x_\mathrm{out}$ is
connected directly to $x_1$ using the product of the gains from the two
edges replaced.

$x_4$ is not a variable of interest; thus, its node and its inflows are
eliminated.

frameless\|upright=2

#### Eliminating self-loop at x1

$$\begin{align}
 x_1  &= \frac{1}{1-bce}x_\mathrm{in}+\frac{ace}{1-bce} \times \frac{bcd}{1-acd} x_1   \\
 x_1  (1-\frac{ace}{1-bce} \times \frac{bcd}{1-acd}) &= \frac{1}{1-bce}x_\mathrm{in}    \\
 x_1   &= \frac{1}{(1-bce) \times (1-\frac{ace}{1-bce} \times \frac{bcd}{1-acd}) }x_\mathrm{in}    \\
 x_\mathrm{out}  &= \frac{bcd}{1-acd} x_1 \\
\end{align}$$
frameless\|upright=2
frameless\|upright=2

#### Eliminating outflow from x1, then eliminating x1 and its inflows

frameless\|upright=2

$$\begin{align}
 x_1   &= \frac{1}{(1-bce) \times (1-\frac{ace}{1-bce} \times \frac{bcd}{1-acd}) }x_\mathrm{in}    \\
 x_\mathrm{out}  &= \frac{bcd}{1-acd} x_1 \\
 x_\mathrm{out}  &= \frac{bcd}{1-acd} \times \frac{1}{(1-bce) \times (1-\frac{ace}{1-bce} \times \frac{bcd}{1-acd}) }x_\mathrm{in} \\
\end{align}$$ $x_1$ is not a variable of interest; $x_1$ and its inflows
are eliminated

$$\begin{align}
 x_\mathrm{out}  &= \frac{bcd}{1-acd} \times \frac{1}{(1-bce) \times (1-\frac{ace}{1-bce} \times \frac{bcd}{1-acd}) }x_\mathrm{in} \\
\end{align}$$
frameless\|upright=2

#### Simplifying the gain expression

$\begin{align}
x_\mathrm{out}  &= \frac{-bcd}{bce+acd-1} x_\mathrm{in} \\
\end{align}$

frameless\|upright=2

### Solving a signal-flow graph by systematic reduction: Three equations in three unknowns

This example shows how a system of three equations in three unknowns is
solved using systematic reduction rules. The independent variables are
$y_1$, $y_2$, $y_3$. The dependent variables are $x_1$, $x_2$, $x_3$.
The coefficients are labeled $c_{jk}$. The steps for solving $x_1$
follow:
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2
frameless\|upright=2

## Electrical engineering: Construction of a flow graph for a RC circuit

![](AC_Source-R-C.svg "AC_Source-R-C.svg")

This illustration shows the physical connections of the circuit.
Independent voltage source S is connected in series with a resistor R
and capacitor C. The example is developed from the physical circuit
equations and solved using signal-flow graph techniques. Polarity is
important:

-   S is a source with the positive terminal at **N~1~** and the
    negative terminal at **N~3~**
-   R is a resistor with the positive terminal at **N~1~** and the
    negative terminal at **N~2~**
-   C is a capacitor with the positive terminal at **N~2~** and the
    negative terminal at **N~3~**.

The unknown variable of interest is the voltage across capacitor **C**.

Approach to the solution:

-   Find the set of equations from the physical network. These equations
    are acausal in nature.
    -   Branch equations for the capacitor and resistor. The equations
        will be developed as transfer functions using Laplace
        transforms.
    -   Kirchhoff\'s voltage and current laws
-   Build a signal-flow graph from the equations.
-   Solve the signal-flow graph.

### Branch equations

![](AC_Source-R-C-Branches.svg "AC_Source-R-C-Branches.svg") The branch
equations are shown for R and C.

#### Resistor R (Branch equation $B_R$)

The resistor\'s branch equation in the time domain is:

$$V_R(t) = R I_R(t)$$ In the Laplace-transformed signal space:

$$V_R(s) = R I_R(s)$$

#### Capacitor C (Branch equation $B_C$)

The capacitor\'s branch equation in the time domain is:

$$V_C(t) = \frac{Q_C(t)}{C} = \frac{1}{C}\int_{t_0}^t I_C(\tau) \mathrm{d}\tau + V_C(t_0)$$
Assuming the capacitor is initially discharged, the equation becomes:

$$V_C(t) = \frac{Q_C(t)}{C} = \frac{1}{C}\int_{t_0}^t I_C(\tau) \mathrm{d}\tau$$
Taking the derivative of this and multiplying by *C* yields the
derivative form:

$$I_C(t) = \frac{\mathrm{d}Q(t)}{\mathrm{d}t} = C\frac{\mathrm{d}V_C(t)}{\mathrm{d}t}$$
In the Laplace-transformed signal space:

$$I_C(s) = V_C(s) sC$$

### Kirchhoff\'s laws equations

![](AC_Source-R-C-KCL-KVL.svg "AC_Source-R-C-KCL-KVL.svg")

#### Kirchhoff\'s Voltage Law equation $\mathrm{KVL}_1$

This circuit has only one independent loop. Its equation in the time
domain is:

$$V_R(t) + V_C(t) - V_S (t) =0$$ In the Laplace-transformed signal
space:

$$V_R(s) + V_C(s) - V_S (s) =0$$

#### Kirchhoff\'s Current Law equations $\mathrm{KCL}_1, {KCL}_2, {KCL}_3$

The circuit has three nodes, thus three Kirchhoff\'s current equations
(expresses here as the currents flowing from the nodes):

:   `<math>`{=html}

\\begin{align} I_S(t) + I_R (t) & = 0 & & \\mathrm{(KCL_1)} \\\\
I_C(t) - I_R (t) & = 0 & & \\mathrm{(KCL_2)} \\\\ I_S(t) - I_C (t) & = 0
& & \\mathrm{(KCL_3)} \\\\ \\end{align} `</math>`{=html} In the
Laplace-transformed signal space:

:   `<math>`{=html}

\\begin{align} I_S(s) + I_R (s) & = 0 & & \\mathrm{(KCL_1)} \\\\
I_C(s) - I_R (s) & = 0 & & \\mathrm{(KCL_2)} \\\\ I_S(s) - I_C (s) & = 0
& & \\mathrm{(KCL_3)} \\\\ \\end{align} `</math>`{=html} A set of
independent equations must be chosen. For the current laws, it is
necessary to drop one of these equations. In this example, let us choose
$\mathrm{KCL}_1, {KCL}_2$.

### Building the signal-flow graph

We then look at the inventory of equations, and the signals that each
equation relates:

  Equation           Signals
  ------------------ --------------------------
  $\mathrm{B_C}$     $\mathrm{V_C, I_C}$
  $\mathrm{B_R}$     $\mathrm{V_R, I_R}$
  $\mathrm{KVL}_1$   $\mathrm{V_R, V_C, V_S}$
  $\mathrm{KCL}_1$   $\mathrm{I_S, I_R}$
  $\mathrm{KCL}_2$   $\mathrm{I_R, I_C}$

The next step consists in assigning to each equation a signal that will
be represented as a node. Each independent source signal is represented
in the signal-flow graph as a source node, therefore no equation is
assigned to the independent source $\mathrm{V_S}$. There are many
possible valid signal flow graphs from this set of equations. An
equation must only be used once, and the variables of interest must be
represented.

  Equation           Signals                    Assigned signal node
  ------------------ -------------------------- ----------------------
  $\mathrm{B_C}$     $\mathrm{V_C, I_C}$        $\mathrm{I_C}$
  $\mathrm{B_R}$     $\mathrm{V_R, I_R}$        $\mathrm{V_R}$
  $\mathrm{KVL}_1$   $\mathrm{V_R, V_C, V_S}$   $\mathrm{V_C}$
  $\mathrm{KCL}_1$   $\mathrm{I_S, I_R}$        $\mathrm{I_S}$
  $\mathrm{KCL}_2$   $\mathrm{I_R, I_C}$        $\mathrm{I_R}$

### The resulting flow graph is then drawn

![](AC_Source-R-C-SFG.svg "AC_Source-R-C-SFG.svg")

The next step consists in solving the signal-flow graph.

Using either Mason or systematic reduction, the resulting signal flow
graph is:\
![](AC_Source-R-C-SFG-Solved-V_C.svg "AC_Source-R-C-SFG-Solved-V_C.svg")

### Mechatronics example

thumb\|upright=3\| Angular position servo and signal flow graph. θ~C~ =
desired angle command, θ~L~ = actual load angle, K~P~ = position loop
gain, V~ωC~ = velocity command, V~ωM~ = motor velocity sense voltage,
K~V~ = velocity loop gain, V~IC~ = current command, V~IM~ = current
sense voltage, K~C~ = current loop gain, V~A~ = power amplifier output
voltage, L~M~ = motor inductance, V~M~ = voltage across motor
inductance, I~M~ = motor current, R~M~ = motor resistance, R~S~ =
current sense resistance, K~M~ = motor torque constant (Nm/amp) , T =
torque, M = momment of inertia of all rotating components α = angular
acceleration, ω = angular velocity, β = mechanical damping, G~M~ = motor
back EMF constant, G~T~ = tachometer conversion gain constant,. There is
one forward path (shown in a different color) and six feedback loops.
The drive shaft assumed to be stiff enough to not treat as a spring.
Constants are shown in black and variables in
purple.

