Skip to content

Control Systems

What is disturbance rejection in control?

Disturbance rejection is how well a control loop brings its output back after something pushes it off target: a gust under a drone, a door opening on a warm room, a hill under a car. A feedback loop doesn't need to know the push is coming. It sees the error the push causes, and corrects that.

The loop only sees error

A drone holding 10 m runs thrust = hover + P + I − D, many times a second. A downdraft knocks 3 m/s off its speed. Nothing in the controller measures wind. What it does see, a moment later, is the height falling and the error growing, and that's enough: a bigger error makes a bigger push, and the drone climbs home.

That's the great strength of feedback. A plan made in advance has to be right about every push the world will give it. A loop only has to keep looking.

Each term's job

  • P pushes back in proportion to how far the drone has dropped.
  • D pushes against speed. A gust is a sudden jolt of speed, so D reacts at once, and it brakes the return so P doesn't overshoot on the way back up.
  • I cleans up anything that lasts. A one-off knock leaves nothing for it to do, but a steady wind or a heavier parcel would leave P short, and I closes that gap.

Live experiment

Send a gust

The loaded drone holds 10 m with thrust = 9.8 + 16 × error + 1 × integral − Kd × v. At 1 s a gust knocks 3 m/s off its speed. With Kd 0 it drops to about 9.4 m and bounces for seconds; with Kd 7 it dips to about 9.74 m and comes straight back.

Try it yourself: free lesson

“A gust of wind” is lesson 6 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the 5 before it first.

The numbers

With Kp 16, Ki 1 and no D, the gust drops the drone to about 9.38 m, and on the way back it swings up to 10.45 m and keeps bouncing for seconds. With Kd 7 it dips only to about 9.74 m and returns without a visible overshoot. Same gust, same P: the difference is all in the brakes.

integral = integral + error * 0.01;
thrust = 9.8 + 16.0 * error + 1.0 * integral - 7.0 * v;

Tuning for knocks

Tune in order. P first, until the response is quick. D next, until neither a step in the target nor a knock makes it ring. I last and small, for whatever error remains. Then test the thing you care about: send it a disturbance, not just a new target, and watch the recovery.

Camera drones hold position in wind by running loops like this hundreds of times a second. Ship autopilots and self-balancing scooters reject knocks the same way.

Free lesson

Now build it yourself

Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.

Try it yourself: free lesson

“A gust of wind” is lesson 6 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the 5 before it first.

Or start from the very first lesson, no account needed

Practice questions

Three quick questions from the lessons. Pick an answer to check it.

  1. Question 1 of 3Which controller recovers from a gust best?
    Show the answer

    Answer: A moderate gain with damping. The gain corrects the knock, the damping stops the swing, and neither has to be extreme.

    • Why not “A huge gain with no damping”? A huge gain overreacts to the knock, and with nothing braking it, the drone swings back and forth for a long time.
    • Why not “No controller”? Without a controller nothing reacts to the knock, so nothing brings the drone back.
    • Why not “A tiny gain”? A tiny gain barely pushes back, so the drone sags and takes ages to climb home.
  2. Question 2 of 3A feedback loop handles a gust by…
    Show the answer

    Answer: Correcting the error it causes, after it happens. It doesn't need to know what the gust was, only that the drone is now off target.

    • Why not “Predicting it”? A feedback loop can't see a gust coming. Acting early from a measurement of the wind is feedforward.
    • Why not “Turning off”? The loop keeps running all the time. Switching it off would leave nothing to bring the drone back.
    • Why not “Ignoring it”? It can't ignore the gust's effect: the drop shows up as error, and the loop pushes back against it.
  3. Question 3 of 3A gust knocks the hovering drone down. With Kd 0 it bounces for seconds; with Kd 7 it dips and comes straight back. Why?
    Show the answer

    Answer: The gust is a jolt of speed, and D is the term that pushes against speed. The loop never sees the gust coming; it sees a sudden downward speed and a growing error. D pushes against the speed straight away, so P's correction doesn't overshoot on the way back.

    • Why not “D predicts the gust”? D only sees the speed the gust has already caused. It reacts quickly, but it doesn't know a gust is coming.
    • Why not “Kd 7 turns P off”? P is still there, bringing the drone back. D just brakes the return so P's push doesn't overshoot.
    • Why not “D makes the drone heavier”? D changes the thrust, not the drone's weight. It pushes against speed.
Keep practising: free lesson

“A gust of wind” is lesson 6 of 6 in Feedback Falls, Control Systems World 1. Free with an account. Lessons unlock in order, so you’ll do the 5 before it first.

Questions people ask

What is a disturbance in a control system?

Any push on the system that the controller didn't make: a gust on a drone, a door left open on a heated room, a hill under a car on cruise control, a heavier load on a motor. Disturbance rejection is how well the loop brings the output back.

Does a feedback controller need to measure the disturbance?

No. It only sees the error the disturbance causes, and corrects that. Measuring the disturbance itself and acting before it shows up as error is feedforward, which is often added on top of feedback.

Which PID term handles a sudden disturbance?

All three, each with its own job. P pulls the system back in proportion to how far it was knocked. D pushes against the sudden speed, so the recovery doesn't overshoot and ring. I removes any error that lingers, like the offset from a steady wind.

What does it mean for a control loop to be robust?

It keeps working when the world isn't what the designer assumed: gusts, wrong weights, worn parts. Feedback is robust because it doesn't need a model of every push, only a measurement of where the system is.

Every topic