Bode Plot Simulator: Frequency Response & Stability Margins

simulator intermediate ~10 min
Loading simulation...
PM = 52°, GM = 12 dB — adequate stability margins

With ωn=10 rad/s and ζ=0.5, the system has a phase margin of 52° and gain margin of 12 dB, providing robust stability against parameter variations.

Formula

G(jω) = Kωn² / ((jω)² + 2ζωn(jω) + ωn²)
|G|_dB = 20·log₁₀|G(jω)|
∠G = arctan(Im(G)/Re(G))

Frequency Domain Analysis

While time-domain simulations show how a system responds to specific inputs, frequency-domain analysis reveals the complete input-output behavior at all frequencies simultaneously. A Bode plot decomposes this into two intuitive graphs: how much the system amplifies each frequency (magnitude) and how much it delays each frequency (phase). Together, they fully characterize a linear time-invariant system.

Reading the Bode Plot

The magnitude plot shows gain in decibels versus log frequency. A flat region means constant amplification, a -20 dB/decade slope indicates a single pole, and -40 dB/decade indicates a double pole or two cascaded poles. Resonance peaks reveal underdamped natural frequencies. The phase plot shows the cumulative phase shift — each pole contributes up to -90° of lag, distributed over two decades centered at the pole frequency.

Stability from Frequency Response

The Bode stability criterion states that a feedback system is stable if the open-loop gain is less than 0 dB when the phase reaches -180°. The gain margin quantifies how far below 0 dB the gain is at the phase crossover, while the phase margin measures how far above -180° the phase is at the gain crossover. Typical design targets are GM > 6 dB and PM > 30°–60° for robust performance.

Design with Bode Plots

Engineers use Bode plots to design compensators — lead networks that add phase at the crossover frequency to increase phase margin, and lag networks that reduce gain at high frequencies to increase gain margin. The graphical nature of Bode plots makes iterative design intuitive: reshape the magnitude and phase curves by adding poles, zeros, and gain until the stability margins and bandwidth meet specifications.

FAQ

What is a Bode plot?

A Bode plot consists of two graphs: magnitude (in dB) and phase (in degrees) of a system's frequency response, both plotted against log frequency. Invented by Hendrik Bode at Bell Labs in the 1930s, it provides intuitive insight into how a system amplifies or attenuates signals at different frequencies.

What are gain margin and phase margin?

Gain margin is how much additional gain (in dB) can be added before the system becomes unstable — measured at the phase crossover frequency where phase equals -180°. Phase margin is how much additional phase lag can be tolerated — measured at the gain crossover frequency where magnitude equals 0 dB. Both must be positive for stability.

How does damping ratio affect the Bode plot?

Low damping (ζ < 0.707) creates a resonance peak near the natural frequency, while high damping eliminates the peak. The peak magnitude is approximately 1/(2ζ), meaning ζ=0.1 produces a 14 dB peak — a 5x amplification at resonance.

Why use logarithmic frequency scale?

Logarithmic scaling compresses wide frequency ranges into readable plots and converts multiplication into addition. System transfer functions composed of simple poles and zeros become straight-line asymptotes on log-log axes, making hand sketching and design intuition possible.

Sources

Embed

<iframe src="https://homo-deus.com/lab/control-systems/bode-plot/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub