# Bi-Objective Function Optimization for Welding Robot Parameters to Improve Manipulability
## 3 Design of Robot Simulator
### Closed-Loop Inverse Kinematics Algorithm with PID Controll and WLN Solution
The larger the value of \(\lambda^{2}\), the more robust the robot is to singularities, but the less precise the robot's control, and the smaller the value, the more precise the robot's control, but the more vulnerable it is to singularities. \[W_{1}=\left[ \begin{matrix}w_{1}&\cdots&0\\ \vdots&\ddots&\vdots\\ 0&\cdots&w_{6}\end{matrix} \right]_{6\times 6}W_{2}=\left[ \begin{matrix} \lambda^{2}&\cdots&0\\ \vdots&\ddots&\vdots\\ 0&\cdots&\lambda^{2}\end{matrix} \right]_{6\times 6} \tag{11}\]  
\[w_{i}=\left\{ \begin{matrix}1+\left|\frac{\partial H}{\partial q_{i}}\right| \left|f\Delta\left|\frac{H}{\partial q_{i}}\right|\right|\geq 0\\ 1&if\Delta\left|\frac{H}{\partial q_{i}}\right|<0\end{matrix} \right. \tag{12}\]  
\[\frac{H}{\partial q_{i}}=\frac{(q_{i,max}-q_{i,min})^{2}(2q_{i}-q_{i,max}-q_{i, min})^{2}}{(q_{i,max}-q_{i})^{2}(q_{i}-q_{i,min})^{2}} \tag{13}\]  
The pseudo-inverse matrix Jacobian reflecting the WLN can be multiplied by \(\dot{x}\) as a \(6\times 1\) vector, which consists of the linear velocity and angular velocity vectors in the task space, to calculate the joint angular velocity in the joint space, as shown in Equation (14). The joint angle can be obtained by integration of this. The following error of the robot is calculated as the difference between \(x_{d}\), which is a \(6\times 1\) vector of desired position and desired orientation, and \(x_{a}\), which is a \(6\times 1\) vector of actual position and actual orientation, as shown in Equation (15). This following error is controlled by the PID control algorithm in Equation (16). \[\dot{q}=J^{\dagger}\dot{x} \tag{14}\]  
\[x_{e}=x_{d}-x_{a} \tag{15}\]  
\[\dot{q}=J^{\dagger}\left(K_{P}x_{e}+K_{D}\dot{x_{e}}+K_{I}\int x_{e}dt\right) \tag{16}\]  
The PID controller used in this paper aims to emulate realistic tracking errors rather than achieving optimal gain tuning. In actual industrial robots, humans often manually adjust the gain values to reduce the following error of the robot during gain tuning. Following the same approach, we iteratively adjusted the diagonal matrices \(K_{P}\), \(K_{I}\), and \(K_{D}\) of the PID controller in Equation (16) in the completed simulator several times to align with the level shown in Figure 9.  
Figure 10: Diagram of the simulated control loop of the CLIK algorithm with PID controller and WLN Solution. Figure 9: Following error to simulate reality. \[AS=S\lambda\Rightarrow A=S\lambda S^{-1} \tag{18}\]  
The \(A\) matrix is a positive definite square matrix. It also has an inverse. Decomposing the \(A\) matrix as shown in Equation (18) gives a \(\lambda\) matrix with the eigenvalues as diagonal elements and a \(S\) matrix with the eigenvectors corresponding to each eigenvalue as columns. In a manipulability ellipsoid as shown in Figure 11, the eigenvalue vectors represent the direction of each axis of the ellipsoid and the eigenvalues represent the length of that axis. The manipulability of the robot can be evaluated by the following equation. \[u_{1}(A)=\sqrt{\frac{\lambda_{max}}{\lambda_{min}}}\geq 1(=1\ :\ Isotropic) \tag{19}\]  
\[u_{2}(A)=\sqrt{\lambda_{1}\lambda_{2}\ldots\lambda_{n}}=\sqrt{det(A)} \tag{20}\]  
Equation (19) evaluates how close a manipulability ellipsoid is to a sphere. The closer it is to 1, the more isotropic it is. Equation (20) evaluates how large the overall volume of the manipulability ellipsoid is. For Equation (19), the value is greater than 1, and the closer to 1 the better. In the case of Equation (20), the larger the value, the better the manipulability of the robot. In this paper, we defined a bi-objective function to evaluate linear and angular velocity manipulability using the above manipulability measures.