Nadir Pointing with Coupled Spacecraft Attitude and Fuel Slosh Dynamics using Hybrid Robust Adaptive Control

For my AE 544 Analytical Dynamics final project at Embry-Riddle Aeronautical University, I modeled a spacecraft whose attitude is coupled to sloshing propellant and designed a hybrid robust adaptive controller that keeps it pointing at Earth (nadir pointing) while the fuel drains. Slosh changes the dynamics the controller sees over the whole mission, so the controller has to adapt and stay provably bounded as the tank empties.

Challenge

Fuel slosh behaves differently at each stage of a mission:

  • Early in the mission, a full tank gives a large slosh mass with a low natural frequency, strong coupling to attitude and significant disturbance torques.
  • As fuel is used, the slosh mass shrinks, the slosh frequency rises and the coupling becomes more nonlinear.
  • Near depletion, the slosh mode has a small amplitude but a high frequency, and it still causes small, repetitive disturbances.
  • Once the tank is empty, the spacecraft behaves as a rigid body and the controller no longer needs to compensate for a moving mass.

This made the control problem hard in several ways:

  • The coupled dynamics are nonlinear and time-varying (NLTV), because the slosh mass ms(t)m_s(t), the inertia I3(t)=Idry+ms(t)ℓ2I_3(t) = I_{dry} + m_s(t)\ell^2 and the slosh frequency all change as fuel burns.
  • The plant is not linearly parameterizable, because of the sin⁡ϕ\sin\phi term and the time-varying parameters, so a nonlinear MRAC design with a direct Lyapunov proof does not apply.
  • The primary reaction wheel is limited to 0.5 N·m, so a thruster backup limited to 2.0 N·m has to cover larger demands and wheel saturation.
  • The plant is also driven by gravity-gradient torque, and the disturbance model allows for actuator saturation loss and model mismatch.

I treated attitude as a single-axis rotation, modeled slosh as a pendulum analog, and modeled both actuators as ideal torque sources that enter as one combined control input.

Action

Orbit and pointing reference

For a circular orbit, the orbital rate is ωorbit=μ/r3\omega_{orbit} = \sqrt{\mu / r^3}, so the nadir reference angle grows linearly as θd(t)=ωorbitt\theta_d(t) = \omega_{orbit} t (offset by π\pi in the simulation). The gravity-gradient torque comes from the inertia asymmetry:

τgg=3μr3(Idry−I3)sin⁡(2θ)\tau_{gg} = \frac{3\mu}{r^3}\left(I_{dry} - I_3\right)\sin(2\theta)

Lagrangian model of attitude and slosh

I defined an inertial frame and a body frame related by a direction cosine matrix for a rotation θ\theta about n^3\hat{n}_3, and placed a slosh pendulum of length ℓ\ell at angle ϕ\phi from b^1\hat{b}_1. Working in a center-of-mass frame, the Lagrangian is

L=12I3(t)θ˙2+12ms(t)[ℓ˙2+ℓ2(θ˙+ϕ˙)2]−ms(t)geffℓ(1−cos⁡ϕ)\mathcal{L} = \frac{1}{2} I_3(t)\dot{\theta}^2 + \frac{1}{2} m_s(t)\left[\dot{\ell}^2 + \ell^2\left(\dot{\theta} + \dot{\phi}\right)^2\right] - m_s(t) g_{eff} \ell (1 - \cos\phi)

Lagrange's equations give the attitude equation (driven by the control torque τext\tau_{ext}) and the slosh equation, both with terms in m˙s\dot{m}_s and ℓ˙\dot{\ell} that capture fuel depletion. Two generalized coordinates give a 4-state model, x=[θ,θ˙,ϕ,ϕ˙]Tx = [\theta, \dot{\theta}, \phi, \dot{\phi}]^T, in which the control enters the attitude rate with gain +1/Idry+1/I_{dry} and the slosh rate with −1/Idry-1/I_{dry}.

Actuator allocation

The reaction wheel supplies torque first, and the thruster supplies only what is left over:

urw=sat(ucmd, 0.5),uthr=sat(ucmd−urw, 2.0),u=urw+uthru_{rw} = sat\left(u_{cmd},\ 0.5\right), \quad u_{thr} = sat\left(u_{cmd} - u_{rw},\ 2.0\right), \quad u = u_{rw} + u_{thr}

Linearization and reference models

Because the plant is not linearly parameterizable, I used the Lyapunov indirect method. I linearized the model with its Jacobian about the origin to get a time-varying A(t)A(t) and B(t)=[0, 1/Idry, 0, −1/Idry]TB(t) = [0,\ 1/I_{dry},\ 0,\ -1/I_{dry}]^T. The reference model has two decoupled second-order blocks (attitude and slosh) and switches on the fuel fraction α\alpha:

ModeActive whenωn\omega_nζ\zeta
Coupledα>0.05\alpha > 0.052≈1.414\sqrt{2} \approx 1.414 rad/s1/2≈0.7071/\sqrt{2} \approx 0.707 (well damped)
Rigidα≤0.05\alpha \le 0.053≈1.732\sqrt{3} \approx 1.732 rad/s1/3≈0.5771/\sqrt{3} \approx 0.577 (moderately underdamped)

Hybrid control law and adaptation

The gain-scheduled control law is u=−K(α)x+W^Tx+kr(α)ru = -K(\alpha)x + \widehat{W}^T x + k_r(\alpha) r. In coupled mode, the weights follow an adaptive law with σ-modification and projection to [−Wmax,Wmax][-W_{max}, W_{max}], and adaptation is frozen in rigid mode:

W^˙=−ΓxeTPBm−σW^(α>0.05)\dot{\widehat{W}} = -\Gamma x e^T P B_m - \sigma\widehat{W} \quad (\alpha > 0.05)

Lyapunov stability proof

I used the candidate V=eTPe+W~TΓ−1W~V = e^T P e + \widetilde{W}^T \Gamma^{-1} \widetilde{W} with AmTP+PAm=−QA_m^T P + P A_m = -Q. Bounding the cross terms with Young's inequality gives V˙≤−αV+β\dot{V} \le -\alpha V + \beta (here α\alpha is a decay rate, not the fuel fraction), provided

c1=σλmin(Γ−1)−4∥PB∥2xmax2λmin(Q)>0c_1 = \sigma\lambda_{min}\left(\Gamma^{-1}\right) - \frac{4\|PB\|^2 x_{max}^2}{\lambda_{min}(Q)} > 0

The closed loop is therefore uniformly ultimately bounded (UUB), with tracking error bound ϵ=β/(αλmin(P))≈0.318\epsilon = \sqrt{\beta / (\alpha\lambda_{min}(P))} \approx 0.318 rad. For the fuel-depleted mode, I used V2=eTPe+z2V_2 = e^T P e + z^2 with an integral state zz and leakage, which gives βz=0.6\beta_z = 0.6 and δ≈1.05×10−9\delta \approx 1.05 \times 10^{-9}, so that mode is also UUB.

Simulation

I simulated open-loop, PID and MRAC control over a 200 s window with Euler integration at a step of 0.05 s, with gravity-gradient torque injected into the plant and slosh parameters varying with α(t)\alpha(t). The main gains were:

ParameterValue
Feedback gains KK[6 8 4 3] coupled, [10 12 6 5] rigid
Feedforward gain krk_r1.0 coupled, 0.7 rigid
Adaptation gain Γ\Gamma2I42I_4 (1/s)
Leakage σ\sigma0.01 1/s
Weight limit WmaxW_{max}10
PID gainsKp=10K_p = 10, Ki=0.2K_i = 0.2, Kd=4K_d = 4

Result

  • The MRAC controller tracked the nadir reference despite the nonlinear coupling and slosh, and it stayed inside the UUB bound for the full 200 s window after an initial overshoot to about 4 rad near 16 s.
  • The PID controller swung with growing amplitude between about -13 and +12 rad, and the open-loop response drifted slowly upward.
  • The commanded torque reached about ±4 N·m, so the reaction wheel saturated at ±0.5 N·m and the thruster covered the rest up to ±2 N·m. The oscillations shrank after about 150 s.
  • Fuel mass fell from 2 kg to 1.2 kg (a fuel fraction of 0.6) during the window, so slosh stayed active and the adaptive mode ran throughout. The full depletion was modeled over about 500 s.
  • The orbital rate is only about 0.0011 rad/s, so the reference moves about 0.55 rad (about 31°) in 500 s. That slow reference is why slow adaptation is enough.
  • A well-tuned PID with anti-windup can win when the system is slowly varying, nearly LTI and lightly disturbed. The robust adaptive controller wins under strong parameter variation, nonlinear coupling, time-varying inertia and uncertainty, which is this problem.
  • The UUB result is proven for the linearized system, so the nonlinear system is, under standard assumptions, at best locally bounded or practically stable.