C++ Module: inertialCartFeedback
Executive Summary
The inertialCartFeedback module computes an inertial-frame deputy force command for translational tracking of a desired deputy inertial state.
This module uses Lyapunov control theory described in chapter 14 of Analytical Mechanics of Space Systems.
The control force \(\mathbf{F}_N\) used in this module is found through Eq. (1):
where
\(m_d\) is the deputy mass, and a superscript * denotes the desired state.
The gravity-difference term is found using:
Message Connection Descriptions
The following diagram and table list all the module input and output messages. The module message connection is set by the user from Python. The message type contains a link to the message structure definition, while the description provides information on what this message is used for.
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
deputyNavInMsg |
Deputy inertial position and velocity input msg |
|
deputyRefInMsg |
Deputy inertial reference state input msg containing desired position, velocity, and total inertial acceleration |
|
deputyVehicleConfigInMsg |
Deputy spacecraft configuration input msg |
|
forceOutMsg |
Inertial force command output msg |
User Guide
This section outlines the steps needed to set up the inertialCartFeedback module in Python using Basilisk.
Import the module:
from Basilisk.fswAlgorithms import inertialCartFeedback
Create an instance of
InertialCartFeedback:module = inertialCartFeedback.InertialCartFeedback()
Set gain matrices using row-major flattened 3x3 lists:
K = [2.0e-5, 0.0, 0.0, 0.0, 3.0e-5, 0.0, 0.0, 0.0, 4.0e-5] P = [5.0e-2, 0.0, 0.0, 0.0, 6.0e-2, 0.0, 0.0, 0.0, 7.0e-2] module.setK(K) module.setP(P)
(Optional) set
mufor gravity compensation:module.setMu(3.986004418e14)
Add the module to a task:
unitTestSim.AddModelToTask(unitTaskName, module)
-
class InertialCartFeedback : public SysModel
- #include <inertialCartFeedback.h>
Inertial Cartesian translational feedback controller for deputy desired-state tracking.
Public Functions
-
InertialCartFeedback() = default
This is the constructor for the module class.
-
~InertialCartFeedback() = default
This is the destructor for the module class.
-
void SelfInit()
Self initialization method for the c-wrapped message.
-
void Reset(uint64_t CurrentSimNanos)
This method is used to reset the module and checks that required input messages are connected.
-
void UpdateState(uint64_t CurrentSimNanos)
This is the main method that gets called every time the module is updated. It computes the inertial force for the relative motion control.
-
void setMu(const double value)
setter for
mu
-
inline double getMu() const
getter for
mu
-
void setK(const std::vector<double> &value)
setter for
K
-
void setP(const std::vector<double> &value)
setter for
P
Public Members
deputy translational navigation input msg
-
ReadFunctor<TransRefMsgPayload> deputyRefInMsg
deputy translational reference input msg
-
ReadFunctor<VehicleConfigMsgPayload> deputyVehicleConfigInMsg
deputy spacecraft mass/config input msg
-
Message<CmdForceInertialMsgPayload> forceOutMsg
inertial force command output msg
-
CmdForceInertialMsg_C forceOutMsgC = {}
C-wrapped inertial force command output msg.
-
BSKLogger bskLogger
BSK logging interface.
-
InertialCartFeedback() = default