Gravity Gradient Torque¶
Long axis near nadir
Wide axis near nadir
Earth pulls slightly more strongly on the near side of an elongated spacecraft. The resulting gravity-gradient torque can passively keep its long axis near nadir. Here both cases start 10° from alignment at 500 km altitude and rotate with the orbit. Green marks the long body axis; yellow points to nadir. With no damping, the stable case librates rather than settling exactly at nadir.
The body-frame gravity-gradient torque is
where \(r\) is the distance from Earth’s centre and
\(\hat{\mathbf n}^{\mathcal B}\) points toward Earth. See
ADCS.satellite_hardware.disturbances.gg_disturbance.GG_Disturbance.torque().
"""Compare stable and unstable gravity-gradient orientations of a 3U satellite."""
import numpy as np
import ADCS
from ADCS.helpers.animations import animate_orbit_godot
from ADCS.helpers.animations.godot.overlays import Arrow, Triad
environment = ADCS.Environment()
gravity_gradient = ADCS.disturbances.GG_Disturbance()
satellite = ADCS.Satellite(
mass=4.0,
COM=np.zeros(3),
J_0=np.diag([0.0333, 0.00667, 0.0333]),
disturbances=[gravity_gradient],
)
radius = 6878.1363 # km: 500 km altitude
mu = 398600.4415 # km^3/s^2
orbital_rate = np.sqrt(mu / radius**3)
orbit = ADCS.Orbital_State(
environment=environment, J2000=0.22,
R=np.array([radius, 0.0, 0.0]),
V=np.array([0.0, np.sqrt(mu / radius), 0.0]),
)
runs = {}
for label, angle_deg in (("Long axis near nadir", -80.0),
("Wide axis near nadir", 10.0)):
angle = np.deg2rad(angle_deg)
initial_state = ADCS.State(
q=np.array([np.cos(angle / 2), 0.0, 0.0, np.sin(angle / 2)]),
w=np.array([0.0, 0.0, orbital_rate]),
)
results = ADCS.simulate(
x=initial_state, satellite=satellite, os0=orbit,
environment=environment, dt=20.0, tf=6000.0,
)
runs[label] = results.first()
animate_orbit_godot(
results=results,
overlays=[
Triad(frame="body", px=110),
Arrow("@nadir", color="#facc15", scale="fixed_px", px=150),
],
graphics_quality="high",
)
Night vision
Click the binoculars button at the top right of the Godot viewer to keep the spacecraft visible while it passes through Earth’s shadow.
Torque magnitude¶
The torque magnitude is small near alignment. In the unstable case, it initially grows as the spacecraft turns away.
import matplotlib.pyplot as plt
for label, run in runs.items():
magnitude = [
np.linalg.norm(gravity_gradient.torque(satellite, state, orbital_state))
for state, orbital_state in zip(run.state_hist, run.os_hist)
]
plt.plot(np.asarray(run.time_s) / 60, np.asarray(magnitude) * 1e9,
label=label)
plt.xlabel("Time [min]")
plt.ylabel("Gravity-gradient torque [nN m]")
plt.legend()
plt.show()
Tips and tricks
Query the body-frame torque at a saved simulation step:
run = runs["Long axis near nadir"]
torque_body = gravity_gradient.torque(
satellite, run.state_hist[0], run.os_hist[0]
)