Energy budgets for coordinate invariant robot control in physical human–robot interaction

In this work we consider the current certification process of applications with physical human–robot interaction (pHRI). Two major hazards are collisions and clamping scenarios. The implementation of safety measures in pHRI applications typically depends strongly on coordinates, e.g., to monitor the robot velocity or to predict external forces. We show that the current certification process does not, in general, guarantee a safe robot behavior. In particular, in unstructured environments it is not possible to predict all risks in advance. We therefore propose to control the energy of the robot, which is a coordinate invariant entity. For an impedance controlled robot, the total energy consists of potential energy and kinetic energy. The energy flow from task description to physical interaction follows a strict causality. We assign a safe energy budget for the robot. With this energy budget, the presented controller auto-tunes its parameters to limit the exchanged kinetic energy during a collision and the potential energy during clamping scenarios. In contact, the robot behaves compliantly and therefore eliminates clamping danger. After contact, the robot automatically continues to follow the desired trajectory. With this approach the number of safety-related parameters to be determined can be reduced to one energy value, which has the potential to significantly speed up the commissioning of pHRI applications. The proposed technique is validated by experiments.


Introduction
Despite the prognosis of market researchers, collaborative robots are still a minority in the industrial sector. While 400,000 industrial robots were installed in 2018 (International Federation of Robotics, 2019a), only 12,000 professional service robots were sold in the same year 1 (International Federation of Robotics, 2019b). One reason is the extensive and complicated certification process required to integrate a collaborative robot in a manual work process. The process usually begins with a virtual set-up in simulation. First risk assessments have to be performed to identify possible hazards for the human when entering the robot workspace (International Organization for Standardization, 2010Standardization, , 2011. The desired result of the risk assessment is to define how likely it is that the hazards harm the human and to provide measures to minimize these risks. Next, the real robot is installed and programmed with a range of velocities. After the robot process is implemented, the impact force of the robot in case of a collision is verified with a measurement device (Dombrowski et al., 2018). The international standard ISO/TS 15066 (International Organization for Standardization, 2016) defines bio-mechanical limits for each body region of the human. Thresholds are defined for two different contact scenarios: transient contact (i.e., collision) and quasi-static contact (i.e., clamping). A collision is a dynamic impact 1 with the moving robot. A clamping scenario occurs when a robot continues to follow a pre-planned trajectory even though an obstacle has been encountered. In the risk assessment, the programmer of the robot application has to decide which contact scenario is likely to occur. Moreover, for each part of the robot application the affected body regions have to be identified. In an iterative manner, the robot velocity is reduced until no bio-mechanical threshold is violated ( Figure 1).
Typical robot controllers are divided into two successive stages: motion planning and motion execution. During motion planning, a reference trajectory is computed for every robot joint. The result is then passed to the motion execution stage, during which the planned joint trajectories are tracked as accurately as possible (Siciliano et al., 2009). For physical human-robot interaction (pHRI), these controllers rely on the prediction of robot collisions with the environment (Bergner et al., 2019;Lee and Song, 2015;Phan et al., 2011). As the reference trajectory cannot be modified during motion, the robot executes a stop reaction if a safety-related signal exceeds a pre-defined threshold (e.g., the distance between robot and environment is too small or the collision force with the environment is too large). In ISO 10218-1 (International Organization for Standardization, 2011) robot motion is defined as the main risk source for the human. Therefore, only stop reactions are considered to be safe. For constricted workspaces, where the robot and human work closely together, this can easily lead to clamping dangers. Moreover, for scenarios where the robot brakes are activated during a quasi-static contact, the human has no means to escape from a clamping scenario (De Luca et al., 2006).
Reactive control schemes merge the planning and execution phases. Therefore, it is possible to develop unified strategies for collision detection and reaction (Haddadin et al., 2008a). Several approaches for collision detection have been proposed (Birjandi et al., 2020;Fritzsche et al., 2011;Haddadin et al., 2017;Liang et al., 2020). If the human and robot share the same workspace, the collision point on the robot structure is not known in advance. Therefore, it is important that the detection does not depend on the impact location, nor on the current robot configuration. Different safety-related reaction strategies exist. One approach is to apply monitoring functions during the robot movement and automatically adapt the controller parameters during runtime (Haddadin et al., 2008b;Muñoz Osorio et al., 2019;Navarro et al., 2016;Raiola et al., 2018). The goal of those controllers is to limit the potential robot impact in case of an unintended collision. Other work focuses on active robot reactions that are executed after a collision has been detected (De Luca and Flacco, 2012;Khan et al., 2014;Laffranchi et al., 2009). For unstructured environments, it is important to ensure that these active reactions do not lead to new risks. Moreover, no controlled robot reaction is fast enough to have a significant influence on the first collision impact (Haddadin et al., 2008b,c).
A promising field of research is learning-based approaches to support pHRI, e.g., imitation learning (Calinon et al., 2010;Rozo et al., 2013) and dynamic motion primitives (Ijspeert et al., 2013;Schaal, 2006). The goal of these approaches is to ''demonstrate'' to the robot human-like interaction and therefore resolve unsafe behavior.
Learning-based approaches often depend on appropriate sensors to monitor the environment. Even though considerable research in safety-related perception and vision has been done in recent years (Beetz et al., 2015;Charalampous et al., 2017;Chen and Song, 2018;Flacco and De Luca, 2017;Flacco et al., 2015;Sadrfaridpour and Wang, 2018), there is a significant lack of certified sensors, e.g., to calculate ''safe distances,'' to predict human intentions and to supervise sharp objects at the robot end-effector. If such sensor functions should be used for pHRI, they have to fulfill the strict requirements of ISO 10218-1 and ISO 13849-1. This means that for a severe and frequently appearing risk, the safety-related software has to be designed in a redundant manner (i.e., ''Category 3'') and the probability that failures of the safety system remain undetected has to be less than 10 À6 (i.e., ''Performance Level d'' or ''System Integrity Level 2'') (International Organization for Standardization, 2011. As these sensors are largely unavailable, ISO/TS 15066 excludes the use of sharp objects in a pHRI application. To program collaborative applications coordinate frames are typically placed on the robot structure, e.g., to monitor Cartesian velocities or predict external forces. As may be anticipated, unmonitored body parts on which no coordinate frame has been placed can easily cause risks for the human. Imagine a service robot working in a supermarket The robot process is programmed with a range of velocities. Collision measurements are performed in order to evaluate the robot impact. Iteratively, the velocity of the robot is adapted. To prove compliance with existing standards and regulations, extensive documentation is needed. surrounded by children. To be productive, it is desired that such a robot moves at high velocity. However, the maximum velocity of the robot has many constraints. Some of the constraints are robot-related (e.g., movement direction and curvature) and others are due to the given environment (e.g., clamping dangers and number of surrounding people). Therefore, it is hard to define possible collision points and maximum limits for the robot velocity. For such applications, intrinsically safe controllers are needed that automatically adapt the robot behavior and exclude clamping danger.
Physical interaction can be characterized by energy exchange (Colgate and Hogan, 1988). A major advantage is that energy is a coordinate invariant entity. Energy shaping techniques in robotic control have been in use since 1981 (Takegaki and Arimoto, 1981). However, there is only limited work addressing the control of energy for safe pHRI. In most energy-related control approaches, the energy difference between two successive control cycles is compared in order to make a statement about the passivity of the robot. Passivity is an energy-based measure of stability (Ortega et al., 2001). Probably the most prominent passivity concept is the ''energy tank'' and ''energy routing'' approach originally proposed by Duindam and Stramigioli (2004), which can be used for telemanipulation (Ferraguti et al., 2015(Ferraguti et al., , 2013Franken et al., 2011), to guarantee stability during contact (Schindlbeck and Haddadin, 2015;Shahriari et al., 2020Shahriari et al., , 2017 or to render nullspace projection approaches passive (Dietrich et al., 2016(Dietrich et al., , 2017Garofalo and Ott, 2018). Moreover, the energy tank concept has been proposed for safe pHRI (Raiola et al., 2018;Tadele et al., 2014). An energy tank constrains the robot energy to a finite amount. During movement, the robot extracts energy from the tank. In all approaches, the initial amount of energy in the tank is crucial. For pHRI this can lead to a conflict: on the one hand, the available energy should be high enough for the robot to fulfill its task; on the other hand, allowing a high energy value can pose a risk for the human in case of an unintended collision. Therefore, it might be worth exploring the allocation of an energy budget for each control cycle (Groothuis et al., 2018).
In this article, we address the coordinate dependency of the implementation of safety measures in pHRI applications. We review the current certification process with the help of an example application on a real robot. For the certification process, coordinate frames are used to monitor Cartesian velocities and predict external forces. We show that for a given robot task these strategies do not generally predict ''unsafe'' robot behavior. The novelty of this article is to assign a dynamic relationship to a contact scenario. This means that the contact is not only defined by the applied robot force but also influenced by the interacting environment. The coordinate invariant energy flow from the information (digital) domain to the energy (physical) domain determines the causality of the desired robot motion and the resulting impact force. We assign an energy budget to the robot to restrict the amount of energy flow in case of a collision. In our control approach, the robot is exposed to an artificial potential field. The controller auto-tunes this potential field at run-time to ensure that the energy budget is not violated. This is a powerful but simple approach, because small adaptations to existing controllers are sufficient. We can reduce the number of control parameters to be selected to one energy value. This approach is experimentally validated for its usability in pHRI. We use stateof-the-art certification devices to derive a safe energy budget for our example application. Thereby, collision and clamping risks are both taken into account.

Safe pHRI: classical approach
In order to certify a robot application, a risk assessment based on ISO 12100 has to be performed. The first step of the risk assessment is to list possible risks for the human. For pHRI, two major hazards are collisions and clamping scenarios, which will be treated in the remainder of the article.

Certification process of pHRI cells
In Figure 2, an exemplary robot application is shown which we use in the following to demonstrate the current certification process. Each robot application can roughly be divided into transfer motion, approach motion and process ( Figure 2). During the transfer motion, collisions or clamping scenarios can occur. The approach motion mostly yields clamping dangers.
If a pHRI application is placed in a restricted and unstructured workspace, the contact scenario can not be determined in advance and the programmer of the robot cell has to assume the worst-case scenario. To determine the impact of a collision between the robot and the human, possibly affected body parts have to be identified. Therefore, ISO/TS 15066 provides bio-mechanical thresholds for different body parts of the human. Moreover, the stiffness k 2 R of each body part is listed. Note that ISO/TS 15066 permits contact with face, skull, and forehead. If it is likely that those areas are affected, equipment has to be provided to protect the human co-worker. For our example application, we identified the upper arm, lower arm, and hand as the affected body parts. The respective bio-mechanical thresholds and stiffness values are listed in Table 1. 2 Note that the transient force and pressure thresholds are twice as high as the respective quasi-static values.
In the next step of the risk assessment, possible collision points on the robot structure have to be determined in order to calculate the impact surface area during contact. The robot programmer analyzes the robot motion and selects the ''sharpest'' points on the robot structure, i.e., the surface with the smallest curvature. Often, the most exposed surface in the movement direction is selected. For our example application, we selected the white rounded cover around the cables of the robot flange as the most exposed surface that is likely to collide with the human arm during transfer motion ( Figure 2). During the approach motion, it is possible that the human arm or hand becomes clamped between the table and the gripper jaws, which have a flat surface at the finger tips ( Figure 2).
To analyze the severity of a collision and to guarantee conformity with ISO/TS 15066, each pHRI application is certified based on measurements. The desired output of the measurements are impact surface area and collision force. With this information, contact pressure can be calculated. We conducted such measurements for our example application. In Figure 3, the measurement setup for the transfer motion and the approach motion can be seen, with detailed technical specifications presented in Appendix B. Two test series were performed, one for the transfer motion and one for the approach motion.
The collision measurements were conducted with a measurement device that was mounted on a solid steel pillar. This simulated a quasi-static contact in which the human has no possibility to back up. The measurement device was equipped with a force sensor. On top of the force sensor, a spring was attached that simulated the stiffness of the human body part. The robot collided with a foam rubber pad that resembled the stiffness of the skin. In our experiments, the spring constants used were 25 N/mm (arm) and 75 N/mm (hand), for transfer motion and approach motion, respectively. These values emulated the stiffness values of the affected body parts, defined in Table 1. The foam rubber had a thickness of 0.01 m. To asses the impact surface area, a pressure sheet was fixed on the measurement device during the first test of each series ( Figure 3). Using the software of the pressure sheet provider, the impact surface area was determined. This was done by outlining the area manually in the software (thin black line in Figure 4). For our experiments, the impact surface area for the transfer motion was A t = 4:15 cm 2 (gripper cover) and for the approach motion A a = 0:36 cm 2 (gripper jaw).
As a last step of the risk assessment, safety measures have to be provided to keep the collision impact within an acceptable range. For contact scenarios, this means that the bio-mechanical thresholds of ISO/TS 15066 must not be exceeded. Collaborative robots provide measures to lower the impact during a contact scenario. For the KUKA LBR iiwa, integrated torque sensors can be used to detect a collision. Moreover, based on the torque sensors, external Cartesian forces can be predicted. In our experiments, a collision detection criterion of torque .20 Nm was set. If any torque sensor measured a value above this threshold, a stop reaction was triggered and the robot brakes were activated. This stop reaction was implemented, because ISO 10218-1 argues that the moving robot is a risk and, hence, only a stopped robot is safe. At the end of the collision

Transient
Quasi-static k (N/mm) measurements the maximum robot speed can be determined such that the collision detection acts quickly enough to stay within the bio-mechanical limits.
Every contact scenario has a transient and a quasi-static phase. During each phase, maximum force and pressure values are tracked. While for transient contact the To determine the impact surface area and impact force during transfer motion (a) and approach motion (b), a collision measurement device was mounted on solid pillars. The robot application was started and the identified robot part collided with the measurement device. The tests were conducted with varying robot speeds to determine the maximum admissible bio-mechanical threshold. After scanning the pressure sheet, the respective pressure regions are displayed in different colors. Yellow represents the area with highest contact pressure. Red indicates the second highest contact pressure, from high in dark red to low in light red. Green represents area without contact. A contour was manually drawn to determine the impact area. The impact area of the gripper cover and one gripper jaw are visualized in (a) and (b), respectively. maximum values are considered over the complete impact time, the maximum quasi-static values are assumed to be established 0.5 seconds after first contact (International Organization for Standardization, 2016). For our example application, we presumed an unstructured environment and considered a quasi-static contact scenario for the transfer and approach motions. Figure 5a shows the robot endeffector velocity in the direction of movement during the transfer motion. Approximately 0:3 s after the robot motion started, a collision with the measurement device occurred. The velocity at the first impact instant (v col ) was analyzed by detecting large torque deviations in axis 6 of the robot. In Figure 5b, the respective force recordings of the measurement device can be seen. The recording was automatically started after a force threshold of .20 N was exceeded. As the cover of the gripper was rounded and the contact surface area was relatively large (Figure 4a), low transient pressure values and low quasi-static pressure (QSP) values were observed. The maximum transient force value was close to the bio-mechanical force threshold of the hand (cf. Table 1 and Figure 5b). Hence, v col was close to the maximum robot velocity that remained within the allowable bio-mechanical thresholds if a collision occurred during the transfer motion. Collaborative robots provide ''safety'' monitoring functions that comply with ISO 13849-1. For the KUKA LBR iiwa, one such function can monitor the Cartesian velocity in a given task coordinate frame. Consequently, v col would have to be set as safetymonitored velocity. If this velocity is exceeded, a stop reaction is triggered. Figure 6a shows the robot end-effector velocity in the movement direction of the approach motion. Unlike the transfer motion, high QSP values were observed since the gripper jaws had a small contact surface area (cf. Figures 4b and 6b). The robot velocity was iteratively adapted, until the QSP approximated the threshold for the lower arm (cf. Table 1 and Figure 6b). Note that v col does not necessarily represent peak velocity, because velocity oscillations can occur owing to the impedance controller (cf. Figure 6a between 2:25 and 2:3 s).
For this example application with a quasi-static contact scenario, for a collision with rounded robot parts (e.g., the gripper cover) transient force values were critical, whereas for parts with small impact surface areas (e.g., the gripper jaws) the QSP values were more important.

Specific aspects of the safety implementation
For the remainder of the article, consider a robot with nnumber of joint coordinates and m-number of task coordinates.
As shown in the previous section, the robot programmer has to determine critical points on the robot structure. For these points, coordinate frames are placed and the maximal velocity is evaluated. The calculation of the velocities is based on the Jacobian matrix J(q) 2 R m × n , which maps joint velocities _ q 2 R n to linear and angular Cartesian velocities V 2 R m : The first three rows of J(q) can be derived by ∂L(q)=∂q and yield the time differentiation of the position p = L(q). The last three rows can be derived by time differentiation of the rotation matrix and by using the skew-symmetric representation of the angular velocity w 2 R 3 (Siciliano et al., 2009).
To analyze a scalar value, the vector V is transformed to a scalar velocity v 2 R, usually by using the Euclidean 2norm. In the kinematically redundant case, there are infinitely many solutions _ q to produce a desired Cartesian velocity. Hence, for a given velocity V the joint velocity of the robot is not unique. This can lead to high joint velocities which can be a risk for the human. This raises the question where to put the coordinate frame on the robot structure. For a poor choice, unmonitored high velocities can cause injuries in case of a collision (Figure 7).
To lower the impact of a collision, often joint torque sensors are used to detect a contact with the environment. External torques t external 2 R n are estimated based on the difference between the measured torques, control torques and acceleration estimations and, hence, require accurate model data. However, t external cannot always be used as a safety measure. For assembly processes, the robot can not differentiate between an intended or unintended contact. Another commonly used approach is to calculate external forces F external 2 R m acting on the robot structure. For robots with joint torque sensors, F external can be obtained by mapping t external into R m : Hereby, the Jacobian inverse J(q) # 2 R n × m is not unique (Dietrich et al., 2015) and depends on a metric choice. As for (1), J(q) # usually depends on the coordinate frame on the robot structure. Moreover, the measurement of t external critically depends on the current robot configuration as well as on the position and direction of the applied force. Along singular directions, no forces can be detected (Figure 8a).
The contact force is frequently described by a linear mass-spring-mass model (Haddadin et al., 2009;International Organization for Standardization, 2016;Rosenstrauch and Kruger, 2017). For a given direction, represented by the unit vector u 2 R 3 , the magnitude of this linear force f 2 R depends on the robot's ''reflected inertia''m eff 2 R at the contact point (Haddadin et al., 2008b(Haddadin et al., , 2010Khatib, 1995;Wassink and Stramigioli, 2007): The ''end-point mobility tensor'' L À1 2 R m × m (Hogan, 1984; Lachner et al., 2020) is a static measure and solely depends on the robot configuration. Hence, if the contact force is modeled based on L À1 , different nullspace motions will cause different predictions of contact forces ( Figure 8b).
As can be seen in (3), the magnitude of m eff depends on the direction of the unit vector u. For the end-effector body, the direction along the linear end-effector motion can be monitored. However, when selecting other points on the robot structure, different nullspace motions result in different values of m eff (Figure 9). Usually, the normal direction to a point on the impact surface with the smallest curvature is selected (Haddadin et al., 2008b;Wassink and Stramigioli, 2007). Near singular configurations, the magnitude of m eff is highly sensitive to small direction changes (Figure 9, bottom plot on the right-hand side). For a redundant robot with an almost round impact surface along the robot structure, what would be an appropriate impact direction to choose?
In our example application, we placed one coordinate frame on the end-effector to monitor and adapt its velocity. Additional high velocities, e.g., of the robot elbow, were not tracked and can represent an injury risk. Even if all appropriate coordinate frames have been placed, the clamping danger still exists. To comply with ISO 10218-1, the robot stops and the brakes are activated if an unintended contact is detected. This is especially disadvantageous for applications with restricted workspaces. This can be seen in our example application (Figures 5b and 6b): the remaining quasi-static force (QSF) values after the robot stopped were approximately 94.74 N and 65.06 N for the transfer motion and the approach motion, respectively. For the approach motion, a constant pressure of 180 N/cm 2 remained. For our example application, the force and pressure values are in correspondence with ISO/TS 15066. However, a wrong choice of considered body parts (Table 1) will not eliminate all risks. Even if all affected body parts were identified correctly and all contact values were in correspondence with ISO/TS 15066, the programmer has to provide some means to release the human co-worker.

Coordinate invariant control of robot energy
A collision between a robot and its environment is a dynamic interaction and hence cannot be described with either velocities or forces alone (Folkertsma and Stramigioli, 2015;Stramigioli, 2015). Physical contact results in a robot response. It is important that this reaction should not evoke new dangers for the human . We control the energy of the robot, which is a coordinate invariant entity and therefore does not depend on the selection of coordinate frames. Our controller autotunes the total energy of the robotic system. The compliant robot behavior in quasi-static contact will protect the human from clamping scenarios.

Energy transfer during interaction
The interaction between the robot and its environment can be represented by an equivalent network (Hogan, 2014;Stramigioli, 2001) (Figure 10). For a given control input c, the robot controller calculates a desired control motion x C 2 R 6 . The contact between robot and human takes place at the interaction port (F, V). In a collision, the energy that is flowing bi-directionally between the robot and the human can be modeled at this port. If the robot behaves like a mechanical impedance, its output is a force (effort) and the input is a displacement (time-integral of flow). The connected subsystem (in our case the human) is exposed to this force F 2 R 6 and influences the robot displacement x 2 R 6 . In a contact scenario, the amount of transferred energy is determined by the energy of the robotic system, i.e., kinetic and potential energy. The total energy L 2 R of the robotic system in contact is   (2014)). The robot is modeled as an impedance (left). A collision can be described at the interaction port (F, V): the robot exerts a force, while the human is influencing the robot position (right). During transient contact, the energy flow is mainly determined by the energy in the robotic system, that is potential and kinetic energy. During quasi-static contact, x remains constant while F increases.
with T 2 R, U g 2 R, and U i 2 R being the kinetic energy, gravitational potential energy and controlled potential energy 3 in joint space (i = q) and Cartesian space (i = x), respectively. Here T depends on the robot mass M(q) 2 R n × n and joint velocity _ q 2 R n . Hence, for a kinematically redundant robot, T can vary with the different nullspace motions. U g depends on the robot configuration and is needed to compensate for the instantaneous robot weight. For pHRI, U g must always be provided to eliminate the risk due to a collapsing robot. In general, any choice for the description of an artificial potential field is possible (Ott, 2008). A common choice is to describe U q as a function of joint stiffness K q 2 R n × n and joint position difference Dq = (q C À q) 2 R n . For the Cartesian space, U x is usually a function of stiffness K x 2 R m × m and position/ orientation difference Dx = (x C À x) 2 R m . Hereby, q C and x C are usually functions of the control time t C 2 R.
For an impedance controlled robot, the energy flow from the information domain (control command c) to the energy domain (physical interaction (F, V)) follows a strict causality. First, the robot is exposed to the impedance potential U i . Once the robot starts moving, U i is transferred to T . In case of a collision, T is exchanged with the human. As the skin is deformed elastically, the contact can be modeled as an energy transfer from T to U skin 2 R (Haddadin et al., 2011;International Organization for Standardization, 2016). In a quasi-static contact, T '0 and the human is only affected by U i , which generates a clamping force at the interaction port. The controlled motion x C and constant robot position x leads to an increase of U i and therefore to an increase of the clamping force F.
We assign an energy budget to the robot system in order to ensure an intrinsically safe robot motion and safe contact behavior. Therefore, the force F is automatically limited in case of a clamping scenario.

Control of potential energy
A robotic task can be described as an elastic potential (Stramigioli, 2001). For a desired joint space behavior, a simple linear choice for the potential function is For Cartesian space, several methods exist to describe the impedance potential, e.g., Fasse and Broenink (1997), Caccavale et al. (1999), Stramigioli (2001), andNatale (2003). The main difference between the methods lies in the description of the rotational potential. One possibility is to describe the rotation with unit-length quaternions. The rotation matrix tcp R des 2 SO(3) between the desired frame and the end-effector frame is converted into quaternion representation with scalar component des h tcp 2 R and vector component des e tcp 2 R 3 × 1 . Therefore, the total potential U x , expressed in coordinate frame 0, is the sum of translational potential U p 2 R and rotational potential U e 2 R: With (5) and (6), the task torque t K 2 R n can be calculated as the partial derivative of U x and U q : To guarantee an efficient robot behavior, we have to find an appropriate damping function. The dissipation function can be expressed with a Rayleigh function as and with corresponding resistive elements B q 2 R n × n and B x 2 R m × m for the joint space and Cartesian space, respectively. Often fixed damping matrices are used, which will have a negative effect on the task performance of the robot. A more advanced method is to express B q and B x as a function of K q and K x and take into consideration inertial information about the robot. Applying the method in Albu-Schaffer et al. (2003), the damping matrices for the Cartesian space are where D z x = diagfz x g with 0 ł z x ł 1, and for the joint space are where D z q = diagfz q g with 0 ł z q ł 1. The matrix is the ''kinetic energy matrix'' defined in Khatib (1995). The square roots of the matrices in (9a) and (9b) can be calculated by coordinate transformation, such that the symmetric positive-definite matrices L x , K x , M(q) and K q have a diagonal form. Subsequently, the square roots of the diagonal elements are taken. Afterwards the matrices are transformed back to original coordinates. In addition, a threshold for the diagonal elements of L x has to be set, since some elements grow without bound as singular configurations are approached.
Using (8), the damping torque t D 2 R n can be calculated with the partial derivative of R q and R x :

Energy budget for safe pHRI
If m\n, U x does not affect the nullspace in the mapping J(q). This nullspace exists for a kinematically redundant robot and can lead to an increase of T due to nullspace motion. Consequently, if we want to control the robot energy, we have to take into account U x , U q and T . Note that we excluded U g , because it always has to be compensated, e.g., via energy shaping techniques (Duindam et al., 2009). The controlled energy L C 2 R, expressed in coordinate frame 0, can then be calculated with We set an energy budget L max 2 R for the robot, satisfying If (13) is violated we can produce a new elastic potential U x 0 = k U x and U q 0 = k U q , with the scaling function k : R ! R: This approach will automatically bound the total energy of the robot. The condition for T .L max is necessary for pHRI: if the human were to push the robot while the scaling function was active, this could result in a high negative k value, which would lead to unstable robot behavior. A simpler form of (14) was used in Tadele et al. (2014) and Raiola et al. (2018). Our work provides two necessary extensions. First, we change our control inputs q C and x C to be a function of ''effective time'': Here, t S 2 R is the sample time of the controller that updates the control time t C at the end of each control cycle. This means that the controller retains the desired position during a contact scenario. This is a necessary extension, because otherwise the time-dependent control positions q C and x C would be updated, which would increase U q and U x . Hence, the scaling function k would continue to act, even though the robot was not in a contact scenario anymore. This would lead to an undesired and unpredictable robot motion.
Second, we introduce an additional joint potential U q Ã 2 R: with q Ã 2 R n being the joint configuration of the first iteration where T .L max , which is stored until T ł L max . This is the case if the operator pushes the robot, e.g., when releasing from a clamping scenario (Extension 1, summary part IV). We extend our controller with a second scaling function r : R ! R, producing a new joint potential where O ø 1 is a scalar value that determines the desired robot behavior. With (16) and (17), the robot increases the joint stiffness if T would violate the energy budget L max . This is a necessary feature since otherwise the joints could accelerate without control if the robot was pushed. The effect of this feature can be seen in Extension 1 (summary part V). Finally, we can calculate the control torque t C by partial differentiation of (5), (6), (8), (16) and apply the energy scaling method of (14) and (17): where E( tcp h des , tcp e des ) = tcp h des IÀ tcpẽ des , with tcpẽ des being the skew symmetric matrix notation of tcp e des . Note that for T \L max : q Ã = q and, hence, U q Ã = 0. A great benefit of this general approach is that the scaling functions can be applied no matter how the elastic potential is described. Hence, the presented controller is a feasible extension for every impedance controller. Moreover, in the presented version, the scaling parameter k also affects the damping design in (9) and the desired damping behavior is also ensured if k\1. With our control approach, we can not only limit the potential energy during quasi-static contact, but also the kinetic energy if the robot is pushed.

Derivation of a safe energy budget
ISO/TS 15066 provides energy thresholds that can be calculated via With the minimal force values and stiffness parameters of Table 1, the energy thresholds can be calculated for our example application (Table 2). These values determine the limit to the bio-mechanical energy that can be exchanged during the transient (L TF ) and quasi-static (L QSF ) contact phases. We begin by analyzing the transient contact phase and set L max = 0:52 J for our controller. All other control parameters can be seen in Appendix C. In the following, the same collision measurements as in Section 2.1 were performed.
As can be seen in Figure 11, the robot automatically limits L C ł 0:52 J. Once L C reaches L max , the scaling function k (Equation (14)) acts on the impedance potential U x and consequently reduces the kinetic energy T of the robot.
Moreover, as long as L C .L max , the controlled position x C is kept constant (Figure 12). Note that if solely x C is kept constant, the energy constraint L max may be violated. This can be seen in our example application during quasi-static contact with k\1 ( Figure 11) and static x C (Figure 12).
During the transient contact phase, T is exchanged with the human and is, hence, the crucial quantity to observe. To comply with ISO/TS 15066, it is necessary that T ł 0:52 J during this phase. For our control approach, however, the robot will never reach this threshold because there will always be a potential energy content in L C (cf. T in Figure 11).
During the quasi-static contact phase, the potential energy imposes a clamping force. The calculated energy threshold based on ISO/TS 15066 for this phase is 0:13 J. We can show that our control approach eliminates the clamping risk. This can be seen by observing the QSF values during the transfer motion and QSP values during the approach motion in our example application. While for the classical approach of Section 2.1, the QSF values after the robot brakes were activated remained approximately 65 N (Figure 6b), these values were limited to ł 6:86 N with our novel approach (Figure 13a). The same holds for the QSP values after a collision during the approach motion: while for the classical approach a constant pressure of approximately 180 N/cm 2 remained (Figure 6b), this value was limited to ł 19:06 N/cm 2 with our novel approach (Figure 13b). For our application, we can therefore argue that we do not have to take into account clamping dangers and can use double the force values to calculate L QSF . This is the same value as for the transient contact phase: L max = L TF = L QSF = 0:52 J. Hence, the presented controller is especially advantageous for approach motions, where the tool tip usually has a small surface area.
The classical approach showed large differences between measurements with rounded and sharp objects. During the (a) (b) Fig. 11. Energy distribution with active scaling function during (a) transfer motion and (b) approach motion. Once the threshold L max is reached, the scaling function k acts on the impedance potential U x and consequently reduces T . After the first collision instant (red star), T reduces quickly and U x approaches L max .  Figure 13a and (b)). Even though the surface area of the gripper jaws was small, the pressure values were reduced to ł 19:06 N/cm 2 (Figure 13b). While every segment of a robot application has to be manually adapted using the classical approach, our novel controller constrains the robot to a consistent behavior during the whole application. As can be seen in Figure 13, the controller is fast enough to minimize the quasi-static contact values within 0.5 seconds of the transient contact phase. Moreover, instead of adapting multiple control parameters in the classical approach (e.g., t max , v max , K q , and K x ), the approach presented here requires only one parameter L max and auto-tunes the initial control parameters to guarantee a safe robot behavior.

Conclusion
Our first aim was to make the reader aware of the influence of coordinates on the implementation of safety measures in  pHRI applications. We have reviewed the current certification process with an example application on a real robot. Coordinate frames had to be placed on the robot structure to monitor Cartesian velocities. With collision measurements, the velocity was iteratively adapted until no biomechanical thresholds were violated. For a poor choice of coordinate frame positions, unmonitored high velocities present risks if unintended collisions occur. If joint torque sensors are used to detect collisions, the reliability of the detection depends on the current robot configuration. Our second aim was to present a novel approach that removed these limitations by assigning an energy budget for impedance controlled robots. This coordinate invariant control approach facilitates the certification process of pHRI applications. The key features of this control approach are as follows. pushed, its energy threshold is still guaranteed. After contact, the robot automatically continues to move on its pre-planned trajectory. 5. This new approach facilitates the current certification process: instead of adapting multiple control parameters, the presented approach has one control input L max and auto-tunes the other control parameters. The experiments in this article used a conservative value for L max . In practice, L max can be optimized for each part of the robot application based on collision measurements. In our approach, this is especially advantageous to speed up transfer motions.

Limitations of the proposed approach
A practical limitation of the presented approach is its need for accurate dynamic model data for the robot. Without access to M(q) of the robot, T cannot be calculated accurately. However, multiple methods exist to identify M(q) (cf. the overview provided in Siciliano and Khatib (2008)). Even with that limitation, the control approach can still be used for quasi-static contact, because T '0 and U i can be calculated without dynamic model data.
The energy threshold L max defined in ISO/TS 15066 can also be calculated based on the minimal pressure values and stiffness parameters of Table 1: Compared with (19), in this case L max depends on the contact surface area A 2 R. Selecting the gripper jaw surface and the minimal pressure thresholds of the lower arm would yield L TF = 0:21 J for the transient contact phase and L QSF = 0:05 J for the quasi-static contact phase. In contrast to these calculated thresholds, we showed in Section 3.4 that setting L max = 0:52 J yields far lower QSF and QSP values than allowed by ISO/TS 15066. For a very sharp tool, however, this energy threshold might be too high. Hence, we can conclude that we can not solely rely on the calculations based on ISO/TS 15066 and that it is still necessary to certify the selected energy thresholds for each part of the robot application via collision measurements.
Many pHRI applications involve contact, e.g., during assembly processes. These processes might involve potential energy greater than L max . In case of a clamping scenario before the robot is in contact, it has to be ensured that the bio-mechanical thresholds are not violated. Hence, strategies have to be applied to identify the contact phase (Bicchi et al., 1993) and adapt the energy budget accordingly.
Lightweight robots have low inertia and, hence, low kinetic energy during movement, which is a beneficial factor for the transient contact phase (De Santis et al., 2008). Therefore, the presented work is a promising control approach for these kind of robots. Classical industrial robots, however, move high masses and therefore have limited application to pHRI. For these robots, external safety measures are needed that monitor the distance between the robot and the human.

Critical review of current certification process
In this article, we have shown the current certification steps of robot applications with pHRI. One important step was to select the correct body part. This step is crucial, because a wrong choice of body parts could yield hazards that traditional safety measures could not cover. However, for applications with unstructured environments it is challenging to predict all possible collision scenarios and respective body parts in advance.
In ISO/TS 15066, force and pressure values are the main parameters to make a statement about the safety of a collaborative application. For the robot transfer motion in our example application, the force and pressure values were in accordance with ISO/TS 15066. However, the end-effector traveled a large distance from the first collision instance to the stopped position. This distance was not considered, even though it could represent a risk for the human coworker. Imagine if an obstacle had been placed in the workspace; the human co-worker would have no means to backup.
In case a safe distance is violated, classical industrial robots have to stop as quickly as possible. As clamping risks are excluded, this is a safe reaction. For pHRI applications, however, extensive care has to be taken to minimize the contact force and pressure during clamping scenarios with the stopped robot. For collaborative robots, we submit that the definition of a safe reaction in current standards and regulations should be reviewed and revised, i.e., in ISO/TS 15066, ISO 10218-1, and ISO 10218-2. Moreover, we conclude that for pHRI only a compliant robot reaction is a safe reaction because it eliminates the clamping risk and does not evoke a new risk caused by an active robot reaction after a collision.