S9 · Lesson 19 · Feedforward and two-degree-of-freedom control
Acting before the error appears: disturbance feedforward and its limits, inverse-model reference feedforward in motion control, prefilters and setpoint weighting
Feedback has a built-in handicap: it can't act until an error has already appeared. If a disturbance can be measured, or a reference is known in advance, there's no need to wait. A furnace controller that sees the door open can add heat before the temperature falls; a motion controller that knows the planned trajectory can supply the torque to accelerate before any position error builds up. That's feedforward. It relies on a model, so it's never perfect, but feedback cleans up what it misses: together they do far better than either alone.
- The curve is the output's deviation after a step disturbance at a plant's input, , with a PI loop of crossover 1 rad/s acting alone: the response from lesson 8, peaking at 0.077 and lingering for tens of seconds.
- The dashed curve adds a feedforward that cancels a fraction g of the disturbance. By superposition, what's left is (1 − g) times the feedback-only deviation.
- A feedforward 80% right removes 80% of the deviation; feedback handles the rest without ever seeing the part that was cancelled.
Predict
A disturbance feedforward is built from a model whose gain is 20% too low. How much of the disturbance's effect does it remove?
The feedforward injects 80% of the input that would exactly cancel the disturbance, so 20% of the disturbance gets through, and feedback then reduces that by its own factor S. Feedforward doesn't have to be accurate to be useful; it only has to be closer than zero. A gain twice too high, though, would overcorrect by 100% and help nothing.
Name it
Disturbance feedforward
A measured disturbance d reaches the output through , and the input reaches it through P. A feedforward adds , so the disturbance's net path is , zero for
That ideal F must be stable and causal: if P has more delay than , or a right-half-plane zero, it can't be inverted exactly, and a static feedforward is the usual fallback. With feedback too, what's left reaches the output as : feedforward shrinks the disturbance, feedback attenuates the remainder.
Reference feedforward and two degrees of freedom
A one-degree-of-freedom loop acts only on the error, so the response to the reference and the rejection of disturbances are tied together through the same C. A two-degree-of-freedom controller separates them:
- inverse-model feedforward: with makes the output follow r exactly when the model is right, and feedback corrects the error when it isn't;
- prefilter: shape the reference before the loop, , so the overall response is , for instance to cancel a slow or overshoot-causing zero of T;
- setpoint weighting in PI control, , with , puts only a fraction b of a setpoint step into the proportional term, which reduces overshoot without changing disturbance rejection.
Motion control
For a motor of inertia J, viscous friction b and torque constant , a trajectory with acceleration a(t) and velocity v(t) needs current
Supplying it ahead of time lets the position loop handle only modeling errors and disturbances, which is why motion controllers carry acceleration and velocity feedforward gains.
Worked example
A rotary stage has J = 2 × 10⁻⁴ kg·m², b = 10⁻³ N·m·s and = 0.05 N·m/A. Its planned move accelerates at 500 rad/s² while at 100 rad/s. What feedforward current does that moment need?
Show the solution
- The two torques. One accelerates the inertia and one overcomes friction at this speed:
- Feedforward current.
- Without feedforward. The position loop would have to build up a tracking error large enough for its gain to command those 4 A, and the error during every acceleration would be proportional to them.
Answer the feedforward current at that moment is 4 A.
Worked example
A furnace's temperature rises 2 °C per watt of heater and 1 °C per °C of ambient. What static feedforward on the measured ambient cancels it, and what's left if the real heater gain is 2.4 °C/W?
Show the solution
- Static feedforward. Cut the heater by 0.5 W for each °C the ambient rises.
- With the true gain. The feedforward removes overcorrecting by 20%.
- Residual. of ambient change, a fifth of the original, which the feedback loop then reduces further.
Answer cut the heater by 0.5 W per °C of ambient rise; with a true gain of 2.4 °C/W, −0.2 °C per °C remains, a fifth of the original.
Worked example
A PI loop around with = 3 and = 8 gives : ζ = 0.707, but with a zero at −2.67. What does the zero do to a step, and how does a prefilter fix it?
Show the solution
- Without the zero. ζ = 0.707 alone would overshoot 4.3%.
- With the zero. The zero adds a multiple of the derivative to the response, and a simulation of T gives 11.9% overshoot.
- The prefilter. This cancels the zero:
- What the reference sees. which overshoots 4.3% again.
- Disturbances. Disturbance rejection is unchanged, since the prefilter sits outside the loop.
Answer the zero raises the overshoot from 4.3% to 11.9%, and the prefilter cancels it, bringing the overshoot back to 4.3%.
Check
A motor with J = 0.0001 kg·m², viscous friction b = 0.001 N·m·s and = 0.03 N·m/A follows a trajectory accelerating at 200 rad/s² while turning at 300 rad/s.
(a)
What feedforward current does it need at that moment?
Write units the way you normally would: 1.5 A, 1500 mA and 0.0015 kA are the same answer.
(b)
What fraction of it goes to acceleration?
Check
A process gains 2 units per unit of input and 0.3 units per unit of a measured disturbance; a static feedforward is designed with a model gain for the input that's off by 20%.
(a)
What feedforward gain does the model give?
(b)
How much disturbance reaches the output per unit, before feedback?
Check
A PI controller ( = 3, = 4) runs around the plant .
(a)
Where is the closed loop's zero?
(b)
What is the closed-loop damping ratio?
(c)
What time constant must a first-order prefilter have to cancel the zero?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
A PI zero cancels the plant pole of , τ = 10 s, for a loop with = 0.5 s; a feedforward cancels a fraction 0.95 of a unit step disturbance at the plant's input.
(a)
What peak deviation remains?
Check
A PI controller with setpoint weight b = 0.3 and = 2 sees a setpoint step of 10 while the output is still at rest.
(a)
How big is the proportional term's initial jump?
Check
A plant has a dead time of 2 s from its input, while a measured disturbance reaches the output after 0.5 s.
(a)
How far in advance would an ideal feedforward need to act?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
Why does a plant with a right-half-plane zero rule out exact inverse-model feedforward?
Check
A static feedforward uses an input gain where the truth is p, to cancel a disturbance with gain d.
Step 1
What is the feedforward gain?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What net disturbance gain remains?
Check
Write peak_deviation(g, T, dt): simulate a unit step disturbance at the input of under PI control , so that L = 1/s (forward Euler, step dt, for T seconds), with a feedforward that subtracts g times the disturbance at the plant's input, and return the largest output deviation.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why are feedforward and feedback combined rather than used alone?
Feedforward acts on a measured disturbance or a known reference before any error appears, so it can be fast and needs no loop gain, but it relies entirely on a model and corrects nothing it didn't anticipate. Feedback needs no model of the disturbance and corrects whatever error appears, but it must first see that error and is limited by stability margins. Together, feedforward removes most of the predictable effect quickly, and feedback cleans up the residue left by model errors and unmeasured disturbances, so the combination is both fast and accurate. Because feedforward sits outside the loop, adding it doesn't change the loop's stability.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.