# Kinematic Modeling of a Trepanation Surgical Robot System
## 2 Methods
### Numerical Solution for the Forward Kinematics of the Tripod End-Effector  
When concerned with parallel robots, since very often the solution to the forward kinematics problem is unavailable in closed form, it is very common to use numerical methods instead. In this section one such solution based on the formulation of the optimization problem is presented. The forward kinematics problem for the tripod end-effector can be formulated as a task of finding the pose of the end-effector when the configuration variables are known:  
\[{}^{B}_{E}T=FK(q_{1},\,q_{2},\,q_{3}) \tag{24}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**i** & \(\mathbf{\alpha_{i-1}}\) & \(\mathbf{L_{i-1}}\) & \(\mathbf{d_{i}}\) & \(\mathbf{q_{i}}\) \\ \hline
1 (\{\{B\},\{2\})\} & 0 & b & \(q_{2}\) & \(-\pi/4\) \\
2 (\{\{2\},\{B_{2}\}\} & \(-\pi/2\) & 0 & 0 & \(q_{22}-\pi\) \\
3 (\{\{B_{2}\},\{C_{2}\}\} & 0 & B2C2 & 0 & \(q_{32}\) \\
4 (\{\{C_{2}\},\{E\}\} & \(-\pi/2\) & C2E & 0 & \(-5\pi/8\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The modified D-H parameters from the the fixed frame \(\{B\}\) to the body frame \(\{E\}\) via \(\{B_{2}\}\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**i** & \(\mathbf{\alpha_{i-1}}\) & \(\mathbf{L_{i-1}}\) & \(\mathbf{d_{i}}\) & \(\mathbf{q_{i}}\) \\ \hline
1 (\{\{B\},\{3\}\}) & 0 & b & \(q_{3}\) & \(\pi/4\) \\
2 (\{\{3\},\{B_{3}\}\} & \(-\pi/2\) & 0 & 0 & \(q_{23}-\pi\) \\
3 (\{\{B_{3}\},\{C_{3}\}\} & 0 & B Since the end-effector \(E\) is fixed to the tripod platform and the \(\frac{C_{1}^{1}}{E}T\) transform is known, the problem can be reduced to the issue of finding the transform \(\frac{B}{C_{1}}T\). It is immediately evident that the vertical displacement between the points \(B_{1}\) and \(C_{1}\) is equal to the configuration variable \(q_{1}\). The transform \(\frac{B}{C_{1}}T\), taking into account its degrees of freedom, can thus be parametrized in the following way:  
\[ \begin{split}\frac{B}{C}T(q_{1},\,\frac{B_{1}^{t}}{C}r_{x},\, \frac{B_{1}^{t}}{C}r_{y})&=\mathrm{Trans}(0,\,0,\,q_{1})\cdot \mathrm{Rot}([0,\,1,\,0],\,\frac{B_{1}^{t}}{C}r_{y})\cdot\mathrm{Rot}([1,\,0, \,0],\,\frac{B_{1}^{t}}{C}r_{x})\end{split}  \tag{25}\]  
Next, the positions of the points \(C_{2}\) and \(C_{3}\) can be found as:  
\[ \begin{split}{}^{B}C_{2}&=\frac{B}{C}T\cdot C^{C}C_{ 2}\\ {}^{B}C_{3}&=\frac{B}{C}T\cdot C^{C}C_{3}\end{split}  \tag{26}\]  
The positions of the ends of the actuators \(B_{2}^{\prime}\) and \(B_{3}^{\prime}\) associated with the configuration variables \(q_{1}\) and \(q_{2}\), respectively, can be found as:  
\[ \begin{split}{}^{B}B_{2}^{\prime}&=\mathrm{Trans}(0, \,0,\,q_{2})\cdot{}^{B}B_{2}\\ {}^{B}B_{3}^{\prime}&=\mathrm{Trans}(0,\,0,\,q_{3}) \cdot{}^{B}B_{3}\end{split}  \tag{27}\]  
We can now observe that the solution to the forward kinematics problem is only correct when the distances between the calculated pairs of points \(({}^{B}B_{2}^{\prime},\,\,{}^{B}C_{2})\) and \(({}^{B}B_{3}^{\prime},\,\,{}^{B}C_{3})\) satisfy the distance constraints imposed by the lengths \(r\) of the links connecting the ends of the actuators \(q_{2}\) and \(q_{3}\) to the tripod platform. Let us construct the objective function:  
\[f(\begin{subarray}{c}B_{1}^{t}r_{x},\,\, \begin{subarray}{c}B_{1}^{t}\\ C\end{subarray} r_{y})= (||(^{B}B_{2}^{t}(q_{2}),\,\,^{B}C_{2}(q_{1},\,\begin{subarray}{c}B_{1 }^{t}r_{x},\, \begin{subarray}{c}B_{1}^{t}r_{y}\\ C\end{subarray} r_{y}))||-r)^{2}\] \[+(||(^{B}B_{3}^{t}(q_{3}),\,^{B}C_{3}(q_{1},\,\begin{subarray}{c}B _{1}^{t}r_{x},\, \begin{subarray}{c}B_{1}^{t}r_{y}\\ C\end{subarray} r_{y}))||-r)^{2} \tag{28}\]  
We can now find the orientation coordinates of the tripod platform by solving the optimization problem formulated as:  
\[ \begin{bmatrix}\begin{subarray}{c}B_{1}^{t}\\ C\end{subarray}r_{x},\,\,\begin{subarray}{c}B_{1}^{t}\\ C\end{subarray}r_{y}\end{bmatrix} =\mathrm{argmin}\,f(\begin{subarray}{c}B_{1 }^{t}r_{x},\,\, \begin{subarray}{c}B_{1}^{t}\\ C\end{subarray}