Time delay and lost phase
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
A pure time delay hands a signal on unchanged, only late. On the Bode plot that means no change in size but a phase loss of ωT that grows without limit. Follow one loop with a 45° phase margin as its measurement arrives 0.5 s, 0.785 s and then 1 s late: the margin shrinks, the loop rings forever, then goes unstable. The Nyquist plot shows the same story, and lowering the gain shows the cure.
A loop with a 45° margin
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°.
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
اقرأ الدرس خطوة بخطوة
A loop with a 45° margin
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°.
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 marginA delay copies the signal, late
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.
a pure time delay of T seconds out(t) = in(t - T) transfer function e^(-sT) from collections import deque T, dt = 0.5, 0.01 belt = deque([0.0] * int(T / dt)) # 50 slots def delay(x): belt.append(x) # new value in return belt.popleft() # oldest value outSame size at every frequency
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.
import cmath T = 0.5 for w in [0.1, 1, 4, 10]: d = cmath.exp(-1j * w * T) print(w, round(abs(d), 6)) 0.1 1.0 1 1.0 4 1.0 10 1.0 # always 1, i.e. 0 dBFaster sines lose more phase
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.
phase of e^(-jωT) = -ωT radians = -57.3·ωT degrees import math T = 0.5 for w in [0.1, 1, 4, 10]: print(w, round(math.degrees(w * T), 1)) 0.1 2.9 1 28.6 4 114.6 10 286.5 a straight line on a linear ω axis, a plunging curve on the log axisThe loop loses its margin
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°.
L(s)·e^(-sT): multiply the sizes, add the angles def phase(w, T): return (-90 - math.degrees(math.atan(w)) - math.degrees(w * T)) print(phase(1.0, 0.5)) # -163.6 print(180 + phase(1.0, 0.5)) # 16.4 lost at crossover = ωc·T rad = 1 × 0.5 rad = 28.6°Less margin, more ringing
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.
# closed loop, step r = 1, from rest K, T, dt = math.sqrt(2), 0.5, 0.001 y = z = 0.0 late = [0.0] * int(T / dt) # the belt peak = 0.0 for n in range(30000): # 30 s late.append(y) e = 1 - late.pop(0) # error, seen late z += e * dt # controller K/s y += (-y + K*z) * dt # plant 1/(s+1) peak = max(peak, y) print(round(peak, 2)) # ≈ 1.67The delay margin
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.
delay margin = PM (in radians) / ωc pm = math.radians(45) print(pm / 1.0) # 0.785 s T = 0.785 s: y swings between −0.01 and 2.01 for ever, one swing every 6.28 s (2π/ωc) the loop is on the edge of stabilityToo late: unstable
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.
print(phase(1.0, 1.0)) # -192.3 print(180 + phase(1.0, 1.0)) # -12.3 negative margin: the closed loop is unstable each overshoot is about 1.59 × the one before the controller and plant are unchanged; 1 s of lateness alone tipped it overNyquist: the curve is twisted
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.
L(jω)·e^(-jωT): same length, angle -ωT more import cmath, math def Ld(w, T): s = 1j * w return math.sqrt(2) / (s*(s+1)) * cmath.exp(-s*T) crossing of the negative real axis (T = 1): atan(ω) + ω = π/2 -> ω = 0.86 rad/s |L| there = 1.25 > 1, so -1 is encircled python-control models a delay with control.pade(T, n): num, denLiving with delay
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.
rule of thumb: keep ωc·T small solve atan(ωc) + ωc·T = π/4 (PM = 45°) ωc = 0.40 rad/s, K = ωc·√(1 + ωc²) = 0.43 T = 1 s, K = 0.43: overshoot 25%, settles in 14.2 s T = 0, K = 1.41: overshoot 23%, settles in 7.1 s other cures: remove the delay at its source (sensor nearer, faster network) or a controller that predicts it (Smith predictor)
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01A pure delay of T = 0.5 s is fed a sine of any frequency. What happens to the sine's amplitude?
A delay only shifts the signal in time. |e^(−jωT)| = 1 at every ω, so the gain is 1, or 0 dB, and the Bode magnitude plot does not change.
02How much phase does a 0.5 s delay take away at 4 rad/s?
Phase lost = ωT = 4 × 0.5 = 2 rad, which is 114.6°. The same 0.5 s is a bigger slice of a faster cycle.
03A loop crosses 0 dB at ωc = 1 rad/s with a phase margin of 45°. What delay brings it to the edge of instability?
Delay margin = PM in radians / ωc = (π/4) / 1 = 0.785 s. With that delay the phase at crossover is exactly −180° and the output rings for ever.
04Why does a delay never change where the loop crosses 0 dB?
Magnitudes multiply and the delay's magnitude is 1, so the magnitude curve and its crossover stay put. Only the phase there gets worse.
05With a 1 s delay the loop is unstable at K = 1.41. Lowering K to 0.43 restores a 45° margin. Why does that work?
The delay still lasts 1 s, but phase lost = ωT, so a slower loop loses less. The price is speed: settling takes 14.2 s instead of 7.1 s.
المسرد
- Time delay (dead time, transport lag)
- A part whose output equals its input T seconds earlier: out(t) = in(t − T). Its transfer function is e^(−sT).
- Phase lag
- How far, in degrees, an output sine peaks after the input sine. A delay T at frequency ω gives a lag of ωT radians (57.3·ωT degrees).
- Gain crossover frequency ωc
- The frequency where the open-loop magnitude |L(jω)| equals 1 (0 dB).
- Phase margin
- 180° plus the open-loop phase at ωc: how much more phase lag the loop can take before it becomes unstable.
- Delay margin
- The largest extra delay the loop can take before it becomes unstable: phase margin in radians divided by ωc.
- Nyquist plot
- The open-loop L(jω) drawn as points in the complex plane as ω rises. If it encircles −1 (for a stable open loop) the closed loop is unstable.
- Padé approximation
- A ratio of polynomials that imitates e^(−sT) over a range of frequencies, used when a tool needs a rational transfer function.
الملاحظات والمصادر
- 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.
- A pure time delay (also called dead time or transport lag) has transfer function e^(−sT), from the shifting theorem of the Laplace transform. Its frequency response has magnitude 1 and phase −ωT radians at every frequency, so it is not a rational transfer function and has no finite set of poles and zeros.
- Phase is quoted in degrees and added term by term. Python's cmath.phase returns an angle between −π and π, so calling it on the delayed L(jω) would wrap −192° to +168°; the lesson's code adds the angles instead.
- Delay margin = phase margin in radians divided by the crossover frequency. It holds as written when the magnitude crosses 0 dB once, as |L| does here (it falls at every frequency).
- 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.
- N. S. Nise, Control Systems Engineering, 8th ed., Wiley (ch. 10, frequency response techniques)
- K. Ogata, Modern Control Engineering, 5th ed., Pearson (ch. 7, frequency-response analysis)
- G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems, 8th ed., Pearson (ch. 6, the frequency-response design method)
- K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, 2nd ed. (free online)
- MIT OpenCourseWare 16.06 Principles of Automatic Control (S. Hall)
- MIT OpenCourseWare 6.302 Feedback Systems (Roberge, Dawson, Lundberg)
- python-control: control.pade (rational approximation of a time delay)
- Python 3 documentation: cmath (phase returns an angle in [−π, π])
اختبار يتاح بعد الخطوة الأخيرة.