3.5.1 · D4 · HinglishGuidance, Navigation & Control (GNC)
Exercises — Reference frames — body frame, inertial frame; rotation between them
3.5.1 · D4· Physics › Guidance, Navigation & Control (GNC) › Reference frames — body frame, inertial frame; rotation betw
Poore note mein hum parent note se liya hua elementary -rotation use karenge: aur iske cousins aur ke baare mein:
R_y(\theta)=\begin{bmatrix}\cos\theta&0&-\sin\theta\\0&1&0\\\sin\theta&0&\cos\theta\end{bmatrix}$$ > [!definition] Teeno matrices ko padhna > Har ek **inertial** frame ke vector ke components leta hai aur uske **body** frame ke components return karta hai, jab body ko uss ek axis ke around stated angle se ghuma diya gaya ho. "1" wali row/column woh axis hai jiske around tum spin kar rahe ho — spin axis ke along components kabhi nahi badalte, yeh tumhara instant sanity check hai. --- ## Level 1 — Recognition > [!example] L1·Q1 — Kaun sa frame bol raha hai? > Ek rate gyro output deta hai $\vec\omega=(0.01,\,0,\,-0.03)$ rad/s. Ek star tracker ek star ki direction $(0,0,1)$ output karta hai. Kaun si reading naturally **body frame** mein hai aur kaun si **inertial frame** mein? > [!recall]- Solution L1·Q1 > **Gyro vehicle ke saath bolted hai**, isliye woh vehicle ke apne axes ke around rotation measure karta hai → uska $\vec\omega$ ==body frame== mein hai. Ek **star tracker** ek catalogued star ki direction report karta hai, jiska direction distant stars ke relative fixed hota hai → yeh ==inertial frame== hai. Onboard computer ka poora kaam yahi hai ki dono ke beech convert kare. > [!example] L1·Q2 — Axis dhundo > Neeche di gayi matrix tumhare haath lagti hai. Yeh kis axis ke around rotation hai, aur angle kya hai? > $$M=\begin{bmatrix}1&0&0\\0&0&1\\0&-1&0\end{bmatrix}$$ > [!recall]- Solution L1·Q2 > **Pehli row aur pehla column** $(1,0,0)$ hai: $x$-component untouched hai, isliye yeh **$x$ ke around** spin karta hai → $R_x(\phi)$ se compare karo. Block $\begin{bmatrix}\cos\phi&\sin\phi\\-\sin\phi&\cos\phi\end{bmatrix}=\begin{bmatrix}0&1\\-1&0\end{bmatrix}$ match karne par milta hai $\cos\phi=0,\ \sin\phi=1\Rightarrow \phi=+90^\circ$. Toh $M=R_x(90^\circ)$. > [!example] L1·Q3 — Sach wala inverse > Ek rotation matrix $R$ diya hua hai. Body se wapas inertial mein vector convert karne ke liye kaun sa operation apply karoge, aur yeh sasta kyun hai? > [!recall]- Solution L1·Q3 > **Transpose** apply karo: $\vec v^{\mathcal I}=R^{\mathsf T}\vec v^{\mathcal B}$. Kyunki ek rotation matrix ==orthogonal== hoti hai ($R^{\mathsf T}R=I$), uska inverse uske transpose ke *barabar* hota hai. Transpose karna sirf rows aur columns badalna hai — koi Gaussian elimination nahi, koi division nahi, numerically exact. > [!mistake] L1 ka trap — "star tracker body coordinates dekhta hai" > **Kyun sahi lagta hai:** tracker physically spacecraft par hai, toh zaroor uske numbers body ke numbers hain. > **Sach:** sensor body mein *rehta* hai, lekin woh ek catalogued inertial direction *report* karta hai (yahi toh star catalogues ka poora point hai). Jo "body mein" hai woh raw pixel hai; *output* inertial hai. > **Fix:** yeh poocho ki *"yeh number kya describe karta hai?"* na ki *"yeh box kahan hai?"* --- ## Level 2 — Application > [!example] L2·Q1 — Ek vector rotate karo > Body ko $z$ ke around $+90^\circ$ ghuma diya gaya hai. Ek inertial vector $\vec v^{\mathcal I}=(2,0,0)$ hai. $\vec v^{\mathcal B}$ nikalo aur confirm karo ki length preserve hui hai. > [!recall]- Solution L2·Q1 > $$\vec v^{\mathcal B}=R_z(90^\circ)\begin{bmatrix}2\\0\\0\end{bmatrix}=\begin{bmatrix}0&1&0\\-1&0&0\\0&0&1\end{bmatrix}\begin{bmatrix}2\\0\\0\end{bmatrix}=\begin{bmatrix}0\\-2\\0\end{bmatrix}$$ > **Yeh kaisa dikhta hai (neeche figure):** arrow khud kabhi nahi hila; *observer* $+90^\circ$ ghuma, isliye inertial $+X$ arrow ab body ke $-y$ ki taraf point kar raha hai. Length: $\sqrt{0^2+(-2)^2+0^2}=2$ ✔. > > ![[deepdives/dd-physics-3.5.01-d4-s01.png]] > [!example] L2·Q2 — $y$ ke around rotate karo > Body ko $y$ ke around $\theta=30^\circ$ ghuma diya gaya. Inertial vector $\vec v^{\mathcal I}=(0,0,1)$. $\vec v^{\mathcal B}$ nikalo. > [!recall]- Solution L2·Q2 > $$\vec v^{\mathcal B}=R_y(30^\circ)\begin{bmatrix}0\\0\\1\end{bmatrix}=\begin{bmatrix}\cos30^\circ&0&-\sin30^\circ\\0&1&0\\\sin30^\circ&0&\cos30^\circ\end{bmatrix}\begin{bmatrix}0\\0\\1\end{bmatrix}=\begin{bmatrix}-\sin30^\circ\\0\\\cos30^\circ\end{bmatrix}=\begin{bmatrix}-0.5\\0\\0.866\end{bmatrix}$$ > $z$-axis vector body view mein $-x$ ki taraf tilt hota hai kyunki body ne apna nose doosri taraf ghuma liya. $\sqrt{0.25+0.75}=1$ ✔. > [!example] L2·Q3 — On-axis star > Star direction $\hat s^{\mathcal I}=(0,0,1)$; attitude hai $R_z(30^\circ)$. Star body coords mein kahan dikhega? > [!recall]- Solution L2·Q3 > $$\hat s^{\mathcal B}=R_z(30^\circ)\begin{bmatrix}0\\0\\1\end{bmatrix}=\begin{bmatrix}0\\0\\1\end{bmatrix}$$ > Star rotation axis **par** hi hai, isliye ek $z$-spin usse untouched chhod deta hai. Yeh kisi bhi $z$-rotation par sabse fast sanity check hai. > [!mistake] L2 ka trap — radians mein soche bina degrees ko $\cos$ mein daalna > **Kyun sahi lagta hai:** hum bol-bol ke *"$\cos 30^\circ$"* kehte hain, toh `cos(30)` type kar dete hain. > **Sach:** software trig ko **radians** chahiye; `cos(30)` = $\cos(30\text{ rad})\approx0.154$ hoga, bilkul silently galat. > **Fix:** pehle convert karo, $30^\circ=\pi/6$ rad, ya phir `deg` wrapper use karo. Paper par, yaad karo $\cos30^\circ=\tfrac{\sqrt3}{2}\approx0.866$. --- ## Level 3 — Analysis > [!example] L3·Q1 — Orthonormal rows prove karo > $R_z(\theta)$ lo. Dikhao ki uski teeno rows mutually perpendicular unit vectors hain, aur isliye $R_z^{\mathsf T}R_z=I$. > [!recall]- Solution L3·Q1 > Rows: $r_1=(\cos\theta,\sin\theta,0)$, $r_2=(-\sin\theta,\cos\theta,0)$, $r_3=(0,0,1)$. > - $\|r_1\|^2=\cos^2\theta+\sin^2\theta=1$; $r_2$ ke liye bhi same; $\|r_3\|=1$. Saari **unit** hain. > - $r_1\cdot r_2=-\cos\theta\sin\theta+\sin\theta\cos\theta+0=0$; $r_1\cdot r_3=0$; $r_2\cdot r_3=0$. Saari **perpendicular** hain. > $R_z R_z^{\mathsf T}$ ki entry $(i,j)$ hai $r_i\cdot r_j=\delta_{ij}$, toh product $I$ hai. **Yeh kyun matter karta hai:** confirm karta hai ki is building block ke liye inverse, transpose ke barabar hai — aur isliye unke kisi bhi product ke liye bhi. > [!example] L3·Q2 — Determinant ka sign > $\det R_z(\theta)$ compute karo aur explain karo ki physically $+1$ (versus $-1$) ki value kya batati hai. > [!recall]- Solution L3·Q2 > Last row ke along expand karo: $\det R_z=1\cdot(\cos\theta\cdot\cos\theta-\sin\theta\cdot(-\sin\theta))=\cos^2\theta+\sin^2\theta=1$. > $+1$ ka determinant matlab **proper rotation** — yeh handedness preserve karta hai (right-handed right-handed hi rehta hai). $-1$ ka determinant matlab koi **reflection** andar ghus gayi hai, frame ki chirality flip ho gayi, jo koi bhi physical rigid rotation nahi kar sakta. > [!example] L3·Q3 — Body frame inertial kyun nahi hai > Ek student rotating body frame mein directly $\vec F=m\vec a$ likh deta hai. Newton's law ko wahan jo extra terms actually chahiye hain, unke naam batao aur kyun. > [!recall]- Solution L3·Q3 > $\vec\omega$ par rotate hote frame mein, inertially dekha gaya true acceleration, body-measured acceleration se fictitious terms se differ karta hai: > $$\vec a^{\mathcal I}=\vec a^{\mathcal B}+2\,\vec\omega\times\vec v^{\mathcal B}+\vec\omega\times(\vec\omega\times\vec r)+\dot{\vec\omega}\times\vec r$$ > Yeh ==Coriolis==, ==centrifugal==, aur Euler (angular-acceleration) terms hain. Yeh isliye exist karte hain kyunki body frame *accelerating* (rotating) hai. Sirf $\mathcal I$ mein $\vec F=m\vec a$ clean hai. Dekho [[Coriolis and fictitious forces in rotating frames]]. > [!mistake] L3 ka trap — "yeh rotation hai, toh obviously $\det=1$ hai; skip karo" > **Kyun sahi lagta hai:** tumhe bataya gaya tha ki rotations ka $\det=+1$ hota hai, toh check karna redundant lagta hai. > **Sach:** ek matrix jo orthogonal hai ($R^{\mathsf T}R=I$) phir bhi $\det=-1$ ho sakta hai — woh *reflection* hai, rotation nahi. Orthogonality akela kaafi nahi hai. > **Fix:** kisi matrix ko attitude maanne se pehle hamesha **dono** verify karo — $R^{\mathsf T}R=I$ **aur** $\det R=+1$. --- ## Level 4 — Synthesis > [!example] L4·Q1 — Do frames chain karo > Inertial→orbit hai $R_{\mathcal O\mathcal I}=R_z(90^\circ)$; orbit→body hai $R_{\mathcal B\mathcal O}=R_x(90^\circ)$. $R_{\mathcal B\mathcal I}$ banao aur $\vec v^{\mathcal I}=(1,0,0)$ ko body frame mein map karo. > [!recall]- Solution L4·Q1 > Adjacent subscripts touch karne chahiye: pehle $\mathcal I\to\mathcal O$ apply karo (sabse right wala), phir $\mathcal O\to\mathcal B$: > $$R_{\mathcal B\mathcal I}=R_{\mathcal B\mathcal O}R_{\mathcal O\mathcal I}=R_x(90^\circ)R_z(90^\circ) > =\begin{bmatrix}1&0&0\\0&0&1\\0&-1&0\end{bmatrix}\begin{bmatrix}0&1&0\\-1&0&0\\0&0&1\end{bmatrix} > =\begin{bmatrix}0&1&0\\0&0&1\\1&0&0\end{bmatrix}$$ > Phir: > $$\vec v^{\mathcal B}=R_{\mathcal B\mathcal I}\begin{bmatrix}1\\0\\0\end{bmatrix}=\begin{bmatrix}0\\0\\1\end{bmatrix}$$ > **Kyun:** matrix multiplication *commutative nahi* hai — order encode karta hai "kaun sa turn pehle hua". Ulta karo toh different attitude milega. > [!example] L4·Q2 — Yaw-pitch-roll (3-2-1) small angles par > Sequence $R_{\mathcal B\mathcal I}=R_x(\phi)R_y(\theta)R_z(\psi)$ ke liye jab saare angles small hain, linearised matrix dikhao aur $\phi=\theta=\psi=0.01$ rad ke liye $\vec v^{\mathcal I}=(1,0,0)$ par evaluate karo. > [!recall]- Solution L4·Q2 > Small $\alpha$ ke liye: $\cos\alpha\approx1$, $\sin\alpha\approx\alpha$. First order rakhte hue aur small angles ke products drop karte hue: > $$R_{\mathcal B\mathcal I}\approx\begin{bmatrix}1&\psi&-\theta\\-\psi&1&\phi\\\theta&-\phi&1\end{bmatrix}$$ > $\phi=\theta=\psi=0.01$ ke saath: > $$\vec v^{\mathcal B}\approx\begin{bmatrix}1&0.01&-0.01\\-0.01&1&0.01\\0.01&-0.01&1\end{bmatrix}\begin{bmatrix}1\\0\\0\end{bmatrix}=\begin{bmatrix}1\\-0.01\\0.01\end{bmatrix}$$ > **Yeh tool kyun:** small-angle linearisation messy trig ko ek clean skew-symmetric perturbation mein badal deti hai — onboard attitude filters ki yahi foundation hai. Dekho [[Euler angles and gimbal lock]]. > [!example] L4·Q3 — DCM se angle recover karo > Tumhe diya gaya hai > $$R_{\mathcal B\mathcal I}=\begin{bmatrix}0.6&0.8&0\\-0.8&0.6&0\\0&0&1\end{bmatrix}$$ > Ise single-axis rotation ki tarah identify karo aur angle extract karo. > [!recall]- Solution L4·Q3 > Teesri row/column $(0,0,1)$ hai → pure $z$-rotation. $R_z$ se match karo: $\cos\theta=0.6$, $\sin\theta=0.8$. $\cos$ (top-left) aur $(1,2)$ slot mein $+\sin$ ki placement dono consistent hain, isliye > $$\theta=\operatorname{atan2}(0.8,\,0.6)=53.13^\circ$$ > **Atan2 kyun, plain arctan kyun nahi:** $\arctan(0.8/0.6)$ sign information kho deta hai aur $53.13^\circ$ aur $233.13^\circ$ mein fark nahi kar sakta. `atan2(sin, cos)` *dono* signs padhta hai aur correct quadrant return karta hai — bilkul wahi fix jo parent note ne naive arctan formula ke liye dikhaya tha. > [!mistake] L4 ka trap — rotations ko reading order mein multiply karna > **Kyun sahi lagta hai:** hum left-to-right padhte hain, isliye "yaw then pitch then roll" lagta hai jaise $R_z R_y R_x$ type karna chahiye. > **Sach:** woh matrix jo vector par *pehle apply* hoti hai woh **right** mein hoti hai. Ek 3-2-1 sequence (yaw pehle) $R_x(\phi)R_y(\theta)R_z(\psi)$ likha jaata hai — yaw sabse right mein hai. > **Fix:** subscript cancellation se police karo: $R_{\mathcal B\mathcal O}R_{\mathcal O\mathcal I}$ — touching $\mathcal O$'s adjacent hone chahiye, jo correct order force karta hai. --- ## Level 5 — Mastery > [!example] L5·Q1 — Atan2 ka har quadrant > Ek DCM ke $z$-rotation se $(\cos\theta,\sin\theta)$ pairs aate hain: **(a)** $(0.6,0.8)$, **(b)** $(-0.6,0.8)$, **(c)** $(-0.6,-0.8)$, **(d)** $(0.6,-0.8)$. Har ek angle degrees mein $(-180^\circ,180^\circ]$ mein do. > [!recall]- Solution L5·Q1 > $\theta=\operatorname{atan2}(\sin\theta,\cos\theta)$ use karke: > - **(a)** Q1: $\operatorname{atan2}(0.8,0.6)=+53.13^\circ$ > - **(b)** Q2: $\operatorname{atan2}(0.8,-0.6)=+126.87^\circ$ > - **(c)** Q3: $\operatorname{atan2}(-0.8,-0.6)=-126.87^\circ$ > - **(d)** Q4: $\operatorname{atan2}(-0.8,0.6)=-53.13^\circ$ > **Yeh kaisa dikhta hai (figure):** charon mein same *ratio* $|{\sin}/{\cos}|=4/3$ hai, phir bhi angles circle ke chaar alag-alag corners hain. Plain arctan (a) aur (c) ko saath collapse kar deta aur (b) aur (d) ko saath — yahi failure hai jo atan2 theek karta hai. > > ![[deepdives/dd-physics-3.5.01-d4-s02.png]] > [!example] L5·Q2 — Degenerate input > **Zero vector** $\vec v^{\mathcal I}=(0,0,0)$ aur **null rotation** $R_z(0^\circ)=I$ machinery mein daalo. Kya nikalta hai, aur dono valid boundary cases kyun hain? > [!recall]- Solution L5·Q2 > - Zero vector ka koi bhi rotation: $R\,\vec 0=\vec 0$. Zero-length arrow ki koi direction nahi hoti, isliye orientation usse change nahi kar sakta — length $0$ trivially preserve hai. > - Null rotation $R_z(0)=I$ har vector ko khud se map karta hai: $\vec v^{\mathcal B}=\vec v^{\mathcal I}$. Body aur inertial frames coincide karte hain. Yeh identity element hai — "kuch nahi karo" wala attitude, aur ek floor test jo har DCM library ko pass karna chahiye. > [!example] L5·Q3 — Composition round-trip (mastery) > Prove karo ki inertial→body phir body→inertial convert karne se **kisi bhi** attitude $R$ ke liye original vector wapas milta hai. Phir numerically verify karo $R=R_z(30^\circ)$ aur $\vec v^{\mathcal I}=(1,2,3)$ ke saath. > [!recall]- Solution L5·Q3 > **Proof:** $\vec v^{\mathcal B}=R\vec v^{\mathcal I}$, phir $R^{\mathsf T}\vec v^{\mathcal B}=R^{\mathsf T}R\,\vec v^{\mathcal I}=I\,\vec v^{\mathcal I}=\vec v^{\mathcal I}$, orthogonality $R^{\mathsf T}R=I$ use karke. Round-trip exact hai — koi drift nahi, koi numerical inverse nahi. > **Numeric check** $R_z(30^\circ)$ ke saath, $\cos30^\circ=0.8660$, $\sin30^\circ=0.5$: > $$\vec v^{\mathcal B}=\begin{bmatrix}0.866&0.5&0\\-0.5&0.866&0\\0&0&1\end{bmatrix}\begin{bmatrix}1\\2\\3\end{bmatrix}=\begin{bmatrix}1.866\\1.232\\3\end{bmatrix}$$ > $R^{\mathsf T}$ apply karne par $(1,2,3)$ wapas milta hai ✔. Yahi exactness *isliye* hai ki attitude filters invert karne ki bajaye transpose karte hain (dekho [[Quaternions for attitude representation]] ussi trick ke liye $q^{-1}=q^\ast$ ke saath). > [!mistake] L5 ka trap — jahan $\operatorname{atan2}$ chahiye wahan $\arctan$ use karna > **Kyun sahi lagta hai:** parent formula $\theta=\arctan(A_y/A_x)$ memory mein burn ho chuka hai. > **Sach:** $\arctan$ sirf $(-90^\circ,90^\circ)$ return karta hai; yeh quadrants II aur III tak *pahunch hi nahi sakta*, aur $A_y/A_x$ divide karne se individual signs kho jaate hain (ek Q2 point aur ek Q4 point same ratio share kar sakte hain). > **Fix:** hamesha **dono** components alag-alag pass karo: $\operatorname{atan2}(A_y,A_x)$. Yeh har sign inspect karta hai aur poora $(-180^\circ,180^\circ]$ answer return karta hai. --- > [!recall]- Self-quiz ke liye one-line summary > Vector ko body mein rotate karo ::: $\vec v^{\mathcal B}=R_{\mathcal B\mathcal I}\vec v^{\mathcal I}$ > Ise saste mein reverse karo ::: transpose, kyunki $R^{-1}=R^{\mathsf T}$ > Frames chain karo ::: $R_{\mathcal C\mathcal I}=R_{\mathcal C\mathcal B}R_{\mathcal B\mathcal I}$, adjacent subscripts cancel ho jaate hain > Angle safely extract karo ::: $\theta=\operatorname{atan2}(\sin\theta,\cos\theta)$, kabhi plain arctan nahi > [!mnemonic] Exam mein yeh saath le jaao > **"Right one first, transpose to reverse, atan2 for the corner."** --- Parent: [[3.5.01 Reference frames — body frame, inertial frame; rotation between them (Hinglish)|Reference frames]] · Related: [[IMU and gyroscope sensing]] · [[Attitude determination — star trackers]] · [[ECI, ECEF and orbit reference frames]]