## 2 Methods
### Robotic System for Thyroid Surgery
#### 2.4.3 Master-Slave Safety Constraints Based on Safety Zones  
The minimally invasive thyroid surgery robot lacks force sensing, limiting its ability to provide feedback such as traction and pressure. As a result, surgeons rely solely on endoscopic images, which may be inadequate for precise decision-making. Moreover,  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Index of Joint** & **Name** & \(L_{i}\) & \(d_{i}\) & \begin{tabular}{c} **Required Force** \\ **(N)** \\ \end{tabular} & \
\begin{tabular}{c} **Required Torque** \\ **(N-mm)** \\ \end{tabular} &
\begin{tabular}{c} **Reduction** \\ **Ratios** \\ \end{tabular} \\ \hline
1 & Effector Ender & 20.0 & 0.81 & 274.2 & 822.6 & 1:89 \\ \hline
2 & Wrist joint 2 & 26.00 & 2.35 & 140.5 & 421.5 & 1:72 \\ \hline
3 & Wrist joint 1 & 37.40 & 2 & 267.7 & 803.1 & 1:72 \\ \hline
4 & Elbow joint & 49.04 & 2.46 & 307.2 & 921.6 & 1:89 \\ \hline
5 & Shoulder joint 2 & 38.49 & 2.46 & 299.6 & 898.8 & 1:72 \\ \hline
6 & Shoulder joint 1 & 19.09 & 1.97 & 411.2 & 1233.6 & 1:89 \\ \hline
7 & Rotary joint & 63.5 & 3 & 381 & 762 & 1:72 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Requirements of the motors for each joint.  
the robot's confined workspace can cause visual obstructions, increasing the risk of mis-operation and damage to healthy tissues.  
To address this issue, we propose a master-slave safety constraint function, incorporating both linear and spherical safety zones.  
Linear Safety Zone. This zone is used for inserting and retracting the slave tool arm. The surgeon activates the master-slave safety constraint mode by pressing a foot pedal, which locks the master hand device's gripper at two points to define a linear path, restricting the master hand's movement along this line.  
Spherical Safety Zone. This zone defines the region of the thyroid tumor, limiting the slave tool arm to a predefined spherical area. The surgeon selects the safety zone by pressing the foot pedal twice. First, they define the center of the spherical region with the master hand device, then move to a point on the sphere's surface and confirm by closing the gripper. If the master hand moves outside the spherical region, the system calculates the position vector to the center and applies a counteracting force using a spring-damper model to guide the master hand back within the zone.  
Building upon the introduction of linear and spherical safety zones, this study further explores the implementation of a spring-damper model to enforce the safety constraints and ensure that the master hand device operates within these predefined boundaries. If the projection vector of the current position vector of the master hand device is \(\overset{\rightarrow}{P}\), and the current velocity vector of the master hand device is \(\overset{\rightarrow}{V}\), the force vector \(\overset{\rightarrow}{F}\) can be calculated as follows based on the spring and damping effects:  
\[\overset{\rightarrow}{F}=K\cdot\overset{\rightarrow}{P}-C\cdot\overset{ \rightarrow}{V} \tag{21}\]  
To validate the effectiveness of the master-slave safety constraints, we simulated the process of establishing spherical and linear safety zones by manipulating the master hand device and recorded the resulting trajectory of the master hand's movement. As depicted in Figure 5c, the master hand device was confined to move exclusively within the predefined safety zones in the Gazebo simulation environment. Upon breaching these zones, a reactive force was computed utilizing the spring-damper model, which effectively propelled the master hand device back within the safe operational boundaries.