Shake the open loop
A gain K = 2.5 drives a motor that turns a dish. To judge the closed loop, we first open the feedback switch and test the open loop L(s) = K·G(s) alone: shake its input, watch its output.
Send a sine at ω = 1 rad/s. The output is a sine at the same ω, 2.42 times bigger (+7.7 dB) and 105.5° late. Those two numbers are |L(jω)| and ∠L(jω): one dot on each Bode plot.
Now sweep ω from 0.1 to 100 rad/s and plot every dot: gain in decibels and phase in degrees, both against log ω. That pair of curves is the open-loop Bode plot. Next, we read it, end by end.
Read the low end
At the low end the gain falls 20 dB per decade and the phase sits near −90°. That is the signature of one 1/s, one integrator: a type 1 loop. So a step is followed with zero error at rest.
Extend the low-frequency line. It is K/ω, so it meets 0 dB at ω = K = 2.5 rad/s. That frequency is the velocity constant Kv = 2.5. A ramp input is followed with a lag of 1/Kv = 0.40 per unit slope.
Each plant pole bends the curves. At 4 rad/s the slope steepens to −40 dB/decade, at 40 to −60. The phase falls past −135° and on towards −270°. How to sketch these lines is in the Circuits lesson on Bode plots.
Read the crossover
The gain crossover ωc is where the curve crosses 0 dB: here 2.19 rad/s. Below ωc the loop gain is big, so the closed loop follows the reference. Above it, it barely follows. So ωc roughly sets the speed.
Read the phase at ωc: −121.8°, which is 58.2° short of −180°. At −180° a sine of size 1 comes back inverted and the loop feeds itself. How far we stay from that edge is the phase margin.
Close the loop
Close the switch and send a unit step. With crossover at 2.19 rad/s and 58.2° to spare, the dish peaks at 1.26 s, overshoots 10% and settles within 2% by 1.9 s. No error at rest: type 1.
Set K = 25. The whole gain curve lifts 20.0 dB, the phase curve does not move. Kv becomes 25, crossover slides right to 9.47 rad/s, and the phase there is −170.4°: only 9.6° from −180°.
Close the loop again. The higher crossover makes it quicker: peak at 0.35 s, not 1.26 s. But with little phase to spare it overshoots 76% and rings until 4.9 s. The Bode plot showed this trade before we closed the loop.
What is happening
# step 1/11 · loop # about: Signal source, Compare r − y, Controller K, Plant G(s), Output meter, Feedback switch plant G(s) = 1 / ( s (1 + s/4) (1 + s/40) ) control K = 2.5 open loop L(s) = K G(s) closed loop T(s) = L / (1 + L) Everything about T can be read from L. So we measure L, with the switch open.
The plant is an illustrative motor and dish, G(s) = 1/(s(1 + s/4)(1 + s/40)), not a real datasheet. Every curve in the figure is computed from it: the Bode plots from L(jω), the step responses by integrating the closed-loop equation (RK4, 1 ms steps). The Python on the steps is plain Python 3 with the cmath and math modules. python-control computes the same numbers with control.bode_plot and control.margin.