Task-Space Admittance Controller with Adaptive Inertia Matrix Conditioning

Whenrobots physically interact with the environment, compliant behaviors should be imposed to prevent damages to all entities involved in the interaction. Moreover, during physical interactions, appropriate pose controllers are usually based on the robot dynamics, in which the ill-conditioning of the joint-space inertia matrix may lead to poor performance or even instability. When the control is not precise, large interaction forces may appear due to disturbed end-effector poses, resulting in unsafe interactions. To overcome these problems, we propose a task-space admittance controller in which the inertia matrix conditioning is adapted online. To this end, the control architecture consists of an admittance controller in the outer loop, which changes the reference trajectory to the robot end-effector to achieve a desired compliant behavior; and an adaptive inertia matrix conditioning controller in the inner loop to track this trajectory and improve the closed-loop performance. We evaluated the proposed architecture on a KUKA LWR4+ robot and compared it, via rigorous statistical analyses, to an architecture in which the proposed inner motion controller was replaced by two widely used ones. The admittance controller with adaptive inertia conditioning presents better performance than with a controller based on the inverse dynamics with feedback linearization, and similar results when compared to the PID controller with gravity compensation in the inner loop.


Introduction
When robots interact with the environment, whether with objects or humans, the closed-loop behavior should be safe for all agents and physical structures involved in the interaction [1], which means that it is crucial to control how the robot responds to the interaction and also its dynamic behavior when moving to accomplish a given task.
Impedance and admittance controllers [2] are usually the most appropriate ones for a safe interaction [3] because suitable compliant behavior is achieved by controlling the apparent robot impedance.These controllers are commonly used in a control architecture where there is an impedance or admittance in an outer loop, and a motion controller in an inner loop [4][5][6][7].Considering this architecture, a suitable motion controller is based on the robot dynamic model as it enables more accurate analyses and helps in the synthesis of the robot dynamic behavior [8].In those controllers, the joint space inertia matrix (JSIM) plays an important role in the control of the robot's dynamic behavior [9,10], which also affects safety.
Although it is well-known that the JSIM is positive definite independently of the robot configuration, this property does not guarantee the good conditioning of the matrix [11].The links of a serial manipulator are connected in a way that each link in the kinematic chain is carried by its predecessors while carrying all successive links in the chain.As a result, the equivalent inertia of the links is extremely disparate, and this difference increases with the number of links, regardless if they are identical or not [9,12], which leads to the ill-conditioning of the JSIM.
When the JSIM is ill-conditioned (i.e., it has a large condition number), small perturbations in the system can produce large changes in the numerical solutions [12], influencing the control performance [11], which in turn may affect safety.For instance, imprecise end-effector motion control can result in large interaction wrenches when the robot interacts with highly rigid environments, which may result in damage to either the robot or the environment.Also, depending on the control design, an ill-conditioned inertia matrix may lead to closed-loop instability, which may yield dangerous movements that would harm the human or cause damage to the environment.
Despite the fact that this ill-conditioning is intrinsic to serial kinematic chains [9], its effects can be mitigated and therefore the control performance can be enhanced.However, this problem is mostly neglected by researchers and just a few have worked on a solution for it [11,13].
In order to circumvent the ill-condition problem, Shen and Featherstone propose to use a PD controller with gravity compensation [11].The PD controller is not affected by the ill-conditioning of the JSIM since it directly converts the joint position/velocity error to the drive torque.Yet, according to the authors, other controllers that have complete knowledge about the robot dynamics should achieve better accuracy.
To benefit from the complete dynamic model in the control law whilst alleviating the effects of the JSIM's illconditioning, an alternative is to add a well-conditioned constant positive definite matrix to it in the Euler-Lagrange equation.However, this addition could lead to steady-state error in the closed-loop system due to the introduction of disturbances in the robot model that are not compensated by the control law.Even though the added matrix is constant, the resultant disturbance depends on the robot acceleration and, therefore, is time-varying, which means that adding an integrator to the control law would not be sufficient to solve the steady-state error problem.More specifically, if the actual robot's inertia matrix is given by M = M + A, where M is the nominal robot's JSIM and A is a positive definite matrix, the actual dynamic model is given by τ = M q + C q + g = M q + C q + g + w, where w = A q is the time-varying disturbance [14].
Another option is to add a positive definite variable matrix that varies according to the JSIM conditioning, without adding excessive inaccuracy to the nominal model.This matrix should be adapted during the robot motion, which inspires the use of an adaptive controller.In this context, we address the problem of task-space admittance control with adaptive inertia matrix conditioning, thus ensuring good performance and safe closed-loop behavior during physical interactions.

Impedance/Admittance Controllers
Pure motion control is usually insufficient to handle physical contacts between the robot and the environment, specially if the environment is rigid, because of the large contact wrenches arising from the interactions [15].Therefore, some works have largely relied on the use of force controllers to minimize the interaction forces [1].However, traditional force controllers tend to increase the robot stiffness to obtain high bandwidth and position accuracy, which may result in poor compliance and even instability.Therefore, force controllers are not the best choice for a good and safe interaction [16].Impedance and admittance controllers, on the other hand, have shown to be more appropriate to handle interactions [3], ensuring a suitable compliant behavior by controlling the apparent robot impedance.
Hogan [2] proposed the first impedance controller to control dynamic interactions between a manipulator and the environment in cases involving interaction forces that are not orthogonal to motions, in which pure force controllers are not adequate.By changing the robot impedance to match the desired interaction impedance, safety is improved, which has motivated many researchers to use impedance controllers when physical interactions are required.
For instance, Erhart et al. [17] extend an impedancebased controller to dual-arm mobile manipulators to limit undesired internal forces caused by kinematic errors due to uncertainties in the object geometry and manipulators.In order to accomplish that, the motion of the arms are separated from the motion of the mobile base to decrease the computational cost and also to, using a potential function, minimize the propagation of the base disturbances to the manipulators.Experiments were performed only in the horizontal plane.Lee et al. [18] also present an impedance controller that considers a dual-arm system as a single manipulator, whose end-effector motion is defined by the relative motion between the two end-effectors.Thus, using a relative Jacobian, the impedance controller is reduced to a single controller for both arms.Two different arms are used to perform a writing task, in which one arm holds a plate while the other writes on it.
In the context of human-robot interactions, Sieber et al. [19] propose the use of an impedance controller in a manipulation task performed by a team composed of a human and multiple robots.By means of a master-slave architecture, the human coordinates the robots formation, and the desired trajectory is designed according to the manipulated object geometry.However, small deviations in the trajectory result in internal forces, and thus impedance controllers are used in each manipulator to prevent damages either to the robots or to the object.A major drawback of that work is that only the end-effectors positions are considered, therefore the internal torques due to orientation uncertainties are not explicitly taken into account.
More concerned with multiple tasks, Hoffman et al. [20] propose a multi-priority impedance controller that considers task priorities inside a Quadratic Programming (QP) optimization framework that allows equality and inequality constraints.This architecture is useful when more than one task must be dealt with simultaneously, such as controlling the end-effectors of a humanoid robot while keeping the balance.Moreover, equality and inequality constraints enable the definition of joint limits, collision avoidance, etc., directly in the control law.
Admittance controllers, which are dual to impedance controllers, have also been used in applications where the manipulator physically interacts with the environment.Throughout the literature, admittance controllers have been called position-based impedance controllers, velocity-based impedance controllers, or, ambiguously, impedance controllers [21].Currently, a more widely accepted definition is that impedance controllers are the ones in which the robot velocity is measured, yielding a wrench as a control signal.Conversely, in admittance controllers, a contact wrench is measured and mapped to a velocity that must be imposed to the robot [21].
Thanks to the ability to handle stiff impedances in addition to enabling non-back drivable and heavy robots to have a compliant behavior, admittance controllers are often used in wearable and industrial robots [21,22].Navarro et al. [23] propose an adaptive damping controller (a special type of admittance controller) that fulfills the ISO10218, a standard that has some requirements to guarantee safety in human-robot interactions with industrial robots.The controller was validated on a manipulator equipped with a robotic hand in a collaborative screwing application.Cherubini et al. [24] developed a collaborative human-robot manufacturing cell for homokinetic joint assembly, in which pre-taught trajectories are deformed to comply with external wrenches using an admittance controller.As a result, the human workload is reduced, and a risk analysis indicates that their approach is compatible with safety standards.
Tarbouriech et al. [25] propose an admittance controller for a collaborative dual-arm manipulation of bulky objects.Computer vision is used to detect where the human is in contact with the object, and an admittance controller makes the bimanual manipulator move according to this information.As the gravity effects are canceled during the manipulation, the human makes an effort only to move the object, without needing to sustain it.Agravante et al. [26] combine a visual servoing controller to an admittance controller to achieve a human-robot collaborative task of carrying a flat surface while preventing an object on top of it from falling.Since they used Euler angles to represent orientations, the controller is restricted to small rotations due to representational singularities [27].
To avoid the representational singularity problem when performing six-degree-of-freedom (DOF) impedance/ admittance control, Caccavale et al. [4] propose to use the imaginary part of a unit quaternion to represent rotations and formulate a geometrically consistent stiffness for infinitesimal displacements.Notwithstanding, they use two distinct control laws for the position and orientation, and their approach presents the topological obstruction problem [28], which may trap the closed-loop system within an unstable equilibrium set.That work is later extended [5] to propose a controller in which the stiffness is proved to be geometrically consistent for finite displacements.Caccavale et al. [5] applied that controller in a dual-arm manipulation, considering internal and external wrenches.Nonetheless, the new controller still carries the topological obstruction issue.

Adaptive Controllers
Since common admittance controller architectures rely on inner motion controllers, special care must be taken if the robot is torque-actuated because the JSIM may be ill-conditioned, as discussed in the previous section.To overcome this drawback, we propose to use an adaptive controller that adjusts the JSIM conditioning online, thus improving the closed-loop performance.
Although adaptive control has been extensively studied, very few authors have tackled the problem of adapting the JSIM conditioning.For instance, Slotine and Li [29] propose an adaptive control law for robots with dynamics uncertainties.Moreover, they show that although the estimated parameters do not converge to the real parameters, the closed-loop system is asymptotically stable.They first address the problem in joint space and then extend the solution to the Cartesian space.
Cheah et al. [30,31] extend the work of Slotine and Li [29] to tackle not only dynamic but also kinematic uncertainties.They show that the robot end-effector can converge to the desired trajectory, despite the uncertain dynamic and kinematic parameters, which are updated online by adaptive laws.Liu et al. [32] propose a task-space adaptive Jacobian controller that is asymptotically stable in the Lyapunov sense and consider the dynamics, kinematics, and also the actuator dynamics, which was not considered by any of the previous works.
Passivity-based adaptive controllers, such as the ones proposed by Slotine and Li [29] and Cheah et al. [30,31], rely on approximate transpose-Jacobian feedback to track the manipulator end-effector [33].Although those controllers achieve asymptotic stability, their performance is not good over the entire robot configuration space.Since the closed-loop response varies with the manipulator configuration [33], it is not possible to define fixed gains that result in fixed closed-loop poles.Moreover, those controllers lead to nonlinear and coupled error dynamics, and thus it is hard to quantify the system performance.Controllers based on the inverse dynamics, on the other hand, yield linear and decoupled error dynamics when the robot parameters are perfectly known.Thus, Wang and Xie [33] propose an adaptive inverse dynamics controller for robots with unknown dynamic and kinematic parameters, but the controller requires the measurements of the joints accelerations, which are not necessary for the passivity-based controllers.As a result, the adaptive inverse dynamics controller is more sensitive to noise.
Both passivity-based and inverse-dynamics based adaptive controllers use the fact that both kinematic and dynamic models are linear in the parameters and utilize a regressor in the parameter update laws.However, computing the regressor matrix is expensive for manipulators with a high number of DOF.Thus, Hanlei [34] proposes a computationally efficient adaptive control law based on the Newton-Euler recursive algorithm.
Passivity-based controllers have some advantages when compared to inverse dynamics controllers.For example, they do not require the inversion of the estimated inertia matrix.However, those laws usually do not guarantee that the estimated inertia matrix is positive definite, which results in physically inconsistent results, or even well-conditioned [35].To overcome the lack of positiveness guarantee, one strategy is to ensure that the estimated parameters are positive to obtain a positive definite estimated inertia matrix.This can be done by defining an appropriate convex region, whose interior defines the set of admissible positive parameters, and then using a projection algorithm to ensure that the parameters remain inside that region [30].Nevertheless, in discrete implementations, the estimated parameters may escape from that region, thus Wang and Xie [35] propose an approach that guarantees the positiveness of the estimated parameters while retaining the stability of the closed-loop system.Still, they observed that when the parameter update is too fast, the algorithm cannot project the estimated parameters into the region of admissible parameters.
Despite the vast literature on adaptive control, to the best of our knowledge, none of them consider the improvement of the JSIM conditioning.

Statement of Contributions and Organization of the Paper
We propose a task-space admittance controller with adaptive inertia matrix conditioning that consists of: -an admittance controller using the dual quaternion (DQ) logarithmic mapping in the outer loop to improve the interaction between the robot and the environment, imposing a desired impedance behavior; -a task-space adaptive controller (TAC) in the inner loop that ensures the improvement in the JSIM's conditioning.
We also present experimental results and rigorous statistical analyses, based on a hypothesis-testing framework, to compare the performance of the proposed architecture (admittance + TAC) with two classic controllers used in the inner loop, together with the admittance controller in the outer loop: an inverse dynamic with feedback linearization (TIDFL) controller and a PID with gravity compensation (TPID).
Furthermore, our approach is free from topological obstructions, in which the closed-loop system can be trapped into unstable equilibria, and is simple to implement.
This work builds upon our previous works [13,14], in which we have proposed a joint-space adaptive controller to compensate for the uncertainties introduced by a matrix that we add to the JSIM to improve its conditioning.The current approach extends those previous works to the taskspace and integrates it to a task-space admittance controller that we have briefly introduced as an extended abstract in the Workshop Applications of Dual Quaternion Algebra to Robotics, which happened at ICAR 2019 [7].
The paper is organized as follows.Section 2 presents a brief mathematical background, whereas Section 3 presents the admittance control law using the DQ logarithmic mapping.Section 4 introduces the TAC and the two other taskspace motion controllers that are used for comparison purposes, namely TIDFL and TPID.Section 5 presents the experimental results as well as the statistical analyses comparing the three controllers.Finally, Section 6 presents the final remarks and perspectives of future works.

Mathematical Background
When designing task-space controllers, the mathematical representation of rigid motions plays an important role, since a poor choice may lead, for instance, to representational singularities [27].In the last decades, several works have shown that dual quaternion algebra presents several advantages over other mathematical tools for robot modeling and control, most notably when the task-space is considered [36].For instance, unit dual quaternions have a compact representation, requiring only eight parameters, whereas homogeneous transformation matrices (HTM) need twelve if the fourth constant row is discarded, presenting thus a smaller computational effort concerning multiplications and additions.Moreover, the unit DQ does not have representational singularities, as well as the HTM, and the coefficients of a DQ can be used directly in the control law.This is a great convenience since the use of other traditional methods based on HTM may require the extraction of geometrical parameters, which in turn can lead to representational singularities.Another advantage of DQ is the fact that it has strong algebraic properties and can be used to represent, in addition to rigid motions, wrenches, twists, and geometric primitives such as Plücker lines and planes.[37] Thanks to the aforementioned advantages, we use dual quaternion algebra throughout the paper.

Quaternions and Dual Quaternions
Quaternions can be understood as an extension of imaginary numbers, in which the three imaginary components obey [38] and the set of quaternions is defined as Given H h = h 1 + îh 2 + ĵh 3 + kh 4 , the real part of h is Re (h) h 1 , and Im (h) îh 2 + ĵh 3 + kh 4 is the imaginary part, such that h = Re (h) + Im (h), whereas the quaternion conjugate is given by h * = Re (h) − Im (h).The subset of pure quaternions is defined as H p {h ∈ H : Re (h) = 0}, and the subset of unit quaternions is defined as The multiplication between real matrices and quaternions is sometimes necessary, and thus appropriate operators are needed.Given H h = h 1 + îh 2 + ĵh 3 + kh 4 , the operator vec 4 : H → R 4 is defined as such that, given a, b ∈ H, the Hamilton operators Moreover, given H p p = îp 1 + ĵp 2 + kp 3 , the operator vec 3 : H p → R 3 is defined as Analogously to quaternions, the dual quaternion set is defined as where ε is the nilpotent dual unit [40].The subset of pure DQ is defined as whereas the set of unit DQ is defined as S h ∈ H : hh * = 1 , in which h * = h * 1 + εh * 2 [37].The set S equipped with the standard multiplication form the group Spin(3) R 3 of rigid motions [41].

Dual Quaternion Logarithmic Mapping
Considering a translation p = îp x + ĵp y + kp z ∈ H p and a rotation r = (cos (φ/2) + n sin (φ/2)) ∈ S 3 , with φ ∈ [0, 2π) being the rotation angle around the rotation axis n = în x + ĵn y + kn z ∈ S 3 ∩ H p , the unit DQ x ∈ S that combines both p and r is given by whose logarithm is [39] The DQ logarithmic mapping can be used to translate the spacial difference x c d x * c x d between two poses x c , x d ∈ S, as in (9), to the origin [42].More specifically, Moreover, letting y log x, the time derivatives of y and x are related by means of the matrix Q 8 x ∈ R 8×6 as [43] vec where vec 8 (•) and vec 6 (•) transform the DQ into a vector, as in ( 5) and ( 6), respectively, and with 0 m×n ∈ R m×n being a matrix of zeros, + H + 4 (•) being the Hamilton operator as in (2), and with I m ∈ R m×m being the identity matrix.In addition, where r i is the ith component of the quaternion r, and The generalized wrench log ∈ R 6 related to the logarithm is given by log G T log x ς, (17) where , where Ī 3×4 0 3×1 I 3×3 .

Admittance Control Law
In order to have a safe interaction between a robot manipulator and the environment, we propose a control architecture that guarantees a compliant behavior while achieving good end-effector pose accuracy.To obtain a compliant behavior on industrial manipulators, admittance controllers are frequently used since those robots are usually characterized by a stiff and non-backdrivable mechanical structure [44], in which an admittance controller ensures better performance than impedance controllers [21].Moreover, when a high positioning accuracy is desirable, an admittance controller is also more adequate as it usually achieve smaller steady-state errors in the end-effector pose than impedance controllers.Thus, aiming at high accuracy and a compliant behavior of industrial manipulators, an admittance controller is more adequate and hence used in this paper.
Considering the desired end-effector pose x d ∈ S, our proposed architecture consists of an admittance controller in the outer loop that modifies x d according to the external wrench, which is measured at the robot end-effector, and outputs a compliant pose x c ∈ S that satisfies the desired apparent impedance.A torque motion controller is used in the inner loop to control the end-effector pose according to the reference trajectory given by x c , as illustrated in Fig. 1.
Analogously to the work of Caccavale et al. [4], the desired apparent impedance is achieved by imposing the closed-loop dynamics given by where M d , B d , K d ∈ R 6×6 are the apparent desired inertia, damping, and stiffness positive definite matrices, y c d vec 6 log x c d ∈ R 6 in which the logarithm is given by ( 10), with S x c d x * c x d .The external generalized wrench, with respect to frame F c , transformed to be consistent with the logarithmic mapping according to (17) is given by . Since the wrench ς eff ∈ R 6 read by the force/torque sensor at the robot end-effector is given with respect to the end-effector frame, the transformation to express it in the compliant frame F c is given by where r c eff = r * c r eff , with r eff ∈ S 3 being the orientation of the end-effector with respect to the fixed reference frame, and vec 6 (•) being the operator defined in (8).
The admittance controller is dual to the impedance controller, in which the contact wrench is measured and the controller output is the acceleration.Thus, the admittance control law is given by Fig. 1 Scheme illustrating the closed-loop system composed of an outer loop with an admittance controller and an inner loop with a torque controller

Trajectory Generation
The displacement x c d and its first and second time derivatives are found by integrating ÿc d twice and using the relations (11), its derivative, and x c d = exp y c d , where exp (•) is the exponential of a pure DQ that satisfies x = exp log x [37].More specifically, the time derivative of ( 11) is where Q8 x c d is the time derivative of ( 12) and given by where Q p is given by ( 13), E(x, ẋ) x + γ 2n x ṅx + ˙ γ n x n y + γ ṅx n y + γ n x ṅy γ n x n z + γ ṅx n z + γ n x ṅz γ n y n x + γ ṅy n x + γ n y ṅx γ n 2 y + γ 2n y ṅy + ˙ γ n y n z + γ ṅy n z + γ n y ṅz γ n z n x + γ ṅz n x + γ n z ṅx γ n z n y + γ ṅz n y + γ n z ṅy γ is the time derivative of ( 14), with , otherwise, being the time derivative of ( 15) and ( 16), respectively.Hence, the compliant trajectory x c (t) and its derivatives ẋc (t) and ẍc (t) are given by where x c d and its derivatives are retrieved by using the operation (7).This trajectory is the input of the motion controller, aimed to control the end-effector pose.

Motion Control Laws
As our proposed architecture includes a motion control law in the inner loop, we need to define a motion controller that accurately tracks the reference trajectory to ensure the apparent admittance in the outer loop and, as consequence, guarantee safety.As we assume complete knowledge of the robot dynamic model, the motion control laws proposed in our work are based on it.Those control laws are designed from the Euler-Lagrange equation, which is given by [45] M (q) q + C (q, q) q + g (q) = τ , (19) where q ∈ R n is the vector of joint configuration, M (q) ∈ R n×n is the inertia matrix, C (q, q) ∈ R n×n contains the Coriolis and centrifugal terms, g (q) ∈ R n is the gravity vector, τ ∈ R n is the vector of generalized torques applied to the joints, and n is the number of DOFs.
We discuss, in the following, an adaptation of two classic task-space motion controllers that are based on (19) and on the differential forward kinematics; namely, the task-space inverse dynamics with feedback linearization (TIDFL) and task-space PID controller with gravity compensation (TPID).The adaptation consists of using unit DQ to represent the end-effector pose, which offers some advantages, as discussed in Section 2.Then, we propose an adaptive controller to improve the JSIM conditioning.

Task-Space Inverse Dynamics with Feedback Linearization
One common task-space controller for torque-actuated robots is based on the inverse dynamics with feedback linearization [45]; that is, u = M (q) a q + C (q, q) q + g (q) , (20) where the control input u τ ∈ R n is applied to the joints and a q q ∈ R n is the control input designed to stabilize the linearized closed-loop system.
Since we seek a task-space controller, the control law for the linearized closed-loop system is defined as where J + is the Moore-Penrose pseudoinverse of the Jacobian matrix J ∈ R 8×n and a x vec 8 ẍ is given by where K D , K P , K I ∈ R 8×8 are positive definite gain matrices and x x −x c denotes the end-effector error, with x c ∈ S ⊂ H being the compliant end-effector pose [46].The torque of each joint calculated from (20) can be very disparate due to the difference in the singular values of M (q), leading to poor closed-loop behavior, as we show in the results in Section 5.For instance, if the configurationdependent inertia along a specific joint is very small, no matter how large the position/velocity error or PIDcoefficients are, the correction torque applied on that joint will be still small compared to the dominant torque, which may result in some undesired stationary error [11,14].

Task-Space PID Controller with Gravity Compensation
To improve the closed-loop system dynamic behavior in joint space, Shen and Featherstone [11] propose to use a PD with gravity compensation, which is proved to be stable [46], as it directly converts the joint-space error to the joint torques, without using the JSIM, and therefore is not affected by its ill-conditioning [11].We adapted their controller to be in task-space and use unit DQ to represent the end-effector pose.Moreover, we added an integral term to it.Thus, the TPID is given by u = J + a x + g (q) , (23) with a x given by ( 22).Shen and Featherstone [11] emphasizes that, although controllers such as (23) do not use the JSIM, which mitigates the problem caused by the JSIM ill-conditioning, a controller that takes into consideration the whole dynamic model of the system should achieve better accuracy.

Task-Space Adaptive JSIM Conditioning Controller
Targeting a task-space control law that is able to achieve a good accuracy by using torque inputs, an adequate alternative to the previously widely used control structures is to use an adaptive controller in which a carefully chosen positive definite matrix D ∈ R n×n is added to the JSIM to improve its conditioning without adding excessive inaccuracy to the nominal model.Since the inertia matrix depends on the robot configuration, it is difficult to choose D beforehand, and thus it should be adapted during the robot motion, which motivates the use of an adaptive controller.
A typical adaptive controller is composed of a control law and an adaptation law.Thus, assuming full knowledge of the robot kinematics and dynamics, and that only the matrix D needs to be estimated, we propose a task-space adaptive control law based on the one by Cheah et al. [31], which is given by u = J T a x + v q, q, qr , qr + Y q, qr â, where a x is given by ( 22), v q, q, qr , qr ∈ R n is a vector containing the known dynamic model-i.e., v q, q, qr , qr = M (q) qr + C (q, q) qr + g (q)-, where qr = J + vec 8 ẋr , qr = J + vec 8 ẍr − J q , in which vec 8 ẋr = vec 8 ẋc − α vec 8 x, vec 8 ẍr = vec 8 ẍc − α vec 8 ẋ, with α being a positive constant.The matrix Y q, qr ∈ R n×n is the regressor that depends on the choice of D and on the parameter vector â ∈ R n to be estimated.

Adaptive JSIM Conditioning
In order to define the adaptation law, we first choose the positive definite matrix D that is added to the JSIM aiming to improve its conditioning. 1Therefore, knowing that the inertia matrix M M (q) can be decomposed into M = USU T , where each column u i , with i ∈ {1, . . ., n}, of U ∈ O (n) contains the left singular vectors of M and S ∈ R n×n contains the singular values of M [47], we define D = UDU T as a positive definite matrix, where R n×n D = diag(d 1 , . . ., d n ) is a suitable diagonal matrix [13].
Since the condition number of M is given by cond (M) σ 1 M /σ n M , where σ 1 M and σ n M are the maximum and minimum singular values of M, respectively, thus If cond(M + D) < cond(M), then Therefore, for the condition number of the sum M + D be smaller than the one of M, the matrix D must be better conditioned than M [13].
Considering the robot dynamic model (19) in which the matrix D is added to the nominal JSIM, and knowing that the model is linear in a set of parameters and its linear combinations [30], we can write M (q) + D qr + C (q, q) qr + g (q) = M (q) qr + C (q, q) qr + g (q) v(q, q, qr , qr ) + Y q, qr a, which implies Y q, qr a = D qr , with a ∈ R n being the vector of parameters.
In (24), the vector â contains the estimated values of a, and thus the goal is to enforce Y q, qr â = D qr , with â = â1 • • • ân T being the singular values of D. Since the regressor is given by Y q, qr = y 1 • • • y n , where y i = u i u T i qr .In order to enforce the estimated parameters in â to be positive and also to have a matrix D that fulfills condition (25), we first define a convex region corresponding to the admissible parameter set [35].Thus, variable lower (β min ) and upper (β max ) bounds are defined as a function of the singular values of the JSIM such that σ n M < β min = β max < σ 1 M .The convex region of admissible parameters is defined as [13] η min ≤ â ≤ η max , where with 1 n being an n-dimensional vector of ones, and δ (β max − β min )/n; therefore, the estimated singular values are decreasingly ordered and between the upper and lower bounds.The regions with the estimated parameters are illustrated in Fig. 2.
The adaptation law is defined as where ν = −LY q, qr T s is the nominal adaptive law, with s q − qr being the slide vector, defined to restrict the error to a sliding surface [29], L ∈ R n×n is a diagonal positive-definite matrix that determines the convergence rate of the adaptive parameters, and I n ∈ R n×n is the identity matrix.The matrix P = diag (p 1 , . . ., p n ), where is used to determine if a given parameter shall be projected onto the border of the region, = diag (λ 1 , . . ., λ n ) with λ i ∈ (0, ∞) is used to accelerate the convergence of each parameter to the boundary of , and ρ = [ρ 1 , . . ., ρ n ] T with ρ i = sgn(η min,i − âi ) is used to choose the direction of convergence, as illustrated in Fig. 3.

Experimental Results and Discussions 2
To evaluate the proposed technique, we performed experiments on a KUKA LWR4+ robot manipulator equipped with a computer with two Intel Xeon 2.4 GHz hexacore processors with 32 Gbof RAM each, and an Anarchy Linux version 1.4 (Linux 4.19.50-rt22-2-rt-lts), with a 64-bit x86 architecture, using the C++ version of the DQ Robotics library [36].The robot is equipped with one ATI Mini 45 force/torque sensor at its end-effector, and it only reacts to wrenches applied at the end-effector.
Since we use a KUKA LWR4+ API3 that provides measurements only of joint angles, the joint velocity and The experiments were run with a sampling time of 5 ms.The parameters of the adaptive controller, given by ( 24) and ( 26 T , and the robot dynamic model was obtained from [48].For the outer loop, the matrices in (18) were chosen empirically as M d = 1.5I 6 , B d = 300I 6 , and K d = 100I 6 .

Choice of Gain Matrices
Since manipulation tasks are typically described in the taskspace, that is, in terms of physical entities related to the endeffector (e.g., pose, wrench, twist), task-space motion controllers are more appropriate than joint-space motion controllers because no explicit inverse kinematics is required.However, the choice of gains for a task-space motion controller, when based on the transpose of the Jacobian matrix, as in (24), is not straightforward because the closedloop response tends to be very abrupt for large errors and extremely slow for small errors [49].Therefore, a variable gain matrix is desirable to ensure a more uniform behavior.
Since there is a relationship between the task-space and the joint-space closed-loop gains [49], one strategy is to define the desired dynamic behavior in joint-space (e.g., exponential decay) and use that relationship to ensure a similar performance in the task-space, regardless if the transpose of the Jacobian matrix is used, as in (24), or if the pseudoinverse of the Jacobian matrix is used, as in ( 23) and (21).When using the latter, this transformation is given by whereas when using the former, the relation is given by where K and K q are the task-space and joint-space gain matrices, respectively [49].Suppose we consider the desired equivalent joint-space error dynamics as q + K D q q + K P q q = 0, (29) where q is the joint-space error and K D q = diag k D q 1 , . . ., k D qn and K P q = diag k P q 1 , . . ., k P qn are the derivative and proportional diagonal positivedefinite joint-space gain matrices.Since the gain matrices are diagonal, the closed-loop system is uncoupled with n independent characteristic equations such as Fig. 3 If the estimated parameter âi is outside the region and the update ν makes it to remain outside, then p i = 0 and the parameter will be projected onto the border of the region.The direction of the projection is defined by ρ i , which is changed whenever âi is smaller or larger than η min,i .If p i = 1, then the nominal adaptation law is used for all i ∈ {1, • • • , n}, with two roots given by 2 and thus the solution to ( 29) is given by Hence, the error decreases exponentially.Thus, we have chosen the equivalent joint-space gains as K D q = 10I 7 and K P q = 25I 7 , for all torque controllers, which satisfies the relation k 2 D q i = 4k P q i , for all i ∈ {1, . . ., n}, and the integral gain has been chosen empirically as K I q = 10I 7 .Consequently, as we wish a dynamic behavior equivalent to q + K D q q + K P q q = 0, the gains K P , K I , and K D for the controllers ( 20)-( 22) and ( 23) have been found by using the transformation (27).Similarly, the equivalent task-space gains for the controller ( 24)-( 26) are found according to the transformation (28).

Experiments with an External Wrench
We performed experiments with an external wrench acting at the robot end-effector to show that the robot behaves compliantly, and also to compare its behavior when different inner motion controllers are used, namely the TIDFL (20), the TPID (23), and the TAC (24).Consider x c (0) = x d (0) = x (0), where x (0) is the initial robot endeffector pose and the robot initial configuration q(0) = 0 0.5 π/2 −π/2 0 0 0 T is shown in Fig. 4a.At the beginning, an object with mass of 0.44kg was placed onto the end-effector.Thus, assuming an initial condition in which the robot is at rest with no external wrench exerted at the end-effector, in our experiment, the external wrench was then produced by the effect of gravity on the object.More specifically, the object's weight produced a wrench at the end-effector, which moved complacently.To ensure the desired apparent impedance, the compliant reference pose x c deviated from x d but the inner-loop controller ensured Fig. 4 Snapshots of the experiment with an object exerting a wrench at the end-effector.In the first row, the object is on the end-effector, which moves complacently due to the gravitational force.In the second row, the object is removed and the end-effector returns to the desired pose Fig. 5 External wrench acting at the end-effector the end-effector tracking of the trajectory given by x c (t). 4After 35 s the object was removed and because there was no external wrench acting at the end-effector, it returned to the desired pose, as shown in the snapshots of Fig. 4. The external wrench for all three controllers are shown in Fig. 5.The larger force in the z-axis, close to −4.5 N, corresponds to the force exerted by the object due to the gravity.Because the end-effector moves slightly differently depending on the controller used in the inner loop, the measured wrenches are different for each one of them.
Given the DQ of the current end-effector pose x, the compliant pose x c , and the desired pose x d , the corresponding axis-angle and translation components (e.g., φn = φn x î + φn y ĵ + φn z k and p = p x î + p y ĵ + p z k) are shown in Fig. 6, for all three controllers.(Given x, the axis-angle and translation information are obtained as 2 log x = nφ + εp-the same is done for x c and x d .)As predicted by the theory, the compliant trajectory is different from the desired one when a wrench acts at the end-effector but, otherwise, they are equal.
By inspection, the TIDFL controller performed worst as the current end-effector pose, and specially the translational component, did not track x c as well as the other two controllers.The error norm for all controllers is shown in Fig. 7 and indicates that the TIDFL had larger error norm during the whole experiment, which corroborates the worst behavior in Fig. 6.
Figure 8 presents the condition number of the JSIM for the TIDFL and the condition number of the resultant matrix M + D for the TAC.Furthermore, since the trajectory generated by the TAC can be different from the one generated by the TIDFL, Fig. 8 also shows the conditioning of the nominal JSIM throughout the trajectory generated by the TAC.As predicted by theory, the conditioning of M + D is always better than the conditioning of M because smaller condition number implies better conditioning.

Experiments in Free-Motion
The analysis of the movement under an external wrench is limited since it requires the same applied wrench for all compared controllers, which is difficult to achieve, as illustrated in Fig. 5. Therefore, deeper analyses were made in free-motion, with the outer loop controller being the same in all experiments, given by (18).As a way to see if there is a significant difference between the performance of the three controllers in the inner loop-namely, (20), (23), and ( 24)-( 26)-, statistical analyses were performed, which consisted of: Analysis 1: analysis of the error; Analysis 2: analysis of the control signal.

Statistical Methodology
In the statistical analyses presented in the next sections, the following definitions are used: p-value, which is the lowest significance level that would lead to the rejection of the null-hypothesis H 0 .This means that the null-hypothesis is rejected if and only if the p-value is smaller than the significance level α analysis , which is the probability of occurrence of a false positive; power of the test, which is given by 1 − β analysis , where β analysis is the probability of occurrence of a false negative; minimally interesting effect, which is the smallest difference between the controllers we are interested in detecting, regarding each one of the Analyses 1 and 2.
The null-hypothesis we want to verify is if the controllers are statistically equivalent (by comparing their population distribution means) concerning the control signal effort and specially the error decay.A false negative is a result that  indicates the controllers are statistically equivalent when they are not.A false positive occurs when the null-hypothesis is rejected even if it is true.All statistical analyses are made in R [50].

Definition of the appropriate number of samples
In order to compare each controller and identify which one presents the best performance, we performed three t-tests, all against all, for Analysis 1 and Analysis 2. The desired characteristics for the analyses were chosen as: -significance level of α analysis = 0.05; -power of 0.85; -and the minimally interesting effect as described in Table 1, where δ , δ μ , δ max are, respectively, the minimally interesting effect for the total, the mean, and the maximum values of the error discrepancy and the control signal.
Since the number of samples necessary to run the statistical analyses is based on the variance of the data, which is unknown a priori, each of the three controllers was initially run 30 times.Given an initial pose x (0) = x c (0) = x d , different desired poses were generated randomly, but being the same for each controller to allow a fair comparison.Thus, to generate these 30 pairs of initial/final poses, first, three different initial configurations q 0 were arbitrarily chosen and, for each one, ten desired joint configurations were generated according to a normal distribution N q 0 , 0.5 , and the initial and desired end-effector poses were found using the robot forward kinematics.
After using the Fligner-Killeen Test of homogeneity of variances [51] in the collected data we concluded that the variance for all the controllers were not the same, since the p-values for each analysis are very small, as shown in Table 2, except for the control effort and the mean value of the control signal.Therefore, the null-hypothesis that the variances are equal is false.Hence, we used the Welch Two Sample t-test, which is a modification of the Student's t-test used when the variance is not equal among all the populations.In this test, the null hypothesis and the alternative one are defined as [52] H where μ i , for i = 1, 2, are the population distribution means.
Considering the three Welch Two Sample t-tests, the computation of the number of samples was done using the mean value of the standard deviation of all three controllers results and the significance level adjusted for three comparisons, according to the Bonferroni correction for the value of α analysis , that is, [52] where K = a (a − 1) /2, with a being the number of controllers, which in our case is equal to 3. Finally, the number of samples was calculated using the two-sample ttest power calculation available in R, resulting in a value lower than 30.Hence, the analyses were made with the 30 samples already collected.

Statistical Analyses of the Error
Given a discrepancy function defined as d (t) vec 8 x (t) , with x (t) x (t) − x c (t), the first analysis concerns the total discrepancy, given by for T = 75 s.Fig. 9a shows the box-plot of the total discrepancy, in which the TIDFL presents the largest value compared to the other controllers.The TPID and the TAC presents similar values, although the error for the TAC is slightly larger.The same is observed for the mean value (Fig. 9b) and maximum discrepancy values (Fig. 9c).
The p-values for all the comparisons are described in Table 3, in which bold values mean that the p-values were smaller than the adjusted significance level α adj = 0.0167 given by (30), indicating that the null-hypothesis is rejected; that is, the difference in performance is statistically significant in these cases.Therefore, both TPID and TAC had different performances when compared to TIDFL.However, when comparing the TPID to the TAC, the pvalues were larger than α adj for all criteria, which means that there is no statistically significant difference between TPID and TAC with respect to trajectory tracking.
We conclude that the TPID and the TAC are statistically equivalent since the null-hypotheses are not rejected when those two controllers are compared, as shown in Table 3.Moreover, both controllers presented a better performance than the TIDFL, which is indicated by the large discrepancy values for the later, as shown in Fig. 9, and by the rejection of the null-hypotheses when comparing all controllers versus the TIDFL.These results corroborate the work of Shen and Featherstone [11] and our previous work [13], in which the controller that uses the nominal JSIM has a poor behavior regarding the error dynamics.
In the TIDFL, the control input for the linearized taskspace dynamics, a x (22), is mapped to the joint-space through (21) and then multiplied by the JSIM.Therefore,  the torque applied to some joints may be attenuated if the inertia along these joints is very small, which may explain the poor closed-loop response when using the TIDFL.For the TPID and TAC, a x is mapped to the joint space without being multiplied by the JSIM, and therefore the control signal is not weakened, enhancing the close-loop error dynamics.Moreover, as predicted by the theory, the condition number of the closed-loop inertia matrix using our proposed algorithm (i.e., M + D), in all experiments, was always smaller than the condition number of the nominal inertia matrix (i.e., M).Since all the experiments showed results similar to the one depicted in Fig. 8, we have omitted the corresponding graphs for the sake of conciseness.

Statistical Analyses of the Control Signal
Similar analyses were done for the control signal u (t) of the inner loop controllers, where we evaluated the control effort given by T 0 u (t) 2 dt.Fig. 10a shows that the TAC presented the largest value, followed by the TPID and then the TIDFL.However, the TIDFL presented an outlier that is the largest value of all controllers.Fig. 10b indicates similar values for the mean value of u (t) for both TPID and TAC, but smaller values for the TIDFL, although the difference was not so significant as for the error discrepancy.Regarding the maximum value of u (t) , shown in Fig. 10c, the TPID presented the smallest median, although the largest variation, followed by the TAC and then the TIDFL.
Again, since the TIDFL generates a low-level control input that is multiplied by the JSIM, the control signal may be attenuated for some joints, which does not happen for the TPID and the TAC.This may explain the larger control signals generated by both TPID and TAC than the ones generated by the TIDFL, as observed in Figs.10a-b.Regarding Fig. 10c, the largest variation of the maximum value of the control signal for the TPID may be related to the absence of the JSIM in the control law.More specifically, the controller generates the control signal by using only partial information about the robot dynamic behavior, which may explain a larger variance of the maximum value for the control input throughout the configuration space.
Table 4 shows the comparisons regarding the control signal of the inner motion controllers, in which bold values indicate that the p-values were smaller than the adjusted significance level α adj = 0.0167.When the maximum control signal is considered, all null-hypotheses were rejected, which means that there is a statistical difference between all controllers.On the other hand, in terms of the mean value, there is no significant difference between the TPID and the TAC.Lastly, when the total discrepancy is considered, there is a statistical difference only between the TIDFL and the TAC.These results indicate that, although the error discrepancy is the worst for the TIDFL, the same cannot be said about the control signal.Indeed, Figs. 10a and b suggest that, in general, the TIDFL generates smaller control signals.This can be related to the use of the JSIM in the control law, which attenuates the control signal along joints that have smaller equivalent inertia.

Conclusion and Final Remarks
This paper proposed a task-space admittance controller with an adaptation of the JSIM conditioning.The architecture consists of an admittance controller in the outer loop, to ensure a compliant robot behavior in case of interaction, and an adaptive motion controller in the inner loop that guarantees that the adapted JSIM is always better conditioned than the nominal one throughout the whole robot configuration space.The controllers are based on DQ algebra, which prevents the occurrence of representational singularities.Moreover, this architecture was compared with one in which the motion controller in the inner loop is replaced by other two widely used motion controllers, namely the TIDFL and the TPID.Statistical analyses were performed with the robot in free-motion to evaluate the tracking error and the control signal.The results of the Welch t-tests, together with the explanatory analyses, showed that the TIDFL presented the worst behavior regarding the error dynamics, whereas the TPID and the TAC presented similar results.This situation can be explained by the ill-conditioning of the inertia matrix.If the inertia along specific joints is very small, no matter how large the position/velocity error or PIDcoefficients are, the correction torques generated by the TIDFL will be still small because they lie in the range space of the JSIM, which may be ill-conditioned and thus attenuate the control signals associated to small eigenvalues.For the TPID and TAC, the low-level control inputs are not multiplied by the JSIM and thus are not attenuated, alleviating the problem.
Experiments done under a contact wrench acting on the end-effector showed that the robot moves compliantly according to a desired apparent impedance, which is imposed by the admittance controller in the outer loop.Both TPID and TAC followed the compliant trajectory, much more accurately than the TIDFL.
The proposed admittance controller, although simple and effective, has a stiffness term that is geometrically inconsistent with the six-DOF tasks.Moreover, it suffers from the unwinding phenomenon, in which the end-effector pose may be close to the desired pose and yet rotate through large angles before reaching the equilibrium [28].Furthermore, the adaptive controller has shown good results, but we have not proved the system closed-loop stability, which is an ongoing work.Due to the insertion of disturbances in the inertia matrix during the adaptation law, the steady-state error may be affected, especially if the JSIM conditioning is overly changed.
Future works will be focused on the formal proof of closed-loop stability when using the proposed algorithm, taking into consideration the effects of the added matrix in the control performance.Moreover, the outer loop will also be modified to deal with the unwinding problem and to use a stiffness matrix that is geometrically consistent with the task.

Fig. 6 Fig. 7
Fig.6 Coefficients of 2 log x, 2 log x c , and 2 log x d , indicating the rotation around the axes x, y, and z (first row), and the translation along each each axis (second row)

Fig. 8
Fig.8 Condition number of the nominal M for the TIDFL and the TAC, and of the resultant matrix M + D. The smaller the number, the better

Fig. 9
Fig. 9 Error discrepancy: (a) integral of the discrepancy function along the motion, (b) mean value of the function, and (c) its maximum

Fig. 10
Fig. 10 Inner loop control signal: (a) control effort throughout the motion, (b) mean, and (c) its maximum value

Table 1
Minimally interesting effect for each analysis

Table 2
Fligner-Killeen test of homogeneity of variances

Table 3 p
-values for the Welch t-test all against all, regarding the error discrepancy

Table 4 p
-values for the Welch t-test all against all, regarding the control signal