ADCS.satellite_hardware.sensors.gyro module

class ADCS.satellite_hardware.sensors.gyro.Gyro(axis, sample_time=0.1, bias=None, noise=None, estimate_bias=False)[source]

Bases: Sensor

Single–axis gyroscope sensor model.

This class implements a body–fixed single–axis angular rate sensor that measures the projection of the spacecraft angular velocity vector onto a specified measurement axis.

The gyroscope model follows the generic sensor interface defined in Sensor.

Measurement model

Let the spacecraft angular velocity expressed in the body frame be

\[\boldsymbol{\omega} = \begin{bmatrix} \omega_x & \omega_y & \omega_z \end{bmatrix}^\top.\]

The clean (ideal) gyroscope measurement is

\[y_{\text{clean}} = \boldsymbol{\omega}^\top \hat{\mathbf{a}},\]

where \(\hat{\mathbf{a}}\) is the unit measurement axis of the gyroscope.

Including bias and noise, the full measurement is

\[z = \boldsymbol{\omega}^\top \hat{\mathbf{a}} + b + n,\]

with:

Symbol

Description

\(b\)

Scalar gyroscope bias

\(n\)

Scalar measurement noise

Bias and noise are modeled using Bias and Noise.

param axis:

Body–frame measurement axis, shape (3,). The axis is normalized internally to ensure unit magnitude.

type axis:

numpy.ndarray

param sample_time:

Sampling period of the gyroscope in seconds.

type sample_time:

float

param bias:

Gyroscope bias model. If None, a zero-bias model is used.

type bias:

Bias or None

param noise:

Gyroscope noise model. If None, a zero-noise model is used.

type noise:

Noise or None

param estimate_bias:

Indicates whether the gyroscope bias is included in the estimated filter state.

type estimate_bias:

bool

return:

None

rtype:

None

Notes

  • This sensor measures angular rate only and is not an attitude sensor.

  • The angular velocity is assumed to occupy the first three elements of the system state vector.

basestate_jac(x, os)[source]

Jacobian of the clean gyroscope measurement with respect to the base (non-bias) system states.

The clean measurement depends only on angular velocity:

\[y_{\text{clean}} = \boldsymbol{\omega}^\top \hat{\mathbf{a}}.\]

Therefore,

\[\frac{\partial y_{\text{clean}}}{\partial \boldsymbol{\omega}} = \hat{\mathbf{a}}, \qquad \frac{\partial y_{\text{clean}}}{\partial \mathbf{q}} = \mathbf{0}_{4 \times 1},\]

where \(\mathbf{q}\) is the attitude quaternion.

The resulting Jacobian is

\[\begin{split}\mathbf{H}_x = \begin{bmatrix} \hat{\mathbf{a}} \\ \mathbf{0}_{4 \times 1} \end{bmatrix} \in \mathbb{R}^{7 \times 1}.\end{split}\]
Parameters:
  • x (numpy.ndarray) – Full system state vector.

  • os (Orbital_State) – Orbital state object (unused).

Returns:

Base–state Jacobian matrix of shape (7, 1).

Return type:

numpy.ndarray

bias_jac(x, os)[source]

Jacobian of the gyroscope measurement with respect to the bias state.

When a bias model is present, the measurement equation is

\[z = y_{\text{clean}} + b,\]

where \(b\) is a scalar bias term.

The Jacobian with respect to the bias is therefore

\[\mathbf{H}_b = \frac{\partial z}{\partial b} = \begin{bmatrix} 1 \end{bmatrix}.\]

If no bias model is included, an empty Jacobian is returned.

Parameters:
  • x (numpy.ndarray) – Full system state vector (unused).

  • os (Orbital_State) – Orbital state object (unused).

Returns:

(1, 1) matrix containing 1 if a bias model exists; otherwise a (0, 1) empty matrix.

Return type:

numpy.ndarray

clean_reading(x, os)[source]

Compute the clean (bias– and noise–free) gyroscope measurement.

The angular velocity is extracted from the system state vector as

\[\boldsymbol{\omega} = x_{0:3},\]

and projected onto the sensor axis:

\[y_{\text{clean}} = \boldsymbol{\omega}^\top \hat{\mathbf{a}}.\]
Parameters:
  • x (numpy.ndarray) – Full system state vector. The first three elements must correspond to the body–frame angular velocity vector \(\boldsymbol{\omega}\).

  • os (Orbital_State) – Orbital state object. This argument is unused by the gyroscope and is provided for interface consistency.

Returns:

Clean single–axis angular rate measurement.

Return type:

numpy.ndarray

Parameters:
  • axis (ndarray)

  • sample_time (float)

  • bias (Bias)

  • noise (Noise)

  • estimate_bias (bool)