Module: solarArrayReference
Executive Summary
This module is used to calculate the required rotation angle for a solar array that is able to rotate about its drive axis. The degree of freedom associated with the rotation of the array about the drive axis makes it such that it is possible to improve the incidence angle between the sun and the array surface, thus ensuring maximum power generation.
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 |
---|---|---|
hingedRigidBodyRefOutMsg |
Output Hinged Rigid Body Reference Message. |
|
attNavInMsg |
Input Attitude Navigation Message. |
|
attRefInMsg |
Input Attitude Reference Message. |
|
hingedRigidBodyInMsg |
Input Hinged Rigid Body Message Message. |
|
vehConfigInMsg (optional) |
Input vehicle configuration message containing the position of the center of mass of the system. |
|
rwConfigDataInMsg (optional) |
Input message containing the number of reaction wheels, relative inertias and orientations with respect to the body frame. |
|
rwSpeedsInMsg (optional) |
Input message containing the relative speeds of the reaction wheels with respect to the hub. |
Module Assumptions and Limitations
This module computes the rotation angle required to achieve the best incidence angle between the Sun direction and the solar array surface. This does not mean that perfect incidence (Sun direction perpendicular to array surface) is guaranteed. This module assumes that the solar array has only one surface that is able to generate power. This bounds the output reference angle \(\theta_R\) between \(0\) and \(2\pi\). Perfect incidence is achievable when the solar array drive direction and the Sun direction are perpendicular. Conversely, when they are parallel, no power generation is possible, and the reference angle is set to the current angle, to avoid pointless energy consumption attempting to rotate the array.
The Sun direction in body-frame components is extracted from the attNavInMsg
. The output reference angle \(\theta_R\), however, can be computed either based on the reference attitude contained in attRefInMsg
, or the current spacecraft attitude contained also in attNavInMsg
. This depends on the frequency with which the arrays need to be actuated, in comparison with the frequency with which the motion of the spacecraft hub is controlled. The module input attitudeFrame
allows the user to set whether to compute the reference angle based on the reference attitude or current spacecraft attitude.
Detailed Module Description
For this module to operate, the user needs to provide two unit directions as inputs:
\({}^\mathcal{B}\boldsymbol{\hat{a}}_1\): direction of the solar array drive, about which the rotation happens;
\({}^\mathcal{B}\boldsymbol{\hat{a}}_2\): direction perpendicular to the solar array surface, with the array at a zero rotation.
The same math applies to the case where the body reference is used. In that case, the same vectors are expressed in body-frame coordinates. Note that the unit directions \(\boldsymbol{\hat{a}}_i\) have the same components in both the body and reference frame, because they are body-fixed and rotate with the spacecraft hub.
Some logic is implemented such that the computed reference angle \(\theta_R\) and the current rotation angle \(\theta_C\) received as input from the hingedRigidBodyInMsg
are never more than 360 degrees apart.
The derivative of the reference angle \(\dot{\theta}_R\) is computed via finite differences.
Maximum Power Generation
To compute the reference rotation that maximizes Sun incidence \(\theta_{\text{Sun,}R}\), the module computes the unit vector \({}^\mathcal{R}\boldsymbol{\hat{a}}_2\), which is coplanar with \({}^\mathcal{B}\boldsymbol{\hat{a}}_1\) and the Sun direction \({}^\mathcal{R}\boldsymbol{\hat{r}}_S\). This is obtained as:
and then normalizing to obtain \({}^\mathcal{R}\boldsymbol{\hat{a}}_2\). The reference angle \(\theta_{\text{Sun,}R}\) is the angle between \({}^\mathcal{B}\boldsymbol{\hat{a}}_2\) and \({}^\mathcal{R}\boldsymbol{\hat{a}}_2\):
Maximum Momentum Dumping
In this pointing mode, the reference angle is computed in order to leverage solar radiation pressure (SRP) to produce a torque whose component in the opposite direction to the local net reaction wheel momentum (\(\boldsymbol{H}\)) is maximum. Because the array can only rotate about the \(\boldsymbol{\hat{a}}_1\) axis, the desired solar array normal \(\boldsymbol{\hat{y}}\) can be expressed as follows, in the solar array frame \(\mathcal{A}\):
The dot product between the solar array torque and the net wheel momentum is the function to minimize:
where \(\boldsymbol{h} = \boldsymbol{r} \times \boldsymbol{H}\) and \(\boldsymbol{r}\) is the position of the array center of pressure with respect to the system’s center of mass. Taking the derivative with respect to \(t\) and equating it to zero results in the third-order equation in \(\tan t\):
whose desired solution is:
In the presence of two solar arrays, it is not desirable to maneuver both to the angle that minimizes \(f(t)\). This is because one array will always reach an edge-on configuration, thus resulting in a SRP torque imbalance between the arrays. For this reason, the array(s) are maneuvered to the reference angle
to ensure that both arrays remain, on average, pointed at the Sun. When one array has the ability to generate a lot of dumping torque (\(f(t) \rightarrow -1\)), its reference angle is skewed towards \(\theta_{\text{Srp,}R}\). Conversely, when \(f(t) \rightarrow 0\) and there is not much momentum dumping capability, the array remains close to the maximum power-generating angle \(\theta_{\text{Sun,}R}\).
For more details on the mathematical derivation, see R. Calaon, C. Allard and H. Schaub, “Momentum Management of a Spacecraft equipped with a Dual-Gimballed Electric Thruster”, currently in preparation for submission to the Journal of Spacecraft and Rockets.
User Guide
The required module configuration is:
saReference = solarArrayReference.solarArrayReference()
saReference.ModelTag = "solarArrayReference"
saReference.a1Hat_B = [1, 0, 0]
saReference.a2Hat_B = [0, 0, 1]
saReference.attitudeFrame = 0
saReference.pointingMode = 0
unitTestSim.AddModelToTask(unitTaskName, saReference)
The module is configurable with the following parameters:
Parameter |
Description |
---|---|
|
solar array drive direction in B-frame coordinates |
|
solar array zero-rotation direction, in B-frame coordinates |
|
0 for reference angle computed w.r.t reference frame; 1 for reference angle computed w.r.t. body frame; defaults to 0 if not specified |
|
0 for maximum power generation; 1 maximum momentum dumping; defaults to 0 if not specified |
Enums
Functions
-
void SelfInit_solarArrayReference(solarArrayReferenceConfig *configData, int64_t moduleID)
This method initializes the output messages for this module.
- Parameters:
configData – The configuration data associated with this module
moduleID – The module identifier
- Returns:
void
-
void Reset_solarArrayReference(solarArrayReferenceConfig *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 module
callTime – [ns] time the method is called
moduleID – The module identifier
- Returns:
void
-
void Update_solarArrayReference(solarArrayReferenceConfig *configData, uint64_t callTime, int64_t moduleID)
This method computes the updated rotation angle reference based on current attitude, reference attitude, and current rotation angle
- Parameters:
configData – The configuration data associated with the module
callTime – The clock time at which the function was called (nanoseconds)
moduleID – The module identifier
- Returns:
void
-
void computeSrpArrayNormal(double a1Hat_B[3], double a2Hat_B[3], double a3Hat_B[3], double sHat_R[3], double r_B[3], double H_B[3], double *thetaR, double *f)
This method computes the reference angle for the arrays that maximizes SRP torque in the direction opposite to current RW momentum (thetaSrpR). It also outputs a coefficient f that is proportional to the projection of the SRP torque along the RW net momentum.
- Returns:
void
-
struct solarArrayReferenceConfig
- #include <solarArrayReference.h>
Top level structure for the sub-module routines.
Public Members
-
double a1Hat_B[3]
solar array drive axis in body frame coordinates
-
double a2Hat_B[3]
solar array surface normal at zero rotation
-
AttitudeFrame attitudeFrame
attitudeFrame = 1: compute theta reference based on body frame instead of reference frame
-
double r_AB_B[3]
location of the array center of pressure in body frame coordinates
-
int count
counter variable for finite differences
declare these variables for internal computations
-
uint64_t priorT
prior call time for finite differences
-
double priorThetaR
prior output msg for finite differences
-
RWArrayConfigMsgPayload rwConfigParams
struct to store message containing RW config parameters in body B frame
-
PointingMode pointingMode
flag that assesses whether RW information is provided to perform momentum dumping
input msg measured attitude
-
AttRefMsg_C attRefInMsg
input attitude reference message
-
VehicleConfigMsg_C vehConfigInMsg
input msg vehicle configuration msg (needed for CM location)
-
RWSpeedMsg_C rwSpeedsInMsg
input reaction wheel speeds message
-
RWArrayConfigMsg_C rwConfigDataInMsg
input RWA configuration message
-
HingedRigidBodyMsg_C hingedRigidBodyInMsg
input hinged rigid body message
-
HingedRigidBodyMsg_C hingedRigidBodyRefOutMsg
output msg containing hinged rigid body target angle and angle rate
-
BSKLogger *bskLogger
BSK Logging.
-
double a1Hat_B[3]