GNC/base_guidance.py โ€” Base Guidance

Middle layer of the guidance tower. Extends [[com_guidance]] with desired base attitude Rbd(s)\bm R_{bd}(s), ฯ‰bd\bm\omega_{bd}, and the impedance-derate ramp ฮณ(ฯƒG)\gamma(\sigma_G).

Offline Frame Sequence Build

A roll-continuous frame field is constructed once at init along the orbit:

  • zz-axis: inward z^i=โˆ’p^i\hat{\bm z}_i = -\hat{\bm p}_i
  • xx-axis: parallel-transported from the previous frame to remove sign flips
  • enforce_frame_sequence_continuity removes any residual discontinuities

Ri=frame(z^i,ย xhint)\bm R_i = \text{frame}(\hat{\bm z}_i,\ \bm x_{\mathrm{hint}})

The sequence is a stored field {Ri}\{\bm R_i\}; no online optimisation.

Runtime SLERP

At progress ss, bracket the stored frames at i0=โŒŠsโŒ‹i_0=\lfloor s\rfloor, i1=i0+1i_1=i_0+1, ฮฑ=sโˆ’i0\alpha=s-i_0:

Rbd(s)=Ri0expโกโ€‰โฃ(ฮฑlogโก(Ri0โŠคRi1))\bm R_{bd}(s) = \bm R_{i_0}\exp\!\big(\alpha \log(\bm R_{i_0}^\top\bm R_{i_1})\big)

(eq 5.6, final.tex ยง3)

Returns the stored frame exactly at integer samples. The geodesic interpolant guarantees Rbd(s)โˆˆSO(3)\bm R_{bd}(s)\in\mathrm{SO}(3) at every fractional progress.

Negligible Base Angular Acceleration

Desired base angular velocity ฯ‰bd\bm\omega_{bd} comes from a central finite difference of the frame field:

ฯ‰bdโ‰ˆlogโก(Rโˆ’โŠคR+)ฮ”t,ฮ”t=ฮ”usห™\bm\omega_{bd} \approx \frac{\log(\bm R_{-}^\top\bm R_{+})}{\Delta t},\qquad \Delta t = \frac{\Delta u}{\dot s}

(body-frame increment โ€” omega_body_frame = True flag)

Because the inward reference rotates slowly along the orbit, the angular acceleration is negligible:

ฯ‰ห™bdโ‰ˆ0\dot{\bm\omega}_{bd} \approx \bm 0

(final.tex ยง3)

Impedance Derate Ramp ฮณ(ฯƒG)\gamma(\sigma_G)

ฯƒGโ‰กฯƒminโก(ฮ“)\sigma_G\equiv\sigma_{\min}(\bm\Gamma) measures proximity to singularity. The ramp:

ฮณ(ฯƒG)={ฯƒcrit,1ฯƒGโ‰คฯƒcrit,21ฯƒGโ‰ฅฯƒcrit,1ฯƒcrit,1+(1โˆ’ฯƒcrit,1)ฯƒGโˆ’ฯƒcrit,2ฯƒcrit,1โˆ’ฯƒcrit,2otherwise\gamma(\sigma_G) = \begin{cases} \sigma_{\mathrm{crit},1} & \sigma_G \le \sigma_{\mathrm{crit},2}\\[4pt] 1 & \sigma_G \ge \sigma_{\mathrm{crit},1}\\[4pt] \sigma_{\mathrm{crit},1} + (1-\sigma_{\mathrm{crit},1})\dfrac{\sigma_G - \sigma_{\mathrm{crit},2}}{\sigma_{\mathrm{crit},1}-\sigma_{\mathrm{crit},2}} & \text{otherwise} \end{cases}

(eq 6.4, final.tex ยง7) ฯƒcrit,1=vref/xmaxโกโ‰ˆ0.143\sigma_{\mathrm{crit},1}=v_{\mathrm{ref}}/x_{\max}\approx 0.143; ฯƒcrit,2=ฯƒcrit,12\sigma_{\mathrm{crit},2}=\sigma_{\mathrm{crit},1}^2.

Derate Applied to the Demand

derate_desired_by_gamma scales the CoM desired by ฮณ\gamma before smoothing:

vcโ†ฮณvc,acโ†ฮณ2ac,ฯ‰bโ†ฮณฯ‰b\bm v_c \leftarrow \gamma \bm v_c,\qquad \bm a_c \leftarrow \gamma^2\bm a_c,\qquad \bm\omega_b \leftarrow \gamma \bm\omega_b

acโˆโˆฅvcโˆฅ2\bm a_c\propto\lVert\bm v_c\rVert^2 so the quadratic scaling keeps centripetal demand consistent. The slowdown is emergent: softening Kห˜\breve{\bm K} relocates the cruise-lag equilibrium to x~ssโ†’1ฮณx~ss\tilde{\bm x}_{ss}\to\tfrac{1}{\gamma}\tilde{\bm x}_{ss} (eq 4.14) rather than throttling the command.