Environmental Torques¶
We model four environmental torques: drag, SRP torque, gravity gradient torque, and residual dipole torque. Their relative sizes depend on altitude and spacecraft properties.
Schematic comparison redrawn from the supplied figure in F. Tuttas, Design and Verification of the Attitude Control for Orbital Manoeuvre Phases of the Small Satellite ROMEO, Master’s thesis, December 2021, doi:10.13140/RG.2.2.31214.89927. The figure also includes thrust-vector misalignment, which is outside these four environmental models.
For the same 3U spacecraft, the script simulates one idealized circular orbit at each altitude from 100 to 100,000 km, then averages the magnitude of each torque over that orbit. The smaller spacecraft gives different absolute magnitudes from the ROMEO comparison. The 500 km animations compare its attitude with and without disturbances.
"""Compare four environmental torques on the same 3U spacecraft."""
import matplotlib.pyplot as plt
import numpy as np
import ADCS
from ADCS.helpers.animations import animate_orbit_godot
environment = ADCS.Environment(
atmosphere=ADCS.SMADAtmosphere(), magnetic_field=ADCS.IGRF14(),
)
size = np.array([0.1, 0.3, 0.1])
faces = []
for axis in range(3):
for sign in (-1.0, 1.0):
normal = sign * np.eye(3)[axis]
faces.append(ADCS.disturbances.GeometryFace(
area=np.prod(np.delete(size, axis)),
centroid=0.5 * size[axis] * normal,
normal=normal, CD=2.2,
eta_s=0.3, eta_d=0.3, eta_a=0.4,
))
geometry = ADCS.disturbances.GeometryConfig(faces)
drag = ADCS.disturbances.Drag_Disturbance(geometry)
srp = ADCS.disturbances.SRP_Disturbance(geometry)
gravity_gradient = ADCS.disturbances.GG_Disturbance()
dipole = ADCS.disturbances.Dipole_Disturbance(np.array([0.01, 0.0, 0.0]))
disturbances = [drag, srp, gravity_gradient, dipole]
inertia = np.diag([0.0333, 0.00667, 0.0333])
satellite = ADCS.Satellite(
mass=4.0, COM=np.array([0.0, 0.02, 0.0]),
J_0=inertia, disturbances=disturbances,
)
quiet_satellite = ADCS.Satellite(
mass=4.0, COM=np.array([0.0, 0.02, 0.0]), J_0=inertia,
)
initial_state = ADCS.State(
q=np.array([1.0, 0.0, 0.0, 0.0]), w=np.zeros(3),
)
radius = 6878.1363 # 500 km altitude
orbit = ADCS.Orbital_State(
environment=environment, J2000=0.22,
R=np.array([radius, 0.0, 0.0]),
V=np.array([0.0, np.sqrt(398600.4415 / radius), 0.0]),
)
results = ADCS.simulate(
x=initial_state, satellite=satellite, os0=orbit,
environment=environment, dt=20.0, tf=5400.0,
)
quiet_results = ADCS.simulate(
x=initial_state, satellite=quiet_satellite, os0=orbit,
environment=environment, dt=20.0, tf=5400.0,
)
altitudes = np.geomspace(100.0, 100000.0, 24) # km
models = (("Drag", drag), ("SRP", srp),
("Gravity gradient", gravity_gradient),
("Residual dipole", dipole))
mean_torques = np.empty((len(altitudes), len(models)))
for i, altitude in enumerate(altitudes):
radius = 6378.1363 + altitude
period = 2 * np.pi * np.sqrt(radius**3 / 398600.4415)
orbit = ADCS.Orbital_State(
environment=environment, J2000=0.22,
R=np.array([radius, 0.0, 0.0]),
V=np.array([0.0, np.sqrt(398600.4415 / radius), 0.0]),
)
sweep = ADCS.simulate(
x=initial_state, satellite=satellite, os0=orbit,
environment=environment, dt=period / 96, tf=period,
)
run = sweep.first()
for j, (_, model) in enumerate(models):
magnitudes = [
np.linalg.norm(
model.torque(state, orbital_state) if model is dipole else
model.torque(satellite, state, orbital_state)
)
for state, orbital_state in zip(run.state_hist, run.os_hist)
]
mean_torques[i, j] = np.mean(magnitudes)
for j, (label, _) in enumerate(models):
# The atmosphere model has vanishingly small tails at high altitude.
positive = mean_torques[:, j] > 1e-13
plt.loglog(mean_torques[positive, j], altitudes[positive], label=label)
plt.xlabel("Mean torque magnitude [N m]")
plt.ylabel("Altitude [km]")
plt.xlim(1e-13, 1e-4)
plt.ylim(80, 150000)
plt.yticks([1e2, 1e3, 1e4, 1e5], [r"$10^2$", r"$10^3$", r"$10^4$", r"$10^5$"])
plt.grid(True, which="major", alpha=0.3)
plt.legend(loc="upper right")
plt.show()
animate_orbit_godot(
results=results, overlays=[], graphics_quality="high",
)
animate_orbit_godot(
results=quiet_results, overlays=[], graphics_quality="high",
)
With disturbances
Without disturbances
For high-accuracy pointing, a controller can compensate predicted torques with feedforward, estimate them with an onboard Kalman filter, or combine both.
Tips and tricks
Keep the same orbit and initial attitude when comparing disturbance models:
run = results.first()
quiet_run = quiet_results.first()
Mission Recommendations
Aerodynamic drag: Place the centre of mass near the aerodynamic centre of pressure; for a symmetric bus, this is often near its geometric centre. Reduce projected area along the flight direction and avoid unnecessary exposed area. A higher orbit reduces atmospheric density and drag torque.
Solar radiation pressure: Keep the centre of mass near the optical centre of pressure and limit exposed area where the mission permits. Less specular reflection can reduce the normal force on a sunlit face; check the complete surface model because the net torque also depends on illumination and geometry.
Gravity gradient: Choose a mass distribution with smaller differences between principal moments if the aim is to reduce this torque. Aligning a principal axis with nadir also reduces the torque at the intended attitude. A deliberately elongated spacecraft may instead use gravity gradient for passive stabilization.
Residual magnetic dipole: Minimize current-loop area, route outgoing and return currents close together, and control magnetic materials and component placement. Some residual moment remains, so measure it and include it in the pointing budget.
These are design directions, not universal optima: projected area, coatings, altitude, and inertia also serve mission requirements. See the spacecraft attitude reference hosted by NASA (Chapter 5) and NASA SP-8018, Spacecraft Magnetic Torques.