Inverse Kinematic Solutions of Dual Redundant Camera Robot Based on Genetic Algorithm

Inverse kinematic solutions for a dual redundant camera robot in position are examined in order to alleviate operation difficulty and reduce time.The inverse kinematic algorithm is based on a basic genetic algorithm, and the genetic algorithm which is used to solve the problem of a redundant robot is mainly optimized in the joint space. On this basis, the genetic algorithm improvement strategies are studied. In this paper, a genetic algorithm with constrained 2 redundant degrees of freedom (DOF) is proposed through setting 2 parameter variables, with more flexible structure of optimization objective function and more efficient algorithm than basic genetic algorithm. Finally, the result of inverse kinematic algorithm is achieved in terms of the physical prototype.


Introduction
Coupled with mechanism geometric flexibility, a robot intelligent control system serves to complete a variety of complex operational tasks [1].The geometric structure of a redundant robot is highly flexible, which provides valuable sources for both theoretical research and practicability [2].The inverse kinematic solutions for a redundant robot are expressed as solutions of nonlinear equations, which generally can only be solved based on numerical iterative methods.Moreover, analytic solutions can be achieved only in some special geometric structures [3].For special structures, the algebraic method employed to obtain inverse kinematic solutions can effectively reduce computational complexity, which is also conducive to online applications [4][5][6][7][8][9][10][11][12][13].There are infinitely many solutions which can be used to solve inverse kinematics of a redundant robot.As a result, the identification of optimal solution is of relevant significance [14][15][16].
Generally, a genetic algorithm is employed to optimize inverse kinematic solutions of a redundant robot in the joint space [17].Optimization objective function, sometimes called fitness function, consists of the minimum position error and rotation angle of each joint and solves to inverse kinematics in accordance with explicit expression from transformation matrix of a redundant robot [18].Although optimization accuracy can achieve a desired effect, there is a certain gap between optimal solutions and target position, because only the end position is optimized.
This paper analyzes an 8 DOF serial camera robot, which boasts flexible movement and accurate positioning ability.It requires a control of position and orientation of end-effector in position to solve inverse kinematics of camera robot primarily [19,20].This camera robot has 2 redundant DOF, complicated mechanical structure, and large size of sample space, which renders it challenging to achieve effective inverse kinematic solutions.Therefore, genetic algorithm for the inverse kinematics is proposed.End-effector minimum position and orientation error are commonly considered as optimization objective function of a basic genetic algorithm, which fails to identify the effective inverse kinematic solutions due to the large size of sample space, poor convergence of a genetic algorithm, and running over time.According to structural characteristics of the camera robot, a subinterval of optimal solutions is determined in advance to reduce dimension of the solution space.Subsequently, the relative position between body structure and target point is identified.Finally, a theoretical effective initial population is set by virtue of pattern search algorithm to reduce operation time and improve quality of the optimal solution.The directors can directly specify end-effector position without any support of professional operators and automatically select a best track to audition through the genetic algorithm.Meanwhile, total running time of this algorithm is in an allowed time.

Inverse Kinematic Solutions Based on Genetic Algorithm with Physical Constrained 2 Redundant DOF
2.1.Establishing Mathematical Mode.In this paper, the camera robot is an 8 DOF PRRPR-S robot.Compared with the traditional industrial robot, upper arms can be extended, and the robot body can be moved in a linear orbit, which can be found in Figure 1.
The kinematic model of this camera robot is established based on an assumption that robot is a rigid body.DH model is adopted for the first 7 joints of the robot [21][22][23][24], and the last one employs 6-parameter model.Finally, connecting rod coordinate system is created, as presented in Figure 2.
There are 8 movement axes.As shown in Figure 2,  1 is the displacement of bottom linear motion,  2 is the rotation angle of bottom annular rotator,  3 is the rotation angle of top pitch rotator,  4 is the displacement of top linear motion,  5 is the rotation angle of top distal pitch rotator,  6 is the rotation angle of end-effector posture rotator,  7 is the rotation angle of end-effector pitch rotator,  ee is the rotation angle of endeffector roll rotator, and the major structure of camera robot is the annular structure.
According to the position and orientation analysis of robot, the transformation matrix is obtained as ] ] ] ] ] ] ] Then the forward kinematic matrices of the robot are

Inverse Kinematic Basic Genetic Algorithm in the Joint
Space.Inverse kinematic basic genetic algorithm for the camera robot is currently an explicit expression of endeffector position according to the robot transformation matrix, and the key to solve inverse kinematic solutions is on the basis of the forward kinematic equation with genetic algorithm.Make CRCP camera robot current position zero point; paT is homogeneous matrix of target position.CRCP = [0 0 0 0 0 0 0 0] In terms of this algorithm, the basic genetic algorithm parameters are set in the joint space, and an experiment is simulated by MATLAB.It turns out that computing time with this algorithm is about 2094.838654s, and the minimum value of fitness function is 62858.09908986.
Robot reaches the target position, as shown in Figure 3.
According to the experiment results, camera robot does not reach the target position, and computing time of this algorithm takes about half an hour, which is beyond endurance in practice.That is principally due to a large number of camera robot joints, large movement of each axis especially linear motion at the top and the bottom, uncertain optimization objective function of algorithm, and complex camera robot mechanism, as well as many transformational matrices.
Therefore, the inverse kinematic solutions based on basic implicit genetic algorithm with constrained 2 redundant DOF are herein proposed to replace explicit expression of fitness function on individual genes.

Inverse Kinematic Solutions Based on Implicit Genetic
Algorithm with Physical Constrained 2 Redundant DOF.The inverse kinematic solutions of camera robot are obtained by genetic algorithm, which takes an arbitrary set of 2dimensional vector of 2 redundant DOF as an individual in physical constraint.Effective inverse solutions which are obtained with least relative weight of each joint angle variation are extracted in infinite inverse solutions through limiting optimization objective function.This indicates that, in the same movement time, there is small variation with large load inertia and large variation with small load inertia.
Make CRCP camera robot current position, CRTP camera robot target position, and CRMD movement displacement of each axis. .
(5) Absolute movement displacement of each axis is considered to be a measure of movement, represented by CRMDA.

CRMDA
Considering load rotary inertia of each motor, make CRMW movement weight of each axis.
In this paper, in terms of weight assignment principle, the larger the load rotary inertia is, the larger the weight is, and vice versa.After achieving optimization objective function, the rotary inertia becomes larger, the displacement becomes smaller, and vice versa.Besides, the smaller the value of the optimization objective function, the better the optimization performance to camera robot operation.
Based on our knowledge, the bottom line motion almost dose not lead to vibration of end-effector of camera robot.Therefore, the movement of bottom linear motion axis can be large.Conversely, the bottom annular rotating axis has a great impact on end-effector with movement as small as possible.Movement of the top linear motion should be smaller without requirement of a higher operational height.There can be more movement of end-effector, and load rotary inertia of each motor on end-effector is fairly small.On this basis, camera robot movement amplitude weighting as the optimization objective function is represented by CRMAW.The larger the value of CRMAW, the larger the movement amplitude weighting and the greater the maximum value of acceleration in the motion process, and vice versa.In addition, the solutions minimizing value of CRMAW are extracted from the infinite number of inverse solutions in an ideal situation.
For invalid inverse solution [ 1  4 ], the movement amplitude weighting is set as a very large value, that is, nCRMAW F = 600000.
Fitness function to be optimized is called objective function in the classical optimization algorithm.In this paper, the minimum value of objective function is found through using the setting of GA toolbox in MATLAB, and the movement amplitude weighting is taken as optimization objective function, which is included in fitness function ,  = .
In function structure, [] = (r), function variable r = [r 1 r 4 ].In order to develop a more profound understanding of the optimization space, the image of fitness function HijGAFcn under the target position paT is drawn, as presented in Figure 4.
Figure 4 shows that the minimum value of fitness function exists in a space consisting of  1 ∈ [1000, 2000] and  4 ∈ [0, 500], which is related to the weight setting of optimization objective function.
A set of random [ 1  4 ] as a 2-dimensional individual is introduced to the genetic algorithm, Individual = FUTS = [ 1  4 ].The 50-group target value of bottom linear motion axis and top linear motion axis are randomly selected, with 2 genes for each individual.As a result, there are 10 rows and 2 columns in population matrix with identical individuals in the population at the same time.
The setting of zero position CRTP and target position paT are the same as basic genetic algorithm.Genetic algorithm parameters are set, and experiment is simulated in MATLAB.It turns out that computing time with this algorithm is about 112.775544 s, and the minimum value of fitness function is 390739.Average and minimum values of fitness function change with the genetic algebra, as shown in Figure 5.In this simulation experiment, although the minimum value of fitness function is consistent with the mean value of population after 8 generation, it fails to converge all the time.At this time, the individual corresponding value of fitness function can be obtained as The solution set of effective inverse solution for camera robot is CRTP = [7296.7 2.71459 −0.04783 505.9 −2.37323 0 0.85027 −0.42700] .
Robot reaches the target position, as shown in Figure 6.The green dashed line is initial position, and the blue line is target point position.
Contrasting with the graph of fitness function, it shows that  1 ∈ [7000, 8000] is local optimization after optimizing, and the optimization effect is not ideal.It is due to the fact that the range of bottom and top linear motion is larger, and the possibility of obtaining effective solution from random values in 2 redundant DOF is quite low.

Improved Genetic Algorithm Based on Theoretical Constraints on 𝑟 1 and Physical
Constraints on  4 .The implicit genetic algorithm with physical constrained 2 redundant DOF is improved through analyzing range of motion for dual redundant camera robot.Known target position, the movement range of bottom linear motion  1 , and top linear motion  4 are prejudged with mechanism characteristics of camera robot, which refers to limiting the range of genetic variables of genetic algorithm to improve the computational efficiency of genetic algorithm.The improved genetic algorithm flow chart is presented in Figure 7.
In Figure 6, paT represents a target point; vR1TS is the range of  1 with theoretical constraints.vR4PS is the range of  4 with physical constraints, and R1TSFcn is obtained from the analysis of camera robot workspace and motion range.vR1TS can be deduced out from R1TSFcn through processing paT, which only considers the physical constraint on  4 .Given paT,  1 , and  4 , the inverse kinematic of camera robot is operated by HijGAFcn, the inverse kinematic solutions are substituted into CRMAW, and CRMAW corresponding optimum solution [ 1  4 ] is treated as the current fitness function .
Prior to solving inverse kinematics of the camera robot, if  1 subinterval existing minimum fitness function value is determined at first, the computation time can be reduced by half.The intersection point of top pitch axis of camera robot ring body and plane perpendicular to the bottom line is defined as , namely, shoulder point.The  coordinates   is specified as decision point of robot main body, and the pT coordinate pT  is identified as decision point of target point.In addition, according to analysis of robot motion range, the target point in robot workspace is arbitrarily given, and the motion range of bottom linear motion can be obtained as When   ≤ pT  ,  1 is limited to [ 1a ,  1b ], and when The setting of initial position, target position, and parameters of genetic algorithm are the same as before.Based on the simulation results, the computing time is about 109.602341s with this improved genetic algorithm, and the minimum Pose of the camera robot when target position is reached is shown in Figure 9.
Although efficiency of implicit genetic algorithm has been improved, the genetic algorithm has a slow convergence rate at each time.Besides, a rather large gap exists between the minimum value and average value of fitness function, and the minimum value of fitness function is also different, even the failure of optimization algorithm.It is due to fact that the selection of population individual is still random, and the optimal individual still can not be obtained as expected, even though expanding population size and increasing the truncated generation.

Setting the Initial Population and Using Pattern Search
Algorithm.In order to further improve algorithm, the  1 is averagely selected in its theoretical intervals, the value range of  4 is determined according to each  1 value, and the intermediate value of interval is selected as the value of  4 .Setting on the basis of this initial population, the individual is evenly distributed in theoretical range.In addition, it can solve the problem that the excellent gene  4 is lost due to matching with inappropriate gene  1 .However, the more accurate local optimization ability for complex fitness function is poor, and population size and truncated generation are limited by the computing time.According to Figure 3, value distribution of fitness function boasts certain regularity, and the minimum function value is few in number.As a result, after identifying the global optimal solutions, the pattern search method is used to address the precise optimal solutions [25].
The setting of initial position, target position, and parameters of genetic algorithm is the same as before.20 values are selected in effective theoretical intervals of  1 , the value range of  4 is determined according to each  1 value, and the intermediate value of  4 interval and  1 forms an individual.The initial population individual constitutes an initial population matrix gInitPop, the reference value of HybridFcn is set as patternsearch, and then simulation experiment is conducted for 10 times.
After the experiment, computing time is on average about 203.6 s at a time, and the minimum values of fitness function in 10 experiments are shown in Figure 10.
The minimum value of fitness function is about 70283 in 10 experiments, and the optimal individual difference is very small, which is nearly Corresponding inverse solution for the camera robot is CRTP = [1401.90.52360 −0.01931 0.000001 −2.56796 0 1.01647 −2.617994] .
The camera robot position when reaching target position is shown in Figure 11.
According to experimental results, it can be found that each time the results are basically consistent, which is close to the global minimum of fitness function.In accordance with the 10 key points, total running time is about 0.5 hours, and the running time is considered as acceptable.

Comparison.
In the same setting of initial position, target position, and parameters of genetic algorithm, the final improved algorithm in comparison with initial algorithm implicit genetic algorithm with physical constrained 2 dual redundant DOF, and the motion range of each axis is shown in Table 1.
The comparison between motion range and movement weight of each axis demonstrates that the movement of bottom linear motion, the rotation angle of bottom annular rotator, and the rotation angle of top pitch rotator are reduced significantly.It indicates that translation and rotation of main structure are very small, and the top distal pitch axis has more movement in comparison with top pitch axis, when camera robot reaches the target point.End-effector with  3 axes and small load inertia has more movement than the unimproved one.This comparison achieves the desired optimization results, and the movement of axis with smaller load inertia is larger.On the contrary, the movement of axis with larger load inertia is smaller.Besides, the top linear movement is about 0, which accords with the idea that the movement of top linear motion is reduced as much as possible in the case of operational height.

Experimental Validation
Considered as Coordinate Measuring Machine, Metronor is used to measure the space position of target point.Besides, the results of optimal solution obtained by final improved algorithm are verified on the physical prototype.The initial position of camera robot is CRCP = [0 0 0 0 0 0 0 0] .
Pose matrix of end-effector coordinate system relatively to inverse solutions world coordinate system is paZ The matrix of target position is Pose homogeneous matrix of target point coordinate system based on end-effector coordinate system is Optimum solution obtained by improved algorithm is CRTP = [1401.90.52360 −0.01931 0 −2.56796 0 1.01647 −2.617994] .
According to kinematic model and reduction ratio of the robot physical prototype, the position input command vector of host computer is obtained as The end-effector coordinate system is set, as shown in Figure 12.
The end-effector coordinate system is represented by 3 space points, coordinate origin O, point X in the -axis, and point Z in the -axis, respectively.In addition, Metronor system is employed to determine the coordinates of this 3 target space points, digital camera placement, and shooting angle, as shown in Figure 13.
Measurements of 3 points in the end coordinate system are shown in Table 2 Among them, coordinates of all point are relative to the world coordinate system of Metronor.The coordinate system of end-effector adopts right-hand rule. direction vector is obtained by the cross product of 2 unit vector in  and  direction, as shown in Table 3.
The zero position of the end-effector coordinate system which is relative to the world coordinate system of Metronor is obtained based on Table 3 Thus, when the paZ is a reference coordinate system, the homogeneous matrix of paT relative to paZ is Compared with (20), it can be seen that the measurement is almost consistent with theoretical position.The target pose error between actual measurement and theoretical simulation is primarily attributed to the parameter error of robot links and the artificial error of three coordinate measuring systems.

Conclusions
The present study aims to reduce the difficulty and time used for the inverse kinematic algorithm and the complex camera robot.It is hard to obtain effective inverse kinematic solutions due to the large size of sample space, poor convergence of GA, and running over time.Therefore, a new algorithm is proposed and improved.Although the optimal solution can be obtained based on a new algorithm, stability of the algorithm is relatively poor even with expanding population size and increasing truncated generation.In addition, the inverse kinematic solutions are obtained through analyzing the range of motion for dual redundant camera robot.The improved algorithm achieved by setting the initial population and using pattern search algorithm can converge to a global optimum, which meets the requirements of practical application.
Finally, the zero position of physical prototype is calibrated through using coordinate measuring machine, and the camera robot is driven to specified target position based on optimal inverse solutions.The actual measurement position of end-effector is basically consistent with the theoretical results, and the goal of alleviating operation difficulty and reducing operation time of camera robot is consequently reached.

Figure 3 :
Figure 3: The target position on basic genetic algorithm.

Figure 4 :
Figure 4: The graph of fitness function.

Figure 5 :
Figure 5: Average and minimum values of fitness function change with the genetic algebra on implicit genetic algorithm.

Figure 6 :
Figure 6: The target position on implicit genetic algorithm.

Figure 8 :Figure 9 :
Figure 8: Average and minimum values of fitness function change with the genetic algebra by limiting genetic variables.

4 Figure 10 :Figure 11 :
Figure 10: The minimum values of fitness function in 10 experiments.

Table 2 :
Measurements of 3 points in the end coordinate system.

Table 3 :
Direction vector in the end coordinate system.