# Human-Robot Cooperative Control Based on Virtual Fixture in Robot-Assisted Endoscopic Sinus Surgery
## 2 Robot Motion Constraint Model Based on Virtual Fixture
### Virtual Fixtures for Endoscopic Simus Surgery
#### 2.2.1 Guiding Virtual Fixture Based on Spatial Curve  
For the geometry of GVFs, there are mainly straight line, two-dimensional curve, three-dimensional curve, etc. However, for the robot system, considering the smoothness and computational complexity of the motion trajectory, the cubic polynomial spatial curve is mostly used.  
As shown in Figure 2a, the schematic diagram of the GVF based on a spatial curve is shown. Assuming that the coordinates of the robot end are \(p(x,y,z)\), the velocity of the robot end is \(V_{int}\), and the curve, S, is the guiding spatial curve, the velocity of the robot end can be decomposed into the velocity along the tangential direction and velocity in the direction perpendicular to the tangential direction:  
\[\left\{\begin{array}{c}V_{in}=V_{in}^{\parallel}+V_{in}^{\perp}\\ V_{in}^{\parallel}=T\cdot V_{in}\\ V_{in}^{\perp}=V_{in}-V_{in}^{\parallel}\end{array}\right. \tag{1}\]  
Introducing a guiding stiffness coefficient, \(k\in[0,1]\), to scale the velocity in the perpendicular tangential direction, the following is obtained:  
\[V_{out}^{\perp}=k\cdot V_{in}^{\perp} \tag{2}\]  
Thus, the velocity of the robot end after the action of the GVF can be obtained as follows:  
\[V_{out}=V_{in}^{\parallel}+k\cdot V_{in}^{\perp} \tag{3}\]  
For the above GVF, different guiding requirements can be achieved by setting different values of the guiding stiffness coefficient. When \(k=1\), the velocity of the robot end remains unchanged before and after guidance, the VF does not work, and the robot is in a free motion state. When \(0<k<1\), the velocity in the perpendicular tangential direction of the robot end is reduced, so the robot will be directed to the curve, S. When \(k=0\), the velocity of the robot end in the perpendicular tangential direction is completely removed and the robot end will be forced to move in the tangential direction of the curve, S. From the above, the smaller the guiding stiffness coefficient is, the stronger the motion guidance to the robot end obtained.  
The above situation is the velocity guidance under ideal conditions. In practical applications, the end of the robot is generally not on the spatial curve, so that the motion trajectory of the robot end will be a curve parallel to the guiding curve.  
Figure 2b shows the action of the GVF when the robot end is not on the guiding curve. Assume \(P^{s}\) is the closest point on the curve to the robot end, then:  
\[P^{s}=\text{Mindistance}(S,P) \tag{4}\]  
Adding a regression coefficient, \(\lambda\), then the regression velocity can be calculated as follows (direction is pointed to \(P^{s}\) from \(P\)):  
\[V_{s}=\lambda\cdot\overline{\text{PP}^{s}} \tag{5}\]  
By adjusting the regression coefficient, the velocity of the robot end returning to the curve can be adjusted, and then the final velocity can be obtained:  
\[V_{out}^{s}=V_{out}+V_{s} \tag{6}\]  
From the above analysis, it can be seen that different guiding requirements of the GVF can be realized by adjusting the guiding stiffness coefficient, k, and the regression coefficient, \(\lambda\).  
The above derivation process of the GVF based on the spatial curve can be applied to the straight line, the two-dimensional curve, and so on because they can be regarded as a special case of the spatial curve.