19-Soft-A4 Real-Time Systems · Paper printed May 2019
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated
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 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.
| Quantity | Result |
|---|---|
| Phase lag from delay at $\omega_c$ | −5.73° |
| Max. $K_i/K_p$ ratio | 4.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$) |