A lead compensator C(s) = K(s+z)/(s+p) with z < p (zero closer to origin than pole) contributes positive phase in the frequency range between z and p, increasing phase margin and speeding up the transient response. A lag compensator has z > p, providing high gain at low frequencies to improve steady-state accuracy while attenuating the loop gain at higher frequencies. Frequency-domain design places the compensator's maximum phase contribution at the desired gain crossover frequency by choosing the geometric mean of z and p to coincide with ωgc. A lead-lag compensator combines both structures to simultaneously improve transient response and reduce steady-state error.
Design lead and lag compensators separately for the same plant and verify on Bode plots that phase margin and low-frequency gain meet specifications. Compare the resulting step responses to those from a PID controller designed for the same plant.
Your Bode plot and gain/phase margin analysis gives you the diagnostic: the gain crossover frequency ωgc (where loop gain = 1) determines response speed, and the phase margin at ωgc measures stability buffer. A system with insufficient phase margin oscillates or goes unstable; one with poor low-frequency gain has large steady-state error. Compensators are transfer function blocks inserted into the loop to surgically reshape these properties. The choice of compensator type follows directly from the diagnosis.
A lead compensator C(s) = K(s+z)/(s+p) with z < p has its zero closer to the origin than its pole. On the Bode plot, the zero adds +20 dB/decade starting at ωz = z, and the pole subtracts it back starting at ωp = p — so the net effect is a magnitude hump and, crucially, a positive phase contribution in the band between z and p. The maximum phase lead occurs at the geometric mean ωm = √(zp) and equals φmax = arcsin((α−1)/(α+1)) where α = p/z > 1. Design procedure: choose the desired ωgc, set ωm equal to it (place maximum phase boost at the new crossover), then solve for z and p. The compensator typically shifts ωgc higher (faster response) while adding 30–60° of phase margin. The cost is increased high-frequency gain, which amplifies sensor noise — a real constraint in practice.
A lag compensator C(s) = K(s+z)/(s+p) with z > p (pole closer to origin) is the mirror image in the Bode plot: high gain at low frequencies, attenuating to unity at high frequencies. It does not add phase; in fact it subtracts a small amount in the transition region, which is why both its pole and zero must be placed far below ωgc (typically at 1/10 of ωgc) so their phase drag at crossover is negligible (under 5°). The benefit is entirely at low frequencies: by increasing the DC loop gain, the lag compensator reduces steady-state error to step and ramp inputs. Design procedure: set the low-frequency gain ratio K = p/z to achieve the required reduction in steady-state error, then place both corner frequencies well below ωgc.
A lead-lag compensator stacks both to address both deficiencies simultaneously. The lead section targets transient response and phase margin; the lag section targets steady-state accuracy. This is the frequency-domain analogue of PID control: the derivative action in PID resembles lead (adds phase, speeds response), and the integral action resembles an extreme lag (pole at origin, eliminates steady-state error entirely). The advantage of the frequency-domain approach is transparency — you can read directly from the Bode plot where each section's contribution lands and verify that specifications are met before implementing anything. The key judgment call is always diagnosing which deficiency you're solving: if the system is oscillatory, reach for lead; if it tracks poorly at steady state, reach for lag; if both, use lead-lag.