Block diagrams
Block diagrams are a graphical representation of a dynamical system. We first encountered block diagrams in the introductory lecture. They are widely used in control systems engineering to represent the flow of signals through a system.
In this section, we will learn about a specialized type of block diagram known as a simulation diagram. These are the type of block diagrams used in simulation software such as MATLAB Simulink.
Ingredients of block diagrams¶
Block diagrams consist of three different types of blocks connected by arrows that indicate the flow of signals. The types of blocks are:
These blocks multiply the input signal by a constant value (the gain) to produce the output signal. They are represented by triangles or rectangles with the gain value written inside. Gains can be positive or negative.
These blocks sum multiple input signals to produce a single output signal. They are represented by circles or rectangles with a combination of plus (+) and minus (−) signs inside to indicate which inputs get added or subtracted. If there are no signs, assume all inputs are summed.
These blocks perform integration on the input signal to produce the output signal. They are represented by rectangles with the integral symbol or inside. This is because is the transfer function for integration.
These blocks represent a general LTI system written as a transfer function. They are represented by rectangles with the transfer function written inside. Integrators are special cases of transfer functions.
Constructing a block diagram¶
How do we construct a representation of a set of ODEs without using any differentiation? The key is to start with the fully differentiated terms, and integrate down to the original variables. Here are the concrete steps.
We will illustrate these steps through several examples.
Spring-mass-damper system¶
First, consider a simple spring-mass-damper system with equation of motion
Step 1: Isolate the highest-order derivative :
Step 2: Create a chain of two integrators to reduce down to . We will also add labels to the signals on the arrows to keep track of the variables.
Step 3: Place a summing junction to combine the terms on the right-hand side of Eq. (2). Our summing junction will have three inputs: one for the input force , one for the term , and one for the term . We also include a gain block of to multiply the entire sum.
Step 4: Draw feedback loops to connect the state variables and back to the summing junction through gain blocks of and , respectively. Also include the force as an input.
And that’s it! We have constructed the block diagram for the spring-mass system.
Example: double spring-mass-damper¶
We now consider a more complex example: a double rotational spring-mass-damper system. Here is the physical diagram:
Figure 8:Double rotational spring-mass-damper system.
We derived the equations of motion for this system in the solution to Problem 2 in the rotational mechanics section. The equations are:
We start by isolating the highest-order derivatives:
With two equations, we need two chains of integrators, one for each . Then, we add summing junctions and feedback loops as before. Here is the final block diagram:
Figure 9:Block diagram for the double rotational spring-mass-damper system of Figure 8.
Example: DC motor¶
Next, let’s look at the block diagram for a DC motor. The equations of motion we derived in the section on DC motors are:
This block diagram has a nice representation because it allows us to clearly separate the electrical and mechanical subsystems, connected by motor constants .
Figure 10:Block diagram for the DC motor system of Eq. (5).
If we want, we can even collapse each subsystem into a single transfer function block to get a higher-level view of the system. For example, the electrical subsystem has ODE:
Taking the Laplace transform and rearranging, we have
Likewise, the mechanical subsystem has transfer function
Substituting these into the block diagram gives a more compact diagram.
Figure 11:Simplified block diagram of Figure 10 with subsystems collapsed into transfer function blocks.
Recovering equations of motion¶
Given a block diagram, we can also recover the equations of motion by following the signal flow and writing equations for each summing junction and block. Let’s illustrate this with the spring-mass-damper example from earlier.
Figure 12:Spring-mass-damper block diagram with labels removed.
Starting from the output , we can work our wa backwards through the integrators, labeling the intermediate signals as needed.
Figure 13:Spring-mass-damper block diagram with labels included.
From here, the equations of motion can be read off directly by looking at the summing junction and gain blocks. We have
Rearranging, we obtain the familiar equation of motion:
Example: interlaced loops¶
The method shown above can fail if there are interlaced loops, or non-consecutive integrations. Consider the example below:
Figure 14:Block diagram with interlaced loops.
In this case, we cannot propagate backwards to the second integrator because of the intermediate summing junction. In such cases, we add new variables for the signals we cannot identify, and include additional equations for the intermediate summing junctions. Here is how it works for this example.
Figure 15:Block diagram with interlaced loops and labeled signals.
We now write one equation for each summing junction and obtain our final equations of motion representing this block diagram:
From here, we can eliminate the intermediate variable to get a single ODE relating to if we wish, or we can leave it as-is (it’s still a valid representation of the system!).
Input derivatives¶
So far, we have seen how to construct block diagrams for systems of ODEs that do not contain input derivatives. What happens if the equations of motion do contain input derivatives? For example, consider the following generic system:
At first glance, it may seem impossible to construct a block diagram for this system without using differentiation. However, there are tricks we can use to rewrite the system into an equivalent form that does not contain input derivatives. These tricks generally boil down to introducing extra variables and equations. We will show two different methods.
First method (controllable form)¶
The transfer function from to is
Let’s define an intermediate variable and write the system as a cascade of two systems so :
Multiplying this out and converting back to the time domain, we have
This is now a system of ODEs (2 equations in unknowns )equivalent to Eq. (12). But critically, it contains no input derivatives! This is called the controllable canonical form.
We can implement the first equation the standard way, but now we’re integrating derivatives of rather than derivatives of . Then, we can create the output using gain blocks and summing junctions from and its derivatives. Here is the result.
Figure 16:Diagram representing Eq. (12) using controllable canonical form.
Second method (observable form)¶
In the second approach, we define a sequence of auxiliary variables, starting with the output. Define . Eq. (12) can then be rewritten as
Collect the highest-order (boxed) terms on the left and define . Substituting into Eq. (16) gives
Continuing this process, we define and substitute into Eq. (17):
This contains no input derivatives, so we can stop. Collecting the equations where we defined , , and , together with Eq. (18), we have
This is now a system of ODEs (4 equations in unknowns ) equivalent to Eq. (12). Again, there are no input derivatives! This is called the observable canonical form.
From here, we can construct separate chains of integrators for , , and , and connect them with summing junctions and gain blocks as needed. Here is the result.
Figure 17:Diagram representing Eq. (12) using observable canonical form.
This diagram looks completely different from the previous one, but it represents the same system dynamics. This reinforces our earlier point that there are often multiple valid ways to draw block diagrams for the same system.
Test your knowledge¶
Solution to Exercise 1 #
Our first step is to isolate the highest-order derivatives:
We noticed the group appears in both equations, so we kept it grouped to minimize the number of blocks and arrows needed in the final diagram. Next, we create two chains of integrators, one for and one for , and connect the summation junctions and feedback loops as needed. Here is the final block diagram:
Figure 18:Block diagram representing the system of equations (20).
Solution to Exercise 2 #
Let’s begin by labeling the internal signals surrounding the integrators, since it is not easy to get to them from the output directly. We will call the output of the second integrator .
Figure 20:Labeled version of the block diagram of Figure 19.
Now we can write one equation of motion for each summing junction:
This is a legitimate system of ODEs representing the block diagram. If we want an even simpler representation, we can eliminate and obtain a single ODE relating and . First, rearrange the second equation to get
Substituting into the first equation gives
Rearranging and simplifying, we have