A technician raises the gain on a pump controller because the pressure is slow to recover. For a moment the loop is faster. Then the pressure begins to swing, the drive speeds up and slows down every two seconds, the pipes knock, and somebody switches the loop to manual. Nothing in the equipment failed: the loop was pushed past its stability limit. This lesson shows how to find that limit on paper, as a gain and a period of oscillation, before the machine finds it for you. #Stability #RouthTest #UltimateGain
Learning Objectives
By the end of this lesson, you will be able to:
Explain what an unstable loop does on a real machine, and read stability from the position of the closed-loop poles
Write the characteristic equation of a feedback loop from its loop transfer function
Apply the Routh array to third-order and fourth-order characteristic equations to find the stable range of controller gain
Calculate the ultimate gain and the ultimate period of a loop
Estimate the effect of dead time with the first-order Padé approximation, and state how far to trust it
Real-World System Problem: A Booster Pump That Hunts
A booster pump with a variable speed drive holds the pressure in a water line. A pressure transmitter on the discharge measures the pressure , the controller in the drive compares it with the setpoint , and the drive changes the pump speed . With a low controller gain the pressure recovers slowly after a tap opens. With a higher gain it recovers faster. With a gain that is too high the pressure never rests: it swings above and below the setpoint, and the drive swings with it. Technicians call this hunting.
The pressure loop of the booster pump
Hunting costs money in ways that are easy to miss: the drive and the motor heat up from the constant change of speed, pressure swings load the pipe joints and the seals, and users at the far end of the line see the flow rise and fall. Most plants then put the loop in manual, and nobody controls the pressure at all.
This lesson answers two questions for a given process: how high can the controller gain go before the loop oscillates without end, and how fast is that oscillation? The answers are the ultimate gain and the ultimate period, and the tuning rules later in this course are built on them.
Fundamental Theory: Stability of a Feedback Loop
What stable and unstable mean
A loop is stable when a limited input gives a limited output. Change the setpoint by a small step, or let a small disturbance enter, and the output of a stable loop moves and then comes to rest. In an unstable loop the same small event produces a response that grows. A ball in a bowl settles after a push; a ball on top of a hill runs away.
On a real machine nothing grows without end, because every final element has limits: a drive stays between 0 and 100 percent speed, and a valve cannot open more than fully. So an unstable loop on real equipment ends in one of two states:
The output goes to one limit and stays there (runaway). This is what happens when the controller action is set the wrong way round.
The output swings between its limits, or between two levels set by some other nonlinear effect (hunting). The size of the swing is set by the limits, not by the linear model.
Poles decide the shape of the response
The closed-loop transfer function from setpoint to output is
where is the process, is the controller and is the loop transfer function. The poles of are the values of that make its denominator zero. Each pole adds a term of the form to the response, where is a constant and is time. Write a pole as , with real part and imaginary part . Then its term behaves as multiplied by a sine wave of frequency in radians per second.
Pole position
Response term
Real and negative ( below zero, )
Decays smoothly, with time constant
Complex pair with negative real part
Oscillation that decays
Pair on the imaginary axis ()
Oscillation of constant size, period
Complex pair with positive real part
Oscillation that grows
Real and positive
Grows smoothly without oscillation
The s-plane: where the poles are decides the response
The stability rule
A linear loop is stable if, and only if, every closed-loop pole has a negative real part. One pole in the right half of the s-plane is enough to make the loop unstable. A pair exactly on the imaginary axis is the limit of stability.
The characteristic equation
The poles of the closed loop are the roots of
This is the characteristic equation. When is a ratio of polynomials, multiply through by its denominator and the characteristic equation becomes a polynomial in set to zero. The controller gain appears in the coefficients, so the poles move as the gain changes. That is the whole reason a change of gain can turn a stable loop into an unstable one.
A common mistake is to look at the poles of the process and call the loop stable because they are all negative. A process with only stable poles can make an unstable loop. Stability of the loop is decided by the roots of , never by the poles of alone.
For a first-order or second-order characteristic equation the test is simple: the loop is stable when all coefficients have the same sign. For third order and above that condition is still necessary, but it is not enough. This is where the Routh array is needed.
The Routh array
The Routh test tells you how many roots of a polynomial are in the right half-plane without solving for the roots. Write the characteristic polynomial with its highest power first. For fourth order:
Fill the first two rows with the coefficients, taking every second one. Compute each later row from the two rows above it.
Each new entry follows one pattern: take the first column entry of the row above, multiply it by the entry one place to the right in the row two above, subtract the cross product, and divide by the first column entry of the row above.
The Routh criterion
All roots have negative real parts if, and only if, every entry in the first column of the Routh array has the same sign and none is zero. The number of sign changes down the first column equals the number of roots in the right half-plane.
For third order, , the array has four rows and the result is short enough to remember. With all coefficients positive, the loop is stable when
In words: the product of the two inner coefficients must be larger than the product of the two outer coefficients.
Special cases, briefly
Two special cases appear in practice.
A zero in the first column while the rest of its row is not zero. Replace the zero by a small positive number , complete the array, and then examine the signs as goes to zero.
A whole row of zeros. This means the polynomial has roots placed symmetrically about the origin, most often a pair on the imaginary axis. Form the auxiliary polynomial from the row just above the zero row. Its roots are those symmetric roots.
The second case is the useful one. When you set the gain exactly at the stability limit, the row becomes zero, and the row gives the frequency of the oscillation directly.
Ultimate gain and ultimate period
With a proportional controller, , raise the gain slowly from a small value. At one value of the gain a pair of poles reaches the imaginary axis and the loop oscillates with constant size. That gain is the ultimate gain . The period of that oscillation is the ultimate period
where is the frequency at the limit in radians per second.
There is a second way to see the same limit. On the imaginary axis , and the characteristic equation says . A complex number equal to has size 1 and phase angle degrees. So at the limit:
the total phase lag around the loop is 180 degrees (this fixes ), and
the loop gain at that frequency is exactly 1 (this fixes ).
This is the phase condition. It explains hunting in physical terms. A sine wave that travels once around the loop and comes back delayed by half a period is inverted. The negative feedback inverts it again. It returns in step with itself, and if the loop gain is 1 or more it keeps itself alive.
Why integral action narrows the stable range
A controller with integral action adds a pole at the origin, so a third-order process gives a fourth-order characteristic equation. Take the three-lag process used in Application 1, with process gain 1, and a controller with integral time . The characteristic equation becomes
The Routh entries are and . The condition reduces to
With proportional control alone the same process is stable up to , as Application 1 shows. Fast integral action has cut the usable gain by a factor of more than five. Integral action always costs some stability, and the next lesson returns to this trade.
Why dead time destabilises a loop
Dead time delays the signal without changing its size. Its transfer function is . At frequency it adds a phase lag of radians, and that lag grows without limit as the frequency rises. A first-order lag can add at most 90 degrees. Dead time can add any amount. So a loop with dead time always reaches 180 degrees of lag at some frequency, and always has a finite ultimate gain.
Half a period of delay turns correction into push
The term is not a polynomial, so the Routh array cannot use it directly. The first-order Padé approximation replaces it with a ratio of polynomials:
The approximation has gain 1 at every frequency, as true dead time has. Its phase lag is , which is close to the true lag only while is small.
For a first-order process with dead time, with process gain and time constant , the exact phase condition is
It has no closed-form solution, but a numerical solver finds in a few steps. The ultimate gain then follows from the size condition: .
Application 1: Stable Gain Range of a Three-Lag Process
Many thermal and mixing processes behave as several lags in series: a heater element, the fluid, and the sensor in its pocket each add one. No single lag can make a loop unstable, and neither can two. Three can.
Step 1: Write the characteristic equation
Click to reveal the characteristic equation
Start from with and :
Multiply through by the denominator. ✅
Expand the first two factors: . ✅
Multiply by the third factor:
This is the denominator of the process. ✅
The characteristic equation is
The gain appears only in the last coefficient. ✅
Step 2: Build the Routh array
Click to reveal the Routh array and the stable range
Fill the first two rows from the coefficients , , , :
The array has four rows for a third-order polynomial. ✅
Compute the entry:
This entry is the one that changes sign as the gain rises. ✅
Require : , so . ✅
Require the entry to be positive: , so . ✅
The loop is stable for
The ultimate gain is . ✅
Step 3: Find the frequency at the limit
Click to reveal the limit frequency
Set . The row becomes zero, which is the special case of a whole row of zeros. ✅
Form the auxiliary polynomial from the row:
Its roots are the poles on the imaginary axis. ✅
Solve: , so . The limit frequency is . ✅
The ultimate period is
At the limit the output swings once every 7 seconds. ✅
Step 4: Check by the roots and by the phase condition
Click to reveal the two checks
Roots. At the polynomial factors exactly:
The poles are and . The pair on the axis agrees with Step 3. ✅
Roots on each side of the limit. A numerical root finder gives, for the pole pair nearest the axis: at , (stable); at , (unstable). The real part changes sign between them, at 12.6. ✅
Phase condition. The three lags must add to 180 degrees. At :
The frequency from the Routh array satisfies the phase condition. ✅
Size condition. The process gain at that frequency is
The loop gain is 1 when . Three methods give the same limit. ✅
Application 2: Ultimate Gain of the Booster Pump With Dead Time
The booster pump has dead time, so the Routh array needs the Padé approximation. This application measures how much error that approximation brings.
Step 1: Estimate with the Padé approximation
Click to reveal the Padé estimate
Replace the dead time, with :
The loop is now a ratio of polynomials. ✅
Write and multiply through:
Expand the product: . ✅
Collect the powers of :
This is second order, so the loop is stable when all three coefficients are positive. ✅
The middle coefficient becomes zero at , so . ✅
At that gain the equation is , so and
This is the Padé estimate of the ultimate period. ✅
Step 2: Solve the exact phase condition
Click to reveal the exact values
The exact condition for 180 degrees of lag is
The first term is the dead time and the second is the lag. ✅
Solve numerically (bisection, or brentq in the script below). The root is . ✅
Check the two parts: the lag gives and the dead time gives . The sum is . ✅
Process gain at this frequency:
The loop gain is 1 when , so . ✅
The exact ultimate period is . ✅
Step 3: Compare the two results
Click to reveal the comparison
Put the values side by side:
Quantity
Padé estimate
Exact
Difference
(percent per bar)
130
100.7
+29.1 percent
(rad/s)
4.32
3.34
+29.3 percent
(s)
1.45
1.88
percent
The Padé estimate is too high in gain and too short in period. ✅
Find the cause. At the true limit, , well above 1 radian. True dead time gives of lag there. The Padé term gives only . ✅
With 16 degrees less lag in the model, the model loop reaches 180 degrees at a higher frequency, where the process gain is lower, so it accepts more controller gain. The error is always on the unsafe side. ✅
Verify It in Python
The script repeats both applications. For the three-lag process it finds the limit three ways. For the booster pump it compares the Padé estimate with the exact solution. It also plots the closed-loop step response of the three-lag loop below, at and above the limit.
stability_routh_check.py
import numpy as np
from scipy.optimize import brentq
from scipy import signal
import matplotlib.pyplot as plt
# ---------- Application 1: three-lag process, K = 1 ----------
K =1.0
den = np.polymul(np.polymul([1, 1],[2, 1]),[5, 1]) # 10s^3+17s^2+8s+1
a3, a2, a1, a0 = den
# Way 1: Routh. Row s^1 is (a2*a1 - a3*(a0 + K*Kc))/a2 > 0
Kc_limit = (a2 * a1 / a3 - a0) / K
w_routh = np.sqrt((a0 + K * Kc_limit) / a2) # from the s^2 row
print("Application 1: three-lag process")
print(f" Routh: stable for -1 < Kc < {Kc_limit:.2f}")
print(f" Routh: limit frequency = {w_routh:.4f} rad/s, "
f"period = {2*np.pi/w_routh:.2f} s")
# Way 2: roots of the characteristic polynomial
for Kc in (6.0, 12.6, 16.0):
roots = np.roots([a3, a2, a1, a0 + K * Kc])
worst = roots[np.argmax(roots.real)]
print(f" Kc = {Kc:5.1f}: largest real part = {worst.real:+.4f}, "
f"imaginary part = {abs(worst.imag):.4f}")
# Way 3: phase condition, total lag = 180 degrees
lag =lambdaw: np.arctan(w) + np.arctan(2*w) + np.arctan(5*w) - np.pi
w_ph =brentq(lag,0.1,5.0)
gain = K / np.sqrt((1+ w_ph**2) * (1+4*w_ph**2) * (1+25*w_ph**2))
print(f" Phase: w = {w_ph:.4f} rad/s, |G| = {gain:.5f}, "
f"Ku = {1/gain:.2f}")
# ---------- Application 2: booster pump, P control ----------
ax.set_ylabel("Output y for a unit setpoint step")
ax.set_title("Three-lag process under proportional control")
ax.grid(True,alpha=0.3)
ax.legend()
fig.tight_layout()
fig.savefig("stability_three_lag.png",dpi=120)
print("Saved stability_three_lag.png")
Expected output
Application 1: three-lag process
Routh: stable for -1 < Kc < 12.60
Routh: limit frequency = 0.8944 rad/s, period = 7.02 s
Kc = 6.0: largest real part = -0.1105, imaginary part = 0.6790
Kc = 12.6: largest real part = +0.0000, imaginary part = 0.8944
Kc = 16.0: largest real part = +0.0426, imaginary part = 0.9749
Phase: w = 0.8944 rad/s, |G| = 0.07937, Ku = 12.60
Application 2: booster pump
Pade : Ku = 130.0 %/bar, w = 4.320 rad/s, Pu = 1.454 s
Exact: Ku = 100.7 %/bar, w = 3.341 rad/s, Pu = 1.881 s
Pade error: Ku +29.1 %, Pu -22.7 %
Saved stability_three_lag.png
Common Mistakes
Judging the loop by the poles of the process. A process with only stable poles can still give an unstable closed loop. Test the roots of .
Stopping at “all coefficients are positive”. That is enough only up to second order. From third order upward, complete the Routh array.
Forgetting the gain in the constant term. With the characteristic polynomial is , and the product is what the limit applies to. A process gain that doubles halves the allowed controller gain.
Trusting the Padé approximation at the stability limit. It gives too little phase lag there and an ultimate gain that is too high. Solve the phase condition exactly for a final value.
Treating the ultimate gain as a setting. It is the edge of instability. Working gains are a fraction of it.
Mixing radians per second and hertz. The Routh array and the phase condition give in radians per second. The period is , not .
Summary
A loop is stable when every root of the characteristic equation has a negative real part.
The Routh array tests this without solving for the roots. For third order the condition is that the product of the inner coefficients exceeds the product of the outer ones.
At the stability limit a row of the array becomes zero, and the row above gives the oscillation frequency.
The ultimate gain and the ultimate period describe that limit. For the three-lag process they are 12.6 and 7.02 s. For the booster pump they are 100.7 percent per bar and 1.88 s.
Dead time adds phase lag without limit, so it always sets a finite ultimate gain. The first-order Padé approximation overestimated that gain by 29 percent for the pump.
Exercises
1. A closed loop has poles at , and . Is it stable? Describe the response and give the period of its oscillation.
Answer
Stable, because all real parts are negative. The pair gives a decaying oscillation at , period , inside an envelope with time constant 2 s. The pole at adds a smooth term that decays in about 2 s.
2. A process is under proportional control with gain . Find the ultimate gain and the ultimate period.
Answer
The characteristic equation is . Stability needs , so . The auxiliary polynomial gives and .
3. The conveyor position loop has in radians per volt. A filter on the position signal adds a lag . With a proportional gain in volts per radian, find the largest stable and the frequency at the limit.
Answer
The characteristic equation is . Stability needs , so . The auxiliary polynomial gives (period 1.40 s). Without the filter the second-order model is stable for every positive gain, so the filter created the limit.
4. The hot water tank has , and . Under proportional control, estimate and with the first-order Padé approximation. Then solve numerically and give the percentage error of the estimate.
Answer
Padé: , so percent per °C, and . Exact: , percent per °C, . The Padé gain is 28.8 percent too high and the period 22.4 percent too short.
5. The three-lag process of Application 1 (with ) is controlled by with . Find the stable range of and the frequency at the limit.
Answer
The characteristic equation is . The Routh entries are and , and reduces to , so . At the limit and the auxiliary polynomial gives . Slower integral action than the 2 s of the theory section leaves more of the stable range.
References
K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, 2nd edition, Princeton University Press, 2021.
K. Ogata, Modern Control Engineering, 5th edition, Prentice Hall, 2010.
N. S. Nise, Control Systems Engineering, 7th edition, Wiley, 2015.
D. E. Seborg, T. F. Edgar, D. A. Mellichamp and F. J. Doyle, Process Dynamics and Control, 4th edition, Wiley, 2016.
Predict first
A process is three simple lags in series. Each lag is stable, and the process alone never overshoots. You close a loop around it with a proportional controller and raise the gain step by step. What happens?
See it: the gain moves the poles across the imaginary axis
Pole pair nearest the axis
Third pole
Gain margin, 12.6 ÷ Kc
Damping ratio of the pair
Period of the ringing now
Period at the limit
The process is the lesson's three lags of 1 s, 2 s and 5 s, with proportional control. The small dots are the path of the three poles as the gain rises from 0 to 20 in equal steps. At zero gain the poles are the poles of the process: −1, −0.5 and −0.2, all stable. As the gain rises, two of them meet, leave the real axis as a pair and move toward the imaginary axis. They cross it at Kc = 12.6, at ±j0.894. The third pole moves left and never causes trouble. The response on the right is simulated for the same gain. A stable response does not end at the setpoint: proportional control leaves an offset, so the output settles at Kc/(1 + Kc).
Check yourself
Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.
1. The three-lag process has poles at −1, −0.5 and −0.2. All three are in the left half of the s-plane. Is the closed loop stable for every proportional gain?
2. The ultimate gain of this loop is 12.6. The controller is set to Kc = 4.2. What is the gain margin?
3. At Kc = 6 the loop is stable and the gain margin is 2.1, above the common target of 2. Is this a good setting?
Watch it build: the Routh array of the three-lag loop
The three-lag process under gain Kc gives a third order characteristic equation.
The first two rows take every second coefficient: 10 and 8, then 17 and 1 + Kc.
The s¹ entry is a cross product of the two rows above, divided by 17.
Every first column entry must be positive: 136 > 10(1 + Kc), so Kc < 12.6.
At Kc = 12.6 the s¹ row is zero. The s² row gives 17s² + 13.6 = 0: 0.894 rad/s, 7.02 s.
The pressure loop of the booster pump
The s-plane: where the poles are decides the response (example)
Half a period of delay turns correction into push
Found this useful?
Discussion
No comments yet. Questions, results from your own build, a better way to explain it: all welcome.
Text size
←→
Previous and next card. On a turned card: Not yet, I knew it
SpaceEnter
Turn the card, show the answer
123
Overview, Recap, Test me
HomeEnd
First and last card
Esc
Close
← → or scroll · N notes · F full screen · B blank0:00
My notes on this page
Kept on this device only. Nothing is sent anywhere.
Tip: select words in the lesson, or tap a figure or an equation, to put a note right there.
Notes on earlier wording
The lesson has changed and these words are no longer in it. Your notes are kept, with the words you chose.