Bode Plot Generator
Magnitude and phase, margins, poles and zeros, the step response and PID tuning.
Try before you buy.
- Free preview: watermarked Bode and step-response charts and the names of each table’s first rows, with the margins and every other figure hidden.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Bode plot
Step response
Poles and zeros
Frequency response
Ziegler–Nichols gains
How it was calculated
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Bode Plot Generator
Type a transfer function the way you write it — 10(s+1)/(s(s+2)(s+10)), 1/(s^2+0.4s+1) — or as coefficient lists, or as poles, zeros and a gain, and add a dead time if the process has one. The generator draws the Bode plot (magnitude in dB and phase against a logarithmic frequency axis, in rad/s or Hz), marks the gain and phase crossovers and gives the gain margin, the phase margin and the delay margin. It lists every pole and zero with its natural frequency and damping ratio, and closes the loop with unity negative feedback to show the closed-loop poles, whether the loop is stable, and the step response with rise time, overshoot, settling time and steady-state error.
Add a PID controller C(s) = Kp + Ki/s + Kd·s/(Tf·s + 1) to see its effect on the open and closed loop, and let the generator suggest Ziegler–Nichols gains from the plant’s ultimate gain and period — taken from the model, or from the values you measured. A second transfer function can be overlaid for comparison, and dead time is simulated exactly as a delay, not approximated.
Without a pass, the free preview works on your own transfer function and shows the Bode and step-response charts at preview size under a watermark, without their numbers, and the names of each table’s first rows; the margins, the poles and zeros, every other figure, the working, Copy result, the CSV and the PNG and SVG charts come with a Pro pass.
How to use it
- Type G(s) — or switch to coefficients, or to poles, zeros and gain — and, if the process has one, the dead time in seconds. The example buttons fill in common systems.
- Choose rad/s or Hz, and a frequency range if you do not want the automatic one.
- Open PID controller and Ziegler–Nichols to add a controller, or use the suggested Ziegler–Nichols gains with one click.
- Read the margins, the poles and the step response. Copy result, the CSV and the chart files need a pass, or unlocking this result.
Examples
G(s) = 1/(s(s+1)(s+2))
phase margin 53.41° at 0.4457 rad/s; gain margin 15.56 dB at 1.414 rad/s; closed loop stable
G(s) = 10/(s(s+1)(s+2))
gain margin −4.437 dB: the closed loop is unstable
G(s) = 1/(s(s+1))
closed loop 1/(s² + s + 1), ζ = 0.5: 16.3% overshoot, peak at 3.628 s
G(s) = 1/(s+1)^3
Ku = 8 at √3 rad/s, Tu = 3.628 s; PID Kp = 4.8, Ti = 1.814 s, Td = 0.4534 s
G(s) = 2/(s+1), 0.2 s dead time
crossover at √3 rad/s; phase margin 120° − 19.85° = 100.2°
Reading a Bode plot
The magnitude |G(jω)| in dB and the phase ∠G(jω) in degrees, both against log frequency. Each pole bends the magnitude down by 20 dB per decade and turns the phase by up to −90° (a zero does the opposite); an integrator is a straight −20 dB/decade line at −90°, and a complex pair with damping ratio ζ peaks near its natural frequency when ζ is small. The phase is unwrapped from the poles and zeros, so it can run past −180° without jumping, and a dead time T adds −ωT radians of phase without changing the magnitude.
Gain margin, phase margin and stability
With unity negative feedback around L(s), the loop becomes unstable when L(jω) reaches −1. The phase margin is 180° + ∠L at the gain crossover ωc, where |L| = 1 (0 dB): how much more phase lag the loop can take. The gain margin is −20·log|L| at the phase crossover ω180, where the phase is −180°: how much more gain it can take. The delay margin PM ÷ ωc is the extra dead time it tolerates. When the open loop is itself unstable the margins can mislead, so the generator also finds the closed-loop poles — the roots of D(s) + N(s) — and calls the loop stable only when every one is in the left half-plane.
Step response
The closed loop T = L ÷ (1 + L) is turned into state-space form and stepped exactly with a zero-order hold (the matrix exponential), so the samples have no integration error. With a dead time the loop is simulated with the delay as a delay line. The generator reports the final value, the 10–90% rise time, the overshoot and peak time, the 2% settling time and the steady-state error for a unit step: zero for a loop with an integrator, 1 ÷ (1 + K) for a type-0 loop with DC gain K.
PID and Ziegler–Nichols tuning
The controller is the parallel PID C(s) = Kp + Ki/s + Kd·s ÷ (Tf·s + 1); the derivative filter Tf defaults to Kd ÷ (10·Kp). Ziegler and Nichols’ ultimate-gain method starts from Ku, the proportional gain that makes the loop oscillate steadily, and Tu, the period of that oscillation; for a model, Ku = 1 ÷ |G(jω180)| and Tu = 2π ÷ ω180. Their table gives P: Kp = 0.5·Ku; PI: Kp = 0.45·Ku, Ti = Tu ÷ 1.2; PID: Kp = 0.6·Ku, Ti = Tu ÷ 2, Td = Tu ÷ 8, with Ki = Kp ÷ Ti and Kd = Kp·Td. The rules aim for a quarter-amplitude decay, so they overshoot: a starting point to refine.
Sources
Limitations
- Linear, time-invariant systems only, with real coefficients: saturation, rate limits, backlash and sampling (discrete-time controllers) are not modelled.
- The feedback is unity and negative; put a sensor or a feedback path into G(s) itself.
- Polynomials up to degree 40 are accepted, but roots of very high-order or badly scaled polynomials lose accuracy; factored forms such as (s+1)^3 are read exactly, but their repeated roots are found numerically.
- With a dead time the closed-loop poles cannot be listed (there are infinitely many); stability is judged from the simulated step response.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, Bode Plot Generator shows watermarked Bode and step-response charts and the names of each table’s first rows, with the margins and every other figure hidden. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
How do I enter a transfer function?
Type it as you would write it, with s, brackets and powers: 10(s+1)/(s(s+2)(s+10)), 1/(s^2+0.4s+1) or 5/(0.1s+1). Multiplication can be left out (2s, s(s+1)). Or switch to coefficient lists from the highest power down (1 3 2 is s² + 3s + 2), or to poles, zeros and a gain (pairs as -1±2j).
How are the gain and phase margins found?
The phase margin is 180° plus the phase where the loop gain crosses 0 dB; the gain margin is how far below 0 dB the gain is where the phase crosses −180°. For 1/(s(s+1)(s+2)) the gain crosses 0 dB at 0.4457 rad/s with a phase of −126.6°, so PM = 53.41°; the phase reaches −180° at √2 rad/s where the gain is 1/6, so GM = 20·log 6 = 15.56 dB.
Why does a dead time matter so much?
Because it adds phase lag ωT that grows without limit as frequency rises, while leaving the magnitude alone. At the gain crossover it eats directly into the phase margin: 0.2 s at 1.732 rad/s costs 19.85°. The delay margin PM ÷ ωc tells you how much dead time the loop can take before it oscillates.
What are the Ziegler–Nichols PID settings?
From the ultimate gain Ku and period Tu: Kp = 0.6·Ku, Ti = Tu/2 and Td = Tu/8 for a PID (0.45·Ku and Tu/1.2 for a PI, 0.5·Ku for P alone). For 1/(s+1)³, Ku = 8 and Tu = 3.628 s, so Kp = 4.8, Ti = 1.814 s and Td = 0.4534 s.
What is the difference between the open-loop and closed-loop curves?
The Bode plot of L(s) (open loop) is what the margins are read from; the closed loop T = L ÷ (1 + L) is what the system actually does with feedback: about 0 dB at low frequency when the loop gain is high, then rolling off near the crossover. Its −3 dB point is roughly the loop’s bandwidth.