TExcelTAD
Home › Control Systems & Automation › Control Systems Exercises

Control Systems Exercises

These exercises follow the course in order. Work each one by hand first, with units on every number, then check it: the program at the end verifies several answers with python-control. Each answer links back to the lesson to revisit.

Feedback and modelling

1. Sensitivity to the plant gain. A unity-feedback loop has L(0)=50L(0) = 50. The plant's gain then drops by 20 %. By how much does the closed-loop DC gain change?

Answer

T(0)=50/51=0.9804T(0) = 50/51 = 0.9804 before, 40/41=0.975640/41 = 0.9756 after: a change of 0.49 %0.49\,\%, about 40 times smaller than the plant's 20 % (roughly 1/(1+L)1/(1 + L) of it). Review: Open and Closed Loop.

2. Mass, spring, damper. m=0.5 kgm = 0.5\ \text{kg}, ks=200 N/mk_s = 200\ \text{N/m}, c=4 N⋅s/mc = 4\ \text{N} \cdot \text{s/m}, force input, position output. Give the transfer function, ωn\omega_n and ζ\zeta.

Answer

XF=10.5s2+4s+200\frac{X}{F} = \frac{1}{0.5 s^2 + 4 s + 200}; ωn=200/0.5=20 rad/s\omega_n = \sqrt{200/0.5} = 20\ \text{rad/s}, ζ=c2ksm=420=0.2\zeta = \frac{c}{2\sqrt{k_s m}} = \frac{4}{20} = 0.2; DC gain 1/200=5 mm/N1/200 = 5\ \text{mm/N}. Review: Electrical and Mechanical Models.

3. A DC motor. Ra=1 ΩR_a = 1\ \Omega, k=0.05 V⋅s/radk = 0.05\ \text{V} \cdot \text{s/rad}, J=10−4 kg⋅m2J = 10^{-4}\ \text{kg} \cdot \text{m}^2, negligible friction and inductance. Give the mechanical time constant and the no-load speed at 24 V24\ \text{V}.

Answer

τm=JRak2=10−40.0025=40 ms\tau_m = \frac{J R_a}{k^2} = \frac{10^{-4}}{0.0025} = 40\ \text{ms}; ω=V/k=480 rad/s\omega = V/k = 480\ \text{rad/s} (4580 rpm4580\ \text{rpm}). Review: Modelling a DC Motor.

4. A heated block. Heat capacity 200 J/K200\ \text{J/K}, thermal resistance to the room 2 K/W2\ \text{K/W}. Time constant, and the final rise with 10 W10\ \text{W}?

Answer

τ=RC=400 s\tau = RC = 400\ \text{s}; ΔT=10×2=20 K\Delta T = 10 \times 2 = 20\ \text{K}. Review: Thermal and Fluid Systems.

5. Linearising a tank. A tank of area 0.5 m20.5\ \text{m}^2 drains through a valve with qout=0.01h m3/sq_\text{out} = 0.01\sqrt{h}\ \text{m}^3\text{/s} (hh in m). Linearise about h0=1 mh_0 = 1\ \text{m}: time constant and gain from inflow to level.

Answer

∂qout∂h=0.012h0=0.005 m2/s\frac{\partial q_\text{out}}{\partial h} = \frac{0.01}{2\sqrt{h_0}} = 0.005\ \text{m}^2\text{/s}, so A δh˙=δqin−0.005 δhA\,\dot{\delta h} = \delta q_\text{in} - 0.005\,\delta h: τ=0.5/0.005=100 s\tau = 0.5/0.005 = 100\ \text{s}, gain 1/0.005=200 m per m3/s1/0.005 = 200\ \text{m per m}^3\text{/s} (a 1 L/s1\ \text{L/s} increase raises the level by 0.2 m0.2\ \text{m}). Review: Linearisation.

Transfer functions and block diagrams

6. One loop. G(s)=10s+1G(s) = \frac{10}{s + 1} in the forward path, H=0.5H = 0.5 in the feedback path (negative feedback). Closed-loop transfer function, DC gain and time constant?

Answer

G1+GH=10s+6\frac{G}{1 + GH} = \frac{10}{s + 6}: DC gain 1.671.67, τ=0.167 s\tau = 0.167\ \text{s}. Review: Block-Diagram Algebra.

7. Nested loops. G1G_1 and G2G_2 in series, an inner feedback H2H_2 around G2G_2 and an outer feedback H1H_1 from the output to the input summing junction. Give Y/RY/R by Mason's rule.

Answer

One forward path P1=G1G2P_1 = G_1 G_2; loops −G2H2-G_2 H_2 and −G1G2H1-G_1 G_2 H_1, which touch each other and the path, so Δ=1+G2H2+G1G2H1\Delta = 1 + G_2 H_2 + G_1 G_2 H_1 and Δ1=1\Delta_1 = 1: YR=G1G21+G2H2+G1G2H1\frac{Y}{R} = \frac{G_1 G_2}{1 + G_2 H_2 + G_1 G_2 H_1}. Review: Signal-Flow Graphs and Mason's Rule.

Time response and steady-state error

8. First order. G(s)=52s+1G(s) = \frac{5}{2 s + 1}, input step of 33. Final value, time to 63 %, 2 % settling time?

Answer

1515; 2 s2\ \text{s}; τln⁡50=7.82 s\tau\ln 50 = 7.82\ \text{s} (about 4τ4\tau). Review: First-Order Systems.

9. Second order. ωn=10 rad/s\omega_n = 10\ \text{rad/s}, ζ=0.4\zeta = 0.4. Overshoot, peak time, 2 % settling estimate?

Answer

e−πζ/1−ζ2=25.4 %e^{-\pi\zeta/\sqrt{1 - \zeta^2}} = 25.4\,\%; tp=πωn1−ζ2=0.343 st_p = \frac{\pi}{\omega_n\sqrt{1 - \zeta^2}} = 0.343\ \text{s}; ts≈4ζωn=1.0 st_s \approx \frac{4}{\zeta\omega_n} = 1.0\ \text{s}. Review: Second-Order Systems.

10. Dominant poles. Closed-loop poles at −2±j3-2 \pm j3 and −20-20, DC gain 1. Which poles dominate, and what overshoot do you expect?

Answer

The pair: −20-20 is 10 times farther left. ζ=2/13=0.555\zeta = 2/\sqrt{13} = 0.555, overshoot about e−π⋅0.555/0.832=12.3 %e^{-\pi \cdot 0.555/0.832} = 12.3\,\% (the far pole lowers it slightly). Review: Higher-Order Systems.

11. System type. L(s)=20s(s+5)L(s) = \frac{20}{s(s + 5)} with unity feedback. Steady-state error to a unit step and to a unit ramp?

Answer

Type 1: step error 0; Kv=lim⁡s→0sL=4 s−1K_v = \lim_{s \to 0} sL = 4\ \text{s}^{-1}, ramp error 1/Kv=0.251/K_v = 0.25. Review: Steady-State Error.

Stability and root locus

12. Routh–Hurwitz. For which KK is s3+4s2+5s+Ks^3 + 4s^2 + 5s + K stable, and at what frequency does it oscillate at the limit?

Answer

Row s1s^1: (20−K)/4>0(20 - K)/4 > 0 and K>0K > 0: 0<K<200 < K < 20. At K=20K = 20 the auxiliary polynomial 4s2+204s^2 + 20 gives ω=5=2.24 rad/s\omega = \sqrt{5} = 2.24\ \text{rad/s}. Review: Stability and Routh–Hurwitz.

13. Root-locus sketch. L(s)=Ks(s+2)(s+4)L(s) = \frac{K}{s(s + 2)(s + 4)}. Asymptotes, breakaway point, and the gain and frequency where the locus crosses the imaginary axis.

Answer

Centroid (0−2−4)/3=−2(0 - 2 - 4)/3 = -2, angles ±60∘\pm 60^\circ and 180∘180^\circ. Breakaway from 3s2+12s+8=03s^2 + 12s + 8 = 0 on the segment between 0 and −2-2: s=−0.845s = -0.845. Characteristic polynomial s3+6s2+8s+Ks^3 + 6s^2 + 8s + K: crossing at K=48K = 48, ω=8=2.83 rad/s\omega = \sqrt{8} = 2.83\ \text{rad/s}. Review: Root-Locus Rules.

14. Design by root locus. L(s)=Ks(s+4)L(s) = \frac{K}{s(s + 4)}. Which KK gives ζ=0.5\zeta = 0.5, and what are ωn\omega_n and the overshoot?

Answer

s2+4s+Ks^2 + 4s + K: 2ζωn=42\zeta\omega_n = 4 with ζ=0.5\zeta = 0.5 gives ωn=4 rad/s\omega_n = 4\ \text{rad/s}, K=16K = 16; overshoot 16.3 %16.3\,\%. Review: Design with the Root Locus.

Frequency response and compensation

15. Crossover and phase margin. L(s)=100s(s+10)L(s) = \frac{100}{s(s + 10)}. Find ωc\omega_c and the phase margin.

Answer

ω2(ω2+100)=104\omega^2(\omega^2 + 100) = 10^4 gives ω2=61.8\omega^2 = 61.8, ωc=7.86 rad/s\omega_c = 7.86\ \text{rad/s}; PM=180∘−90∘−arctan⁡(0.786)=51.8∘\text{PM} = 180^\circ - 90^\circ - \arctan(0.786) = 51.8^\circ. Review: Bode Plots of the Loop.

16. Nyquist with an unstable plant. L(s)=Ks−1L(s) = \frac{K}{s - 1}. For which K>0K > 0 is the unity-feedback loop stable, and how does the Nyquist plot show it?

Answer

P=1P = 1 open-loop pole in the right half-plane, so the plot must encircle −1-1 once counter-clockwise. L(jω)L(j\omega) is a circle from −K-K (at ω=0\omega = 0) to the origin, which encircles −1-1 once when K>1K > 1. Closed loop: s−1+Ks - 1 + K, stable for K>1K > 1. Review: The Nyquist Criterion.

17. Delay margin. A loop crosses over at 2 rad/s2\ \text{rad/s} with a phase margin of 50∘50^\circ. What added delay makes it unstable?

Answer

50∘=0.873 rad50^\circ = 0.873\ \text{rad}; a delay adds −ωτ-\omega\tau rad: τ=0.873/2=0.436 s\tau = 0.873/2 = 0.436\ \text{s}. Review: Stability Margins.

18. Lead compensator. You need 40∘40^\circ of extra phase at ωm=10 rad/s\omega_m = 10\ \text{rad/s} from C(s)=Ts+1αTs+1C(s) = \frac{T s + 1}{\alpha T s + 1}. Find α\alpha, TT and the gain the compensator adds at ωm\omega_m.

Answer

α=1−sin⁡40∘1+sin⁡40∘=0.217\alpha = \frac{1 - \sin 40^\circ}{1 + \sin 40^\circ} = 0.217; T=1ωmα=0.214 sT = \frac{1}{\omega_m\sqrt{\alpha}} = 0.214\ \text{s} (zero at 4.664.66, pole at 21.4 rad/s21.4\ \text{rad/s}); gain at ωm\omega_m: 1/α=2.141/\sqrt{\alpha} = 2.14 (6.6 dB6.6\ \text{dB}), which moves the crossover, so iterate. Review: Lead Compensation.

19. Lag compensator. A loop meets its phase margin with ωc=5 rad/s\omega_c = 5\ \text{rad/s} but needs 10 times more low-frequency gain. Sketch a lag compensator.

Answer

C(s)=Ts+1βTs+1C(s) = \frac{T s + 1}{\beta T s + 1} with β=10\beta = 10 and the zero a decade below crossover, 1/T=0.5 rad/s1/T = 0.5\ \text{rad/s} (T=2 sT = 2\ \text{s}, pole at 0.05 rad/s0.05\ \text{rad/s}), then multiply the controller gain by 10. It costs about 5∘5^\circ of phase at ωc\omega_c. Review: Lag and Lead-Lag Compensation.

PID control

20. Ziegler–Nichols from a relay test. A relay test gives Ku=8K_u = 8 and Pu=3.63 sP_u = 3.63\ \text{s}. Give the classic PID settings.

Answer

Kp=0.6Ku=4.8K_p = 0.6K_u = 4.8, Ti=Pu/2=1.82 sT_i = P_u/2 = 1.82\ \text{s}, Td=Pu/8=0.454 sT_d = P_u/8 = 0.454\ \text{s}. Expect a lively loop (quarter-decay intent). Review: Ziegler–Nichols Methods, Nonlinearities for the relay test.

21. Lambda tuning. FOPDT model K=2K = 2, T=50 sT = 50\ \text{s}, θ=5 s\theta = 5\ \text{s}; you want a closed-loop time constant λ=20 s\lambda = 20\ \text{s}. Give the PI.

Answer

Kp=TK(λ+θ)=502×25=1.0K_p = \frac{T}{K(\lambda + \theta)} = \frac{50}{2 \times 25} = 1.0, Ti=T=50 sT_i = T = 50\ \text{s}. Review: Model-Based Tuning.

22. Derivative filter. A PID has Kp=3K_p = 3, Td=2 sT_d = 2\ \text{s} and a derivative filter with N=10N = 10. Filter time constant and high-frequency gain of the D term?

Answer

Tf=Td/N=0.2 sT_f = T_d/N = 0.2\ \text{s}; at high frequency the D term gives KpN=30K_p N = 30 instead of growing without limit. Review: Practical PID.

23. Windup. A PI heater loop starts with a 25 K25\ \text{K} error and the heater saturates at full power for 200 s200\ \text{s}; Ki=0.02 W/(K⋅s)K_i = 0.02\ \text{W/(K} \cdot \text{s)}. Roughly how much does an unprotected integrator accumulate if the error averages 15 K15\ \text{K} in that time, and why is that a problem?

Answer

0.02×15×200=60 W0.02 \times 15 \times 200 = 60\ \text{W} of integral, four times the heater's range: after the setpoint is reached the integral must unwind through a long period of negative error, i.e. a large overshoot. Clamping or back-calculation stops it. Review: Anti-Windup.

State space

24. Pole placement. A=[01−2−3]A = \begin{bmatrix} 0 & 1 \\ -2 & -3 \end{bmatrix}, B=[ 0, 1 ]TB = [\,0,\ 1\,]^T. Find KK for poles at −4±j4-4 \pm j4.

Answer

det⁡(sI−A+BK)=s2+(3+k2)s+(2+k1)\det(sI - A + BK) = s^2 + (3 + k_2)s + (2 + k_1); desired s2+8s+32s^2 + 8s + 32: K=[ 30, 5 ]K = [\,30,\ 5\,]. Review: Pole Placement.

25. Observer. Same AA, C=[ 1, 0 ]C = [\,1,\ 0\,]. Find LL for both observer poles at −10-10.

Answer

det⁡(sI−A+LC)=s2+(3+l1)s+(2+3l1+l2)\det(sI - A + LC) = s^2 + (3 + l_1)s + (2 + 3l_1 + l_2); desired s2+20s+100s^2 + 20s + 100: l1=17l_1 = 17, l2=47l_2 = 47. Review: Observers.

26. Scalar LQR. x˙=x+u\dot{x} = x + u (unstable), Q=3Q = 3, R=1R = 1. Solve the Riccati equation.

Answer

2P−P2+3=02P - P^2 + 3 = 0, P=3P = 3 (the positive root), K=3K = 3, closed-loop pole 1−3=−21 - 3 = -2. Review: LQR.

27. Controllability. Is the pair in exercise 24 controllable? Is (A,C)(A, C) with C=[ 1, 1 ]C = [\,1,\ 1\,] observable?

Answer

[ B  AB ]=[011−3][\,B\ \ AB\,] = \begin{bmatrix} 0 & 1 \\ 1 & -3 \end{bmatrix}, rank 2: yes. [CCA]=[11−2−2]\begin{bmatrix} C \\ CA \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ -2 & -2 \end{bmatrix}, rank 1: no. The mode at s=−1s = -1 (eigenvector [ 1, −1 ]T[\,1,\ -1\,]^T) is invisible to y=x1+x2y = x_1 + x_2. Review: Controllability and Observability.

Digital control

28. ZOH discretisation. Discretise G(s)=1s+1G(s) = \frac{1}{s + 1} with a zero-order hold at Ts=0.1 sT_s = 0.1\ \text{s}.

Answer

G(z)=1−e−0.1z−e−0.1=0.0952z−0.9048G(z) = \frac{1 - e^{-0.1}}{z - e^{-0.1}} = \frac{0.0952}{z - 0.9048}: the pole maps by z=esTsz = e^{sT_s}. Review: Sampled-Data Loops.

29. A discrete PI. Write the update for u[k]u[k] of a PI with Kp=2K_p = 2, Ki=0.5 s−1K_i = 0.5\ \text{s}^{-1}, Ts=0.1 sT_s = 0.1\ \text{s} (backward-Euler integral), and compute the first three outputs for a constant error e=1e = 1.

Answer

I[k]=I[k−1]+KiTse[k]I[k] = I[k-1] + K_i T_s e[k], u[k]=Kpe[k]+I[k]u[k] = K_p e[k] + I[k]: u=2.05,2.10,2.15u = 2.05, 2.10, 2.15. Review: Discrete PID.

30. z-plane stability. Is G(z)=0.5z2−1.2z+0.5G(z) = \frac{0.5}{z^2 - 1.2z + 0.5} stable?

Answer

Poles 0.6±j0.3740.6 \pm j0.374, ∣z∣=0.5=0.707<1\lvert z \rvert = \sqrt{0.5} = 0.707 < 1: stable. Review: Design in the z-Plane.

Nonlinearities, structures and automation

31. Relay limit cycle. A ±5 V\pm 5\ \text{V} relay drives a plant with ∣G∣=0.2\lvert G \rvert = 0.2 at its phase crossover. Predicted oscillation amplitude?

Answer

A=4M∣G∣π=4×5×0.2π=1.27A = \frac{4M\lvert G \rvert}{\pi} = \frac{4 \times 5 \times 0.2}{\pi} = 1.27. Review: Nonlinearities.

32. Cascade. An outer temperature loop has a bandwidth of 0.02 rad/s0.02\ \text{rad/s}. What bandwidth should an inner heater-power loop have?

Answer

At least 3 to 10 times faster: 0.060.06 to 0.2 rad/s0.2\ \text{rad/s} or more (a power loop is usually far faster anyway). Review: Cascade, Feedforward and Ratio Control.

33. 4–20 mA. A level transmitter spans 0–4 m0\text{–}4\ \text{m}. What does 9 mA9\ \text{mA} mean, and what current corresponds to 3 m3\ \text{m}?

Answer

(9−4)/16×4=1.25 m(9 - 4)/16 \times 4 = 1.25\ \text{m}; 4+16×3/4=16 mA4 + 16 \times 3/4 = 16\ \text{mA}. Review: Sensors and Actuators.

34. Scan time. A PLC scans every 5 ms5\ \text{ms} with a 2 ms2\ \text{ms} input filter and 0.5 ms0.5\ \text{ms} output delay. Worst-case response, and which pulses can it miss?

Answer

2+2×5+0.5=12.5 ms2 + 2 \times 5 + 0.5 = 12.5\ \text{ms}; pulses shorter than 5 ms5\ \text{ms} can be missed. Review: PLCs and the Scan Cycle.

35. Ladder to text. Write in Structured Text: the fan runs when the temperature switch is on or the manual switch is on, but never when the door is open (Door_Closed is TRUE when closed).

Answer

Fan := (Temp_Switch OR Manual) AND Door_Closed; Review: IEC 61131-3 Languages.

36. Probability of failure on demand. A 1oo1 trip with λDU=10−6 h−1\lambda_{DU} = 10^{-6}\ \text{h}^{-1} is proof-tested every two years. PFDavg\text{PFD}_\text{avg} and SIL band?

Answer

10−6×17 520/2=8.76×10−310^{-6} \times 17\,520/2 = 8.76 \times 10^{-3}, between 10−310^{-3} and 10−210^{-2}: the SIL 2 band by PFD alone, close to its upper edge (architectural constraints may limit the claim). Review: Interlocks, Safety PLCs, SCADA.

37. Starting current (calculation only). A motor with In=20 AI_n = 20\ \text{A} draws 6 times InI_n direct on line. Line current with star-delta starting?

Answer

120/3=40 A120/3 = 40\ \text{A}, with one third of the torque. Review: Motor Control.

Check several answers in Python

python · try it yourself
import numpy as np
import control as ct

print(f"11: Kv = {ct.dcgain(ct.tf([20], [1, 5])):.2f} 1/s, ramp error {1 / 4:.2f}")
print("12: poles at K = 20:", np.round(np.roots([1, 4, 5, 20]), 3))
print("13: poles at K = 48:", np.round(np.roots([1, 6, 8, 48]), 3))
gm, pm, wpc, wgc = ct.margin(ct.tf([100], [1, 10, 0]))
print(f"15: crossover {wgc:.3f} rad/s, phase margin {pm:.1f} deg")
A = np.array([[0, 1], [-2, -3]]); B = np.array([[0], [1]]); C = np.array([[1, 0]])
print("24: K =", np.round(ct.place(A, B, [-4 + 4j, -4 - 4j]), 3))
print("25: L =", np.round(ct.acker(A.T, C.T, [-10, -10]).T.ravel(), 3))
K, P, E = ct.lqr(np.array([[1.0]]), np.array([[1.0]]), 3.0, 1.0)
print(f"26: K = {K.item():.3f}, closed-loop pole {E.real.item():.3f}")
Gz = ct.c2d(ct.tf([1], [1, 1]), 0.1, method="zoh")
print(f"28: G(z) = {Gz.num[0][0][0]:.4f} / (z - {-Gz.den[0][0][1]:.4f})")
print("30: |poles| =", np.round(np.abs(np.roots([1, -1.2, 0.5])), 4))
11: Kv = 4.00 1/s, ramp error 0.25
12: poles at K = 20: [-4.+0.j     0.+2.236j  0.-2.236j]
13: poles at K = 48: [-6.+0.j     0.+2.828j  0.-2.828j]
15: crossover 7.862 rad/s, phase margin 51.8 deg
24: K = [[30.  5.]]
25: L = [17. 47.]
26: K = 3.000, closed-loop pole -2.000
28: G(z) = 0.0952 / (z - 0.9048)
30: |poles| = [0.7071 0.7071]

Test yourself

A unity-feedback loop with L(s)=Ks(s+4)L(s) = \frac{K}{s(s + 4)} has ζ=0.5\zeta = 0.5 when KK is

  1. 4
  2. 8
  3. 16
  4. 32

A loop with a 50∘50^\circ phase margin at ωc=2 rad/s\omega_c = 2\ \text{rad/s} tolerates an extra delay of about

  1. 0.044 s0.044\ \text{s}
  2. 0.44 s0.44\ \text{s}
  3. 25 s25\ \text{s}
  4. 1.57 s1.57\ \text{s}

The ZOH discretisation of 1s+1\frac{1}{s + 1} at Ts=0.1 sT_s = 0.1\ \text{s} has its pole at

  1. z=−1z = -1
  2. z=0.9z = 0.9
  3. z=e−0.1=0.905z = e^{-0.1} = 0.905
  4. z=1.105z = 1.105

Classic Ziegler–Nichols PID from Ku=8K_u = 8, Pu=3.63 sP_u = 3.63\ \text{s} gives KpK_p =

  1. 3.6
  2. 4.0
  3. 4.8
  4. 8.0