# Optimization Method of Assembly Tolerance Types Based on Degree of Freedom
## 4 CPDF for Geometric Functional Tolerancing of Assemblies
### CPDF Acquisition
#### 4.1.3 Analysis of the Impact of Contact Change Displacement on the Geometric Function  
Based on the dimensions marked in Figure 2 of the assembly model, the vector of the coordinate origin of the local coordinate system B (\(w\)-\(mln\)) in the global coordinate system is expressed as \(r_{o}\) = (b 1 k), and the position vector of the measured point P in the ideal feature plane P\({}_{2}\) is denoted as \(r_{p}\) in the local coordinate system B (\(w\)-\(mln\)), as shown in Equation (2). \[r_{p}= \begin{pmatrix}0&l&n&1\end{pmatrix}  \tag{2}\]  
When the actual assembly joint changes in displacement relative to the ideal assembly joint, the coordinate system G (\(O\)-\(XYZ\)) of the ideal feature plane of the assembly joint changes, and the coordinate system is transformed into \(G\)'(\(O\)-\(X\)'\(Y\)'\(Z\)), as shown in Figure 3b, whose displacement change is described by the displacement vector V, as shown in Equation (3). \[v= \begin{pmatrix}T_{x}&T_{y}&T_{z}&R_{x}&R_{y}&R_{z}\end{pmatrix} = \begin{pmatrix} \Delta X&\Delta Y&\Delta Z&\alpha&\beta&\lambda\end{pmatrix}  \tag{3}\]  
At the same time, the position of the measured point \(P\) also changes. In the global coordinate system G (\(O\)-\(XYZ\)), the position vector of the measured point \(P\) after change of its position is expressed as \(r_{G}\), \(r_{G}\) is as shown in Equation (4). \[r_{G}= \begin{pmatrix}X_{P}&Y_{P}&Z_{P}&1\end{pmatrix}  \tag{4}\]  
When the global coordinate changes, the conversion relation between the position vectors \(r_{G}\) and \(r_{p}\) is as shown in Equation (5) [3]. \[r_{G}=T_{B}r_{p} \tag{5}\]  
In Formula (5), \(T_{B}\) is the homogeneous transformation matrix, and the expression is shown in Formula (6) [37]:  
\[T_{B}= \begin{pmatrix}r_{11}&r_{12}&r_{13}&X_{0}\\ r_{21}&r_{22}&r_{23}&Y_{0}\\ r_{31}&r_{32}&r_{33}&Z_{0}\\ 0&0&0&1\end{pmatrix} = \begin{pmatrix}C_{B}&&d_{G}\\ 0&0&0&1\end{pmatrix}  \tag{6}\]The value of the element \(r_{ij}\) in the matrix \(T_{B}\) is related to the rotational coordinate axis; \(C_{B}\) is the rotation matrix. When the G-coordinate system is rotated around the X-axis only and the rotational displacement is \(\alpha\), the expression \(C_{B}\) is as shown in Formula (7) [38]. \[C_{B}=C_{X}= \begin{pmatrix}1&0&0\\ 0&\cos\alpha&\sin\alpha\\ 0&-\sin\alpha&\cos\alpha\end{pmatrix}  \tag{7}\]  
The \(d_{G}\) is the relative position vector between the local coordinate system and the global coordinate system. In this paper, \(d_{G}\) is as shown in Equation (8). \[d_{G}=(X_{0}\quad Y_{0}\quad Z_{0})=r_{0} \tag{8}\]  
When there is only rotational displacement around the X-axis, Equation (9) is obtained from Equations (6) and (7). \[T_{B}=T_{X}= \begin{pmatrix}1&0&0&X_{0}\\ 0&\cos\alpha&\sin\alpha&Y_{0}\\ 0&-\sin\alpha&\cos\alpha&Z_{0}\\ 0&0&0&1\end{pmatrix}  \tag{9}\]  
In the global coordinate system, the measured point P position changes \(\Delta r\) is determined by Formula (10):  
\[\Delta r= \begin{pmatrix}\Delta X_{P}\\ \Delta Y_{P}\\ Z\Delta_{P}\end{pmatrix} =r_{G}-(r_{p}+d_{G}), \tag{10}\]  
The element values \(\Delta X_{p}\), \(\Delta Y_{p}\), and \(\Delta Z_{p}\) in the position change vector \(\Delta r\) represent the changes of the measured point \(P\) in the X-axis direction, the Y-axis direction, and the Z-axis direction, respectively. They have different effects on the functional geometric error of the assembly body. In the assembly model shown in Figure 2, only the displacement change in the X-axis direction \(\Delta X_{p}\) affects the perpendicularity error value. For the assembly body shown in Figure 2, the influence of the rotational displacement of the assembly feature surface around the X, Y, and Z coordinate axes on the perpendicularity error is analyzed using Formulas 1 and 5, respectively. Only when the assembly feature surface F\({}_{11}\) is rotated around the X-axis, the rotation displacement is \(\alpha_{2:1}\). In the local coordinate system, the position vector of measured point P in the target feature surface F\({}_{12}\) is as follows: \(r_{p}=