## 3 Multisolution Selection of Joint Angle Based on the Key Order of the Joint
### Multisolution Selection  
Even though each solution is available for the kinematics in theory, it is necessary to select one appropriate solution of joint angles from the view of a whole tool path and precise machining. The magnitude of joint motion is directly related to the energy consumption and running time of the entire robot system, and it is also important to ensure that continuous changes in joint angles do not mutate. The incremental changes of each joint angle should be small enough that the relative motion amplitude of the joint between the two path points can be considered in path planning. The key joints and joint increments are used to select a suitable solution from all possible solutions in the inverse kinematics of a multijoint industrial robot. For one point \(\mathrm{P_{i}}=[\mathrm{x_{i}},\mathrm{y_{i}},\mathrm{z_{i}}]^{\mathrm{T}}\) in the trajectory of the end-effector of the robot, all possible groups of joint angles can be obtained based on Section 2. The previous point \(\mathrm{P_{i-1}}\) in the trajectory and its corresponding joint angles of the robot \(\mathrm{Q_{i-1}}=[\mathrm{\theta_{1,\,i-1}},\mathrm{\theta_{2,\,i-1}},\cdots, \mathrm{\theta_{m,\,i-1}}]\)T are used to select the appropriate solutions \(\mathrm{Q_{i}}\) of the point \(\mathrm{P_{i}}\). The nominal increments of all joint angles from \(\mathrm{P_{i-1}}\) to \(\mathrm{P_{i}}\) can be calculated with the Jacobian matrix by substituting in the joint angles \(\mathrm{Q_{i-1}}\) of \(\mathrm{P_{i-1}}\) as  
\[\Delta\mathrm{Q_{i}}=[\Delta\mathrm{\theta_{1,\,i}},\Delta\mathrm{\theta_{2, \,i}},\ldots,\Delta\mathrm{\theta_{m,\,i}}]^{\mathrm{T}}=\left(\mathrm{J_{i-1} ^{T}}\cdot\mathrm{J_{i-1}}\right)^{-1}\cdot\mathrm{J_{i-1}^{T}}\cdot\left( \mathrm{P_{i}}-\mathrm{P_{i-1}}\right) \tag{16}\]  
The nominal joint angles of point \(\mathrm{P_{i}}\) can be obtained with the joint angles \(\mathrm{Q_{i-1}}\) as  
\[\mathrm{Q_{i}^{n}}=\mathrm{Q_{i-1}}+\Delta\mathrm{Q_{i}}=[\mathrm{\theta_{1, \,i}^{n}},\mathrm{\theta_{2,\,i}^{n}},\ldots,\mathrm{\theta_{m,\,i}^{n}}]^{ \mathrm{T}} \tag{17}\]  
where \(\Delta\mathrm{Q_{i}}\) represents the nominal increments of all joint angles of \(\mathrm{P_{i}}\); \(\Delta\mathrm{\theta_{k,\,i}}\) represents the nominal increments of the kth joint; \(\mathrm{J_{i-1}}\) represents the Jacobian matrix by substituting into joint angles \(\mathrm{Q_{i-1}}\); \(\mathrm{Q_{i}^{n}}\) represents the nominal joint angles of point \(\mathrm{P_{i}}\); and \(\mathrm{\theta_{k,\,i}^{n}}\) represents the nominal joint angles of kth joint. All joints are sorted based on their key degree, and the key order of all joints can be obtained. For example, if the key order of the hth joint \(\mathrm{d_{h}}=\mathrm{j}\), it means that the hth joint is the jth key joint. The nominal joint angles of the jth key joint for point \(\mathrm{P_{i}}\) can then be obtained as  
\[\mathrm{\theta_{j,\,i}^{d}}=\mathrm{\theta_{h,\,i}^{n}} \tag{18}\]  
where \(\mathrm{\theta_{j,\,i}^{d}}\) represents the nominal joint angles of the jth key joint. One principle based on the smallest differences of the nominal angle for one joint is proposed to select the possible solutions for this joint. The possible joint angles of one joint \(\mathrm{q_{\,q}}\mathrm{h_{,\,i}}\) in the possible groups of solutions obtained by the inverse kinematics can be compared with the nominal joint angles \(\mathrm{\theta_{h,\,i}^{n}}\) of this joint obtained by Equations (16) and (17). The differences can be expressed as \(\mathrm{\theta_{j,\,q}}\mathrm{\theta_{h,\,i}}-\mathrm{\theta_{h,\,i}^{n}}\). The selection principle for one joint is to obtain the smallest differences of joint angles. In this way, the possible solutions for one joint are selected from all possible groups of solutions. The key order of one joint reflects the key degree of the influences of this joint. The possible solutions for the joints with low key order should be selected before selecting the solutions for the joints with high key order.