Collision Avoidance for Redundant 7-DOF Robots Using a Critically Damped Dynamic Approach

: The presence of collaborative robots in industrial environments requires that their control strategies include collision avoidance in the generation of trajectories. In general, collision avoidance is performed via additional displacements of the kinematic chain that make the robot move far from the objects that are occasionally inserted into its safety workspace. The variability of the coordinates of the collision points inside the safety volume leads to abrupt movements for the robot. This paper presents a general method for smoothing abrupt movements in robots with one degree of redundancy for collision-avoidance trajectories, employing a second-order digital ﬁlter designed with adjustable critical damping. The method is illustrated by applying it to a redundant robot with a spherical–revolute–spherical type (SRS-type) kinematic chain, which is a benchmark used to test the algorithms ideated for solving this problem. This paper also presents an alternative algorithm for the inverse kinematics of the SRS-type robot and the computational experiments that show the collision avoidance proposal’s performance and its properties through graphical results.


Introduction
Complex tasks require interactions between robots and humans collaboratively. This collaboration comes from sharing tools, operations, and workspaces [1][2][3] and requires specific control techniques to overcome possible collisions between robots and humans or devices located inside the workspace [4]. Such collaboration implies a more significant number of restrictions on the volume available to the end-effector and the respective safety volume (i.e., the geometric spatial volume around the links and the end-effector, where the robot is considered free of collisions) available for the displacements of the robot's kinematic chain [5]. In this sense, a new class of robots is arising, defined as collaborative robots [6,7], which are provided with strategies at the hardware and software levels to avoid collisions and improve the interactions between robots and humans. Collision-avoidance strategies require additional movements of the kinematic chains, which means that the robots need to have greater mobility than what is needed to perform their tasks; that is, they need to be redundant [6,[8][9][10][11] Elements inserted into a robot's safety workspace [12] usually make the robot change its coordinates randomly, causing abrupt variation in the distances to the points belonging to the robot's kinematic chain. If the values of these distances are used as references in collision-avoidance algorithms, the movements of the robot's kinematic chain are abrupt and naturally undesirable. Indeed, abrupt changes in joint variables, besides being physically difficult to obtain, generate vibrations in a wide range of frequencies that cannot be tolerated during machine motion. This is why smoothing the additional motion that avoids a possible collision is an important requirement for any collision-avoidance strategy.
into the robot's safety volume [12,40,41]. The collision-avoidance strategy must avoid the collision by acting in the null space of a redundant robot so that the robot's configuration changes using movements, chosen according to the degree of redundancy [11,30], that do not affect the task performed by the robot. In short, without redundancy, avoiding a possible collision can be achieved only by changing the motion task of the robot.
The collision-avoidance method proposed in this paper holds for robots with only one degree of redundancy. So, we can only exploit a movement with one DOF to avoid a collision. In the literature, for the case of the SRS-type redundant robot of Figure 1, which is a benchmark for this problem, angle α is usually chosen for controlling the distance between the elbow point P e and the collision point P c using criteria such as geometric approaches [1,38], differential maps [17,29], and energy [5,25,26,32]. The problem reduces itself to ideate an inverse-kinematics algorithm that makes angle α perform the internal movements (null-space) of the kinematic chain without changing the position and orientation of the end-effector. 3 Finally, Section 7 draws the conclusions.

Critically Damped Collision Avoidance
Let Pc be a point with an imminent possibility of collision with a redundant robot. Such a point may belong to a human operator or to another apparatus occasionally inserted into the robot's safety volume [12,40,41]. The collision-avoidance strategy must avoid the collision by acting in the null space of a redundant robot so that the robot's configuration changes using movements, chosen according to the degree of redundancy [11,30], that do not affect the task performed by the robot. In short, without redundancy, avoiding a possible collision can be achieved only by changing the motion task of the robot.
The collision-avoidance method proposed in this paper holds for robots with only one degree of redundancy. So, we can only exploit a movement with one DOF to avoid a collision. In the literature, for the case of the SRS-type redundant robot of Figure 1, which is a benchmark for this problem, angle α is usually chosen for controlling the distance between the elbow point Pe and the collision point Pc using criteria such as geometric approaches [1,38], differential maps [17,29], and energy [5,25,26,32]. The problem reduces itself to ideate an inverse-kinematics algorithm that makes angle α perform the internal movements (null-space) of the kinematic chain without changing the position and orientation of the end-effector. From a geometric point of view, the problem consists of verifying the minimum distance, dmin, between the robot and the nearest point, Pc, of a mobile obstacle and then adjusting the value of angle α to guarantee a minimum desired distance, drmin. Considering that point Pc may change its coordinates randomly or abruptly in the space at each measurement of its coordinates (e.g., obtained through sensors or video cameras [42]), the respective change of angle α may produce abrupt oscillations of the joint positions, calculated with inverse-kinematics algorithms, which is an undesirable and often, unpractical result.
To avoid abrupt oscillations in the values of the joint positions, it is interesting to smooth angle-α transients before using them as input data for the inverse-kinematics algorithms. Smoothing improves continuity in signal transitions and variations based on From a geometric point of view, the problem consists of verifying the minimum distance, d min , between the robot and the nearest point, P c , of a mobile obstacle and then adjusting the value of angle α to guarantee a minimum desired distance, dr min . Considering that point P c may change its coordinates randomly or abruptly in the space at each measurement of its coordinates (e.g., obtained through sensors or video cameras [42]), the respective change of angle α may produce abrupt oscillations of the joint positions, calculated with inverse-kinematics algorithms, which is an undesirable and often, unpractical result.
To avoid abrupt oscillations in the values of the joint positions, it is interesting to smooth angle-α transients before using them as input data for the inverse-kinematics algorithms. Smoothing improves continuity in signal transitions and variations based on polynomial numerical interpolations [43]. Such an approach has limitations when the order of signals' derivatives is greater than polynomials' order; indeed, in this case, continuity is no longer guaranteed.
This work proposes that angle α be numerically filtered by using a time-continuous second-order transfer function, G(s), defined as follows, which is critically damped and has a static gain equal to 1 [28]: In Equation (1), α c (s) corresponds to a time-continuous signal input for the α values on the complex s-domain calculated to avoid the collision; α f (s) is the respective continuous output, signal-filtered; and p is an adjustable pole, which allows setting the speed of the transients [28]. The critically damped dynamics consist of second-order systems that have a time response with faster transients without overshoot, where the damping coefficient ξ = 1 [28].
Using the filtered signal, α f , in a trajectory-generator algorithm needs the discretization of the transfer function, G(s), defined by Equation (1). The discretization of G(s) is given by its z-transform associated with a zero-order hold (ZOH) [28] as follows: where T is the desired sample time (in general defined as a function of the computer clock, or interfaces sample times); m is the product Tp; Using the right-shift or delay theorem [28], the variable z behaves like a delay operator for the input and output variables of the discrete transfer function presented in Equation (2). In this way, it is possible to obtain a command line for the algorithm that filters the α angle as follows: where "n" is the discrete parameter, that is, n = 0, 1, . . . , whereas α c and α f are the computedinput and the filtered-output angle α calculated at the instant "n", respectively. It is worth noting that since the signal starts at n = 0, it is necessary to define the initial conditions of α f and α c for n = −2, −1.

Geometric Description
The SRS-type robot is a redundant robot with seven revolute joints (7-DOF) with the possibility of elbow movement, adapted mainly for collaborative tasks between robots or robots and humans [9,44,45]. The scope of applications has encouraged several authors to develop research and proposals for the kinematic modeling of this robot [8,9,26,35,37,46]. A typical SRS-type redundant robot is the Kuka-LBR-iiwa [4,44], whose kinematic model is shown in Figure 1.
With reference to Figure 1, the links are numbered from 0 (the frame) to 7 (the end effector), and the revolute(R)-joint variables are q = [θ 1 θ 2 θ 3 θ 4 θ 5 θ 6 θ 7 ] T (see Here, without losing generality, for the sake of simplicity, the assumption that the tool is displaced a 3 from the center of the spherical wrist is introduced. The seven R-joints are numbered from 1 to 7 following the order they are encountered by moving from the base to the end effector along the 7R kinematic chain of the robot. The 7-DOF Kuka-LBR-iiwa robot is a serial chain of SRS-type. Indeed, the axes of the first three R-joints, with joint variables (θ 1 , θ 2 , θ 3 ), intersect at P s , which is the center of the first S-pair, and the axes of the last three R-joints, with joint variables (θ 5 , θ 6 , θ 7 ), intersect themselves at P w , which is the center of the second S-pair (i.e., the wrist of the robot). The axis of the first R-joint coincides with the y b -axis, whereas the axis of the second R-joint is perpendicular to the y b -axis and passes through P s . The axis of the third R-joint is perpendicular to both the axes of the second and the fourth R-joints and intersects the axis of the fourth R-joint at P e . Points O b , P s , and P w lie on a plane, hereafter named plane-π 1 , which contains the y b -axis. Points P s , P e , and P w lie on another plane, hereafter named plane-π 2 , whose normal is parallel to the axis of the fourth R-joint. The axis of the fifth R-joint passes through P e , is perpendicular to both the axes of the fourth and the sixth R-joints, and intersects the axis of the sixth R-joint at P w : θ 5 is the angle between the axes of the fourth and the sixth R-joints. Eventually, the axis of the seventh R-joint passes through P w and is perpendicular to the axis of the sixth R-joint: θ 6 is the angle between the axes of the fifth and the seventh R-joints.
The constant lengths, shown in Figure 1b, are defined as follows: a 0 is the distance between points O b and P s ; a 1 is the distance between points P s and P e ; a 2 is the distance between points P e and P w ; and a 3 is the distance between points P w and O e . In addition, three characteristic internal points are defined (see Figure 1b): P s -shoulder point-in the center of the first S-pair; P e -elbow point-in the crossing point of the joint axes 3, 4, and 5; and, lastly, P w in the center of the second S-pair (the robot wrist). When θ 3 = 0 rad, the points O b , P s , P e , and P w belong to the same plane (i.e., plane-π 1 and plane-π 2 coincide with one another), making the kinematic chain like a classical 6-DOF anthropomorphic robot. Differently, when θ 3 = 0 rad, point P e goes out of plane-π 1 , and the line passing through points P s and P w becomes the common intersection between plane-π 1 and plane-π 2 , which P e lies on. The angle α between these two planes (see Figure 1b From a geometric point of view, angle α is a rotation angle around the line segment P s P w . In short, we have x = [ b p 7 T b ϕ e T α] T as operational-space coordinates and Mathematically the direct kinematics model: q→x, uses a common methodology such as Denavit-Hartenberg [10,11,30] or successive screws [14,31], among others. Such methodologies are well known and allow the systematic deduction of the kinematics equation. For the inverse kinematics: x→q, the angle α and the end-effector's pose parameters, b p 7 T and b ϕ e T , are known and, in this case [9], the inverse kinematics has a finite number of solutions [14,30,31]. The next section presents a particular solution for the inverse kinematics, refining other propositions [8,11,46] for α Î [0, 2π].

An Analytical Approach to Solve the Inverse Kinematics of SRS-Type Redundant Robots
Let b T e be a homogeneous transformation matrix built from the end-effector's pose parameters, b p e T and b ϕ e T , which locates a Cartesian reference P w -x 7 y 7 z 7 fixed to link 7 with respect to O b -x b y b z b . Additionally, consider, without losing generality, that the tool action point of the end-effector is in the O e -x e y e z e frame, as shown in Figure 1a, and has its pose with respect to the Cartesian reference P w -x 7 y 7 z 7 identified by a known and constant homogeneous matrix 7 T e . Thus, we have the two known homogeneous matrices ( j R i and j p i stand for the rotation matrix and the position vector, respectively, associated with the homogeneous transformation matrix j T i ): The first step consists of setting θ 3 = 0 rad to make the SRS-type robot's kinematic chain like a classical 6-DOF anthropomorphic robot. Considering the resultant 6-DOF sub-structure, the solution of the inverse kinematics calculates an intermediary joint position vector q = [θ 1 θ 2 θ 4 θ 5 θ 6 θ 7 ] T , with θ 3 = 0 rad through an analytical procedure [30,31,39].
With the values obtained for q, it is possible to calculate the coordinates of P s , P eo , and P w , where P eo is the coordinates of P e when α = 0 rad (or θ 3 = 0 rad). The next step consists of rotating P eo around the axis P s P w by the known angle α for calculating the actual coordinates of P e , as shown in Figure 1b. Using Rodrigues's rotation formula [14,31] to perform this rotation yields the following relationship: where u = u x u y u z T = (P w − P s )/ P w − P s is the unit vector that identifies the rotation axis with reference to which angle α is defined, whereas cα and sα stand for cosα and sinα, respectively. The above-described two steps calculated the coordinates of the characteristic internal points P s , P e and P w . Now, these computed data can be used in the third step for adjusting the joint-space vector according to the actual value of angle α of the final configuration of the robot. Note that after the rotation of angle α, only the angle θ 4 remains the same, and all the other joint variables require a correction that must be computed.
Joints θ 1 , θ 2 , and θ 3 compose the first spherical wrist with orientation defined by the consecutive elemental rotations of the YZX Tait-Bryan angles where the directions of the y, z, and x-axes coincide with the R-pair axes of the wrist (see Figure 1). This definition yields the following rotation matrix of link 3 with respect to the base: where c i and s i denote cosθ i and sinθ i , for i = 1, 2, 3, respectively. Additionally, the same b R 3 rotation matrix can be obtained numerically using the coordinates of the characteristic internal points as follows: where, considering that (see Figure 1b) P eu = P s + ((P e − P s ) · u)u is the projection [31,43,47] of P e onto the line defined by the segment P s P w and v = P e − P eu : The comparison of Equations (6) and (7) allows the deduction of the following explicit expressions for θ 1 , θ 2 , and θ 3 : where sign(θ 2 ) is the chosen sign for θ 2 determining if θ 2 ∈ −π 2 , π 2 rad for sign(θ 2 ) > 0 or if θ 2 ∈ π 2 , 3π 2 rad for sign(θ 2 ) < 0. Note that for θ 2 = kπ ± π 2 rad, for k = 0, 1, . . . , it configures a singular posture in the first S-pair since, in this case, the axes of the R-joints 1 and 3 are aligned. Such a singularity is additional to the others, which are the alignment of links 3 and 4, when θ 4 = 0, and the axis alignment of joints 5 and 7 in the second S-pair (the robot wrist), both common to anthropomorphic robots with six DOFs.
Knowing the angles θ 1 , θ 2 , θ 3 , and θ 4 , the rotation matrix b R 4 describes the rotation of the frame of link 4 with respect to the base frame as follows: where 3 R 4 is the rotation matrix that relates the orientation of link 4 with respect to link 3 described by an elementary rotation around the z-axis by the angle θ 4 . The known rotation matrices b R e and 7 R e that appear in Equation (4) and the rotation matrix b R 4 computed through Equation (10) are related by the following relationship, which enables the computation of the remaining joint variables θ 5 , θ 6 , and θ 7 : Indeed, isolating 4 R 7 in Equation (11) yields the following result: The second S-pair orientates link 7 with respect to link 4 through the angles θ 5 , θ 6 , and θ 7 defined as the consecutive elemental rotations of the XZX proper Euler angles, where the directions of the x, z, and x-axes coincide with the R-pair axes of the S-pair (see Figure 1). Therefore, the following expression of rotation matrix 4 R 7 holds: Comparing the rotation matrices presented in Equations (12) and (13) reaches the expressions for θ 5 , θ 6 , and θ 7 as follows: θ 5 = Atan2(sign(θ 6 )n 31 , sign(θ 6 )n 21 ) θ 6 = Atan2 sign(θ 6 ) n 2 12 + n 2 13 , n 11 θ 7 = Atan2(sign(θ 6 )n 13 , −sign(θ 6 )n 12 ) (14) where sign(θ 6 ) is the chosen sign for θ 6 determining if θ 6 ∈ (0, π) rad for sign(θ 6 ) > 0 or if θ 6 ∈ (−π, 0) rad for sign(θ 6 ) < 0.
The joint variables computed with Equations (9) and (14), together with the value of θ 4 obtained in the inverse kinematics of the intermediate 6-DOF sub-model, yield the sought-after joint-space vector q that solves the inverse kinematics.

Typical Strategy for Collision Avoidance
When an obstacle enters the robot's safety volume, the collision-avoidance strategy must impose additional movements for the robot that prevent the possibility of a collision [14,30].
The typical collision-avoidance approach firstly measures the distance, d, between the nearest point of the obstacle (i.e., point P c ) and a relevant point of the robot, in general, the "elbow", which, in Figure 1, is point P e . Then, by moving point P e , it tries to keep, in the worst case, point P c on the spherical surface with the center at point P e and radius equal to the minimum desired distance, dr min ; that is, it imposes d ≥ dr min .
In an SRS-type robot, if the value of dr min is less than the lengths of the segments P s P e and/or P e P w , point P c can collide with one of the links belonging to the kinematic chain, thus making the strategy unfeasible.

Proposition of a New Approach for Obstacle Measurement
Let the kinematic structure of a robot be defined through a set of relevant points, such as intersections of R-pair axes and centers of spherical wrists. Hereafter, the segments between any two relevant points will be called referential links. It is worth noting that the referential links are not constrained to keep their lengths constant during the robot's motion.
This paper proposes the use of axis-symmetric solids, such as right circular cylinders and truncated right-cones (i.e., a right-cone whose top is cut by a plane parallel to the base), whose axes of symmetry are the referential links, to define the boundaries of safety regions around the links of the robot. In addition, for the relevant points, if necessary, the use of a sphere determines the boundaries of a safety region, as used in conventional approaches [4,9]. The objective of collision avoidance is to keep the points belonging to the obstacles out, or on the boundaries of the safety regions defined by all the above-defined solids. For the SRS-type model, therefore, we have P s , P e , and P w as relevant points, and the segments P s P e and P e P w [11] as the respective referential links.
Considering the referential linksP s P e and P e P w , we propose the use of truncated right cones to define the boundary of a safety volume around the robot links. For the line segment P s P e , the truncated right cone has its smaller base circle with radius d cmin centered at point P s and the larger base circle with radius d cmax centered at point P e . Similarly, for the line segment P e P w , the truncated right cone has its larger base circle with radius d cmax centered at point P e and the smaller base circle with radius d cmin centered at point P w . Eventually, as the elbow is a relevant point that is exposed, a sphere, centered at point P e with radius d cmax , defines the boundary of its safety volume. Figure 2 shows the SRS-type robot together with its safety volume defined as explained above.  It is worth stressing that points Ps and Pw, when under the imminence of a collision, cannot be moved, since Ps is fixed with respect to the base coordinate system and a displacement of point Pw implies changes in the position or direction of the end-effector. In these cases, it is interesting to use dcmin = 0, for real applications featuring a right cone, as a safety volume.

Computing the Minimum Distance and Respective Collision-Avoidance Angle α
Concerning Figure 3, let us consider a point, Pc, belonging to an obstacle located inside the space region where the robot moves and placed on one side of plane-π2, which is identified by the sign . Additionally, let us consider the Pc projection points Pc1 and Pc2 onto the lines defined by the referential links PsPe and PePw, respectively [47]. The following relationships hold: It is worth stressing that points P s and P w , when under the imminence of a collision, cannot be moved, since P s is fixed with respect to the base coordinate system and a displacement of point P w implies changes in the position or direction of the end-effector. In these cases, it is interesting to use d cmin = 0, for real applications featuring a right cone, as a safety volume.

Computing the Minimum Distance and Respective Collision-Avoidance Angle α
Concerning Figure 3, let us consider a point, P c , belonging to an obstacle located inside the space region where the robot moves and placed on one side of plane-π 2 , which is identified by the sign g. Additionally, let us consider the P c projection points P c1 and Robotics 2022, 11, 93 9 of 19 P c2 onto the lines defined by the referential links P s P e and P e P w , respectively [47]. The following relationships hold: (15) is identified by the sign . Additionally, let us consider the Pc p Pc2 onto the lines defined by the referential links PsPe and PeP following relationships hold: P P P P P P P P P P P P P P P P P P P P  In the proposed algorithm, evaluating whether point P c1 (P c2 ) is inside the segment P s P e (segment P e P w ) is the first step. Both, just one, or even none of the two points may belong to their respective segments. Such an evaluation will be true if it is true that for the two parameters u 1 and u 2 , defined as follows: where the conditions u 1 ∈ [0, 1] and u 2 ∈ [0, 1] hold. If P c1 (P c2 ) belongs to P s P e (to P e P w ), the next step consists of the computation of the three distances: 1], which are the distances of P c , respectively, from the referential link P s P e , the relevant point P e , and the referential link P e P w . Considering the minimum and maximum radii of the truncated cones (see Figure 2), the minimum allowed safety distance d m1 and d m2 , for each cone of each link are calculated as follows: The collision will be imminent if d a < d m1 or d b < d cmax or d c < d m2 . The three inequalities can be false, which implies that there is no possibility of collision; that is, α c (n) = 0 rad (see Equations (2) and (3)). Differently, if one or more inequalities are true, one or more points on the robot's kinematic chain are under collision imminence. In this case, with only one degree of redundancy and, therefore, only one possible additional movement, the smallest among the minimum distances exceeded (d a or d b or d c ) will be identified and will serve as a reference for calculating angle α c (n) (see Figure 4).
Let us consider the case (see Figure 4) where the minimu point Pc and the robot link PsPe is less than the allowed distan make the distance between Pc and its projection, Pcol, onto PsPe at implies moving Pcol from its initial position to at least point Pr of (see Figure 1b). Let us consider the case (see Figure 4) where the minimum distance between the point P c and the robot link P s P e is less than the allowed distance d m1 . Angle α c (n) must make the distance between P c and its projection, P col , onto P s P e at least equal to d m1 , which implies moving P col from its initial position to at least point P r of Figure 4 by changing α (see Figure 1b).
Let P cu be the projection point of P c onto the line segment P s P w , calculated as follows: Thus, inspecting Figure 4, one notes that the angle α c (n) = γ − β, with where k 1 = P col − P cu , and k 2 = P c − P cu , v 1 = P eo −P eu P eo −P eu , v 2 = P c −P eu P c −P eu , and g = ((P c − P cu ) × (P col − P cu )) · (P w − P s ). The sign of g indicates which side of plane-π 2 point P c belongs to (see Figure 3) and determines the rotation direction of the angles γ and β.
For the n th iteration of the trajectory generation, the previous steps can be summarized in Algorithm 1.

Algorithm 1.
Computation of angle α f at the n th iteration.
1 Input 2 Desired position and orientation of the end-effector at the iteration n; 3 Compute the inverse kinematics for α c = 0 rad; 4 Coordinates of the points belonging to the referential links and relevant points % In this development P s , P e and P w 5 Retrieve the values of α c (n − 1), α c (n − 2), α f (n − 1), α f (n − 2) 6 P c % Coordinates of a possible collision point 7 find← false; % Boolean variable to indicate if a collision point exists inside safety volume. 8 d mc ← 0; % Initializing the minimum of the minimal distances. 9 P col ← []; % Point in the kinematic chain with the minor distance to P c . 10 Compute u 1 and u 2 ; 11 if u 1 ∈ [0, 1] then % P c1 is between P s and P e 12 d a = P c − P c1 ; 13 if d a < d m1 then 15 d mc ←d m1 ; % saving the minimal allowed distance 16 P col ← P c1 ; % saving the point on the kinematic chain 17 find← true; end 18 elseif u 2 ∈ [0, 1] then % P c2 is between P e and P w 19  Compute γ and β; 39 (3) 41 Solve inverse kinematics using α f (n); 42 Output Save joint positions;

Graphical Results
Numerical simulations were conducted to validate the proposed collision-avoidance strategy. In these simulations, the Kuka-LBR-iiwa real lengths [45], that is, a 0 = 340 mm, a 1 = 400 mm, a 2 = 400 mm, and a 3 = 126 mm, were selected for the geometric model of the SRS-type robot. Additionally, the chosen motion task for the robot is an end-effector  The simulation environment, over the robot, includes two human arms identified as Human-arm 1 and Human-arm 2, composed of two links and located in the space by three points named shoulder, elbow, and hand, thus improving the experiments presented in [48], where only one arm is used. The links shoulder-elbow and elbow-hand have lengths [49] of 319.6 mm and 246.5 mm with angle displacement defined with respect to the x b -axis. The chosen motion for these two arms makes the three above-mentioned points perform oscillatory movements with the motion parameters reported in Table 1. Human-arm motion takes place while the robot's end-effector performs the above-defined five circular paths with the center at [400 200 200] T mm and a radius of 200 mm. The tests were developed on a laptop with an Intel Core i7 CPU (2.7 GHz, 800 Gb RAM), spending 3.68 s in execution. All the simulations were developed by using MATLAB R2021a. Eventually, the second-order transfer function, the reference for programming the filter, was adjusted with p = 0.2 s −1 , and the sampling time was adjusted to T = 0.06 s, which corresponds to m = pT = 0.012 and a simulation cycle of 60 s. It is worth stressing that, to avoid muscular injuries, a worker should not execute motion cycles with a period lower than 60 s; so, in these simulations, the human-arm motion is much faster than the admitted one (i.e., the chosen parameters make the simulation environment much faster than a realistic one).
The graphical simulation environment presented in Figure 5 enables us to observe the evolution of the proposed algorithm and the SRS-type's end-effector performance following the desired trajectory while dealing with collision avoidance.
A video that presents the complete simulation experiment of the proposed algorithm is available at [50] and as "Supplementary Materials" accompanying this paper. Figure 6 presents three frames from the above-mentioned video showing the SRS-type robot while avoiding a collision. The video shows that, in this simulation environment, a sampling rate (=1/T) of 16.7 Hz is sufficient to avoid collision with the proposed strategy. It is worth stressing that since this sampling rate corresponds to a "reaction time" of 60 ms for the robot and the human reaction time is about 200 ms, the proposed strategy can enable the robot to react three times faster than a human being. 13 The tests were developed on a laptop with an Intel Core i7 CPU (2.7 GHz, 8,00 Gb RAM), spending 3.68 s in execution. All the simulations were developed by using MATLAB R2021a. Eventually, the second-order transfer function, the reference for programming the filter, was adjusted with p = 0.2 s −1 , and the sampling time was adjusted to T = 0.06 s, which corresponds to m = pT = 0.012 and a simulation cycle of 60 s. It is worth stressing that, to avoid muscular injuries, a worker should not execute motion cycles with a period lower than 60 s; so, in these simulations, the human-arm motion is much faster than the admitted one (i.e., the chosen parameters make the simulation environment much faster than a realistic one).
The graphical simulation environment presented in Figure 5 enables us to observe the evolution of the proposed algorithm and the SRS-type's end-effector performance following the desired trajectory while dealing with collision avoidance.
A video that presents the complete simulation experiment of the proposed algorithm is available at [50] and as "supplementary material" accompanying this paper. Figure 6 presents three frames from the above-mentioned video showing the SRS-type robot while avoiding a collision. The video shows that, in this simulation environment, a sampling rate (=1/T) of 16.7 Hz is sufficient to avoid collision with the proposed strategy. It is worth stressing that since this sampling rate corresponds to a "reaction time" of 60 ms for the robot and the human reaction time is about 200 ms, the proposed strategy can enable the robot to react three times faster than a human being.  Figure 7 shows the computed angle αc and its filtered counterpart αf, used as a reference for the inverse kinematics, during the simulation cycle. The analysis of Figure 7 reveals that αf is a regular curve.  Figure 7 shows the computed angle α c and its filtered counterpart α f , used as a reference for the inverse kinematics, during the simulation cycle. The analysis of Figure 7 reveals that α f is a regular curve. The inverse-kinematics solution of the SRS-type robot yields the position profile of joints 1, 2, and 3, which are θ1, θ2, and θ3, respectively, presented in Figure 10; as well as joints 4, 5, 6, and 7, which are θ4, θ5, θ6, and θ7, respectively, presented in Figure 11.   The inverse-kinematics solution of the SRS-type robot yields the position profile of joints 1, 2, and 3, which are θ1, θ2, and θ3, respectively, presented in Figure 10; as well as joints 4, 5, 6, and 7, which are θ4, θ5, θ6, and θ7, respectively, presented in Figure 11.      The inverse-kinematics solution of the SRS-type robot yields the position profile of joints 1, 2, and 3, which are θ 1 , θ 2 , and θ 3 , respectively, presented in Figure 10; as well as joints 4, 5, 6, and 7, which are θ 4 , θ 5 , θ 6 , and θ 7 , respectively, presented in Figure 11.  For each iteration, and considering the known sampling time T, the rates of changes of joint variables and corresponding accelerations were calculated for each joint by firstorder approximations. Thus, taking the maximum and minimum values obtained, Figures  12 and 13 show the range achieved for the rate of change of position and acceleration, respectively, in each iteration of all robot joint variables. The rates of joint positions and acceleration behavior did not show abrupt variations, remaining in a limited range with similar magnitudes.
The angle αf smooths the resultant distances between the robot and the collision point. Figure 14 shows the behavior of the distance between the SRS-type robot and the collision point (red) along the simulation, compared with the distances when under imminent collision (blue). It is worth mentioning that when the robot is out of collision avoidance, the distance dmc used to calculate the angle αf is adjusted to 0, as seen in line 37 of Algorithm 1.  For each iteration, and considering the known sampling time T, the rates of changes of joint variables and corresponding accelerations were calculated for each joint by firstorder approximations. Thus, taking the maximum and minimum values obtained, Figures  12 and 13 show the range achieved for the rate of change of position and acceleration, respectively, in each iteration of all robot joint variables. The rates of joint positions and acceleration behavior did not show abrupt variations, remaining in a limited range with similar magnitudes.
The angle αf smooths the resultant distances between the robot and the collision point. Figure 14 shows the behavior of the distance between the SRS-type robot and the collision point (red) along the simulation, compared with the distances when under imminent collision (blue). It is worth mentioning that when the robot is out of collision avoidance, the distance dmc used to calculate the angle αf is adjusted to 0, as seen in line 37 of Algorithm 1.  The angle αf smooths the resultant distances between the robot and the collision point. Figure 14 shows the behavior of the distance between the SRS-type robot and the collision point (red) along the simulation, compared with the distances when under imminent collision (blue). It is worth mentioning that when the robot is out of collision avoidance, the distance dmc used to calculate the angle αf is adjusted to 0, as seen in line 37 of Algorithm 1.

Discussions
The results presented in the test showed that the proposed algorithm smoothed all the joints' position and velocity profiles in a dynamic environment.
The test aims at replicating the relationship between a collision point crossing a circle and the consequent problem of variation in the resulting distances projected on the robot's links. Although the collision curve is deterministic in the test, the procedure applies to random variations in the collision point coordinates or a more significant number of collision points, including the number of links and relevant robot points. The algorithm can deal with multiple collision points, attempting to move the robot away from that nearest collision point. For the collision avoidance on k simultaneous collision points, the robot should have a redundancy index r = k; for example, if it is necessary to have three collision points or control the three distances, such as da, db, and dc discussed in Section 4.3, the robot should have degrees of redundancy r = 3. In this way, the algorithm should be executed three times for each collision point featuring its expandability.
The presented inverse kinematics, which solves the α angle for the four quadrants, is based on review propositions [8,39,48] and refines them, thus improving the formulation.
Additionally, in the presented simulation, the available degree of redundancy is 1, and it is strictly sufficient to solve the collision-avoidance problem without including the joint limits control, as was achieved in other papers [15,20,48,[51][52][53] where the introduced redundancy was exploited by optimization procedures to find the best α that avoids The angle α f smooths the resultant distances between the robot and the collision point. Figure 14 shows the behavior of the distance between the SRS-type robot and the collision point (red) along the simulation, compared with the distances when under imminent collision (blue). It is worth mentioning that when the robot is out of collision avoidance, the distance d mc used to calculate the angle α f is adjusted to 0, as seen in line 37 of Algorithm 1.

Discussions
The results presented in the test showed that the proposed algorithm smoothed all the joints' position and velocity profiles in a dynamic environment.
The test aims at replicating the relationship between a collision point crossing a circle and the consequent problem of variation in the resulting distances projected on the robot's links. Although the collision curve is deterministic in the test, the procedure applies to random variations in the collision point coordinates or a more significant number of collision points, including the number of links and relevant robot points. The algorithm can deal with multiple collision points, attempting to move the robot away from that nearest collision point. For the collision avoidance on k simultaneous collision points, the robot should have a redundancy index r = k; for example, if it is necessary to have three collision points or control the three distances, such as da, db, and dc discussed in Section 4.3, the robot should have degrees of redundancy r = 3. In this way, the algorithm should be executed three times for each collision point featuring its expandability.

Discussions
The results presented in the test showed that the proposed algorithm smoothed all the joints' position and velocity profiles in a dynamic environment.
The test aims at replicating the relationship between a collision point crossing a circle and the consequent problem of variation in the resulting distances projected on the robot's links. Although the collision curve is deterministic in the test, the procedure applies to random variations in the collision point coordinates or a more significant number of collision points, including the number of links and relevant robot points. The algorithm can deal with multiple collision points, attempting to move the robot away from that nearest collision point. For the collision avoidance on k simultaneous collision points, the robot should have a redundancy index r = k; for example, if it is necessary to have three collision points or control the three distances, such as d a , d b , and d c discussed in Section 4.3, the robot should have degrees of redundancy r = 3. In this way, the algorithm should be executed three times for each collision point featuring its expandability.
The presented inverse kinematics, which solves the α angle for the four quadrants, is based on review propositions [8,39,48] and refines them, thus improving the formulation.
Additionally, in the presented simulation, the available degree of redundancy is 1, and it is strictly sufficient to solve the collision-avoidance problem without including the joint limits control, as was achieved in other papers [15,20,48,[51][52][53] where the introduced redundancy was exploited by optimization procedures to find the best α that avoids reaching joint-position limits. The possible involvement of joint-position limits' control, over collision avoidance, in programming trajectories and kinematic algorithms solely depends on the availability of redundancy degrees higher than one, which, if available, can be exploited by implementing one of the strategies proposed in the literature, even with the proposed algorithm.
Similar algorithms present safety volumes described by a limited number of points [44,54] or based on numerical approaches [4,20]. The here-discussed proposal uses a parametric surface around the links, instead of limited volumes as discussed in [4], to define the safety volume in the computation of the collision distance for any point of the link, which makes this new approach more realistic and reliable.
At the same time, the use of a second-order filter makes the strategy feasible, adjustable, and replicable, ensuring, together with the description of the safety volume, smooth transients in the trajectories as well as an analytical collision-avoidance algorithm without numerical procedures that increase the computational burden, as found in [23]. The smoothing of the collision-avoidance transients appears in the bounded rate of positions and acceleration profiles for the robot joints (see Figures 12 and 13), continuously ensuring that discontinuities, such as those shown in [4,54,55], do not arise despite the dynamic environment.
Using a digital filter in the transition between paths to be followed by the joints additionally guarantees the smoothness of the programmed trajectories.
It is important to note that the collision-avoidance algorithm's proposition has limitations when several collision points or several links lead to opposite displacements generating conflicts of movements characterizing singularities. Concerning the singularities, it is observed that collision avoidance does not occur when g = 0, or the collision point P c belongs to the plane formed by the points P s , P w , and P e , as can be seen in Figures 3 and 4; that is, D = (P c − P s ) · n p n p = 0 (20) where D corresponds to the distance between the point P c and the plane formed by the points P s , P w , and P e , and n p is the result of a cross-product as follows: It is interesting to note that angle α f does not produce errors of position and orientation of the end effector, despite the need for a time of accommodation or convergence to the final values following trajectories, since its primary task is to control the distance from the collision.
However, the need for transitory times for collision avoidance means suitable adjustments to the filter time constant according to the desired performance and control specifications.
The proposed algorithm can deal with collision avoidance between multiple robots simultaneously. In this case, the distance between the robot's links is controlled by calculating the geometric distance between the line segments to which the links belong. Thus, taking a robot as a reference, the P c points belong to the other robots, and running the proposed algorithm in each robot's trajectory generator allows several robots to share the same space without generating collisions.

Conclusions
Workspaces shared between robots and humans in collaborative tasks require strategies that include collision avoidance and the programming of smooth transitional displacements.
This paper presented an algorithm for the treatment of collision and posture adjustment of robots based on analytical spatial geometry and the use of digital second-order critically damped filters. The strategy includes a posture adjustment of the robot based on an additional movement, defined as α, available for the redundant 7-DOF SRS-type robot. The simulations showed the smoothing of the joints' trajectory profiles and collision avoidance effectiveness without collisions in a dynamic environment.
The geometric approach allowed us to present a proposition for inverse kinematics considering the posture adjustment and the projection of the collision point on any point on the links of the robot's kinematic chain.
Spatial surfaces were used as an example for the determination of the safety regions of the robot. For relevant points and links (under imminent collision), we used the formulation of spheres and truncated cones, which allows us to identify the possibility of collision and activate the collision-avoidance strategy. According to the geometry of links and components that form the environment where the robot is inserted, other formulations can be adapted and used as safety surfaces.
The proposed collision-avoidance solution is feasible and straightforward, providing a quick implementation solution for collaborative robots. The fact that the proposal is based only on analytical formulations reduces the computational effort, thus increasing the reliability of the solutions for trajectories and the efficiency of collision control and other processing in each sampling time.