Module: lowPassFilterTorqueCommand

Executive Summary

Module applies a low pass filter to the attitude control torque command.

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

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

cmdTorqueOutMsg

CmdTorqueBodyMsgPayload

filtered commanded torque output message

cmdTorqueInMsg

CmdTorqueBodyMsgPayload

un-filtered commanded torque input message


Defines

NUM_LPF

Functions

void SelfInit_lowPassFilterTorqueCommand(lowPassFilterTorqueCommandConfig *configData, int64_t moduleID)

This method initializes the configData for this module. It checks to ensure that the inputs are sane and then creates the output message

Parameters
  • configData – The configuration data associated with this module

  • moduleID – The module identifier

Returns

void

void Update_lowPassFilterTorqueCommand(lowPassFilterTorqueCommandConfig *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.

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

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

  • moduleID – The module identifier

Returns

void

void Reset_lowPassFilterTorqueCommand(lowPassFilterTorqueCommandConfig *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 MRP steering control

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

  • moduleID – The module identifier

Returns

void

struct lowPassFilterTorqueCommandConfig
#include <lowPassFilterTorqueCommand.h>

module configuration message.

Public Members

double h

[s] filter time step (assumed to be fixed

double wc

[rad/s] continuous filter cut-off frequency

double hw

[rad] h times the prewarped discrete time cut-off frequency

double a[NUM_LPF]

filter coefficients for output

double b[NUM_LPF]

filter coefficients for input

double Lr[NUM_LPF][3]

[Nm] prior torque command

double LrF[NUM_LPF][3]

[Nm] prior filtered torque command

int reset

flag indicating the filter being started up

CmdTorqueBodyMsg_C cmdTorqueOutMsg

commanded torque output message

CmdTorqueBodyMsg_C cmdTorqueInMsg

commanded torque input message

BSKLogger *bskLogger

BSK Logging.