ADCS.helpers.plotting.plot_controller module¶
- ADCS.helpers.plotting.plot_controller.plot_control(time, u_hist, title='Control Effort Over Time', units='Command')[source]¶
Plot time histories of spacecraft control commands.
This function visualizes actuator or control-command outputs as a function of time. Each control channel is plotted as a separate curve, enabling direct comparison of magnitudes, trends, and relative activity among actuators.
Mathematical Context¶
Let the control input vector be
\[\mathbf{u}(t) = \begin{bmatrix} u_1(t) & u_2(t) & \dots & u_M(t) \end{bmatrix}^T\]where \(M\) is the number of control channels (e.g., reaction wheels, magnetorquers, thrusters).
Given discrete time samples \(t_i\), the function plots
\[u_j(t_i), \qquad i = 1, \dots, N,\; j = 1, \dots, M\]on a shared set of axes.
Visualization Details¶
Each control channel is labeled as \(u_1, u_2, \dots, u_M\)
The y-axis units are user-configurable
A grid and legend are automatically enabled
- param time:
One-dimensional array of time stamps in seconds.
- type time:
numpy.ndarray
- param u_hist:
Control command history. Each column corresponds to one control channel.
- type u_hist:
numpy.ndarray
- param title:
Title displayed at the top of the plot.
- type title:
str
- param units:
Units of the control command shown on the y-axis.
- type units:
str
- return:
None. The function creates a Matplotlib figure.
- rtype:
None
- Parameters:
time (ndarray)
u_hist (ndarray)
title (str)
units (str)
- Return type:
None
- ADCS.helpers.plotting.plot_controller.plot_rw_momentum(time, state_hist, title='Reaction Wheel Stored Momentum', units='N·m·s')[source]¶
Plot reaction wheel stored angular momentum over time.
This function extracts reaction wheel momentum states from the spacecraft state history and visualizes their evolution. It is commonly used to evaluate momentum buildup, desaturation events, and long-term actuator usage.
State Vector Assumption¶
The spacecraft state vector is assumed to be ordered as
\[\begin{split}\mathbf{x} = \begin{bmatrix} \boldsymbol{\omega} \\ \mathbf{q} \\ \mathbf{h}_{\text{rw}} \end{bmatrix}\end{split}\]where:
\(\boldsymbol{\omega} \in \mathbb{R}^3\) is body angular rate
\(\mathbf{q} \in \mathbb{R}^4\) is the attitude quaternion
\(\mathbf{h}_{\text{rw}} \in \mathbb{R}^{N_{\text{rw}}}\) is the reaction wheel stored angular momentum
The reaction wheel momentum components are assumed to begin at index 7.
Mathematical Meaning¶
For each reaction wheel \(k\), the plotted quantity is
\[h_k(t_i), \qquad i = 1, \dots, N\]expressed in units of angular momentum.
- param time:
One-dimensional array of time stamps in seconds.
- type time:
numpy.ndarray
- param state_hist:
Spacecraft state history containing reaction wheel momentum states.
- type state_hist:
numpy.ndarray
- param title:
Title displayed at the top of the plot.
- type title:
str
- param units:
Units of stored momentum shown on the y-axis.
- type units:
str
- return:
None. The function creates a Matplotlib figure.
- rtype:
None
- Parameters:
time (ndarray)
state_hist (ndarray)
title (str)
units (str)
- Return type:
None