Description
This model implements the PID Feedback Controller based on Modified Rodriguez Parameters (MRP) described in Chapter 8 of [1]. Given errors between desired and target attitude states and attitude rates, the controller computes torques in the body frame required to minimize these errors. Predicted torques are tuned based on a set of gains ().
The model also includes inputs for:
- Spacecraft Mass State (required) - This may be provided directly by the spacecraft, but, more appropriately, it should be set by the user or Computer. This is to allow the user to model common error patterns where ADCS controllers have inaccurate knowledge about the spacecraft’s mass state.
- Reaction Wheel speeds (optional) - This is to allow the controller to incorporate the contribution of the reaction wheels to the system moment of inertia in its calculations.
- External Force Torque (optional) - This allows the controller to incorporate known external torques into the feedback controller to optimize the output torque commands.
Example Use Cases
- Compute ACDS command torques: Compute command torques in the body frame that could be mapped to a range of different actuators.
- Controller resilience to mass errors: Model pointing errors caused by incorrect knowledge of mass state.
Module Implementation
Equations of Motion
This model assumes that the rotational equations of motion of a rigid spacecraft can be written as follows:
Here:
- is the spacecraft’s total moment of inertia
- is the angular velocity of the spacecraft body frame B with respect to the inertial frame N
- is the attitude of the spacecraft body frame B with respect to the inertial frame N
- is an optional external torque being applied to the body in the inertial frame
The model also accounts for the presence of N Reaction Wheels (RWs), whose internal angular momentum must be accounted for accurate control. These RWs are added through the following parameters.
- defines a projection matrix, where with being the RW spin axis.
- is the inertial angular momentum matrix, written as:
where is the spin axis inertia of the reaction wheel.
Control Law
The feedback law implemented is assumed to be globally asymptotically stabilizing and requires attitudes to be represented as Modified Rodriguez Parameters (MRP). Given the equation of motion defined in the previous section, the control torque to be computer can be written as [1]:
Here:
- is the attitude error gain
- is the rate error gain matrix
- is the integral feedback gain
- is the spin axis moment of inertia of the reaction wheel sub-system.
- is the attitude error between the body frame B and the target reference frame R.
- is the attitude rate error between the body frame B and the target reference frame R.
- is the angular rate error between the body frame B and the target reference frame R.
- is a known external torque
- and is the measure of integral attitude error, written as,
If , the integral feedback term is turned off and the controller follows a PD control law.
References
[1] Hanspeter Schaub and John L. Junkins. Analytical Mechanics of Space Systems. AIAA Education Series, Reston, VA, 3rd edition, 2014.