# Variable Structure PID Controller for Satellite Attitude Control Considering Actuator Failure
## 3 Results
### Fault Tolerant Algorithm  
Noting that the actuators on the satellite platform may fail during the control process and cause the divergence of the control system, it is necessary to design a fault detect and a tolerant algorithm for the satellite attitude controller. It is worth noting that, under a complete failure situation (actuators could not generate any torque at all), the system is completely out of control, and the control algorithm would not help for hardware breakdown. In this section, the part failure is considered, i.e., control actuators would generate part of the expected torque as follows:  
\[\mathbf{u}=\mathbf{\rho}\mathbf{u}_{d} \tag{33}\]  
where \(\mathbf{u}\) is the real torque generated by the actuator, \(\mathbf{u}_{d}\) is the expected torque calculated by the control algorithm, and \(\mathbf{\rho}\) is the error matrix describing the coupling of real torque and expected torque; generally, the element of \(\mathbf{\rho}\) satisfies \(\left|\rho_{ij}\right|\leq 1\). Based on the results in previous section, the fault tolerant variable structure PID controller could be written as follows  
\[\mathbf{u}_{r}= \begin{cases}\mathbf{u}&\delta\leq\overline{\delta}\\ -k_{d}\mathbf{\omega}-k_{p}\mathbf{q}_{v}&\delta>\overline{\delta}\end{cases}  \tag{34}\]  
where \(\mathbf{u}_{r}\) is the fault tolerant control torque, \(\mathbf{u}\) is the control torque (same as the previous section, i.e., Equation (16)), \(k_{d}\), \(k_{p}\), and \(\overline{\delta}\) are positive scalars, and \(\delta\) is the fault detection factor that detects whether the fault happens. The definition of \(\delta\) is defined as follows:  
\[\delta=\|\mathbf{\omega}-\mathbf{\omega}_{k-1}-\mathbf{J}^{-1}\Big{(}\mathbf{u}_{r}-\mathbf{ \omega}_{k-1}^{\times}\mathbf{I}\mathbf{\omega}_{k-1}\Big{)}\Delta t\| \tag{35}\]  
where \(\mathbf{\omega}_{k-1}\) is the angular velocity of the last control cycle, and \(\Delta t\) is the control sample time. It could be easily found that the later part in Equation (35) is integral to the dynamic model of angular velocity of the last control cycle, and the former part is the current angular velocity; hence, the essence of \(\delta\) is to calculate the error of the estimated and actual values. **Remark 6**. : _Based on the structure of the fault tolerant controller, it can be found that the key to detect the fault is \(\delta\), and the basic idea is to integrate the dynamic model of angular velocity of the last control cycle and to compare it with the current angular velocity. If the theoretical value is too much larger than the threshold \(\overline{\delta}\), then it could be treated as a system with actuator failure. In addition, based on the controller structure, it could be found that if the actuator failure does not occur, then the controller maintains the same structure as the previous section, and if the failure does happen, the controller becomes a standard PD controller._The next step is to prove system stability under controller (34). Since the stability without actuator failure has been proven in the previous section, only the fault situation is discussed. The Lyapunov function is selected as follows  
\[V_{3}=\frac{1}{2}\mathbf{\omega}^{T}\mathbf{J}\mathbf{\omega}+2k_{p}(1-q_{0}) \tag{36}\]  
Its derivative is calculated and the second stage of controller (34) is substituted  
\[ \begin{array}{ll}\dot{V}_{3}&=\mathbf{\omega}^{T}\mathbf{J}\dot{\mathbf{\omega}}-2k_{p} \dot{q}_{0}\\ &\approx\mathbf{\omega}^{T}(\mathbf{u}-\mathbf{\omega}^{\gamma}\mathbf{J}\mathbf{\omega})+k_{p} \mathbf{q}_{\
u}^{T}\mathbf{\omega}\\ &=-k_{d}\mathbf{\omega}^{T}\mathbf{\omega}\leq 0\end{array}  \tag{37}\]  
Based on the LaSalle invariant principle, the system converges to the curve \(\mathbf{\omega}=0\), hence \(\dot{\mathbf{\omega}}=0\); noting the dynamic model of \(\dot{\mathbf{\omega}}\) and the controller structure, it could be obtained that \(\mathbf{q}_{\
u}=0\). Hence, the system governed by controller (34) is asymptotic stable. **Remark 7**.