Level 5 — MasteryGuidance, Navigation & Control (GNC)

Guidance, Navigation & Control (GNC)

3 minutes100 marksprintable — key stays hidden on paper

Level: 5 — Mastery (cross-domain: math + physics + coding, build/prove, open-ended) Time limit: 3 hours Total marks: 100

Instructions: Answer all three questions. Show all derivations. Where code is requested, pseudocode or Python/NumPy is acceptable but must be dimensionally and algorithmically correct. State all assumptions.


Question 1 — Attitude Kinematics, Quaternions & Gimbal Lock (34 marks)

A spacecraft has body angular velocity (rad/s) measured in the body frame: ω=[0.100.200.05].\boldsymbol{\omega} = \begin{bmatrix} 0.10 \\ -0.20 \\ 0.05 \end{bmatrix}.

(a) Starting from the definition of the direction cosine matrix CC (body-from-inertial) and the requirement that a body-fixed vector has constant components, derive the DCM kinematic equation C˙=[ω×]C\dot C = -[\boldsymbol{\omega}\times]C. Explicitly justify the sign. (6)

(b) Write the quaternion kinematic equation q˙=12Ξ(q)ω\dot{\mathbf q} = \tfrac12 \Xi(\mathbf q)\,\boldsymbol\omega in full component form for the scalar-first convention q=(q0,q1,q2,q3)\mathbf q = (q_0,q_1,q_2,q_3). Prove that this kinematics preserves the unit-norm constraint q=1\|\mathbf q\| = 1 (i.e. ddtq2=0\frac{d}{dt}\|\mathbf q\|^2 = 0). (8)

(c) For the 3-2-1 (yaw–pitch–roll) Euler sequence, the body-rate to Euler-rate map is [ϕ˙θ˙ψ˙]=1cosθ[cosθsinϕsinθcosϕsinθ0cosϕcosθsinϕcosθ0sinϕcosϕ]ω.\begin{bmatrix}\dot\phi\\\dot\theta\\\dot\psi\end{bmatrix} = \frac{1}{\cos\theta}\begin{bmatrix} \cos\theta & \sin\phi\sin\theta & \cos\phi\sin\theta \\ 0 & \cos\phi\cos\theta & -\sin\phi\cos\theta \\ 0 & \sin\phi & \cos\phi \end{bmatrix}\boldsymbol\omega . Explain quantitatively what happens at θ=±90\theta = \pm 90^\circ (gimbal lock): identify the singular quantity, show which Euler rates diverge, and state which physical rotational degree of freedom becomes unobservable in Euler-angle space. (6)

(d) Given the current attitude quaternion q(0)=(1,0,0,0)\mathbf q(0) = (1,0,0,0) and the ω\boldsymbol\omega above (assumed constant), write a self-contained code routine that propagates q\mathbf q for T=10 sT = 10\text{ s} using RK4 with step h=0.01h = 0.01 s, renormalizing each step, and returns the final quaternion and the equivalent 3-2-1 Euler angles. State the exact analytic final quaternion (rotation about the fixed axis ω^\hat{\boldsymbol\omega}) and use it to argue your code is correct. (8)

(e) Modified Rodrigues Parameters (MRP) are σ=e^tan(Φ/4)\boldsymbol\sigma = \hat{\mathbf e}\tan(\Phi/4) for principal rotation angle Φ\Phi. State the value of Φ\Phi at which the standard MRP set becomes singular, and describe the shadow-set switching rule that keeps the representation bounded. (6)


Question 2 — INS/GPS Sensor Fusion & Kalman Filtering (34 marks)

Consider a 1-D inertial navigation problem: a vehicle moves along one axis. An accelerometer measures specific force am=a+b+waa_m = a + b + w_a where bb is a slowly-varying bias (random walk) and waw_a is white noise. A GPS receiver provides noisy position fixes.

State vector: x=[p, v, b]\mathbf x = [p,\ v,\ b]^\top (position, velocity, accelerometer bias).

(a) Write the continuous-time INS mechanization / error model in state-space form x˙=Ax+Bu+Gw\dot{\mathbf x} = A\mathbf x + B u + G\mathbf w, treating the measured acceleration input as u=amu = a_m and the bias as a random-walk driven by process noise. Give AA, BB, GG explicitly. (6)

(b) GPS measures position: z=p+νz = p + \nu, νN(0,R)\nu\sim\mathcal N(0,R). Write HH. Test observability of the pair (A,H)(A,H) using the observability matrix rank test. Is the accelerometer bias bb observable from position measurements alone? Prove your answer. (8)

(c) Derive the Kalman gain KkK_k from first principles as the matrix that minimizes tr(Pk+)\operatorname{tr}(P_k^+), the trace of the a-posteriori covariance, starting from the standard update xk+=xk+Kk(zkHxk)\mathbf x_k^+ = \mathbf x_k^- + K_k(z_k - H\mathbf x_k^-) and the Joseph-form covariance. Show Kk=PkH(HPkH+R)1K_k = P_k^- H^\top (HP_k^-H^\top + R)^{-1}. (10)

(d) A complementary filter blends a high-rate integrated-IMU estimate with low-rate GPS. Write the scalar complementary-filter transfer functions from (i) true signal and (ii) each sensor to the output, and show the two sensor paths sum to unity across all frequencies. Explain in one line why the crossover frequency is chosen near the point where IMU drift power equals GPS noise power. (6)

(e) State the separation principle (LQG) precisely and explain why observability (part b) and controllability are the two conditions that make an LQG controller well-posed. (4)


Question 3 — Control Design & Proportional Navigation Guidance (32 marks)

A single-axis rocket pitch model (rigid, thrust-vector-controlled) linearizes to the double-integrator-with-instability plant: θ¨=kδ,G(s)=ks2,\ddot\theta = k\,\delta,\qquad G(s) = \frac{k}{s^2}, where θ\theta is pitch angle, δ\delta is the TVC gimbal angle command, and k=4.0 s2k = 4.0\ \text{s}^{-2}.

(a) Design a PD controller δ=(Kpθ+Kdθ˙)\delta = -(K_p\theta + K_d\dot\theta) to place the closed-loop poles at s=2±2js = -2 \pm 2j. Solve for Kp,KdK_p, K_d. Give the resulting undamped natural frequency ωn\omega_n and damping ratio ζ\zeta. (8)

(b) Put the closed-loop system in state-space form with x=[θ,θ˙]\mathbf x = [\theta,\dot\theta]^\top, write AclA_{cl}, compute its eigenvalues, and confirm they match (a). Then propose a Lyapunov function V=xPxV = \mathbf x^\top P \mathbf x and state the condition on PP that proves asymptotic stability. (8)

(c) The real TVC actuator has finite bandwidth modelled as a first-order lag δactδcmd=1τs+1\frac{\delta_{act}}{\delta_{cmd}}=\frac{1}{\tau s+1} with τ=0.05\tau = 0.05 s, plus a pure transport delay etdse^{-t_d s}, td=0.02t_d = 0.02 s. For the PD-compensated loop, estimate the phase margin degradation contributed by the lag and delay at the gain-crossover frequency ωc2.8\omega_c \approx 2.8 rad/s. Comment on stability-margin risk. (8)

(d) Derive proportional navigation guidance: for a constant-bearing collision geometry, show the commanded lateral acceleration is ac=NVcλ˙a_c = N V_c \dot\lambda, defining every symbol. Explain the geometric meaning of "driving λ˙0\dot\lambda \to 0" and state the typical range of the navigation constant NN. Then state the augmentation term added for a maneuvering/gravity target and why. (8)


Answer keyMark scheme & solutions

Question 1

(a) DCM kinematics derivation (6)

  • A vector rB=CrI\mathbf r_B = C\,\mathbf r_I fixed in the body has constant body components: r˙B=0\dot{\mathbf r}_B = 0 when expressed... more carefully: for a vector fixed in inertial space, rI\mathbf r_I const, and rB=CrI\mathbf r_B = C\mathbf r_I, so r˙B=C˙rI\dot{\mathbf r}_B = \dot C \mathbf r_I. (1)
  • Physically, in the body frame an inertially-fixed vector appears to rotate with ω-\boldsymbol\omega (relative rotation), so r˙B=ω×rB=[ω×]rB\dot{\mathbf r}_B = -\boldsymbol\omega\times\mathbf r_B = -[\boldsymbol\omega\times]\mathbf r_B. (2)
  • Substitute rB=CrI\mathbf r_B = C\mathbf r_I: C˙rI=[ω×]CrI\dot C\mathbf r_I = -[\boldsymbol\omega\times]C\mathbf r_I for all rI\mathbf r_I. (2)
  • Hence C˙=[ω×]C\dot C = -[\boldsymbol\omega\times]C. The minus sign arises because CC maps inertial→body and the body sees inertial vectors rotate the opposite way to the body's own rotation. (1)

(b) Quaternion kinematics + norm preservation (8) Component form (scalar-first): q˙=12[q1q2q3q0q3q2q3q0q1q2q1q0][ω1ω2ω3].\dot{\mathbf q} = \tfrac12\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}\begin{bmatrix}\omega_1\\\omega_2\\\omega_3\end{bmatrix}. (4) Norm proof: ddtq2=2qq˙=qΞ(q)ω\frac{d}{dt}\|\mathbf q\|^2 = 2\mathbf q^\top\dot{\mathbf q} = \mathbf q^\top\Xi(\mathbf q)\boldsymbol\omega. (2) The key identity qΞ(q)=0\mathbf q^\top\Xi(\mathbf q) = \mathbf 0^\top: the four rows of Ξ\Xi^\top dotted with q\mathbf q each give q1q0+q0q1+q3q2q2q3=0-q_1q_0+q_0q_1+q_3q_2-q_2q_3=0, etc. (each column of Ξ\Xi is orthogonal to q\mathbf q). Hence ddtq2=0\frac{d}{dt}\|\mathbf q\|^2 = 0. (2)

(c) Gimbal lock (6)

  • The map contains 1/cosθ1/\cos\theta; at θ=±90\theta=\pm90^\circ, cosθ=0\cos\theta=0, so the matrix is singular. (2)
  • ϕ˙\dot\phi and ψ˙\dot\psi terms diverge (blow up) because they carry 1/cosθ1/\cos\theta factors; only θ˙\dot\theta stays finite. (2)
  • At θ=90\theta=90^\circ the roll and yaw axes become collinear — one rotational DOF is lost in the representation; ϕ\phi and ψ\psi become indistinguishable (only their sum/difference is defined). The physical DOF still exists but is unobservable in Euler coordinates. (2)

(d) RK4 quaternion propagation (8) Analytic result: constant ω\boldsymbol\omega ⇒ rotation about fixed axis ω^\hat{\boldsymbol\omega} by angle Φ=ωT\Phi=\|\boldsymbol\omega\|T. ω=0.01+0.04+0.0025=0.0525=0.229129 rad/s\|\boldsymbol\omega\|=\sqrt{0.01+0.04+0.0025}=\sqrt{0.0525}=0.229129\text{ rad/s}; Φ=2.29129\Phi=2.29129 rad. q0=cos(Φ/2)=cos(1.145644)=0.41155q_0=\cos(\Phi/2)=\cos(1.145644)=0.41155; vector part =sin(Φ/2)ω^=0.91138×(0.10,0.20,0.05)/0.229129=\sin(\Phi/2)\,\hat{\boldsymbol\omega}=0.91138\times(0.10,-0.20,0.05)/0.229129. ω^=(0.436436,0.872872,0.218218)\hat{\boldsymbol\omega}=(0.436436,-0.872872,0.218218); vector part =(0.39781,0.79562,0.19891)=(0.39781,-0.79562,0.19891). So q(10)(0.4116, 0.3978, 0.7956, 0.1989)\mathbf q(10)\approx(0.4116,\ 0.3978,\ -0.7956,\ 0.1989). (3)

import numpy as np
def Xi(q):
    q0,q1,q2,q3=q
    return 0.5*np.array([[-q1,-q2,-q3],[q0,-q3,q2],
                         [q3,q0,-q1],[-q2,q1,q0]])
def qdot(q,w): return Xi(q)@w
def propagate(q0,w,T=10.0,h=0.01):
    q=np.array(q0,float); n=int(T/h)
    for _ in range(n):
        k1=qdot(q,w); k2=qdot(q+h/2*k1,w)
        k3=qdot(q+h/2*k2,w); k4=qdot(q+h*k3,w)
        q=q+h/6*(k1+2*k2+2*k3+k4); q/=np.linalg.norm(q)
    return q
def quat_to_euler321(q):
    q0,q1,q2,q3=q
    phi=np.arctan2(2*(q0*q1+q2*q3),1-2*(q1**2+q2**2))
    theta=np.arcsin(2*(q0*q2-q3*q1))
    psi=np.arctan2(2*(q0*q3+q1*q2),1-2*(q2**2+q3**2))
    return phi,theta,psi
qf=propagate([1,0,0,0],np.array([0.1,-0.2,0.05]))

Correctness argument: RK4 output should match the analytic axis-angle quaternion to ~1e-8; renormalization keeps q=1\|\mathbf q\|=1. (5)

(e) MRP singularity (6)

  • Standard MRP σ=e^tan(Φ/4)\boldsymbol\sigma=\hat{\mathbf e}\tan(\Phi/4) becomes singular at Φ=±360\Phi=\pm360^\circ (full rotation), where tan(Φ/4)\tan(\Phi/4)\to\infty. (3)
  • Shadow-set rule: whenever σ>1\|\boldsymbol\sigma\|>1 (equivalently Φ>180\Phi>180^\circ), switch to σS=σ/σ2\boldsymbol\sigma^S=-\boldsymbol\sigma/\|\boldsymbol\sigma\|^2. The two sets describe the same attitude; switching at σ=1\|\boldsymbol\sigma\|=1 (Φ=180\Phi=180^\circ) keeps σ1\|\boldsymbol\sigma\|\le1 always, avoiding the singularity. (3)

Question 2

(a) Mechanization/error model (6) p˙=v\dot p=v, v˙=a=ambwa\dot v=a=a_m-b-w_a, b˙=wb\dot b=w_b. With u=amu=a_m: A=[010001000], B=[010], G=[001001], w=[wawb].A=\begin{bmatrix}0&1&0\\0&0&-1\\0&0&0\end{bmatrix},\ B=\begin{bmatrix}0\\1\\0\end{bmatrix},\ G=\begin{bmatrix}0&0\\-1&0\\0&1\end{bmatrix},\ \mathbf w=\begin{bmatrix}w_a\\w_b\end{bmatrix}. (6)

(b) Observability (8) H=[1 0 0]H=[1\ 0\ 0]. Observability matrix: O=[HHAHA2]=[100010001].\mathcal O=\begin{bmatrix}H\\HA\\HA^2\end{bmatrix}=\begin{bmatrix}1&0&0\\0&1&0\\0&0&-1\end{bmatrix}. HA=[010]HA=[0\,1\,0], HA2=[001]HA^2=[0\,0\,-1]. detO=10\det\mathcal O=-1\neq0 ⇒ rank 3 = full. (6) Therefore the system is fully observable; the bias bb IS observable from position alone, because position curvature (2nd derivative) reveals acceleration error, which after integration exposes the bias. (2)

(c) Kalman gain derivation (10) Estimate error ek+=xkxk+e_k^+=\mathbf x_k-\mathbf x_k^+. Sub update and zk=Hxk+νkz_k=H\mathbf x_k+\nu_k: ek+=(IKkH)ekKkνke_k^+=(I-K_kH)e_k^- - K_k\nu_k. (2) Joseph form: Pk+=(IKkH)Pk(IKkH)+KkRKkP_k^+=(I-K_kH)P_k^-(I-K_kH)^\top+K_kRK_k^\top. (2) Minimize J=tr(Pk+)J=\operatorname{tr}(P_k^+). Using tr(XAX)/X=2XA\partial\operatorname{tr}(XAX^\top)/\partial X=2XA (A symmetric): $\frac{\partial J}{\partial K_k}=-