mrpProportionalDerivative#
Executive Summary#
This module provides a MRP based PD attitude control module. It is similar to mrpFeedback, but without the RW or the integral feedback option. The feedback control is able to asymptotically track a reference attitude if there are no unknown dynamics and the attitude control torque is implemented with a thruster set.
Message Connection Descriptions#
The following table lists all the module input and output messages. The module msg variable name 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.
Figure 1: mrpPD()
Module I/O Illustration#
Msg Variable Name |
Msg Type |
Description |
---|---|---|
cmdTorqueOutMsg |
CmdTorqueBodyMsgPayload |
Commanded external torque output message |
vehConfigInMsg |
VehicleConfigMsgPayload |
Vehicle configuration input message |
guidInMsg |
VehicleConfigMsgPayload |
Vehicle configuration input message |
Detailed Module Description#
This attitude feedback module using the MRP feedback control related to the control in section 8.4.1 in Analytical Mechanics of Space Systems:
Note that this control solution creates an external control torque which must be produced with a cluster of thrusters. No reaction wheel information is used here. Further, the feedback control component is a simple proportional and derivative feedback formulation. As shown in Analytical Mechanics of Space Systems, this control can asymptotically track a general reference trajectory given by the reference frame \(\cal R\).
Module Assumptions and Limitations#
This control assumes the spacecraft is rigid and that the inertia tensor does not vary with time.
User Guide#
The following parameters must be set for the module:
K
: the MRP proportional feedback gainP
: the \(\pmb\omega\) tracking error proportional feedback gainknownTorquePntB_B
: (Optional) the known external torque vector \({}^{B}{\bf L}\). The default value is a zero vector.
Class MrpProportionalDerivative#
-
class MrpProportionalDerivative : public SysModel#
MRP PD control class.
Public Functions
-
MrpProportionalDerivative() = default#
Constructor.
-
~MrpProportionalDerivative() = default#
Destructor.
-
void reset(uint64_t currentSimNanos) override#
Reset member function.
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:
callTime – [ns] Time the method is called
- Returns:
void
-
void updateState(uint64_t currentSimNanos) override#
Update member function.
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:
callTime – [ns] Time the method is called
- Returns:
void
-
double getDerivativeGainP()#
Getter method for derivative gain P.
Getter method for the derivative gain P.
- Returns:
const double
-
const Eigen::Vector3d &getKnownTorquePntB_B() const#
Getter method for the known external torque about point B.
Getter method for the known torque about point B.
- Returns:
const Eigen::Vector3d
-
double getProportionalGainK()#
Getter method for proportional gain K.
Getter method for the proportional gain K.
- Returns:
const double
-
void setDerivativeGainP(double P)#
Setter method for derivative gain P.
Setter method for the derivative gain P.
- Parameters:
P – [N*m*s] Rate error feedback gain applied
- Returns:
void
-
void setKnownTorquePntB_B(Eigen::Vector3d &knownTorquePntB_B)#
Getter method for the known external torque about point B.
Setter method for the known external torque about point B.
- Parameters:
knownTorquePntB_B – [N*m] Known external torque expressed in body frame components
- Returns:
void
-
void setProportionalGainK(double K)#
Getter method for proportional gain K.
Setter method for the proportional gain K.
- Parameters:
K – [rad/s] Proportional gain applied to MRP errors
- Returns:
void
-
MrpProportionalDerivative() = default#