The loop and the delay
Our loop: a controller K/s, K = 1.41, drives a plant 1/(s + 1). Its open-loop Bode plot crosses 0 dB at ωc = 1 rad/s, where the phase is −135°. So the phase margin (lesson: Gain margin and phase margin) is 45°.
Now the measurement reaches the controller T = 0.5 s late, like water in a long pipe. A pure delay changes nothing except arrival time: out(t) = in(t − T). Each bead on the belt keeps the value it entered with for 0.5 s.
Feed the delay a sine. Out comes the same sine, the same height, only shifted. So its gain is exactly 1, which is 0 dB, at every frequency: |e^(−jωT)| = 1. The delay leaves the magnitude plot untouched.
The lag is always 0.5 s, but a faster sine has shorter cycles, so 0.5 s is a bigger slice of each one. Phase lost = ωT radians: 28.6° at 1 rad/s, 114.6° at 4 rad/s. It grows without limit.
Delay inside the loop
Put the delay in the loop. The magnitude plot is unchanged, so crossover stays at 1 rad/s. But there the phase is now −135° − 28.6° = −163.6°. The phase margin shrinks from 45° to 16.4°.
Step the setpoint from 0 to 1 and simulate. Without delay the output overshoots 23% and settles in 7.1 s. With the 0.5 s delay it overshoots 67% and takes 26.7 s. Same controller, same plant: only the lateness changed.
How much delay can the loop take? Divide the phase margin, in radians, by the crossover: 0.785 / 1 = 0.785 s. With exactly that delay the phase at crossover is −180° and the output rings forever at 1 rad/s.
At T = 1 s the delay costs 57.3° at crossover. The phase there is −192.3°, a margin of −12.3°. Each correction now arrives so late that it pushes the wrong way, and every swing is bigger than the last.
Two views and a cure
On the Nyquist plot the delay turns each point L(jω) clockwise by ωT radians and keeps its length. Low frequencies barely move; high ones spiral round the origin. At T = 1 s the curve crosses the real axis at −1.25, beyond −1: unstable.
You cannot tune a delay away, only respect it. Lower K to 0.43: crossover drops to 0.40 rad/s, where 1 s of delay costs only 23°, and the margin is back to 45°. The price: settling takes 14.2 s instead of 7.1 s.
What is happening
# step 1/10 · loop # about: Controller K/s, Plant 1/(s+1), Bode magnitude, |L(jω)|, Bode phase, ∠L, no delay open loop L(s) = K / (s (s + 1)), K = √2 import math K = math.sqrt(2) def mag(w): return K / (w * math.sqrt(1 + w*w)) def phase(w): return -90 - math.degrees(math.atan(w)) print(mag(1.0)) # 1.000 -> ωc = 1 rad/s print(phase(1.0)) # -135.0 print(180 + phase(1.0)) # 45.0 phase margin
The loop is a plant 1/(s + 1) under integral control K/s, with K = √2 so that the gain crossover is exactly 1 rad/s. The delay sits in the feedback path. Every curve and number is computed from this model: the Bode and Nyquist curves from L(jω)·e^(−jωT), the step responses by numerical integration from rest. The Python on each step is plain Python 3 (math, cmath, collections). The step responses in the figure use a fourth-order Runge–Kutta step of 1 ms; the simple 1 ms update in the step code gives the same peaks to about two digits. python-control's control.pade(T, n) gives a rational approximation of a delay when a tool needs one.