Module: cssWlsEst

Executive Summary

A weighted least-squares minimum-norm algorithm is used to estimate the body-relative sun heading using a cluster of coarse sun sensors. Using two successive sun heading evaluation the module also computes the inertial angular velocity vector. As rotations about the sun-heading vector are not observable, this angular velocity vector only contains body rates orthogonal to this sun heading vector. More information on can be found in the PDF Description

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

cssDataInMsg

CSSArraySensorMsgPayload

name of the CSS sensor input message

cssConfigInMsg

CSSConfigMsgPayload

name of the CSS configuration input message

navStateOutMsg

NavAttMsgPayload

name of the navigation output message containing the estimated states

cssWLSFiltResOutMsg

SunlineFilterMsgPayload

name of the CSS filter state data out message


Functions

void SelfInit_cssWlsEst(CSSWLSConfig *configData, int64_t moduleID)

This method initializes the configData for theCSS WLS estimator.

Parameters
  • configData – The configuration data associated with the CSS WLS estimator

  • moduleID – The module identifier

Returns

void

void Update_cssWlsEst(CSSWLSConfig *configData, uint64_t callTime, int64_t moduleID)

This method takes the parsed CSS sensor data and outputs an estimate of the sun vector in the ADCS body frame

Parameters
  • configData – The configuration data associated with the CSS estimator

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The module identifier

Returns

void

void Reset_cssWlsEst(CSSWLSConfig *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 guidance module

  • callTime – The clock time at which the function was called (nanoseconds)

  • moduleID – The module identifier

Returns

void

int computeWlsmn(int numActiveCss, double *H, double *W, double *y, double x[3])

This method computes a least squares fit with the given parameters. It treats the inputs as though they were double dimensioned arrays but they are all singly dimensioned for ease of use

Parameters
  • numActiveCss – The count on input measurements

  • H – The predicted pointing vector for each measurement

  • W – the weighting matrix for the set of measurements

  • y – the observation vector for the valid sensors

  • x – The output least squares fit for the observations

Returns

success indicator (0 for good, 1 for fail)

void computeWlsResiduals(double *cssMeas, CSSConfigMsgPayload *cssConfig, double *wlsEst, double *cssResiduals)

This method computes the post-fit residuals for the WLS estimate. Note that everything has to have been allocated appropriately as this function operates directly on the arrays.

Parameters
  • cssMeas – The measured values for the CSS sensors

  • cssConfig – The CSS configuration information

  • wlsEst – The WLS estimate computed for the CSS measurements

  • cssResiduals – The measurement residuals output by this function

Returns

void

struct CSSWLSConfig
#include <cssWlsEst.h>

Top level structure for the CSS weighted least squares estimator. Used to estimate the sun state in the vehicle body frame.

Public Members

CSSArraySensorMsg_C cssDataInMsg

The name of the CSS sensor input message.

CSSConfigMsg_C cssConfigInMsg

The name of the CSS configuration input message.

NavAttMsg_C navStateOutMsg

The name of the navigation output message containing the estimated states.

SunlineFilterMsg_C cssWLSFiltResOutMsg

The name of the CSS filter data out message.

uint32_t numActiveCss

[-] Number of currently active CSS sensors

uint32_t useWeights

Flag indicating whether or not to use weights for least squares.

uint32_t priorSignalAvailable

Flag indicating if a recent prior heading estimate is available.

double dOld[3]

The prior sun heading estimate.

double sensorUseThresh

Threshold below which we discount sensors.

uint64_t priorTime

[ns] Last time the attitude control is called

CSSConfigMsgPayload cssConfigInBuffer

CSS constellation configuration message buffer.

SunlineFilterMsgPayload filtStatus

Filter message.

BSKLogger *bskLogger

BSK Logging.