Poles that move with K
A motor turns a camera arm to the angle we ask for. The plant is G(s) = 1/(s(s+1)(s+2)). An amplifier multiplies the error by a gain K, and feedback brings the arm's angle back to compare. K is our only knob.
The closed-loop poles are the roots of 1 + K·G(s) = 0, which here is s³ + 3s² + 2s + K = 0. Every K gives three poles. At K = 0 they sit on the plant's own poles: 0, −1 and −2.
Turn the dial from 0 to 6 and follow the poles. Two meet at −0.423 and leave the axis; the third heads left. Their paths are the root locus. At K = 6 the pair reaches ±1.41j: the edge of stability.
Find the gain
We want the pair's damping ratio ζ = 0.5: about 16.3% overshoot for a pure two-pole system. Every pole with ζ = 0.5 lies on one ray from the origin, 60° up from the negative real axis, because cos 60° = 0.5.
A point is on the locus when the angles from the plant's poles add up to 180°. Walking out along the ray, that happens at distance 0.667 from the origin: s* = −0.333 + 0.577j. This is our design point.
On the locus, K = 1/|G(s*)|: multiply the distances from the plant's poles to s*. That is 0.667 × 0.882 × 1.764 = 1.037. In Python, K = −1/G(s) gives the same number in one line.
Check it
Set K = 1.037 (exactly 28/27). The pair glides onto the ray at −0.333 ± 0.577j. The third pole stops at −2.33, because the three poles must still add up to −3.
The pair's real part is −0.333; the third pole sits at −2.33, 7 times further left. Its term e^(−2.33t) dies 7 times faster, so the pair sets the shape. A common rule asks for at least 5 times.
Now the real test: a unit step, integrated from the closed loop. The arm overshoots by 15.5% at 5.93 s and stays within 2% after 12.5 s. The predicted 16.3% was close: the third pole trims a little.
Why not more gain? At K = 3 the pair climbs past the ray to −0.164 ± 1.047j, ζ = 0.15. The arm overshoots 56.5% and needs 22.2 s to settle. On the root locus, picking K means picking this trade.
The working
# step 1/10 · loop
# about: Command: unit step, Compare (error), Gain dial K, Plant G(s), Arm angle y
plant G(s) = 1 / (s(s + 1)(s + 2))
controller gain K (an amplifier)
feedback unity: error = command - angle
closed loop T(s) = K·G / (1 + K·G)
= K / (s³ + 3s² + 2s + K)
The question: which K gives a good response?
The plant 1/(s(s+1)(s+2)) is a standard textbook servo model with round numbers, not a measured motor. The locus is the exact roots of s³ + 3s² + 2s + K for many values of K; the step responses are integrated from the closed loop (RK4, 0.01 s steps) and measured to a 2% band. The Python uses only the standard library. With python-control installed, ct.root_locus_plot(ct.tf([1], [1, 3, 2, 0]), grid=True) draws this locus with lines of constant damping.