Magnetorquer

Illustration of Earth's magnetic field lines.

Geodynamo field lines, Wikimedia Commons (public domain).

A magnetorquer creates a magnetic dipole \(\mathbf m^{\mathcal B}\). Its torque comes from the local field \(\mathbf B^{\mathcal B}\):

\[\boldsymbol\tau_{\mathrm{MTQ}}^{\mathcal B} = \mathbf m^{\mathcal B}\times\mathbf B^{\mathcal B}.\]

See ADCS.satellite_hardware.actuators.magnetotorquer.MTQ.torque(). The cross product gives torque perpendicular to the field, so there is no instantaneous torque along \(\mathbf B^{\mathcal B}\). The simple ADCS.controller.bdot.BDot controller commands \(\mathbf m^{\mathcal B}=-K\dot{\mathbf B}^{\mathcal B}\) to slow a tumbling spacecraft. The field changes along the orbit, so the available torque direction changes too.

The plot covers roughly one orbit. The animation shows the first 30 minutes, with Earth visible and the spacecraft kept lit by Godot’s night vision mode.

magnetorquer_godot.py
"""Detumble a 3U spacecraft with B-dot magnetorquer control."""

import numpy as np
import ADCS
from ADCS.helpers.animations import animate_orbit_godot


environment = ADCS.Environment(magnetic_field=ADCS.IGRF14())
satellite = ADCS.Satellite(
    mass=4.0, J_0=np.diag([0.0333, 0.00667, 0.0333]),
    actuators=[ADCS.MTQ(axis, max_torque=0.2) for axis in np.eye(3)],
    sensors=[ADCS.MTM(axis) for axis in np.eye(3)],
)
orbit = ADCS.Orbital_State(
    environment=environment, J2000=0.22,
    R=np.array([6878.1363, 0.0, 0.0]),
    V=np.array([0.0, 7.6126, 0.0]),
)
results = ADCS.simulate(
    x=ADCS.State(w=np.array([0.0, 0.08, 0.0]), q=np.array([1.0, 0.0, 0.0, 0.0])),
    satellite=satellite, controller=ADCS.controller.BDot(satellite, gain=5e4),
    os0=orbit, environment=environment, dt=5.0, tf=5400.0,
)

ADCS.plot(results, ADCS.plots.AngularVelocityPlotCombined(sources=["real"]), layout=(1, 1))
animate_orbit_godot(results=results, overlays=[], graphics_quality="high")
A tumbling MiRaTa spacecraft slows under B-dot magnetorquer control, with Earth visible in night vision mode. Spacecraft body angular velocity falls under B-dot control.

Tips and tricks

B-dot uses magnetometer readings; one sensor and one torquer along each body axis make the three-dimensional field and dipole accessible. Click the viewer’s night vision button to match the animation.

sensors = [ADCS.MTM(axis) for axis in np.eye(3)]
actuators = [ADCS.MTQ(axis, max_torque=0.2) for axis in np.eye(3)]