Analysis of Open Architecture 6R Robot Forward and Inverse Kinematics Adaptive to Structural Variations

This paper presents a kinematic analysis for an open architecture 6R robot controller, which is designed to control robots made by domestic manufactures with structural variations. Usually, robot kinematic studies are often introduced for specific robot types, and therefore, difficult to apply the kinematic model from one to another robot. This study incorporates most of the robot structural variations in one model so that it is convenient to switch robot types by modifying model parameters. By combining an adequate set of parameters, the kinematic models, especially the inverse kinematics, are derived. The kinematic models are proved to be suitable for many classic industrial robot types, such as Puma560, ABB IRB120/1600, KAWASAKI RS003N/RS010N, FANUC M6iB/M10iA, and therefore be applicable to those with similar structures. The analysis and derivation of the forward and inverse kinematic models are presented, and the results are proven to be accurate.


Introduction
Kinematics analysis is one of the most important procedures for robot control. In the year 2018, the annual production volume of industrial robots reached 390 thousand; many of them are increasingly made by small or medium manufactures. A rising issue is that robots produced by different companies may have different structures, e.g., Figure 1; however, according to literature, robot kinematic models are often introduced for specific robot types rather than in a universal form. is leads to the fact that many robots with varying dimensional parameters must firstly derive a correct kinematic model in the controller.
For the purpose of reducing the inconvenience, this study aims to develop an open architecture controller in which the kinematic models are given a universal form so that they can apply to different robot types by changing parameters.
e approach was based on the classic DH modelling method for well-known Puma560 analysis as presented in many text books [1].
is study introduced more link and offset parameters, which can be modified or set to zero for different robot structures, and the forward and reverse solutions were rederived for this expended DH model. Compared with other analysis methods such as those based on screw theory, this approach is more understandable to general robot users and easy to implement in practice.
Today the large majority of industrial 6R robots are equipped with orthogonal wrists, where the axes of the last three joints intersect on one point. A distinctive example is a UR-5 robot that uses offset wrist, in which case joint 4 and joint 6 are parallel and vertical to joint 5. For common industrial 6R robots, as can be represented by ABB IRB120/ IRB1600 as shown in Figure 1, the major structural differences lie in the arm configurations, especially the offset distances of joint 2 and joint 3. Studies on Puma560 robot are most widely presented in university textbook [1] and discussed in the literature [2][3][4]11]. However, Puma560 is somehow different from a normal industrial 6R robot since its link 3 is offset and the axis is not aligned with the axis of joint 1. For ABB IRB1600, the offset exists in link 2 and therefore, it cannot use the models for Puma560 and IRB120.
In terms of DH modelling, Puma560 is the most widely used example. e DH modelling approach takes robot section length, joint mounting angle, and offset distance to create a transformation matrix, from which the end point position can be calculated in forward kinematics, and on the contrary, the joint angles can be determined by known end status from inverse kinematics. More recent academic studies on robot kinematics are often based on screw theory [13][14][15], which provides better solutions, but are difficult to be utilized by domestic robot manufactures. For the robot controllers with fast CPUs, numerical solutions are always possible, and therefore, the studies on numerical approach are also well documented [16][17][18]. is study aims to develop open architecture kinematic models and controllers for small or medium robot manufactures, and therefore DH modelling remains in focus.
Robot dynamics is an important area besides analysis of kinematics, and relative studies are plenty [19][20][21], among which the Lagrange method is the most utilized approach. is study validates the robot on a controller developed on ARM and DSP, and control signals go through Panasonic A6 series motor drivers to drive motors. Since A6 drivers can be configured to use pulse mode and current control mode, and in the former case, it uses the internal PID controller to cancel out loading effects. For simplification purposes, this study uses pulse control mode in experiments and therefore, dynamics modelling is not required.

DH Models and Forward Kinematics
From the above investigations, a general 6R robot DH model should take adequate offset and length parameters into account, while the joint orthogonal status can be configured by one set of parameters, provided the input joint rotation angles can be adjusted to a specific robot type where necessary. Based on such premise, the DH parameters are listed in Table 1, where α stands for the joint orthogonal angle, a for link length, and d for link offset. Note the coordinate orientations in this form may be different from the definitions made by some original companies; however, the differences can always be cancelled out using some extra coordinate transformations after the model calculation.
Following this arrangement, the DH model diagram for the general 6R robot can be established as shown in Figure 2. It can be seen for Puma560 and ABB IRB120 that a 1 is zero.
us, the axes of joint 1 and joint 2 intersect instead of being away. For Puma560, d 2 and d 3 both are present but are unequal, while for ABB IRB1600, d 2 and d 3 are identical, although its link appears to be on one side.
Besides, for industrial 6R robots, the axes of the last three joints intersect on a single point p, while the actual geometrical center of the robot end without considering tool apparatus is point p′, which represents the genuine TCP of the robot. In many university textbooks and works of the literature, for Puma560 modelling, the calculations were often evaluated on point p. In many actual applications or simulations, such as in ABB Robot Studio, the evaluations can only be made on the genuine TCP p′. For later comparison purposes, this study presents results for Puma560 on point p, while for other robots, the results on p′ will be evaluated. e origin of the coordinate systems was made on point O 0 , without considering the base height h 0 , which is included in Table 2 but not actually used in calculations. e complete sets of parameters for some different robot types are given in Table 2. Note for Puma560, d 6 is taking 0 only because the evaluation is made on point p as mentioned above. Also, note apart from Puma560, d 2 and d 3 are always identical, which indicates for most industrial 6R robots, link 3 and the axis of joint 1 are in the same plane. Many robot DH models do not include d 2 and d 3 since the effects can be cancelled out.
is study keeps all the parameters in the model in case variations are made by different manufactures.
Based on the DH model diagram in Figure 2, the forward DH transformation matrixes can be described in equations  ABB IRB-120 ABB IRB-1600 (1) and (2), where T mn stands for transformation from the mth coordinate system to the nth coordinate system.
e matrix product of the above leads to the transformation from the origin to the last coordinate system of the robot, which can be described below, where n, o, and a correspond to the normal vector, the orientation vector, and the approaching vector.
T 06 � T 01 T 12 T 23 T 34 T 45 T 56 � n x o x a x p x n y o y a y p y n z o z a z p z In a robot control system based on a Python environment, the forward kinematic model can be directly calculated using matrix multiplication functions. In a different coding system, the equations might have to be configured manually. To simplify the trigonometric function representations, use symbols s and c in place of sin and cos and define c 23 � c 2 c 3 − s 2 s 3 , s 23 � c 2 s 3 + s 2 c 3 . en, the equations of the forward kinematic model can be written as below.  Figure 2: DH model diagram for general 6R robot. Since the output of T 06 represents the position of the wrist intersection point p, while in many cases, users measure and evaluate the position of robot genuine TCP, i.e., point p′, which should include parameter d 6 in the calculation. Without considering other robot tool configurations, the actual robot end point p′ can be calculated using one more matrix transformation as follows: n y o y a y p y + a y d 6 Clearly, when a specific tool is installed, the TCP position may be shifted by modifications in equation (5). For inverse calculation purposes, equation (5) should be firstly reversed to recover T 06 so that the inverse analysis as presented in the following section may commence.

Calculate Joint 1 Angle θ 1 .
e approach to calculate θ 1 is similar to that mentioned in the classic Puma560 model in the textbook [1]. In order to calculate θ 1 , it is necessary to construct an equation where the only unknown parameter is θ 1 , and all the other parameters are known constants. For this purpose, investigate the transformation matrix T 16 , which can be obtained either by multiplying the inverse matrix of T 01 with T 06 , or by multiplying T 12 , T 23 , T 34 , T 45, and T 56 , as represented follows: In the above, p x and p y are already known from equation (4). To calculate θ 1 , investigate the element (2, 4) of the matrix product in equation (7) and that of T 16 , the below relationship can be established: Differed from the Puma560 model, in equation (8), there is a parameter d 3 that is not used in Puma560 robot. To facilitate analysis, define the following functions: Substitute equation (9) into (8), then the solution of θ 1 can be obtained.
For equations (8), (11), and (12), sum up the squares of left and right sides, and the two sides should still be identical; therefore, where k is as follows: In the above equation, the term E is introduced due to the parameter a 1 , which is not present in the classic Puma560 model. From analysis the term E can be written as follows: Since equations (8) and (13) are in a similar format, θ 3 can be solved in a similar manner as follows:

Calculate Joint 2 Angle θ 2 .
To derive θ 2, the method is new from the classic Puma560 model since it involves parameters a 1 and a 3 . e analysis is performed on the transformation matrix T 26 , as follows: e principle of deriving θ 2 relies on searching for an equation where the unknown parameter is θ 2 while the rest parameters only include θ 1 and θ 3, which are already worked out. erefore, the above equation is rewritten in the following form: By looking into element (1, 4) of the above equation and T 26 , the following relationship can be identified: To help resolve equation (19), define the equations below: en equation (19) can be transformed into the following form, which again has a similar structure as equation (8): en, the final solution of θ 2 can be obtained as follows:

Calculate Joint 4 Angle θ 4 .
Similarly, to calculate θ 4 the method is to analyze the transformation matrix T 36 , as follows: By analyzing the (1, 3) and (3, 3) elements of the matrixes on the two sides, the following relationships can be identified:

(25)
If the condition is s 5 � 0, then the robot is in a singular posture. In this case, θ 4 can be taken with an arbitrary value that does not affect the end results.

Calculate Joint 5 Angle θ 5 .
To derive θ 5 it is possible to investigate T 46 as given by the following: From the equality of elements (1, 3) and (3, 3) on the two sides, the following relationships can be derived:  (29) e above gives a unique solution for θ 6 as follows: In addition, the symmetric solutions of the robot wrist angles do not affect end results. erefore, there are extra solutions for θ 4 , θ 5, and θ 6 as follows: Mathematical Problems in Engineering (31)

Validation of the Forward Kinematic Model.
e forward kinematic models were calculated in a robot control software developed in a Python environment, which was purposely made to construct an open architecture robot control system. A test run on ABB IRB120 is shown in Figure 3. For comparison purposes, ABB Robot Studio v.6.04 was employed with a IRB120 model. By configuring the input joint angles to the same degrees and then measuring the end coordinate values, the identical results can be obtained. Note in this ABB robot the original posture of link 2 is vertical upward, while the direct output of θ 2 � 0 in the DH models results in link 2 horizontal, as for Puma560. erefore, the control software performs an initial subtraction of 90 degrees for θ 2 for this ABB robot. e forward kinematic modelling results for some robot types are shown in Table 3. For the ABB robots, the results were compared with those measured in ABB Robot Studio v.6.04 and proven to be consistent. e results for the Puma560 robot were compared with the literature and again showed consistency. Attention should be paid to joint 2 angles, which is the original value for Puma560, while for the ABB robots, the presented θ 2 values subtract 90 degrees were the actual inputs for the DH models.
In order to further support comparisons, the DH models for the mentioned robots were redeveloped in MATLAB Robotics Toolbox v10.4, and the end position values are consistent with those shown in Table 3. Below graphs were recorded in MATLAB Robotics Toolbox, where Figure 4 shows Puma560 at the two positions suggested in Table 3, and Figure 5 for ABB120 and Figure 6 for ABB1600, respectively.
ere are other methods often utilized for robot validations, such as simulations in ADAMS and in ROS (Robot Operating System) environments. However, to practice these simulations, it is necessary to construct an environment identical to the current study and redevelop models in  these environments. Comparatively, MATLAB Robotics Toolbox is very simple to reconstruct DH models in different forms, and therefore, it is chosen as the major validation tool.

Validation of the Inverse Kinematic Model.
By entering the end coordinate values and run inverse models in the Python software, all the possible solutions can be worked out, and the optimal solution can be selected by minimizing absolute angle changes comparing with the previous posture. For validation purposes, all the 8 solutions for Puma560 data set 2 were recorded and shown in Table 4. It can be seen that solution 1 is consistent with the original inputs.
For different robot types, the angle range of each joint may be different. is study assumes the angle range for each joint is from −180°to 180°as for Puma560 configurations, although some specific robot types may have different angle ranges, and these should be altered accordingly in the real application. For the ABB IRB120 robot, there are also 8 solutions, and Table 5 shows the solutions for data set 1. It can be seen that solution 1 is consistent with the original inputs in Table 3.
For the ABB IRB1600 data set 2, the 8 inverse solutions are shown in Table 6, where one can recognize solution 5 is consistent with the original inputs.     Figure 6: e forward kinematic modelling results for ABB IRB1600.       Figure 7(b). e open architecture controller consists of a handheld ARM upper computer as the user command interface, a DSP board as the mid-layer signal processer, and a bottom layer Panasonic A6 series motor driver to generate current to drive A6 motors on the robot. e kinematic models were built in the ARM upper computer to enable users to define robot motion commands. e commands were sent to the DSP, which converts the requirements into a corresponding signal frequency and pulse numbers. en, the processed control signals were sent to A6 drivers to generate the correct current to drive motors. e A6 motor drivers can be configured to pulse control mode or current control model. In the pulse control mode, the AC server motors are controlled in a very similar way to stepper motors, i.e., the motor shaft ration is proportional to the number of input pulses. In this case, the driver uses an internal closed loop PID controller to cancel out the loading effects so that the proportion always remains constant. is means in the pulse control mode, the robot dynamics do not need to be modelled and the robot still produces good positioning accuracy. For this advantage, the pulse control mode was employed in the current stage of development. An example testing trace obtained in the Dynalog CompuGauge platform was shown in Figure 8.

Experiments
e Dynalog CompuGauge platform can record robot motion data. A group of data for validating robot repeated positioning accuracy is given in Table 7. On average of each axis, the controller gives repeated positioning accuracy within 0.05 mm.

Conclusions
is paper has investigated the structural variations in industrial 6R robots with the aim of developing open architecture 6R robot controller. e main results of the paper are summarized below: (1) e analysis employed a classic Puma560 DH modelling approach but introduced more link offset and length parameters to suit different robot types. e major newly derived equations include equations (8) e development of the kinematic models makes it possible to construct an advanced open architecture robot controller, which can adapt to different robot types and the environment with minimum changes in the control software. is progress would benefit small or medium robot manufacturers in the future.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.