# Fuzzy Adaptive Dynamic Surface Control with Constant Gain for Non-Affine Pure-Feedback Systems
## 4 Simulation Results
### Simulation Example 2  
To further demonstrate the practicality of the control algorithm, it is specifically used to control the trajectory of a type of flexible robot:  
\[\begin{split}& mL^{2}\bar{\theta}+mgL\sin(\theta)+r(\dot{\theta})+S_{c }\theta=S_{c}\theta_{r}\\ & F_{c}\ddot{\theta}_{r}+D_{c}\dot{\theta}_{r}+S_{c}(\theta_{r}- \theta)=u_{F}(t)\end{split} \tag{86}\]  
If the link position \(\theta=x_{1}\), the link velocity \(\dot{\theta}=x_{2}\), the rotor position \(\theta_{r=x_{3}}\), and the rotor velocity \(\dot{\theta}_{r}=x_{4}\), then the dynamic Equation (86) of the flexible robot can be transformed into a standard form:  
\[\begin{split}&\dot{x}_{1}=x2+d_{1}(t)\\ &\dot{x}_{2}=7x_{3}+g_{2}(x_{1},x_{2})\\ &\dot{x}_{3}=x4+d_{3}(t)\\ &\dot{x}_{4}=0.01u+g_{4}(x_{1},x_{3},x_{4})\\ & y=x_{1}\end{split} \tag{87}\]  
where \(g_{2}=(2x_{1}-2.45\sin(x_{1})-r(x_{2}))/0.25\), and \(g_{4}=(-0.6x_{4}-2(x_{3}-x_{1}))/0.001\); \(d_{1}(t)=0.02\cos(t)+0.01\cos(2t)\), and \(d_{2}(t)=0.15\sin(t)+0.02\cos(5t)\) represent some periodic time-varying disturbances. Due to (87) being a fourth-order system, it is necessary to design three virtual control laws, one actual control signal, and one adaptive law:  
\[\alpha_{1}=\frac{-a_{1}e_{1}}{\psi_{1}}-\frac{e_{1}\dot{\theta}\bar{W}_{1}^{T} \bar{W}_{1}}{\psi_{1}2b_{1}^{2}}-\frac{x_{2}}{\psi_{1}}-e_{2}+x_{2}^{0}+\frac {\dot{y}_{1d}}{\psi_{1}} \tag{88}\]  
\[\alpha_{2}=\frac{-a_{2}e_{2}}{\psi_{2}}-\frac{e_{2}\dot{\theta}\bar{W}_{2}^{T} \bar{W}_{2}}{\psi_{2}2b_{2}^{2}}-\frac{\delta_{2}}{\psi_{2}}-e_{3}+x_{3}^{0}+ \frac{\dot{w}_{2}}{\psi_{2}} \tag{89}\]  
\[\alpha_{3}=\frac{-a_{3}e_{3}}{\psi_{3}}-\frac{e_{3}\dot{\theta}\bar{W}_{3}^{T} \bar{W}_{3}}{\psi_{3}2b_{3}^{2}}-\frac{x_{4}}{\psi_{3}}-e_{4}+x_{4}^{0}+\frac {\dot{w}_{3}}{\psi_{3}} \tag{90}\]  
\[u=\frac{-a_{4}e_{4}}{\psi}-\frac{e_{4}\dot{\theta}\bar{W}_{4}^{T}\bar{W}_{4}} {\psi 2b_{4}^{2}}+u^{0} \tag{91}\]  
\[\dot{\theta}=\varsigma\sum_{i=1}^{4}\frac{e_{i}^{2}\bar{W}_{i}^{T}\bar{W}_{i}} {2b_{i}^{2}}-\varphi\dot{\theta} \tag{92}\]  
This flexible robot starts operating from the following initial state: \(x_{1}(0)=0.1\), \(x_{2}(0)=0.14\), \(x_{3}(0)=0.2\), \(x_{4}(0)=0.14\), \(\dot{\theta}(0)=0.2\), \(w_{2}(0)=0\). The key control parameters are set to \(a_{1}=9\), \(a_{2}=12\), \(a_{3}=6\), \(a_{2}=4\), \(b_{1}=0.43\), \(b_{2}=0.18\), \(b_{3}=0.11\), \(b_{2}=0.56\), \(\psi=4\), \(\varsigma=7\), \(\varphi=0.7\), \(u^{0}=0\), and \(x_{2}^{0}=0\), respectively. In addition, the node width parameter in the fuzzy logic system is set to \(1.5\), and the center position vector is set to \([-8,-7,\ldots,7,8]^{T}\). A classic PID controller is also used to control the joint angular displacement of the flexible robot [38]. The three key parameters of this PID controller, namely, proportional, integral, and derivative parameters, are set to \(4\), \(0.5\), and \(0.1\), respectively. The relevant simulation results are shown in Figure 7. The proposed control algorithm can ensure that the variation range of tracking error is reduced within the range of \(-0.0204\) to \(0.007171\). However, the range of variation for the PID control algorithm extends to \(-0.0204\) to \(0.02022\). Therefore, the control algorithm has a small tracking error.