Module: vscmgGimbalRateServo
Executive Summary
The vscmgGimbalRateServo
module maps a desired wheel acceleration and gimbal rate for each VSCMG to a corresponding motor torque command for both the reaction wheel and gimbal.
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 |
---|---|---|
vscmgParamsInMsg |
VSCMG array configuration input message |
|
vscmgRefStatesInMsg |
reference VSCMG states input message |
|
attInMsg |
attitude navigation input message |
|
speedsInMsg |
VSCMG speeds input message |
|
cmdsOutMsg |
VSCMG motor torque output message |
Detailed Module Description
General Function
The vscmgGimbalRateServo module creates the the VSCMG wheel motor torque \({\bf u}_{s}\) and gimbal motor torque \({\bf u}_g\) developed in chapter 8 of Analytical Mechanics of Space Systems.
Algorithm
This module employs the Acceleration-Based VSCMG Steering Law of Section (8.8.3) of Analytical Mechanics of Space Systems. Taking the gimbal motor torque equation
where
and \(J_{s_{i}}\), \(J_{t_{i}}\), \(J_{g_{i}}\) are the inertias for the ith gimbal wheel system for the first, second and third axis respectively, \(I_{w_{s_{i}}}\) is the ith RW spin axis inertia, \(\gamma\) is the gimbal angle, and \(\Omega\) is the wheel speed. Considering the relative magnitude of \(\dot{\bf \omega}\) and \(\ddot{\gamma}_{i}\), the gimbal torque can be approximated as
Using a desired gimbal rate \(\dot{\gamma}_{d}\) the servo tracking error for the gimbal rate is defined as
Picking the Lyapunov Function
and taking the time derivative and forcing it to be negative definite leads to
with gain \(K_{\dot{\gamma}} > 0\). Solving for the gimbal acceleration leads to
dropping the feedforward term and substituing the result in to Eq. (3) leads to the gimbal torque command
The wheel motor torque equation is given by
comparing the magnitude of \(\dot{\Omega}_{i}\) and \(\dot{\boldsymbol{ \omega}}\) leads to the approximation
Setting \(\dot{\Omega} = \dot{\Omega}_{d}\) produces the open loop control
This servo implementation does not track the wheel spin rate \({\Omega}_{i}\) and thus relies on the outer control loop of the attitude feedback control to adjust the desired wheel accelerations to yield the desired close-loop dynamics.
User Guide
This section is to outline the steps needed to setup the VSCMG gimbal rate servo module in Python using Basilisk.
Import the vscmgGimbalRateServo class:
from Basilisk.fswAlgorithms import vscmgGimbalRateServo
Create an instance of the vscmgGimbalRateServo:
vscmgGimbalRateServo = vscmgGimbalRateServo.VscmgGimbalRateServo()
Set the gain for the gimbal servo:
K_gammaDot = 1.0 vscmgGimbalRateServo.setK_gammaDot(K_gammaDot)
The VSCMG torque output message is
cmdsOutMsg
.add the module to the task list:
unitTestSim.AddModelToTask(unitTaskName, vscmgGimbalRateServo)
-
class VscmgGimbalRateServo : public SysModel
- #include <vscmgGimbalRateServo.h>
Mapping desired gimbal rates and RW wheel accelerations to motor torques.
Public Functions
-
VscmgGimbalRateServo()
-
~VscmgGimbalRateServo() = default
-
void SelfInit()
Initialize C-wrapped output messages
-
void Reset(uint64_t CurrentSimNanos)
Reset the module to original configuration values.
-
void UpdateState(uint64_t CurrentSimNanos)
-
void setK_gammaDot(double)
[-] setter for
K-gammaDot
property
-
inline double getK_gammaDot() const
[-] getter for
K-gammaDot
property
Public Members
-
ReadFunctor<VSCMGArrayConfigMsgPayload> vsmcgParamsInMsg
[-] VSCMG array configuration input message
-
ReadFunctor<VSCMGRefStatesMsgPayload> vscmgRefStatesInMsg
[-] reference VSCMG states input message
-
ReadFunctor<NavAttMsgPayload> attInMsg
[-] attitude navigation input message
-
ReadFunctor<VSCMGSpeedMsgPayload> speedsInMsg
[-] VSCMG speeds input message
-
Message<VSCMGArrayTorqueMsgPayload> cmdsOutMsg
[-] VSCMG motor torque C++ output message
-
VSCMGArrayTorqueMsg_C cmdsOutMsgC = {}
[-] VSCMG motor torque C output message
-
BSKLogger bskLogger
[-] BSK Logging
Private Members
-
double K_gammaDot
[1/s] proportional gain applied to gimbal rate errors
-
VSCMGArrayTorqueMsgPayload outputTorques
[-] output torques for the VSCMGs
-
VSCMGArrayConfigMsgPayload vscmgConfigParams
[-] struct to store message containing VSCMG config parameters in body B frame
-
VscmgGimbalRateServo()