*3.2. 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 *fv* 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 *Fy* in Figure 6c, which is reflected in the TNB projected force as *Ft* and *Fb* 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 *Fx* in Figure 6c and *Ft*, *Fb* 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 *Fz* in Figure 6c and *Fn* 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 *fv* until *s* = 1.

**Figure 6.** Linear motion path tracking test. Numerals 1–5 are used to separate regions where forces are applied in different directions: 1 and 5—free-motion, 2—force applied along y-axis of robot frame, 3—force applied along x-axis of robot frame, 4—force applied along z-axis of robot frame. (**a**) Desired and actual 3D path in robot base frame. (**b**) Desired and actual Cartesian positions. (**c**) Forces in robot frame. (**d**) Parameter s. (**e**) Desired Velocities in TNB frame. (**f**) Forces in TNB frame.

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.


**Table 2.** Linear motion task tracking root mean square error (RMSE).
