Lead-Lag Compensator Design Calculator

Design a lead compensator to boost phase margin or a lag compensator to improve steady-state error, with a direct phase/magnitude check at the design frequency.

🔧 Lead-Lag Compensator Design Calculator
Design frequency (ωm)10 rad/s
rad/s
0.1100
Required phase boost (φm)45°
°
570
Compensator gain (Kc)1
0.120
Error improvement factor (β)10
×
250
Decade separation (N)10
220
Verified phase at ωm
Zero (z)
Pole (p)
Recommended Kc
Magnitude at ωm
Step-by-step working

🔧 What is a Lead-Lag Compensator?

A lead-lag compensator is a first-order controller of the form Gc(s) = Kc(s+z)/(s+p) added into a feedback loop to reshape its frequency response near or below the gain crossover frequency. A lead compensator places its zero closer to the origin than its pole (z < p), which adds positive phase in a band of frequencies around their geometric mean, improving phase margin and speeding up the transient response, at the cost of some added high-frequency gain. A lag compensator does the opposite, placing its zero farther from the origin than its pole (z > p), which boosts low-frequency gain to shrink steady-state error while adding only a small, deliberately minimized phase lag near crossover.

Control engineers reach for a lead compensator when a system is stable but too slow or too oscillatory, phase margin is comfortable at low gain but a faster design needs more of it back. A servo motor position loop that overshoots too much when sped up, a voltage regulator that needs a quicker transient recovery, or an aircraft pitch-rate loop needing more damping margin are all classic lead-compensator use cases. A lag compensator is the tool of choice when the transient response is already acceptable but the steady-state error, the small residual gap between a ramp or step input and the settled output, is too large; adding low-frequency gain without disturbing the crossover region fixes that error without destabilizing the loop.

A common misconception is that lead and lag compensators are opposites that cancel each other out if used together. In practice a combined lead-lag network uses each stage for its own distinct job, the lead stage shapes the response near crossover for speed and damping, the lag stage shapes the response at low frequency for accuracy, and because the lag stage is placed a decade or more below crossover its effect on the lead stage's phase contribution near crossover is small by design, not by cancellation.

This calculator designs one stage at a time. In Lead mode, enter the phase boost you need and the frequency you need it at, and the calculator solves the standard lead-network design equations for the zero, the pole, and a recommended gain, then verifies the resulting network actually delivers that phase by direct computation. In Lag mode, enter the steady-state error improvement factor you need and the calculator places the zero and pole using the standard decade-separation rule, then verifies the small phase lag this adds at crossover.

📐 Formula

Gc(s)  =  Kc (s + z) / (s + p)
Lead (z < p): α = (1 − sinφm) / (1 + sinφm),   z = ωm√α,   p = ωm/√α
Recommended Kc = 1/√α (keeps 0 dB gain, and so the crossover frequency, at ωm)
Lag (z > p): z = ωm/N,   p = z/β,   DC gain Gc(0) = β
∠Gc(jω) = arctan(ω/z) − arctan(ω/p),   |Gc(jω)| = Kc√((ω²+z²)/(ω²+p²))
Example: Lead, φm = 45°, ωm = 10 rad/s → α = 0.1716, z = 4.142 rad/s, p = 24.142 rad/s, verified phase = 45.00°.

📖 How to Use This Calculator

Steps

1
Choose lead or lag. Select Lead to boost phase margin and transient response, or Lag to improve steady-state error.
2
Enter the design frequency. Type the design/crossover frequency ωm in rad/s that the compensator is being placed around.
3
Enter the mode-specific design spec. For Lead, enter the required phase boost φm and gain Kc. For Lag, enter the error improvement factor β and decade separation N.
4
Read the zero, pole, and verification. See the computed zero z, pole p, and a direct phase/magnitude check of Gc(jωm) against your design target, plus the Bode plots of the compensator alone.

💡 Example Calculations

Example 1 — Classic 45° Lead Design

Lead mode: φm = 45°, ωm = 10 rad/s, Kc = 1

1
α = (1 − sin45°) / (1 + sin45°) = 0.1716
2
z = 10×√0.1716 = 4.142 rad/s, p = 10/√0.1716 = 24.142 rad/s
3
Verification: ∠Gc(j10) = arctan(10/4.142) − arctan(10/24.142) = 45.00°, exactly matching the request
z = 4.142 rad/s, p = 24.142 rad/s, recommended Kc = 2.414
Try this example →

Example 2 — Lower-Frequency Lead Design

Lead mode: φm = 30°, ωm = 5 rad/s, Kc = 1

1
α = (1 − sin30°) / (1 + sin30°) = 0.3333
2
z = 5×√0.3333 = 2.887 rad/s, p = 5/√0.3333 = 8.660 rad/s
3
Verification: ∠Gc(j5) = 30.00°, magnitude at ωm with Kc=1 is -4.77 dB (attenuation the recommended Kc = 1.732 would cancel)
z = 2.887 rad/s, p = 8.660 rad/s, verified phase = 30.00°
Try this example →

Example 3 — Standard Lag Design for Steady-State Error

Lag mode: β = 10, ωm = 10 rad/s, N = 10

1
z = ωm/N = 10/10 = 1 rad/s
2
p = z/β = 1/10 = 0.1 rad/s, DC gain Gc(0) = z/p = 10 (matches β)
3
Phase lag added at ωm = 10: ∠Gc(j10) = -5.14°, a small, deliberately minimized cost
z = 1 rad/s, p = 0.1 rad/s, low-frequency gain boost = 20.00 dB, phase lag = -5.14°
Try this example →

Example 4 — Larger Error Improvement, Higher Crossover

Lag mode: β = 20, ωm = 20 rad/s, N = 10

1
z = 20/10 = 2 rad/s, p = 2/20 = 0.1 rad/s
2
Low-frequency gain boost = 20log₁₀(20) = 26.02 dB
3
Phase lag at ωm = 20: ∠Gc(j20) = -5.42°, still small despite the larger β
z = 2 rad/s, p = 0.1 rad/s, low-frequency gain boost = 26.02 dB, phase lag = -5.42°
Try this example →

❓ Frequently Asked Questions

What is the difference between a lead and a lag compensator?+
A lead compensator Gc(s) = Kc(s+z)/(s+p) with z smaller than p adds positive phase near the gain crossover frequency, improving phase margin and transient response at the cost of pushing crossover slightly higher. A lag compensator has z larger than p and adds gain at low frequency to shrink steady-state error, while adding only a small negative phase near crossover if its pole and zero are placed well below it.
How do you calculate the lead compensator's zero and pole?+
First find alpha = (1 - sin(phi_m)) / (1 + sin(phi_m)) from the required phase boost phi_m. Then the zero is z = wm*sqrt(alpha) and the pole is p = wm/sqrt(alpha), where wm is the frequency at which you want that maximum phase boost to occur, usually the target new gain crossover frequency.
Why does the lead compensator's maximum phase occur at sqrt(z*p)?+
The phase of (s+z)/(s+p) is arctan(w/z) - arctan(w/p), and taking the derivative with respect to w and setting it to zero shows the maximum occurs exactly at w = sqrt(z*p), the geometric mean of the zero and pole frequencies. The lead design equations place z and p so that this geometric mean lands exactly at your chosen design frequency wm.
How do you calculate the lag compensator's zero and pole?+
Pick a decade separation factor N (10 is standard) and place the zero at z = wm/N, a decade below the target crossover wm. Then the pole is p = z/beta, where beta is how much you want to multiply the steady-state error constant by. The DC gain of the network, Gc(0) = z/p, equals beta exactly.
Why is the lag compensator's zero placed a decade below crossover?+
Placing both the zero and pole well below the crossover frequency keeps the phase contribution of (s+z)/(s+p) small and negative at crossover, typically only a few degrees, instead of the tens of degrees it would add if placed closer to crossover. This preserves most of the original phase margin while still delivering the full low-frequency gain boost.
What is the maximum practical phase boost from a single lead stage?+
Around 60 degrees is the commonly cited practical ceiling for a single lead network, since pushing alpha toward zero to get more phase also requires an increasingly large pole-to-zero frequency ratio and a correspondingly large gain correction, both of which amplify high-frequency noise. Designs needing more than about 60 degrees typically cascade two lead stages instead.
Does adding a lead or lag compensator change the gain crossover frequency?+
Yes, generally. A lead compensator boosts magnitude near its zero-pole pair (by a factor of 1/sqrt(alpha) at wm before any gain correction), which tends to push the crossover higher unless Kc is chosen to compensate. A lag compensator is designed to leave the magnitude at the original crossover frequency almost unchanged, since its zero and pole sit a decade below it and their effects nearly cancel there.
What does the recommended Kc value do in lead compensator mode?+
Kc = 1/sqrt(alpha) exactly cancels the pole-zero pair's inherent attenuation of sqrt(alpha) at the design frequency wm, so the compensated loop's gain crossover frequency stays at wm rather than shifting to wherever the uncorrected network happens to cross 0 dB.
Can I design a combined lead-lag compensator with this calculator?+
This calculator designs one stage at a time, a lead stage for phase margin and transient response, or a lag stage for steady-state error. A full lead-lag network is simply the product of both individually-designed transfer functions cascaded together, Gc(s) = Gc_lead(s) * Gc_lag(s), each contributing its own effect with minimal interaction if the lag stage stays well below crossover as recommended.
Why does the lag compensator's DC gain equal beta exactly?+
At s = 0, Gc(0) = Kc*z/p. With z = wm/N and p = z/beta, the ratio z/p simplifies to beta regardless of the specific values of wm and N, so with Kc = 1 the network's low-frequency gain boost is exactly beta, matching the steady-state error constant improvement you asked for.
What steady-state error constant does a lag compensator improve?+
It multiplies whichever error constant applies to the system type by the DC gain boost beta, Kp for a Type 0 system's step response, Kv for a Type 1 system's ramp response, or Ka for a Type 2 system's parabolic response. Since steady-state error is inversely proportional to that constant, a beta-times larger constant means a beta-times smaller steady-state error.
Why does the phase verification matter for the lead compensator?+
The lead design formulas are only useful if the resulting network actually delivers the requested phase boost at the frequency you designed for. This calculator recomputes the exact phase of Gc(jwm) = arctan(wm/z) - arctan(wm/p) from the derived z and p and displays it directly, confirming it matches your input phi_m rather than asking you to trust the algebra alone.

What is the difference between a lead and a lag compensator?

A lead compensator Gc(s) = Kc(s+z)/(s+p) with z smaller than p adds positive phase near the gain crossover frequency, improving phase margin and transient response at the cost of pushing crossover slightly higher. A lag compensator has z larger than p and adds gain at low frequency to shrink steady-state error, while adding only a small negative phase near crossover if its pole and zero are placed well below it.

How do you calculate the lead compensator's zero and pole?

First find alpha = (1 - sin(phi_m)) / (1 + sin(phi_m)) from the required phase boost phi_m. Then the zero is z = wm*sqrt(alpha) and the pole is p = wm/sqrt(alpha), where wm is the frequency at which you want that maximum phase boost to occur, usually the target new gain crossover frequency.

Why does the lead compensator's maximum phase occur at sqrt(z*p)?

The phase of (s+z)/(s+p) is arctan(w/z) - arctan(w/p), and taking the derivative with respect to w and setting it to zero shows the maximum occurs exactly at w = sqrt(z*p), the geometric mean of the zero and pole frequencies. The lead design equations place z and p so that this geometric mean lands exactly at your chosen design frequency wm.

How do you calculate the lag compensator's zero and pole?

Pick a decade separation factor N (10 is standard) and place the zero at z = wm/N, a decade below the target crossover wm. Then the pole is p = z/beta, where beta is how much you want to multiply the steady-state error constant by. The DC gain of the network, Gc(0) = z/p, equals beta exactly.

Why is the lag compensator's zero placed a decade below crossover?

Placing both the zero and pole well below the crossover frequency keeps the phase contribution of (s+z)/(s+p) small and negative at crossover, typically only a few degrees, instead of the tens of degrees it would add if placed closer to crossover. This preserves most of the original phase margin while still delivering the full low-frequency gain boost.

What is the maximum practical phase boost from a single lead stage?

Around 60 degrees is the commonly cited practical ceiling for a single lead network, since pushing alpha toward zero to get more phase also requires an increasingly large pole-to-zero frequency ratio and a correspondingly large gain correction, both of which amplify high-frequency noise. Designs needing more than about 60 degrees typically cascade two lead stages instead.

Does adding a lead or lag compensator change the gain crossover frequency?

Yes, generally. A lead compensator boosts magnitude near its zero-pole pair (by a factor of 1/sqrt(alpha) at wm before any gain correction), which tends to push the crossover higher unless Kc is chosen to compensate. A lag compensator is designed to leave the magnitude at the original crossover frequency almost unchanged, since its zero and pole sit a decade below it and their effects nearly cancel there.

What does the recommended Kc value do in lead compensator mode?

Kc = 1/sqrt(alpha) exactly cancels the pole-zero pair's inherent attenuation of sqrt(alpha) at the design frequency wm, so the compensated loop's gain crossover frequency stays at wm rather than shifting to wherever the uncorrected network happens to cross 0 dB.

Can I design a combined lead-lag compensator with this calculator?

This calculator designs one stage at a time, a lead stage for phase margin and transient response, or a lag stage for steady-state error. A full lead-lag network is simply the product of both individually-designed transfer functions cascaded together, Gc(s) = Gc_lead(s) * Gc_lag(s), each contributing its own effect with minimal interaction if the lag stage stays well below crossover as recommended.

Why does the lag compensator's DC gain equal beta exactly?

At s = 0, Gc(0) = Kc*z/p. With z = wm/N and p = z/beta, the ratio z/p simplifies to beta regardless of the specific values of wm and N, so with Kc = 1 the network's low-frequency gain boost is exactly beta, matching the steady-state error constant improvement you asked for.

What steady-state error constant does a lag compensator improve?

It multiplies whichever error constant applies to the system type by the DC gain boost beta, Kp for a Type 0 system's step response, Kv for a Type 1 system's ramp response, or Ka for a Type 2 system's parabolic response. Since steady-state error is inversely proportional to that constant, a beta-times larger constant means a beta-times smaller steady-state error.

Why does the phase verification matter for the lead compensator?

The lead design formulas are only useful if the resulting network actually delivers the requested phase boost at the frequency you designed for. This calculator recomputes the exact phase of Gc(jwm) = arctan(wm/z) - arctan(wm/p) from the derived z and p and displays it directly, confirming it matches your input phi_m rather than asking you to trust the algebra alone.