# Compliant Human-Robot Collaboration with Accurate Path-Tracking Ability for a Robot Manipulator
## 2 Problem Formulation and Methodology
### Outer Admittance Control Loop  
Suppose that the reference path with respect to an inertial frame in the 3D task space is  
\[r_{p}(s)= \begin{bmatrix}x_{p}(s)&y_{p}(s)&z_{p}(s)\end{bmatrix} ^{T} \tag{12}\]  
which is parameterized by a single parameter \(s\in[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:  
\[t(s)=\frac{r^{\prime}_{p}(s)}{\|r^{\prime}_{p}(s)\|},\ \ n(s)=\frac{t^{ \prime}(s)}{\|t^{\prime}(s)\|},\ \ b(s)=t(s)\times n(s) \tag{13}\]  
Note that \(r^{\prime}_{p}(s)\) and \(t^{\prime}(s)\) denote the first derivatives of \(r_{p}(s)\) and \(t(s)\) with respect to \(s\), and \(\times\) 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  
Figure 3: The \(j\)th component of the closed-loop system when the sliding surface \(\sigma_{j}=0\) is reached, \(j=1,\cdots,\ n\). 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,  
\[f_{proj}=\left\{ \begin{array}{ll}(f_{ext}^{T}t(s))t(s),&\|f_{ext}\|\geq f_{th }\\ f_{v}t(s),&\|f_{ext}\|<f_{th}\end{array} \right. \tag{14}\]  
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 \(t_{d}\), is determined as \(t_{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:  
\[G(s)=\frac{\frac{1}{c}}{\frac{m}{c}s+1} \tag{15}\]  
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 \(t_{d}\) is obtained, the desired joint space velocity is calculated by  
\[\dot{q}_{d}=J^{\dagger}(q)[\dot{r}_{d}+K(r_{d}-r)] \tag{16}\]  
where \(r\) is the actual position of the end effector and \(K\in\mathbb{R}^{3\times 3}\) is a positive definite gain matrix which guarantees that \(r\to r_{d}\) as \(t\rightarrow\infty\). \(J^{\dagger}(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^{\dagger}(q)\) exists for all points on \(r_{p}\). Existence of singularities is an inherent limitation for industrial robots, regardless of the method used.