Module: cssWlsEst

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


Functions

void SelfInit_cssWlsEst(CSSWLSConfig *configData, int64_t moduleID)

This method initializes the configData for theCSS WLS estimator.

Return

void

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

void CrossInit_cssWlsEst(CSSWLSConfig *configData, int64_t moduleID)

This method performs the second stage of initialization for the CSS sensor interface. It’s primary function is to link the input messages that were created elsewhere.

Return

void

Parameters
  • configData: The configuration data associated with the CSS interface

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

Return

void

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

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

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.

Return

void

Parameters
  • configData: The configuration data associated with the guidance module

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

Return

success indicator (0 for good, 1 for fail)

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

void computeWlsResiduals(double *cssMeas, CSSConfigFswMsg *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.

Return

void

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

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

char cssDataInMsgName[MAX_STAT_MSG_LENGTH]

The name of the css sensor input message.

char cssConfigInMsgName[MAX_STAT_MSG_LENGTH]

The name of the css configuration input message.

char navStateOutMsgName[MAX_STAT_MSG_LENGTH]

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

char cssWLSFiltResOutMsgName[MAX_STAT_MSG_LENGTH]

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

CSSConfigFswMsg cssConfigInBuffer

CSS constellation configuration message buffer.

SunlineFilterFswMsg filtStatus

Filter message.

int32_t cssDataInMsgID

ID for the incoming CSS sensor message.

int32_t cssConfigInMsgID

ID for the incoming CSS configuration message.

int32_t navStateOutMsgId

ID for the outgoing body estimate message.

int32_t cssWlsFiltResOutMsgId

ID of the output residuals for CSS.

BSKLogger *bskLogger

BSK Logging.