Skip to content
ComputeVerse.ai

Control SystemsDesign workbenchPreliminary engineering

Bode Plot Generator

Magnitude (dB) and unwrapped phase of H(jω) on a log-frequency axis, with gain and phase crossovers located and both stability margins annotated.

About this calculator

The Bode plot is the frequency-domain workhorse: magnitude in decibels and phase in degrees against log frequency, where cascaded dynamics simply add. This generator evaluates H(jω) exactly — no straight-line asymptote approximation — with the phase unwrapped so a third-order roll-off honestly reads −270° instead of jumping back across the ±180° seam.

When H(s) is an OPEN-LOOP transfer function L(s) about to be wrapped in a negative-unity-feedback loop, the two classical margins live on this plot. The gain crossover ω_gc is where |L| passes 0 dB, and the phase margin PM = 180° + ∠L(jω_gc) is how much additional phase lag the loop tolerates before oscillating. The phase crossover ω_pc is where the phase passes −180°, and the gain margin GM = −20·log₁₀|L(jω_pc)| is how much additional gain fits before the same fate. Both crossings are found by bisection on the exact response, not read off the grid.

The margins are reported with their standard caveat stated rather than hidden: for open-loop stable, minimum-phase-like systems, positive margins certify closed-loop stability. When L(s) itself has right-half-plane poles or multiple crossovers, the numbers still compute but the Nyquist criterion is the arbiter — this tool tells you when that is the case and links to the Nyquist plot.

Evaluate at a specific frequency for the exact magnitude and phase there, worked symbol → substitution → result like every calculator on this site.

Design notes & common mistakes

  • Margins are open-loop quantities used to predict closed-loop behavior — compute them on L(s) = G(s)·C(s)·H(s), never on the closed-loop transfer function.
  • 20·log₁₀ vs 10·log₁₀ is the classic dB trap: transfer-function magnitudes are amplitude ratios, so Bode magnitude uses 20·log₁₀. Power quantities use 10·log₁₀.
  • Phase wrapping hides margins: a plot that jumps from −180° to +180° can look fine while the unwrapped phase is diving through −270°. This tool unwraps; many quick plotters don't.
  • Both margins can be positive while the loop is unstable when L(s) has RHP poles or the locus crosses 0 dB several times — that is what the Nyquist plot is for.

Assumptions

  • H(jω) is evaluated exactly by complex polynomial division — no asymptotic straight-line approximation.
  • Phase is unwrapped by continuity along the frequency sweep.
  • Crossover frequencies are refined by bisection to a relative tolerance of about 1e−10 (verified against the analytic ω_pc = √2 of the classic 1/(s(s+1)(s+2)) example in the engine tests).
  • Margins presume the negative-unity-feedback convention and are only a stability certificate for open-loop-stable systems without pathological multiple crossings.

When to use this calculator

Appropriate for

  • Plotting exact magnitude and unwrapped phase of an open-loop transfer function versus frequency
  • Reading gain and phase margins and their crossover frequencies for an open-loop-stable loop
  • Teaching frequency-response and margin concepts

Not suitable for

  • Loops whose open loop has right-half-plane poles or multiple crossovers, where Bode margins mislead — use the Nyquist criterion
  • Systems with transport delay, which subtracts phase and can erase a margin the rational plot shows as healthy
  • Final controller sign-off without a full robustness and disturbance-rejection assessment

What this calculator does not cover

  • No transport delay e^(−sT): delay subtracts ωT of phase without touching magnitude and can erase a phase margin this plot shows as healthy.
  • Margins are computed for the negative-unity-feedback convention only; positive-feedback or non-unity sensor loops need L(s) formed accordingly before entry.
  • When multiple gain crossovers exist, the binding (smallest) margin is reported — inspect the full plot rather than trusting one number.
  • Continuous-time only; sampled-data phase loss (ZOH ≈ ωT_s/2 lag) is not modeled.
  • As with every calculator on this site: results are preliminary and educational, are not verified for any specific installation, and must be reviewed against the applicable code edition and stamped by a licensed Professional Engineer before real-world use.

Frequently asked questions

What do gain margin and phase margin actually protect against?

Gain margin is how much the loop gain can increase (in dB) before oscillation at the phase-crossover frequency; phase margin is how much extra phase lag — from delays, filters, or unmodeled dynamics — fits at the gain crossover. They are robustness budgets, not just stability booleans.

What margins should I design for?

Common practice is PM of 45–60° and GM of at least 6–10 dB. Below ~30° of phase margin the closed loop rings hard, and ordinary model error can consume the rest. The right values are application-specific; these are the classical starting targets.

Why is the phase unwrapped instead of jumping at ±180°?

Because margins live at the −180° line: a wrapped plot renders −181° as +179° and visually destroys the crossing. Unwrapping keeps phase continuous so a third-order system honestly descends to −270°.

When do Bode margins fail as a stability test?

When the open loop already has right-half-plane poles, or when the magnitude crosses 0 dB more than once — then encirclement counting on the Nyquist plot is the reliable criterion. The tool flags the RHP-pole case explicitly.

References

  • Nise, N. S., Control Systems Engineering, 8th ed., Ch. 10 (frequency response techniques; gain and phase margin)
  • Franklin, G., Powell, J. & Emami-Naeini, A., Feedback Control of Dynamic Systems, 8th ed., Ch. 6 (frequency-response design)
  • Ogata, K., Modern Control Engineering, 5th ed., Ch. 7 (Bode diagrams, stability margins)

Related calculators

Get the ComputeVerse.ai quick reference

A free engineering quick-reference PDF, plus a note when new calculators launch across the library — one or two emails a month, nothing else.