ERK'2022, Portorož, 212-215 212 Human-inspired robotic levering using Periodic Dynamic Movement Primitives Boris Kuster, Matevˇ z Majcen Horvat Humanoid and Cognitive Robotics Lab, Dept. of Automatics, Biocybernetics and Robotics, Joˇ zef Stefan Institute, Jamova cesta 39, 1000 Ljubljana E-mail: boris.kuster@ijs.si, matevz.majcen@ijs.si Abstract Autonomous robotic disassembly (recycling) of elec- tronics requires a variety of skills. One of these is lev- ering, which allows the robot to apply greater forces us- ing a fulcrum, providing a mechanical advantage. While such tasks can be accomplished in some cases using pre- recorded robot trajectories obtained by demonstration, a more general approach to levering is preferred. The issue is an automatic adaptation to the different object shapes. This work presents an algorithm for perform- ing human-inspired robotic levering exploiting periodic dynamic movement primitives and force/torque feedback- based control for contact point determination. The algo- rithm autonomously adapts to the different object shapes and provides for the successful accomplishment of the levering task. 1 Introduction With the recent shift towards environmentalist policies, robotic disassembly of items for waste reduction by re- cycling has received increased attention. Humanity pro- duces a great deal of electronic waste [1]. The applica- tion of intelligent and flexible robots to replace human workers can decrease recycling costs in the long term. On the other hand, recycling faces the problem of small batches and a great variety of recycled items. In such cir- cumstances, the effort for robot programming to perform autonomous disassembly of generic electronics is one of the reasons for the slow deployment of robotics-based so- lutions. During the disassembly of electronics and other items, various robotic skills are needed, one of which is levering. It is a process whereby mechanical advantage can be gained using a rigid beam (lever) and a fixed hinge (fulcrum), allowing a greater force to be exerted on the load (the levered object). Some operations where lever- ing is needed include removing pins and nails or separat- ing different device parts. While this is an easy task for humans, as they can rely on vision, force, and pressure sensing supported by previous experience and general- isation capability, robotic disassembly applications still commonly use pre-recorded trajectories. These trajec- tories, however, need to be carefully adapted and repro- grammed for each disassembled object. Dynamic move- ment primitives were shown to be applicable to assembly and disassembly tasks [2] as well as to the task of motor control in humanoid robots [3]. In this paper, we propose to improve the generalisation of the levering movement using Periodic Dynamic Movement Primitives (PDMPs) and combine them with external forces and torques esti- mation, acting on the end-effector. One of the benefits of the proposed framework is adaptation without addi- tional vision information, which can be unreliable due to the poor lighting conditions and occlusions often encoun- tered in recycling processes. The proposed algorithm for performing human-inspired robotic levering was imple- mented on a collaborative Franka Emika Panda robot and applied to disassembling heat cost allocators (electronic devices). 2 Preliminaries and related work Dynamic movement primitives (DMPs) were proposed as an efficient way for learning and control of complex robot behaviors [4]. The basic form of DMPs consists of a differential equation (a linear second order damped spring attractor system) along with an added nonlinear forcing term, which allows the adaptation of the simple second order attractor dynamics to a specific robot move- ment [5]. Eq. (1) is the nonlinear differential equation defining a DMP. This model can be written in first-order notation, as shown in Eqns. (2, 3). Here, τ is a time constant, whileα z andβ z are positive constants that rep- resent the damping and proportional terms, respectively. With the appropriate choice ofα z andβ z , the system will be critically damped and y will monotonically converge towardsg. In the context of robotics, ¨y, ˙y andy represent the acceleration, velocity and position of a joint, respec- tively. g represents the goal, the desired final position of the movement. If the forcing term f is set to zero, these equations represent a globally stable second-order linear system with (z,y) = (0,g) as a point attractor. τ ¨y =α z (β z (g− y)− ˙ y ) +f (1) τ ˙y =z (2) τ ˙z =α z (β z (g− y)− z) +f (3) To avoid explicit time dependency, the phase x has been introduced. It follows the first order linear dynamics 213 shown in Eq. (4). The advantage of this approach is that, for example, we can stop the evolution of time to account for perturbations during trajectory execution. τ ˙x = − α x x (4) Periodic dynamic movement primitives can be mod- eled in a similar fashion as discrete DMPs, shown in Eqns. (5, 6). Ude et al. [6] presented an implementation of PDMPs. In this work, we follow their implementation. ˙ z = Ω( α z (β z (g− y)− z) +f(ϕ,r )) (5) ˙ y = Ω z (6) The phase variable ϕ is introduced to avoid explicit time dependency. The phase is assumed to move with constant speed, as shown in Eqns. (7, 8). The frequency of oscillation is defined as Ω . τ = 1 Ω (7) ˙ ϕ = Ω (8) The forcing termf can be used to create more versa- tile point attractor dynamics, so that a more specific path can be followed from the current position to the goal, for example avoiding an obstacle between the current posi- tion and the goal. The forcing term usually takes the form shown in Eq. (9) for PDMPs, where ψ i are fixed basis functions, whilew i are adjustable weights [7]. f(ϕ,r ) = N P i=1 ψ i (ϕ )· w i N P i=1 ψ i (ϕ ) r (9) In general, a demonstrated robot trajectory y demo is recorded in joint or Cartesian space. Velocities and accel- erations can be calculated as derivatives of the recorded positions or recorded directly. Then, the trajectory is encoded into a DMP by setting the goal to be the last recorded position. For PDMPs, the goal is set as shown in Eq. (10). Eq. (1) can be reformulated as Eq. (11). g = 0. 5· (min(y) +max(y)) (10) f target =τ 2 ¨ y demo − α z (β z (g− y demo )− τ ˙ y demo ) (11) For PDMPs, this equation takes the form of Eq. (12), wherer is the amplitude of the oscillator. f(ϕ (t),r) = ¨ y Ω 2 − α z (β z (g− y)− ˙ y Ω ) (12) The forcing function values are approximated by a linear combination of weight functions, shown in Eq. (9). Weight functions for Periodic DMPs are shown in Eq. (13). The weightsw i are calculated by applying standard regression techniques [7]. Centers of the weight func- tions,c i , are evenly distributed along the trajectory, while h i > 0. ψ i (ϕ ) =exp(h i (cos(ϕ − c i )− 1)) (13) Various improvements have been proposed for DMPs. Ude et al. propose defining DMPs for non minimal, sin- gularity free representations of orientation, with rotation matrices and quaternions [7]. Nemec et al. [2] propose extensions, which enable the generalization of movement back and forth for Cartesian Dynamic Movement primi- tives, while also encoding the robot end-effector quater- nion orientation. Saveriano et al. [4] describe the various existing DMP formulations and discuss their advantages and disadvantages. Ijspeert et al. [5] show how to op- timize DMP parameters to minimize various costs, for example the total jerk of the trajectory or the end-point variance. Deniˇ sa et al. [8] propose compliant movement primitives (CMPs), which encode both the kinematic tra- jectory as well as the corresponding joint torques. This allows for compliant robot behavior, which is advanta- geous when operating in unstructured environments along- side humans. 3 Levering setup Fig. 1 shows the typical levering setup. The lever is at- tached to the robot flange, therefore the terms lever and tool can be used interchangeably. The used tool in this task is a screwdriver. The levered part lies within the ob- ject. Subsequently, we will refer to the levered part as part. To increase mechanical advantage, the lever is posi- tioned against the fulcrum. Figure 1: Elements of a levering process. In Fig. 2, object coordinate system(c.s.) (X, Y , Z axes), the robot flange c.s. (X 0 , Y 0 , Z 0 ), the nominal tool c.s. (X 1 ,Y 1 ,Z 1 ) and the tool c.s. (X 2 ,Y 2 ,Z 2 ) are shown. The Tool Center Point (TCP) is located at the tool c.s. Initially, the nominal tool c.s. and the tool c.s. are identical, the tool c.s. is changed only after the location of the fulcrum is known. In our work, we make use of force-torque (FT) measurements (F x0 , F y0 , F z0 , M x0 , M y0 ,M z0 ), which are calculated in the robot flange c.s. The lever (tool) angleα is shown in Fig. 2. 214 Figure 2: The object, robot flange, nominal tool and tool coor- dinate systems. 4 Fulcrum and part contact point search al- gorithm Our search algorithm is parameterized with the following input parameters: • initial Cartesian position (x,y,z) in robot coordi- nate system. • the c.s. rotation angleβ . • torque threshold to detect the part and fulcrum,M thr . • forceF z0 threshold to detect the part,F thr The robot TCP must be initially positioned above the part and the approximate location of the part and fulcrum must be known in advance. This approximate informa- tion can be obtained, for example, by a vision system, or by pre-positioning the part within a holder with a known pose. The input parameters for the algorithm are the ini- tial Cartesian position (x,y,z) between the fulcrum and part (in the robot c.s.) and the angle of rotation around thez axis,β . This position and the angle define the plane in which we will perform the levering, as shown in Fig. 1). The initial Cartesian position must be located between the fulcrum and the part. To detect the part, we can take advantage of the fact that our object has a flat lower plane, which we detect by moving in the negativez direction until determining con- tact by measuringF z0 . The location of the levered part (load) can be trivially determined by moving along the positivex axis until detecting contact by measuringM x . After the threshold valueM thr is reached, the current po- sition is recorded as the part position. To contact the fulcrum, the tool angleα is decreased until contact is detected by measuringM x0 . The TCP is recorded. For approximately detecting the location of the fulcrum, we can take advantage of the fact that we know both the robot flange and TCP positions. After slightly increasing the threshold value M thr , further rotation is performed and the position is again recorded. In a 2D plane, the approximate position of the fulcrum can be de- termined by the intersection of the two lines connecting the robot flange to the TCP. The robot’s TCP, which was previously located at the end of the lever, is moved to the position of the fulcrum, as seen in Fig. 2 (the TCP is reduced in the negativez 0 axis). This ensures that, when changing the tool angleα , the lever is rotated around the fulcrum and always stays in contact with it. 5 Executing the levering We have observed that humans often use periodic move- ments when levering, especially when they do not know the force required to dislodge an object with the lever. In doing so, they slightly increase the force on the lever in each period. Our levering algorithm is parameterized with the fol- lowing input parameters: • initial amplitude of the sinusoidal cycle, set toA = 10 ◦ in our experiments. • duration of the sinusoidal cycle, set tot c = 10s. • number of weights for encoding the PDMP, set to n = 25. • goal scaling for each iteration, set tog =g+0. 2·A. • initial radius of the PDMP, set tor = 1. To mimic this behavior, we generate a single degree- of-freedom (DOF) sinusoidal cycle with an amplitudeA and cycle timet c , which represents the angle of the end- effector relative to the initial angleα at which the robot is in contact with the fulcrum and part. This angle is the most important parameter in levering. The specified sinusoidal pattern is encoded into the PDMP as per section 2. We usen weights. After the lever is in the initial position, touching both the part and the fulcrum, the execution of the PDMP be- gins. While the PDMP is being executed, the measured force- torque signals are used to detect when the levering was successful, as per Section 6. If the entire trajectory is completed without encountering a success signal, the PDMP goal value is increased as specified by the input parame- ters of the algorithm. This effectively increases the force applied to the levered part during each iteration. The orig- inal generated trajectory (lever angle) is shown in Fig. 3, along with the decoded PDMP trajectory. Here, three it- erations are shown, and after each iteration the goal angle is increased. 6 Detecting levering completion using force- torque measurement To detect when levering is successful without using vi- sion or other feedback signals, we can use force-torque (FT) measurements (F x0 ,F y0 ,F z0 ,M x0 ,M y0 ,M z0 ) on the robot end effector. The algorithm for detecting levering success is pa- rameterized with the following input parameters: • component of the FT measurement, in our casei = 4, which corresponds toM x . 215 Figure 3: Three iterations of decoded PDMP with an increasing goal. • torque value used as a threshold,M max = 2Nm. • time window in which the threshold condition is calculated,t w = 1s. • the secondary cut-off condition,α max , set to 0°. We observe that M x shows a sharp drop-off at the point in time when the part (load) is dislodged, as shown in Fig. 4. There are two possible conditions for lever- ing success. Firstly, the levering is successful if the dif- ference between the maximal and minimal torque value within the width of the signal observation window,t w , is greater than the parameterM max , as shown in Eq. (14). The current sample time is denoted ast k . The measured torques, as well as the value of this threshold condition cond are shown in Fig. 4. An additional constraint is that this condition can only be triggered while the lever angle α is increasing, meaning it’s applying force to the part. max(M x (t))− min(M x (t))>M max ,t =t k − t w ,...,t k , (14) When recycling old electronics, it can sometimes hap- pen that the levered part is very loose and does not pro- vide a large resistance force, so a drop in M x will not be detected. Therefore, the secondary condition for lev- ering success is if the lever angle α is higher than the parameter of the second cut-off conditionα max . In our specific case, shown in Fig. 1, the contact point with the part is always lower than the fulcrum in the objectz axis. Therefore, if the lever’s angle is greater than horizontal (α> 0°), the levering stops. 7 Conclusion and further work We presented a human-inspired levering algorithm, com- posed of two sub-tasks: searching and levering. The search algorithm automatically detects contact points after be- ing roughly pre-positioned between and above the part and fulcrum locations. The levering algorithm is accom- plished using periodic dynamic motion primitives frame- work. Both algorithms are parametrized to quickly adapt Figure 4: Measured torques and the condition variable. to different use-cases. The success of the levering ac- tion is detected based on a pre-defined criteria of a torque measurement drop-off. However, this value needs fine tuning. To overcome this problem, we propose to analyze the force torque signals using the dynamic time warping (DTW), which compares a reference signal of successful levering torques with the observed torques in the current levering iteration. References [1] E. Commission, D.-G. for Environment, M. Tesar, B. Karigl, C. Lampert, C. Neubauer, J. Oliva, and J. Wolf, Study on quality standards for the treatment of waste elec- trical and electronic equipment (WEEE) : final report. Pub- lications Office, 2021. [2] B. Nemec, M. Simoniˇ c, T. Petriˇ c, and A. Ude, “Incre- mental policy refinement by recursive regression and kines- thetic guidance,” in International Conference on Advanced Robotics (ICAR), (Belo Horizonte, Brazil, Brazil), 2019. [3] S. Schaal, Dynamic Movement Primitives -A Framework for Motor Control in Humans and Humanoid Robotics, pp. 261–280. Tokyo: Springer Tokyo, 2006. [4] M. Saveriano, F. J. Abu-Dakka, A. Kramberger, and L. Pe- ternel, “Dynamic movement primitives in robotics: A tuto- rial survey,” CoRR, vol. abs/2102.03861, 2021. [5] A. Ijspeert, J. Nakanishi, H. Hoffmann, P. Pastor, and S. Schaal, “Dynamical movement primitives: Learning at- tractor models for motor behaviors,” Neural computation, vol. 25, 11 2012. [6] A. Ude, A. Gams, T. Asfour, and J. Morimoto, “Task- specific generalization of discrete and periodic dynamic movement primitives,” IEEE Transactions on Robotics, vol. 26, no. 5, pp. 800–815, 2010. [7] A. Ude, B. Nemec, T. Petri´ c, and J. Morimoto, “Orientation in cartesian space dynamic movement primitives,” in 2014 IEEE International Conference on Robotics and Automa- tion (ICRA), pp. 2997–3004, 2014. [8] M. Deniˇ sa, T. Petric, A. Gams, and A. Ude, A Review of Compliant Movement Primitives. 10 2016.