Singular Configuration Analysis and Singularity Avoidance with Application in an Intelligent Robotic Manipulator

Recently, robotic sensor systems have gained more attention annually in complex system sense strategies. The robotic sensors sense the information from itself and the environment, and fuse information for the use of perception, decision, planning, and control. As an important supplement to traditional industrial robots, co-bots (short for co-working robots) play an increasingly vital role in helping small and medium-sized enterprises realize intelligent manufacturing. They have high flexibility and safety so that they can assist humans to complete highly repetitive and high-precision work. In order to maintain robot safe operation in the increasing complex working environment and human–computer intelligent interactive control, this paper is concerned with the problem of applicant accuracy analysis and singularity avoidance for co-bots. Based on the dynamic model with load and torque sensors, which is used to detect the external force at the end of the robot, this paper systematically analyzes the causes of singularity phenomenon in the robot motion control. The inverse solution is obtained by analytical method and numerical method, respectively. In order to ensure the smooth and safe operation in the whole workspace, it is necessary for a robot to avoid singularity. Singularity avoidance schemes are utilized for different control tasks, including point-to-point control and continuous path control. Corresponding simulation experiments are designed to verify the effectiveness of different evasion schemes, in which the advantages and disadvantages are compared and analyzed.


Introduction
Recently, appliance accuracy analysis and human-computer interaction have undergone rapid development in intelligent assembly machine factories, with typical examples including assembly, polishing, dual-arm coordination, or dexterous hand manipulations [1][2][3]. In order to adapt to small-batch, customized, and short-cycle production, it is necessary for co-bots, a new type of industrial robot that can work with human beings in the same working environment, to develop a hierarchical control algorithm that enables safe and stable cooperative locomotion. With dynamic model and torque sensors, the robot is achieving the drag control by compensations of gravity and friction, which counteract external disturbances. However, it will inevitably lead to the complexity and uncertainty of environment [4,5]. Reaching the singular region makes it easy for a robot to cause various problems, such as instability, poor performance, and so on. Emphasis is placed on the co-bot singularity. Hence, the singularity avoidance is the basis to ensure co-bot stable operation in the man-machine cooperation.
The singular configuration is a phenomenon which hampers the motion of the robot end effector [6,7]. The freedom of the robot end will decrease in a singular configuration, so it cannot be controlled to move in directions. While the robot approaches the singular adjacent region, some joints calculated by the inverse kinematic tend to infinity, which will 1.
The D-H modeling method is utilized to build a joint coordinate system of the JACO2 robot. The inverse kinematics is solved by analytical method and numerical method, and the operation speed and accuracy of two schemes are compared.

2.
The singularity caused by inverse kinematics is analyzed, and the robot singular configuration conditions are based on the block analysis of wrist Jacobian matrix, which are divided into three singular types: internal singularity, external singularity, and wrist singularity.
are divided into three singular types: internal singularity, external singularity, and wrist singularity.
3. According to different task requirements, singularity avoidance schemes are utilized in robot redundancy, damped least squares, and singularity consistency. It is noted that these works focus on the working principle and control methods of robotic sensor system.

D-H Model
The kinematics model of the JACO2 robot with D-H model is illustrated in Figure 1, and its parameters are shown in Table 1.
According to D-H parameters, the transformation matrix between each links is where i = 0, 1, 2 . . . 5. Thus, the forward kinematics equation of the JACO2 robot can be expressed as base T n = base T 0 where i T j denotes the homogeneous transformation matrix from {i} to {j} coordinate system, and Θ = {θ 1 , θ 2 · · · θ n } denotes angle information of each joint. The Euler angle (x-y-z)[α, β, γ] and p = [p x , p v , p z , α, β, γ] T denote attitude of robot end and end pose, respectively, where p x , p y , p z denote robot end position.

Inverse Kinematics
The analytical solution and numerical solution are generally adopted to resolve robot inverse kinematics. The former uses a robot's geometric configuration by separating the forward kinematics parameters. The latter is based on numerical iteration, which obtains the optimal solution by setting objective function and controlling joint angle to move to the opposite gradient direction.
The JACO2 robot is a seven-DOF spherical revolution spherical configuration series robot. For a certain end pose, the robot has countless sets of inverse kinematics solutions. The redundancy makes the JACO2 robot operate more flexible than a traditional six-DOF series robot but increases the computational complexity. Two methods are used to solve inverse kinematics, respectively.

1.
Analytical solution The JACO2 robot has one more rotating joint at third joint and one more offset at fourth joint. Taking the third joint angle θ 3 as the redundant parameter, other joint angles are All inverse kinematics solutions can be obtained by traversing all effective value, and only one set of optimal solution can be selected according to cost function. Therefore, the inverse kinematics optimization problem is simplified as where Θ = [θ 1 θ 2 θ 3 θ 4 θ 5 θ 6 θ 7 ] T is angle vectors of each joint, base T(Θ) is the forward kinematics equation, base T d is the given end pose, and Θ min , Θ max represents the constraint of each joint. Substituting (2) into (3), the inverse kinematics optimization problem is turned into a one-dimensional optimization of θ 3 : Selecting the motion amplitude of each joint as the cost function, where λ i is the weight coefficient, θ t+1 i is the solution of the i-th joint in the current period, and θ t i is the solution of the i-th joint in the previous cycle. A greedy search is used to find the optimal solution.

2.
Numerical solution The numerical method focuses on the equation relationship instead of robot geometric configuration. Given this, f (Θ) = base T n , expected position base T d , which are to be solved with constraints Θ ∈ Θ min , Θ max . The Jacobian matrix describes the relationship between robot end velocity and joint velocity: where .
x = v x v y v z w x w y w z T represents terminal velocity. R 3×3 describes the relationship between Euler angle and terminal angular velocity.

Singular Configuration Analysis
Both of the two methods illustrated in Section 2.2 will introduce singularity. Whether the robot is in a singular configuration depends on the full rank of the Jacobian matrix, where e i is the unit vector of the i-th joint, and r i is the vector between the origin and end position. The Jacobian matrix at the end and wrist satisfies Let c i and s i be abbreviations of cosθ i and sinθ i , respectively, and that det(J e J T e ) = det(J w J T w ), Rank(J e ) = Rank(J w ). According to (8), the Jacobian matrix of wrist is It is expressed as (11) in the wrist coordinate system: where base R w represents wrist Jacobian matrix.

Positional singularity
The unfilled rank of the first three rows of the Jacobian matrix will result in position singularity, which can be described as det( w J 11 where M i represents the determinant of cofactor of matrix w J 11 .
The conditions in whether each co-factor equals zero are expressed as Table 2. Table 2. The condition in which the determinant of the w J 11 cofactor of each order is 0.
When s 4 = 0, the θ 4 joint limitation is 32 •~3 28 • , the robot arms stretch out, and the end is at the boundary point, which is called boundary singularity. The θ 2 joint limitation is 49 •~3 11 • , when d 4 s 3 + d 5 s 3 s 4 = 0, the JACO2 robot is in a singular state, which is called internal singularity, which is shown in Figure 2. The singularity condition is illustrated in Table 3.

Number
Condition Combination in Table 2

Attitude singularity
Similarly, the attitude singularity can be judged by analyzing whether the last three rows of the wrist Jacobian matrix are less than the rank. Substituting each item of Jacobian matrix, the robot attitude singularity condition is shown in Table 4, and its wrist singularity condition is shown in Figure 3.
Not established (4 and 5 cannot be met at the same time).

Attitude singularity
Similarly, the attitude singularity can be judged by analyzing whether the last three rows of the wrist Jacobian matrix are less than the rank. Substituting each item of Jacobian matrix, the robot attitude singularity condition is shown in Table 4, and its wrist singularity condition is shown in Figure 3.
The position singularity is also satisfied. 3

Number Attitude Singularity Satisfying Condition
The position singularity is also satisfied.

Theoretical Analysis
The main purpose of singularity avoidance is to keep the stable, continuous, and bounded running speed of each joint when the robot is in the singular region. The relationship between joint velocity and end velocity is described as Since the Jacobian matrix of the JACO2 robot is a nonsquare matrix, (13) is turned into where = ( ) represents the pseudo-inverse of the Jacobian matrix , is coefficient, and is an arbitrary vector. In order to ensure that the joint velocity is bounded, it is necessary to change Jacobian matrix or end running velocity .

Theoretical Analysis
The main purpose of singularity avoidance is to keep the stable, continuous, and bounded running speed of each joint when the robot is in the singular region. The relationship between joint velocity and end velocity is described as Since the Jacobian matrix of the JACO2 robot is a nonsquare matrix, (13) is turned into where J + = J T J J T −1 represents the pseudo-inverse of the Jacobian matrix J, α is coefficient, and ∇ϕ is an arbitrary vector. In order to ensure that the joint velocity is bounded, it is necessary to change Jacobian matrix J or end running velocity . x.

Internal singularity
To keep the end velocity constant, according to (15), only the Jacobian matrix J needs to be changed. The cost function (10) is introduced to obtain the optimal solution. The function is designed: where J respresents Jacobian matrix corresponding to each group of possible inverse kinematics solutions. Then, det J J T will be maximized to avoid singularity. The cost function can be designed as where σ r and σ 1 represent minimum and maximum singular value, respectively. The convergence direction can be controlled by selecting an appropriate vector ∇ϕ, which controls the gradient of cost function with respect to joint angle Θ. Hence, the equivalent effect of avoiding singularity with the analytical rule is However, considering that all redundant solutions of the JACO2 robot make the manipulator elbow operate on a spatial circle, the above avoidance method can only have a good avoidance effect on the internal singularity and yet have nothing to do with external singularity and pose singularity.

2.
Other singular configurations Other singular configurations cannot be simply avoided by redundant solutions. When the robot elbow is extended, which belongs to external singularity, the robot end is close to the workspace boundary. The robot cannot find the solution far away from the singularity (the fourth joint angle of all solutions approaches π). For six-DOF series industrial robots (most are PUMA type), the method of "singular separation + damping coefficient" adopted in literature [16,21] can obtain good results and analyze the corresponding errors, while it is not suitable for the JACO2 redundant robot, since singular separation effect cannot be realized directly. A damped least squares method is adopted for singular avoidance in this section, which combines the merit of Newton and steepest descent method. It not only ensures the convergence of iterative calculation, but also speeds up the convergence speed.
where J # is the pseudo-inverse of damped Jacobian matrix, Then, minimizing the cost function, and regularizing velocity term by coefficient, Then, we regularize of velocity term by coefficient. The minimum singular value of the Jacobian matrix is used as the criterion to judge whether the robot enters the singular region. Equation (20) can be transformed into .

Avoidance Strategy with End Velocity Changed
The external singularity and wrist singularity are mainly discussed here. The avoidance strategy of end speed change is to change the expected end speed in (15). A path parameter p is introduced to describe the trajectory, and end operation trajectory can be expressed as The tracking of desired trajectory is expressed by mathematical expression, where k(p) represents the forward kinematics solution process, q is the set of path parameters p and joint angles, i.e., q = (q, p). The tracking target will satisfy where S is a unit vector, which satisfies dx(p) = dpS, and dv = dv(x) direction, S is the vector of the end running speed, and parameter P is the end running speed. The general solution of (27) can be expressed as where f ( q) = (adjJ(q))S(p). Equation (29) can be expanded to As long as the trajectory parameters are designed to satisfy (32) and give the joint speed of formula (31), the robot end trajectory can be always followed. It can be found that when the robot approaches the singular configuration, the determinant of the Jacobian matrix approaches 0, and the given constant and joint velocity both tend to infinity. Therefore, the singular phenomenon can be avoided. The constant b is determined by Reprogramming end velocity based on (32), In that the JACO2 robot has redundant joints, (31) is deformed as where b ep and b s f are all constants, J 3 is the Jacobian matrix removing cofactor of column 3, n ep ∈ rowJ, n s f ∈ kerJ. However, when internal singularity occurs, the symbol of det J 3 and dp will change, making the expected trajectory reverse, which is equivalent to an obstacle.
where J i is the Jacobian matrix removing the cofactor of column i, the ith item of n i is always 0, then remove n i item, there is Jn i = C i det J i . The ith item of C i is 1, and other items are 0.
then the symbol dp will not change.

Experimental Results and Comparisons
To demonstrate the performance of the proposed algorithm, a series of simulations and comparisons are conducted. The simulations include a variety of avoidance strategies which basically cover most of the actual situations. Four experimental studies including inverse kinematics solutions and singularity analysis are carried out to test the feasibility of practical application. The symbolic operation toolbox in MATLAB is used for dynamic modeling. The

Two Inverse Kinematics Solutions
Let the robot end run at a speed of 0.1 m/s along the y-axis for 3 s, and control period be 0.1 s. A total of 200 trajectory middle points are inserted. The angles of each joint are calculated by two inverse kinematics solution algorithms. Figure 4 shows the trajectories of two kinematics algorithms. The red points represent the desired points, and blue and green describe trajectories with numerical and analytical solutions, respectively. Their solution errors are shown in Figures 5 and 6.
Let the robot end run at a speed of 0.1 m/s along the y-axis for 3 s, and control period be 0.1 s. A total of 200 trajectory middle points are inserted. The angles of each joint are calculated by two inverse kinematics solution algorithms. Figure 4 shows the trajectories of two kinematics algorithms. The red points represent the desired points, and blue and green describe trajectories with numerical and analytical solutions, respectively. Their solution errors are shown in Figures 5 and 6.   Let the robot end run at a speed of 0.1 m/s along the y-axis for 3 s, and control period be 0.1 s. A total of 200 trajectory middle points are inserted. The angles of each joint are calculated by two inverse kinematics solution algorithms. Figure 4 shows the trajectories of two kinematics algorithms. The red points represent the desired points, and blue and green describe trajectories with numerical and analytical solutions, respectively. Their solution errors are shown in Figures 5 and 6.

Singularity Avoidance
To verify the effectiveness proposed in Section 3, singularity avoidance strategies based on robot redundancy, damped least squares, and singularity consistency are realized, respectively. Let the robot end run at the speed of 0.1 m/s along the positive direction along the z-axis for 7.5 s and then turn back, and continue to run along the negative direc-

Singularity Avoidance
To verify the effectiveness proposed in Section 3, singularity avoidance strategies based on robot redundancy, damped least squares, and singularity consistency are realized, respectively. Let the robot end run at the speed of 0.1 m/s along the positive direction along the z-axis for 7.5 s and then turn back, and continue to run along the negative direction along the z-axis for 7.5 s. Set a control cycle as 0.01 s. The joint state and tracking error are plotted with a sampling period of 0.1 s. The compared simulations are as follows.

1.
Taking no avoiding measures Figure 7 shows the position change curve of each joint, Figure 8 shows the velocity variation curve (4.5 s~4.9 s), and Figure 9 shows the tracking errors of position and orientation (4.5 s~4.9 s).

Singularity Avoidance
To verify the effectiveness proposed in Section 3, singularity avoidance strategies based on robot redundancy, damped least squares, and singularity consistency are realized, respectively. Let the robot end run at the speed of 0.1 m/s along the positive direction along the z-axis for 7.5 s and then turn back, and continue to run along the negative direction along the z-axis for 7.5 s. Set a control cycle as 0.01 s. The joint state and tracking error are plotted with a sampling period of 0.1 s. The compared simulations are as follows. Figure 7 shows the position change curve of each joint, Figure 8 shows the velocity variation curve (4.5 s~4.9 s), and Figure 9 shows the tracking errors of position and orientation (4.5 s~4.9 s).    4. Using damping Jacobian matrix to avoid singularity Assume that = 0.1 is the boundary of the singular region, and = 0.1 is the damping coefficient. Figure 10 shows position change curve of each joint, Figure 11 shows the speed change, and Figure 12 shows tracking errors of position and orientation, respectively.

2.
Using damping Jacobian matrix to avoid singularity Assume that ε = 0.1 is the boundary of the singular region, and λ 2 m = 0.1 is the damping coefficient. Figure 10 shows position change curve of each joint, Figure 11 shows the speed change, and Figure 12 shows tracking errors of position and orientation, respectively.    Figure 11. Velocity of each joint. Figure 11. Velocity of each joint. Figure 11. Velocity of each joint.  3.
Using singular consistency to avoid singularity Figures 13 and 14 show the position and speed change curve of each joint, respectively. Figure 15 shows the running speed of the robot end, Figure 16 shows each item changes of constant b, and Figure 17 shows the tracking errors of position and orientation.  Figure 15 shows the running speed of the robot end, Figure 16 shows each item changes of constant b, and Figure 17 shows the tracking errors of position and orientation.    Figure 15 shows the running speed of the robot end, Figure 16 shows each item changes of constant b, and Figure 17 shows the tracking errors of position and orientation.

Results Discussion
From the simulation results in Section 4.1, it is noted that both accuracies can meet the requirement of inverse kinematics. The average calculation time of using the numerical method to calculate the inverse kinematics solution is 0.0021 s, and using the analytical method is 0.0014 s. The calculation time of two methods is in the same order of magnitude. However, when the robot is in the singular configuration, the numerical method takes three times more time than the numerical method due to more iterations needed. Figures 7-9 show variation curves of joint position, velocity, and tracking error with time under no avoiding measures. It is obvious that the robot enters the singular region

Results Discussion
From the simulation results in Section 4.1, it is noted that both accuracies can meet the requirement of inverse kinematics. The average calculation time of using the numerical method to calculate the inverse kinematics solution is 0.0021 s, and using the analytical method is 0.0014 s. The calculation time of two methods is in the same order of magnitude. However, when the robot is in the singular configuration, the numerical method takes three times more time than the numerical method due to more iterations needed. Figures 7-9 show variation curves of joint position, velocity, and tracking error with time under no avoiding measures. It is obvious that the robot enters the singular region in about 4.65 s. At this time, the angle value of joint 4 is close to π and meets the condition

Results Discussion
From the simulation results in Section 4.1, it is noted that both accuracies can meet the requirement of inverse kinematics. The average calculation time of using the numerical method to calculate the inverse kinematics solution is 0.0021 s, and using the analytical method is 0.0014 s. The calculation time of two methods is in the same order of magnitude.
However, when the robot is in the singular configuration, the numerical method takes three times more time than the numerical method due to more iterations needed. Figures 7-9 show variation curves of joint position, velocity, and tracking error with time under no avoiding measures. It is obvious that the robot enters the singular region in about 4.65 s. At this time, the angle value of joint 4 is close to π and meets the condition of external singularity. Due to the ill condition of the Jacobian matrix, the obtained joint angle has a sudden change, and the joint speed is particularly huge, which is impossible for the motor to realize in practice. Meanwhile, the robot tracking error end pose becomes larger after entering the singular region, since the upper motor speed cannot be tracked in practical operation.
From Figures 10-12, it can be seen that with damping Jacobian matrix (21), the joint angle changes smoothly, and the whole joint speed can be below 1.5 rad/s. After entering the singular region at about 4.65 s, the pose tracking error will also increase to a certain extent. However, the avoidance method has a certain effect on limiting joint speeds, it is too sensitive to the selection of parameters. Hence, it is necessary to design and select appropriate control parameters for different task requirements. Figures 13-17 show variation curves of joint position, velocity, end position, and tracking error with singular consistency to avoid singularity. It can be seen that the robot enters the singular region at about 4.1 s. By changing constant value b i , which makes the following det J i smaller, the desired robot end speed dp are forced to change (Figure 15), to limit the speed of each joint ( Figure 14). Compared with the singularity avoidance methods in Section 3.1, the joint operation is more stable, and the operation speed of each joint can also transit smoothly when entering into singularity region. Moreover, it will not cause an error deviating from desired trajectory. Therefore, when the robot end velocity is constant, the damping least square avoidance method is selected, while the singular consistency avoidance method is more appropriate when the end velocity changes.

Conclusions
The emergence of co-bots is an important supplement to traditional industrial robots, especially for new potential users such as small and medium-sized enterprises and increasingly complex control tasks in 3C electronic products, which determines that co-bots should have characteristics of safe use, simple operation, and convenient deployment. Taking the JACO2 robot as a carrier, this paper provides research on singularity analysis and avoidance strategies to realize safe control and smooth operation of a co-bot in the increasingly complex working environment and man-machine intelligent interactive control. The research results are summarized as follows.
The instability and potential safety hazards of the robot in the singular region are analyzed in detail. The conditions for singularity of the robot are deduced by means of Jacobian matrix separation. Then, the singular configuration conditions are analyzed in detail by means of block analysis of robot wrist Jacobian matrix, which can be divided into three singular types: internal singularity, external singularity, and wrist singularity. For different types of singularity, three singularity avoidance schemes are realized based on robot redundancy and different control tasks. This will ensure safe and stable operation of the co-bot in the whole workspace, and it eliminates safety problems in the man-machine cooperation.
In the future work, it is necessary to study some security issues through other sensors to ensure safety from the perspective of smooth operation, for example, replanning tasks to avoid collision, and adjusting the robot running state according to the working state of the operator. In addition, compliance control can also be studied to improve the robot adaptability with complex industrial tasks.