MRP_Feedback

This module implements a nonlinear MRP feedback control that tracks an arbitrary reference orientation.

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.

Functions

void SelfInit_MRP_Feedback(MRP_FeedbackConfig *configData, int64_t moduleID)

This method sets up the module output message of type CmdTorqueBodyIntMsg.

Return

void

Parameters
  • configData: The configuration data associated with this module

  • moduleID: The ID associated with the configData

void CrossInit_MRP_Feedback(MRP_FeedbackConfig *configData, int64_t moduleID)

This method performs the second stage of initialization for this module. Its primary function is to link the input messages that were created elsewhere. The required input messages are the attitude tracking error message of type AttGuidFswMsg and the vehicle configuration message of type VehicleConfigFswMsg. Optional messages are the RW configuration message of type RWArrayConfigFswMsg, the RW speed message of type RWSpeedIntMsg and the RW availability message of type RWAvailabilityFswMsg.

Return

void

Parameters
  • configData: The configuration data associated with this module

void Update_MRP_Feedback(MRP_FeedbackConfig *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, and computes the required control torque Lr.

Return

void

Parameters
  • configData: The configuration data associated with the MRP Steering attitude control

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

void Reset_MRP_Feedback(MRP_FeedbackConfig *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 MRP steering control

struct MRP_FeedbackConfig
#include <MRP_Feedback.h>

Data configuration structure for the MRP feedback attitude control routine.

Public Members

double K

[rad/sec] Proportional gain applied to MRP errors

double P

[N*m*s] Rate error feedback gain applied

double Ki

[N*m] Integration feedback error on rate error

double integralLimit

[N*m] Integration limit to avoid wind-up issue

uint64_t priorTime

[ns] Last time the attitude control is called

double z[3]

[rad] integral state of delta_omega

double int_sigma[3]

[s] integral of the MPR attitude error

double knownTorquePntB_B[3]

[N*m] known external torque in body frame vector components

double ISCPntB_B[9]

[kg m^2] Spacecraft Inertia

RWArrayConfigFswMsg rwConfigParams

[-] struct to store message containing RW config parameters in body B frame

char rwParamsInMsgName[MAX_STAT_MSG_LENGTH]

The name of the RWArrayConfigFswMsg input message.

int32_t rwParamsInMsgId

[-] ID for the RWArrayConfigFswMsg ingoing message

char vehConfigInMsgName[MAX_STAT_MSG_LENGTH]
int32_t vehConfigInMsgId
char rwAvailInMsgName[MAX_STAT_MSG_LENGTH]

[-] The name of the RWs availability message

int32_t rwAvailInMsgId

[-] ID for the incoming RWs availability data

char outputDataName[MAX_STAT_MSG_LENGTH]

[-] The name of the output message

char inputGuidName[MAX_STAT_MSG_LENGTH]

[-] The name of the Input message

char inputRWSpeedsName[MAX_STAT_MSG_LENGTH]

[-] The name for the reaction wheel speeds message

int32_t rwSpeedsInMsgId

[-] ID for the reaction wheel speeds message

int32_t attControlTorqueOutMsgId

[-] ID for the outgoing attitude control torque message

int32_t attGuidInMsgId

[-] ID for the incoming attitude guidance errors