# Integrated Magnetic Management of Stored Angular Momentum in Autonomous Attitude Control Systems
## 2 Attitude Control System
### Integrated Magnetic Management of Stored Angular Momentum  
The integrated magnetic management of stored angular momentum is practically realized combining magnetic torque with a momentum unloading command to the reaction wheels. The classical cross-product control law [22] is directly applied to the magnetic torquers in order to balance the desaturation torque for the reaction wheels. However, if used in continuous mode during the nominal mission operations, the magnetic torque behaves as a perturbation for the dynamics, decreasing the stability of the overall attitude control system. With the proposed method, the magnetic torque is used to recover the PID three-axis attitude control action that is partially lost because of the integrated desaturation commands sent to the reaction wheels. Indeed, the angular momentum variation in the reaction wheels required by the PID control is corrected in order to manage the stored angular momentum. In this way, the reaction wheels' unloading torque is calculated for the reaction wheels, and the magnetic control counteracts the desaturation torque by controlling the spacecraft to the desired attitude state. In order to desaturate the momentum exchange actuators with a torque that can be practically balanced by the magnetic control action, the commands sent to the reaction wheels are calculated considering the surrounding geomagnetic field, as in the classical cross-product control law. Knowing on-board the angular momentum stored in the actuators owing to their encoders, the desaturation torque can be computed as:  
\[\mathbf{t}_{R}^{DES}=-k_{DES}\left(\frac{1}{\left\|\mathbf{B}\right\|^{2}} \mathbf{B}\times\mathbf{R}\mathbf{h}_{R}\right)\times\mathbf{B}, \tag{19}\]  
where the gain parameter \(k_{DES}\) is used to adjust the bandwidth of this control proportional to the stored angular momentum. Remembering that the integrated momentum manage ment control should have a bandwidth 5 to 10 times smaller than the PID three-axis attitude control, this gain parameter was designed to be limited by an upper threshold as:  
\[k_{DES}\leq\frac{1}{10\,I_{R}\omega_{R}^{Max}}\beta. \tag{20}\]  
Moreover, \(k_{DES}\) should be tuned in a way that the desaturation torque is not higher that the maximum torque achievable by the magnetic torquers. Note that for this purpose, the desaturation torque can also be limited in the maximum absolute value to further avoid unloading the stored angular momentum at a rate that is not sustainable for the magnetic actuators. The formulation of the desaturation control in Equation (19) allows the generation of a desaturation torque that is orthogonal to the geomagnetic field, guaranteeing instantaneous controllability with the integrated magnetic control. The torque obtained is then commanded to the reaction wheels by distributing it according to the pseudo-inverse law as:  
\[\mathbf{t}_{CMD}^{DES}=\dot{\mathbf{h}}_{R}^{DES}=\mathbf{R}^{\dagger}\ \mathbf{t}_{R}^{DES}. \tag{21}\]  
The overall command for the reaction wheels results from the integration of the PID and the desaturation control torques:  
\[\dot{\mathbf{h}}_{R}=\dot{\mathbf{h}}_{R}^{PID}+\dot{\mathbf{h}}_{R}^{DES}. \tag{22}\]  
Desaturation control can be easily activated and deactivated in order to maintain the stored angular momentum within predefined level boundaries. In fact, the reaction wheels should not reach the saturation speed, but they should also be operated far from zero velocity, which is a condition commonly characterized by higher friction and larger vibrations of the rotor. For this reason, momentum unloading is switched off if the actuator's spin rate is below a certain threshold. Similarly, an emergency dedicated desaturation mode is activated if the reaction wheel's spin rate is above another threshold.