Compliant Human–Robot Collaboration with Accurate Path-Tracking Ability for a Robot Manipulator

: In this article, we aim to achieve manual guidance of a robot manipulator to perform tasks that require strict path following and would beneﬁt from collaboration with a human to guide the motion. The robot can be used as a tool to increase the accuracy of a human operator while remaining compliant with the human instructions. We propose a dual-loop control structure where the outer admittance control loop allows the robot to be compliant along a path considering the projection of the external force to the tangential-normal-binormal (TNB) frame associated with the path. The inner motion control loop is designed based on a modiﬁed sliding mode control (SMC) law. We evaluate the system behavior to forces applied from different directions to the end-effector of a 6-DOF industrial robot in a linear motion test. Next, a second test using a 3D path as a tracking task is conducted, where we specify three interaction types: free motion (FM), force-applied motion (FAM), and combined motion with virtual forces (CVF). Results show that the difference of root mean square error (RMSE) among the cases is less than 0.1 mm, which proves the feasibility of applying this method for various path-tracking applications in compliant human–robot collaboration.


Introduction
Guidance constraints are a type of active constraints/virtual fixtures, which have been studied in the field of physical human-robot interaction (pHRI) by many researchers [1][2][3][4][5][6][7]. From the work of Rosenberg [1], the concept of perceptual overlay to increase task performance has been explored in different types of human-machine manipulation systems, such as telemanipulators and cooperative manipulators [3]. These virtual fixtures are often used to guide the movement of the robot towards desired targets while avoiding obstacles and preventing the robot from entering predefined forbidden regions. Although reference paths for the robot are generated in some applications, the accuracy of path following is not the focus of these techniques. Instead, compliant behavior of the robot that allows deviation of the path is the main concern of most pHRI studies. However, accurate path tracking and compliant behavior are not necessarily antinomies. They can be delicately tailored to meet the requirements for dedicated purposes and achieve better performance. For example, rehabilitation patients can benefit greatly from practicing with equipment that is capable of following a path while still being compliant along the path, because it allows the patient to closely track an optimal path predefined by medical experts, and progress in different levels of assistance, which has been shown to improve rehabilitation progress [8][9][10]. Another important application is in industrial assembly tasks. Many efforts have been reported in this area towards efficient human-robot collaboration [11][12][13][14][15]. The authors of [13] presented a force-overshoot-free controller for high-accuracy assembly tasks using an industrial robot. Furthermore, in [14] a collaborative task for a homokinetic joint assembly is performed using admittance control. In [15], a method for robotic fixtureless approach of large flexible panels assembly using compliance force control is presented and evaluated with an industrial robot. The aim of these approaches is to relieve the operator from having to manipulate heavy components during the assembly and instead being able to focus only with the dexterous part of the assembly. Moreover, an important factor is that in high-precision assembly tasks static fixtures are necessary to keep in place the parts being joined and task performance depends on these fixtures. These tasks could benefit from a compliant path-tracking system. Furthermore, other direct application of path tracking in human-robot collaboration is for educational and physical training purposes where the robot system can be used as a tool to teach complex tasks that are best learned by hand-in-hand demonstration. Examples include practicing calligraphy, assisted hand-motor skills development, and so on [16,17]. In this sense, the robot system acts as the coach and the user is guided to follow an optimal path that perfectly accomplishes the task while obtaining different levels of assistance to trace the path, from completely passive to completely active. Based on these analyses, we found that in many manual guidance applications, it is beneficial for the robot to follow a path while being compliant along the path. Consequently, the goal of this paper is to investigate the related techniques.
Path-tracking is an important feature of most robotic systems. From manipulators to mobile platforms, the ability to follow a path with high accuracy has been investigated by many researchers [2,18,19]. Moreover, path-tracking in compliant human-robot collaboration has been the topic of recent studies. In [4], virtual fixtures were created and modified through an iterative method based on kinesthetic teaching and Akima splines. The approach was evaluated in a simulated sanding task using a 3-DOF collaborative robot and a user study which showed that virtual guide assistance improves the performance of co-manipulation tasks. Later, Raiola et al. in [20] defined virtual guides as virtual mechanisms using Gaussian mixtures model (GMM) from multiple user demonstrations, which can be refined through incremental training. They proposed to establish a library of multiple virtual guides which can be created, modified and used by the human operator. The performance was experimentally evaluated with a compliant 3-DOF robot and a user study. The algorithms in [4,20] concentrated on virtual guides construction and how to iteratively modify the nominal path, but there was no treatment of the accuracy of path-tracking. Wu et al. in [21] optimally reshaped the desired robot trajectory using an adaptive neural network controller to effectively complete co-manipulation tasks with a robotic exoskeleton. The experimental validation was demonstrated in a 2-DOF motion case but did not describe extensibility of the method to higher DOFs or to different types of manipulators. In other words, the research effort was to conceive an algorithm that allows the human to modify the desired trajectory using shared control; thus, the contributions focus on the path generation aspect of human-robot collaboration. However, the challenge of accuracy in human-robot interaction by regulating robot motion in the predetermined task direction remains.
Previous works on the accuracy aspect for compliant tasks by the use of virtual fixtures include [5][6][7], where virtual fixtures were used together with admittance control to allow for compliant path tracking tasks. A vision-based virtual fixture algorithm for cooperative manipulation was designed and implemented in [5], where the authors described how to create hard and soft virtual fixtures for two types of reference targets-point positioning and curve following-as well as the extensions to virtual geometries such as tubes or cones to confine motion to a volume for a cooperative system which uses admittance control. The experimental setup was validated using the "Steady Hand Robot" [22] in macroscale and microscale planar tasks. The results showed that the addition of vision-based virtual fixtures assistance increased performance regarding position error and execution time, and that there is a trade-off between performance and user control. However, the experimental validation consisted in using different fixed levels of admittance, but as covered in [23] adaptive admittance control has been proven more effective. Moreover, there is no distinction between the virtual fixture definition and the admittance control parameter tuning. This complicates the definition of the virtual fixtures and directly influences the achievable tracking performance, as shown in their study. In [6], virtual fixtures were used to control the robot for robotic-assisted surgery. The task was defined and projected into a space of orthogonal directions that consisted of preferred directions and non-preferred ones. The authors of [6] explored and compared two types of error compensation-manual and autonomous-to reduce the path-tracking task error. The results showed that manual compensation was not sufficient for correction of all deviations, particularly when a translational virtual fixture was defined and the deviation error for orientation occurred, and vice versa. This was solved with their proposed autonomous compensation method where the user had control of the system along the preferred directions through the forces applied, while the robotic system independently compensated deviations. In [7], a framework for compliant path tracking tasks was proposed. The system used a virtual robot approach to obtain the desired velocities that were treated as the command to the internal position controller. Motion constraints and task space constraints can be defined in this framework. The proposed approach was experimentally evaluated using a 7-DOF KUKA LWR cobot. The results showed that it is easy to define different constraints in the framework by adjusting the properties and parameters in their algorithm. However, all parameters were tuned heuristically and specifically for the evaluated task. The authors of [24] presented a hybrid position-force control oriented to surface treatment tasks, e.g., sanding, deburring, polishing, etc. They used sliding mode concepts for the robot force control to maintain the orientation of the tool always perpendicular to the surface and to obtain the desired tool pressure on the surface. The lower-priority tracking controller was designed to follow the desired trajectory where deviations to satisfy safety constraints are allowed. Finally, redundancy resolution was also included to keep the manipulator near its home configuration for safety purposes. The method showed increased robustness and low computational cost, and experimental validation of the approach using a 7R manipulator proved its applicability and effectiveness.
The common drawbacks of the cited works are that, in many cases, the accuracy aspect of path tracking when compliance is combined for co-manipulation tasks was not explored. Besides, the experimental setup often relies on robots designed to be inherently suitable for manipulation tasks. Furthermore, kinematic constraints such as singularities, joint limits, task space limits, etc., if considered, are part of the virtual fixture definition and therefore task dependent. As a result, the task must be carefully planned to avoid these kinematic constraints, which imposes restrictions on the task definition. Given these recent references in the field and considering their contributions and stated drawbacks, we believe the topic of path tracking is highly relevant to human-robot collaboration applications, and the study of the associated design strategies is of great importance and value.
In this paper, we aim to achieve compliance of a robot manipulator along a predefined path, giving the robot the ability to move forward or backward depending on the direction of an external force applied to the end effector while tracking the path. Figure 1 illustrates this objective, where a desired path is shown and in the case of an external force is applied, the robot is compliant only along the path tangential direction, and not compliant along the normal direction. To accomplish this goal, we propose a dual-loop control structure, including an inner motion control loop and an outer admittance control loop. A modified sliding mode controller (SMC) is designed for the inner motion control, which guarantees desirable state tracking performance and robustness while significantly suppresses chattering. In the outer admittance loop, we define the compliance control problem in the tangential-normal-binormal (TNB) frame associated with the path to find the projection of the external force in the tangential direction and develop an atemporal path generation strategy by parameterizing the path with respect to the arc length to move along the path as desired by the user. Furthermore, an adaptive admittance law that has been experimentally verified in [23] is exploited to allow a timely, intuitive, and simple communication between the human and robot. In addition, the proposed adaptive admittance law considers the most common kinematics constraints that can appear in manual guidance interaction and adapts the admittance parameters appropriately based on the objectives of safety, accuracy, and comfort. In this approach, kinematic constraints are not task dependent and instead are configuration dependent, which means that they can be reused in multiple applications. Furthermore, these constraints are treated simultaneously, considering smooth transitions among them. Combining the TNB frame projection and adaptive admittance law, the outer admittance control loop realizes a safe and intuitive human-robot collaboration along a predefined path while the robust inner motion control loop guarantees that the robot follows the path accurately.
We validate the proposed approach with two experiments including a linear motion test to demonstrate the behavior of the robot to the direction of the external force applied and a general 3D path test. Both tests are performed on a traditional 6-DOF industrial robot equipped with a force/torque (F/T) sensor on its end effector. No dedicated hardware is required. We compare three types of motion-free motion (FM), force-applied motion (FAM), and combined motion with virtual forces (CVF)-to show the performance in both ends of the assistance range spectrum. FM demonstrates the fully assisted case, where no force from the user is needed; FAM is the no-assistance case, where the motion of the robot along the path depends on the force applied by the user; and CVF is the smooth transition between the previous two cases. To achieve the proposed objective of compliant human-robot collaboration with accurate path-tracking, the robot follows a reference path and the tracking error should be small, whether it is subject to external forces or not. Thus, we evaluate the tracking performance of each type of motion by calculating the root mean square error (RMSE). The experiments exhibit not only accurate path tracking with desired compliant behavior but also the applicability of the proposed approach to traditional industrial manipulators with F/T sensors. Therefore, the main contributions of this work are as follows: • Development of a dual-loop control structure that achieves accurate path tracking for collaborative tasks while maintaining compliance along the path.  The paper is structured as follows. Section 2 covers the problem formulation and the methodology, including the inner motion control loop and the outer admittance control loop. In Section 3, we describe the experimental setup and tests performed to validate the proposed approach. Additionally, we present the results and analysis of RMSE, which is used to evaluate the tracking performance. Finally, the conclusions of the work are presented in Section 4.

Problem Formulation and Methodology
As we discussed in the previous section, the most effective way to accomplish particular human-robot collaboration in the fields of rehabilitation, industrial assembly, education, and physical training is by guiding the user to closely follow an optimal path with robots, while reserving a certain degree of compliance for safe and smooth human-robot interaction. In these applications, the path is defined in advance by domain experts. The goal of this paper is to design a controller that confines the end effector of a robot on the path but allows it to move forward or backward freely along the path depending on the direction of external forces. If the external force is too weak or null, a virtual force is applied to the end effector from the controller to track the path autonomously and accurately. In other words, the proposed control system endows the robot with directional compliance along a prescribed path, and high stiffness in other directions for accurate path tracking. Moreover, the degree of compliance is online adjustable according to the applied forces and safety operation criteria of the robot such that the interaction between the human and the robot is safe, comfortable, and intuitive.
In this paper, we consider an n-joint robot that carries out tasks in the 3D task space, where n ≥ 3. An F/T sensor is mounted on the end effector of the robot to measure external forces. To accomplish the goal of this paper, we propose a dual-loop control structure as shown in Figure 2. The inner loop is dedicated to precision motion control in the joint space. Namely, given the desired trajectory in the joint space q d ∈ R n , the motion controller in the inner loop calculates the corresponding joint torque such that the actual joint angle follows q d accurately. q d is determined by the outer admittance control loop based on the desired task space path and the external force F ext ∈ R 3 . The filtered external force f ext ∈ R 3 is projected to the tangent direction of the path and then converted to the corresponding task space velocityṙ d ∈ R 3 through an admittance function whose parameters are online adjustable. Then,ṙ d is transformed to the joint space to obtain q d . In the following subsections, we present the details of the techniques used in the proposed dual-loop control structure.

Inner Motion Control Loop
The dynamic equation of an n-joint robot is given as follows: where q,q,q, τ ∈ R n , denote the joint angle, angular velocity, angular acceleration, and torque, respectively. M(q), C(q,q) ∈ R n×n are the inertial matrix, Coriolis, and centrifugal matrix, respectively. G(q), F(q) ∈ R n are the gravitational torque and frictional torque, respectively. J(q) ∈ R 3×n is the Jacobian matrix of the end effector, and F ext ∈ R 3 is the external force applied to the end effector.
Given the desired joint space trajectory q d ∈ R n , we would like to design a robust motion control law that calculates the required joint torque τ for keeping the tracking error q = q − q d as small as possible, even in the presence of model uncertainties and external disturbance. It is well known that SMC has desirable robustness with respect to matched uncertainties, but high-frequency chattering causes degradation of performance and should be suppressed carefully. Many variations of SMC have been investigated in the past for alleviating chattering with minor cost in performance deterioration [25][26][27][28][29]. Among all these techniques, we adopt the modified SMC developed and experimentally verified by our research group in [30].
Let M 0 (q), C 0 (q,q), G 0 (q), and F o (q) be the nominal models of M(q), C(q,q), G(q), and F(q), respectively. Then, (1) can be rewritten as where d is the lumped additive model uncertainties resulting from all model parameters in M(q), C(q,q), G(q) and F(q). ∆ M is the multiplicative model uncertainty of M −1 (q). We assume that ∆ M ≤ κ < 1 and d ≤ d for all q andq. Define the sliding variable σ ∈ R n as where C 1 ∈ R n×n is positive definite and η ∈ R n is an auxiliary vector which will be determined shortly. The proposed control law is Note that the control law in (4) cancels the nominal nonlinear terms and introduces an auxiliary control input u 1 to enhance robustness. Λ 1 , Λ 0 , K s ∈ R n×n are constant gain matrices and ρ = sgn(σ 1 )d s1 , · · · , sgn(σ n )d sn T where sgn(· ) denotes the sign function, andd si =d + κ q d − C 1˙ q + Λ 0 u 1 , i = 1, · · · , n, is the bound of the uncertain terms. Each component of ρ switches its sign across the sliding surface σ i = 0 and is used to suppress the model uncertainty. However, the high-frequency switching behavior of ρ causes significant chattering if it is directly added to the joint torque, just as the traditional SMC does. Let K s be positive definite, if we substitute (4)-(6) into (2), it can be shown that [30] σ Tσ ≤ −σ T K s σ This implies that σ → 0 as t → ∞. In other words, the system will reach and stay on the sliding surface σ ≡ 0. Moreover, (5) and (6) can be combined into one equation: where Λ 1 , Λ 0 ∈ R n×n are chosen such that the left-hand side of (9) is a stable system. For example, Λ 1 , Λ 0 can be chosen as diagonal matrices with positive diagonal elements.
From (4) and (9) we see that, unlike traditional SMC, the switching term ρ does not appear in the joint torque directly. Instead, it is filtered by (9) before being incorporated into the joint torque. Therefore, the chattering phenomenon is significantly alleviated.
Once the sliding surface is reached, i.e., σ ≡ 0, the switching term is equivalent to the lumped effect of model uncertainty and external disturbance, and the closed-loop system can be expressed asü For ease of illustration, let us temporarily assume that Λ 1 , Λ 0 , and C 1 are diagonal matrices, i.e., Λ i = diag(λ i1 , · · · , λ in ), i = 0, 1, and C 1 = diag(c 11 , · · · , c 1n ). Then, the closed-loop system (10) and (11) can be expressed as Figure 3 below. It is clear from Figure 3 that the closed-loop system is stable. In addition, the switching term, which is equivalent to uncertainty and disturbance in the sliding mode, is filtered by a second-order system s+λ 1j s 2 +λ 1j s+λ 0j and affects the tracking error through a first-order system 1 s+c 1j . Although the tracking error is not guaranteed to converge to zero, we can choose appropriate gain matrices Λ 1 , Λ 0 , and C 1 such that the tracking error is as small as desired. Besides the chattering attenuation property, another appealing feature of the proposed modified SMC is that if the initial tracking error is known, we can set η(0) = −˙ q(0) − C 1 q(0). As a result, the system is on the sliding surface as it starts, which eliminates the reaching phase of the traditional SMC and reduces the transient response time.
Experimental verification conducted in [30] showed that the proposed modified SMC has the best tracking performance in comparison with traditional first-order SMC (FOSMC), second-order SMC (SOSMC), and integral SMC (ISMC). Its chattering reduction ability is much better than FOSMC and ISMC, and similar to SOSMC. However, the proposed modified SMC does not need to find bounds to the time derivative of uncertainties as SOSMC does. Therefore, the proposed control law induces less vibration and achieves the best tracking performance with a simple structure.

Outer Admittance Control Loop
Suppose that the reference path with respect to an inertial frame in the 3D task space is which is parameterized by a single parameter s ∈ [0, 1]. We assume that r p has finite length and choose the normalized arc length as the parameter s. Thus, s = 0 and s = 1 correspond to the start point and the end point of the reference path, respectively. Furthermore, we assume that r p is twice differentiable with respect to s. At any point on r p (s), we can find the unit tangent vector t(s), unit normal vector n(s) and unit binormal vector b(s) at that point as follows: Note that r p (s) and t (s) denote the first derivatives of r p (s) and t(s) with respect to s, and × is the cross product of two vectors. These vectors comprise the TNB frame, which moves with the end effector along r p . Whenever an external force F ext is applied to the end effector, they are measured by the F/T sensor equipped on the end effector, and the measurements are preprocessed to alleviate noise, obtaining f ext (see the output of the signal conditioning block in Figure 2). If the magnitude of f ext exceeds a threshold f th , the f ext is projected to the unit tangent vector of the path. On the other hand, if f ext is too weak or null, i.e., f ext < f th , then a virtual force with magnitude f v > 0 is added along the tangent direction of the path. In other words, Note that (14) is represented by the mode select block in Figure 2. Then, the desired velocity of the end effector in the task space, denoted byṙ d , is determined asṙ d = g(t) * f proj , where * denotes convolution, and g(t) is the impulse response of the desired admittance function G(s), which has the following first-order form: Parameters m and c denote the virtual mass and damping of the end effector, respectively, and they are online adjustable for avoiding common kinematic constraints such as singularities, joint limits, and task space limits. These constraints are directly related to the safety of the interaction because it may cause damage to the environment or the nearby human operators if any of these constraints is violated. Furthermore, providing the robot with awareness of these constraints and a way to preemptively deal with them relieves the operator from the mental load required to avoid them, which increases performance of the task [1,[5][6][7]14,20]. If none of these constraints are going to be violated, the admittance parameters are adjusted to achieve safe, comfortable, and intuitive human-robot interaction. The online parameter tuning algorithm will be introduced shortly. Once the desired task space velocityṙ d is obtained, the desired joint space velocity is calculated bẏ where r is the actual position of the end effector and K ∈ R 3×3 is a positive definite gain matrix which guarantees that r → r d as t → ∞. J † (q) is the pseudo-inverse of J(q). We assume that the reference path r p does not pass through any singularity of the robot; therefore, J(q) is full rank and J † (q) exists for all points on r p . Existence of singularities is an inherent limitation for industrial robots, regardless of the method used. However, one desirable feature of the proposed method is that it forces the robot to stop before reaching singularities and allows the robot to retract along the path without getting stuck when guided by the human operator. This is accomplished by the outer admittance control loop. Therefore, violation of the no-singularities-on-the-reference-path assumption does not fail the normal operation of the robot. It just restricts its motion on the portion of the reference path without singularities. Note that only the tangential component of f ext is used to generateṙ d which is in the tangent direction of r p . In other words, the robot moves along r p when the end effector is pushed by an external tangential force. However, if a large force, i.e., f ext ≥ f th , is applied in the perpendicular direction of r p , then f proj is zero. Consequently,ṙ d reduces to zero exponentially with time constant m c , and the robot stops almost immediately if the time constant is very small. In this way, the robot rejects perpendicular forces while complies with tangential forces based on an adaptive admittance law.
The first-order admittance function G(s) is widely used in many compliance control problems [31][32][33][34], but the appropriate admittance parameters are task dependent and are often set by heuristics. To deal with this problem, we have proposed an online parameter tuning approach in [23] that considers the safety, comfort, and intuition of manual guidance. The underlying idea is to reduce compliance without significantly changing the dynamic behavior of the admittance function whenever the robot is close to constrained areas such as singularities, joint limits, and task space limits. If no constraints are going to be breached, the compliance varies with the external force, allowing the user to guide the motion of the robot more comfortably and intuitively. In this paper, the desired task space path r p is defined in advance and the end effector does not deviate from this path; thus, we can assume that the robot will not pass through or go near any constrained areas. Therefore, the admittance parameters are adapted based on the applied forces.
To tune the admittance parameters, we first set up the varying range for the virtual damping c. The maximum allowable motion speed is considered when selecting the limits of the range for damping c. This ensures that any motion is below the safety relative speed limit defined in the Annex A of ISO/TS 15066:2016 [35] for transient and quasi-static contact. Let c ∈ [c min , c max ], where c min and c max are the pre-established minimum and maximum limits of c, respectively. Then, the projected force f proj is normalized with respect to an estimated maximum valuef , which could be determined either experimentally or heuristically. Definef Therefore,f ∈ (0, 1]. The proposed parameter adaptive law is (18) Notice that the largest forcef = 1 is mapped to the minimum damping c min , which corresponds to the largest DC gain of G(s), while the smallest forcef ≈ 0 is mapped to the maximum damping c max corresponding to the smallest DC gain of G(s). Consequently, the user can guide the robot to move faster and reach the destination quickly just by applying a larger force. On the other hand, the user slows down the robot to accomplish fine work with high accuracy when a smaller force is applied. Once the virtual damping c is determined, the virtual mass m is adjusted accordingly to keep the ratio m c unaltered. The ratio m c is the time constant of G(s), which is related to the response time of G(s). Fixed time constant gives consistent dynamic behavior of the admittance function and allows the user to quickly get accustomed to the way for operating the robot.
Experimental verification of the proposed adaptive admittance law and comparison with other parameter tuning methods were conducted in [23] by implementing a 3D shape tracing task. The admittance laws in comparison included constant parameters and adaptive virtual damping with fixed virtual mass. Objective evaluation of the test results was done by analyzing the path length errors and task execution time. Meanwhile, a subjective evaluation was also conducted by collecting questionnaires that asked each test user to score the performance of each parameter tuning method in terms of vibration of the system, required efforts, and ease of completing the task. The results showed that the proposed adaptive admittance law has the best performance among all compared methods for both objective and subjective evaluation.
The outer admittance control loop is summarized as Algorithm 1 below.

Algorithm 1 Compliant path tracking using force projection
Inputs: f ext , f v , s Outputs:ṙ d 1: From path r p (s), calculate t(s), n(s), b(s) using (13) 2: Initialize f th , f v , c and ratio m/c 3: for t = 0 to ∞ do 4: if (s ≤ 1) then 5: Select mode to choose force input and project it to the tangent direction. 6: if ( f ext < f th ) then 7: Update f proj = f v t(s) f v is the task-dependent constant virtual force 8: else 9: Update f proj = ( f T ext t(s))t(s) Obtainṙ d from passing f proj through the admittance law (15). 15: Normalize f proj using (17) to obtainf 16: Update c using (18) and calculate m to maintain the fixed ratio m/c 17: end for

Experimental Setup
The tests are performed using a HIWIN RA605 6-DOF robot arm with a Robotiq 2F-85 gripper attached to the end effector. An ATI Gamma F/T sensor with analog output sampled at 1 kHz was used to measure the external force applied to the end effector. See Figure 4. In this section, the two experiments conducted to validate the proposed approach are detailed. They include a linear motion test and a 3D path test. For these tests, the robot moves with constant orientation. Furthermore, the robot tool actual position is obtained from the robot joint encoders. The sliding mode control parameters used are summarized in Table 1. Regarding the admittance law parameters, the limits for damping c were chosen as c min = 300 N·s·m −1 and c max = 1200 N·m·s −1 . From these values, the maximum speed is 266 mm·s −1 , which allows us to comply with the relative speed limits defined in Annex A of ISO/TS 15066:2016 [35] for applications where contact between body areas and the robot system is possible. In our case, these body areas include the lower arm and hand/finger, where the speeds are restricted to 1300 and 650 mm·s −1 for transient and quasi-static contact, respectively, considering an estimated robot mass of 20 kg. In addition, the user has an emergency button at hand throughout the experiments conducted. The time constant of G(s) is the ratio m c = 0.0167 s. Finally, f th = 1.2 N and f v = 40 N.   For the second test, the 3D path we chose to demonstrate the path-tracking capability of our system is a helix, defined in (20)

Linear Motion Test
We performed a linear motion test to show the behavior of the robot to the external forces applied from different directions. The detailed data are presented in Figure 6, including the desired and actual 3D paths in the robot base frame, desired and actual Cartesian positions, path parameter s, desired velocities in the TNB frame, and external forces in the robot frame and the TNB frame. Each subfigure of Figure 6 is annotated with labels using numerals from 1 to 5 to separate the data into regions where forces are applied in different directions: 1 and 5 for free-motion, 2 for force applied along the y-axis of the robot frame, 3 for force applied along the x-axis of the robot frame, and 4 for force applied along the z-axis of the robot frame. The differences between the desired and actual Cartesian positions in Figure 6a,b are the tracking errors represented in the task space which demonstrate the performance of the inner loop SMC controller. Figure 6d shows the evolution of the s parameter, which defines the position of the robot in the path. In region 1, from t = 0 s to t = 16 s, there is no external force applied to the robot, and the robot moves to the target point B at s = 1 with a constant velocity based on f v as in (14) and Algorithm 1, (see also Figure 6c-f). Next, in region 2, from t = 16 s to t = 24 s a negative external force on the y-axis of the robot frame is applied, see F y in Figure 6c, which is reflected in the TNB projected force as F t and F b in Figure 6f. This causes the robot to move backward along the line reaching s = 0 in Figure 6d.
Likewise, from t = 24 s to t = 35 s a positive external force on the y-axis of the robot frame was applied to move the robot forward along the path. During this interval there was a pause from t = 29 s to t = 31 s where no force was applied, and the slope of the s parameter changed to the same value as in the previous free-motion interval, see Figure 6c-f. For region 3, from t = 35 s to t = 59 s, the same tests were repeated but this time applying the external force on the x-axis of the robot frame showing a similar behavior in the s parameter, see F x in Figure 6c and F t , F b in Figure 6f. In region 4, from t = 59 s to t = 78 s, an external force normal to the path along the z-axis of the robot frame was applied three times with alternating signs, see F z in Figure 6c and F n in Figure 6f. As expected, the applied force was not considered for robot motion because the projection to the tangent direction of the path is null. This can also be seen in Figure 6d where three stair patterns are created, meaning the s parameter remained constant during the three periods where the perpendicular force was applied, see Figure 6c,f. For region 5, from t = 78 s to t = 84 s, no force was applied to the robot; thus, the robot moved towards the goal with constant velocity obtained from the virtual force f v until s = 1. This linear test proves the capability of our proposed method to customize the compliance behavior of the robot for a path tracking task. Furthermore, for clear presentation, the tracking performance of the modified SMC controller in both the joint space and task space is summarized in Table 2.

3D Path-Tracking Tests
Three tests were executed using the helix path for comparison to show the behavior of the proposed algorithm in both ends of the assistance range spectrum, namely, fully assisted motion or free motion (FM), and not assisted motion, i.e., force-applied motion (FAM). The combined motion with virtual forces (CVF) is the smooth transition between FM and FAM. Note that for the FAM test we defined f v = 0 N to test the case of no assistance individually. This causes that at any instant when there is no external force applied, the robot stops and maintains the last position, meaning that only the user can make the robot move in this case. Moreover, the proposed virtual force scheme provides the means for a smooth transition between FM and FAM. The detailed data of the tests are shown in Figure 7a-i, including the external forces in the TNB frame, the s parameter variation throughout the task, and the desired velocityṙ d in the TNB frame obtained from the constant virtual force f v .

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ṙ d in Figure 7c, which are used in (16) to obtain the desired joint velocities, are calculated from passing the constant virtual force f v projected to the tangent direction of motion of the path through the admittance law as described in Section 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 f v = 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.

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 f v 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.

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 r p (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 r p (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 d p,i⊥r p between the ith point and the reference curve r p (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 p j,i is the ith test point of the jth component, j = x, y, z, and N is the total number of points in the test. d p,i⊥r p = min s (r p,x (s) − p x,i ) 2 + (r p,y (s) − p y,i ) 2 + (r p,z (s) − p z,i ) 2 , s ∈ [0, 1] (23) 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][37][38].

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.