Module: hingedJointArrayMotor
Executive Summary
The hingedJointArrayMotor module determines the motor torques for an array of hinged joints based on commanded angles and the current system configuration.
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. Additionally, the math assumes the reaction torques experienced by the hub due to the hinged joint motion are cancelled.
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 |
|
desJointStatesInMsg |
Desired joint states input msg |
|
jointStatesInMsg |
Vector of joint state input msgs |
|
jointStateDotsInMsg |
Vector of joint state derivative input msgs |
|
motorTorquesOutMsg |
Vector of joint motor torque output msgs |
User Guide
This section is to outline the steps needed to setup the hingedJointArrayMotor module in Python using Basilisk.
Import the hingedJointArrayMotor class:
from Basilisk.fswAlgorithms import hingedJointArrayMotor
Create an instance of hingedJointArrayMotor:
module = hingedJointArrayMotor.HingedJointArrayMotor()
Set the control gains:
Ktheta = 10.0 * np.eye(numJoints * numSpacecraft) Ptheta = 2.0 * np.sqrt(10.0) * np.eye(numJoints * numSpacecraft) module.setKtheta(Ktheta.flatten().tolist()) module.setPtheta(Ptheta.flatten().tolist())
(Optional) set the maximum motor torque values:
uMax = [0.03] * (numJoints * numSpacecraft) module.setUMax(uMax)
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 HingedJointArrayMotor : public SysModel
- #include <hingedJointArrayMotor.h>
This module determines the motor torques for an array of hinged joints based on commanded angles and the current system status.
Public Functions
-
HingedJointArrayMotor() = default
This is the constructor for the module class.
-
~HingedJointArrayMotor() = 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 motor torques for the full array of hinged joints.
-
void setKtheta(std::vector<double>)
setter for
Kthetaproperty
-
void setPtheta(std::vector<double>)
setter for
Pthetaproperty
-
void setUMax(std::vector<double>)
setter for
uMaxproperty
-
inline std::vector<double> getUMax() const
getter for
uMaxproperty
-
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
-
ReadFunctor<JointArrayStateMsgPayload> desJointStatesInMsg
desired joint states input msg
-
std::vector<ReadFunctor<ScalarJointStateMsgPayload>> jointStatesInMsgs
vector of joint state input msgs
-
std::vector<ReadFunctor<ScalarJointStateMsgPayload>> jointStateDotsInMsgs
vector of joint state derivative input msgs
-
std::vector<Message<SingleActuatorMsgPayload>*> motorTorquesOutMsgs
vector of joint motor torque output msgs
-
BSKLogger bskLogger
BSK Logging.
Private Members
-
int numHingedJoints = 0
number of hinged joints in the system
-
std::vector<double> uMax = {}
[Nm] (optional) maximum joint motor torque
-
bool treeInfoInitialized = false
flag indicating if tree info has been initialized
-
int numKinematicTrees = 0
number of kinematic trees in the system
-
struct TreeInfo
-
HingedJointArrayMotor() = default