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. |
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.
To compute the reference rotation \(\theta_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_R\) is the angle between \({}^\mathcal{B}\boldsymbol{\hat{a}}_2\) and \({}^\mathcal{R}\boldsymbol{\hat{a}}_2\):
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.
User Guide¶
The required module configuration is:
solarArrayConfig = solarArrayRotation.solarArrayRotationConfig()
solarArrayWrap = unitTestSim.setModelDataWrap(solarArrayConfig)
solarArrayWrap.ModelTag = "solarArrayRotation"
solarArrayConfig.a1Hat_B = [1, 0, 0]
solarArrayConfig.a2Hat_B = [0, 0, 1]
solarArrayConfig.attitudeFrame = 0
unitTestSim.AddModelToTask(unitTaskName, solarArrayWrap, solarArrayConfig)
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 |
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
-
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
-
int attitudeFrame¶
flag = 1: compute theta reference based on current attitude instead of attitude reference
-
int count¶
counter variable for finite differences
-
uint64_t priorT¶
prior call time for finite differences
-
double priorThetaR¶
prior output msg for finite differences
input msg measured attitude
-
AttRefMsg_C attRefInMsg¶
input attitude reference 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]¶