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 | ||
| parallel | and fed the same , outputs added | |
| negative feedback | forward, in the return path |
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 (downstream): signals added after it must be multiplied by to keep the same output; moving it upstream, divide them by .
- Moving a pickoff point (a branch) past a block downstream: the branch must be divided by ; upstream, multiplied by .
- 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, .
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 , which depends only on the loop.
The position servo
The reference motor of Modelling a DC Motor, reduced to first order (, ), 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: , , , motor , integrator .
Find: with and without the tachometer; and in both cases.
Solve:
- Inner loop (feedback rule): . With and : . The tachometer made the speed loop three times faster and three times weaker.
- Series with and : .
- Outer loop: , so and .
- Without the tachometer: , the same but (about overshoot instead of ).
The tachometer feeds back , 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.
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 in the forward path) or to the measurement only. Block-diagram algebra says this moves the 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 , , , derivative on the error gives no overshoot and a rise time of ; derivative on the measurement gives overshoot, rise and settling . Same loop, same stability, different response to the reference. Practical PID explains when each is preferred.
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 ; the speed loop of the worked example predicts the closed-loop speed time constant .
Simulation. Change kt and Ka in the program and watch ; find the that gives .
What you would measure. Drive the motor from a small linear power amplifier or an H-bridge with PWM from a microcontroller, at with a current limit. Log the tachometer voltage at after a 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 (here 3); the measurement scatters by 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
- Reduce: in the forward path, in the feedback path.
- Two blocks in parallel, and , followed by . Give the total.
- A unity loop . Which gives ?
Answer
- .
- .
- : , , so , .
Test yourself
Negative feedback with forward and in the return path gives
Moving a summing junction from before a block to after it, the signal that was added must be
- divided by
- multiplied by
- left unchanged
- differentiated
Moving the derivative term from the forward path into the feedback path changes
- the closed-loop poles
- the closed-loop zeros only
- both poles and zeros
- nothing
In the servo, the tachometer raised the damping ratio from 0.225 to
- 0.300
- 0.500
- 0.672
- 1.000