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.

Module I/O Messages

Msg Variable Name

Msg Type

Description

vscmgParamsInMsg

VSCMGArrayConfigMsgPayload

VSCMG array configuration input message

vscmgRefStatesInMsg

VSCMGRefStatesMsgPayload

reference VSCMG states input message

attInMsg

AttRefMsgPayload

attitude navigation input message

speedsInMsg

VSCMGSpeedMsgPayload

VSCMG speeds input message

cmdsOutMsg

VSCMGArrayTorqueMsgPayload

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

(1)\[u_{g_{i}} = J_{g_{i}}(\hat{\boldsymbol{ g}}_{g_{i}}^{T}\dot{\boldsymbol{ \omega}} + \ddot{\gamma}_{i}) -(J_{s_{i}} - J_{t_{i}})\omega_{s_{i}}\omega_{t_{i}} - I_{w_{s_{i}}}\Omega\omega_{t_{i}}\]

where

(2)\[{\boldsymbol{ \omega}} = \omega_{s_{i}}\hat{\boldsymbol{ g}}_{s_{i}} + \omega_{t_{i}}\hat{\boldsymbol{ g}}_{t_{i}} + \omega_{g_{i}}\hat{\boldsymbol{ g}}_{g_{i}}\]

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

(3)\[u_{g_{i}} \approx J_{g_{i}}\ddot{\gamma}_{i} -(J_{s_{i}} - J_{t_{i}})\omega_{s_{i}}\omega_{t_{i}} - I_{w_{s_{i}}}\Omega\omega_{t_{i}}\]

Using a desired gimbal rate \(\dot{\gamma}_{d}\) the servo tracking error for the gimbal rate is defined as

(4)\[\Delta\dot{\gamma} = \dot{\gamma} - \dot{\gamma}_{d}\]

Picking the Lyapunov Function

(5)\[V = \frac{1}{2}\Delta\dot{\gamma}^{2}\]

and taking the time derivative and forcing it to be negative definite leads to

(6)\[\dot{V} = \Delta\dot{\gamma}\Delta\ddot{\gamma} \equiv -K_{\dot{\gamma}}\Delta\dot{\gamma}^{2}\]

with gain \(K_{\dot{\gamma}} > 0\). Solving for the gimbal acceleration leads to

(7)\[\ddot{\gamma} = \ddot{\gamma}_{d} - K_{\dot{\gamma}}\Delta\dot{\gamma}\]

dropping the feedforward term and substituing the result in to Eq. (3) leads to the gimbal torque command

(8)\[u_{g_{i}} = -J_{g_{i}} K_{\dot{\gamma}}\Delta\dot{\gamma} - (J_{s_{i}} - J_{t_{i}})\omega_{s_{i}}\omega_{t_{i}} - I_{w_{s_{i}}}\Omega\omega_{t_{i}}\]

The wheel motor torque equation is given by

(9)\[u_{s_{i}} = I_{w_{s_{i}}}(\dot{\Omega}_{i} + \hat{\boldsymbol{ g}}_{s_{i}}^{T}\dot{\boldsymbol{ \omega}} + \dot{\gamma}_{i}\omega_{t_{i}})\]

comparing the magnitude of \(\dot{\Omega}_{i}\) and \(\dot{\boldsymbol{ \omega}}\) leads to the approximation

(10)\[u_{s_{i}} \approx I_{w_{s_{i}}}(\dot{\Omega}_{i} + \dot{\gamma}_{i}\omega_{t_{i}})\]

Setting \(\dot{\Omega} = \dot{\Omega}_{d}\) produces the open loop control

(11)\[u_{s_{i}} = I_{w_{s_{i}}}(\dot{\Omega}_{d_{i}} + \dot{\gamma}\omega_{t_{i}})\]

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.

  1. Import the vscmgGimbalRateServo class:

    from Basilisk.fswAlgorithms import vscmgGimbalRateServo
    
  2. Create an instance of the vscmgGimbalRateServo:

    vscmgGimbalRateServo = vscmgGimbalRateServo.VscmgGimbalRateServo()
    
  3. Set the gain for the gimbal servo:

    K_gammaDot = 1.0
    vscmgGimbalRateServo.setK_gammaDot(K_gammaDot)
    
  4. The VSCMG torque output message is cmdsOutMsg.

  5. 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