smallBodyWaypointFeedback#
Executive Summary#
This module is provides a feedback control law for waypoint-to-waypoint control about a small body. The waypoints are defined in the Hill frame of the body.
Message Connection Descriptions#
The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg 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 |
---|---|---|
navTransInMsg |
NavTransMsgPayload |
translational navigation input message |
navAttInMsg |
NavAttMsgPayload |
attitude navigation input message |
asteroidEphemerisInMsg |
EphemerisMsgPayload |
asteroid ephemeris input message |
sunEphemerisInMsg |
EphemerisMsgPayload |
sun ephemeris input message |
forceOutMsg |
CmdForceBodyMsgPayload |
force command output |
forceOutMsgC |
CmdForceBodyMsgPayload |
C-wrapped force output message |
Detailed Module Description#
General Function#
The smallBodyWaypointFeedback()
module provides a solution for waypoint-to-waypoint control about a small body. The feedback
control law is similar to the cartesian coordinate continuous feedback control law in Chapter 14 of Analytical Mechanics of Space Systems.
A cannonball SRP model, third body perturbations from the sun, and point-mass gravity are utilized. The state inputs are
messages written out by simpleNav and planetNav modules or an estimator that provides the same input messages.
Algorithm#
The state vector is defined as follows:
The associated frame definitions may be found in the following table.
Frame Description |
Frame Definition |
---|---|
Small Body Hill Frame |
\(O: \{\hat{\mathbf{o}}_1, \hat{\mathbf{o}}_2, \hat{\mathbf{o}}_3\}\) |
Spacecraft Body Frame |
\(B: \{\hat{\mathbf{b}}_1, \hat{\mathbf{b}}_2, \hat{\mathbf{b}}_3\}\) |
The derivation of the control law is skipped here for brevity. The thrust, however, is computed as follows:
The relative velocity dynamics are described in detail by Takahashi and Scheeres.
User Guide#
A detailed example of the module is provided in scenarioSmallBodyFeedbackControl. However, the initialization of the module is also shown here. The module is first initialized as follows:
waypointFeedback = smallBodyWaypointFeedback.SmallBodyWaypointFeedback()
The asteroid ephemeris input message is then connected. In this example, we use the planetNav module.
waypointFeedback.asteroidEphemerisInMsg.subscribeTo(planetNavMeas.ephemerisOutMsg)
A standalone message is created for the sun ephemeris message.
sunEphemerisMsgData = messaging.EphemerisMsgPayload()
sunEphemerisMsg = messaging.EphemerisMsg()
sunEphemerisMsg.write(sunEphemerisMsgData)
waypointFeedback.sunEphemerisInMsg.subscribeTo(sunEphemerisMsg)
The navigation attitude and translation messages are then subscribed to
waypointFeedback.navAttInMsg.subscribeTo(simpleNavMeas.attOutMsg)
waypointFeedback.navTransInMsg.subscribeTo(simpleNavMeas.transOutMsg)
Finally, the area, mass, inertia, and gravitational parameter of the asteroid are initialized
waypointFeedback.A_sc = 1. # Surface area of the spacecraft, m^2
waypointFeedback.M_sc = mass # Mass of the spacecraft, kg
waypointFeedback.IHubPntC_B = unitTestSupport.np2EigenMatrix3d(I) # sc inertia
waypointFeedback.mu_ast = mu # Gravitational constant of the asteroid
The reference states are then defined:
waypointFeedback.x1_ref = [-2000., 0., 0.]
waypointFeedback.x2_ref = [0.0, 0.0, 0.0]
Finally, the feedback gains are set:
waypointFeedback.K1 = unitTestSupport.np2EigenMatrix3d([5e-4, 0e-5, 0e-5, 0e-5, 5e-4, 0e-5, 0e-5, 0e-5, 5e-4])
waypointFeedback.K2 = unitTestSupport.np2EigenMatrix3d([1., 0., 0., 0., 1., 0., 0., 0., 1.])
Class SmallBodyWaypointFeedback#
-
class SmallBodyWaypointFeedback : public SysModel#
This module is provides a Lyapunov feedback control law for waypoint to waypoint guidance and control about a small body. The waypoints are defined in the Hill frame of the body.
Public Functions
-
SmallBodyWaypointFeedback()#
This is the constructor for the module class. It sets default variable values and initializes the various parts of the model
-
void reset(uint64_t currentSimNanos)#
This method is used to reset the module and checks that required input messages are connect.
- Returns:
void
-
void updateState(uint64_t currentSimNanos)#
This is the main method that gets called every time the module is updated. Provide an appropriate description.
- Returns:
void
-
void readMessages()#
This method reads the input messages each call of updateState
- Returns:
void
-
void computeControl(uint64_t currentSimNanos)#
This method computes the control using a Lyapunov feedback law
- Returns:
void
-
void writeMessages(uint64_t currentSimNanos)#
This method reads the input messages each call of updateState
- Returns:
void
Public Members
translational navigation input message
attitude navigation input message
-
ReadFunctor<EphemerisMsgPayload> asteroidEphemerisInMsg#
asteroid ephemeris input message
-
ReadFunctor<EphemerisMsgPayload> sunEphemerisInMsg#
sun ephemeris input message
-
Message<CmdForceBodyMsgPayload> forceOutMsg#
force command output
-
BSKLogger bskLogger#
— BSK Logging
-
double C_SRP#
SRP scaling coefficient.
-
double P_0#
SRP at 1 AU.
-
double rho#
Surface reflectivity.
-
double A_sc#
Surface area of the spacecraft.
-
double M_sc#
Mass of the spacecraft.
-
Eigen::Matrix3d IHubPntC_B#
sc inertia
-
double mu_ast#
Gravitational constant of the asteroid.
-
Eigen::Vector3d x1_ref#
Desired Hill-frame position.
-
Eigen::Vector3d x2_ref#
Desired Hill-frame velocity.
-
Eigen::Matrix3d K1#
Position gain.
-
Eigen::Matrix3d K2#
Velocity gain.
-
SmallBodyWaypointFeedback()#