Skip to content

Control Systems

Why time delay makes a control loop oscillate

A feedback controller steers on its measurements. When those measurements arrive late, a delay engineers call dead time, every correction is worked out from where the system was, not where it is. A gentle correction copes. A big one lands after the system has already moved, overshoots, and the next correction overshoots back. The more delay, the lower the gain that stays stable.

Where delays come from

A barometer averages its readings. A radio link queues packets. A camera waits for the next frame. Hot water takes seconds to travel down a pipe to the shower head. Each is dead time: the controller acts now and hears about the result later.

Gain meets lag

Take a drone holding its height with a P controller, thrust = 9.8 + Kp × error. With a sensor that reports at once, even Kp 4 overshoots a little and settles. Now delay the sensor:

Sensor delaySettlesStill swinging at 12 s
NoneKp 0.5 up to 4nothing tried
200 msKp 0.5 to 2Kp 4
400 msKp 0.5Kp 1 and up

Each hard push is computed on a stale height and arrives after the drone has moved past the target.

Live experiment

Fly a drone with a late sensor

A drone holds its height with thrust = 9.8 + Kp × error, but its sensor reports 0, 200 or 400 ms late. Amber dashes show what the sensor said, the blue line where the drone really was. With no lag even Kp 4 settles; behind 200 ms Kp 4 is still swinging at 12 s; behind 400 ms only Kp 0.5 settles.

Try it yourself: free lesson

“Lag in the loop” is lesson 1 of 6 in Lag Lagoon, Control Systems World 2. Free with an account. Lessons unlock in order, so you’ll do the 7 before it first.

Why: phase lag

A delay of T seconds makes any wobble at frequency f arrive late by a fraction f × T of a cycle:

phase lag = 360° × f × T

At 2.5 Hz, a 200 ms delay is 360° × 2.5 × 0.2 = 180°: half a cycle. A push that's half a cycle late pushes with the swing instead of against it. If the loop's gain at that frequency is big enough to make the swing grow, it oscillates. Turning Kp down shrinks the gain at every frequency until the swing dies away. Double the delay and 180° arrives at half the frequency, where the loop has more gain, so the safe Kp falls further. The room left between the loop and that edge is its phase margin.

The fixes

  • Lower the gain: stable, but slow.
  • Shorten the delay: a faster sensor, less averaging, a quicker link.
  • Add damping: a D term reacts to the rate of change, which starts the braking before the stale reading reaches the target.
  • Predict: a model of the process estimates what the late sensor will say.

The shower teaches all four: small turns, then wait. Mars rovers are the extreme case. With a command taking several minutes to arrive, nobody steers one live; drivers send a plan, and the rover's own fast local loop does the steering.

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

“Lag in the loop” is lesson 1 of 6 in Lag Lagoon, Control Systems World 2. Free with an account. Lessons unlock in order, so you’ll do the 7 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 3A wobble at 2.5 times a second, seen through a 200 ms delay. The reading is late by…
    Show the answer

    Answer: Half a wobble: the controller pushes exactly the wrong way. One wobble takes 0.4 s, so 0.2 s is half of it. By the time the push lands, the drone is on the other side: the push feeds the swing instead of fighting it.

    • Why not “A tenth of a wobble”? One wobble at 2.5 per second takes 0.4 s, so a 0.2 s delay is half of it, not a tenth.
    • Why not “Nothing”? Any delay makes the reading late. 0.2 s against a 0.4 s wobble is half a cycle.
    • Why not “A whole wobble: no harm done”? A whole wobble would need a 0.4 s delay. At 0.2 s the reading is half a cycle out.
  2. Question 2 of 3The lag doubles from 200 ms to 400 ms. The largest gain that still settles…
    Show the answer

    Answer: Falls, to less than half: 2 becomes under 1. More lag means more time for a push to go stale, so pushes must be gentler. In this drone, 200 ms tolerates Kp 2; 400 ms needs a gain under 1, and 0.5 is safe.

    • Why not “Doubles”? More lag makes every push staler, so the gain has to come down, not up.
    • Why not “Doesn't matter”? Gain is exactly what the delay limits. Too much and each late push overshoots.
    • Why not “Stays the same”? The safe gain depends on the lag: Kp 2 settles behind 200 ms but swings behind 400 ms.
  3. Question 3 of 3What would let the gain go back up?
    Show the answer

    Answer: A faster sensor, or a D term. Less lag or damping. Gain alone can only be traded against the delay.

    • Why not “A longer run”? More time just shows more of the same swinging. The loop itself has to change.
    • Why not “More hover thrust”? Hover thrust only balances gravity. It does nothing about the delay or the swing.
    • Why not “A bigger drone”? Size doesn't remove the delay. The trouble is pushes based on stale readings.
Keep practising: free lesson

“Lag in the loop” is lesson 1 of 6 in Lag Lagoon, Control Systems World 2. Free with an account. Lessons unlock in order, so you’ll do the 7 before it first.

Questions people ask

What is dead time in a control system?

A pure delay between the controller acting, or the system changing, and the controller seeing the result. A slow sensor, a long pipe, a conveyor belt or a radio link all add dead time. Nothing the controller does can show up in its measurements until the delay has passed.

How does a time delay affect stability?

A delay of T seconds makes a wobble at frequency f arrive 360° × f × T late. At the frequency where that reaches 180°, every correction pushes with the swing instead of against it. If the loop still has a gain of one or more there, the swing grows or keeps going.

How do you control a process with a long delay?

Turn the gain down, shorten the delay with a faster sensor, or add damping such as a D term. For very long, well-known delays, a Smith predictor uses a model of the process to predict what the measurement will show once it catches up.

Every topic