Chapter 4: Transfer Functions and Block Diagrams
Lesson 3: Block Diagram Representation of Control Loops
This lesson introduces the formal block diagram representation of single-input single-output (SISO) linear control loops. Starting from transfer functions, we define blocks, summing junctions, and pickoff points, and derive algebraic relations for standard feedback structures. We connect these diagrams to closed-loop transfer functions and illustrate how software tools in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica represent and manipulate block diagrams, with examples motivated by robotic actuators.
1. Why Block Diagrams in Linear Control?
In previous lessons, you have seen how physical models lead to linear time-invariant (LTI) differential equations and then to transfer functions via Laplace transforms. A transfer function \( G(s) \) describes the input–output relation in the Laplace domain:
\[ Y(s) = G(s)U(s), \quad G(s) = \frac{Y(s)}{U(s)} \]
Block diagrams are graphical representations that organize such input–output relations into an interconnection of subsystems. Each block corresponds to a transfer function, and directed lines represent signals in the Laplace domain. This is especially convenient for control loops, where sensing, actuation, and feedback create structured interconnections that would otherwise be cumbersome to manipulate purely algebraically.
A canonical negative-feedback control loop involves:
- Reference input \( R(s) \): desired value (e.g., desired joint angle).
- Error signal \( E(s) \): difference between reference and feedback.
- Controller \( G_c(s) \): computes control effort.
- Plant \( G_p(s) \): physical system (robot joint, motor, etc.).
- Sensor/feedback \( H(s) \): models measurement and feedback path.
flowchart TD
R["R(s): reference"] --> E["Summing: e = r - y_fb"]
E --> GC["Controller Gc(s)"]
GC --> GP["Plant Gp(s)"]
GP --> Y["C(s): output"]
Y --> H["Feedback H(s)"]
H --> YFB["Y_fb(s)"]
YFB --> E
In this diagram, each block is an LTI subsystem, and the entire loop is itself an LTI system from \( R(s) \) to \( C(s) \). The main goal of this lesson is to translate such diagrams into precise algebraic relations between signals and transfer functions.
2. Elementary Components of Block Diagrams
2.1. Blocks (Transfer Function Elements)
A block represents an LTI subsystem with input \( U(s) \) and output \( Y(s) \), related by:
\[ Y(s) = G(s)U(s) \]
In robotics, examples include:
- Amplifiers or digital controllers: \( G_c(s) \) (e.g., a proportional gain \( K_p \)).
- Actuators (DC motors, servo drives): plant transfer function \( G_p(s) \).
- Sensors: encoder gain \( H(s) = K_{\text{enc}} \) or filters in the feedback path.
2.2. Summing Junctions
A summing junction adds (or subtracts) several incoming signals to produce a single output. For two inputs \( X_1(s) \) and \( X_2(s) \) with signs \( + \) and \( - \), the output is:
\[ Y(s) = X_1(s) - X_2(s) \]
In feedback loops, the error signal is typically \( E(s) = R(s) - B(s) \), where \( B(s) \) is the feedback signal. This sign convention corresponds to negative feedback, which generally improves stability and robustness in engineering systems.
2.3. Pickoff (Branching) Points
A pickoff point creates multiple copies of a signal that are used as inputs to several blocks. If a signal \( X(s) \) is branched, each branch carries the same Laplace-transformed signal \( X(s) \). For example, the plant output \( C(s) \) may be simultaneously sent to a sensor, a recording device, and a visualization block.
3. Algebra of Series and Parallel Interconnections
3.1. Series (Cascade) Connection
Consider two blocks in series with transfer functions \( G_1(s) \) and \( G_2(s) \). Let \( U(s) \) be the input of the first block, \( V(s) \) the intermediate signal, and \( Y(s) \) the final output:
\[ V(s) = G_1(s)U(s), \quad Y(s) = G_2(s)V(s). \]
Eliminating \( V(s) \) gives:
\[ Y(s) = G_2(s)G_1(s)U(s) \quad \Longrightarrow \quad G_{\text{series}}(s) = G_2(s)G_1(s). \]
Thus, the equivalent block for a cascade is the product of the individual transfer functions.
3.2. Parallel Connection (Additive Blocks)
For two blocks in parallel with a common input \( U(s) \) and outputs summed to form \( Y(s) \):
\[ Y(s) = G_1(s)U(s) + G_2(s)U(s) = \bigl(G_1(s) + G_2(s)\bigr)U(s). \]
Therefore, the equivalent transfer function is:
\[ G_{\text{parallel}}(s) = G_1(s) + G_2(s). \]
In practice, parallel connections can represent multiple control actions acting on the same signal (e.g., a feedforward path and a feedback path summed at an actuator).
4. Standard Single-Loop Negative Feedback
We now analyze the canonical block diagram of a SISO negative-feedback loop with:
- Controller \( G_c(s) \)
- Plant \( G_p(s) \)
- Feedback transfer function \( H(s) \)
Let \( R(s) \) be the reference, \( C(s) \) the output, \( B(s) \) the feedback signal, and \( E(s) \) the error:
\[ E(s) = R(s) - B(s), \quad B(s) = H(s)C(s). \]
The controller and plant are in series, so the loop forward path is:
\[ G(s) = G_c(s)G_p(s). \]
The output is:
\[ C(s) = G(s)E(s) = G(s)\bigl(R(s) - H(s)C(s)\bigr). \]
Solve for the closed-loop input–output relation by collecting terms in \( C(s) \):
\[ C(s) = G(s)R(s) - G(s)H(s)C(s) \quad \Longrightarrow \quad \bigl(1 + G(s)H(s)\bigr)C(s) = G(s)R(s). \]
Hence, the closed-loop transfer function from reference to output is:
\[ T(s) = \frac{C(s)}{R(s)} = \frac{G(s)}{1 + G(s)H(s)}. \]
The loop transfer function (also called open-loop transfer function) is:
\[ L(s) = G(s)H(s), \quad T(s) = \frac{G(s)}{1 + L(s)}. \]
The denominator \( 1 + L(s) = 0 \) defines the closed-loop characteristic equation, whose roots are the closed-loop poles. Their locations determine stability, which will be analyzed in later chapters.
For unity feedback, \( H(s) = 1 \), and:
\[ T(s) = \frac{G(s)}{1 + G(s)}. \]
5. Disturbances in Block Diagram Form
Real systems are affected by disturbances. A simple and common model is an additive disturbance \( D(s) \) at the plant input (e.g., a torque disturbance on a robot joint):
- The input to the plant is the sum of controller output and disturbance.
- The rest of the loop remains unchanged.
Let the plant input be \( U_p(s) = U_c(s) + D(s) \), where \( U_c(s) = G_c(s)E(s) \). Then:
\[ C(s) = G_p(s)\bigl(G_c(s)E(s) + D(s)\bigr) = G_p(s)G_c(s)\bigl(R(s) - H(s)C(s)\bigr) + G_p(s)D(s). \]
Rearranging,
\[ \bigl(1 + G_c(s)G_p(s)H(s)\bigr)C(s) = G_c(s)G_p(s)R(s) + G_p(s)D(s). \]
Therefore:
\[ C(s) = \frac{G_c(s)G_p(s)}{1 + G_c(s)G_p(s)H(s)}R(s) + \frac{G_p(s)}{1 + G_c(s)G_p(s)H(s)}D(s). \]
The first term describes how the reference is tracked; the second term describes how the disturbance propagates to the output. Already at this stage, the block diagram clearly separates design objectives: choosing \( G_c(s) \) and \( H(s) \) to achieve both good tracking and disturbance rejection.
6. Example – Block Diagram of a Simple Position Control Loop
Consider a DC motor driving a robot joint. For this lesson, we abstract away the mechanical details and use an already derived plant transfer function (from earlier modeling chapters):
\[ G_p(s) = \frac{K_m}{Js^2 + Bs}, \]
where:
- \( J \): equivalent inertia,
- \( B \): viscous friction,
- \( K_m \): motor torque constant (after suitable scaling).
Suppose we use a proportional controller \( G_c(s) = K_p \) and an ideal encoder modeled as \( H(s) = K_{\text{enc}} \). Then the loop forward transfer function is:
\[ G(s) = G_c(s)G_p(s) = \frac{K_p K_m}{Js^2 + Bs}, \quad L(s) = G(s)H(s) = \frac{K_p K_m K_{\text{enc}}}{Js^2 + Bs}. \]
The closed-loop transfer function from desired joint position \( R(s) \) to actual joint position \( C(s) \) is:
\[ T(s) = \frac{C(s)}{R(s)} = \frac{G(s)}{1 + G(s)H(s)} = \frac{\dfrac{K_p K_m}{Js^2 + Bs}}{1 + \dfrac{K_p K_m K_{\text{enc}}}{Js^2 + Bs}} = \frac{K_p K_m}{Js^2 + Bs + K_p K_m K_{\text{enc}}}. \]
This example illustrates how the block diagram directly reveals the structure of the closed-loop dynamics: the denominator is changed by feedback, increasing effective damping and stiffness. Detailed performance and stability analysis will be developed in later chapters.
7. Software Representation – Python and MATLAB/Simulink
7.1. Python with python-control (and Robotics Context)
In Python, the python-control library provides direct
support for transfer functions and feedback interconnections. Such tools
are frequently used in robotics research alongside libraries like
roboticstoolbox to simulate actuators and joint
controllers.
import control as ctl # python-control library
# Example plant and controller:
# Gp(s) = Km / (J s^2 + B s)
J = 0.02 # kg m^2
B = 0.1 # N m s/rad
Km = 0.5 # N m/A
Kp = 20.0 # proportional gain
Kenc = 1.0 # encoder gain (unity for simplicity)
# Define s as Laplace variable and construct transfer functions
s = ctl.TransferFunction.s
Gp = Km / (J*s**2 + B*s)
Gc = Kp
H = Kenc
# Forward path and closed-loop transfer function
G = Gc * Gp
T = ctl.feedback(G, H) # T(s) = G(s)/(1 + G(s)H(s))
print("Plant Gp(s):", Gp)
print("Controller Gc(s):", Gc)
print("Closed-loop T(s):", T)
# Step response (position tracking)
t, y = ctl.step_response(T)
# t and y can be plotted with matplotlib
Internally, ctl.feedback(G, H) performs the algebraic
operation corresponding to the block diagram: it forms the loop transfer
function and computes the closed-loop transfer function \( T(s) =
G(s)/(1 + G(s)H(s)) \).
7.2. MATLAB/Simulink – Block Diagrams as Primary Objects
MATLAB's Control System Toolbox and Simulink treat block diagrams as first-class modeling objects. The same example can be implemented as:
% Parameters
J = 0.02;
B = 0.1;
Km = 0.5;
Kp = 20.0;
Kenc = 1.0;
% Transfer functions
s = tf('s');
Gp = Km / (J*s^2 + B*s);
Gc = Kp;
H = Kenc;
% Closed-loop transfer function T(s) = feedback(Gc*Gp, H)
G = series(Gc, Gp); % Gc(s)*Gp(s)
T = feedback(G, H); % Negative feedback by default
step(T); grid on;
title('Closed-loop step response: position control');
% In Simulink, the same loop is drawn with blocks:
% 1) Use "Transfer Fcn" block for Gp(s)
% 2) Use "Gain" block for Kp
% 3) Use "Sum" block for error e = r - y_fb
% 4) Use "Gain" for H(s) or connect output directly for unity feedback
Simulink provides a direct visual mapping to the block diagram formalism: each transfer function and gain corresponds to a block, and the summing junctions and pickoff points are drawn explicitly with dedicated blocks.
8. Software Representation – C++, Java, and Wolfram Mathematica
8.1. C++ – Simple Transfer Function Class (Robotics Context)
In embedded robotics (e.g., using ROS control), control loops are often implemented in C++. Below is a minimal class for rational transfer functions, with a method to form the closed-loop transfer function for unity feedback. The coefficients are stored as numerator and denominator polynomials in powers of \( s \).
#include <vector>
#include <stdexcept>
struct TransferFunction {
// Y(s)/U(s) = num(s)/den(s)
std::vector<double> num;
std::vector<double> den;
// Polynomial addition (for same length, padding if needed)
static std::vector<double> polyAdd(const std::vector<double>& a,
const std::vector<double>& b) {
std::size_t n = std::max(a.size(), b.size());
std::vector<double> c(n, 0.0);
for (std::size_t i = 0; i < n; ++i) {
double av = (i < a.size()) ? a[a.size()-1-i] : 0.0;
double bv = (i < b.size()) ? b[b.size()-1-i] : 0.0;
c[n-1-i] = av + bv;
}
return c;
}
// Polynomial multiplication
static std::vector<double> polyMul(const std::vector<double>& a,
const std::vector<double>& b) {
std::vector<double> c(a.size() + b.size() - 1, 0.0);
for (std::size_t i = 0; i < a.size(); ++i)
for (std::size_t j = 0; j < b.size(); ++j)
c[i + j] += a[i] * b[j];
return c;
}
// Closed-loop unity feedback: T(s) = G(s)/(1 + G(s))
TransferFunction unityFeedback() const {
// 1 is represented as den(s)/den(s)
std::vector<double> numG = num;
std::vector<double> denG = den;
std::vector<double> numOne = denG;
std::vector<double> denOne = denG;
// 1 + G(s) = (denG + numG) / denG
std::vector<double> numSum = polyAdd(numOne, numG);
std::vector<double> denSum = denG; // common denominator
// T = G / (1 + G) = (numG/denG) / (numSum/denSum)
// = (numG * denSum) / (denG * numSum)
std::vector<double> numT = polyMul(numG, denSum);
std::vector<double> denT = polyMul(denG, numSum);
return {numT, denT};
}
};
// In a robotics application, G(s) could be the joint servo transfer function,
// and unityFeedback() would give the closed-loop behavior for analysis.
8.2. Java – Algebraic Formation of Closed-Loop Transfer Function
Java is frequently used in educational robotics (e.g., WPILib for FRC robots). Here is a simple Java method that computes the numerator and denominator of a unity-feedback closed loop, assuming polynomials are stored as arrays in ascending powers of \( s \):
public class TransferFunction {
public double[] num; // numerator coefficients
public double[] den; // denominator coefficients
public TransferFunction(double[] num, double[] den) {
this.num = num;
this.den = den;
}
private static double[] polyMul(double[] a, double[] b) {
double[] c = new double[a.length + b.length - 1];
for (int i = 0; i < a.length; ++i)
for (int j = 0; j < b.length; ++j)
c[i + j] += a[i] * b[j];
return c;
}
private static double[] polyAdd(double[] a, double[] b) {
int n = Math.max(a.length, b.length);
double[] c = new double[n];
for (int i = 0; i < n; ++i) {
double av = (i < a.length) ? a[i] : 0.0;
double bv = (i < b.length) ? b[i] : 0.0;
c[i] = av + bv;
}
return c;
}
// Unity feedback: T(s) = G(s)/(1 + G(s))
public TransferFunction unityFeedback() {
// 1 is den(s)/den(s)
double[] numG = this.num;
double[] denG = this.den;
double[] numOne = denG.clone(); // num of 1 in common denominator
double[] denOne = denG.clone();
double[] numSum = polyAdd(numOne, numG); // numerator of 1 + G
double[] denSum = denG; // denominator of 1 + G
double[] numT = polyMul(numG, denSum);
double[] denT = polyMul(denG, numSum);
return new TransferFunction(numT, denT);
}
}
8.3. Wolfram Mathematica – Symbolic Block Diagram Composition
Mathematica's control systems functionality includes symbolic transfer functions and block-diagram operations useful in robotics modeling (e.g., for manipulator joints).
(* Define Laplace variable and plant/controller *)
s = LaplaceTransformVariable["s"];
J = 0.02; B = 0.1; Km = 0.5; Kp = 20.0; Kenc = 1.0;
Gp = TransferFunctionModel[Km/(J s^2 + B s), s];
Gc = TransferFunctionModel[Kp, s];
H = TransferFunctionModel[Kenc, s];
(* Series connection and feedback *)
G = SystemsModelSeries[Gc, Gp];
T = SystemsModelFeedback[G, H]; (* Negative feedback by default *)
(* Closed-loop transfer function *)
TransferFunctionExpand[T]
(* Step response for position command *)
OutputResponse[T, UnitStep[t], t]
The functions SystemsModelSeries and
SystemsModelFeedback implement the same algebra that we
derived from block diagrams, but now in a fully symbolic setting.
9. Problems and Solutions
Problem 1 (Closed-Loop Transfer Function – General Feedback): Consider the standard negative-feedback loop with forward transfer function \( G(s) \) and feedback transfer function \( H(s) \). The reference input is \( R(s) \) and the output is \( C(s) \). Derive the closed-loop transfer function \( T(s) = C(s)/R(s) \).
Solution:
By definition of the summing junction, \( E(s) = R(s) - H(s)C(s) \). The forward path gives \( C(s) = G(s)E(s) \), so:
\[ C(s) = G(s)\bigl(R(s) - H(s)C(s)\bigr) = G(s)R(s) - G(s)H(s)C(s). \]
Collect terms in \( C(s) \):
\[ \bigl(1 + G(s)H(s)\bigr)C(s) = G(s)R(s) \quad \Longrightarrow \quad \frac{C(s)}{R(s)} = \frac{G(s)}{1 + G(s)H(s)}. \]
Thus, \( T(s) = G(s)/(1 + G(s)H(s)) \).
Problem 2 (Unity Feedback for a Second-Order Plant): Let the plant transfer function be \( G_p(s) = \dfrac{K}{s^2 + 2\zeta\omega_n s + \omega_n^2} \), and the controller be a pure gain \( G_c(s) = K_p \). Assume unity feedback \( H(s) = 1 \). Find the closed-loop transfer function \( T(s) = C(s)/R(s) \).
Solution:
The forward transfer function is \( G(s) = G_c(s)G_p(s) = \dfrac{K_p K}{s^2 + 2\zeta\omega_n s + \omega_n^2} \). For unity feedback, \( T(s) = \dfrac{G(s)}{1 + G(s)} \):
\[ T(s) = \frac{\dfrac{K_p K}{s^2 + 2\zeta\omega_n s + \omega_n^2}} {1 + \dfrac{K_p K}{s^2 + 2\zeta\omega_n s + \omega_n^2}} = \frac{K_p K}{s^2 + 2\zeta\omega_n s + \omega_n^2 + K_p K}. \]
The closed-loop characteristic polynomial is \( s^2 + 2\zeta\omega_n s + \omega_n^2 + K_p K \). Later, we will relate its coefficients to time-response characteristics.
Problem 3 (Disturbance at Plant Input): Consider the loop of Problem 1, but now with an additive disturbance \( D(s) \) at the plant input. The plant input is \( U_p(s) = U_c(s) + D(s) \) where \( U_c(s) = G_c(s)E(s) \), and the plant transfer function is \( G_p(s) \). Derive the transfer function from disturbance \( D(s) \) to output \( C(s) \).
Solution:
We have:
\[ C(s) = G_p(s)\bigl(G_c(s)E(s) + D(s)\bigr), \quad E(s) = R(s) - H(s)C(s). \]
Substitute \( E(s) \) and expand:
\[ C(s) = G_p(s)G_c(s)\bigl(R(s) - H(s)C(s)\bigr) + G_p(s)D(s) = \\ G(s)R(s) - G(s)H(s)C(s) + G_p(s)D(s), \]
where \( G(s) = G_c(s)G_p(s) \). Collect terms in \( C(s) \):
\[ \bigl(1 + G(s)H(s)\bigr)C(s) = G(s)R(s) + G_p(s)D(s). \]
The disturbance-to-output transfer function is obtained by setting \( R(s) = 0 \):
\[ \frac{C(s)}{D(s)} = \frac{G_p(s)}{1 + G(s)H(s)}. \]
This shows explicitly how feedback modifies the disturbance propagation.
Problem 4 (Series and Parallel Reduction): A controller consists of a proportional gain and a lead compensator connected in series: \( G_{c1}(s) = K_p \), \( G_{c2}(s) = \dfrac{s + z}{s + p} \). The plant consists of two elements in parallel: \( G_{p1}(s) = \dfrac{1}{s} \) and \( G_{p2}(s) = \dfrac{1}{s + a} \). Find the overall equivalent forward-path transfer function \( G(s) \).
Solution:
The controller equivalent is series:
\[ G_c(s) = G_{c2}(s)G_{c1}(s) = K_p \frac{s + z}{s + p}. \]
The plant equivalent is parallel:
\[ G_p(s) = G_{p1}(s) + G_{p2}(s) = \frac{1}{s} + \frac{1}{s + a} = \frac{(s + a) + s}{s(s + a)} = \frac{2s + a}{s(s + a)}. \]
The overall forward-path transfer function is:
\[ G(s) = G_c(s)G_p(s) = K_p \frac{s + z}{s + p} \cdot \frac{2s + a}{s(s + a)}. \]
Problem 5 (Block Diagram Recognition – Conceptual): A robot joint position control system has the following components: a reference input \( r(t) \), a summing junction producing error \( e(t) \), a controller \( G_c(s) \), an amplifier \( G_a(s) \), a plant \( G_p(s) \), and a sensor with transfer function \( H(s) \). The amplifier is in series with the controller, and the sensor is in the feedback path. Sketch the corresponding interconnection structure (conceptually).
Solution (conceptual structure):
The conceptual interconnection (ignoring detailed numerical values) can be summarized as:
flowchart TD
R["Reference r(t)"] --> SUM["Summing: e = r - y_fb"]
SUM --> GC["Controller Gc(s)"]
GC --> GA["Amplifier Ga(s)"]
GA --> GP["Plant Gp(s)"]
GP --> Y["Output y(t)"]
Y --> HS["Sensor H(s)"]
HS --> YFB["Feedback y_fb(t)"]
YFB --> SUM
Algebraically, the forward path transfer function is \( G(s) = G_c(s)G_a(s)G_p(s) \), and the closed-loop transfer function is obtained exactly as in Problems 1 and 2 by treating \( G(s) \) as the forward transfer function and \( H(s) \) as the feedback transfer function.
10. Summary
- Block diagrams are graphical representations of LTI systems where blocks are transfer functions, summing junctions combine signals, and pickoff points branch signals.
- Series and parallel interconnections correspond to algebraic operations on transfer functions: products for cascades and sums for parallel paths.
- The standard negative-feedback loop with forward transfer function \( G(s) \) and feedback \( H(s) \) has closed-loop transfer function \( T(s) = G(s)/(1 + G(s)H(s)) \).
- Disturbances can be introduced at various points in the block diagram; their effect on the output is captured by appropriate disturbance-to-output transfer functions.
-
Modern software tools (Python
python-control, C++ frameworks, Java libraries, MATLAB/Simulink, Wolfram Mathematica) implement block-diagram algebra directly, supporting both numerical and symbolic analysis of control loops for robotic actuators and other systems.
In the next lesson, we will exploit these interconnection rules systematically in block diagram reduction techniques, enabling us to reduce complex diagrams to simple equivalent transfer functions.
11. References
- Nyquist, H. (1932). Regeneration theory. Bell System Technical Journal, 11(1), 126–147.
- Black, H. S. (1934). Stabilized feedback amplifiers. Bell System Technical Journal, 13(1), 1–18.
- Bode, H. W. (1940). Relations between attenuation and phase in feedback amplifier design. Bell System Technical Journal, 19(3), 421–454.
- Zadeh, L. A., & Desoer, C. A. (1963). Linear System Theory: The State Space Approach. McGraw–Hill. (Foundational material on interconnections and feedback.)
- Truxal, J. G. (1955). Automatic Feedback Control System Synthesis. McGraw–Hill. (Classical block-diagram based synthesis.)
- MacFarlane, A. G. J. (1963). On the theory of linear systems. Proceedings of the Institution of Electrical Engineers, 110(2), 323–335.
- Rosenbrock, H. H. (1970). State-space and multivariable theory. International Journal of Control, 11(2), 247–284. (Provides a rigorous view of interconnections in a general framework.)