Skip to main content

Module 12 — Math & theory you'll keep reaching for

A pocket reference. Skim now, return forever. Everything here already appeared in context in earlier modules.

🟢 Vectors & trig. A vector has length and direction; you'll use the dot product (ab=abcosθ\mathbf a\cdot\mathbf b = |\mathbf a||\mathbf b|\cos\theta — projections, "how aligned") and cross product (a×b=absinθ|\mathbf a\times\mathbf b| = |\mathbf a||\mathbf b|\sin\theta — torque, rotation axes) daily. SOH-CAH-TOA decomposes thrust into components; atan2(y,x)\text{atan2}(y,x) recovers angles without quadrant bugs.

🟡 Rotations. A yaw by angle ψ\psi is the matrix

Rz(ψ)=[cosψsinψ0sinψcosψ0001]R_z(\psi) = \begin{bmatrix}\cos\psi & -\sin\psi & 0\\ \sin\psi & \cos\psi & 0\\ 0 & 0 & 1\end{bmatrix}

Chaining Euler angles (roll·pitch·yaw) is intuitive but suffers gimbal lock at ±90° pitch. Firmware therefore stores attitude as a quaternion q=(cosθ2, usinθ2)q = \big(\cos\tfrac\theta2,\ \mathbf u\sin\tfrac\theta2\big) — 4 numbers, no singularities; composition is quaternion multiplication (order matters!). Rule of thumb: quaternions inside the code, Euler angles on the OSD for humans.

🟡 Calculus in one paragraph. The derivative is instantaneous rate of change (gyro = derivative of angle); the integral is accumulation (angle = integral of gyro, which is why gyro bias becomes drift). PID literally is one signal plus its integral plus its derivative.

🔴 Dynamics & the 2nd-order template. Half of control intuition is the mass–spring–damper:

mx¨+cx˙+kx=F,ωn=k/m,ζ=c2kmm\ddot x + c\dot x + kx = F,\qquad \omega_n = \sqrt{k/m},\qquad \zeta = \frac{c}{2\sqrt{km}}

Overshoot Mp=eπζ/1ζ2M_p = e^{-\pi\zeta/\sqrt{1-\zeta^2}}, settling time 4/(ζωn)\approx 4/(\zeta\omega_n). When a reviewer says "add damping", they mean raise ζ\zeta.

🔴 Frequency domain. Any signal is a sum of sinusoids (Fourier); the FFT computes the recipe — that's your spectrogram. The Laplace transform turns differential equations into algebra (ss = differentiation), giving transfer functions and Bode plots. Nyquist: sampling at fsf_s can only represent content below fs/2f_s/2; above it, aliasing manufactures lies.

🔴 Probability for estimation. Mean, variance, and the Gaussian are the vocabulary of the Kalman filter: every sensor is a Gaussian around the truth; fusing two Gaussians yields a narrower one — that is sensor fusion in one sentence.

⚫ Numerics & linear algebra. Simulators integrate the equations of motion — Euler integration (xk+1=xk+x˙Δtx_{k+1} = x_k + \dot x\,\Delta t) is simple but drifts; RK4 buys accuracy per step. Eigenvalues of the closed-loop matrix decide stability (all in the left half-plane / inside the unit circle); this is the bridge to LQR and modern control.

If you're doing…You're using…
Reading a spectrogramFourier / Nyquist
Tuning P and D2nd-order response, ζ\zeta, ωn\omega_n
Trusting GPS vs baroGaussian fusion / Kalman
Angle mode mathRotation matrices / quaternions
Writing a simulatorNumerical integration (RK4)
Mixer & torqueCross products, moments

📚 Free resources: 3Blue1Brown "Essence of linear algebra" & "Essence of calculus"; Brian Douglas control playlists; MIT OCW 18.06; interactive quaternion visualizer (eater.net/quaternions).