Gain is not enough
The plant is G(s) = 1/(s(s + 1)(s + 2)). We want two things at once: follow a ramp with an error of only 0.1, so Kv = 10, and a phase margin of at least 45°, so the step response stays calm.
Kv = lim s·K·G(s) = K/2, so K = 20 gives Kv = 10. On the Bode plot the whole gain curve lifts, and its low-frequency line K/(2ω) meets 0 dB at ω = 10. The phase curve does not move.
But the curve now crosses 0 dB at 2.43 rad/s, where the phase is already −208.1°. That is 28.1° past −180°: a phase margin of −28.1°. The loop would feed itself.
Close the loop and send a unit step. The output shoots to 2.57, falls to −1.82, then climbs to 6.06: every swing is wider. Gain alone cannot meet both specs. We must reshape the middle of the curve and keep the low end.
Two tools
New crossover: 1 rad/s, where ∠G = −161.6°, a margin of only 18.4°. Want 50° after the lag, plus about 5° the lag will cost: 55 − 18.4 ≈ 37°. A lead (1 + s/0.5)/(1 + s/2) peaks at 1 rad/s with 36.9°, +6.0 dB.
Add the lead to K·G: the decibels add, and so do the degrees. The lead's extra gain drags crossover right, to 3.96 rad/s, where the plant has lost even more phase. Margin: −29.5°. Still unstable.
At 1 rad/s, K·G plus lead is 16.0 + 6.0 = 22.0 dB too high. A lag removes exactly that above its corners: zero at 0.1, a decade below, pole at 0.1/12.65 = 0.0079. Its cost at 1 rad/s: −5.3°.
The design
With both in the loop, |L| crosses 0 dB at 1.00 rad/s, where ∠L = −130.2°. Phase margin 49.8°, comfortably over 45°, and gain margin 11.4 dB. The low end is K·G's, so Kv is still 10.
Close the loop and send the step. It is stable now: a peak of 1.21 at 2.78 s (21% overshoot). Then a slow creep, 1.05 at 10 s, inside 2% only by 19.6 s: the lag's slow pole and zero leave a long tail.
Now send a ramp, r = t. After a minute the output trails it by 0.10, just as Kv = 10 promised: the lead and the lag both have a gain of 1 at ω = 0, so the low end of |L| never moved.
What is happening
# step 1/10 · specs
# about: Plant G(s)
plant G(s) = 1 / ( s (s + 1)(s + 2) )
spec 1 Kv = lim s·L(s) = 10 (s → 0)
ramp error = 1/Kv = 0.1
spec 2 phase margin ≥ 45°
Kv is set by the LOW end of the Bode plot,
the phase margin by the MIDDLE (crossover).
The plant G(s) = 1/(s(s + 1)(s + 2)) is a textbook-style example with illustrative numbers. Every curve in the figure is computed from it: the Bode plots from L(jω), the step and ramp responses by integrating the closed-loop equation (RK4, 2 ms steps). The Python is plain Python 3 with the math module. python-control gives the same margins: control.margin(L) returns the gain margin, phase margin and both crossover frequencies.