Algorithm Search⌘K

Techniquecore

Loop shaping

Also called classical loop shaping.

Design a controller C by shaping the Bode plot of L = PC: high gain at low frequency, low gain at high frequency, and a crossover with a slope near -20 dB per decade and enough phase margin.

Loop shaping is a way to design a feedback controller CC by choosing the frequency response of the loop transfer function L=PCL = PC instead of the closed loop. The designer asks for high gain ∣L∣|L| at low frequency, so that the sensitivity function ∣S∣≈1/∣L∣|S| \approx 1/|L| is small and the loop tracks references and rejects disturbances; low gain at high frequency, so that ∣T∣≈∣L∣|T| \approx |L| is small and the loop ignores sensor noise and model errors; and a crossover where ∣L∣|L| passes 0 dB with a slope near −20-20 dB per decade and enough phase margin. On a Bode plot the factors of CC add to the curve of PP, so the controller is built one factor at a time. The Bode gain-phase relation and the Bode sensitivity integral say how far the shape can be pushed.

In plain words

The loop gain is the controller times the plant, and its curve against frequency tells most of the story. Where the curve is high, the loop follows commands and fights disturbances. Where it is low, the loop ignores noise and does not care about errors in the model. The designer draws the wanted curve: high at slow frequencies, low at fast ones, and a gentle slope where the curve passes through one, because a steep slope there brings too much lag and the loop starts to ring. Then the controller is the wanted curve divided by the plant, built from a few standard pieces such as an integrator, a lead and a lag. Last, the designer checks the margins and the response, and adjusts.

When it applies

  • The plant is linear, time invariant, and single input single output, with a model P(s)P(s) or a measured frequency response. For several inputs and outputs the same ideas work with singular values, with more care.
  • The specifications are, or can be turned into, bounds on ∣S∣|S| and ∣T∣|T| over frequency bands: an error of at most ϵ\epsilon for slow references and disturbances, a noise or uncertainty bound at high frequency, a peak MsM_s of 1.2 to 2, and a phase margin of 30 to 60 degrees.
  • The plant is minimum-phase and stable, or close to it. A zero in the right half plane at zz, a time delay τ\tau and an unstable pole at pp all limit the crossover frequency ωc\omega_c. Common rules of thumb are ωc<z/2\omega_c < z/2, ωc<1/τ\omega_c < 1/\tau and ωc>2p\omega_c > 2p; an unstable pole and a slower zero in the right half plane together make the design hard or impossible.

The template

  1. Turn the specifications into bounds on ∣L∣|L|. If ∣L∣≥1/ϵ|L| \ge 1/\epsilon with ϵ<1\epsilon < 1, then ∣S∣=1/∣1+L∣≤ϵ/(1−ϵ)|S| = 1/|1 + L| \le \epsilon/(1 - \epsilon). If ∣L∣≤δ<1|L| \le \delta < 1, then ∣T∣=∣L∣/∣1+L∣≤δ/(1−δ)|T| = |L|/|1 + L| \le \delta/(1 - \delta). So a low-frequency band where ∣S∣|S| must be small becomes a floor under ∣L∣|L|, and a high-frequency band where ∣T∣|T| must be small becomes a ceiling over ∣L∣|L|. For a relative model uncertainty of size ∣W(jω)∣|W(j\omega)|, robust stability asks ∣T(jω)W(jω)∣<1|T(j\omega)W(j\omega)| < 1, which is again a ceiling at high frequency.
  2. Choose the crossover frequency ωc\omega_c. It must lie between the floor band and the ceiling band, and below the limits set by zeros in the right half plane and delays. The closed-loop bandwidth is roughly ωc\omega_c.
  3. Draw the target loop. Put an integrator in LL if steady state errors to steps must be 0. Give ∣L∣|L| a slope of about −20-20 dB per decade over roughly a decade around ωc\omega_c; by the gain-phase relation this keeps the phase near −90-90 to −135-135 degrees there. Let the gain fall faster above that band, for roll-off.
  4. Build CC. Write C=Ltarget/PC = L_{\text{target}}/P in terms of standard factors: a gain, an integrator or a PI factor (Tis+1)/(Tis)(T_i s + 1)/(T_i s), a lead-lag compensator for phase near ωc\omega_c, and extra poles for roll-off. Never cancel a pole or zero of PP in the closed right half plane.
  5. Check and iterate. Compute the margins, MsM_s and Mt=max⁡∣T∣M_t = \max|T|, confirm with the Nyquist stability criterion or the closed-loop poles that the loop is asymptotically stable, and look at the step responses to the reference and to a load disturbance.

Why it works. At frequencies where ∣L∣≫1|L| \gg 1, S≈1/LS \approx 1/L and T≈1T \approx 1. Where ∣L∣≪1|L| \ll 1, S≈1S \approx 1 and T≈LT \approx L. So far from crossover, the closed loop is read directly from LL, and the shape of ∣L∣|L| alone sets performance and noise rejection. Near crossover neither approximation holds, and there the phase of LL decides the peaks of ∣S∣|S| and ∣T∣|T|; for a minimum-phase loop that phase is fixed by the slope of ∣L∣|L|, which is why step 3 asks for a gentle slope. The sensitivity integral adds a global limit: with a finite bandwidth, a deeper floor under ∣L∣|L| costs a higher peak of ∣S∣|S| elsewhere.

Classic examples

A PI controller for three equal lags. Let P(s)=1/(s+1)3P(s) = 1/(s + 1)^3 and ask for zero steady state error to steps and a phase margin of 60 degrees. Take C(s)=kp(Tis+1)/(Tis)C(s) = k_p(T_i s + 1)/(T_i s). The integrator gives the floor at low frequency. Put the PI zero a factor 3 below crossover, Tiωc=3T_i\omega_c = 3, so that the PI factor costs 90−arctan⁡3=18.4390 - \arctan 3 = 18.43 degrees at ωc\omega_c. The plant phase is −3arctan⁡ω-3\arctan\omega, so the margin of 60 degrees needs 3arctan⁡ωc=180−60−18.43=101.573\arctan\omega_c = 180 - 60 - 18.43 = 101.57 degrees, which gives ωc=tan⁡(33.86∘)=0.67083\omega_c = \tan(33.86^\circ) = 0.67083 and Ti=4.47205T_i = 4.47205. The gain from ∣L(jωc)∣=1|L(j\omega_c)| = 1 is

kp=(1+ωc2)3/21+1/9=1.451.51.05409=1.65646,k_p = \frac{(1 + \omega_c^2)^{3/2}}{\sqrt{1 + 1/9}} = \frac{1.45^{1.5}}{1.05409} = 1.65646,

so ki=kp/Ti=0.37040k_i = k_p/T_i = 0.37040. You can check the phase by hand: at ωc\omega_c the plant gives −101.57-101.57 degrees and the PI factor −18.43-18.43 degrees, −120-120 in total.

The resulting loop has these properties:

quantity value
phase margin 60.00 degrees at ωc=0.67083\omega_c = 0.67083
gain margin 3.7819 (11.554 dB) at ω=1.55612\omega = 1.55612
peak sensitivity MsM_s 1.73168 at ω=1.07547\omega = 1.07547
peak of ∣T∣\lvert T\rvert 1.08677 at ω=0.86866\omega = 0.86866
closed-loop poles −2.14048-2.14048, −0.34699±0.96173j-0.34699 \pm 0.96173j, −0.16554-0.16554

The approximations of step 1 hold away from crossover. At ω=0.01\omega = 0.01, ∣S∣=0.02695|S| = 0.02695 and 1/∣L∣=0.026971/|L| = 0.02697; at ω=0.1\omega = 0.1, ∣S∣=0.23604|S| = 0.23604 and 1/∣L∣=0.250161/|L| = 0.25016. At ω=3\omega = 3, ∣T∣=0.05473|T| = 0.05473 and ∣L∣=0.05253|L| = 0.05253; at ω=10\omega = 10, ∣T∣=0.001633|T| = 0.001633 and ∣L∣=0.001632|L| = 0.001632.

For comparison, the classic Ziegler-Nichols PID for the same plant (Kp=4.8K_p = 4.8, Ti=1.8138T_i = 1.8138, Td=0.45345T_d = 0.45345) has a phase margin of 30.62 degrees at ωc=1.37545\omega_c = 1.37545 and Ms=2.13177M_s = 2.13177: a faster loop with half the phase margin and a higher peak of ∣S∣|S|.

The slow pole of the PI zero. The closed-loop pole at −0.16554-0.16554 is close to the PI zero at −1/Ti=−0.22361-1/T_i = -0.22361. In the response to a reference step the pair nearly cancels and leaves a small slow tail. In the response to a load disturbance at the plant input, the zero is not in the transfer function PSPS, and the slow pole shows fully. Placing the PI zero closer to ωc\omega_c speeds this pole up but costs phase margin.

A lead network on a fast plant. For P(s)=10/(s(s+1))P(s) = 10/(s(s + 1)), the loop without compensation has its crossover at 3.08423 rad/s with a phase margin of only 17.96 degrees. A lead network adds about 37 degrees at a new crossover of 4.41659 rad/s and gives a margin of 49.63 degrees with the same low-frequency gain; the lead-lag compensator page works this example through.

Variations

  • Lead-lag design. Shape the loop with one or two first-order lead or lag factors, the classical form of loop shaping before computers (lead-lag compensator).
  • PID tuning by loop shaping. Fix the crossover and margin of a PID controller loop, as in the example above, instead of a tuning table.
  • Design on the Nichols chart. Work with the curve of LL on the Nichols chart, where a gain change moves the curve up or down and the closed-loop peak is read from the contours.
  • Horowitz's design against uncertainty. Isaac Horowitz (1963) designed LL so that a whole set of plants meets the specifications, by bounds on LL at each frequency; he later developed this into quantitative feedback theory.
  • H-infinity loop shaping. Shape the plant with weights by the classical rules, then compute a controller that robustly stabilizes the shaped plant (H-infinity loop shaping).
  • Mixed-sensitivity design. Write the floor and the ceiling as weights on SS and TT and minimize an H-infinity norm (mixed-sensitivity design).
  • Two degrees of freedom. Shape LL for feedback properties only, and shape the reference response with a prefilter (two-degree-of-freedom control).

Pitfalls

  • Cancelling an unstable pole or a zero in the right half plane. C=1/PC = 1/P near such a factor gives a nice LL but an internally unstable loop: the cancelled mode is still there in PSPS or CSCS.
  • Shaping the gain and forgetting the phase. A slope of −40-40 dB per decade at crossover gives a phase near −180-180 degrees for a minimum-phase loop. With a delay or a zero in the right half plane the phase is even lower than the slope suggests.
  • Trusting the two margins. A loop with good gain and phase margins can still pass close to −1-1 between the crossovers, for example near a lightly damped mode. Check MsM_s as well (see the example on the gain margin page).
  • Several crossovers. If ∣L∣|L| crosses 0 dB more than once, each crossover needs its own phase margin, and the smallest counts.
  • Saturation. The linear design assumes that the actuator does not saturate. A high gain at low frequency with an integrator needs anti-windup.
  • Pushing the floor too far. By the sensitivity integral, a deeper or wider floor under ∣L∣|L| raises the peak of ∣S∣|S| when the bandwidth is limited.

Exercises

  1. In the PI example, what does the PI factor cost in phase at ωc\omega_c if Tiωc=5T_i\omega_c = 5? (Answer: 90−arctan⁡5=11.3190 - \arctan 5 = 11.31 degrees.)
  2. Redo the PI design for a phase margin of 45 degrees with Tiωc=3T_i\omega_c = 3. (Answer: ωc=0.80560\omega_c = 0.80560, Ti=3.72392T_i = 3.72392, kp=2.00886k_p = 2.00886.)
  3. Show that ∣L(jω)∣≥10|L(j\omega)| \ge 10 implies ∣S(jω)∣≤1/9|S(j\omega)| \le 1/9, and that ∣L(jω)∣≤0.1|L(j\omega)| \le 0.1 implies ∣T(jω)∣≤1/9|T(j\omega)| \le 1/9.
  4. For L(s)=k/(s(s+1))L(s) = k/(s(s + 1)), find kk for a phase margin of 45 degrees. (Answer: the phase is −135-135 degrees at ω=1\omega = 1, so k=2k = \sqrt 2.)
  5. Let P(s)=1/(s−1)P(s) = 1/(s - 1) and C(s)=2(s−1)/(s(s+1))C(s) = 2(s - 1)/(s(s + 1)). Compute LL and its margins, then compute PSPS and explain why the loop is not usable.

References

  1. Isaac M. Horowitz, Synthesis of Feedback Systems, Academic Press, 1963, the whole book (the design of the loop transmission against plant uncertainty and the cost of feedback in bandwidth); no chapter locator confirmed
  2. John C. Doyle, Bruce A. Francis and Allen R. Tannenbaum, Feedback Control Theory, Macmillan, 1992 (Dover reprint, 2009), Chapter 7, Loopshaping (performance and robustness specifications turned into bounds on the loop gain)
  3. Sigurd Skogestad and Ian Postlethwaite, Multivariable Feedback Control, Analysis and Design, second edition, Wiley, 2005, Section 2.6, Loop shaping, with Section 2.6.1 on the trade-offs in terms of L and Section 2.6.2 on the fundamentals, including the limits from zeros in the right half plane and from time delays
  4. Karl Johan Åström and Richard M. Murray, Feedback Systems, An Introduction for Scientists and Engineers, second edition, Princeton University Press, 2021, Chapter 12, Frequency Domain Design, the section on feedback design via loop shaping

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples