Skip to content

BdotFiniteDiff

Defined in: bdot.rs:231

pub struct BdotFiniteDiff\<F: [MagneticFieldModel](../../../../tobari/api/traits/magneticfieldmodel/) = [tobari::magnetic::TiltedDipole](../../../../tobari/api/structs/tilteddipole/), Fr: [EarthFixedTransform](../../../../arika/api/traits/earthfixedtransform/) = [frame::SimpleEci](../../../../arika/api/type-aliases/simpleeci/)\>

B-dot controller using finite-difference dB/dt estimation.

Unlike BdotCross which estimates dB/dt via the cross-product -omega x B_body, this controller measures the actual magnetic field at each sample time and computes dB/dt via backward finite difference. This is more realistic (flight software only sees magnetometer readings) but introduces a one-sample delay and produces zero command on the first call.

When no epoch is available, returns zero command.

Fr is the inertial frame the geomagnetic field is evaluated in, as for BdotCross.

fn new(gain: f64, max_moment: Vector3<f64>, field: F, sample_period: f64) -> Self

Create a new finite-difference B-dot controller in the default SimpleEci frame.

max_moment is per-axis maximum [A·m²] for a 3-axis MTQ.

Panics if gain is negative, any component of max_moment is negative, or sample_period is not positive.


fn new_in_frame(gain: f64, max_moment: Vector3<f64>, field: F, sample_period: f64, eop: ::EopStorage) -> Self

Create a finite-difference B-dot controller that samples the field in an arbitrary inertial frame Fr, with that frame’s EOP storage (() for SimpleEci).

Panics if gain is negative, any component of max_moment is negative, or sample_period is not positive.