ADCS.controller.bdot module

class ADCS.controller.bdot.BDot(est_sat, gain)[source]

Bases: Controller

Implements the B-Dot magnetic detumbling controller.

This class provides an implementation of the classical B-Dot control law, which is commonly used during the early mission phase of a satellite to reduce angular velocity after deployment. The controller relies exclusively on magnetometer measurements and magnetorquer actuators, exploiting the interaction between the spacecraft magnetic dipole moment and the Earth’s geomagnetic field.

The B-Dot controller is stateless with respect to the satellite attitude and angular velocity estimates and instead uses the time derivative of the measured magnetic field expressed in the body frame.

Control Law

The requested magnetic dipole moment is given by

\[\mathbf{m}_{\mathrm{req}} = -K \, \dot{\mathbf{B}}\]

where

Symbol

Description

mathbf{m}

Magnetic dipole moment (A m^2)

K

Positive scalar control gain

mathbf{B}

Magnetic field vector in body frame (T)

The magnetic torque generated by the magnetorquers is

\[\boldsymbol{\tau} = \mathbf{m} \times \mathbf{B}\]

Substituting the B-Dot control law yields

\[\boldsymbol{\tau} = -K \left( \dot{\mathbf{B}} \times \mathbf{B} \right)\]

For a tumbling satellite, the dominant contribution to the magnetic field derivative is due to body rotation:

\[\dot{\mathbf{B}} \approx \boldsymbol{\omega} \times \mathbf{B}\]

which produces a dissipative torque opposing angular velocity components perpendicular to the geomagnetic field.

Hardware Dependencies

This controller requires the following hardware interfaces to be defined in EstimatedSatellite:

  1. At least one magnetometer of type MTM

  2. At least one magnetorquer of type MTQ

Sensor and Actuator Mapping

Internally, the controller constructs:

  • A sensor reconstruction matrix using the Moore–Penrose pseudoinverse to map raw magnetometer measurements to a three-dimensional magnetic field vector

  • An actuation matrix to map desired magnetic dipole moments to actuator commands, allowing for redundant or non-orthogonal magnetorquers

Parameters:
find_u(x_hat, sens, est_sat, os_hat, goal=None)[source]

Computes the B-Dot control command.

This method evaluates the magnetic detumbling control law at the current time step using raw magnetometer measurements and orbital timing information.

Algorithm

  1. Magnetic Field Reconstruction

    Raw sensor measurements y are mapped to the body-frame magnetic field vector using the sensor reconstruction matrix:

    \[\mathbf{B}_k = M_{\mathrm{read}} \, \mathbf{y}\]
  2. Discrete-Time Magnetic Field Derivative

    The time derivative of the magnetic field is approximated using a backward finite difference:

    \[\dot{\mathbf{B}}_k \approx \frac{\mathbf{B}_k - \mathbf{B}_{k-1}}{\Delta t}\]

    where the time step Delta t is computed from the J2000 timestamps provided by Orbital_State and converted to seconds using TimeConstants.

  3. Desired Magnetic Dipole Moment

    The B-Dot control law is applied:

    \[\mathbf{m}_{\mathrm{req}} = -K \, \dot{\mathbf{B}}_k\]
  4. Actuator Command Mapping

    The desired dipole moment is converted to actuator commands using the actuator mapping matrix:

    \[\mathbf{u} = M_{\mathrm{act}} \, \mathbf{m}_{\mathrm{req}}\]
  5. Actuator Saturation

    The actuator commands are limited according to magnetorquer capabilities using limit().

Parameters:
  • x_hat (np.ndarray) – Estimated state vector, not used by the B-Dot controller

  • sens (np.ndarray) – Raw sensor measurement vector

  • est_sat (EstimatedSatellite) – Estimated satellite object required by the controller interface

  • os_hat (Orbital_State) – Orbital state estimate providing timing information

  • goal (Goal)

Returns:

Actuator command vector for magnetorquers

Return type:

np.ndarray