# Research on Multiple-Axis Contour Error Suppression Method Based on Composite Layered Control
## 3 Design of Composite Layered Cross-Coupling Controller
### Double-Layer Profile Error Model  
The geometric relationship between the actual and reference positions point calculates the contour error. In multi-axis motion control systems, some scholars internationally use three-dimensional nonlinear estimation methods [35] and vector methods [36] to estimate the contour error of multi-axis motion control systems. The nonlinear trajectory of multi-axis motion is shown in Figure 7, where \(P_{0}\) is the reference position, \(P\) is the actual position, and \(|P_{0}P|\) is the tracking error. Figure 5: Disturbance error under different conditions. Assuming that \(\overrightarrow{e}=\left[e_{x}e_{y}e_{z}\right]^{T}\) is a 3D contour tracking error vector, the relationship between the vectors can be used to obtain:  
\[ \begin{split}\overrightarrow{e}_{t}&=\left\langle \overrightarrow{e},\overrightarrow{t}\right\rangle\cdot\overrightarrow{t}\\ \overrightarrow{e}_{n}&=\left\langle \overrightarrow{e},\overrightarrow{n}\right\rangle\cdot\overrightarrow{n} \end{split}  \tag{27}\]  
where the vector \(\overrightarrow{n}\) and the vector \(\overrightarrow{t}\) are the unit normal vector and the tangent vector at the reference position \(P_{0}\). As can be seen from Figure 7, when the value of \(\overrightarrow{e}_{t}\) of the tangent direction sub-vector is small, the contour error \(\varepsilon\) of the system can be approximately equal to the normal direction sub-vector \(\overrightarrow{\varepsilon}_{n}\), which can be expressed as:  
\[\overrightarrow{e}\approx\overrightarrow{e}_{n}=\left\langle \overrightarrow{e},\overrightarrow{n}\right\rangle\cdot\overrightarrow{n} \tag{28}\]  
Figure 6: Control system structure block diagram. Figure 7: Three-dimensional space contour error. Reference [37] provides the calculation results of the lower \(\theta\) angle of XY and the upper \(\gamma\) angle of RZ, as well as the lower contour error \(\varepsilon_{cxy}\) and the upper contour error \(\varepsilon_{cxz}\), as shown in Equation (29):  
\[ \begin{split}\theta&=\tan^{-1}\left(\frac{r_{1y}(n)-r_{1 y}(n-1)}{r_{1x}(n)-r_{1x}(n-1)}\right)\\ \gamma&=\tan^{-1}\left(\frac{r_{1x}(n)-r_{1z}(n-1)}{ r_{1x}(n)-r_{1x}(n-1)}\right)\\ \varepsilon_{cxy}&\approx\varepsilon_{nxy}=\left< \overset{\rightarrow}{e},\overset{\rightarrow}{n}\right>=-\varepsilon_{x} \sin\theta+e_{y}\cos\theta\\ \varepsilon_{cxz}&\approx\varepsilon_{nxz}=\left< \overset{\rightarrow}{e},\overset{\rightarrow}{n}\right>=-e_{r}\sin\gamma+ \varepsilon_{z}\cos\gamma\end{split}  \tag{29}\]  
where \(n\) and \(n-1\) represent the instants of \(n^{th}\) and \((n-1)^{th}\), respectively, \(r_{1x}\) and \(r_{1y}\) are the \(X\) coordinate components and \(Y\) coordinate components of \(P_{1}\), and the contour error at the lower level can be estimated as the normal vector \(P_{0}P_{1}^{n^{\prime\prime}}\), while the contour error at the top level can be estimated as the normal vector \(P^{n_{1}}P_{1}^{n^{\prime}}\). Assuming the angle between the two layers is E, based on the geometric relationship between the points in Figure 8, the spatial contour error can be obtained as \(|P_{0}P^{n_{1}}|\):  
\[\left\|P_{0}P_{1}^{n^{\prime}}\right\|=\sqrt{\varepsilon_{cxy}^{2}+\varepsilon _{cxz}^{2}-2\varepsilon_{cxy}\varepsilon_{cxz}\cos\xi} \tag{31}\]  
From Equation (31), it can be seen that when the lower contour error \(\varepsilon_{cxy}\) and the upper contour error \(\varepsilon_{cxz}\) approach zero, the spatial contour error \(\varepsilon_{c}\) will also approach zero. Therefore, the proposed double-layer contour error model is effective. In this study, controllers were devised separately for the upper and lower layers and were subsequently integrated to achieve the suppression of three-dimensional spatial contour errors. The comprehensive construction of the dual-layer contour error model was elaborated upon by [PERSON] et al. in reference [37]; thus, this aspect will not be reiterated in this paper.