## 3 Parallel Manipulator Mathematical Model
In this case, \(u=u_{1}\), respectively, \(u>D_{link}\) and there is no intersection. Figure 4b shows an example where \(u_{1}>0\) and \(u_{2}>0\), while \(u>D_{link}\), so there is no intersection. **Case 2. ** Condition (36) is not satisfied, that is, the links are not parallel. Let us construct an auxiliary plane in which the segment \(A_{3}A_{4}\) will lie and to which the segment \(A_{1}A_{2}\) will be parallel. In this case, the distance between the segments can be similarly written as:  
\[u=\sqrt{u_{1}^{2}+u_{2}^{2}}, \tag{43}\]  
where \(u_{1}\) is the distance between the segment \(A_{1}A_{2}\) and the auxiliary plane, \(u_{2}\) is the distance between the nearest points of the segments \(A_{3}A_{4}\) and the projection of the segment \(A_{1}A_{2}\) onto the auxiliary plane. To determine \(u_{1}\), we calculate the normal vector:  
\[\mathbf{N}=\left[ \begin{array}{c}N_{x}\\ N_{y}\\ N_{z}\end{array} \right]=\left[ \begin{array}{c}(y_{A4}-y_{A3})(z_{A2}-z_{A1}) -(z_{A4}-z_{A3})(y_{A2}-y_{A1})\\ (z_{A4}-z_{A3})(x_{A2}-x_{A1})-(x_{A4}-x_{A3})(z_{A2}-z_{A1})\\ (x_{A4}-x_{A3})(y_{A2}-y_{A1})-(y_{A4}-y_{A3})(x_{A2}-x_{A1})\end{array} \right] \tag{44}\]  
Figure 4: Checking the intersection of links for case 1—(a) for \(u_{2}=0\), (b) for \(u_{2}>0\). Determine the distance \(u_{1}\) using the coefficient \(k\) for the length of the normal vector. \[u_{1}=\sqrt{\left(N_{x}k\right)^{2}+\left(N_{y}k\right)^{2}+\left(N_{z}k\right) ^{2}}, \tag{45}\]  
where \(k=\frac{N_{x}\left(x_{A1}-x_{A3}\right)+N_{y}\left(y_{A1}-y_{A3}\right)+N_{z} \left(z_{A1}-z_{A3}\right)}{x_{A1}N_{x}+y_{A1}N_{y}+z_{A1}N_{z}}\). Let us determine, using the coefficient \(k\), the coordinates of the point \(A_{11}\) as a result of the projection of the point \(A_{1}\) onto the auxiliary plane:  
\[x_{A11}=x_{A1}-N_{x}k,\;y_{A11}=y_{A1}-N_{y}k,\;z_{A11}=z_{A1}-N_{z}k. \tag{46}\]  
To define \(u_{2}\), rotate the construction plane around point \(A_{11}\) so that it is parallel to the YOZ plane. After rotating the coordinates of the second point of the segment \(A_{12}\) and points \(A_{13}\) and \(A_{14}\) of the second segment, we define as:  
\[x_{A12}=x_{A11}+c^{(a)}(x_{Ai}-x_{A1})+s^{(a)}\Big{(}s^{(b)}(y_{Ai}-y_{A1})+c^ {(b)}(z_{Ai}-z_{A1})\Big{)}, \tag{47}\]  
\[y_{A12}=y_{A11}+c^{(b)}(y_{Ai}-y_{A1})-s^{(b)}(z_{Ai}-z_{A1}), \tag{48}\]  
\[z_{A12}=z_{A11}-s^{(a)}(x_{Ai}-x_{A1})+c^{(a)}\Big{(}s^{(b)}(y_{Ai}-y_{A1})+c^ {(b)}(z_{Ai}-z_{A1})\Big{)}, \tag{49}\]  
\[x_{A1i}=x_{A11}+c^{(a)}(x_{Ai}-x_{A11})+s^{(a)}\Big{(}s^{(b)}(y_{Ai}-y_{A11}) +c^{(b)}(z_{Ai}-z_{A11})\Big{)}, \tag{50}\]  
\[y_{A1i}=y_{A11}+c^{(b)}(y_{Ai}-y_{A11})-s^{(b)}(z_{Ai}-z_{A11}), \tag{51}\]  
\[z_{A1i}=z_{A11}-s^{(a)}(x_{Ai}-x_{A11})+c^{(a)}\Big{(}s^{(b)}(y_{Ai}-y_{A11}) +c^{(b)}(z_{Ai}-z_{A11})\Big{)}, \tag{52}\]  
where \(s^{(a)}=\sin\!\left(\tan^{-1}\!\left(\frac{s^{(b)}N_{y}+c^{(b)}N_{z}}{N_{x}} \right)\right)\), \(c^{(a)}=\cos\!\left(\tan^{-1}\!\left(\frac{s^{(b)}N_{y}+c^{(b)}N_{z}}{N_{x}} \right)\right)\), \(s^{(b)}=\sin\!\left(\tan^{-1}\frac{N_{x}}{N_{z}}\right)\), \(c^{(b)}=\cos\!\left(\tan^{-1}\frac{N_{y}}{N_{z}}\right)\), \(i\leq 3,\;4\). As a result, the definition of \(u_{2}\) is reduced to the problem of calculating the distance between the nearest points of the segments \(A_{11}A_{12}\) and \(A_{13}A_{14}\) on a two-dimensional plane, which consists of checking the intersection of the segments, and then, if there are no intersections, the search for the smallest height dropped from the end of one segment to another. If it is impossible to lower the height, we determine the minimum distance between the extreme points of the segments. Figure 5 shows examples of verification for the second case of intersection of links. Figure 5a shows an example when \(u_{1}>D_{link}\), and \(u_{2}=0\), since the segments intersect in the projection. In this case, \(u=u_{1}\), respectively, \(u>D_{link}\) and there is no intersection. Figure 5b shows an example where \(u_{1}<D_{link}\), but \(u>D_{link}\) and there is no intersection either.