# Human-Robot Cooperative Control Based on Virtual Fixture in Robot-Assisted Endoscopic Sinus Surgery
## 2 Robot Motion Constraint Model Based on Virtual Fixture
### Overall Robot Motion Constraint Model Based on Virtual Fixture  
Through the analysis in the above section, several typical VF types suitable for endoscopic sinus surgery have been obtained. Considering that it is difficult for a single VF to meet the diverse constraint requirements during different stages of robot-assisted endoscopic sinus surgery, a composite VF is constructed based on the above typical VFs, and the overall robot motion constraint model is obtained, as shown in Figure 5.  
Figure 5: Overall robot motion constraint model based on VFs.  
After multiple VFs are combined, the working condition and scope of each basic VF have been changed to avoid conflicts among the basic VFs. Based on the robot-assisted endoscopic sinus surgery procedure, the process of the composite VF system is shown in Figure 6.  
The detailed process of the composite VF is as follows:  
1) Enter the coordinates, \(P(x,y,z)\), and velocity, \(V_{in}\), of the endoscope tip in the composite VF system.  
Figure 6: The process of the composite VF.  
2) Calculate the directed distance, \(D_{P2 Plane}\), from the endoscope tip to the constraint plane (plane normal direction is positive). If \(D_{P2 Plane}\geq 0\), indicating the endoscope tip is above the constraint plane, the robot can move freely in all directions, and go to step (7); if \(D_{P2 Plane}<0\), indicating the endoscope tip is below the constraint plane, go to step (3).  
3) Calculate the spatial relationship between the endoscope tip and nasal entrance point (RCM point) (the direction of the single-leaf hyperboloid opening is positive). If \(D_{P2 RCM}\geq 0\), it means that the endoscope tip is above the nasal entrance point, go to step (4); if \(D_{P2 RCM}<0\), it means that the endoscope tip is below the nasal entrance point, go to step (5).  
4) Calculate the spatial relationship between the endoscope tip and single-leaf hyperboloid (if the endoscope tip is outside the single-leaf hyperboloid, the \(D_{P2 Surface}\) is positive). If \(D_{P2 Surface}\geq 0\), it means the endoscope tip is outside the single-leaf hyperboloid, go to step (6); if \(D_{P2 Surface}<0\), it means the endoscope tip is inside the single-leaf hyperboloid, the robot can move freely in all directions, go to step (7).  
5) The endoscope enters the RCM restraint state, and the movement of the endoscope will be constrained to two rotational degrees of freedom around the RCM point, go to step (7).  
6) Compare the distance from the endoscope tip to the constraint plane and distance from the endoscope tip to the single-leaf hyperboloid. If \(D_{P2 Surface}\geq D_{P2 Plane}\), it means the endoscope tip is close to the constraint plane, and the plane constraint is used to deal with the velocity of the endoscope tip; if \(D_{P2 Surface}<D_{P2 Plane}\), it means the endoscope tip is close to the single-leaf hyperboloid, and the velocity of the endoscope tip is processed by the single-leaf hyperboloid constraint. Go to step (7).  
7) Calculate the distance between the endoscope tip and the point cloud model of the nasal tissue. If \(D_{P2 Cloud}>0\), it means that there is no interference between the endoscope tip and nasal tissue, and the robot can move freely in all directions; if \(D_{P2 Cloud}\leq 0\), it means that the endoscope tip and nasal tissue are interfering. The robot stops moving.