Settling Time: What is it? (Formula And How To Find it in MATLAB)

💡
Key learnings:
  • Settling Time Definition: Settling time is defined as the period needed for the output of a dynamic system to remain within a certain tolerance level of its final value.
  • Settling Time Formula: The formula for settling time is determined by taking the negative natural logarithm of the product of the tolerance fraction and the square root of one minus the square of the damping ratio, divided by the product of the damping ratio and the natural frequency. This explains how quickly the system’s output stabilizes within a specific error margin, based on the system’s damping and oscillation characteristics.
  • MATLAB Techniques: Settling time can be accurately determined in MATLAB using functions like ‘stepinfo’ which analyze the step response of control systems.
  • Control Strategies: Reducing settling time involves adjusting the gains of PID controllers, affecting the system’s response time and stability.
  • Root Locus Application: The root locus method helps visualize and calculate the effects of changing system parameters on settling time, useful for system design and analysis.

What is Settling Time?

Settling time Ts is the first time after which the step response stays inside a stated error band around the final value, and remains there.

That interval includes delay, rise, any overshoot and the ring-down until the band is never left again. Overload recovery of an amplifier is a related but separate spec (how a clamped output returns).

Control texts usually quote a 2% or 5% band of the final value. MATLAB stepinfo defaults to 2%.

A second-order system step response with that band marked is below.

settling time
Settling Time

Settling Time Formula

For an underdamped second-order plant it depends on damping ζ and natural frequency ωn. A compact envelope form is Ts ≈ −ln(δ)/(ζ ωn) for band δ. The stored line omits the minus sign and the √(1−ζ²) factor derived next.

    \[ T_S = \frac{ln(tolerance \, fraction)}{damping \, ratio \times Natural \, frequency} \]

The underdamped unit-step response (0<ζ<1) is

    \[ C(t) = 1 - \left( \frac{e^{-\zeta \omega_n t}}{\sqrt{1-\zeta^2}} \right) sin(\omega_d t + \theta) \]

That splits into an exponential envelope and a sinusoid:

 

    \[ exponential \, component = \left( \frac{e^{-\zeta \omega_n t}}{\sqrt{1-\zeta^2}} \right) \]

    \[ sinusoidal \, component = sin(\omega_d t + \theta) \]

Settling is judged from the envelope, not by cancelling the sine. Set the envelope (tolerance fraction) equal to the exponential factor when you want a closed form. The sine still oscillates inside that envelope.

    \[ Tolerance \, fraction = \frac{e^{-\zeta \omega_n t}}{\sqrt{1-\zeta^2}} \]

    \[ t = T_S \]

    \[ Tolerance \, fraction \times \sqrt{1-\zeta^2} = e^{-\zeta \omega_n T_S} \]

    \[ ln \left( Tolerance \, fraction \times \sqrt{1-\zeta^2} \right) = -\zeta \omega_n T_S \]

    \[ T_S = - \frac{ ln \left( Tolerance \, fraction \times \sqrt{1-\zeta^2} \right)}{\zeta \omega_n} \]

How to Calculate Settling Time

A first order system with unit-step input:

    \[ \frac{C(s)}{R(s)} = \frac{\frac{1}{T}}{s+\frac{1}{T}}} \]

Unit step:

    \[ R(s) = \frac{1}{s} \]

So

    \[ C(s) = \frac{\frac{1}{T}}{s(s+\frac{1}{T})}} \]

    \[ C(s) = \frac{A_1}{s} + \frac{A_2}{s+\frac{1}{T}} \]

Partial fractions: find A1 and A2.

    \[ \frac{\frac{1}{T}}{s(s+\frac{1}{T})}} = \frac{A_1(s+\frac{1}{T}) + A_2s}{s(s+\frac{1}{T})} \]

    \[ \frac{1}{T} = A_1 (s+\frac{1}{T}) + A_2 s \]

Set s = 0:

    \[ \frac{1}{T} = A_1( 0 + \frac{1}{T}) + A_2 (0) \]

    \[ \frac{1}{T} = A_1 \frac{1}{T} \]

    \[ A_1 = 1 \]

Set s = −1/T:

    \[ \frac{1}{T} = A_1 (0) + A_2 (\frac{-1}{T}) \]

    \[ \frac{1}{T} = -A_2 \frac{1}{T} \]

    \[ A_2 = -1 \]

    \[C(s) = \frac{1}{s} - \frac{1}{s+\frac{1}{T}} \]

    \[ C(t) = L^{-1} C(s) \]

    \[ C(t) = 1 - e^{\frac{-t}{T}} \]

    \[ e^{\frac{-t}{T}} = 1 - C(t) \]

For a 2% band, 1−C(t) = 0.02:

    \[ e^{\frac{-t_s}{T}} = 0.02 \]

    \[ \frac{-t_s}{T} = ln(0.02) \]

    \[ \frac{-t_s}{T} = -3.9 \]

    \[ t_s = 3.9T \]

    \[ t_s \approx 4T \]

So a first-order lag with time constant T has Ts ≈ 4T for 2% (ln(0.02) ≈ −3.91). That is an envelope/error formula, not a MATLAB measurement.

For the underdamped second-order step,

    \[ C(t) = 1 - \frac{e^{- \zeta \omega_n t}}{\sqrt{1-\zeta^2}} sin(\omega_d t+\phi) \]

The exponential sets how fast the envelope decays.

    \[ C(t) = 1 - \frac{e^{- \zeta \omega_n t}}{\sqrt{1-\zeta^2}} \]

    \[ \frac{e^{- \zeta \omega_n t}}{\sqrt{1-\zeta^2}} = 1 - C(t) \]

Again take 2%, so 1 − C(t) = 0.02:

    \[ \frac{e^{- \zeta \omega_n t}}{\sqrt{1-\zeta^2}} = 0.02 \]

Damping ξ is set by the plant (and any controller). Underdamped means 0<ξ<1.

For moderate damping, √(1−ζ²) is not far from 1, so textbooks drop it and use e^{−ζωn Ts} ≈ 0.02.

    \[ e^{- \zeta \omega_n t_s} = 0.02 \]

    \[ - \zeta \omega_n t_s = ln(0.02) \]

    \[ - \zeta \omega_n t_s = -3.9 \]

    \[ t_s = \frac{3.9}{\zeta \omega_n} \]

    \[ t_s \approx \frac{4}{\zeta \omega_n} \]

Ts ≈ 4/(ζ ωn) is that 2% underdamped approximation. It does not apply to ζ ≥ 1 or to a 5% band.

For 5%, 1 − C(t) = 0.05 and ln(0.05) ≈ −3.00, so

    \[ e^(- \zeta \omega_n t_s) = 0.05 \]

    \[ - \zeta \omega_n t_s = ln(0.05) \]

    \[ - \zeta \omega_n t_s = -3 \]

    \[ t_s \approx \frac{3}{\zeta \omega_n} \]

To use those formulas you need ζ and ωn (or the real part σ = ζ ωn of the dominant poles).

Second-order SystemDamping Ratio (ξ)Setting Time (TS)
Underdamped0<ξ<1

    \[ T_S = \frac{4}{\zeta \omega_n }\]

Undampedξ = 0

    \[ T_S = \infty \]

Critical dampedξ = 1

    \[ T_S = \frac{6}{\omega_n} \]

Overdampξ > 1Depends on dominant pole

Root Locus Settling Time

On a root locus method plot, a constant-ζ ray and a constant-σ vertical give ωn and ζ of a chosen closed-loop pole, hence an approximate Ts.

Read σ from the real part: Ts ≈ 4/|σ| for the 2% rule on a dominant pair.

Example:

    \[ G(s) = \frac{K}{(s+1)(s+2)(s+3)} \]

Design overshoot 20% (Mp = 0.2) for a dominant second-order pair.

    \[ damping \, ratio \, \zeta = \frac{-ln(\%OS/100)}{\sqrt{\pi^2 + ln^2(\%OS/100)}} \]

    \[ \zeta = \frac{-ln(0.2)}{ \sqrt{\pi^2 + ln^2(0.2)}} \]

    \[ \zeta = \frac{1.609}{ \sqrt{\pi^2 + 2.59}} \]

    \[ \zeta = \frac{1.609}{3.529} \]

    \[ \zeta = 0.4559 \]

From the locus (or sisotool) take the dominant pair

    \[ P = -0.866 \pm j 1.691  = \sigma \pm j \omega_d \]

    \[ \omega_d = 1.691 \]

    \[ \omega_d = \omega_n \sqrt{1-\zeta^2} \]

    \[ 1.691 = \omega_n \sqrt{1-0.207} \]

    \[ \omega_n = \frac{1.691}{\sqrt{0.793}} \]

    \[ \omega_n = \frac{1.691}{0.890} \]

    \[ \omega_n = 1.9 \, rad/sec \]

With ξ and ωn (the stored Ts line writes ωm; use ωn):

    \[ settling \, time \, t_s = \frac{4}{\zeta \omega_m} \]

    \[ t_s = \frac{4}{0.455 \times 1.9} \]

    \[ t_s = 4.62 sec \]

MATLAB Control System Designer (sisotool) can draw that locus and a 20% overshoot constraint so you can pick the same dominant poles.

A MATLAB root-locus figure is below.

root locus example
Root Locus Example

stepinfo on a step response is the usual MATLAB measurement. A unit-step plot is below.

settling time in matlab
Settling Time in MATLAB

How to Reduce Settling Time

Faster settling is often wanted. It trades with overshoot, actuator effort and noise. There is no universal “must be minimum” number.

A controller is one way to move the closed-loop poles (hence Ts).

PID is a standard controller family for this job. Tune it to the plant and the specs.

Gains KP, KI, KD are tuned to the plant. The next lines are textbook trends for many simple loops, not a guarantee for every process.

Raising KP often changes Ts only a little on a simple second-order plant. Raising KI often lengthens settling. Raising KD often shortens it, until noise and actuator limits appear.

So Kd is the term people raise when they want a shorter Ts, watching rise time, overshoot and steady-state error at the same time. (Stored table header says “Setting Time”.)

How to Find Settling Time in MATLAB

MATLAB: form a tf, call step to plot and use stepinfo to read SettlingTime. Example plant:

    \[ G(s) = \frac{25}{s^2 + 6s + 25} \]

Match this transfer function to the standard second-order form

    \[ G(s) = \frac{\omega_n^2}{s^2 + 2 \zeta \omega_n s + \omega_n^2} \]

Then

    \[ 2 \zeta \omega_n = 6 \]

    \[ \zeta \omega_n = 3 \]

    \[ settling \, time \, (t_s) = \frac{4}{\zeta \omega_n} \]

    \[ t_s = \frac{4}{3} \]

    \[ t_s = 1.33 sec \]

4/(ζωn) = 4/3 ≈ 1.33 s is the 2% envelope rule. stepinfo on the stored code returns 1.1886 s for this plant, which is the measured last entry into the 2% band. The loop listing is a sketch; use stepinfo for the number.

The listing below uses step and stepinfo:

clc; clear all; close all;
 
num = [0 0 25];
den = [1 6 25];

t = 0:0.005:5;
 
sys = tf(num,den);
F = step(sys,t);
H = stepinfo(F,t)

step(sys,t);
Output:

H = 

RiseTime: 0.3708
SettlingTime: 1.1886
SettlingMin: 0.9071
SettlingMax: 1.0948
Overshoot: 9.4780
Undershoot: 0
Peak: 1.0948
PeakTime: 0.7850

The step plot is below.

settling time calculation in matlab
Settling time calculation in MATLAB

stepinfo uses 2% unless you set SettlingTimeThreshold. On a figure you can also right-click > properties > options > “show settling time within ___ %”.

property editor matlab
Property Editor MATLAB

A loop over samples in 0.98 to 1.02 is shown next. Walk the definition from the last sample; the stored while-condition is easy to get off-by-one. Prefer stepinfo.

clc; clear all; close all;
 
num = [0 0 25];
den = [1 6 25];
 
t = 0:0.005:5;
 
[y,x,t] = step(num,den,t);

S = 1001;
while y(S)>0.98 & y(S)<1.02;
    S=S-1;
end
settling_time = (S-1)*0.005
Output: 

settling_time = 1.1886
Want To Learn Faster? 🎓
Get electrical articles delivered to your inbox every week.
No credit card required—it’s 100% free.

About Electrical4U

Electrical4U is dedicated to the teaching and sharing of all things related to electrical and electronics engineering.