Skip to content
ELECTRONICS ENGINEERINGelectronics-engineering.com
Author's pick MATLAB Process Control

Setting up controllers in multivariable systems: relay, Niederlinski, sequential method and BLT

Tuning decentralised PIDs on the Wood and Berry column: RGA and Niederlinski index with proof, relay test and describing function, Ziegler-Nichols turning unstable, sequential method, Luyben's BLT, detuning, verified Python code.

https://www.electronics-engineering.com/en/multivariable-pid-tuning-relay-niederlinski-sequential-blt/

Was this page useful? Rate it:
average 5.0 from 1 rating

In process plants (distillation columns, reactors, boilers) most systems have several inputs and several outputs, yet they are almost always controlled with separate PIDs, one per loop: this is decentralised control. It is simple, every operator understands what each controller does and, if one loop goes to manual, the others keep working. The price is that the loops disturb each other: a PID tuned well on its own can make the plant unstable when the other loops are closed too. This in-depth study shows how PIDs are set up (tuned) in this case: identification with the relay, checking interaction with the RGA and the Niederlinski index, the sequential method, the BLT method with the reasoning behind its criterion, and the detuning methods, all on the classic Wood and Berry column example, with Python code that reproduces the numbers. The linked lesson explains interaction, RGA and decoupling.

The subject was studied in the degree thesis of Eliana Li Santi at the University of Pisa (supervisors Aldo Balestrino and Alberto Landi, 2004), which compares the methods in simulation: the chapters are at the bottom of the page.

The example: the Wood and Berry column

It is the most used test process in the literature on multivariable control: a methanol-water distillation column in which the distillate purity y_1 and the bottoms purity y_2 are controlled by acting on the reflux flow u_1 and the reboiler steam u_2. The identified model (times in minutes) is

    \[ G(s) = \begin{pmatrix} \dfrac{12.8\,e^{-s}}{16.7s + 1} & \dfrac{-18.9\,e^{-3s}}{21s + 1} \\ \dfrac{6.6\,e^{-7s}}{10.9s + 1} & \dfrac{-19.4\,e^{-3s}}{14.4s + 1} \end{pmatrix} \]

Each element is a first-order lag with dead time: each input acts on both outputs, with different delays.

Interaction. The relative gain of the pairing u_1 \to y_1, u_2 \to y_2 is

    \[ \lambda_{11} = \frac{1}{1 - \dfrac{K_{12}K_{21}}{K_{11}K_{22}}} = \frac{1}{1 - \dfrac{(-18.9)(6.6)}{(12.8)(-19.4)}} = 2.01 \]

Positive, so the pairing is the right one, but far from 1: closing loop 2 halves the gain that loop 1 sees (\lambda_{11} = \frac{\text{open-loop gain}}{\text{gain with the other loop closed}}). A PID tuned on loop 1 alone will turn out about twice as aggressive as expected if the other loop is closed.

Niederlinski index. For a system with integral action in every loop,

    \[ NI = \frac{\det G(0)}{\prod_i G_{ii}(0)} \]

Theorem (Niederlinski). If NI \lt  0, decentralised control with integral action cannot work safely with that pairing: either the system is unstable with all loops closed, or it becomes unstable when one of the loops is opened (put in manual, or saturated). The controllers have gains of the same sign as their G_{ii}(0), as always in practice.

Proof (slow controllers). Consider very slow pure integral controllers, C_i(s) = \varepsilon k_i/s with small \varepsilon: the most cautious tuning possible. The slow closed-loop poles are near the origin, where G(s) \approx G(0); the characteristic equation becomes \det\big(sI + \varepsilon\,G(0)K\big) = 0, with K = \text{diag}(k_i), so the slow poles are s = -\varepsilon\mu, with \mu the eigenvalues of G(0)K. The product of the eigenvalues is \det(G(0)K) = \det G(0)\prod k_i. Since k_i has the sign of G_{ii}(0), \prod k_i has the sign of \prod G_{ii}(0) and so \det(G(0)K) has the sign of NI. If NI \lt  0 the determinant is negative: a real matrix with negative determinant has an odd number of negative real eigenvalues, hence at least one \mu \lt  0 and a pole s = -\varepsilon\mu \gt  0. The system is unstable even with the slowest tuning. The general result, for any tuning, is due to Grosdidier, Morari and Holt (1985). ∎

For the column NI = \frac{(12.8)(-19.4) - (-18.9)(6.6)}{(12.8)(-19.4)} = 0.498 \gt  0: the pairing is not excluded. For a 2×2 system NI = 1/\lambda_{11} always holds, and indeed here 1/2.01 = 0.498.

Identification with the relay

Tuning a PID with the Ziegler-Nichols rules needs the ultimate gain K_u and the ultimate period P_u. Bringing a plant to the stability limit by raising the gain is dangerous; Åström and Hägglund (1984) proposed replacing the controller with a relay: the controller output switches between +d and -d depending on the sign of the error. The loop settles into a stable oscillation of controlled amplitude (d is chosen), from which K_u and P_u are obtained. It is the basis of the autotuning function found in almost all industrial controllers.

The relay test
The controller is replaced by a relay that outputs plus d or minus d depending on the sign of the error; the loop oscillates and the ultimate gain and period are obtained from the oscillation of the output y.

Theorem (relay describing function). If the output y oscillates almost sinusoidally with amplitude a, then

    \[ K_u \approx \frac{4d}{\pi a},\qquad P_u \approx \text{period of the oscillation} \]

Proof. The relay output is a square wave of amplitude d. Its Fourier series is \frac{4d}{\pi}\left(\sin\omega t + \frac{1}{3}\sin 3\omega t + \dots\right). The process is a low-pass filter: higher harmonics are attenuated and only the first, of amplitude \frac{4d}{\pi}, matters. The relay therefore behaves as an equivalent gain N(a) = \frac{4d}{\pi a} (ratio between the first harmonic of the output and the input amplitude), in phase. An oscillation sustains itself when N(a)G(j\omega) = -1: the phase of G must be -180° and |G(j\omega)| = 1/N(a). But this is exactly the definition of the ultimate frequency and gain: K_u = 1/|G(j\omega_u)| = N(a). ∎

The relay test on loop 1 of the column
The input u, violet, is a square wave of amplitude d = 1 (drawn here at half scale); the output y, blue, oscillates with amplitude a, red line, and with a period of about 3.9 minutes.

How accurate is it? Simulating the test on the two loops of the column (code below) and comparing with the exact calculation from the frequency response:

exact K_urelay K_uexact P_urelay P_u
loop 12.0991.7093.91 min3.89 min
loop 20.4220.34911.13 min10.97 min

The period is almost exact; the gain is underestimated by 17-19 %, because with a delay small compared with the time constant the output is more triangular than sinusoidal (as the graph shows) and the first-harmonic assumption is approximate. The error goes in the safe direction: a somewhat less aggressive controller results. Commercial controllers correct the estimate or add hysteresis to the relay to make it robust to noise.

Ziegler-Nichols loop by loop

With the exact K_u and P_u, the Ziegler-Nichols rules for the PI (K_c = K_u/2.2, T_I = P_u/1.2) give

  • loop 1: K_{c1} = 0.954, T_{I1} = 3.26 min;
  • loop 2: K_{c2} = -0.192, T_{I2} = 9.28 min (negative because K_{22} \lt  0).

Each one, on its own, works. But closing both loops makes the system unstable: in simulation the oscillation after the setpoint step does not die out and its amplitude slowly grows (0.248, 0.257, 0.266 in three successive 100-minute intervals). It is the consequence of \lambda_{11} = 2: each loop sees a process different from the one it was tuned on.

The sequential method

The loops are tuned one at a time, closing them in order: first the fastest loop (here loop 1, P_u = 3.9 min), with the relay test and the tuning rules; then, with loop 1 closed, the relay test is run on loop 2, which thus sees the “effective” process including the effect of the other loop. With more loops one continues, and the round can be repeated until the parameters stop changing. Advantage: each relay test accounts for the real interactions of the plant. Drawbacks: the result depends on the order, and the first loop, tuned while the others were open, may need retuning.

The BLT method

Luyben (1986) proposed a simple and widely used method, called BLT (biggest log-modulus tuning):

1. Compute the Ziegler-Nichols settings of each loop, K_{ZN,i} and T_{ZN,i}.

2. Choose a single detuning factor F \gt  1 and set K_{c,i} = K_{ZN,i}/F, T_{I,i} = F\,T_{ZN,i}: all loops become slower in the same proportion.

3. Compute the function

    \[ W(j\omega) = -1 + \det\big(I + G(j\omega)G_c(j\omega)\big),\qquad L_c(\omega) = 20\log_{10}\left|\frac{W}{1 + W}\right| \]

4. Choose F so that the maximum of L_c is 2N dB, with N the number of loops.

Why it works. By the multivariable Nyquist theorem, the closed-loop system is stable if the plot of \det(I + GG_c) does not encircle the origin (with process and controllers stable in open loop). W is defined so that \det(I + GG_c) = 1 + W: the condition becomes “W does not encircle -1“, as in the Nyquist plot of a single loop with loop function W. Then \frac{W}{1 + W} plays the role of the complementary sensitivity function, and its peak (the closed-loop resonance peak) measures how close the plot comes to -1. For a single loop the rule of thumb is a +2 dB peak; for N loops Luyben uses 2N dB because W contains products of N loop functions and grows faster. ∎

For the column, with N = 2 a 4 dB peak is sought:

F122.53
peak of L_c50.1 dB6.5 dB4.2 dB2.6 dB

With F = 1 (uncorrected Ziegler-Nichols) the peak is very high: the plot passes almost through -1, consistent with the oscillation that does not decay. Solving for 4 dB gives F = 2.545 (Luyben rounds it to 2.55), i.e.

  • loop 1: K_{c1} = 0.375, T_{I1} = 8.29 min;
  • loop 2: K_{c2} = -0.075, T_{I2} = 23.6 min,

the same values published by Luyben.

Luyben's log modulus for three detuning factors
With F = 1.6, dashed grey, the peak exceeds 9 dB; with F = 2.55, blue, it exactly touches the 4 dB limit, red line; with F = 4, green, it stays well below and the loops are slower than necessary.
Setpoint step on output 1
With the Ziegler-Nichols settings, grey, output 1 oscillates without decaying; with the BLT settings, blue, it reaches 1 with a 10 % overshoot in about 20 minutes, while output 2, dashed orange, suffers a maximum disturbance of 0.67 that its controller brings back to zero.

In the simulation of the setpoint step on y_1, with the BLT settings y_1 has a 10 % overshoot and y_2 a maximum disturbance of 0.67; the integral of absolute error (IAE, summed over the two outputs in 120 minutes) is 19.7, against 76.3 for Ziegler-Nichols, which would however keep growing because the system is unstable.

Other detuning methods

BLT’s single factor is safe but not optimal: it also slows down the loop that would not need it. Later methods, also compared in the thesis, seek better compromises:

  • detuning with integral criteria: F is chosen by minimising an index such as IAE or ISE computed in simulation on the complete system, instead of with the peak of L_c;
  • detuning with different factors: one factor per loop, F_1, F_2, \dots, chosen with the same criterion; the more coupled loops are slowed down more;
  • iterative detuning: start from F = 1 and increase it in steps on the real plant until the response is acceptable; it needs no model, only tests;
  • conditional integration: this is anti-windup. When a controller output saturates (a valve fully open), the integral stops accumulating; without this precaution, in multivariable systems a saturated loop drags the others into long oscillations.

In industrial practice the typical sequence is: RGA and Niederlinski to choose the pairings, relay test for each loop, BLT for a safe starting tuning, fine-tuning on the plant. If interaction is too strong (\lambda very different from 1) one moves to decouplers or predictive control (MPC), described in the lesson.

The Python code

The program computes RGA and Niederlinski, the exact ultimate gain and period, simulates the relay test and finds the BLT factor:

import numpy as np
from scipy.optimize import brentq

# Wood-Berry column: G_ij = K e^{-theta s} / (tau s + 1), times in minutes
K = np.array([[12.8, -18.9], [6.6, -19.4]])
TAU = np.array([[16.7, 21.0], [10.9, 14.4]])
TH = np.array([[1.0, 3.0], [7.0, 3.0]])

def G(s):
    return K * np.exp(-TH * s) / (TAU * s + 1)

l11 = 1 / (1 - K[0, 1] * K[1, 0] / (K[0, 0] * K[1, 1]))
NI = np.linalg.det(K) / (K[0, 0] * K[1, 1])
print(f"RGA lambda11 = {l11:.3f}, Niederlinski = {NI:.3f}")

# exact ultimate gain and period (phase = -180 degrees) and Ziegler-Nichols rules for the PI
ZN = []
for i in range(2):
    phase = lambda w: -TH[i, i] * w - np.arctan(TAU[i, i] * w) + np.pi
    wu = brentq(phase, 1e-3, 10)
    Ku = np.sqrt(1 + (TAU[i, i] * wu) ** 2) / abs(K[i, i])
    Pu = 2 * np.pi / wu
    ZN.append((np.sign(K[i, i]) * Ku / 2.2, Pu / 1.2))
    print(f"loop {i+1}: Ku = {Ku:.3f}, Pu = {Pu:.2f} min, PI: Kc = {ZN[i][0]:.3f}, TI = {ZN[i][1]:.2f}")

# simulated relay test (d = 1, Euler with 2 ms step, delay as a sample queue)
def relay(i, d=1.0, dt=0.002, T=150):
    n, nd = int(T / dt), int(round(TH[i, i] / dt))
    u_queue, y, ys = np.zeros(n + nd), 0.0, np.zeros(n)
    for k in range(n):
        u_queue[k + nd] = -d * np.sign(K[i, i]) if y > 0 else d * np.sign(K[i, i])
        y += dt * (-y + K[i, i] * u_queue[k]) / TAU[i, i]
        ys[k] = y
    tail = ys[n // 2:]
    a = (tail.max() - tail.min()) / 2
    rises = np.where(np.diff(np.sign(tail)) > 0)[0]
    return 4 * d / (np.pi * a), np.mean(np.diff(rises)) * dt

for i in range(2):
    Ku_r, Pu_r = relay(i)
    print(f"relay loop {i+1}: Ku = {Ku_r:.3f}, Pu = {Pu_r:.2f} min")

# BLT: peak of Luyben's log modulus equal to 2N = 4 dB
def peak_Lc(F):
    peak = -np.inf
    for w in np.logspace(-3, 1, 4000):
        s = 1j * w
        Gc = np.diag([ZN[j][0] / F * (1 + 1 / (F * ZN[j][1] * s)) for j in range(2)])
        W = -1 + np.linalg.det(np.eye(2) + G(s) @ Gc)
        peak = max(peak, 20 * np.log10(abs(W / (1 + W))))
    return peak

F = brentq(lambda F: peak_Lc(F) - 4.0, 1.2, 5)
print(f"BLT: F = {F:.3f}")
for j in range(2):
    print(f"loop {j+1}: Kc = {ZN[j][0] / F:.3f}, TI = {ZN[j][1] * F:.2f} min")

Running it prints \lambda_{11} = 2.009, NI = 0.498, the ultimate and Ziegler-Nichols values of the table, F = 2.545 and the BLT settings. In MATLAB the same calculation is done with tf with the InputDelay property, allmargin for the ultimate values and freqresp for L_c.

The original thesis

The chapters of the thesis by Eliana Li Santi, *Predisposizione dei controllori nei sistemi multivariabili* (Setting up controllers in multivariable systems), University of Pisa, 2004, in Italian, with implementations and comparisons in simulation:

Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
1
0
Would love your thoughts, please comment.x
()
x