Level 3 — ProductionGuidance, Navigation & Control (GNC)

Guidance, Navigation & Control (GNC)

45 minutes60 marksprintable — key stays hidden on paper

Level: 3 — Production (from-scratch derivations, code-from-memory, explain-out-loud) Time limit: 45 minutes Total marks: 60

Answer all questions. Show every derivation step. Where code is requested, pseudocode or Python-style is acceptable but must be logically complete.


Question 1 — Quaternion kinematics from scratch (10 marks)

(a) State the unit quaternion constraint and give the quaternion kinematic equation q˙=12Ξ(q)ω\dot{q}=\tfrac{1}{2}\,\Xi(q)\,\omega, writing out the 4×34\times3 matrix Ξ(q)\Xi(q) explicitly for q=(q0,q1,q2,q3)q=(q_0,q_1,q_2,q_3). (4)

(b) Derive the scalar equation q˙0\dot{q}_0 in terms of q1,2,3q_{1,2,3} and ω=(ωx,ωy,ωz)\omega=(\omega_x,\omega_y,\omega_z). (3)

(c) Show that this kinematics preserves the norm, i.e. ddt(qq)=0\frac{d}{dt}(q^\top q)=0. (3)


Question 2 — Proportional navigation derivation (10 marks)

(a) Starting from the line-of-sight (LOS) geometry, derive the PN guidance law ac=NVcλ˙a_c = N\,V_c\,\dot\lambda, defining every symbol. (5)

(b) A missile closes on a target with closing velocity Vc=800 m/sV_c = 800\ \text{m/s}, LOS rate λ˙=0.02 rad/s\dot\lambda = 0.02\ \text{rad/s}, and navigation constant N=4N=4. Compute the commanded lateral acceleration and express it in units of gg (g=9.81g=9.81). (3)

(c) Explain in one or two sentences why NN is chosen in the range 3355 in practice. (2)


Question 3 — Kalman gain optimality (12 marks)

(a) Write the linear KF measurement update: posterior mean and covariance P+=(IKH)P(IKH)+KRKP^+ = (I-KH)P^-(I-KH)^\top + KRK^\top (Joseph form). (3)

(b) By minimizing tr(P+)\operatorname{tr}(P^+) with respect to KK, derive the optimal Kalman gain K=PH(HPH+R)1K = P^- H^\top (H P^- H^\top + R)^{-1}. Show the differentiation step. (6)

(c) Substitute the optimal KK back to show the simplified P+=(IKH)PP^+=(I-KH)P^-. (3)


Question 4 — DCM / gimbal lock (10 marks)

(a) Construct the 3-2-1 (yaw-pitch-roll) DCM C=R1(ϕ)R2(θ)R3(ψ)C = R_1(\phi)R_2(\theta)R_3(\psi) symbolically (write the product's entries in terms of s,cs_\bullet,c_\bullet). You may show the three elementary matrices and one representative product entry. (4)

(b) Give the standard formulas to extract ϕ,θ,ψ\phi,\theta,\psi from the DCM entries. (3)

(c) Explain mathematically why gimbal lock occurs at θ=±90\theta=\pm90^\circ — reference the specific DCM entries that become indeterminate. (3)


Question 5 — LQR / stability (8 marks)

(a) State the continuous-time algebraic Riccati equation (CARE) whose solution PP gives the LQR gain K=R1BPK=R^{-1}B^\top P. (3)

(b) For the scalar system x˙=ax+bu\dot x = a x + b u with cost weights q,rq,r, solve the scalar Riccati equation for P>0P>0 and give the closed-loop pole. Use a=0a=0, b=1b=1, q=1q=1, r=1r=1 to get numeric values. (5)


Question 6 — Code from memory: complementary filter (10 marks)

(a) Write pseudocode for a 1-axis complementary filter fusing gyro rate ω\omega (integrated) and accelerometer-derived angle θacc\theta_{acc}, with blend coefficient α\alpha and timestep dtdt. (5)

(b) Explain the frequency-domain interpretation: which sensor dominates at high frequency, which at low, and how α\alpha relates to the crossover time constant τ\tau. (3)

(c) State one advantage of a Kalman filter over the complementary filter for this task. (2)

Answer keyMark scheme & solutions

Question 1 (10)

(a) Unit constraint: q02+q12+q22+q32=1q_0^2+q_1^2+q_2^2+q_3^2=1. (1)

\Xi(q)=\begin{bmatrix}-q_1&-q_2&-q_3\\ q_0&-q_3&q_2\\ q_3&q_0&-q_1\\ -q_2&q_1&q_0\end{bmatrix}$$ *(1 for correct dimensions, 2 for correct entries; sign convention consistent with Hamilton/scalar-first.)* **(3)** **(b)** First row of $\Xi(q)\omega$: $$\dot q_0 = \tfrac12(-q_1\omega_x - q_2\omega_y - q_3\omega_z).$$ *Why:* it is the dot of the first $\Xi$ row with $\omega$, scaled by ½. **(3)** **(c)** $\frac{d}{dt}(q^\top q)=2q^\top\dot q = q^\top\Xi(q)\omega$. Because $q^\top\Xi(q)=0$ (each column of $\Xi$ is orthogonal to $q$ — verify: e.g. column 1 dotted with $q$ = $-q_0q_1+q_0q_1+q_3q_2-q_2q_3=0$), the norm derivative is zero. **(3)** --- ## Question 2 (10) **(a)** Define $r$ = range, $\lambda$ = LOS angle, $V_c=-\dot r$ = closing velocity, $N$ = navigation constant, $a_c$ = commanded acceleration ⟂ to LOS. PN commands acceleration proportional to the inertial LOS rotation rate: nulling $\dot\lambda$ makes the intercept triangle collinear (constant bearing, decreasing range → collision). Result: **(5)** $$\boxed{a_c = N\,V_c\,\dot\lambda}$$ **(b)** $a_c = 4\times800\times0.02 = 64\ \text{m/s}^2$. In g: $64/9.81 = 6.52\,g$. **(3)** **(c)** $N<3$ gives sluggish, large-miss response; $N>5$ amplifies noise/LOS-rate measurement errors and saturates actuators. $N\in[3,5]$ balances responsiveness vs. control effort/noise. **(2)** --- ## Question 3 (12) **(a)** $x^+ = x^- + K(z-Hx^-)$, and Joseph form: $P^+=(I-KH)P^-(I-KH)^\top+KRK^\top$. **(3)** **(b)** Expand: $$P^+ = P^- - KHP^- - P^-H^\top K^\top + K(HP^-H^\top+R)K^\top.$$ Let $S=HP^-H^\top+R$. Then $\frac{\partial}{\partial K}\operatorname{tr}(P^+) = -2P^-H^\top + 2KS = 0$ (using $\partial\operatorname{tr}(KA)/\partial K=A^\top$ and $\partial\operatorname{tr}(KSK^\top)/\partial K=2KS$ for symmetric $S$). **(4)** Solve: $KS = P^-H^\top \Rightarrow K = P^-H^\top S^{-1} = P^-H^\top(HP^-H^\top+R)^{-1}.$ **(2)** **(c)** Sub optimal $K$: $KRK^\top = KS K^\top - KHP^-H^\top K^\top$, and since $KS=P^-H^\top$, $KSK^\top = P^-H^\top K^\top$. Combine the Joseph expansion → cross terms cancel, leaving $$P^+ = P^- - KHP^- = (I-KH)P^-.$$ **(3)** --- ## Question 4 (10) **(a)** Elementary matrices (1 mark): $$R_3(\psi)=\begin{bmatrix}c_\psi&s_\psi&0\\-s_\psi&c_\psi&0\\0&0&1\end{bmatrix},\; R_2(\theta)=\begin{bmatrix}c_\theta&0&-s_\theta\\0&1&0\\s_\theta&0&c_\theta\end{bmatrix},\; R_1(\phi)=\begin{bmatrix}1&0&0\\0&c_\phi&s_\phi\\0&-s_\phi&c_\phi\end{bmatrix}$$ Product $C=R_1R_2R_3$: $$C=\begin{bmatrix} c_\theta c_\psi & c_\theta s_\psi & -s_\theta\\ s_\phi s_\theta c_\psi - c_\phi s_\psi & s_\phi s_\theta s_\psi + c_\phi c_\psi & s_\phi c_\theta\\ c_\phi s_\theta c_\psi + s_\phi s_\psi & c_\phi s_\theta s_\psi - s_\phi c_\psi & c_\phi c_\theta \end{bmatrix}$$ *(2 for correct top row, 1 for at least one correct lower entry.)* **(4)** **(b)** $\theta=-\arcsin(C_{13})$, $\phi=\operatorname{atan2}(C_{23},C_{33})$, $\psi=\operatorname{atan2}(C_{12},C_{11})$. **(3)** **(c)** At $\theta=\pm90^\circ$, $c_\theta=0$, so $C_{13}=\mp1$ but $C_{23},C_{33},C_{12},C_{11}$ all vanish (each carries a $c_\theta$ factor). The atan2 arguments become $0/0$ → $\phi$ and $\psi$ are individually indeterminate; only their sum/difference is defined (one rotational DoF lost). **(3)** --- ## Question 5 (8) **(a)** CARE: $A^\top P + P A - P B R^{-1} B^\top P + Q = 0$, then $K=R^{-1}B^\top P$. **(3)** **(b)** Scalar: $2aP - P^2 b^2/r + q = 0$. With $a=0,b=1,q=1,r=1$: $-P^2+1=0 \Rightarrow P=1$ (positive root). Gain $K=R^{-1}bP = 1$. Closed loop: $a_{cl}=a-bK=0-1=-1$ → pole at $s=-1$ (stable). **(5)** --- ## Question 6 (10) **(a)** **(5)** ``` theta = 0 loop each dt: theta_gyro = theta + omega * dt # integrate gyro theta = alpha * theta_gyro + (1-alpha) * theta_acc ``` *(gyro integration, accel blend, correct convex combination.)* **(b)** High-frequency: gyro dominates (integrates fast motion, no accel vibration noise). Low-frequency: accelerometer dominates (bounds gyro drift/bias). Crossover time constant $\tau = \dfrac{\alpha\,dt}{1-\alpha}$; large $\alpha$ → long $\tau$ → trust gyro longer. **(3)** **(c)** KF optimally weights sensors using their actual noise covariances (time-varying gain) and can estimate gyro bias as a state, whereas the complementary filter uses a fixed hand-tuned $\alpha$. **(2)** --- ```verify [ {"claim":"PN commanded accel = N*Vc*lambdadot = 64 m/s^2 and 6.52 g", "code":"ac=4*800*0.02; g=ac/9.81; result = (ac==64) and (abs(g-6.5239)<1e-2)"}, {"claim":"Scalar Riccati P=1, gain K=1, closed-loop pole -1", "code":"P=symbols('P',positive=True); sol=solve(Eq(2*0*P-P**2*1/1+1,0),P); Pv=[s for s in sol if s>0][0]; K=Pv; pole=0-1*K; result=(Pv==1) and (K==1) and (pole==-1)"}, {"claim":"Xi columns orthogonal to q so norm preserved (col1 . q =0)", "code":"q0,q1,q2,q3=symbols('q0 q1 q2 q3'); col1=Matrix([-q1,q0,q3,-q2]); qv=Matrix([q0,q1,q2,q3]); result = simplify((col1.T*qv)[0])==0"}, {"claim":"DCM top-left entry C11 = cos(theta)cos(psi)", "code":"ph,th,ps=symbols('phi theta psi'); R3=Matrix([[cos(ps),sin(ps),0],[-sin(ps),cos(ps),0],[0,0,1]]); R2=Matrix([[cos(th),0,-sin(th)],[0,1,0],[sin(th),0,cos(th)]]); R1=Matrix([[1,0,0],[0,cos(ph),sin(ph)],[0,-sin(ph),cos(ph)]]); C=R1*R2*R3; result=simplify(C[0,0]-cos(th)*cos(ps))==0"} ] ```