TExcelTAD
Home › Control Systems & Automation › Block-Diagram Algebra

Block-Diagram Algebra

A real control system is drawn before it is analysed: a sensor here, an amplifier there, an inner loop around the motor, a disturbance entering in the middle. The drawing is a block diagram, and with three rules and a few rearrangements it collapses to one transfer function from any input to any output. This lesson reduces the diagram of a position servo with a tachometer, the classic way to add damping to a motor drive, and shows that python-control does the same algebra for you.

The three rules

Connection Diagram Equivalent
series U→G1→G2→YU \to G_1 \to G_2 \to Y G1G2G_1 G_2
parallel G1G_1 and G2G_2 fed the same UU, outputs added G1+G2G_1 + G_2
negative feedback GG forward, HH in the return path G1+GH\frac{G}{1 + GH}

The feedback rule is the one to remember: forward path over one plus loop. With positive feedback the sign in the denominator flips. Everything else is rearrangement:

  • Moving a summing junction past a block GG (downstream): signals added after it must be multiplied by GG to keep the same output; moving it upstream, divide them by GG.
  • Moving a pickoff point (a branch) past a block downstream: the branch must be divided by GG; upstream, multiplied by GG.
  • Several inputs: the system is linear, so find the transfer function from each input with the others set to zero and add (superposition). For the loop of the intro, Y=TR+GSD−TNY = T R + G S D - T N.

Rearranging changes nothing physical. What it can change is where a signal is fed back, and that changes the zeros of the closed loop but not its poles: the poles come from 1+L=01 + L = 0, which depends only on the loop.

The position servo

r + - Kp 5 V/rad + - Ka 2 V/V v Km/(tm s + 1) motor speed w 1/s theta kt tachometer 0.02 V s/rad angle sensor (unity)

The reference motor of Modelling a DC Motor, reduced to first order (Km=49.75 rad/(s⋅V)K_m = 49.75\ \text{rad/(s} \cdot \text{V)}, τm=9.95 ms\tau_m = 9.95\ \text{ms}), turns a dial. A potentiometer measures the angle, a tachometer (a small generator on the same shaft) measures the speed. The inner loop feeds back speed, the outer loop angle.

Worked example: reduce the servo

Given: Kp=5 V/radK_p = 5\ \text{V/rad}, Ka=2K_a = 2, kt=0.02 V⋅s/radk_t = 0.02\ \text{V} \cdot \text{s/rad}, motor 49.750.00995s+1\frac{49.75}{0.00995 s + 1}, integrator 1s\frac{1}{s}.

Find: Θ(s)/R(s)\Theta(s)/R(s) with and without the tachometer; ωn\omega_n and ζ\zeta in both cases.

Solve:

  • Inner loop (feedback rule): ΩVin=KaKm/(τms+1)1+KaKmkt/(τms+1)=KaKmτms+1+KaKmkt\frac{\Omega}{V_\text{in}} = \frac{K_a K_m/(\tau_m s + 1)}{1 + K_a K_m k_t/(\tau_m s + 1)} = \frac{K_a K_m}{\tau_m s + 1 + K_a K_m k_t}. With KaKm=99.5K_a K_m = 99.5 and KaKmkt=1.99K_a K_m k_t = 1.99: 33.280.003328s+1\frac{33.28}{0.003328 s + 1}. The tachometer made the speed loop three times faster and three times weaker.
  • Series with KpK_p and 1s\frac{1}{s}: L(s)=166.4s(0.003328s+1)L(s) = \frac{166.4}{s(0.003328 s + 1)}.
  • Outer loop: ΘR=L1+L=166.40.003328s2+s+166.4\frac{\Theta}{R} = \frac{L}{1 + L} = \frac{166.4}{0.003328 s^2 + s + 166.4}, so ωn=166.4/0.003328=223.6 rad/s\omega_n = \sqrt{166.4/0.003328} = 223.6\ \text{rad/s} and ζ=12166.4×0.003328=0.672\zeta = \frac{1}{2\sqrt{166.4 \times 0.003328}} = 0.672.
  • Without the tachometer: L=497.5s(0.00995s+1)L = \frac{497.5}{s(0.00995 s + 1)}, the same ωn=223.6 rad/s\omega_n = 223.6\ \text{rad/s} but ζ=0.225\zeta = 0.225 (about 48 %48\,\% overshoot instead of 6 %6\,\%).

The tachometer feeds back θ˙\dot\theta, which is what a derivative term would compute; it is derivative action measured by a sensor, without the noise of differentiating a potentiometer signal.

Check: SymPy confirms the algebra, python-control the numbers.

python · try it yourself
import numpy as np
import sympy as sp
import control as ct

s, Kp, Ka, Km, tm, kt = sp.symbols("s K_p K_a K_m tau_m k_t", positive=True)
motor = Km / (tm * s + 1)
inner = sp.simplify(Ka * motor / (1 + Ka * motor * kt))
L = Kp * inner / s
T = sp.factor(sp.simplify(L / (1 + L)))
print("Theta/R =", T)

vals = dict(Kp=5.0, Ka=2.0, kt=0.02, Km=0.02 / (2e-6 + 4e-4), tm=2 * 2e-6 / (2e-6 + 4e-4))
G_m = ct.tf([vals["Km"]], [vals["tm"], 1])
integ = ct.tf([1], [1, 0])
for name, k_t in (("with tachometer", vals["kt"]), ("without", 0.0)):
    inner_loop = ct.feedback(vals["Ka"] * G_m, k_t)          # speed loop, tach in the return path
    T_cl = ct.feedback(vals["Kp"] * inner_loop * integ, 1)   # angle loop, unity sensor
    wn, z, _ = ct.damp(T_cl, doprint=False)
    info = ct.step_info(T_cl, T=np.linspace(0, 0.1, 100001))
    print(f"{name:16s}: wn = {wn[0]:6.1f} rad/s, zeta = {z[0]:.3f}, overshoot {info['Overshoot']:4.1f} %, "
          f"settling {1e3 * info['SettlingTime']:5.1f} ms")
Theta/R = K_a*K_m*K_p/(K_a*K_m*K_p + K_a*K_m*k_t*s + s**2*tau_m + s)
with tachometer : wn =  223.6 rad/s, zeta = 0.672, overshoot  5.8 %, settling  26.9 ms
without         : wn =  223.6 rad/s, zeta = 0.225, overshoot 48.5 %, settling  75.5 ms

ct.feedback(G, H) is the feedback rule, * between systems is the series rule and + the parallel rule; nested calls follow the diagram from the inside out.

In the lab: same poles, different zeros

The PID lab can apply the derivative term either to the error (the textbook C(s)=Kp+Ki/s+KdsC(s) = K_p + K_i/s + K_d s in the forward path) or to the measurement only. Block-diagram algebra says this moves the KdsK_d s block from the forward path into the return path: the closed-loop poles (shown in the lab's diagram) stay exactly the same, the zeros change. With the default plant and Kp=3K_p = 3, Ki=2 s−1K_i = 2\ \text{s}^{-1}, Kd=1 sK_d = 1\ \text{s}, derivative on the error gives no overshoot and a rise time of 1.099 s1.099\ \text{s}; derivative on the measurement gives 7.80 %7.80\,\% overshoot, rise 999.3 ms999.3\ \text{ms} and settling 4.479 s4.479\ \text{s}. Same loop, same stability, different response to the reference. Practical PID explains when each is preferred.

r = 1+C(s): Kp 3, Ki 2, Kd 1P(s) = 1/((1s+1)(0.5s+1))y-T(s) = (1.000 s^2 + 3.000 s + 2.000) / (0.500 s^3 + 2.500 s^2 + 4.000 s + 2.000)closed-loop poles: -1.00, -2.00+j0.00, -2.00-j0.000.00.51.000.5 s1.0 s1.5 s2.0 s2.5 sty(t)t_s 1.96 sy(t)setpoint10-90 % rise

Guided lab: verify a reduced diagram on a motor

Hand calculation. With a small motor and a second identical motor coupled shaft-to-shaft as a tachometer, the tachometer voltage is kωk\omega; the speed loop of the worked example predicts the closed-loop speed time constant τm/(1+KaKmkt)\tau_m/(1 + K_a K_m k_t).

Simulation. Change kt and Ka in the program and watch ζ\zeta; find the ktk_t that gives ζ=0.7\zeta = 0.7.

What you would measure. Drive the motor from a small linear power amplifier or an H-bridge with PWM from a microcontroller, at 12 V12\ \text{V} with a 1 A1\ \text{A} current limit. Log the tachometer voltage at 1 kHz1\ \text{kHz} after a 1 V1\ \text{V} step of the speed reference, with and without the tachometer feedback in software. Expect the closed-loop time constant to shrink by roughly the factor 1+KaKmkt1 + K_a K_m k_t (here 3); the measurement scatters by ±15 %\pm 15\,\% because the real motor has dry friction and brush ripple on the tachometer.

Hazards and safe setup. Clamp both motors and the coupling, guard the coupling, current-limit the supply, flyback diodes on the driver. Never run the tachometer motor open-circuited above its rated voltage.

Pitfalls

  • Applying the feedback rule with the wrong sign: check whether the junction subtracts.
  • Moving a pickoff point and forgetting to compensate the branch.
  • Cancelling a pole and zero in the reduced expression when the pole belongs to an inner loop: the reduced transfer function looks simpler, but an internal signal may still oscillate or saturate.
  • Simplifying a diagram with a disturbance input as if the reference were the only input.

Practice

  1. Reduce: G1=10s+1G_1 = \frac{10}{s + 1} in the forward path, H=0.5H = 0.5 in the feedback path.
  2. Two blocks in parallel, 1s\frac{1}{s} and 22, followed by 1s+3\frac{1}{s + 3}. Give the total.
  3. A unity loop L=Ks(s+2)L = \frac{K}{s(s + 2)}. Which KK gives ζ=0.5\zeta = 0.5?
Answer
  1. 10/(s+1)1+5/(s+1)=10s+6\frac{10/(s + 1)}{1 + 5/(s + 1)} = \frac{10}{s + 6}.
  2. (1s+2)1s+3=2s+1s(s+3)\left(\frac{1}{s} + 2\right)\frac{1}{s + 3} = \frac{2s + 1}{s(s + 3)}.
  3. T=Ks2+2s+KT = \frac{K}{s^2 + 2s + K}: ωn=K\omega_n = \sqrt K, 2ζωn=22\zeta\omega_n = 2, so K=2\sqrt K = 2, K=4K = 4.

Test yourself

Negative feedback with GG forward and HH in the return path gives

  1. G1−GH\frac{G}{1 - GH}
  2. G1+GH\frac{G}{1 + GH}
  3. GH1+GH\frac{GH}{1 + GH}
  4. G+HG + H

Moving a summing junction from before a block GG to after it, the signal that was added must be

  1. divided by GG
  2. multiplied by GG
  3. left unchanged
  4. differentiated

Moving the derivative term from the forward path into the feedback path changes

  1. the closed-loop poles
  2. the closed-loop zeros only
  3. both poles and zeros
  4. nothing

In the servo, the tachometer raised the damping ratio from 0.225 to

  1. 0.300
  2. 0.500
  3. 0.672
  4. 1.000