Partial gravity compensation of a surgical robot

Surgical robots are safety-critical devices that require multiple domains of safety features. This article focuses on the passive gravity compensation design optimization of a surgical robot. The limits of this optimization are related with the safety features including minimization of the total moving mass/inertia and compactness of the design. The particle swarm optimization method is used as a novel approach for the optimization of a parallel remote-center-of-motion mechanism. A compact design is achieved by partially balancing the mechanism, which also decreases the torque requirements from the actuators.


Introduction
The use of robot systems for surgical procedures initiated with the adaptation of industrial robots. Since surgical procedures are safety-critical operations, in the later years, robots that are specifically designed for a specific cluster of surgeries have been emerged. In these robots, safety issues are considered in three different domains: (1) mechanical, (2) electrical, and (3) software. In terms of mechanical safety features, one issue is the minimization of the moving mass/inertia and another issue is the passive gravity compensation. Minimized moving mass/inertia minimizes the damage in case of an unforeseen collision. Passive gravity compensation guarantees that the mechanism will be balanced even if the total system fails and actuators cannot be operated.
Another obvious advantage of passive gravity compensation is that the actuator's effort will be mostly spent on the control of the motion rather than working against gravitational loads, which improves the control performance. Hence, peak loads of the actuators will be smaller, which leads to the use of smaller and more precise actuation systems, which is safer for the human-robot interaction. 1 For medical applications, safety requirements lead to another conclusion that gravity balancing is a necessity due to the induced advantages in backdrivability. 2 This article focuses on passive gravity compensation of a surgical robot with the limitation of minimizing the total moving mass/inertia.
The surgical robot mechanism considered in this study is composed of a remote-center-of-motion (RCM) mechanism carried by a passively balanced nonactuated serial arm (passive arm). The system is designed to handle and direct an endoscope in a minimally invasive surgery procedure called a pituitary tumor surgery. 3 The system is called NeuRobo-Scope 4 and its first functional prototype is shown in Figure 1.
The RCM mechanism is designed as a parallel mechanism and its kinematic parameters are shown in Figure 2. The three input angles q 1 , q 2 , and q 3 are used for controlling the two rotations RCM and RCM , and one linear motion d of an endoscope about RCM, which is called pivot point.
This RCM mechanism is designated to work on top of the head of the patient during the surgery. Consequently, there should be safety features in case of possible failures in the system. Potential scenarios of these failures are the malfunction of the actuators and brakes of this robot mechanism or the malfunction of the control system. In this case, the manipulator should be statically balanced so that it will not fall on the head of the patient during these types of failures. In addition, increased gravitational loads can cause deformation of the pivot point, which can affect the dynamics, stiffness, and accuracy performance of the parallel manipulator. 5 Additionally, gravity compensation can improve the positioning accuracy of parallel robots, as it has been concluded in the literature. 6 Passive gravity compensation has been implemented in medical applications, such as in wearable rehabilitation mechanism for lower limbs 7 and upper limbs, 8 in an exoskeleton supporting the body parts, 9 and in a backdrivable robotic arm carrying the ultrasound probe for an ultrasound examination. 1,10 In the area of surgical robotics, in the literature, 11 a novel passive gravity compensation mechanism based on springs and wires with a scotch-yoke mechanism is introduced for a laparoscopic robotic arm. Another application for a large-mass medical device carrying mechanism was developed by Baradat et al. 6 by designing a balancing mechanism consisting of multiloop pantograph linkages for actuator torque minimization of a spatial parallel manipulator.
Numerous design concepts for passive gravity compensation in mechanism design have been proposed and implemented. A review of the available techniques is presented in the work of Arakelian 12 by presenting the advantages and drawbacks of the methods with examples. Passive gravity compensation via counter-mass or spring can be considered as a fundamental way in the passive gravity compensation of robot manipulators. A comparison between these two techniques is presented by Mahalingam and Sharan. 13 In fact, these two techniques can be used simultaneously. 4 A design tool was proposed by Martini et al. 14 to determine a feasible gravity compensation solution by selecting appropriate mixtures of counter-masses and springs. Martini et al. 14 evaluated the performance of unbalanced/balanced mechanism in terms of energy efficiency, peak motor loads, and joint reactions to assess the most convenient balancing solution.
Among the gravity compensation methods, an obvious and relatively easier option is integrating countermasses, which is a superior method for its independency of the direction of gravity vector when the base of the robot has rotational motion. Nevertheless, this solution results in increased mass/inertia of the moving bodies. Additionally, in contrast to using a spring-balanced system, using counter-masses increases the required power of the actuators and results in a lower bandwidth of the system. 15 Two main arrangement methods are usually used when using springs 5 : (1) direct connection of spring to the link and (2) via utilizing an auxiliary linkage with the spring. Usually, gravity compensation with spring components is used in parallel robotic manipulators with a fixed base platform. 16 In the literature, 5 three tension springs were used for 3-RPS parallel robot manipulator to compensate for gravitational loads. The geometric parameters of these  springs were optimized by minimizing gravitational potential energy fluctuation within a prescribed workspace. However, using tension springs on links needs a fixture point connected to the base platform of the parallel robot manipulator, which needs auxiliary fixture structures that increases the total weight of the whole system. Although there are solutions including pulleys and cables, 17,18 additional components in a design increase the risk of failures. Hence, the proposed spring-based gravity balancing system is designed to integrate torsional springs in front of the actuation systems. In an earlier work, a similar solution is proposed via adding torsional springs. 1 In the literature, 1 torsional springs are placed at active and selected passive revolute joints of the manipulator to meet two objectives: (1) to keep the vertical load always upward so that in case of a failure, the medical tool out of contact with the patient for safety reasons and (2) to minimize peak loads at actuators. They achieved these objectives using a classical sequential linear programming technique.
In recent years, several optimization methods that are conceptually different from the traditional ones have been developed. These methods are labeled as modern or nontraditional methods of optimization and some of such methods can be listed as genetic algorithms, 19 particle swarm optimization (PSO) method, 20 and ant colony optimization. 21 Optimization methods based on swarm intelligence (SI) are called behaviorally inspired algorithms, 22 and in a comparative study of SI-based methods, PSO was named the second-best method. 23 The disadvantages of traditional PSO are premature and local optimum convergence. However, PSO variants are discovered to increase its performance and they increase the algorithm's ability to solve a wide range of optimization problems. 24 Therefore, PSO method is adopted in this study for the design optimization of the passive gravity compensation system.

Problem definition for the gravity compensation design of NeuRoboScope surgical robot
One practical limitation of this RCM mechanism is its total mass. This RCM mechanism is carried by a backdrivable passive arm, which is also statically balanced, as shown in Figure 3. This passive arm is backdriven by the surgeon to place the endoscope in and out of the surgery zone. An increase in the total mass of the RCM mechanism results in degrading the backdrivability of the passive arm since the total moving mass/inertia has been increased.
Recently, a study was conducted using only countermass based and a combination of counter-mass and spring in a previous study for our surgical system. 4 The increase in the total moving mass was investigated when only counter-masses are used. To reduce the total moving mass, the use of springs was proposed for the links that are connected to the base platform. Nevertheless, total gravity balancing could not be achieved because of the pitch motion of the first links.
With fixed-base platform parallel manipulators, there is no problem in fixing the one end of the springs to the inertial frame. However, in our application, the parallel robot manipulator is mounted on a passive arm, which has the feasibility to change the orientation of the base platform. Hence, there is no inertial frame on the parallel robot structure to be used for fixing one end of the spring, as demanded by design constraints, neither adding an auxiliary linkage for this purpose.
To address the aforementioned problems, in this article, partial gravity balancing for the RCM mechanism is proposed without using counter-masses. Another concern is the compactness of the design, which is required for having a minimal amount of components that can interfere with the surgeons and their viewpoints during the surgery. The optimization of the compact solution with torsional springs is carried out via PSO. Therefore, the novelty of this article is the design optimization of the partial passive gravity compensation mechanism for a surgical system using the PSO method. Following a brief description of the kinematics of the RCM mechanism, the design principle of the partial gravity balancing system is presented in the next section. Finally, the optimized designs and their outcomes are presented and discussed in terms of their applicability in the NeuRoboScope surgical system.

Brief description of the surgical robot's kinematics
This special-purpose parallel mechanism, first presented by Yaşır and Kiper, 25 has three degrees of freedom to generate a three-dimensional workspace with RCM capability. All of the dimensions have been designed to cope with this surgical workspace, as can be seen in the literature. 26 The mechanism consists of three legs, as shown in Figure 4.  Each i'th leg has the links of length a i , b i , and c i connected by revolute joints. Each leg is connected to the ground by a universal joint. The last link of the third leg (the leg in the middle) is connected rigidly to the moving platform, whereas first and second legs are connected by revolute joints with identical axes concurrent with the telescope axis and therefore passing through the RCM. These three actuators provide input motion for the angles q 1 , q 2 , and q 3 , as shown in Figure 4, to produce 2R1T (2R for two rotational motion and while 1T for one translational along with the endoscope d). The rotation axes of q 1 and q 2 angular motions intersect at point D, which identifies the location of the RCM. On the other hand, the third angle q 3 regulates the insertion amount of the endoscope. It should be noted here that a failure of the actuator regulating the q 3 angular motion can lead to a motion of the endoscope falling downward to undesired an insertion value toward the patient.
The relationship between the motion in the joint space and the motion in the workspace is conveniently defined by the expression of the unit vectorw. This unit vector represents the direction of the endoscope and it can be resolved in the workspace reference coordinate frame (global frame) indicated with the superscript (g) and also can be resolved in the manipulator's reference coordinate frame indicated with the superscript (m) w g ð Þ ¼R y; R x; whereR GM represents the transformation matrix from the global frame to the manipulator's frame w m ð Þ ¼ The components of the unit vectorw that are resolved in the manipulator's reference frame can be related to q 1 and q 2 by the following equations Then, by the use of equations (2) to (5), each of q 1 and q 2 can be calculated as follows The third leg with the axis of the endoscope generates a subsystem of a closed-loop slider-crank mechanism that acts on a virtual plane of RRRP (R for revolute and P for prismatic). The necessary inputs for this analysis are g 3 angle and the link length d, which is considered as the desired value of the sliding/prismatic joint. Note that g 3 is a function of q 1 and q 2 , and it can be calculated as To determine q 3 , the Euclidean norm of B 1 B 2 represents the scalar value which is the link length b 3 and it can be calculated as follows The variable d is the distance from the tip of the endoscope to the RCM. Equation (8) constitutes a relation between q 1 , q 2 , q 3 , and d and can be used to find either q 3 during the inverse kinematics analysis or d during the forward kinematics analysis. To determine b 3 , the position of B 2 is calculated in two ways to determine the loopclosure equation

Design principle of the passive gravity compensation system
This surgical procedure is a safety-critical operation. Therefore, focusing on the safety measures, the reasons for integrating a passive gravity compensation system to the RCM mechanism are summarized as follows: 1. Since the RCM mechanism is designated to be used for a surgical system, in case of total system failure, the mechanism should be able to maintain its position. Thus, the system shall have an inherent safety feature. 2. During the tests of the first prototype, it is measured that most of the actuation load is spent on the gravity balancing of this payload, the endoscope. By integrating passive gravity balancing, since the actuation loads are lower, the use of a high-speed reduction system can be avoided. As a result, the low-speed reduction ratio of capstan drives can be used to cancel the gear backlash effects while maintaining the transmission system's stiffness for highprecision operation. 27 Thus, control quality will be improved. 3. The use of capstan drives with a low-speed reduction ratio (i.e. 1:10) facilitates the backdrivability of the RCM mechanism since the felt inertia during the backdriving motion is increased as the speed reduction ratio is increased. As a result of this, the surgeon can backdrive the system if there is a need or system failure.
Based on the abovementioned discussions, it is clear that passive gravity balancing will be advantageous to be used in the RCM mechanism of the NeuRoboScope surgical system. Among the passive gravity balancing methods, using counter-mass is the prominent option. However, the maximum total mass constraint, which is a total of 10 kg, for this application directs us to the use of a spring-based solution. Nevertheless, even with a spring-based solution, another constraint must be kept in view, which is the compactness of the design to minimize the components that are not enclosed.
During the surgery, a surgeon handles the endoscope and moves it inside the surgery zone (inside a nostril) by fixing the RCM to the previously determined location, which is the tip of the nose. During this operation, the brakes of the RCM mechanism are on and the passive mechanism is freely backdriven. After this procedure, the brakes of the passive arm are activated and the RCM mechanism's brakes are released. From this point on, RCM mechanism is actively driven to the desired direction and location inside the nostril with the help of its actuation systems. While the system is in operation, the surgeon performs the surgery by viewing inside the nostril from the endoscope's visual feedback appearing on a screen behind the RCM mechanism. Therefore, RCM mechanism's size is limited. In the current size of the RCM mechanism, the view of the surgeon is not affected. Therefore, any solution of passive gravity compensation should not enlarge the RCM mechanism's current size.
In the literature, various design studies have been carried out for implementing passive gravity balancing methods. During the implementation of these methods, the main design consideration is the use of simple mechanisms to result in a cost-effective and easy to maintain design while reducing power demand from the system actuators. 28 In the literature, 29 a solution is proposed to have smaller-sized springs by the arrangement of springs with different diameters located inside of each other. A smaller and compact spring element was produced but the total weight was not the focus of this design. For a compact design, our idea is to enclose the spring within the actuation system. Therefore, a spiral spring is chosen. Spiral springs are mounted directly on the rotating shafts with customized packaging for safer design and they are defined within the actuation system. In this design, the adjustment of the preload on the springs can be done easily while the spring is in its case.
Within the design of the RCM's actuation system, the most practical place to locate the spiral spring is to embed it inside the capstan drive's follower wheel. As this spiral spring is enclosed within the capstan drive, in case of a failure in the spring, the spring will remain in its casing. The radius of the spring is bounded within two limits in this design. Due to this constraint in the motion of the spring, it is unlikely that the spring will experience a fracture due to bending stresses. It is also possible to change the initial preload value with ease if a different endoscope with different inertial properties will be used. The actuation system shown in Figure 5 is composed of a DC motor, brake, and capstan drive. Additionally, in this figure, the torsional spring-based passive gravity compensation design is presented.
As an additional constraint, the base of the RCM mechanism is considered to be placed in the horizontal plane during the earlier optimization studies in this article. Since the RCM mechanism's joints are all revolute joints, using a spiral spring for each actuation system, as shown in Figure 6, will not be enough to completely balance the system under gravitational loads. Nevertheless, it is a compact solution that can minimize the unbalanced mass and hence, bring forth the abovementioned advantages. To minimize the unbalanced mass throughout the workspace, optimization of the spiral spring must be carried out. Although the workspace of the previously developed RCM mechanism is relatively larger, the surgery zone range is defined as ¼ À35 ! À12 , ¼ À1 ! 12 , and d ¼ 17 ! 20 cm according to the frame defined on the right sketch in Figure 4. This surgery zone is related to the measurements taken from the right nostril of a cadaver and shown in green in Figure 6. The workspace of the RCM mechanism is shown in Figure 6 that has the shape of an uneven white hourglass that is composed of two cones. The lower cone is the part that is inside the nasal cavity whose tip is the RCM at the pivot point located on the tip of the nose. This optimization procedure along with the design parameters is explained in the next section. Optimization studies by using particle swarm optimization method PSO was formulated by Edward and Kennedy in 1995. 20 The advantages of PSO are that it is easy to implement, it does not require the mathematical gradient to optimize a problem, and there are only a few parameters to be adjusted. In this algorithm, each particle moves about the cost surface with a velocity. Each particle studies its own previous best solution for the optimization problem and its group's previous best. The optimal value will be found by repeating this process. The PSO algorithm updates the velocity vector for each particle and then adds that velocity to the particle position or its value where v is particle velocity; w is inertia weight, which affects directly the behavior of the particles with respect to their motion toward the optimum solutions; p is particle position or variable, which represents the corresponding design parameter (dp); r 1 and r 2 are independent uniform random numbers; p localÀbest i;j is the best local solution; p globalÀbest i;j is the best global solution; i is particle index with the maximum value set to the size of the population (pp); j is the dimension of the variable referred to the number of dp; G 1 is a cognitive parameter, which has the effect of the convergence of design parameters within its local position; and G 2 is a social parameter, which is responsible on the convergence within the global best solution in the swarm. One approach in selecting these parameters is to perform a similar analysis presented by Liu et al. 30 Another approach is to carry out the selection of parameter process via experimentation to obtain an acceptable outcome. 31 The selection of these parameters depends on the desired upcoming information from the particles. The optimization and tuning of these parameters have been a research topic for many articles. 32-34 A survey and comparison of such studies are presented by Sengupta et al. 35 In this work, due to its simplicity and ease of implementation, the PSO technique is used as an optimization tool for the selection of optimum design parameters.
The procedure defined in the flowchart shown in Figure 7 is used for generating the PSO program.
For the next subsections describing the optimization studies, it is worth noting that the spiral spring is mounted to the joint directly so that the relation between the angle and torque can be considered to be linear. This produces a compact design without adding an auxiliary mechanism for passive gravity balancing.
Three types of optimization studies are conducted. In the first one, the effect of adding a spring for passive gravity balancing is investigated. In the second and third studies, the PSO method is used to find optimum stiffness value and preload initial angle for each spring used for each actuation system. The selection of the objective function depends  directly or indirectly on the change in potential energy inside a previously prescribed workspace.

Study for investigating the effect of using the spring on the performance of the remote-center-of-motion mechanism
This initial test is carried out to verify that the parameters can be optimized to achieve improved results and validate the need for optimization. Initially, a specific scenario for the motion of the RCM mechanism is selected so that all actuators will be operating simultaneously. The devised motion trajectory is shown in Figure 8. The designated motion is a single axis rotation in the range of angle (0 ! À40 ), where is kept at 0 and d is kept at 17 cm, which means the endoscope's telescope tip is inserted beyond pivot point by 6.1 cm. The motion is a sinusoidal motion with a period of 60 s.
As a first case study, just for the third joint, various spring stiffness values are selected manually as 0.3, 0.5, 0.7, and 0.9 Nm/rad. The effect of these springs is examined in the simulation tests and shown in Figure 9. The preload angle is selected relative to stiffness and loading conditions so that the actuator torque values fluctuate about zero torque value. Since the actuator torque values fluctuate about 1.7 Nm in the no gravity compensation case, the preload value is calculated with respect to the stiffness value (S3 ¼ 1.7/K3) so that the actuator torque values fluctuate about 0 Nm for all stiffness values.
It is observed that changing stiffness value and initial preload angle have a direct effect on the required torque by the actuator. In that respect, minimized maximum torque or minimized energy consumption by the actuator can be obtained by selecting optimum values of the stiffness and preload angle of the spring. The preload angle is used to shift the actuator torque's value to the desired value while changing stiffness value that affects the shape of the required torque function with respect to the followed motion trajectory, as can be noticed in Figure 9. Within the workspace of the RCM mechanism, the required torque for the three actuators is in one direction and no zero-torque crossover happens for the unbalanced case. This allows us to attach the balancing springs with a preloaded initial angle. For obtaining the optimum results beyond this specific test condition, the selection of the stiffness and initial preloaded angle is to be studied within the entire workspace. To achieve this goal, in the next studies presented in this article, PSO is used.

Optimization study by minimizing the summation of actuator torques
In this optimization test, PSO is used to select all three springs' stiffness and their initial preloaded angle for optimum design. The objective function for the optimization process is defined as the sum for the squares of the three actuators' torques calculated at the preselected points of the workspace. This sum is calculated as a quadratic function of the actuator torques τ tŵ τ , where the weighing matrixŵ is selected as an identity matrix for equal distribution of the load. These points inside the workspace are selected at extreme loci and in the midpoint of the extreme loci. As a start, 3 Â 3 Â 3 loci for the three independent variables are selected, which result in 27 loci inside the workspace range.
In this work, some parameters are selected experimentally, while some general parameters, such as G 1 and G 2 , are calibrated by extended comparative investigations. The parameters in all tests are selected to have acceptable optimization performance of the swarm with respect to the number and convergence of the particles to the results inside the appropriate size of the swarm. The bounds are selected with regard to the potential solution of the design parameters. Nevertheless, the solution converges to the best optimization objective value (OpObVa) 9.6775 N 2 m 2 after approximately 220 iterations. However, this value does not necessarily indicate the maximum possible torque for actuators calculated among these loci. Among these loci, one of the loci could have the highest actuator torque value with regard to the other loci. To solve this problem, in the next optimization tests, another optimization objective function is defined.

Optimization study by using the minimum upper limit of actuators' torques
In this study, the optimization objective function has been modified to obtain minimum upper torque value at all loci and for all actuators. As a result of this modification of the objective function, the maximum torque generated by any of the three actuators will be minimized with the gravity compensation optimization. Nonetheless, it does not guarantee a specific target value for the upper limit torque constraint. Another condition was added to result in a physically possible result for the stiffness values of the springs, which considers a solution with only positive values of the springs' stiffness. Other than these, all the conditions and constraints are the same as the ones given in "Optimization study by minimizing the summation of actuator torques" section. In this optimization test, two different scenarios are introduced to relate the selected solution with design constraints: I. In the first scenario, three different stiffness values for the springs (k 1 ; k 2 , and k 3 ), are considered with three different initial preload values q 01 ; q 02 , and q 03 . The optimization objective function is to be defined as the maximum torque for any of the actuators at all loci. The role of the PSO solution here is to minimize this objective function. As a result, the optimum solution of dominant design parameters will be the one with the solution of the lower upper torque of all actuators inside the workspace. The optimum design parameters are found (in the best OpObVa) at 0.555 Nm as the minimized upper torque calculated for the first actuator, which is obtained after 100 iterations.
In this case, sum of squares of actuator torques came out to be 15.529 N 2 m 2 , which is higher than the former result due to this additional new constraint. This scenario presented dissimilar results between the first and second actuators compilation in spite of the symmetry of the presented RCM mechanism. That difference is derived from the selection of the workspace, which is related to the right nostril. However, with these parameters, there is no symmetry of gravity compensation components and this means that adjustments have to be done when the endoscope is inserted through a different nostril.
II. In the second scenario, the RCM mechanism is considered to be used in the right or left side of the nostril. Two different springs are considered as k 1 ¼ k 2 and k 3 with two different initial preload angular values q 01 ¼ À q 02 and q 03 . In this case, the symmetricity of the springs and the initial angular values of the first and second actuators enables to obtaining a result conveniently for the  insertion through the right or left nostril. After approximately 70 iterations, the best OpObVa is obtained at 0.6817 Nm.

Evaluation and improvement of the optimized design
Initially, to test the optimization results, inside the previously defined workspace, outer boundaries and midpoints of the range of motion in each direction are selected as the 27 loci. Later, the design parameters are tested in simulations for randomly generated 100,000 loci within different ranges inside the workspace. It is observed that the minimum upper torque limit for the selected parameters in the first scenario is calculated to be 0.555 Nm at the locus (À35 , 12 , and 0.2 m). The other maximum torques calculated among the 100,000 loci are 0.552, 0.526, and 0.515 Nm for the first, second, and third actuators, respectively. These results indicate that the selected design parameters in the optimization process can be tested using only the selected 27 loci. Optimum design parameters obtained in the first scenario of the previous section are tested again for the condition when the base platform of the parallel manipulator (the pitch angle) is rotated by 20 . This is the maximum pitch rotation at the wrist of the passive arm that was foreseen to happen during the surgery. In this case, it is observed that the maximum torque increased from 0.555 Nm to 1.898 Nm at one of the extreme loci, as can be observed in test number 3, results in Table 1. The change in the values is due to the change of the orientation of the gravity vector with respect to the RCM mechanism. The results of these tests show that the previously optimized results are not suitable when the pitch angle is increased.
Consequently, a new optimization study is conducted, taking into account this problem.
To obtain improved results, the maximum pitch angle of 20 is considered during this new optimization procedure. In addition, an extended surgical workspace is chosen as ¼ À45 ! À12 , ¼ À1 ! 12 , and d ¼ 17 ! 24 cm. The reason for using this extended surgical workspace is explained by presenting the workspace of the tip of the endoscope after the pivot point in Figure 10. The blue dashed line in Figure10 represents ¼ RCM ¼ 0 for the pitch angle 0 condition and the black dashed line represents RCM ¼ 0 for the pitch angle 20 condition. The RCM angle range of the mechanism varies for different insertion ranges. The RCM angle range increases to +35 for the insertion range of 3 cm defined for the value of d ¼ 17 ! 20 cm and this range is displayed in Figure 10 for the pitch angle 0 condition in orange color. The RCM angle range decreases to +25 for the insertion range of 7 cm defined for the value of d ¼ 17 ! 24 cm and this range is displayed in Figure 10 for the pitch angle 20 condition in light blue color. The actual surgical zone in which the endoscope should be operated is defined with the green color in Figure 10. According to these explanations, for the insertion range of 7 cm, at the pitch angle 20 condition, the operating range in surgical workspace is updated to be ¼ À45 ! À12 . The endoscope, its telescope, and the added mass of the cables are totally up to a mass of 400 g. This mass is also added to the mass of the moving platform for a more realistic scenario. The optimized parameters are presented in Table 2.
The optimization was performed inside the maximum workspace and tested during the optimization process on 27 loci to result in the best OpObVa of 0.895 Nm as maximum Table 1. Test results of the optimized design parameters in the first scenario for different pitch angles.
Test no.
Specification of the workspace, number of points (n), the orientation of the manipulator torque value for any actuator. For testing the optimized parameters, a cube of 10 6 equally distributed points inside the selected workspace is generated. The obtained torques inside this discretized workspace for the first, second, and third actuators are shown in Figures 11 to 13, respectively. The results indicate that the maximum torque considering      all actuators is 0.915 Nm when the gravity compensation is activated and 4.348 Nm when deactivated. The decrease in the amount of torques for the three actuators is approximately 77%, 80%, and 66%, respectively.

Discussion
The optimization methodology presented in this article can be implemented for various needs of regulating the gravitational loads at the actuators of this surgical system. If the surgeons require the robot, and obviously, the endoscope to move away from the patient, then the preload values of the actuators can be adjusted to satisfy this need. As an example, the preload value of the actuator connected to the third leg is adjusted to its maximum torque value received during the first scenario. Figure 14 shows the consequence of such an adjustment of the preload value. As it can be observed, the actuator torque values are all negative values throughout the workspace. These negative values indicate that the third leg will move upward, and thus, move the endoscope away from the patient when there is no actuator input due to a malfunction in the system.
Another optimization scenario could be implemented if the generated actuator torque values are required to be distributed evenly between the positive and negative values throughout the workspace. This can also be achieved by adjusting the preload value of the related torsional spring.
So far, in this article, the optimization procedures are carried out on specific pitch angles of the passive arm's wrist. To test the design parameters along the full range of pitch angles of the wrist, initially, the no gravity compensation situation is examined. The tests are conducted within the pitch angle range from 0 to 20 with the increment of 1 . The maximum torque values obtained at each pitch angle are shown in Figure 15.
It is observed from Figure 15 that the required amount of torques for gravity compensation obtained for the actuators on the sides (T 1 , T 2 ) increases as the pitch angle increases while the required amount of the torques obtained for the middle leg's actuator (T 3 ) is almost the same for each pitch angle. The results indicate that the most amount of actuator torque requirements are obtained at the pitch angle 20 . Consequently, the previously optimized design parameters (shown in Table 2) for the pitch angle 20 are used in the next tests using the same range of the pitch angle variation. The results of this test are shown in Figure 16, displaying the maximum amount of actuator torque required at each pitch angle.
As can be noticed, the least amount of maximum torques is obtained at the pitch angle 20 , which is the pitch angle   selected for this optimization procedure. Also, the required amounts of actuator torques are minimized if the findings in Figure 15 are compared to the results shown in Figure 16. This scenario can still be acceptable when considering that the surgery generally takes place at the pitch angle of 20 and the maximum torque values obtained at different pitch angles are also decreased.
For a case in which various pitch angles of the passive arm's wrist are used during the surgery, finding the optimum design parameters by considering the results obtained at all pitch angles is studied. The optimization is carried out by considering all pitch angles with the increment of 1 together, which results in 27 Â 21 loci used during the optimization process and 21 Â 10 6 loci used during the testing process. The optimized design parameters as presented in Table 3 and the maximum torque values obtained at different pitch angles are displayed in Figure 17. According to the discussions based on Figure 10, it should be noted that the maximum angle is varied for different pitch angles from 45 at the pitch angle of 20-25 at the pitch angle of 0 with the increments of 1 .
When the results obtained in Figure 17 are compared to the results obtained in Figure 16, as a result of the optimization using the full range of the pitch angle, the maximum torque value obtained at any pitch angle is decreased by almost 0.3 Nm. However, when the full range of the pitch angle is used in the optimization process, the maximum torque values obtained at 20 comes out to be higher than the values obtained when the optimization is carried out by only considering 27 loci at the pitch angle of 20 .

Conclusions
A design study is presented in this article to partially compensate the gravitational loads of a surgical robot system with RCM mechanism. This design was required for safety requirements. In the design optimization, the total added mass and compactness of the design is considered. PSO method is adopted for optimization purposes. The study proved that PSO can be adopted for such an optimization process and it is possible to minimize the gravitational loads with a compact design.   (Table 3) for gravity compensation obtained at different pitch angles of the wrist.
In this work, the possibility of using the same spring properties due to the symmetry of the RCM mechanism is investigated. This possibility is investigated to avoid the need for changing springs on the sides and their preload values when the surgeon wishes to insert the endoscope from the right or left nostril. Consequently, in the second scenario, for the first and second springs, same spring constants and preload values are used. The results indicated that slightly higher actuator torques will be needed for this option.
The optimization procedure is repeated considering the full range of the pitch angle of the passive arm's wrist. The results indicate that the maximum amount of actuator torque values reserved for gravity compensation is decreased considering this full range. If the mechanism is to be used for all ranges of the pitch angle, this solution can be used. However, if it is foreseen that the pitch angle is fixed at 20 , then the optimized parameters that are obtained considering the loci at 20 can be used since this solution produces relatively decreased maximum torques at 20 .
The main limitation of this design is that the gravitational loads cannot be fully compensated. A hybrid use of counter-masses with torsional springs can be investigated as a future study. However, because of the total mass limitations, it will still not be possible to fully balance the system under gravitational loads. Therefore, another optimization study can be carried out for such a hybrid solution.