Exercises: Spacecraft Attitude Dynamics
Work these with a calculator. Use the conventions of §14.2 throughout: passive rotations (a DCM carries reference-frame components to body-frame components, with $+\sin\theta$ in the upper right of $R_z$, matching Appendix D) and Hamilton, scalar-first quaternions $\mathbf{q} = (q_0, q_1, q_2, q_3)$ with $q_0 = \cos(\theta/2)$. Handy constants: Earth $\mu = 3.986\times10^{14}\ \text{m}^3/\text{s}^2$, $1^\circ = 3600\ \text{arcsec}$, solar pressure near Earth $P_\odot \approx 4.5\times10^{-6}\ \text{N/m}^2$.
Difficulty: ⭐ foundational, ⭐⭐ intermediate, ⭐⭐⭐ challenging. Worked solutions to the daggered (†)
and odd-numbered problems are in appendices/answers-to-selected.md — try each cold first. For the
"implement it" problems, do not run the code: hand-trace it and write the result in an
# Expected output: comment, exactly as the chapter does.
Part A — Warm-ups: vocabulary and single quantities (⭐)
14.1 † A rigid spacecraft has six degrees of freedom. State which three belong to the orbit and which three to the attitude, and name the physical quantity (force or torque) that drives each set.
14.2 Write the quaternion (scalar-first, unit norm) for a rotation of $\theta = 60^\circ$ about the body $z$-axis. Give all four components as decimals.
14.3 † A quaternion is reported as $\mathbf{q} = (0.60, 0.00, 0.80, 0.00)$. Verify it is a valid unit rotation quaternion, and find the rotation angle $\theta$ and axis $\hat{\mathbf{e}}$ it represents.
14.4 For each function, name the attitude sensor or actuator: (a) images the star field and outputs a full three-axis attitude; (b) a flywheel whose spin-up torques the vehicle; (c) measures turn rate, not orientation; (d) pushes against Earth's magnetic field using only electricity.
14.5 † In one sentence each, state the single biggest advantage of the quaternion over (a) Euler angles and (b) the direction cosine matrix.
14.6 At what pitch angle does the 3–2–1 (yaw–pitch–roll) Euler sequence hit gimbal lock, and what is physically lost there?
Part B — Rotations and quaternions (⭐⭐)
14.7 † Using the Hamilton product, compute $\mathbf{q}_x \otimes \mathbf{q}_x$ by hand, where $\mathbf{q}_x = (0.7071, 0.7071, 0, 0)$ is a $90^\circ$ rotation about $x$. Identify the resulting rotation (angle and axis) and confirm it makes physical sense.
14.8 Compute the passive DCM $R_{B/N}$ from the quaternion $\mathbf{q} = (0.7071, 0, 0, 0.7071)$ (a $90^\circ$ rotation about $z$) using the formula in §14.2. Confirm it equals the Appendix-D $R_z(90^\circ)$ with $+\sin$ in the upper right.
14.9 † The conjugate of a scalar-first quaternion is $\mathbf{q}^{*} = (q_0, -q_1, -q_2, -q_3)$, and it represents the inverse rotation. Take $\mathbf{q} = (0.7071, 0.7071, 0, 0)$ and compute $\mathbf{q} \otimes \mathbf{q}^{*}$ by hand. What must you get, and why?
14.10 A spacecraft's attitude relative to the reference frame is the quaternion $\mathbf{q} = (0.5, 0.5, 0.5, 0.5)$. Without multiplying matrices, state the single rotation angle and axis this represents, and explain how you read them straight off the four numbers.
14.11 † Explain, in terms of degrees of freedom and constraints, why a DCM uses nine numbers for a three-DOF orientation while a quaternion uses four. How many redundant numbers does each carry, and which is cheaper to keep valid in flight software?
14.12 A student claims their 3–2–1 Euler-angle controller "will be fine, we never pitch past $60^\circ$." Is avoiding the singularity by staying away from it a legitimate engineering choice? Give one case where it is acceptable and one where it is not.
Part C — Implement it in Python (⭐⭐)
Write each function, hand-trace it for the given inputs, and record the result in an # Expected output:
comment. Do not run it. Keep the §14.2 conventions.
14.13 † Write quat_multiply(q1, q2) (Hamilton, scalar-first). Trace it for
quat_multiply([0.7071, 0, 0, 0.7071], [0.7071, 0, 0, 0.7071]) — two $90^\circ$ $z$-rotations composed.
14.14 Write quat_norm(q) returning $\sqrt{q_0^2+q_1^2+q_2^2+q_3^2}$ and quat_normalize(q)
returning the unit quaternion. Trace quat_normalize([0, 0, 0, 2]).
14.15 † Write dcm_from_quat(q) (passive DCM of §14.2). Trace it for
dcm_from_quat([1, 0, 0, 0]) (the identity/zero rotation) and state the matrix you expect.
Part D — Find the error (⭐⭐)
14.16 An operator reports: "The satellite's orbit is perfect, so its pointing must be fine too." Explain, in terms of degrees of freedom, why this does not follow.
14.17 † A design memo says: "We use reaction wheels, which need no propellant, so this spacecraft needs no thrusters or magnetorquers at all." The orbit-average disturbance torque about the pointing axis is a steady $1\times10^{-4}\ \text{N·m}$, and the wheels hold $H_{\max} = 4\ \text{N·m·s}$. Find how long until the wheels saturate, and correct the memo.
14.18 A newcomer says "our rate gyros will tell us exactly which way we're pointing." Diagnose the two things wrong with this: what a gyro actually measures, and what happens to a gyro-only attitude over hours.
Part E — Design it (⭐⭐ / ⭐⭐⭐)
14.19 † (Mission project) For your chosen mission (Track A/B/C/D), write the attitude section of your MDR: (a) the tightest pointing requirement and which kind it is (accuracy / knowledge / jitter); (b) spin or three-axis, justified; (c) the actuator and sensor suite, with a momentum-dumping method appropriate to the environment. Save it to your MDR.
14.20 An agile imager has moment of inertia $I = 150\ \text{kg·m}^2$ about its slew axis and must rotate $30^\circ$ and stop in $20\ \text{s}$ using a bang-bang (accelerate then decelerate) profile. Find the peak reaction-wheel torque and the peak stored angular momentum, and comment on whether a wheel rated for $0.2\ \text{N·m}$ and $8\ \text{N·m·s}$ suffices.
14.21 † A camera requires $0.03^\circ$ pointing accuracy. Your error contributions (RSS) are: star tracker $30\ \text{arcsec}$, gyro drift $20\ \text{arcsec}$, wheel quantization $x\ \text{arcsec}$, and alignment/thermal $60\ \text{arcsec}$. Find the largest wheel-quantization $x$ your design can tolerate and still meet the requirement. Which term should you fix first, regardless?
14.22 Choose a stabilization method (spin, dual-spin, or three-axis) for each and justify in one line: (a) a simple spinning magnetospheric science probe with body-mounted particle detectors; (b) a sharp GEO weather imager that must stare at one hemisphere; (c) a cubesat that only needs its arrays roughly Sun-pointed.
Part F — Back of the envelope & "why can't you just…" (⭐⭐⭐)
14.23 † Estimate the gravity-gradient torque on a $6U$ cubesat in a $500\ \text{km}$ orbit ($r = 6.871\times10^6\ \text{m}$) with $\lvert I_{\max} - I_{\min}\rvert \approx 0.1\ \text{kg·m}^2$, at its worst-case orientation. Is it larger or smaller than a plausible magnetorquer torque of $\sim 1\times10^{-4}\ \text{N·m}$? What does the comparison say about controllability?
14.24 Why can't you just use three Euler angles in the flight computer and forget quaternions entirely? Frame your answer around gimbal lock and the rate equations, and say when three angles are acceptable.
14.25 † Why can't you just keep a spacecraft pointed forever with reaction wheels and never carry an external actuator? Answer using the conservation law $\dot{\mathbf{H}}{\text{total}} = \mathbf{M}$.}
14.26 Why can't you just spin a long, pencil-shaped spacecraft about its long axis for cheap stability? Name the rule you would be violating and the historical mission that learned it the hard way.
Part G — Interleaved and synthesis (from Chapters 8 and 12)
14.27 † (Ch. 8) A spacecraft's attitude is often expressed relative to its local orbit frame (nadir-pointing). Using Chapter 8, explain why a perfectly nadir-pointing satellite is nonetheless rotating in inertial space, and state its inertial rotation rate in terms of the mean motion $n$.
14.28 (Ch. 12) Chapter 12 treated solar radiation pressure and atmospheric drag as forces that perturb the orbit. Explain how each of these same effects becomes a torque on the attitude, and state which one dominates the attitude disturbance at GEO and which in very low LEO.
14.29 † (Ch. 8, synthesis) The gravity-gradient torque bracket is $3\mu/r^3$, and Chapter 8 gives $n = \sqrt{\mu/a^3}$. Show that $3\mu/r^3 = 3n^2$ for a circular orbit, then evaluate it for a $400\ \text{km}$ orbit ($n \approx 1.13\times10^{-3}\ \text{rad/s}$) and confirm it matches a direct computation from $\mu$ and $r = 6.771\times10^6\ \text{m}$.
14.30 (Ch. 12, synthesis) Chapter 12's station-keeping and this chapter's momentum dumping are both recurring operations forced by small, relentless environmental effects. Write two sentences contrasting what accumulates in each case and what external action removes it.
Solutions to † and odd-numbered exercises are in appendices/answers-to-selected.md. Reference code for
the "implement it" problems is in code/exercise-solutions.py. For design problems, the rubric rewards:
an explicit statement of conventions, correct set-up with units, and a sanity check on the final number.