Nivaar Exam Prep

19-Soft-A4 Real-Time Systems · Paper printed May 2019

Question 4 of 6: Networked (Distributed) Control Loop — Protocol, Delay Effects and PI-Controller Stability Bound

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated

Notes on this paper

Note. Pages 3–4 print the same question stem three times side by side with only the supporting data table changed.

Reference texts: Jane W. S. Liu, Real-Time Systems (Prentice Hall, 2000) — task models, timing requirements, FCFS/EDF and priority scheduling; Giorgio C. Buttazzo, Hard Real-Time Computing Systems: Predictable Scheduling Algorithms and Applications (Springer, 3rd ed.) — preemptive fixed-priority and dynamic-priority scheduling; Hermann Kopetz, Real-Time Systems: Design Principles for Distributed Embedded Applications (Springer, 2nd ed.) — distributed real-time control, network-induced delay; Katsuhiko Ogata, Modern Control Engineering (Pearson, 5th ed.) — frequency-domain stability, phase margin, transport-lag systems; Ian Sommerville, Software Engineering (Pearson, 10th ed.) — general software-engineering process context.

Question 4: Networked (Distributed) Control Loop — Protocol, Delay Effects and PI-Controller Stability Bound (20%)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

[Figure not reproduced: Figure 2 — networked control loop: sensor, controller and actuator on separate nodes, joined by two links each modelled as a constant transport delay ($\tau_{sc}$, $\tau_{ca}$). See the official exam paper.]

(i) A network protocol fitting the constant-delay model. A Time-Triggered Protocol (TTP) (or, more generally, any TDMA-based fieldbus such as TTEthernet, FlexRay in its static segment, or CAN operated with a fixed, collision-free schedule) fits this model: each node is assigned a pre-computed time slot in a repeating schedule, so a message always departs at a scheduled instant and arrives after a fixed number of slot-widths — there is no contention, retransmission or queueing, so the sensor→controller and controller→actuator transport times are constant ($\tau_{sc}$, $\tau_{ca}$) by construction rather than only on average. (A best-effort protocol such as unscheduled Ethernet or CSMA/CD CAN would instead give a variable, load-dependent delay and would not match the constant-delay assumption stated in the problem.)

(ii) Effect of the network delay on closed-loop performance and stability. A pure transport delay $\tau$ contributes a frequency response $e^{-j\omega\tau}$ to the loop — unity magnitude at every frequency, but a phase lag of $-\omega\tau$ radians that grows linearly (and without bound) with frequency. Because it adds phase without adding magnitude, delay does not change the gain-crossover frequency $\omega_c$ (where $|L(j\omega_c)|=1$) but it subtracts phase margin at that frequency: $\text{PM}_{\text{with delay}} = \text{PM}_{\text{no delay}} - \omega_c\tau_{\text{rad}}$. Beyond a critical total delay $\tau_{\max}=\text{PM}_{\text{no delay}}/\omega_c$ (the delay margin), the phase margin is driven to zero and the closed loop becomes marginally, then actively, unstable — this is the mechanism by which $\tau=\tau_{sc}+\tau_{ca}$ degrades and can destroy stability even though it changes neither the plant $P(s)$ nor the controller $C(s)$ themselves.

(iii) Maximum PI gains at the given crossover frequency.

Approach. At marginal stability the loop's total phase at the crossover frequency $\omega_c$ must equal exactly $-180^{\circ}$ (phase margin = 0); solving that equation for the PI controller's phase contribution, together with the crossover magnitude condition $|C(j\omega_c)P(j\omega_c)|=1$, pins down the largest $(K_p,K_i)$ pair the design can use.

Check: the source gives $\omega_c = 0.5$ rad/s but does not state numeric values for the network delays $\tau_{sc}$, $\tau_{ca}$ or the plant $P(s)$ (the figure shows only the symbolic block diagram). To carry the method through to a numeric answer, this solution uses the representative, clearly-flagged assumption of an integrating plant $P(s)=1/s$ (a common simplified "process" model for this class of textbook problem, e.g. a rate-controlled actuator) and an illustrative total network delay $\tau=\tau_{sc}+\tau_{ca}=0.2\ \text{s}$ (0.1 s each way). The method below is fully general — substituting the exam's actual $P(s)$ and $\tau$ values (if recovered from a cleaner source) reproduces the same four-step derivation with different numbers.
  1. Phase from the plant and the delay at $\omega_c$. With $P(s)=1/s$: $\angle P(j\omega_c) = -90^{\circ}$ (constant at all frequencies). With $\tau=0.2\ \text{s}$: $$\angle(\text{delay}) = -\omega_c\tau \times \frac{180^{\circ}}{\pi} = -0.5\times0.2\times\frac{180^{\circ}}{\pi} = \boxed{-5.73^{\circ}}.$$
  2. Marginal-stability phase equation. The PI controller's phase is $\angle C(j\omega) = -\arctan\!\big(K_i/(K_p\omega)\big)$. Setting the total loop phase to $-180^{\circ}$: $$\angle C(j\omega_c) + \angle P(j\omega_c) + \angle(\text{delay}) = -180^{\circ} \;\Rightarrow\; \angle C(j\omega_c) = -180^{\circ}+90^{\circ}+5.73^{\circ} = \boxed{-84.27^{\circ}}.$$ So $\arctan\!\big(K_i/(K_p\,\omega_c)\big) = 84.27^{\circ} \Rightarrow K_i/K_p = \omega_c\tan(84.27^{\circ}) = 0.5\times9.967 = \boxed{4.983}$ — the largest integral-to-proportional-gain ratio the loop can tolerate at this $\omega_c$.
  3. Crossover magnitude condition. $|P(j\omega_c)| = 1/\omega_c = 2$, so $|C(j\omega_c)| = 1/|P(j\omega_c)| = \omega_c = 0.5$. With $|C(j\omega)|=\sqrt{K_p^2+(K_i/\omega)^2}$ and $K_i=4.983\,K_p$: $$\sqrt{K_p^2 + (4.983K_p/0.5)^2} = 0.5 \;\Rightarrow\; K_p\sqrt{1+4\times4.983^2} = 0.5 \;\Rightarrow\; \boxed{K_p \approx 0.0499}.$$
  4. Maximum integral gain. $$K_i = 4.983\times K_p = 4.983\times0.0499 = \boxed{0.2488}.$$ Check: total loop phase at $\omega_c$ with these gains works out to exactly $-180.0^{\circ}$ and $|C(j\omega_c)P(j\omega_c)|=1.000$ — the marginal-stability condition is satisfied. ✓
QuantityResult
Phase lag from delay at $\omega_c$−5.73°
Max. $K_i/K_p$ ratio4.98
Max. proportional gain, $K_{p,\max}$≈ 0.050 (illustrative $P(s)$, $\tau$)
Max. integral gain, $K_{i,\max}$≈ 0.249 (illustrative $P(s)$, $\tau$)