singleAxisProfiler#
Executive Summary#
This prescribed motion-specific module computes the hub-relative rotational states of a spinning body following
prescribed rotational one degree-of-freedom (DOF) motion about a single hub-fixed axis. The body frame of the spinning
body is designated by the frame \(\mathcal{F}\). The spinning body’s states are profiled relative to a hub-fixed
frame \(\mathcal{M}\). The input message to this module is the StepperMotorMsgPayload message which provides
the scalar spinning body states relative to the hub theta
, thetaDot
, and thetaDDot
. Given these scalar
states together with the spinning body rotation axis specified by the user, the prescribed rotational states
sigma_FM
, omega_FM_F
, and omegaPrime_FM_F
are computed and output from the module using the
PrescribedRotationMsgPayload message. The only required input to this module that must be set by the user is
the spinning body rotation axis expressed as a unit vector in Mount frame components rotHat_M
.
Important
To use this module for prescribed motion, it must be connected to the prescribedMotionStateEffector dynamics module. This ensures the spinning body’s states are correctly incorporated into the spacecraft dynamics.
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 the message is used for.
Msg Variable Name |
Msg Type |
Description |
---|---|---|
stepperMotorInMsg |
StepperMotorMsgPayload |
input msg with the stepper motor scalar states |
prescribedRotationOutMsg |
PrescribedRotationMsgPayload |
output message with the prescribed spinning body rotational states |
Detailed Module Description#
To compute the spinning body attitude relative to the hub-fixed mount frame, the given axis of rotation and the current stepper motor scalar angle are used in the following expression:
where \(\hat{\boldsymbol{s}}\) is the given axis of rotation.
The spinning body angular velocity relative to the mount frame is computed using the following expression:
The spinning body angular acceleration relative to the mount frame is similarly computed:
The computed prescribed rotational states sigma_FM
, omega_FM_F
, and omegaPrime_FM_F
are then written to the
PrescribedRotationMsgPayload module output message.
Module Testing#
The unit test for this module ensures that the single-axis hub-relative rotational scalar states theta
,
thetaDot
, and thetaDDot
are properly converted to prescribed hub-relative rotational states sigma_FM
,
omega_FM_F
, and omegaPrime_FM_F
. The scalar states are varied in the test, along with a single angle
rotAxis_MAngle
that is used to vary the axis of rotation rotAxis_M
associated with the given
scalar information. To verify the module, the final prescribed rotational states are logged from the module. The
final attitude is checked with the computed true attitude. The dot product between the given rotation axis and
the final angular velocity and angular acceleration is checked to match the given scalar angle rate and angle
acceleration.
User Guide#
The only required input to this module that must be set by the user is the spinning body rotation axis expressed
as a unit vector in Mount frame components rotHat_M
. This section outlines the steps needed to set up this
single axis profiler module in python using Basilisk.
Import the singleAxisProfiler class:
from Basilisk.simulation import singleAxisProfiler
Create an instantiation of the module:
singleAxisRotProfiler = singleAxisProfiler.SingleAxisProfiler()
Define all of the configuration data associated with the module:
singleAxisRotProfiler.modelTag = "singleAxisProfiler" singleAxisRotProfiler.setRotHat_M([1.0, 0.0, 0.0])
Connect the StepperMotorMsgPayload input message to the module that tracks the stepper motor states in time. For example, the user can create a stand-alone message to specify a non-rotating spinning body:
stepperMotorMessageData = messaging.StepperMotorMsgPayload() stepperMotorMessageData.theta = 10.0 * np.pi / 180.0 # [rad] stepperMotorMessageData.thetaDot = 0.0 * np.pi / 180.0 # [rad/s] stepperMotorMessageData.thetaDDot = 0.0 * np.pi / 180.0 # [rad/s^2] stepperMotorMessage = messaging.StepperMotorMsg().write(stepperMotorMessageData)
Subscribe the singleAxisProfiler module input message to the stepper motor message:
singleAxisRotProfiler.stepperMotorInMsg.subscribeTo(stepperMotorMessage)
Add the module to the task list:
unitTestSim.AddModelToTask(unitTaskName, singleAxisRotProfiler)
Class SingleAxisProfiler#
-
class SingleAxisProfiler : public SysModel#
Single Axis Profiler Class.
Public Functions
-
void reset(uint64_t currentSimNanos) override#
Reset member function.
This method checks the input message to ensure it is linked.
- Parameters:
callTime – [ns] Time the method is called
- Returns:
void
-
void updateState(uint64_t currentSimNanos) override#
Update member function.
This method converts the stepper motor scalar rotational states to the prescribed motion hub-relative rotational states. The prescribed rotational states are then written to the output message.
- Parameters:
callTime – [ns] Time the method is called
- Returns:
void
-
void setRotHat_M(const Eigen::Vector3d &rotHat_M)#
Setter for the spinning body rotation axis.
Setter method for the spinning body rotation axis.
- Parameters:
rotHat_M – Spinning body rotation axis (unit vector)
- Returns:
void
-
const Eigen::Vector3d &getRotHat_M() const#
Getter for the spinning body rotation axis.
Getter method for the spinning body rotation axis.
- Returns:
const Eigen::Vector3d
-
void reset(uint64_t currentSimNanos) override#