## 4 Simulations and Results
### Obstacle Avoidance Using APF  
After detecting the obstacle using the SPO and estimating the end-effector contact force, the next and final step is to avoid the obstacle. At the time of collision, the proposed technique saves the robot end-effector position. The method used for collision in the current study is APF. It generates a repulsive potential when it comes near (threshold value) to the obstacle. The two different scenarios are presented, but for good understanding, let us define the desired end-effector trajectory first. The following Figures 13 and 14 show the desired end-effector trajectory for the five DOF robot manipulator in x and y directions. In the RVI, the robot only moves in the x and y direction. Currently, we only consider the  
Figure 11: Estimated external torque when collision takes place. Figure 12: Estimated force vs. force provided by toolbox. Figure 16 shows the outcome based on the robot end-effector position. When the robot approaches the obstacle (threshold = 0.04 m), the repulsive force starts acting on the robot end-effector and keeps it away from the obstacle. The reason is that it has turned a corner sharply in avoidance because the threshold radius is very small, which leads to high repulsive force. To counter it, the repulsive force is restricted to a constant value. Table 1 shows the simulation parameters used to demonstrate the results. Similarly, another scenario is of a solid obstacle of arbitrary shape in the RVI. The obstacle has a sharp-turn corner. The proposed technique first detects the obstacle during scanning and saves its location. The robot avoids it the next time it passes from the same location. The whole process can be seen in Figure 17. The end-effector trajectory can be seen in Figure 18.  
Third, the RVI wall is considered a continuous obstacle. The information regarding the obstacle is unknown. Therefore, according to proposed technique, the robot first detects and scans the obstacle position and records it, using the proposed estimated external disturbance torque. When the robot passes the same position, a repulsive force acts to change the trajectory and avoid collision. In Figure 19, the first figure shows the result when only the collision detection algorithm is implemented so it detects and scans the obstacle at time 25.86 s to 31.3 s and again detects the obstacle when it comes to the same position at time 59.5 s to 64.9 s. The second figure shows the outcome when collision detection and avoidance algorithms are implemented at the same time. First the collision detection algorithm detects and scans the obstacle (25.86 s to 31.3 s) from the estimated external disturbance torque and then, using the artificial potential field, obstacle collision is avoided. This is why the estimated external torque is zero from time 59.5 s to 64.9 s, which is a good sign for our system. Figure 20 shows the results of avoiding the obstacle using the artificial potential field on the nuclear power plant virtual simulator. Figure 21 shows the robot end effector trajectory in circular shape inside RVI. When the robot is near to this continuous obstacle, or when robot is 0.04 m away from the obstacle, repulsive force is generated to keep the robot away from that obstacle. The avoidance trajectory can be seen in Figure 18, which is  
Figure 19: Continuous obstacle detection and avoidance scenario. Figure 18: Sharp-turn corner obstacle avoidance trajectory (end-effector). not very smooth due to nonoptimized parameter selection (\(R\) and \(\alpha\)) of the potential field parameter. Figure 21 shows the different trajectories offered by the artificial potential field to avoid a detected obstacle. Figure 22 shows the desired robot end-effector trajectory with respect to the time axis, before and after collision avoidance. Figure 21: Continuous obstacle avoidance trajectory (end-effector). Figure 20: Continuous obstacle avoidance in simulator (end-effector); (**a–c**) collision detection (scanning); (**d–f**) collision avoidance after scanning and saving obstacle position (on return).