Module: jointMotionCompensator
Executive Summary
The jointMotionCompensator module determines the hub torques required to negate the effect of hinged joint motor torques on the spacecraft hub motion.
Note
This module is designed to work for systems with multiple spacecraft, however, each spacecraft must be comprised of six degree-of-freedom rigid hub with attached hinged joints only.
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 |
|---|---|---|
massMatrixInMsg |
system mass matrix input msg |
|
reactionForcesInMsg |
joint reaction forces and torques input msg |
|
jointTorqueInMsgs |
vector of joint motor torque input msgs |
|
hubTorqueOutMsgs |
vector of hub torque output msgs |
User Guide
This section is to outline the steps needed to setup the jointMotionCompensator module in Python using Basilisk.
Import the jointMotionCompensator class:
from Basilisk.fswAlgorithms import jointMotionCompensator
Create an instance of jointMotionCompensator:
module = jointMotionCompensator.JointMotionCompensator()
(Optional) Set the maximum hub torque values:
uMax = [0.03] * (3 * numSpacecraft) module.setUMax(uMax)
For each spacecraft in the system, add a spacecraft to the module:
module.addSpacecraft()
For each hinged joint in the system, add a hinged joint to the module:
module.addHingedJoint()
Add the module to the task list:
unitTestSim.AddModelToTask(unitTaskName, module)
-
class JointMotionCompensator : public SysModel
- #include <jointMotionCompensator.h>
This module determines the hub torques required to negate the reaction torques induced by moving joints on a spacecraft.
Public Functions
-
JointMotionCompensator() = default
This is the constructor for the module class.
-
~JointMotionCompensator() = default
This is the destructor for the module class.
-
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 hub torques needed to negate the reaction torques induced by moving joints.
-
void setUMax(std::vector<double>)
setter for
uMaxproperty
-
inline std::vector<double> getUMax() const
getter for
uMaxproperty
-
void addSpacecraft()
method for adding a new spacecraft to the system
-
void addHingedJoint()
method for adding a new hinged joint to the system
Public Members
-
ReadFunctor<MJSysMassMatrixMsgPayload> massMatrixInMsg
system mass matrix input msg
-
ReadFunctor<MJJointReactionsMsgPayload> reactionForcesInMsg
joint reaction forces and torques input msg
-
std::vector<ReadFunctor<SingleActuatorMsgPayload>> jointTorqueInMsgs
vector of joint motor torque input msgs
-
std::vector<Message<SingleActuatorMsgPayload>*> hubTorqueOutMsgs
vector of hub torque output msgs
-
BSKLogger bskLogger
BSK Logging.
Private Members
-
std::vector<double> uMax = {}
[Nm] (optional) maximum hub motor torque
-
int numSpacecraft = 0
[-] number of spacecraft in the system
-
int numHingedJoints = 0
[-] number of hinged joints in the system
-
bool treeInfoInitialized = false
[-] flag indicating if the treeInfo struct has been initialized
-
struct TreeInfo
-
JointMotionCompensator() = default