3.3.1. Free Motion (FM)

For this test as shown in Figure 7a–c, the robot follows the defined helix path, without external forces applied to the end effector as presented in Figure 7a. This demonstrates the case of fully-assisted interaction because the robot moves from the starting point *s* = 0 to the final point *s* = 1, see Figure 7b. This case serves as the reference to evaluate the error in the results of Section 3.4. The desired velocities *r*˙*<sup>d</sup>* in Figure 7c, which are used in (16) to obtain the desired joint velocities, are calculated from passing the constant virtual force *fv* projected to the tangent direction of motion of the path through the admittance law as described in Section 2.

#### 3.3.2. Force-Applied Motion (FAM)

Figure 7d–f illustrates this test, which consists of applying an external force, see Figure 7d, to the robot end-effector to move it along the predefined helix path. This force is projected to the tangential direction of the path, which gives the magnitude of the desired velocity in task space to start or stop robot motion, see Figure 7f. No virtual force is generated for this case because the magnitude of *fv* = 0 N. In this test, the robot moves from the initial point *s* = 0 to the final point *s* = 1 in a nonlinear way opposed to the FM case because the desired velocity depends on the external force applied to the end effector, as can be seen in Figure 7e,f.

#### 3.3.3. Combined Test Using Virtual Forces (CVF)

In this test, we merge the two previous cases to demonstrate the capabilities of the proposed algorithm for multiple applications and the smooth transition between collaborative and non-collaborative interaction. The robot will track the helix path with constant velocity obtained from *fv* if no external forces are applied, moving from the initial point *s* = 0 to the final point *s* = 1. This can be seen from *t* = 0 s to *t* = 30 s in Figure 7g–i. At any point of this free motion towards the goal, the user can apply an external force that will cause the robot to retract or advance while tracking the path, as seen in Figure 7g,h from *t* = 34 s to *t* = 46 s. If the user stops applying the external force, the robot will continue to move to the goal in FM case as shown in the same figures from *t* = 46 s to *t* = 49 s. The desired velocity in each step of the test in the TNB frame is calculated accordingly, see Figure 7i.

**Figure 7.** Helix path-tracking test detailed data for free motion (FM), force-applied motion (FAM), and combined motion with virtual forces (CVF) in the TNB frame. (**a**) External Forces-FM. (**b**) Parameter s-FM. (**c**) Desired Velocities-FM. (**d**) External Forces-FAM. (**e**) Parameter s-FAM. (**f**) Desired Velocities-FAM. (**g**) External Forces–CVF. (**h**) Parameter s–CVF. (**i**) Desired Velocities-CVF.

#### *3.4. RMSE Evaluation and Comparison*

Following our objective of accurate path tracking in human–robot collaboration tasks, we evaluate the error between the reference path and the actual recorded path. It is important for the robot to continue tracking the path accurately, despite forces being applied or not during the human–robot interaction. In this context, the addition of directional compliant motion should have as small influence as possible on path tracking accuracy. Thus, we must ensure the error difference is small among the proposed cases that represent the interaction assistance range.

Figure 8 shows the reprojection of the RMSE residuals to the 3D helix path calculated between the reference helix path *rp*(*s*) in black dashed line and the recorded test data *r*(*s*) in red solid line, also green dotted lines connect the points from *r*(*s*) to *rp*(*s*) to display the error every 10 samples. Figure 9 presents for each of the three evaluated cases, the RMSE values in green dashed line and the tracking error between the actual and reference samples in solid blue line. For every joint position data collected in the test, we find the shortest distance *dp*,*i*⊥*rp* between the *i*th point and the reference curve *rp*(*s*), which was sampled from (20)–(22) to have the same number of points as the test data, see (23). Then, we find the RMSE as in (24), where *pj*,*<sup>i</sup>* is the *i*th test point of the *j*th component, *j* = *x*, *y*, *z*, and *N* is the total number of points in the test.

$$d\_{p,j\perp r\_p} = \min\_s \left( \sqrt{(r\_{p,x}(s) - p\_{x,i})^2 + (r\_{p,y}(s) - p\_{y,i})^2 + (r\_{p,z}(s) - p\_{z,i})^2} \right), s \in [0, 1] \tag{23}$$

$$RMSE = \sqrt{\frac{\sum\_{i=1}^{i=N} \left(d\_{p,i\perp r\_p}\right)^2}{N}} \tag{24}$$

In Table 3, we can see that the RMSE values obtained between the FM and FAM motion have a very small difference of 0.021 mm. This shows path tracking has a good performance even when external forces are applied to guide the motion. In the other case for the combined test with virtual forces, the error difference with the free motion test is slightly higher, 0.038 mm; however, it is still less than 0.1 mm, which is the pose accuracy value reported for commercial robots used in collaborative applications [36–38].

**Figure 8.** Helix path tracking. *rp*(*s*)-black dashed line, *r*(*s*)-red solid line, distance from each point of *r*(*s*) to *rp*(*s*)-green dotted line. (**a**) FM. (**b**) FAM. (**c**) CVF.

**Figure 9.** RMSE and distance error plot for each test. (**a**) FM. (**b**) FAM. (**c**) CVF.


**Table 3.** RMSE error differences among cases: FM vs. FAM, and FM vs. CVF.

#### **4. Conclusions**

We successfully achieved compliant path tracking motion using an industrial 6-DOF robot manipulator by employing the proposed dual-loop control structure including an inner motion control loop and an outer admittance control loop. The safety of the application is guaranteed by adhering to the constraints presented in our previous work [23], which include singularity avoidance, joint limits, and workspace limits. Additionally, the modified SMC designed and implemented as the inner motion controller showed a satisfactory tracking performance. A linear motion test successfully demonstrated the system ability to modify the robot compliance with respect to the external force direction applied to the end effector. The results from this linear test show the capability of our proposed method to customize the compliance behavior of the robot for a path tracking task. Furthermore, a 3D helix path was used to test the path-tracking performance and display the generality to many applications such as rehabilitation, assisted drawing, assisted hand–motor skills development, and so on. For this test, three cases were compared depending on the level of the interaction; FM, FAM, and CVF motion. The error difference between cases is less than 0.1 mm, which is suitable for path tracking applications where the user can dynamically interact with the robot. Our future research directions include testing the framework in more specific applications such as rehabilitation or assisted hand–motor skills development as well as in different types of robot manipulators, given that our framework implementation can be easily ported to other manipulators with the addition of an F/T sensor. Moreover, a user study will be carried out to further explore the perceived performance in each specific application.

**Author Contributions:** Conceptualization, D.R.-U. and T.H.; Data curation, D.R.-U.; Formal analysis, D.R.-U.; Funding acquisition, T.H.; Investigation, D.R.-U.; Methodology, D.R.-U. and T.H.; Project administration, T.H.; Resources, T.H.; Software, D.R.-U.; Supervision, T.H.; Validation, D.R.-U. and T.H.; Visualization, D.R.-U.; Writing–original draft, D.R.-U. and T.H.; Writing–review & editing, D.R.-U. and T.H. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Ministry of Science and Technology, Taiwan, grant number MOST 109-2221-E-009-092-.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

### **References**

