TExcelTAD
Home › Control Systems & Automation › Cascade, Feedforward and Ratio Control

Cascade, Feedforward and Ratio Control

One feedback loop around the whole process is the textbook picture; plants rarely use just that. A motor drive closes a fast current loop inside its speed loop, so the current never exceeds the motor's rating and a sagging supply is corrected before the speed notices. A heater controller that is told "the fan just switched on" adds the extra power at once instead of waiting for the temperature to drop. A dosing pump follows the main flow in a fixed proportion. These are the three classic control structures built from ordinary PID blocks: cascade, feedforward and ratio control. They cost a sensor or a signal each and buy disturbance rejection that no amount of single-loop tuning can match.

Cascade control

w* + - speed PI outer limit +/-1.5 A i* + - current PI inner drive +/-12 V v armature R, L, emf i rotor J, b T_L current (shunt) speed (encoder) back-emf

The outer (primary) controller does not drive the actuator; it sets the setpoint of an inner (secondary) loop that controls an intermediate variable. It pays off when:

  • a disturbance enters the inner part of the process (supply voltage, inlet pressure) and the inner loop can correct it before it reaches the main output;
  • the inner variable must be limited (motor current, heater power, valve flow): clamp the inner setpoint;
  • the actuator is nonlinear (a valve, a PWM stage): the inner loop linearises it, so the outer loop sees a clean, nearly unity-gain block.

Rules of thumb. The inner loop must be clearly faster than the outer one, typically 3 to 10 times in bandwidth, so the outer controller can treat it as a gain of about 1. Tune the inner loop first with the outer loop open (in manual), then the outer loop. The inner sensor must measure the intermediate variable directly.

For the small motor the textbook inner design is a PI current controller whose zero cancels the electrical pole: Kp,i=LaωciK_{p,i} = L_a\omega_{ci}, Ki,i=RaωciK_{i,i} = R_a\omega_{ci}, so the closed current loop is 1s/ωci+1\frac{1}{s/\omega_{ci} + 1}. With ωci=2000 rad/s\omega_{ci} = 2000\ \text{rad/s}: Kp,i=2 V/AK_{p,i} = 2\ \text{V/A}, Ki,i=4000 V/(A⋅s)K_{i,i} = 4000\ \text{V/(A} \cdot \text{s)}. The outer plant is then current to speed, kJs+b≈10 000s rad/s per A⋅s\frac{k}{Js + b} \approx \frac{10\,000}{s}\ \text{rad/s per A} \cdot \text{s}, and a speed PI with Kp,ω=0.02 A⋅s/radK_{p,\omega} = 0.02\ \text{A} \cdot \text{s/rad} gives a speed loop near 200 rad/s200\ \text{rad/s}, ten times slower.

Worked example: speed loop with and without a current loop

Given: the reference motor on a 12 V12\ \text{V} drive; speed reference 300 rad/s300\ \text{rad/s} from standstill; a load torque of 2 mN⋅m2\ \text{mN} \cdot \text{m} at t=0.1 st = 0.1\ \text{s}. (a) A single speed PI acting on the voltage (Kp=0.04 V⋅s/radK_p = 0.04\ \text{V} \cdot \text{s/rad}, Ki=2 V/radK_i = 2\ \text{V/rad}); (b) the cascade above with the current setpoint clamped at ±1.5 A\pm 1.5\ \text{A}. Both use conditional integration (no integration while limited).

Find: the peak current, the time to reach 90 % of the reference, the speed dip under load, the final current.

Solve: by hand, only the end points: at 300 rad/s300\ \text{rad/s} under load the motor needs i=(TL+bω)/k=(0.002+0.0003)/0.02=0.115 Ai = (T_L + b\omega)/k = (0.002 + 0.0003)/0.02 = 0.115\ \text{A} in both cases. In (a) the first voltage step is Kp×300=12 VK_p \times 300 = 12\ \text{V}, so the current heads for 12/2=6 A12/2 = 6\ \text{A} until the back-EMF rises; in (b) the clamp holds it near 1.5 A1.5\ \text{A}. The rest needs a simulation:

python · try it yourself
import numpy as np

Ra, La, k, J, b = 2.0, 1e-3, 0.02, 2e-6, 1e-6
h, T = 5e-6, 0.2

def sat(x, lim):
    return min(max(x, -lim), lim)

def simulate(cascade):
    i = w = Iw = Ii = 0.0
    log = []
    for n in range(int(T / h)):
        t = n * h
        TL = 2e-3 if t >= 0.1 else 0.0
        ew = 300.0 - w
        if cascade:
            ir = 0.02 * ew + Iw                  # outer speed PI -> current reference
            irs = sat(ir, 1.5)
            if ir == irs:
                Iw += 1.0 * ew * h
            ei = irs - i
            v = 2.0 * ei + Ii                    # inner current PI -> voltage
            vs = sat(v, 12.0)
            if v == vs:
                Ii += 4000.0 * ei * h
        else:
            v = 0.04 * ew + Iw                   # single speed PI -> voltage
            vs = sat(v, 12.0)
            if v == vs:
                Iw += 2.0 * ew * h
        i += h * (vs - Ra * i - k * w) / La
        w += h * (k * i - b * w - TL) / J
        log.append((t, w, i))
    a = np.array(log)
    before, after = a[a[:, 0] < 0.1], a[a[:, 0] >= 0.1]
    t90 = before[np.argmax(before[:, 1] >= 270.0), 0]
    return np.abs(before[:, 2]).max(), t90, after[:, 1].min(), after[-1, 2]

for name, c in (("single speed loop", False), ("cascade (current loop)", True)):
    ipk, t90, wmin, ifin = simulate(c)
    print(f"{name:22s}: peak current {ipk:4.2f} A, 90 % speed at {1e3 * t90:4.1f} ms, "
          f"dip under load to {wmin:5.1f} rad/s, final current {ifin:.3f} A")
single speed loop     : peak current 4.96 A, 90 % speed at 27.3 ms, dip under load to 295.7 rad/s, final current 0.116 A
cascade (current loop): peak current 1.43 A, 90 % speed at 20.3 ms, dip under load to 296.3 rad/s, final current 0.115 A

Check: both end at the hand-calculated 0.115 A0.115\ \text{A} (the single loop is still settling at 0.116 A0.116\ \text{A}). The cascade holds the start current near its 1.5 A1.5\ \text{A} limit instead of more than three times that, and still reaches speed sooner, because it uses the whole permitted current for the whole acceleration instead of a brief spike. The load dip is about the same here; it would be much smaller for the cascade if the disturbance were a supply-voltage sag, which the inner loop removes within a millisecond.

Feedforward control

Feedback acts only after an error has appeared. If a disturbance can be measured (or is commanded by the same controller) its effect can be cancelled before it shows up in the output:

u=ufb+uff,uff=−Gd(s)G(s) d(ideal)u = u_\text{fb} + u_\text{ff}, \qquad u_\text{ff} = -\frac{G_d(s)}{G(s)}\,d \quad \text{(ideal)}

where GdG_d is the path from the disturbance to the output. In practice the ideal inverse is often unrealisable (delays, more poles than zeros), so a static feedforward −Gd(0)/G(0) d-G_d(0)/G(0)\,d, perhaps with a lead-lag, does most of the work, and feedback cleans up the rest. Feedforward does not change stability: it is outside the loop. Its accuracy depends on the model, so it is always combined with feedback.

The same idea applied to the reference is setpoint feedforward: add the input the plant needs in steady state (r/G(0)r/G(0)), or a filtered inverse model for fast tracking, so the feedback controller only has to correct errors.

Example: a fan on the heater block. The block (heat capacity 75 J/K75\ \text{J/K}, normally losing 0.25 W/K0.25\ \text{W/K}) runs at 25 K25\ \text{K} above the room under PI control (Kp=2 W/KK_p = 2\ \text{W/K}, Ki=0.02 W/(K⋅s)K_i = 0.02\ \text{W/(K} \cdot \text{s)}). At t=600 st = 600\ \text{s} a cooling fan switches on and doubles the loss to 0.5 W/K0.5\ \text{W/K}. The controller knows when the fan runs, so a static feedforward adds Δg⋅r=0.25×25=6.25 W\Delta g \cdot r = 0.25 \times 25 = 6.25\ \text{W} at once.

python · try it yourself
import numpy as np

def run(ff_gain, h=0.1, T=1800.0):
    Ch, r = 75.0, 25.0
    Tb = r                                     # start in steady state
    I = 0.25 * r                               # integral holds the 6.25 W of the steady state
    worst = 0.0
    for n in range(int(T / h)):
        t = n * h
        fan = t >= 600.0
        g = 0.5 if fan else 0.25
        e = r - Tb
        uff = ff_gain * 0.25 * r if fan else 0.0   # feedforward of the extra loss
        P = 2.0 * e + I + uff
        Ps = min(max(P, 0.0), 14.4)
        if P == Ps:
            I += 0.02 * e * h
        Tb += h * (Ps - g * Tb) / Ch
        if fan:
            worst = max(worst, r - Tb)
    return worst

for name, gain in (("PI only", 0.0), ("PI + exact feedforward", 1.0), ("PI + feedforward 20 % low", 0.8)):
    print(f"{name:26s}: largest temperature drop after the fan starts {run(gain):.3f} K")
PI only                   : largest temperature drop after the fan starts 1.853 K
PI + exact feedforward    : largest temperature drop after the fan starts 0.000 K
PI + feedforward 20 % low : largest temperature drop after the fan starts 0.371 K

Even a feedforward that is 20 % wrong cuts the drop by about a factor of five; feedback removes the remaining error slowly, as before.

Ratio control

Some variables must stay in proportion rather than at a value: fuel to air in a burner, a dosing chemical to the main water flow, two motor speeds on a web line. Ratio control measures the uncontrolled ("wild") flow FwF_w, multiplies it by the desired ratio RR, and uses the product as the setpoint of the controlled flow's loop:

rc=R⋅Fwr_c = R \cdot F_w

Two details matter in practice. If the controlled loop is slow, the ratio is wrong during changes; a lead-lag on FwF_w or feedforward helps. In combustion the ratio must never go fuel-rich, even transiently, so the fuel setpoint takes the lower of the demand and what the measured air allows, while the air setpoint takes the higher (a cross-limiting scheme): concepts only in this course, because burners and gas trains are safety-critical systems built to their own standards.

Example. A dosing pump must add 2 mL2\ \text{mL} of additive per litre of water. The water meter reads 12 L/min12\ \text{L/min}, so the pump's setpoint is 0.002×12=0.024 L/min=24 mL/min0.002 \times 12 = 0.024\ \text{L/min} = 24\ \text{mL/min}; when the water falls to 8 L/min8\ \text{L/min}, the setpoint follows to 16 mL/min16\ \text{mL/min}.

Guided lab: a cascaded motor drive

Hand calculation. Current loop bandwidth 2000 rad/s2000\ \text{rad/s} (318 Hz318\ \text{Hz}), speed loop about 200 rad/s200\ \text{rad/s}; start current limited to 1.5 A1.5\ \text{A}; acceleration at the limit k⋅1.5/J=15 000 rad/s2k \cdot 1.5/J = 15\,000\ \text{rad/s}^2, so 300 rad/s300\ \text{rad/s} in about 20 ms20\ \text{ms} (the simulation agrees).

Simulation. In the motor program set the clamp to 0.75 A0.75\ \text{A}: the acceleration halves and the 90 % time roughly doubles.

What you would measure. Motor, H-bridge and 0.1 Ω0.1\ \Omega shunt with an amplifier, encoder, microcontroller running the current loop at 10–20 kHz10\text{–}20\ \text{kHz} and the speed loop at 1 kHz1\ \text{kHz}, from a 12 V12\ \text{V} supply limited to 2 A2\ \text{A}. Log the current during a speed step: a flat top near 1.5 A1.5\ \text{A} (±5 %\pm 5\,\% from shunt tolerance and amplifier offset) while accelerating, then the small running current. Load the shaft with a friction brake (a felt pad) to see the speed dip and recovery.

Hazards and safe setup. Clamp the motor, guard the shaft and the brake; set the supply current limit above the clamp but low (here 2 A2\ \text{A}); a sign error in the inner loop makes it unstable at full current, so test it alone first with the rotor locked and a 3 V3\ \text{V} supply.

Pitfalls

  • An inner loop not much faster than the outer: the loops interact and the outer tuning becomes fragile.
  • Tuning the outer loop first: its gains change when the inner loop is retuned.
  • Feedforward from a noisy measurement: filter it, or the actuator follows the noise.
  • Forgetting that feedforward needs a model: always keep feedback to remove the residual error.

Practice

  1. A speed loop has bandwidth 50 rad/s50\ \text{rad/s}. What range of current-loop bandwidths does the 3–10 rule suggest?
  2. The heater's fan doubles the loss as above, but the feedforward is 50 % too large. What happens just after the fan starts?
Answer
  1. 150150 to 500 rad/s500\ \text{rad/s} or more.
  2. The block briefly warms (too much power is added), and feedback then removes the excess slowly; the error has the opposite sign and about half the size of the PI-only drop.

Test yourself

In a cascade, which loop is tuned first?

  1. the outer loop
  2. the inner loop, with the outer loop in manual
  3. both at once
  4. it does not matter

Why does a motor drive put a current loop inside the speed loop?

  1. to measure speed
  2. to limit current and correct supply and electrical disturbances quickly
  3. to remove the encoder
  4. to make the speed loop unstable

Feedforward from a measured disturbance

  1. changes the closed-loop poles
  2. acts before an error appears and does not affect stability
  3. replaces feedback
  4. needs no model

A dosing ratio of 2 mL/L2\ \text{mL/L} with a wild water flow of 15 L/min15\ \text{L/min} gives a pump setpoint of

  1. 7.5 mL/min7.5\ \text{mL/min}
  2. 30 mL/min30\ \text{mL/min}
  3. 2 mL/min2\ \text{mL/min}
  4. 15 mL/min15\ \text{mL/min}