Module: mrpSteering
Executive Summary
The intend of this module is to implement an MRP attitude steering law where the control output is a vector of commanded body rates. To use this module it is required to use a separate rate tracking servo control module, such as Module: rateServoFullNonlinear, as well.
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 |
---|---|---|
guidInMsg |
Attitude guidance input message. |
|
rateCmdOutMsg |
Rate command output message. |
Detailed Module Description
The following text describes the mathematics behind the mrpSteering
module. Further information can also be
found in the journal paper Speed-Constrained Three-Axes Attitude Control Using Kinematic Steering.
Steering Law Goals
This technical note develops a new MRP based steering law that drives a body frame \({\cal B}:\{ \hat{\bf b}_1, \hat{\bf b}_2, \hat{\bf b}_3 \}\) towards a time varying reference frame \({\cal R}:\{ \hat{\bf r}_1, \hat{\bf r}_2, \hat{\bf r}_3 \}\). The inertial frame is given by \({\cal N}:\{ \hat{\bf n}_1, \hat{\bf n}_2, \hat{\bf n}_3 \}\). The RW coordinate frame is given by \(\mathcal{W}_{i}:\{ \hat{\bf g}_{s_{i}}, \hat{\bf g}_{t_{i}}, \hat{\bf g}_{g_{i}} \}\). Using MRPs, the overall control goal is
The reference frame orientation \(\pmb \sigma_{\mathcal{R}/\mathcal{N}}\), angular velocity \(\pmb\omega_{\mathcal{R}/\mathcal{N}}\) and inertial angular acceleration \(\dot{\pmb \omega}_{\mathcal{R}/\mathcal{N}}\) are assumed to be known.
The rotational equations of motion of a rigid spacecraft with N Reaction Wheels (RWs) attached are given by Analytical Mechanics of Space Systems.
where the inertia tensor \([I_{RW}]\) is defined as
The spacecraft inertial without the N RWs is \([I_{s}]\), while \(J_{s_{i}}\), \(J_{t_{i}}\) and \(J_{g_{i}}\) are the RW inertias about the body fixed RW axis \(\hat{\bf g}_{s_{i}}\) (RW spin axis), \(\hat{\bf g}_{t_{i}}\) and \(\hat{\bf g}_{g_{i}}\). The \(3\times N\) projection matrix \([G_{s}]\) is then defined as
The RW inertial angular momentum vector \({\bf h}_{s}\) is defined as
Here \(\Omega_{i}\) is the \(i^{\text{th}}\) RW spin relative to the spacecraft, and the body angular velocity is written in terms of body and RW frame components as
MRP Steering Law
Steering Law Stability Requirement
As is commonly done in robotic applications where the steering laws are of the form \(\dot{\bf x} = {\bf u}\), this section derives a kinematic based attitude steering law. Let us consider the simple Lyapunov candidate function:
in terms of the MRP attitude tracking error \(\pmb\sigma_{\mathcal{B}/\mathcal{R}}\). Using the MRP differential kinematic equations
where \(\sigma_{\mathcal{B}/\mathcal{R}}^{2} = \pmb\sigma_{\mathcal{B}/\mathcal{R}}^{T} \pmb\sigma_{\mathcal{B}/\mathcal{R}}\), the time derivative of \(V\) is
To create a kinematic steering law, let \({\mathcal{B}}^{\ast}\) be the desired body orientation, and \(\pmb\omega_{{\mathcal{B}}^{\ast}/\mathcal{R}}\) be the desired angular velocity vector of this body orientation relative to the reference frame \(\mathcal{R}\). The steering law requires an algorithm for the desired body rates \(\pmb\omega_{{\mathcal{B}}^{\ast}/\mathcal{R}}\) relative to the reference frame make \(\dot V\) in Eq. (9) negative definite. For this purpose, let us select
where \({\bf f}(\pmb\sigma)\) is an even function such that
The Lyapunov rate simplifies to the negative definite expression:
Saturated MRP Steering Law
A very simple example would be to set
where \(K_{1}>0\). This yields a kinematic control where the desired body rates are proportional to the MRP attitude error measure. If the rate should saturate, then \({\bf f}()\) could be defined as
where
A smoothly saturating function is given by
where
Here as \(\sigma_{i} \rightarrow \infty\) then the function \(f\) smoothly converges to the maximum speed rate \(\pm \omega_{\text{max}}\). For small \(|\pmb\sigma_{\mathcal{B}/\mathcal{R}}|\), this function linearizes to
If the MRP shadow set parameters are used to avoid the MRP singularity at 360 deg, then \(|\pmb\sigma_{\mathcal{B}/\mathcal{R}}|\) is upper limited by 1. To control how rapidly the rate commands approach the \(\omega_{\text{max}}\) limit, Eq. (15) is modified to include a cubic term:
The order of the polynomial must be odd to keep ${bf f}()$ an even function. A nice feature of Eq. (17) is that the control rate is saturated individually about each axis. If the smoothing component is removed to reduce this to a bang-band rate control, then this would yield a Lyapunov optimal control which minimizes \(\dot V\) subject to the allowable rate constraint \(\omega_{\text{max}}\).
Figures 2-4 illustrate how the parameters \(\omega_{\text{max}}\), \(K_{1}\) and \(K_{3}\) impact the steering law behavior. The maximum steering law rate commands are easily set through the \(\omega_{\text{max}}\) parameters. The gain \(K_{1}\) controls the linear stiffness when the attitude errors have become small, while \(K_{3}\) controls how rapidly the steering law approaches the speed command limit.
The required velocity servo loop design is aided by knowing the body-frame derivative of \({}^{B}{\pmb\omega}_{{\mathcal{B}}^{\ast}/\mathcal{R}}\) to implement a feed-forward components. Using the \({\bf f}()\) function definition in Eq. (16), this requires the time derivatives of \(f(\sigma_{i})\).
where
Using the general \(f()\) definition in Eq. (17), its sensitivity with respect to \(\sigma_{i}\) is
Module Assumptions and Limitations
This control assumes the spacecraft is rigid, and that a fast enough rate control sub-servo system is present.
User Guide
The following variables must be specified from Python:
The gains
K1
,K3
The value of
omega_max
This module returns the values of \(\pmb\omega_{\mathcal{B}^{\ast}/\mathcal{R}}\) and \(\pmb\omega_{\mathcal{B}^{\ast}/\mathcal{R}}'\), which are used in the rate servo-level controller to compute required torques.
The control update period \(\Delta t\) is evaluated automatically.
Functions
-
void SelfInit_mrpSteering(mrpSteeringConfig *configData, int64_t moduleID)
self init method
- Parameters:
configData – The configuration data associated with this module
moduleID – The module identifier
- Returns:
void
-
void Update_mrpSteering(mrpSteeringConfig *configData, uint64_t callTime, int64_t moduleID)
This method takes the attitude and rate errors relative to the Reference frame, as well as the reference frame angular rates and acceleration
- Parameters:
configData – The configuration data associated with the MRP Steering attitude control
callTime – The clock time at which the function was called (nanoseconds)
moduleID – The module identifier
- Returns:
void
-
void Reset_mrpSteering(mrpSteeringConfig *configData, uint64_t callTime, int64_t moduleID)
This method performs a complete reset of the module. Local module variables that retain time varying states between function calls are reset to their default values.
- Parameters:
configData – The configuration data associated with the MRP steering control
callTime – The clock time at which the function was called (nanoseconds)
moduleID – The module identifier
- Returns:
void
-
void MRPSteeringLaw(mrpSteeringConfig *configData, double sigma_BR[3], double omega_ast[3], double omega_ast_p[3])
This method computes the MRP Steering law. A commanded body rate is returned given the MRP attitude error measure of the body relative to a reference frame. The function returns the commanded body rate, as well as the body frame derivative of this rate command.
- Parameters:
configData – The configuration data associated with this module
sigma_BR – MRP attitude error of B relative to R
omega_ast – Commanded body rates
omega_ast_p – Body frame derivative of the commanded body rates
- Returns:
void
-
struct mrpSteeringConfig
- #include <mrpSteering.h>
Data structure for the MRP feedback attitude control routine.
Public Members
-
double K1
[rad/sec] Proportional gain applied to MRP errors
-
double K3
[rad/sec] Cubic gain applied to MRP error in steering saturation function
-
double omega_max
[rad/sec] Maximum rate command of steering control
-
uint32_t ignoreOuterLoopFeedforward
[] Boolean flag indicating if outer feedforward term should be included
-
RateCmdMsg_C rateCmdOutMsg
rate command output message
-
AttGuidMsg_C guidInMsg
attitude guidance input message
-
BSKLogger *bskLogger
BSK Logging.
-
double K1