## Appendix B  
Here, the required formulas for minimizing the objective function by adjusting two and three consecutive parallel revolute joints at the same time are given. When there are two consecutive parallel revolute joints \((\theta_{i},\theta_{i+1})\) in the robot manipulator configuration, the two joints are regarded as variables, and the others are regarded as constants. Accordingly, the gradient of the objective function (Equation (28)) is defined as  
\[\bigtriangledown f(\mathbf{\Theta}_{i\sim i+1})=\left[\frac{\partial f}{\partial \theta_{i}},\frac{\partial f}{\partial\theta_{i+1}}\right]^{T}, \tag{115}\]  
where  
\[\frac{\partial f}{\partial\theta_{i}} =a_{12}\cos(\theta_{i}+\theta_{i+1})+b_{12}\sin(\theta_{i}+\theta _{i+1})+a_{1}\cos(\theta_{i})+b_{1}\sin(\theta_{i}), \tag{116}\] \[\frac{\partial f}{\partial\theta_{i+1}} =a_{12}\cos(\theta_{i}+\theta_{i+1})+b_{12}\sin(\theta_{i}+\theta _{i+1})+a_{2}\cos(\theta_{i+1})+b_{2}\sin(\theta_{i+1}), \tag{117}\]  
where  
\[a_{12} =2\lambda\left(-\mathbf{P_{ai+1}^{T}}\mathbf{\Omega}_{i}^{2}\mathbf{v}_{i}-\bm {P_{ti}^{T}}\mathbf{\Omega}_{i}\mathbf{P_{ai+1}}+\mathbf{P_{ti}^{T}}\mathbf{\Omega}_{i}^{2}\mathbf{ v}_{i+1}+\mathbf{v}_{i+1}^{T}\mathbf{\Omega}_{i}\mathbf{v}_{i}\right)-2\text{trace}(\mathbf{R_{ti}^{T}} \mathbf{\Omega}_{i}\mathbf{R_{ai+1}}), \tag{118}\] \[b_{12} =2\lambda\left(-\mathbf{P_{ai+1}^{T}}\mathbf{\Omega}_{i}\mathbf{v}_{i}-\mathbf{P_ {ti}^{T}}\mathbf{\Omega}_{i}^{2}\mathbf{P_{ai+1}}-\mathbf{P_{ti}^{T}}\mathbf{\Omega}_{i}\mathbf{v}_ {i+1}+\mathbf{v}_{i+1}^{T}\mathbf{\Omega}_{i}^{T}\mathbf{\Omega}_{i}\mathbf{v}_{i}\right)-2 \text{trace}(\mathbf{R_{ti}^{T}}\mathbf{\Omega}_{i}^{2}\mathbf{R_{ai+1}}),\] (119) \[a_{1} =2\lambda\left(\mathbf{P_{ti}^{T}}\mathbf{\Omega}_{i}^{2}\left(\mathbf{v}_{i} -\mathbf{v}_{i+1}\right)-\mathbf{v}_{i+1}^{T}\mathbf{\Omega}_{i}\mathbf{v}_{i}\right),\] (120) \[b_{1} =2\lambda\left(\mathbf{\Omega}_{i}\mathbf{v}_{i}-\mathbf{P_{ti}}\right)^{T} \mathbf{\Omega}_{i}\left(\mathbf{v}_{i}-\mathbf{v}_{i+1}\right),\] (121) \[a_{2} =2\lambda\left(\mathbf{P_{ai+1}^{T}}\mathbf{\Omega}_{i}^{2}\left(\mathbf{v}_ {i}-\mathbf{v}_{i+1}\right)-\mathbf{v}_{i+1}^{T}\mathbf{\Omega}_{i}\mathbf{v}_{i}\right),\] (122) \[b_{2} =2\lambda\left(\mathbf{P_{ai+1}}-\mathbf{\Omega}_{i}\mathbf{v}_{i+1}\right)^{ T}\mathbf{\Omega}_{i}\left(\mathbf{v}_{i}-\mathbf{v}_{i+1}\right), \tag{123}\]where \(\mathbf{R}_{\mathbf{ai+1}}\), \(\mathbf{P}_{\mathbf{ai+1}}\), \(\mathbf{R}_{\mathbf{ti}}\), and \(\mathbf{P}_{\mathbf{ti}}\) are defined as Equations (29), (30), (31), and (32), respectively. The Hessian matrix of the objective function (Equation(28)) is defined as  
\[\mathbf{H}(\mathbf{\Theta}_{i\sim i+1})=\bigtriangledown^{2}\!f(\mathbf{\Theta}_{i\sim i+1 })=\left[ \begin{array}{cc}\frac{\partial^{2}f}{\partial\theta_{i}^{2}}&\frac{ \partial^{2}f}{\partial\theta_{i\theta+1}}\\ \frac{\partial^{2}f}{\partial\theta_{i+1}\partial\theta_{i}}&\frac{\partial ^{2}f}{\partial\theta_{i+1}^{2}}\end{array} \right], \tag{14}\]  
where  
\[\frac{\partial^{2}f}{\partial\theta_{i}^{2}} =-a_{12}\sin(\theta_{i}+\theta_{i+1})+b_{12}\cos(\theta_{i}+ \theta_{i+1})-a_{1}\sin(\theta_{j})+b_{1}\cos(\theta_{i}), \tag{15}\] \[\frac{\partial^{2}f}{\partial\theta_{i}\partial\theta_{i+1}} =\frac{\partial^{2}f}{\partial\theta_{i+1}\partial\theta_{i}}=-a _{12}\sin(\theta_{i}+\theta_{i+1})+b_{12}\cos(\theta_{i}+\theta_{i+1}),\] (16) \[\frac{\partial^{2}f}{\partial\theta_{i+1}^{2}} =-a_{12}\sin(\theta_{i}+\theta_{i+1})+b_{12}\cos(\theta_{i}+ \theta_{i+1})-a_{2}\sin(\theta_{i+1})+b_{2}\cos(\theta_{i+1}). \tag{17}\]  
When  
\[\frac{\partial f}{\partial\theta_{i}}=0,\quad\frac{\partial f}{\partial\theta _{i+1}}=0 \tag{18}\]  
and  
\[\frac{\partial^{2}f}{\partial\theta_{i}^{2}}>0,\quad\frac{\partial^{2}f}{ \partial\theta_{i+1}^{2}}>0 \tag{19}\]  
are satisfied at the same time, the objective function (Equation (28)) obtains the local minimum.