Appendix A Mathematical details
A.1 Human-guidance detection speed
In order to relate our algorithm to methods used in the lit. of collision detection, we can investigate the time-derivate of h as follows:
$$\begin{aligned} \dot{h} = {\left\{ \begin{array}{ll} 0 &{}\quad E \le E_{t}\\ \dot{E}/(E_{m} - E_{t}) &{}\quad E > E_{t} \end{array}\right. } \end{aligned}$$
(18)
By replacing \(\dot{E}\) from Eq. 7 and the approximation that \({\tilde{P}}_{o} = h {\tilde{P}}_{i}\) (since, in the discrete system, \({\tilde{P}}_{o}(k) = h(k-1) {\tilde{P}}_{i}(k-1)\)), we have
$$\begin{aligned} \dot{h} = -\gamma (h - 1) \end{aligned}$$
(19)
where \(\gamma = ({\tilde{P}}_{i}-{\tilde{P}}_{d})/(E_{m}-E_{t})\). It shows that \({\tilde{P}}_{i} > {\tilde{P}}_{d}\), \(h \rightarrow 1\) and otherwise \(h \rightarrow 0\). The solution to this equation for an arbitrary initial condition (h(0)) is:
$$\begin{aligned} h(t) = (h(0) - 1) e^{-\gamma t} + 1 \end{aligned}$$
(20)
The rise time (i.e., to reach 0.9 from 0) for a fixed \(\gamma \) is \(T_r = 2.32 \gamma ^{-1}\). Moreover, the energy first needs to pass \(E_{t}\) which requires \(T_t = E_{t}/{\tilde{P}}_{i}\). In total the time to reach \(h=0.9\) when the tank is empty \(E(0)=0\) for constant \({\tilde{P}}_{i} > 0\) is
$$\begin{aligned} T_{u} = 2.32 (E_{m}-E_{t})/({\tilde{P}}_{i}-{\tilde{P}}_{d}) + {E_{t}}/{{\tilde{P}}_{i}} \end{aligned}$$
(21)
Same can be derived for the case where human retreats from the interaction \({\tilde{P}}_{i}=0\). In this case, we reach \(h=0\) from \(h(0)=0.9\) given the following time constant.
$$\begin{aligned} T_{d} = 2.32 (E_{m}-E_{t})/{\tilde{P}}_{d} \end{aligned}$$
(22)
Note that non-consistent interaction \({\tilde{P}}_{i} < 0\) decrease h faster by reducing the energy in the tank.
Figure 15 shows the accumulated energy based on the magnitude and duration of an external force. By choosing a level set (i.e., \(E_{m}\)), we can consider the tank as a classifier that passes forces with certain consistency (i,e., magnitude, duration).
A.2 Autocorrelation of external force
Our human detection algorithm can be investigated from a statistical point of view. First, let us assume diagonal inertia and damping matrices in Eq. 5. Let \(m_j\) and \(d_j\) be the inertia and damping for the jth dimension (\(j\in \{1,...,n\}\)). The admittance dynamics in Eq. 5 can be written as a low-pass filter in the following discrete form for each dimension.
$$\begin{aligned} \dot{\tilde{x}}_j(k) = \beta _j \dot{\tilde{x}}_j(k-1) + (1 - \beta _j) d_j^{-1} F_{e,j} \end{aligned}$$
(23)
where \(\dot{\tilde{x}}_j(k)\) is the virtual admittance velocity for the time-step k and jth dimension. \(F_{e,j}\) is the external force in jth dimension, and \(\beta _j = 1 - m_a^{-1} d_j \varDelta t\) where \(\varDelta t\) is sampling rate. Therefore, the input power at time-step k can be expanded as:
$$\begin{aligned} \begin{aligned} {\tilde{P}}_{in,j}(k)&= \dot{\tilde{x}}_j(k) F_{e,j}(k)\\&= d_j^{-1} (1-\beta _j) \sum \limits _{l=1}^{\infty } \beta _j^{l-1} F_{e,j}(k-l) F_{e,j}(k) \end{aligned} \end{aligned}$$
(24)
The accumulated energy due to \({\tilde{P}}_{i}\) can be computed as:
$$\begin{aligned} \begin{aligned} E_{j}(n)&= \sum \limits _{k=-\infty }^{n} {\tilde{P}}_{i}(k)\\&= \sum \limits _{k=-\infty }^{n} d_j^{-1} (1-\beta _j) \sum \limits _{l=1}^{\infty } \beta _j^{l-1} F_{e,j}(k-l) F_{e,j}(k)\\&= d_j^{-1} (1-\beta _j) \sum \limits _{l=1}^{\infty } \beta _j^{l-1} \sum \limits _{k=-\infty }^{n} F_{e,j}(k-l) F_{e,j}(k)\\ \end{aligned} \end{aligned}$$
(25)
by defining the autocorrelation function with lag l over the external force at time step n as follows
$$\begin{aligned} \rho _j(l) = \sum \limits _{k=-\infty }^{n} F_{e,j}(k) F_{e,j}(k-l) \end{aligned}$$
(26)
we can rewrite the energy of the tank as:
$$\begin{aligned} \begin{aligned} E_{j}(n)&= d_j^{-1} \frac{ \sum \limits _{l=1}^{\infty } \beta _j^{l-1} \rho _j(l)}{\sum \limits _{l=1}^{\infty } \beta _j^{l-1} } \end{aligned} \end{aligned}$$
(27)
Note that, we used the expansion of \((1-\beta _j)^{-1}\). Therefore, the input energy is the weighted averaged of autocorrelation with different lags.
A.3 Energy analysis
In this section, we investigate the passivity of our control architecture. First, we assume the following decomposition for the dynamical system.
$$\begin{aligned} f(x) = - \nabla _x V(x) + \tilde{f}(x) \end{aligned}$$
(28)
Where \(V(x) \in \mathbb {R}^{+}\) is a potential function and \(\tilde{f}: \mathbb {R}^n \mapsto \mathbb {R}^n\) is a residual that accounts for the non-conservative part of the DS. The stability of motion-generation can be investigated with the assumptions of perfect tracking (\({\dot{x}} = {\dot{x}}_{t}\)) as follows:
$$\begin{aligned} \dot{V}(x) = \nabla _x V(x) {\dot{x}}_{t} = -|| \nabla _x V(x) ||^2 + \nabla _x V(x)^T \tilde{f}(x) \end{aligned}$$
(29)
The Lyapunov stability of the DS can be guaranteed if
$$\begin{aligned} \nabla _x V(x)^T \tilde{f}(x) < || \nabla _x V(x) ||^2 \end{aligned}$$
(30)
which indicates that the conservative part dominates the non-conservative part and vanishes over time.
In the case of perfect tracking (\({\dot{x}} = {\dot{x}}_d\)), we can write
$$\begin{aligned} {\dot{x}} = \bar{h} {\dot{x}}_{t} + {\dot{x}}_a \end{aligned}$$
(31)
where \(\bar{h} = 1-h\). initially, we limit our analysis to \(D_a = d_a \mathbb {I}_n\) where \(d_a \in {\mathbb {R}}^{+}\). Let’s consider the following storage function:
$$\begin{aligned} W = \frac{1}{2} {\dot{x}}^T M_a {\dot{x}} + d_a V(x) \end{aligned}$$
(32)
Using the admittance dynamics (Eq. 3), the time derivative of this storage function is
$$\begin{aligned} \begin{aligned} \dot{W} =&~{\dot{x}}^T (\bar{h} M_a \ddot{x}_{t} - \dot{h} M_a {\dot{x}}_{t} - d_a {\dot{x}}_a + h F_e)\\&+ d_a \nabla _x V(x) {\dot{x}} \\ \end{aligned} \end{aligned}$$
(33)
\(\ddot{x}_{t}\) can be computed based on the Jacobian of f(x) as \(\ddot{x}_{t}= f^{\prime }(x) {\dot{x}}\).
$$\begin{aligned} \begin{aligned} \dot{W} =&~ h F_e^T {\dot{x}} - {\dot{x}}^T (d_a \mathbb {I}_n - \bar{h} M_a f^{\prime }(x)) {\dot{x}} \\&+ {\dot{x}}^T (\bar{h} d_a \mathbb {I}_n - \dot{h} M_a ) {\dot{x}}_{t} + d_a \nabla _x V(x)^T {\dot{x}}_r \end{aligned} \end{aligned}$$
(34)
Using Eqs. 2 and 28, and defining the human-induced error as \(\dot{e}_h = {\dot{x}}_r - \bar{h} {\dot{x}}_{t}\) we can write
$$\begin{aligned} \begin{aligned} \dot{W} =&h F_e^T {\dot{x}} -{\dot{x}}^T (d_a \mathbb {I}_n - \bar{h} M_a f^{\prime }(x)) {\dot{x}} + \bar{h} h d_a \nabla _x V(x)^T {\dot{x}}_{t} \\&\bar{h} d_a {\dot{x}}^T \tilde{f}(x) + h d_a \nabla _x V(x)^T \dot{e}_h -\dot{h} {\dot{x}}_{t}^T M_a {\dot{x}}\\ \end{aligned} \end{aligned}$$
(35)
Let’s first investigate the two boundary conditions (\(h=1\) and \(h=0\) with \(\dot{h}=0\)). For \(h=0\) (the absence of human guidance), we have
$$\begin{aligned} \dot{W}|_{h=0} = - {\dot{x}}^T (d_a \mathbb {I}_n - M_a f^{\prime }(x)) {\dot{x}} + d_a {\dot{x}}^T \tilde{f}(x) \end{aligned}$$
(36)
The system is stable if \(d_a > \lambda _{max}(M_a f^{\prime }(x))\). This means that forces generated by the damping part of the admittance (\(d_a {\dot{x}}\)) should dominate the centrifugal forces generated by DS (\(M_a f^{\prime }(x) {\dot{x}}\)). Moreover, the non-conservative part of DS (\({\dot{x}}^T \tilde{f}(x)\)) might violate the stability of the system. Nevertheless, having a damped admittance behavior in \(h=0\) results in \({\dot{x}}_a \rightarrow 0\), therefore \({\dot{x}}={\dot{x}}_{t}\). Given this, we can rewrite
$$\begin{aligned} {\dot{x}}_{t}^T \tilde{f}(x)= & {} (- \nabla _x V(x) + \tilde{f}(x))^T \tilde{f}(x)\nonumber \\= & {} - \nabla _x V(x)^T \tilde{f}(x) + \tilde{f}(x)^2 \end{aligned}$$
(37)
Therefore, the system is stable if \( ||\tilde{f}(x)||^2 \le \nabla _x V(x)^T \tilde{f}(x) \) which includes \(\tilde{f}(x)=0\). Finally, note that \(\dot{W}<0\) only proves the stability of the system. The passivity of the mapping \(F_e \mapsto {\dot{x}}\) is ill-defined since the term \(F_e^T {\dot{x}}\) does not appear in \(\dot{W}\) for \(h=0\).
For \(h=1\) (the presence of human guidance), we have
$$\begin{aligned} \dot{W}|_{h=1} = F_e^T {\dot{x}} - d_a ||{\dot{x}}||^2 + d_a \nabla _x V(x)^T {\dot{x}} \end{aligned}$$
(38)
The system exchanges energy through the input port \(F_e^T {\dot{x}}\). The passivity of the admittance is guaranteed since \(d_a > 0\). The last term (\(P_{h}\)) shows how the human can inject energy into DS potential function by changing the state of the system.
During transitions (\(\dot{h}=0\)), DS dissipates energy since \(\nabla _x V(x)^T {\dot{x}}_{t} <0\) (from Eq. 29) and \(\bar{h}h>0\). Since we modulate \({\dot{x}}_{t}\) by \((1-h)\), sudden changes of h result in an acceleration of \(-\dot{h} M_a {\dot{x}}_{t}\). This temporary energy generation (which is bounded) can either be neglected or handled by setting a limit on the increase of h based on the state of the system. The other solution is to avoid modulating \({\dot{x}}_{t}\) (as in Eq. 1) and to use the following:
$$\begin{aligned} {\dot{x}}_d = {\dot{x}}_{t} + {\dot{x}}_a \end{aligned}$$
(39)
This leads to a simpler energy analysis as follows:
$$\begin{aligned} \dot{W} = h F_e^T {\dot{x}} - {\dot{x}}^T (d_a \mathbb {I}_n - M_a f^{\prime }(x)) {\dot{x}} + d_a {\dot{x}}^T \tilde{f}(x) \end{aligned}$$
(40)
In this formulation, the desired velocity generated by the DS are always present. This might be a drawback for cases where this velocity perturbs the human during \(h=1\) or deteriorate the compliant behavior. However, in cases where human guidance has the purpose of small corrections, the presence of this velocity is beneficial. Moreover, in proactive scenarios, even during \(h=1\), it is necessary for the robot to not only rely on \({\dot{x}}_a\) but also generate and follow \({\dot{x}}_{t}\). It is intuitive to see that \({\dot{x}}_a\) accounts for passive-following behavior and \({\dot{x}}_{t}\) can account for pro-active following behavior during \(h \ne 0\). For better illustration, the power exchanges for the 1D simulation case are presented in Fig. 16.
A.4 Asymmetric damping matrix
Without any loss of passivity, we can have the following admittance behavior:
$$\begin{aligned} M_a \ddot{x}_a = - d_a^{\parallel } {\dot{x}}_a^{\parallel } - d_a^{\perp } {\dot{x}}_a^{\perp } + h F_e \end{aligned}$$
(41)
where \({\dot{x}}_a\) is decomposed into two parts: \({\dot{x}}_a^{\parallel }\) parallel and \({\dot{x}}_a^{\perp }\) orthogonal to \({\dot{x}}_{t}\) with their respective damping gains (\(d_a^{\parallel }\) and \(d_a^{\perp }\)). The resulting damping matrix is:
$$\begin{aligned} D_a = Q \varLambda Q^T \end{aligned}$$
(42)
where the columns of \(Q \in \mathbb {R}^{n \times n}\) are unit vectors that span \(R^{n}\) and the first column is parallel to \({\dot{x}}_ds\). \(\varLambda \) is diagonal matrix with elements equal to \(d_a^{\perp }\) except the first one being \(d_a^{\parallel }\). The stability and passivity analysis follows the same procedure only \(d_a^{\parallel }\) appears instead of \(d_a\) in Eq. 35.
A.5 The simulation parameters
The parameters used for the 1D simulations are as follows: \(M_a=1\), \(D_a=10\), \(E_{m}=2\), \(E_{t}=1\), \({\tilde{P}}_{d}=2\), \(h(0)=0\), \(E(0)=0\), \({\dot{x}}(0)=0\), \(x(0)=1\), \({\dot{x}}_a(0)=0\), \(dt=1\) ms. The dynamics system: \({\dot{x}}_{t} = -3x\) but saturated in \([-2,~ 2]\). The external forces:
$$\begin{aligned} F_e = {\left\{ \begin{array}{ll} {\mathcal {N}}(0,36) &{}\quad 0<t<2 \\ -20 (x - 1) - 10 {\dot{x}}_r &{}\quad 3<t<6 \\ 10 &{}\quad 9<t<9.005 \\ 0 &{}\quad \text {elsewhere} \end{array}\right. } \end{aligned}$$
(43)
However, the forces for the simulated human (second row) is saturated between 5 and \(-5\), and the pulse (third row) repeats 10 times every 50 ms.
For the 2D simulation example, we use \(M_a=\text {diag}\{2,2\}\), \(D_a=\text {diag}\{4,4\}\), \(E_{m}=2\), \(E_{t}=1\), \({\tilde{P}}_{d}=2\), \(h(0)=0\), \(E(0)=0\), \({\dot{x}}(0)=[0,0]\), \(x(0)=[-.9,-.6]\), \({\dot{x}}_a(0)=[0,0]\), \(dt=1\) ms. The dynamical system is:
$$\begin{aligned} f(x) = \begin{bmatrix} -1.5 &{}\quad 1.5 \\ -2.4 &{}\quad -6 \end{bmatrix} x \end{aligned}$$
(44)
saturated at 2m/s.
For the adaptive case (Fig. 8), we use \(M=\text {diag}\{1,1\}\), \(C=\text {diag}\{0,0\}\), \(\ddot{x}(0)=[0,0]\), \({\dot{x}}(0)=[0,0]\), \(x(0)=[.022,0]\), \(D_a=\text {diag}\{2,2\}\), \(M_a=\text {diag}\{0.05,0.05\}\), \({\dot{x}}_a(0)=[0,0]\), \(h(0)=0\),\({\tilde{P}}_{d}=.2\), \(E(0)=0\), \(E_{t}=.1\), \(E_{m}=.2\), \(dt=1\) ms. The dynamical system specified in the polar coordinate is:
$$\begin{aligned} {\left\{ \begin{array}{ll} \dot{\theta } = \pm 10 \\ \dot{r} = -15 (r - 0.022) \end{array}\right. } \end{aligned}$$
(45)
where \(x_1 = r \cos (\theta )\) and \(x_2= r \sin (\theta )\). \(f_1\) represent the counterclockwise and \(f_2\) the clockwise rotation. The external forces are simulate as
$$\begin{aligned} F_e = -20 ({\dot{x}}- f_1(x)) \end{aligned}$$
(46)
where the norm of the output is limited to 2N. In one of the comparisons with impedance control (i.e., higher human effort), we increase this limit to 20N.
A.6 The robot parameters
For the arm admittance, we use the following parameters.
$$\begin{aligned} \begin{aligned} M_a&= \text {diag}\{6,6,6,1,1,.5\}\\ D_a&= \text {diag}\{60,60,60,15,15,15\}\\ dt~&= 8\,\text {ms} \end{aligned} \end{aligned}$$
(47)
However, for the virtual admittance use the following values.
$$\begin{aligned} \begin{aligned} M_a&= \text {diag}\{2,2,2,1,1,1\}\\ D_a&= \text {diag}\{2,2,2,2,2,2\}\\ \end{aligned} \end{aligned}$$
(48)
For the energy tank, we use \(E_m= 4\), \(E_t=2\) , \({\tilde{P}}_d = 2.5\).
A.7 Media
A demonstration of our method can be viewed at https://youtu.be/HrR85-IP-Qo.
A.8 Source codes
A C++ implementation of our method can be found at https://github.com/epfl-lasa/ds_admittance_control/tree/ridgeback.