The Generalized Architecture of the Spherical Serial Manipulator

Some architectures of serial manipulators like the RRP have been studied in different ways, for instance, in [1] a RRP manipulator is studied to solve the inverse kinematics problem, IKP for short, near singularities applying the least-square method. Furthermore, by Saeidpourazar [2,3] the forward and inverse kinematics problems are analyzed in a RRP nanomanipulator called MM3A, which is able to perform specific tasks. It was also developed a controller which evaluates the vision and strength of the MM3A.


Introduction
Some architectures of serial manipulators like the RRP have been studied in different ways, for instance, in [1] a RRP manipulator is studied to solve the inverse kinematics problem, IKP for short, near singularities applying the least-square method. Furthermore, by Saeidpourazar [2,3] the forward and inverse kinematics problems are analyzed in a RRP nanomanipulator called MM3A, which is able to perform specific tasks. It was also developed a controller which evaluates the vision and strength of the MM3A.
A numerical method that solves the IKP of six-degree-of-freedom manipulators with combinations of revolute, prismatic or cylindrical joints, is proposed in [4]. A similar study in [5] shows an algorithm for the solution of the inverse kinematics problem of six-or fewer degree-of-freedom manipulators, where the PUMA robot is analyzed as a case study, and being implemented in the KINEM package, which is a software that solves the inverse kinematics problem of several serial manipulators.
DYNAMAN [6], is another simulation software package developed in FORTRAN, where a method to formulate the dynamic equations is applied on serial robots with multiple links, with either revolute or prismatic joints. This software does not have an interface to modify the DH parameters in a simple way. Besides, the model generated lacks of details. SYMORO [7] and OpenSYMORO [8] is an open source software package developed fundamentally in Pythom dedicated to the symbolic modeling of robots. This package provides support to robot models with flexible joints and to mobile robots. It offers support to serial robots with open and closed chains. A visualization tool to perceive the robot structure is also provided. Another software Package, RobSim [9], whose platform is MATLAB, is able tosimulate five manipulator types: spherical, cartesian, cylindrical, and two architectures of the articulated robot (KAU) PYR and RPR, where link dimensions and robot poses can be specified. It also displays the workspace in 2D.
Some references discussed the IKP for different architectures in the same configuration as in [10], which is obtained for a 5R manipulator using Clifford's exponential algebra, it is also presented in [11] a unified solution in closed form of a serial robot with six-degree-offreedom by Pieper's geometry or the Duffy's geometry. On the other hand, Pieper [12], studies rigid body motions onsix-degree-of-freedom manipulators, with revolute or prismatic joints. FORTRAN is applied for the position analysis and trajectory generation. By means of using velocity methods and Newton-Rapshson technics, numeric solutions of the IKP of the general case are presented. Although Pieper's work is focused in the methodology required to solve any type of manipulator with six-degree-of-freedom, only presents the study case of the Stanford manipulator, where the equations to obtain the joint variables are shown.
Paul and Shimano [13], provide rules to assign coordinate frames to manipulator links, including simple cases and prismatic joints. In this work, the Stanford manipulator is presented as study case to prove their algorithm to solve position and orientation.
Khalil and Murareci [14] establish the possibility of considering special values of the geometric parameters of manipulators to take the characteristic polynomial to the simplest form using a minimum number of equations. This polynomial, for special architectures, can be obtained numerically. The RRP architecture is studied only when α 1 = nπ and α 2 = nπ (the first three axes are parallel), besides, an equation for each joint variable is not presented explicitly.
Much of the kinematic analysis presented in the literature provides numerical solution approaches, as in the case of [15], where a finite element method is applied to solve the forward kinematics problem of the Stanford manipulator using the software Maple V. A probabilistic approach, specifically the Monte Carlo method, is applied in [16] to model the kinematic and dynamic random errors of various manipulator parameters, such as those related to the Stanford manipulator. In [17] the equations of motion are developed for any manipulator with two -or three-degree-of-freedom, where the PUMA and the Stanford robots are presented as case studies.
An important subject is the validation of the results obtained in mathematical models with the application of computer packages for simulation. For example, in [18] are implemented in LabVIEW the forward kinematic and the dynamic analysis of a SCARA manipulator, whereas in [19], MATLAB is applied to solve the forward kinematics problem of a spherical manipulator by implementing a FPGA.
It was found, in general, that the specific solution of the IKP of the spherical manipulator is based on either the basic architecture or the architecture defining the Stanford arm, but to the best of our knowledge, the solution to a generalized architecture has not been reported explicitly in the literature. This generalized solution involves the formulation that embrace eight different possible architectures that the spherical manipulator can hold depending on the values of the first two twist angles according to the Denavit-Hartenberg notation [20].
The generalized closed-form solution of RRP serial manipulators presented in this paper, is an important contribution to the research and development field, since the resulting algorithm, represents a powerful tool to study in real time, the motion of all possible architecture combinations within the same framework.
In this research work, a section is dedicated to establish the guidelines of what we call the generalized architecture of the spherical manipulator. Then, we define the eight types of the generalized spherical manipulator, followed by the formulation of the inverse kinematics solution, which in most cases is represented as a closed-form solution. This formulation includes the pseudo-code that was applied as template to implement the code in ADEFID's platform [21]. We have dedicated a section to present an algorithm that generates intermediate poses by providing a single parameter, once the initial and final poses of a linear trajectory have been defined.
In the last section, we present a case study related to a simulation of pick and place operations. We integrate in the simulation, the algorithm for the inverse kinematics solution and the algorithm for the linear trajectory planning. In order to provide a closer taste of the performance, sets of frames are sequentially presented. The simulation is running in real time within the software developed for this application.

The Generalized Spherical Manipulator
The manipulator designed with spherical architecture for the positioning of the wrist center point, is the well-known Stanford arm, whose pioneer model is shown in Figure 1a, while Figure 1b shows a more up-to-date version.
The full architecture of the manipulators described above is identified as RRPRRR. Since the last three joints are connected with the architecture of a spherical wrist (RRR), we will refer to these type of manipulators by the first three joints only, namely, the RRP spherical manipulator.
Our study is focused in the derivation of the inverse kinematics solution for the positioning of the wrist center point of what we call the generalized architecture of the spherical manipulator, in other words, according to the definitions of the links parameters following the Denavit-Hartenberg's notation [20], DH notation for short, all link offsets and link lengths are not zero.
The skeleton representation of the basic architecture of the spherical manipulator along with the corresponding DH parameters, is shown in Figure 2, based on the values given in Table 1, where all link lengths , as well as b 2 are zero. The architecture of the Stanford manipulator, shown in Figure 3, is obtained from the basic architecture of the spherical manipulator by setting b 2 , the offset of the second link, not equal to zero, as shown in Table 2. Now, the generalized architecture, with the parameters given in Table 3, is plotted in Figure 4.

On the Classification
Applying the same concept introduced in [22] regarding the manipulators' architecture, we define here eight different types depending on 1 and 2 values. Thus, 1 can be either 90° or 270°, if the manipulator is right shoulder (R) or left shoulder (L), respectively. Whereas 2 , which defines the direction of motion of the wrist center point while the manipulator is set at the zero configuration with 3 ≠ 0, can hold 0, 90°, 180° , and 270°. Table 4 shows the nomenclature defined for this classification, and Figures 5 and 6, the skeleton representation of right shoulder and left shoulder.   To obtain θ 1 , the joint variable that orientates x 1 with respect to x 0 , we use Fig. 7 as reference, where all the linear dimensions shown, lie in parallel planes to the x 0 -y 0 plane. Thus, θ 1 is obtained as From eq. (1), is related with while is associated with h and r as, with In eq. (4), 2 = cos 2 . Further down we will take into account that ≡ cos and ≡ sin for =1,2,3. It is important to note that the equations derived for the inverse kinematic solution are obtained for an arbitrary value of 2 , and the four values for the architectures defined here become particular cases Figure 7. Now, to obtain 2 , the joint variable that orientates 2 with respect to 1 , we use Figure 8, in this case, all the linear dimensions shown, lie in parallel planes to the 1 -0 plane. Thus, 2 is obtained as

The Generalized Geometric Approach
In this section, we establish an algorithm that describes the inverse kinematics solution of the generalized spherical architecture RRP, with spherical wrist. The approach presented here, holds the eight architectures described in Section 3, nevertheless, we select the RD type to show the variables and to state their geometric relationship that will be applied along the formulation. Therefore, we depart from the fact that except for the joint variables, we know all the values given in Table  5. We also assume that the position of the wrist center point p=(px, py, pz) T , is known.
Now, a projection of 3 is related to 2, 3 and e, namely, To solve 1 and 2 , from eqs. (1) and (5), respectively, we need , β, γ, and . From eq. (2) we see that depends on the position of the wrist center point, which is given, but the other three angles, are functions of 3 , therefore, we must solve eq. (10) first, which for arbitrary values of 2 , must be evaluated numerically. However, if 1 = 0, then 3 is obtained in closed-form as, A similar analysis can be performed to solve the inverse kinematics of the left shoulder manipulator. Now, for the eight types defined in Section 3, a closed-form solution for 3 is also obtained. Taking into account that 3 > 0, there are two possible solutions for a given architecture, and they depend on the position of the manipulator's body, which is represented by the first joint. The first set of solutions 2 = + In eq. (5), is associated with 2 , 3 and a projection of 3 as, =arctan ( 2 3 /( 2 + 3 )) While is related with and by, =arctan ( / ) where, = − 1 (8)       • The desired position vector p of the wrist center point.

*Joint variables
• Now, the pseudo-code for the full inverse kinematics solution is readily defined as: In this case, besides the argument DH, there are other two arguments to pass when calling Set Full Inverse ( ): • The desired orientation of the end effector given by . • The desired position vector of the end-effector reference point d.

Linear Path Tracking
In order to better understand the case study presented in the following section, we report here an algorithm devoted to generate discreet poses given by a single parameter and departing from the knowledge of the initial and final poses of a linear trajectory. Any is listed in Table 6, while the second set, in Table 7. To the best of our knowledge, these sets have not been reported in the literature.
To illustrate the two solutions to reach a given wrist center point, an example of a RD manipulator is presented here. The coordinates of p are (435,78,601) mm, and the two solutions together with the design parameters are shown in Table 8. The simulation is achieved in ADEFID's platform [21], and Figure 9 illustrates the two poses of the manipulator.
With the closed-form solution for the inverse kinematics positioning approach, above introduced, we have derived a pseudocode that consider all possible solutions in which 3 can be evaluated with no need of a numerical solution. Furthermore, 1 and 2 are symbolically expressed so that not only the eight architecures are contemplated but also those architectures with an arbitrary value of 2 if 1 = 0. Such pseudo-code is listed next: Arch. 3 1 2    desired pose of the end effector is represented by its coordinate frame associated with a homogeneous matrix containing the matrix and the vector d, which respectively represent the frame rotation and the position vector with respect to a given reference coordinate frame, as indicated in eq.(13).
Once the initial and final frames, and , of the corresponding poses are defined by and , respectively, intermediate poses in a line path, represented by , can be readily obtained with the aid of a single parameter , with 0 ≤ ≤ 1. To achieve this, it is necessary to define some invariants, such as vector d, defining the position vector of the origin of frame with respect to frame , and the roll, pitch and yaw angles, which we denote as , and . These angles define the orientation of frame with respect to frame by performing basic rotations about , and , represented as ( ), ( ), and ( ), respectively. In Figure 10 we can observe the relationship between the mentioned poses. The function that evaluates the invariants is named Set Invariants ( ), and the pseudo-code is presented below: Now, with the invariants defined with Set Invariants ( ), it is possible to obtain any intermediate pose by calling the function named Get Pose ( ), whose pseudo-code is given as: Functions Get Rot Mat From Pose ( ) and Get Vec From Pose ( ) take care of retrieving respectively, and d from a given matrix. Whereas Get RPY Angles ( ), returns roll, pitch and yaw angles by solving the following equation:

Case Study
The results obtained in this paper were validated through an online simulation developed in ADRS (Architecture Design and Robot Simulation) which is an application developed in ADEFID platform. The simulation consists in the execution of a pick and place operation. The full cycle of this task is composed on a set of control poses along the planned trajectory. In this case it takes four poses besides the home pose to complete the task.
In order to have a better picture of the great advantage of applying the linear tracking approach introduced here in combination with the closed-form solution of the IKP, we describe the algorithm that takes the robot smoothly from the initial pose to final pose of the linear trajectory.
To begin with, we distinguish two main control levels in the simulation program. The first level consisting in the invariants definition of a desired trajectory, and the second level, in the execution of the process to move from one control point to another.
Within a complete cycle, the robot is set in different states. For each state the robot moves from the beginning to the end of the linear trajectory. When the robot reaches the end pose of a given state, it is set as SUSPEND state, meaning that the robot waits for the next control step, and a control step might be triggered by an input signal, either virtual or real.
Let us consider that the action to move from pose A to pose B is defined by the state STATE1, and the input signal is the Boolean variable named Task from A to B. Then the pseudo-code to be performed in the first level, which is part of an infinite loop, is defined as follows: Note that at this control level, the statements are executed only once. Now, for the second level, a switch is applied to consider all the  one of the five control poses mentioned above. Figure 11, displays an image in which the two dialogs are opened together with a sample of a Stanford robot. Note that in the image, Pose A was set by just pressing the button labeled Set From Actual. Now, we applied the algorithm to a simple case, i.e., the Stanford manipulator, which is set as a LU -manipulator. On the ADEFID platform we simulate it with the parameters shown in Table 9.
We have already indicated that for a given architecture there are two possible solutions with 3 > 0, then we present still images of the simulation while performing the task. In Figure 12, four frames show the sequence of the simulation, starting from the top left corner, where the block is picked from the feeding conveyor, and ending to the right bottom corner where the block is delivered. The same simulation is performed in Figure 13, but in this case, with the second solution. These solutions are chosen by setting the variable IsBodySol1 true or false in the Inverse Position ( ) function.
The capacity to import STL files of models created in any CAD software having the feature to export this type of files, is an ADEFID's advantage that allows to create more realistic simulations. Such task,       is achieved through the application of the DrawSTL ( ) function pertaining to the CSTL Draw class. With this function, an OpenGL list for each link of a robot is generated, and all lists are handled to achieve simulations as those shown in Figures 11-13.
As a second example we test the algorithm with the generalized spherical architecture. The DH design parameters applied in this case are given in Table 10. The first and second solutions are shown in Figures  14 and 15, respectively. Considering that it is a generalized architecture, and there is no a specific design of the links, the manipulator is shown in the skeleton form.

Conclusions
The unified orthogonal architecture concept presented in [22] for serial 6R manipulators, motivated the idea to extend the concept on spherical serial RRPRRR manipulators, and we were able to derive a formulation to solve the inverse kinematic problem for a generalized architecture, in other words, for cases in which all the Denavit-Hartenberg parameters involved for the positioning problem are not zero.
With the twist angles combination of the two first joints of the generalized architecture of the spherical serial manipulator, eight different types were defined, and it was shown that the Stanford arm belongs to one of these. It was also found that for each type, two possible solutions exist for the inverse kinematics problem on the positioning of the wrist center point.
Although the general solution reported here for the inverse kinematics problem is numerical, we obtained a closed-form solution for the case in which 1 =0 with an arbitrary value of 2 . Besides, closedform solutions were also obtained for the eight architectures defined in this paper.
We were able to handle all closed-form solutions with the approach of a single algorithm. An original feature of this algorithm is that the user can control the solutions allowing to choose the one that best suits the application requirements. A novel algorithm to follow a linear path of the end effector was also introduced in this paper, knowing its initial and final poses, by controlling the position and orientation along the path with a single parameter. The corresponding pseudo-codes of both algorithms were developed, implemented, and validated within a case study focused in pick and place operations, with the aid of ADEFID through ADRS (Architecture Design and Robot Simulation), which is an open source application dedicated to design and simulate in real time, serial manipulators for industrial and research purposes.