# Research on Multiple-Axis Contour Error Suppression Method Based on Composite Layered Control
## 2 Design of a Single-Axis Controller Based on Sliding-Mode Disturbance Observer
### Design of Disturbance Observer  
In the design and analysis of ISSMC shown in Section 2.2, the influence of external disturbance was not considered; only the control performance of the sliding-mode control under the approach law and the ability to reduce chatter were considered. However, it is apparent from Equation (1) that there is a disturbance, \(f\), built into the model, and there is inevitable external disturbance in practical engineering applications. Therefore, it is necessary to design a disturbance observer to observe the external disturbance of the sliding-mode controller and the feed-forward compensation. The disturbance observer can be categorized into various types: an inverse nominal model-based disturbance observer, an extended-state observer-based disturbance observer, a nonlinear observer-based disturbance observer, and a state observer-based disturbance observer. However, in practical machining, external disturbances manifest in various forms such as external noise interference, signal interference, and environmental changes, exhibiting nonlinear characteristics. Consequently, this paper, based on actual numerical-control machining systems, designed a disturbance observer using a nonlinear observer, as illustrated in Equation (22):  
\[ \begin{split}\left[\begin{array}{c}\dot{f}\\ \dot{\tilde{e}}\end{array}\right]=\left[\begin{array}{cc}0&0\\ 1&0\end{array}\right]\left[\begin{array}{c}\dot{f}\\ \dot{\tilde{e}}\end{array}\right]+\left[\begin{array}{cc}0\\ 1\end{array}\right]\left(\ddot{x}_{1}+\frac{B}{M}\dot{x}_{1}\right)\\ &+\left[\begin{array}{c}0\\ B\end{array}\right]u+\left[\begin{array}{c}k_{1}\\ k_{2}\end{array}\right]\left[\begin{array}{cc}\dot{e}&\dot{\tilde{e}}\end{array}\right] \end{split}  \tag{22}\]  
where \(\hat{f}\) is the estimation of uncertain disturbance \(f\) and is observed by the disturbance observer designed in this section, \(\widetilde{f}=f-\hat{f}\) is defined as the estimation error of the disturbance, \(\dot{\tilde{e}}\) is the estimated value of \(\dot{e}\), and \(\widetilde{\dot{e}}=\dot{e}-\dot{\tilde{e}}\) is the estimated error of the estimated value. The disturbance observer can be further expressed as:  
\[ \begin{split}\dot{\tilde{f}}&=k_{1}\widetilde{\dot{e}}\\ \dot{\tilde{e}}&=\hat{f}-Bu+k_{2}\widetilde{\dot{e}}+\ddot{x}_{d}+A\dot{x}_{ 1}\end{split}  \tag{23}\]  
where \(k_{1}\) and \(k_{2}\) are coefficient constants. Next, the stability analysis is performed, and the Lyapunov function is defined as [34]:  
\[V_{2}=\frac{1}{2k_{1}}\widetilde{f}^{2}+\frac{1\dot{\gamma}^{2}}{2} \tag{24}\]  
The sampling frequency of the controller is usually much greater than the change time of the external disturbance, so the external disturbance can be considered as a constant value during the sampling period, which is \(\hat{f}=0\). Furthermore, by incorporating the disturbance observer Equation (23) into Equation (24), it can be concluded that:\[ \begin{split} V_{2}&=-\frac{1}{k_{1}}\tilde{f}\tilde{f}+ \tilde{\tilde{e}}\left(\ddot{x}_{d}-\ddot{x}_{1}-\dot{\tilde{e}}\right)\\ &=-\frac{1}{k_{1}}\tilde{f}\tilde{f}\ \ +\tilde{\tilde{e}}\left( \ddot{x}_{d}-\ddot{x}_{1}-\left(\begin{array}{c}\tilde{f}-B+k_{2}\tilde{ \tilde{e}}\\ +\ddot{x}_{d}+\dot{A}\dot{x}_{1}\end{array}\right)\right)\\ &=\ -\frac{1}{k_{1}}\tilde{f}\dot{f}+\tilde{\tilde{e}}\left(\begin{array}{c} \ddot{x}_{d}+A\dot{x}_{1}-Bu+f-\\ \left(\tilde{f}-B+k_{2}\tilde{\tilde{e}}+\ddot{x}_{d}+A\dot{x}_{1}\right) \end{array}\right)\\ &=-\tilde{\tilde{f}}\tilde{e}+\tilde{\tilde{e}}\left(\tilde{f}-k_{2}\tilde{ \tilde{e}}\right)\\ &=-k_{2}\tilde{e}^{2}\leq 0\end{split}  \tag{25}\]  
Based on the [PERSON] stability theory, the system is proven to be stable. The disturbance observer Equation (23) can be further represented as Equation (26), and its structural diagram is shown in Figure 3:  
\[\ddot{\tilde{f}}=(k_{1}-k_{2})\dot{f}+k_{1}BU-k_{1}\ddot{x}_{1}-k_{1}A\dot{x} _{1} \tag{26}\]  
Based on the disturbance observer equation provided in Equation (26), we conducted a study on its observability performance.