Attitude estimation — triad method (two vector measurements)
3.5.12· Physics › Guidance, Navigation & Control (GNC)
WHY do we need this?
WHAT hai attitude? Attitude = ek rigid body (spacecraft) ki orientation, kisi reference frame ke relative. Mathematically yeh ek rotation matrix (ya attitude matrix) hai jo vectors ko reference/inertial frame se body frame mein map karta hai:
WHY do vectors? Ek akela measured direction sirf 3 degrees of freedom mein se 2 hi fix karta hai — spacecraft us direction ke baare mein abhi bhi spin kar sakta hai aur aapko pata bhi nahi chalega. Uss last spin angle ko lock karne ke liye aapko ek doosra independent direction chahiye.
Ek issue yeh hai: measurements noisy hote hain, isliye dono ke liye exactly generally impossible hai ( ke beech ka angle ke beech ke angle se perfectly match nahi karega). TRIAD ka trick: ek vector ko completely trust karo, aur doosre ko sirf direction ke liye use karo.
HOW to derive TRIAD from scratch
Hum har ek set of coordinates mein ek orthonormal triad (ek right-handed frame) construct karenge, phir unhe match karenge. Isi se naam aaya hai: TRI-Axial Attitude Determination.
Step 1 — Reference vectors se ek right-handed frame banao
Hamare paas hain. Hum teen orthogonal unit axes chahte hain.
Yeh step kyun? Hum ko apna sabse trusted measurement declare karte hain, isliye hum ise exactly pehle axis ke roop mein rakhte hain.
{\lVert \hat{\mathbf r}_1 \times \hat{\mathbf r}_2 \rVert}$$ *Yeh step kyun?* Cross product dono input vectors ke **perpendicular** hota hai, isliye woh automatically $\hat{\mathbf t}_1^{(r)}$ ke orthogonal hota hai. Normalize karne se yeh unit vector ban jata hai. Importantly, yeh direction $\hat{\mathbf r}_2$ ki *direction* par depend karta hai lekin **uske exact angle par nahi** — isliye doosre vector ka noisy angle throw away ho jaata hai. Yahi noise-rejection choice hai. $$\hat{\mathbf t}_3^{(r)} = \hat{\mathbf t}_1^{(r)} \times \hat{\mathbf t}_2^{(r)}$$ *Yeh step kyun?* Do orthonormal vectors ka cross product **remaining orthogonal axis** deta hai aur ek **right-handed** frame guarantee karta hai ($\det = +1$, ek proper rotation). Inhe columns ke roop mein stack karo: $$M_r = \big[\,\hat{\mathbf t}_1^{(r)}\ \ \hat{\mathbf t}_2^{(r)}\ \ \hat{\mathbf t}_3^{(r)}\,\big]$$ ### Step 2 — Body measurements se WAHI frame banao Bilkul same recipe, $\hat{\mathbf b}$ ke saath: $$\hat{\mathbf t}_1^{(b)}=\hat{\mathbf b}_1,\quad \hat{\mathbf t}_2^{(b)}=\frac{\hat{\mathbf b}_1\times\hat{\mathbf b}_2} {\lVert \hat{\mathbf b}_1\times\hat{\mathbf b}_2\rVert},\quad \hat{\mathbf t}_3^{(b)}=\hat{\mathbf t}_1^{(b)}\times\hat{\mathbf t}_2^{(b)}$$ $$M_b = \big[\,\hat{\mathbf t}_1^{(b)}\ \ \hat{\mathbf t}_2^{(b)}\ \ \hat{\mathbf t}_3^{(b)}\,\big]$$ ### Step 3 — Do frames ko match karo $M_r$ aur $M_b$ dono **same physical triad** describe karte hain — ek reference coordinates mein, ek body coordinates mein. Rotation ko reference-frame columns ko body-frame columns mein le jaana chahiye: $$A\,M_r = M_b$$ *Kyun?* Column-by-column yeh kehta hai $A\hat{\mathbf t}_i^{(r)}=\hat{\mathbf t}_i^{(b)}$ — attitude matrix har reference axis ko corresponding body axis par rotate karta hai. Kyunki $M_r$ orthonormal hai, uska inverse uska transpose hai ($M_r^{-1}=M_r^{\mathsf T}$). Isliye: > [!formula] TRIAD attitude matrix > $$\boxed{A = M_b\,M_r^{\mathsf T} = \sum_{i=1}^{3}\hat{\mathbf t}_i^{(b)}\,\hat{\mathbf t}_i^{(r)\mathsf T}}$$ > Derived hai, sirf diya nahi gaya: yeh **body triad aur reference triad ke transpose ka product** hai, kyunki $A = M_b M_r^{-1}$ aur orthonormal $\Rightarrow M_r^{-1}=M_r^{\mathsf T}$. **Check karo ki valid rotation hai:** $M_b, M_r$ orthonormal hain $\det=+1$ ke saath, isliye $A A^{\mathsf T}=M_bM_r^{\mathsf T}M_rM_b^{\mathsf T}=M_bM_b^{\mathsf T}=I$ aur $\det A = +1$. ✅ ![[3.5.12-Attitude-estimation-—-triad-method-(two-vector-measurements).png]] --- ## Worked Example 1 — clean, exact case Reference vectors (maano Sun aur mag-field inertial frame mein): $$\hat{\mathbf r}_1=(1,0,0),\qquad \hat{\mathbf r}_2=(0,1,0)$$ Maano true attitude **z-axis ke baare mein 90° rotation** hai, toh measured body vectors hain: $$\hat{\mathbf b}_1=(0,1,0),\qquad \hat{\mathbf b}_2=(-1,0,0)$$ **Reference triad:** - $\hat{\mathbf t}_1^{(r)}=(1,0,0)$ - $\hat{\mathbf r}_1\times\hat{\mathbf r}_2=(0,0,1)\Rightarrow\hat{\mathbf t}_2^{(r)}=(0,0,1)$ *(Kyun? x̂ aur ŷ ka cross ẑ hota hai.)* - $\hat{\mathbf t}_3^{(r)}=(1,0,0)\times(0,0,1)=(0,-1,0)$ $$M_r=\begin{bmatrix}1&0&0\\0&0&-1\\0&1&0\end{bmatrix}$$ **Body triad:** - $\hat{\mathbf t}_1^{(b)}=(0,1,0)$ - $\hat{\mathbf b}_1\times\hat{\mathbf b}_2=(0,1,0)\times(-1,0,0)=(0,0,1)\Rightarrow\hat{\mathbf t}_2^{(b)}=(0,0,1)$ - $\hat{\mathbf t}_3^{(b)}=(0,1,0)\times(0,0,1)=(1,0,0)$ $$M_b=\begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$$ **Attitude:** $A=M_bM_r^{\mathsf T}$. $M_r^{\mathsf T}$ compute karo aur multiply karo: $$A=\begin{bmatrix}0&-1&0\\1&0&0\\0&0&1\end{bmatrix}$$ *Yeh sahi kyun hai:* yeh exactly standard $R_z(90^\circ)$ matrix hai — check karo $A\hat{\mathbf r}_1 =(0,1,0)=\hat{\mathbf b}_1$ ✅ aur $A\hat{\mathbf r}_2=(-1,0,0)=\hat{\mathbf b}_2$ ✅. --- ## Worked Example 2 — noisy case (poora point yahi hai) Maano reference vectors ke beech ka *true* angle $90^\circ$ hai, lekin second body measurement noisy hai, jisse $\hat{\mathbf b}_2$, $\hat{\mathbf b}_1$ se $90^\circ$ ki jagah $88^\circ$ par hai. - TRIAD $\hat{\mathbf t}_1^{(b)}=\hat{\mathbf b}_1$ **exactly** set karta hai — toh jo bhi sensor $\hat{\mathbf b}_1$ deta hai (jaise star tracker) usse **perfectly honor kiya jaata hai**. - $\hat{\mathbf b}_2$ mein $2^\circ$ ki error sirf cross product ke liye use hone wale *plane* ko thoda tilt karti hai; uska precise angle **discard** ho jaata hai. Toh doosra sensor sirf "kaun sa side upar hai" contribute karta hai. *Yeh kyun important hai:* Agar sensor 1, sensor 2 se bahut zyada accurate hai, toh TRIAD smart hai — **accurate sensor ko $\hat{\mathbf r}_1/\hat{\mathbf b}_1$ ke roop mein do**. Estimate error *accurate* sensor mein first-order rehti hai aur sensor-2 angular noise largely reject ho jaata hai. --- ## Common Mistakes (Steel-manned) > [!mistake] "TRIAD dono measurements ko equally treat karta hai." > **Kyun sahi lagta hai:** recipe *dekhne mein* symmetric lagti hai — aap dono vectors ko kisi bhi taraf cross kar sakte ho. > **Kyun galat hai:** $\hat{\mathbf b}_1$ ek *exact* axis ban jaata hai jabki cross product ki sirf **direction** (angle nahi) $\hat{\mathbf b}_2$ ki survive karti hai. Method **asymmetric** hai. > **Fix:** Hamesha apna **sabse trusted sensor** slot 1 mein assign karo. 1↔2 swap karne par ek *alag* $A$ milta hai. > [!mistake] "Main normalize kiye bina sirf $A=M_b M_r^{-1}$ use kar sakta hoon." > **Kyun sahi lagta hai:** algebraically $A=M_bM_r^{-1}$ correct hai. > **Kyun galat hai:** Agar aap cross products ko normalize karna skip karo, toh $M_r,M_b$ orthonormal nahi hain, isliye $M_r^{-1}\neq M_r^{\mathsf T}$ aur $A$ proper rotation nahi hoga. > **Fix:** Har triad axis ko normalize karo; tab $M^{-1}=M^{\mathsf T}$ aur $\det A=+1$. > [!mistake] "Ise tab bhi use karo jab do vectors almost parallel hon." > **Kyun sahi lagta hai:** do vectors, do vectors hain. > **Kyun galat hai:** $\lVert\hat{\mathbf r}_1\times\hat{\mathbf r}_2\rVert=\sin\theta\to0$; ek tiny number se divide karna noise ko catastrophically amplify karta hai. > **Fix:** Achha angular separation chahiye (best near $90^\circ$); agar vectors collinear hain, toh us axis ke baare mein attitude undetermined hai. --- ## Active Recall > [!recall]- Kya aap TRIAD blind rebuild kar sakte ho? > 1. Ek vector nahi, **do** vectors kyun chahiye? *(ek spin DOF free rehta hai)* > 2. $\hat{\mathbf t}_2$ likho. Cross product kyun? *(dono ke orthogonal, sensor-2 ka angle discard karta hai)* > 3. $A=M_bM_r^{\mathsf T}$ kyun hai, literally $M_bM_r^{-1}$ kyun nahi? *(orthonormal ⇒ inverse=transpose)* > 4. Kaun sa sensor slot 1 hona chahiye? *(woh jo zyada accurate ho)* > [!recall]- Feynman: ek 12-saal ke bachche ko explain karo > Socho tumhe ek field mein aankhon par patti bandh karke ghuma diya gaya. Agar koi bole "Sun udhar hai," toh tumhe kuch pata chalta hai — lekin tum abhi bhi sar ek taraf jhuka ke khadeh ho sakte ho. Agar woh *yeh bhi* bolen "woh unchi tower udhar hai," toh ab tumhe **exactly** pata hai tum kis taraf face kar rahe ho. TRIAD ek robot hai jo wahi karta hai: woh **sky mein do known cheezein** dekhta hai, compare karta hai ki woh *hain* kahan aur *hone chahiye* kahan, aur figure out karta hai ki woh kis tarah ghuma hua hai. Woh saaf landmark ko zyada trust karta hai, aur doosre ko sirf "kaun sa side upar hai" jaanne ke liye use karta hai. > [!mnemonic] Recipe yaad karo > **"1 rehta hai, cross 2 deta hai, phir cross karo 3 milta hai; phir Body times Ref-transpose."** > Ya: **B**ody **M**atches **R**eference → $A=\mathbf{B}\,\mathbf{R}^{\mathsf T}$ ("Boy Rides Transposed"). --- ## Connections - [[Rotation Matrices and SO(3)]] — kyun orthonormal ⇒ transpose = inverse, $\det=+1$. - [[Wahba's Problem]] — optimal least-squares generalization (dono vectors ko **weight** karta hai). - [[Davenport q-method]] aur [[QUEST algorithm]] — Wahba ko quaternions ke through efficiently solve karte hain. - [[Cross Product and Right-Handed Frames]] — yahan ka geometric backbone. - [[Sun Sensors and Magnetometers]] — $\hat{\mathbf b}_i$ ke physical sources. - [[Quaternion Attitude Kinematics]] — estimated $A$ kaise [[Kalman Filter — Attitude]] mein feed hota hai. --- #flashcards/physics TRIAD ka full form kya hai / kya problem solve karta hai? ::: TRIaxial Attitude Determination; do vector measurements se attitude (rotation) matrix nikalti hai jo reference aur body dono frames mein known hain. Single vector measurement poora attitude kyun nahi de sakta? ::: Yeh sirf 2 DOF fix karta hai; body abhi bhi us vector ke baare mein freely rotate kar sakti hai (1 unresolved spin angle). Pehla TRIAD axis $\hat t_1$ = ? ::: Sabse trusted measured unit vector khud ($\hat r_1$ / $\hat b_1$), exactly rakha hua. Doosra TRIAD axis $\hat t_2$ = ? ::: Normalized cross product $(\hat r_1\times\hat r_2)/\lVert\hat r_1\times\hat r_2\rVert$ — dono ke orthogonal, vector-2 ka angle discard karta hai. Teesra TRIAD axis $\hat t_3$ = ? ::: $\hat t_1\times\hat t_2$, jo remaining orthogonal, right-handed axis deta hai. A ke liye final TRIAD formula ::: $A = M_b M_r^{\mathsf T}$, jahan $M_r,M_b$ = triad axes ki matrices columns ke roop mein. $M_r^{-1}=M_r^{\mathsf T}$ kyun? ::: $M_r$ orthonormal hai (columns unit hain, mutually orthogonal), yeh proper rotation/frame matrices ki property hai. Slot 1 mein kaun sa measurement assign hona chahiye? ::: Sabse accurate sensor, kyunki slot 1 exactly honor hota hai jabki slot 2 ka angle discard ho jaata hai. TRIAD kab fail / degrade hota hai? ::: Jab do vectors almost parallel hon: $\lVert\hat r_1\times\hat r_2\rVert=\sin\theta\to0$ noise amplify karta hai; us axis ke baare mein attitude undetermined hai. Wahba/QUEST ke against key limitation? ::: TRIAD sirf 2 vectors asymmetrically use karta hai; Wahba/QUEST optimally kisi bhi number of vectors ko weight karta hai (least squares). Check karo ki TRIAD ka A proper rotation hai ::: $AA^{\mathsf T}=M_bM_r^{\mathsf T}M_rM_b^{\mathsf T}=I$ aur $\det A=+1$. ## 🖼️ Concept Map ```mermaid flowchart TD A[Attitude = rotation matrix A] -->|maps ref to body| B[v_body = A v_ref] C[Single vector] -->|fixes only 2 DOF| D[Spin ambiguity] D -->|needs 2nd vector| E[Two non-parallel vectors] E -->|reference frame| F[r1 r2 known] E -->|body frame| G[b1 b2 measured] F -->|build triad| H[Reference frame Mr] G -->|build triad| I[Body frame Mb] H -->|t1 = r1 trusted| J[First axis] H -->|t2 = cross product| K[Rejects noisy angle] H -->|t3 = t1 x t2| L[Right-handed proper rotation] I -->|match triads| M[A = Mb Mr transpose] J --> M K --> M L --> M ```