THEORY BEHIND EXPERIMENT 21 · DC MOTOR

Critical dead time of a PI loop, calculated

The lab raises the dead time step by step and watches the margin shrink. This note goes straight to the edge: one division gives the delay at which the loop stops settling, a second the period it rings at there, and two single-gain changes show which gain to lower when a delay appears.

Companion to the lab experiment Dead time limits speed. Run it there; this note predicts what you will see and why.

The model in play

PI on the default motor (kp = 0.22, ki = 0.6, kd = 0), a 50 rad/s target and no load, updated every 20 ms. The opt-in input dead time θ delays the drive voltage in whole 5 ms steps, and the frequency workbench includes the same delay in its sampled loop.

Li˙=V(t−θ)−Ri−Keω,Jω˙=Kti−bω−τloadL\dot{i}=V(t-\theta)-Ri-K_e\omega,\qquad J\dot{\omega}=K_t i-b\omega-\tau_{load}
L(jω)=C(jω) G(jω) e−jωθ:∣L∣ unchanged,∠L reduced by ωθL(j\omega)=C(j\omega)\,G(j\omega)\,e^{-j\omega\theta}:\qquad |L|\ \text{unchanged},\qquad \angle L\ \text{reduced by}\ \omega\theta

Simplifications that matter here

  • The phase rule treats the loop as linear. Nothing clips until the loop is past the edge; at the lab's 300 ms setting the voltage reaches 12 V.
  • The lab's menu offers 0, 20, 50, 100, 200, 300 and 500 ms; the edge lies between two entries, so it was checked in the engine at 5 ms resolution.

Predict it by hand

A delay leaves the gain crossover where it is, 3.49 rad/s, and removes ωθ of phase there, so the margin falls by 20.0° per 100 ms. The loop loses its whole 53.08° margin when ω_c θ equals it in radians. At that edge the loop rings at the crossover frequency.

θcrit=53.08∘⋅π/1803.49 rad/s=0.265 s,Tosc≈2πωc=1.80 s\theta_{crit}=\frac{53.08^\circ\cdot\pi/180}{3.49\ \mathrm{rad/s}}=0.265\ \mathrm{s},\qquad T_{osc}\approx\frac{2\pi}{\omega_c}=1.80\ \mathrm{s}

Check against the engine

At 260 ms the engine's oscillation still shrinks: its largest error is 20.98 rad/s between 4 and 8 s and 18.65 rad/s between 8 and 12 s. At 270 ms it does not (30.59, then 30.95 rad/s). The workbench margin changes sign between them, 1.06° at 260 ms and −0.94° at 270 ms. At the lab's 300 ms the speed oscillates with a period of 1.85 s, between the 1.80 s estimate and the 2.04 s at which the phase now crosses −180°; with the voltage clipping, it is a limit cycle rather than a linear mode.

What to change next

  1. At 200 ms, halve only the integral gain (ki = 0.3).

    The PI zero ki/kp moves from 2.73 to 1.36 rad/s, further below crossover, so the controller adds less lag where it matters: predict a larger margin. The engine gives 36.14° at 2.99 rad/s, 20.29% overshoot and settling at 2.16 s, against 35.47% and 6.28 s with the original gains.

  2. At 200 ms, halve only P instead (kp = 0.11).

    Now the PI zero rises to 5.45 rad/s, above crossover, and the integrator's lag dominates there: predict a smaller margin, not a larger one. The engine gives 1.58° at 2.90 rad/s, 68.16% overshoot, and the speed never settles.

Common mistakes when reading this run

  • Lowering P to cope with a delay in a PI loop. It moves the PI zero up toward crossover and adds lag, as the second variation shows.
  • Looking for the delay in the Bode magnitude. Dead time changes only the phase, so the magnitude plot and the crossover stay put.
  • Treating the 300 ms menu entry as the limit. The edge is at 0.265 s; a design should keep a margin, not stop just short of it.

Where to go next

Run this experiment in the lab, pin a run and try the two changes above.

Lectures

Terms used in this note

Calculator

Bode plot calculator: Open this PI loop without the delay or the 20 ms hold in the Bode calculator: 54.30° of phase margin at 3.45 rad/s. Subtract ωθ from the phase by hand for any delay.