# Implementation of Fault-Tolerant Control for
## 3 Fault Estimation Using an Extended State Observer  
In this section, an extended state observer of uncertainties/disturbances and faults/failures is presented. The dynamic model of the robot manipulator of Equation (7) can be rewritten in state space as  
\[\ddot{q}=\mathbf{M}^{-1}(q)(\tau-\mathbf{H}(q,\dot{q}))-\mathbf{M}^{-1}(q) \zeta(q,\dot{q},\ddot{q},\tau,t) \tag{8}\]  
where \(\mathbf{H}(q,\dot{q})=\mathbf{C}(q,\dot{q})q+\mathbf{G}(q)+\mathbf{F}_{f}( \dot{q})\). \(\zeta(q,\dot{q},\ddot{q},\tau,t)=\rho(t)\tau+\Psi(q,\dot{q},\ddot{q},t)-\mathbf{ f}(t)\) represents the uncertainties/disturbances and faults/failures. In state space, the dynamic model of Equation (8) becomes  
\[\left\{ \begin{array}{l}\dot{x}_{1}=x_{2}\\ \dot{x}_{2}=f(x_{1},x_{2},\tau)+\phi(x_{1},x_{2},\tau,t)\end{array} \right. \tag{9}\]  
where \(x_{1}=q\in\Re^{n}\), \(x_{2}=\dot{q}\in\Re^{n}\), \(f(x_{1},x_{2},\tau)=\mathbf{M}^{-1}(q)(\tau-\mathbf{H}(q,\dot{q}))\), and \(\phi(x_{1},x_{2},\tau,t)=-\mathbf{M}^{-1}(q)\zeta(q,\dot{q},\ddot{q},\tau,t)\). An extended state observer [19] is given as  
\[\left\{ \begin{array}{l}\dot{\widetilde{x}}_{1}=\widetilde{x}_{2}+\frac{a_{ 1}}{\varepsilon}(x_{1}-\widetilde{x}_{1})\\ \dot{\widetilde{x}}_{2}=\widehat{f}(x_{1},\widetilde{x}_{2},\tau)+\frac{a_{2} }{\varepsilon^{2}}(x_{1}-\widehat{x}_{1})+\widehat{\phi}\\ \dot{\widehat{\phi}}=\frac{a_{3}}{\varepsilon^{3}}(x_{1}-\widehat{x}_{1}) \end{array} \right. \tag{10}\]  
where \(\widehat{x}_{1},\widehat{x}_{2},\widehat{f}\) and \(\widehat{\phi}\) are estimates of \(x_{1},x_{2},f\) and \(\phi\), respectively; \(\alpha_{1},\alpha_{2}\), and \(\alpha_{3}\) are positive constants; polynomial \(s^{3}+\alpha_{1}s^{2}+\alpha_{2}s+\alpha_{3}\) is Hurwitz; and \(0<\varepsilon<1\). **Theorem 1**. : _Considering the system (9) with observer (10) and satisfying \(0<\varepsilon<1\) and \(\left|\dot{\phi}\right|\leq L\), then \(\widehat{x}_{1}(t)\to x_{1}(t)\), \(\widehat{x}_{2}(t)\to x_{2}(t)\) and \(\widehat{\phi}(q,\dot{q},t)\to\phi(q,\dot{q},t)\) as \(t\to\infty\)._  
Proof. : We define the observer error as \(\tilde{\epsilon}=[\tilde{\epsilon}_{1},\tilde{\epsilon}_{2},\tilde{\epsilon} _{3}]^{T}\) where \(\tilde{\epsilon}_{1}=(x_{1}-\widehat{x}_{1})/\varepsilon^{2}\), \(\tilde{\epsilon}_{2}=(x_{2}-\widehat{x}_{2})/\varepsilon\) and \(\tilde{\epsilon}_{3}=\phi-\widehat{\phi}\). From assumption 1 and Equation (9), it can be seen that there will exist a value \(L\) satisfying \(\left|\dot{\phi}\right|\leq L\). The value of \(LWe define the Lyapunov function as  
\[V=\varepsilon\tilde{\epsilon}^{T}P\tilde{\epsilon} \tag{11}\]  
where the matrix \(P\) is unique, symmetric, and positive. The time derivative of \(V\) in Equation (11) is  
\[\dot{V}=\dot{\epsilon}\dot{\tilde{\epsilon}}^{T}P\tilde{\epsilon}+\varepsilon \tilde{\epsilon}^{T}P\dot{\tilde{\epsilon}} \tag{12}\]  
where  
\[\dot{\epsilon}\dot{\tilde{\epsilon}} =\left[ \begin{array}{c}\dot{\epsilon}\dot{\tilde{\epsilon}}_{1 }\\ \dot{\epsilon}\dot{\tilde{\epsilon}}_{2}\\ \dot{\epsilon}\dot{\tilde{\epsilon}}_{3}\end{array} \right]=\left[ \begin{array} []{c}\frac{\dot{\tilde{x}}_{1}-\dot{\tilde{x}}_{1}}{\varepsilon}\\ \dot{\epsilon}\frac{\dot{\tilde{x}}_{2}-\dot{\tilde{x}}_{2}}{\varepsilon}\\ \dot{\epsilon}(\dot{\phi}-\dot{\phi})\end{array} \right]=\left[ \begin{array}{c }-\frac{\alpha_{1}}{\varepsilon^{2}}(x_{1}-\widehat{x}_{1})+\frac{1}{ \varepsilon}(x_{2}-\widehat{x}_{2})\\ -\frac{\alpha_{2}}{\varepsilon^{2}}(x_{1}-\widehat{x}_{1})+(\dot{\phi}-\dot{ \phi})\\ \varepsilon\dot{\phi}-\frac{\alpha_{3}}{\varepsilon^{2}}(x_{1}-\widehat{x}_{1} )\end{array} \right] \tag{13}\] \[=\left[ \begin{array}{c}-\alpha_{1}\tilde{\epsilon}_{1}+\tilde{ \epsilon}_{2}\\ -\alpha_{2}\tilde{\epsilon}_{1}+\tilde{\epsilon}_{3}\\ -\alpha_{3}\tilde{\epsilon}_{1}+\varepsilon\dot{\phi}\end{array} \right]=A \tilde{\epsilon}+\varepsilon B\dot{\phi}\]  
where  
\[A=\left[ \begin{array}{ccc}-\alpha_{1}&1&0\\ -\alpha_{2}&0&1\\ -\alpha_{3}&0&0\end{array} \right]\text{and }B=\left[ \begin{array}{c}0\\ 0\\ 1\end{array}