Singularity Distance Computations for 3-RPR Manipulators Using Extrinsic Metrics

It is well-known that parallel manipulators are prone to singularities. However, there is still a lack of distance evaluation functions, referred to as metrics, for computing the distance between two 3-RPR configurations. The proposed extrinsic metrics take the combinatorial structure of the manipulator into account as well as different design options. Utilizing these extrinsic metrics, we formulate constrained optimization problems. These problems are aimed at identifying the closest singular configurations for a given non-singular configuration. The solution to the associated system of polynomial equations relies on algorithms from numerical algebraic geometry implemented in the software package \texttt{Bertini}. Furthermore, we have developed a computational pipeline for determining the distance to singularity during a one-parametric motion of the manipulator. To facilitate these computations for the user, an open-source interface is developed between software packages \texttt{Maple}, \texttt{Bertini}, and \texttt{Paramotopy}. The effectiveness of the presented approach is demonstrated based on numerical examples and compared with existing indices evaluating the singularity closeness.


Introduction
A 3-RPR manipulator (cf. Fig. 1) is a three Degree-of-Freedom (DoF) planar parallel manipulator with two translational DoFs and one rotational DoF. The base and platform are connected by three legs, where each leg consists of two passive revolute (R) joints connected by an actuated prismatic (P) joint (cf. Fig. 1). Note that we will not consider any motion range limitations on P and R joints.
Let denote the coordinate vectors of the base anchor points with respect to the fixed frame with coordinates ( , ) for = 1, 2, 3. The coordinate vectors of the platform anchor points with respect to the moving frame are with coordinates ( , ) for = 4, 5, 6. Their coordinate vectors with respect to the fixed frame can be computed as: where is a 2 × 2 rotation matrix and is the translation vector. Without loss of generality, we can assume that 1 is the origin of the fixed frame (⇒ 1 = 1 = 0) and 2 is located on the -axis of the fixed frame (⇒ 2 = 0). The same assumptions can be made for the moving frame which implies 4 = 4 = 5 = 0. The remaining six coordinates 2 , 3 , 3 , 5 , 6 , 6 can be seen as the design parameters of the base and platform, respectively.
In the remainder of the paper, we denote a 3-RPR configuration by with ∶= ( 1 , … , 6 ). The 3-RPR manipulator is the best-studied planar parallel mechanism, and their singularities are well understood from various points of view (e.g. [1]). It is well known that 3-RPR manipulators have at least one uncontrollable instantaneous DoF in singular (also known as shaky or infinitesimal flexible) configurations. Moreover in their neighborhood, minor geometry variations caused by, e.g., backlash in the joints and uncertainties in the actuation of P-joints, respectively, can significantly affect the resulting manipulator pose. Another phenomenon that appears close to singularities is that the actuator forces can become very large, which may result in a breakdown of the manipulator [2]. Therefore, singularities and their vicinities should be avoided, which reasons the interest of the kinematic/robotic community in evaluating the singularity closeness. Even though a lot of performance indices are given in the literature, which can also be seen as closeness indices to singularities, there is still a lack of such distance metrics, where one can distinguish the following two kinds: 1. Intrinsic metrics: The distance to the singularity is measured based on the inner metric of the manipulator, which is determined by the distances between and with < and ( , ) ∈ {(1, 2), (2,3), (1,3), (1,4), (2,5), (3,6), (4,5), (5,6), (4,6)}. Singularity distance computations for 3-RPR manipulators using intrinsic metrics is presented by the authors in [3]. 2. Extrinsic metrics: The distance to the singularity is measured based on the metric of the embedding space of the manipulator, which is in our case the Euclidean plane ℝ 2 . The resulting singularity distance also implies the radius of singularity-free spheres in the configuration space, which can e.g. be used for path-planning [4].

Review on extrinsic singularity distance computations
Since the early days of robotics numerous kinematic performance indices 1 have been defined. As a 3-RPR robot cannot transmit the motion standstill of the P-joints to the moving platform within a singular configuration, kinematic performance indices are also sometimes regarded as closeness indices to singularities. As a complete review of all these closeness indices is out of the scope of this paper, we only discuss those that identify the closest singular configuration to a given non-singular one.
• Li et al [6] determined a singularity-free zone around a non-singular configuration as follows: They parameterized the 3-dimensional configuration space by , , , where , are the two position variables and the orientation angle. Then point ( , , ) of the singularity variety which minimizes the function where ( 0 , 0 ) corresponds to the position of the given non-singular configuration. Note that the orientation of the given configuration is not taken into account thus √ is the radius of the circular directrix centered in ( 0 , 0 ) of the "singularity-free cylinder". This concept was also used in [7].
• The second author presented in [8,Eq. (3)] the following extrinsic metric to compute the distance between two configurations and ′ : The upper and lower bullets in Eq. (3) indicate that the distance is measured between corresponding platform and base anchor points of the two configurations. This preliminary extrinsic metric was already used for determining the singularity distance, which has the following physical interpretation according to [8,Theorem 1]: If the radial clearance of the six passive R-joints is smaller than • • then the parallel manipulator is guaranteed to be not in a singular configuration. More details on the performed singularity distance computation are summarized in the next subsection.

Singularity distance computation using the preliminary extrinsic metric
From the line-geometric point of view a 3-RPR configuration ′ is singular if and only if the carrier lines of the three legs intersect in a common point (cf. Fig. 1) or are parallel. This is equivalent to the fact that the Plücker coordinates of these lines are linearly dependent, which results in the algebraic characterization in form of the so-called singularity variety = 0 with The singularity polynomial is of degree 4 in the coordinates ( , ) of the points ′ with respect to the fixed frame (for = 1, … , 6).
The minimization of • • ( , ′ ) given in Eq. (3) under the side condition = 0 of Eq. (4) is a constrained optimization problem, which can be formulated as the Lagrange function with where is the Lagrange multiplier. To find the closest singular configuration, one needs to compute the critical points of as the zero sets of the partial derivatives of with respect to the involved 13 unknowns 1 , … , 6 , 1 , … , 6 and . In [8] the resulting square systems of polynomial equations were solved by using symbolic computations (Göberner basis methods) implemented in a computer algebraic system (software Maple). Then the configuration, which corresponds to the critical point causing the smallest value for • • ( , ′ ), has been assigned as the closest singular configuration (cf. Fig. 2).

Motivation and outline
A limitation of the approach presented in [8] concerns the computational efficiency caused by Gröbner base calculations. As we aim to compute the singularity distance (incl. the closest singularity) along a 1-parametric motion of the manipulator, we use the numerical algebraic geometry tool of homotopy continuation implemented in the freeware Bertini [9]. To facilitate these computations for the user, an open-source interface is developed between the software packages Maple, Bertini [10], and Paramotopy [11]. 4 Moreover, the paper at hand also fills the gap that singular points of the singular variety = 0 are excluded from the Lagrangian approach given in Eq. (5) as pointed out in [4, Section 3.2.2]. We identify these points, which are considered separately within the presented computational pipeline.
A further limitation of the distance metric • • given in Eq. (3) is that it does not take into account how the six anchor points are connected combinatorially. Especially for the three platform/base anchor points one can distinguish two basic design options; namely if they are considered as the vertices of a triangular plate (▴) or as the pin-joints of a triangular bar structure (▵). Note that in the latter case, additional shaky configurations arise by the collinearity of the three base/platform points.
In the general case, the structural components (bars and plates) are assumed to be made of deformable material allowing not only a variation of the leg lengths 2 but also a change of the platform/base geometry by an affine transformation. We also take the option into account that the platform/base is made of a non-deformable material, which is indicated by the symbol ▬, restricting affine transformations to Euclidean motions. Thus we end up with three possibilities (▴, ▵, ▬) for the platform/base, which results in a total of nine interpretations illustrated in Fig. 3.

Remark 1.
Note that we have distinguished the same nine interpretations in the already mentioned study [3] using intrinsic metrics. In the paper at hand, we present the corresponding extrinsic metrics. These paired intrinsic and extrinsic metrics can be used for quantifying the change in the shape of the manipulator implied by variations of the inner geometry, which contributes to the topic of sensitivity analysis (e.g. [12]). ⋄ The combinatorial structure of the nine interpretations of Fig. 3 is taken into account by constructing extrinsic metrics, which rely on the distance computation between corresponding structural components (bars or plates) outlined in Section 2. The constrained optimization problems related to these extrinsic metrics are set up in Section 3. A geometric characterization of the singular points of the constrained varieties is obtained in Section 4. The developed computational pipeline for computing the singularity distance along a 1-parametric motion of the manipulator is given in Section 5. In Section 6 we present a numerical example and discuss the results. We conclude the paper in Section 7.

Extrinsic metric formulation
We start by setting up the distance function between the geometric elements (line segments and triangles) which can be associated with the structural components (bars and plates) of the manipulator.
According to [13], the squared distance between two oriented line-segments | = ( , ) and | ′ = ( ′ , ′ ) can be defined as (cf. Fig. 4 left): This distance metric equals the square root of the mean of squared distances of corresponding 3 points over the entire line segment (see also [14,Section 4.1]. One can extend this idea to compute the squared distance between two triangles ▴ = ( , , ) and ▴ ′ = ( ′ , ′ , ′ ) with < < (cf. Fig. 4 right) which yields (see Appendix A for the derivation) under the side condition that the distance between ′ −1 and ′ −2 does not change, which is expressed by the conditions = 0 and = 0 with Note that due to Lemma 2 given in Appendix B we can always assume without loss of generality that there exists a labeling of our 3-RPR manipulator such that 2 ≠ 0 and 5 ≠ 0 hold, which is needed for the properness of Eqs. (21) and (22).
As a consequence, the Lagrange function reads as where , and are the Lagrange multipliers.
• • ▬ ( , ′ ) with • ∈ {▴, ▵}: In these two cases only the base is transformed by a Euclidean displacement, thus the Lagrange function reads as: • ▬ ⋆ ( , ′ ) with ⋆ ∈ {▴, ▵}: In these two cases, only the platform is transformed by a Euclidean displacement, thus the Lagrange function reads as: • • ⋆ ( , ′ ) with •, ⋆ ∈ {▴, ▵}: In these four cases the platform, as well as the base, are transformed affinely thus the Lagrangian reads as: 8 The unknowns appearing in the given Lagrange functions are summarized in Table 1.
As already mentioned in Section 1.3, we get additional singular configurations if the platform/base is interpreted as a triangular bar structure. The optimization problem for computing the closest configurations with collinear platform/base anchor points is discussed in the next subsection.

Closest configuration on the collinearity variety
If the base or platform is interpreted as a triangular bar-structure (▵) the additional singularities can be characterized algebraically by the condition = 0 and = 0, respectively, with Note that the so-called collinearity varieties = 0 and = 0 are quadratic in 1 , … , 6 , 1 , … , 6 . In the following, we set up the optimization problems for computing the closest singularity on the collinearity variety = 0 and = 0, respectively.
• ▵ ▬ ( , ′ ): In this case, only the platform can deform, thus the Lagrange function with collinearity condition = 0 reads as: • ▬ ▵ ( , ′ ): In this case, only the base can deform, thus the Lagrange function with collinearity condition = 0 reads as: In these two cases the platform, as well as the base, are transformed affinely thus the Lagrangian reads as: In these two cases the platform, as well as the base, are transformed affinely thus the Lagrangian reads as: 9 The number of unknowns for the Lagrange optimization problems for the mentioned above four cases either with collinearity variety = 0 and = 0 is the same as summarized in Table 1.
The platform anchor points of the closest configuration ′ on the collinearity variety = 0 with respect to the extrinsic metric ▵ ⋆ ( , ′ ) with ⋆ ∈ {▴, ▵} are the pedal points of 4 , 5 , 6 on their line of regression (cf. Fig. 5(b) and 5(c)). Moreover, the distance ▵ ⋆ ( , ′ ) only depends on the geometry of the manipulator; i.e. it is pose independent.
Proof. The partial derivatives of Eq. (32) with respect to the twelve coordinates , ( = 1, … 6) and the Lagrange multiplier results in the following ideal of thirteen equations: On the other hand, the pedal points of 4 , 5 , 6 on the line of regression can be obtained as a solution of the following optimization problem: The partial derivatives of Eq. (35) with respect to the six unknowns , ( = 4, 5, 6) including the multiplier 1 results in the following ideal: In order to show that the critical points of both Lagrange formulations are identical, one can eliminate , , for = 1, 2, 3 from the ideal  1 and 1 from  2 i.e.
By the usage of the software Maple, it can be verified that  3 is contained in  4 and vice versa.
To prove that the distance ▵ ⋆ ( , ′ ) is pose independent, we parameterize the pose determined by and in Eq. (1) by Using this parametrization we take again the partial derivatives of Eq. (32) with respect to the twelve coordinates , ( = 1, … 6) and the Lagrange multiplier . We solve the resulting system of 13 equations for , , ( = 1, … 6) by using Gröbner basis package implemented in Maple and obtain two solution sets. Substituting each of the two obtained solutions for , ( = 1, … , 6) back into the extrinsic distance functions given by Eq. 14 and Eq. 16, respectively, shows that the resulting expression only depends on the geometry parameters 5 , 6 , 6 . For the explicit expressions of • ▵ ( , ′ ) with • ∈ {▴, ▵} we refer to Appendix C. The Maple files used for proving Theorem 1 can be downloaded from [16].
Clearly, this theorem also holds by exchanging the platform and the base which yields: Note that the first sentence of Theorem 1 (resp. Theorem 2) does not hold for the metric , which is demonstrated by the following counter-example. Counter example 1. We use as input for our numerical example the one discussed in [ Fig. 5 and their coordinates are given in Table. 2.  Table 2 it can be seen that the coordinates of ′ 4 , ′ 5 , ′ 6 of (a) differ from those of (b) and (c) and that they are not fulfilling the equation of the line of regression. Also the second sentence of Theorem 1 (resp. Theorem 2) does not hold for ▵ ▬ ( , ′ ) (resp. ▬ ▵ ( , ′ )), which can be seen from the example (cf. Fig. 11(a,d)) discussed in Section 6.

Singular points of the constraint varieties
As already mentioned the Lagrangian formulations given in Eqs. (25-28) and Eqs. (30-33) do not take the singular points of the constraint varieties into account. Therefore we have to take care of them separately, which is done in the following two subsections:

Singular points of the singularity variety
We are interested in giving a geometric characterization of the singular points of the singularity variety = 0. As a preparatory work towards this goal, we prove the following lemma: Proof. From Eq. (4) it can be seen that only depends on the free coordinates , ( = 1, … , 6). Partial derivatives of Eq. (4) with respect to these twelve unknowns plus the singularity polynomial results in an overdetermined system of thirteen equations spanning the following ideal: Now to prove translational invariance we make the substitutions in ( = 1, … , 13) resulting in a new system of polynomials forming the following ideal: It can be verified by the computational algebra software Maple that  and  are contained in each other, thus their varieties are identical.
In the second step, we prove the invariance under stretch rotations, for which we make the substitutions in ( = 1, … , 13) resulting in a new set of polynomials forming the following ideal: Again by the usage of the software Maple, it can be verified that  is contained in  and vice versa. The Maple files used for proving Lemma 1 can be downloaded from [16].
By using Lemma 1we can prove the following theorem: Theorem 3. Singular points of the singularity variety = 0 correspond to one of the following configurations: 1. Three legs of the manipulator are collinear (see Fig. 6a).
2. Two legs are collinear and one leg degenerates to a point (see Fig. 6b).
3. Two legs degenerate to points (see Fig. 6c). 4. One leg degenerates to a point and the carrier lines of the remaining two legs pass through that point (see Fig. 6d).
with respect to the 19 unknowns 13 The corresponding result to Lemma 1 also holds with respect to = 0, which is proven in Lemma 3 given in Appendix B. Therefore we can set 1 = 1 = 2 = 0 in order to simplify the set of 19 equations, which allows us to solve them again by using Gröbner basis method implemented in Maple. The corresponding Maple file, which results in 48 solutions, can be downloaded from [16].
Clearly, this theorem also holds by exchanging the platform and the base which yields: are linearly dependent. Algebraically this can be expressed by the set of equations resulting from the partial differentiation of 0 + 1 + 2 1 + 3 2 + 4 + 5 3 + 6 4 with respect to the 25 unknowns They form the following ideal: Similar to the procedure of Lemma 1 one can prove the translational invariance by substituting Eq. (40) into Eq. (51). We were not able to show the invariance under rotations by substituting Eq.
(42) into Eq. (51), as the ideal containment test failed due to the limited computational resources. Therefore we can set 1 = 1 = 0 but not 2 = 0. Moreover, due to Lemma 2 given in Appendix B we can assume without loss of generality that 2 5 ≠ 0 holds. Thus by assuming a suitable scale unit we can set 2 5 = 1. By adding this equation to the ideal of Eq. 51, we end up with: In the following, we prove that no singular points of type (II) exist. By setting = 1 for ∈ {1, … , 6} we obtain the ideal The corresponding basis with respect to graded reverse lexicographic order is denoted by  . According to [18], Hilbert's Nullstellensatz implies that the variety of  is empty if and only if  = {1}. It can be verified by using Maple that  = {1} holds true. The used Maple file can be downloaded from [16].

Parametrizing the set of singular points of the singularity variety
In order to include the set of singular points of the singularity variety into our computation of the singularity distance we parameterize it. We restrict ourselves to the singular points, which correspond to case 1 of Theorem 3, as in practice no leg can have zero length thus cases 2-4 are not of interest. As case 1 of Theorem 3 is more restrictive than the collinearity conditions of Section 4.2 the following relations have to hold: where ′ is the global minimizer of Theorem 1 and 2, respectively, and ′′ denotes the closest singular point belonging to case 1 of Theorem 3. Therefore one only has to compute ′′ for the metrics • ⋆ ( , ′′ ) with •, ⋆ ∈ {▴, ▬}, which is done next: The point ′′ 1 is parameterized by its coordinates ( , ) and the remaining points by: Now we minimize ▴ ▴ ( , ′′ ) under the normalization condition = 0 with ∶= 2 0 + 2 1 − 1, which results in the following Lagrangian formulation: • ▴ ▬ ( , ′′ ): Clearly, ′′ can only exist if the base points of the given manipulator are collinear. If this is the case the parametrization can be done analogously to Eq. (55) with the sole difference that 1 and 2 are already known as they have to equal 2 and 3 , respectively.

Extrinsic metric unknowns in the Lagrangian
The same procedure can be applied as in the last case, just by swapping the roles of the platform and the base.
• ▬ ▬ ( , ′′ ): Now ′′ can only exist if the given base points are collinear as well as the platform points. If this is the case the parametrization can be done as in Eq. (55) under consideration of 1 = 2 , 2 = 3 with 4 = 3 ± 5 and 5 = 3 ± 6 . Due to ± one has to run two optimization problems with six unknowns , , 3 , 0 , 1 , and take the minimum over both.

Singular points of the collinearity variety
It can easily be verified by the reader that the following theorem, which is illustrated in Fig. 7, holds true:

Theorem 7. The singular points of the collinearity variety
= 0 (resp. = 0) of the base (resp. platform) are characterized by ′ 1 = ′ 2 = ′ 3 (resp. ′ 4 = ′ 5 = ′ 6 ). As the condition that three points collapse to a single point is more restrictive than the condition that these three points are collinear the following relation has to hold: where ′ is the global minimizer of Theorem 1 and ′′ denotes the closest singular point of the collinearity variety = 0. We only have to take a closer look at the case of equality in Eq. (57). According to the geometric interpretation given in Theorem 1 the three points ′ 4 , ′ 5 , ′ 6 can only collapse into one point if they are already collinear which contradicts our assumption that the given configuration is not singular. Therefore Eq. (57) can be sharpened as follows:

16
Analogous considerations to the above case yield the inequality where ′ is the global minimizer of Theorem 2 and ′′ denotes the closest singular point of the collinearity variety = 0. Due to the validity of the Eqs. (58) and (59), we can abstain from computing the configurations ′′ for the respective metrics.
If we restrict the base (resp. platform) to be transformed by Euclidean motions, then our set of collinear configurations is only a subset̃ (resp.̃ ) of (resp. ). The singular points of these subsets have the same geometric characterization as given in Theorem 7, which is proven next: Clearly, this theorem also holds by exchanging the platform and the base which yields: Theorem 9. Singular points of the collinearity varietỹ = 0 are characterized by ′ 1 = ′ 2 = ′ 3 . If the base or platform is made of undeformable material we have to compute the closest singular points ′′ , on the collinearity varieties̃ = 0 and̃ = 0 of Theorems 8 and 9, which can be done by solving the optimization problems formulated in the following two equations: where the three platform anchor points of ′′ degenerate to a point ′′ ∶= ( , ) and with ′′ 3 according to Eq. 21; where the three base anchor points of ′′ degenerate to a point ′′ ∶= ( , ) and with ′′ 6 according to Eq. 22. The number of unknowns for these two optimization problems is summarized in Table 4. Extrinsic metric unknowns in the Lagrangian # unknowns , , 4 , 4 , 5 , 5 , 7

Computational procedure
In this section, we present a pipeline for computing the closest singular configuration along a one-parametric motion, which is discretized into poses, for the presented nine interpretations illustrated in Fig. 3. We use numerical algebraic geometry algorithms implemented in the freeware Bertini for computing generic finite solutions and for user-defined homotopy. We compute critical points for each of the poses along the one parametric motion by using Paramotopy [11]. The practical reasons for using the software Bertini are discussed in [15,Section 1]. A detailed discussion of homotopy continuation algorithms and the functioning of the software is not within the scope of the paper, for that we refer to [9,19].
The computations were performed in parallel using a total of 64 threads using AMD Ryzen 7 2700X, 3.7 GHz processor. The computational procedure can be divided into four steps, which are discussed within the following subsections and are illustrated in Fig. 8 of the operational flowchart.

Step 1: Ab-Initio phase
We start with a generic framework by picking randomly all nine remaining coordinates (besides 1 = 1 = 2 = 0) with respect to the fixed frame from the set of complex numbers ℂ. Therefore, we denote the resulting vectors of the anchor points with respect to the fixed frame by ℂ for = 1, … , 6 and consequently the complex configuration by ℂ , which is called source configuration. For this input, we want to find the critical points over ℂ, for each of the Lagrange optimization problems formulated in Section 3.1, Section 3.2, and Section 4.1.1 and Section 4.2. The corresponding unknowns in for the optimization problems are summarized in Table 1, Table 3,  and Table 4, respectively. As already mentioned the number of unknowns for the optimization problems presented in Section 3.2 is the same as summarized in Table 1.
Note that the partial derivatives of with the listed unknowns always result in the square system of non-homogeneous polynomial equations. The critical points obtained from the ab-initio phase are referred to as solutions to the source configuration.
As Bertini computes solutions to the system of polynomial equations with numerical approximations up to 16 digits (default), it is not possible to know the exact root count beforehand, without tracking all the paths. For the optimization problems presented in Section 3.1, Section 3.2 Section 4.1.1 and Section 4.2, we have to find the global minimizers as they correspond to the closest singular configuration. Therefore it is necessary to track all the finite solutions over ℂ without any numerical errors (e.g. path failures) in the ab-initio phase.
The input file required for Bertini to compute the solutions of the source configuration is pre-processed in Maple. It has to be noted that the Bertini package allows numerous configuration settings in the input file to track solutions without path failures. Currently, there is no artificial intelligence module implemented in Bertini1.6v in order to indicate the necessary

Maple Bertini Paramotopy
Ab-initio phase: Pre-processing User-defined homotopy phase Paramotopy phase Post-processing configuration settings required for the given input file given by the user, to track the solutions without numerical errors. Therefore, they have to be fine-tuned manually to the problem at hand. We refer to [10, p. 301-321] for understanding configuration settings in detail. First of all, we have to check if the solution sets of the presented optimization problems contain any higher dimensional components. This can be done in Bertini by invoking Tracktype:1 in the configuration settings of the input files by keeping the remaining settings as default. It shows that no higher dimensional components exist for the source configuration. Thus we can proceed with the computation of the isolated solutions using the regeneration algorithm [20] implemented in Bertini1.6v 5 , which finds the solution to the systems by sequentially solving equationby-equation but has the following limitation. Limitation 1. According to [10, p. 93] using the regeneration algorithm, it is not guaranteed to obtain all the solutions as it discards singular solutions during the computation.
As already mentioned we need to obtain all the generic finite solutions (including singular solutions). By using symbolic methods (e.g. Gröbner basis method within Maple), we are able to reduce each optimization problem to the solution of a univariate polynomial. Its degree corresponds to the root count, which can be used to check if all solutions were tracked by the regeneration algorithm performed with the configuration settings given in Table 5. This is the case according to . Note that these generic solutions only have to be computed once for each of the different optimization problems.

Step 2: User-defined homotopy phase
The input for this step is the geometry of the manipulator given by the real values 2 , 3 , 3 , 5 , 6 , 6 and a 1-parametric motion with parameter ∈ [ ; ]; i.e.
( ) = ( ) + ( ) for = 4, 5, 6 (63) according to Eq. (1). We consider one generic random complex pose of this motion, referred to as seed configuration, by setting where ℂ is a randomly chosen complex number. Now we define a linear homotopy between the vector coordinates of the ab-initio configuration ℂ and the seed configuration by where is the homotopy parameter. By applying this mapping to the polynomial systems of the ab-initio phase, we are able to track the finite solutions of the source configuration to the finite solutions of the seed configuration while is running from 1 to 0.

Step 3: Paramotopy phase
The usage of Paramotopy [11] software comes with two steps. Based on an input file, Paramotopy calls in a first step Bertini to solve the system of polynomial equations at a generic parameter point. These solutions are tracked by Paramotopy in a second step to all desired parameter values again by calling Bertini.
With our seed configuration and its solutions computed in Section 5.2 we can directly enter the second step of Paramotopy, which requires in addition the parameter ℂ and the number of poses (can be defined by the user), in which the 1-parametric motion of Eq. (63), should be discretized. In fact, ∈ [0; 1] is equally subdivided into values, and while runs through this interval the corresponding solutions for the poses are tracked by Paramotopy. While running Step 2 of paramotopy there can still be path failures for each discretized pose, to overcome these failures one needs to re-run failed paths by tuning the configuration settings.

Step 4: Post-processing
In this phase, the obtained real solutions for discretized poses are given as input to Maple. For the corresponding configuration, the distance function is evaluated in order to filter out the global minimizer.

Interface
To operate this pipeline, we developed an open-source software interface between Maple and Bertini as well as Paramotopy, thus that all calls can be made within Maple rather than by switching between the systems. Note that the user needs to run only steps 2-4.

Remark 3.
Steps 2 and 3 of the above given computational pipeline can also be replaced by using both steps of Paramotopy [11]. The drawback is that one always needs to run the first step of Paramotopy which is substantially longer, as it can be seen from Table 10, which lists the computation times for the numerical example discussed in the next section. ⋄

Results and discussion
The presented computational procedure for finding singularity distances is demonstrated on the basis of the following numerical example for all the optimization problems. The base and platform anchor points and the one parametric motion are given by: Note that this 1-parametric motion of the manipulator has two singular configurations at = 0 and ≈ 3.0356972 radians. The interval for the motion parameter is chosen between [0; 2 ]; i.e. = 0 and = 2 . According to Eq. (64) we generate a floating point arithmetic of a random complex ℂ and express the pose of the platform with respect to the base frame by Eq. (67). By defining userdefined homotopies given by Eq. (65), we obtain the system of polynomial equations depending on the homotopy parameter . We invoke User homotopy:2 in the input files, to avoid tracking infinitely long paths (for details see [10, Sec. 7.5.2]). We use generic finite solutions of the source configuration as start solutions and track them to the seed configuration without any path failures. Note that the number of paths to be tracked equals the generic finite root count given in Tables 6-9. For the Paramotopy phase we set = 90; i.e. we discretized the 1-parametric motion into 90 poses. The resulting solution set for each pose is post-processed according to Step 4. A comparison of the average CPU run time 6 (over 5 runs) between both steps of Paramotopy and Step 2 and Step 3 of the proposed algorithm is given in Table 10.
In Fig. 9 we compare the distances to the singularity variety = 0 with respect to the different extrinsic metrics • ⋆ ( , ′ ) with •, ⋆ ∈ {▴, ▵, ▬} to the preliminary one • • ( , ′ ) of Eq. (3). Note that due to the discretization of the motion into 90 poses by Paramotopy, the linearly interpolated value at the singularity ≈ 3.0356972 radians is not exactly zero. In Fig. 10 the closest singular configurations on = 0 are illustrated for the pose = 0.8471710528, which is indicated by the black dashed line in Fig. 9. For the metric • • ( , ′ ) we refer to Fig. 2. For the interpretations possessing a pin-jointed triangular bar structure in the platform or base, the distances to the singularity variety and collinearity variety are compared in Fig. 11. In Fig. 12 the corresponding closest configurations on the collinearity varieties are again illustrated for the pose = 0.8471710528.  Figure 9: Distances to the singularity variety = 0 with respect to the different extrinsic metrics.
In Fig. 13 (a,b,c), we present the comparison of the distances to the closest regular and singular points of the constraint variety. It can be observed that the latter is always larger. The configuration, which corresponds to the closest singular point on the constraint variety, is illustrated in Fig. 13 (d,e,f) for the pose = 0.8471710528.

Remark 4.
The animations of the manipulator's one-parametric motion given in Eq. 67 together with the closest singular configurations implying the graphs of Figs. 9, 11 and 13 can be downloaded from [16]. ⋄ For the singularity distance, we have to take the minimum of the graphs given in Figs. 9, 11 and 13, which yields the graphs given in Fig. 14. Finally, we want to point out that discontinuities in the final graphs of Fig. 14 belong to the cut loci of the extrinsic distance functions; i.e. in the corresponding configurations the closest singular configuration is not determined uniquely (there exist at least two closest singular configurations).

Conclusion and future work
We presented extrinsic metrics for the computation of the closest singular configuration of a 3-RPR parallel manipulator, which takes the combinatorial structure of the mechanism into account as well as different design options. For each of the resulting nine interpretations (Section 1.3) the corresponding extrinsic metric relies on the distance computation between structural components (Section 2).
The constrained optimization problem of computing the closest singular configuration with respect to these nine metrics was formulated using the Lagrangian approach (Section 3). As the singular points of the constraint varieties are missed by this method, we determined them algebraically. Based on their obtained geometric characterization, we parameterized them for a separate optimization (Section 4).
Moreover, we presented an efficient computational algorithm for the singularity distance computation along a 1-parametric motion of the manipulator using the computer algebra system Maple as well as the numerical algebraic geometry software Bertini and Paramotopy (Section 5).
We coded an open-source software interface allowing to make all calls from Maple rather than by switching between the systems. Finally, we validated our approach on hand of a numerical example (Section 6).
Due to the possibility of parallelizing the computations, the proposed singularity distance algorithm has the capability to be executed in real-time, which can be used for singularity-free path planning. In [3], we studied for the same nine interpretations of 3-RPR configurations the computation of singularity distances with respect to intrinsic metrics and compared them to the corresponding extrinsic ones. As already mentioned in Remark 1, the paired intrinsic and extrinsic metrics can be used for sensitivity analysis, which is dedicated to future research.
Finally it should be noted, that the presented method of computing the extrinsic distance to the closest singularity can adopted straightforwardly to any robot, which can be abstracted into a jointed composition of bars, triangular plates and tetrahedral bodies. For the latter ones a similar formula to Eq. (7) can be computed in analogy to Appendix A.