# Reconfiguration for the Maximum Dynamic Wrench Capability of a Parallel Robot
## 3 Reconfiguration for the Maximum Allowable DWC
### Solution Procedure by a Hierarchical Optimization Process
Find the minimum dynamic wrench force \(f_{\mathbf{p},\mathbf{w}}\) and wrench moment \(n_{\mathbf{p},\mathbf{w}}\) for the individual \(p\) along the task trajectory by \(f_{\mathbf{p},\mathbf{w}}=\min\left\{f_{\mathbf{w},\mathbf{n}}^{p},\mathbf{n}=1,\ldots,N\right\}\) and \(n_{\mathbf{p},\mathbf{w}}=\min\left\{n_{\mathbf{w},\mathbf{n}}^{p},\mathbf{n}=1,\ldots,N\right\}\). 4. In the \(i\)th generation of the differential evolution solution procedure, the allowable dynamic wrench capability \(G_{\mathbf{p}}\)= \(\lambda_{f}f_{\mathbf{p},\mathbf{w}}\) + \(\lambda_{n}n_{\mathbf{p},\mathbf{w}}\) in Equation (25) is evaluated using the minimum dynamic wrench force, \(f_{\mathbf{p},\mathbf{w}}\) and dynamic wrench moment, \(n_{\mathbf{p},\mathbf{w}}\) of each individual from the step (3). 5. Generate mutant individuals by adding a randomly selected individual to the difference of two other randomly selected individuals in the parent population according to the following equation: \[\hat{\textbf{{Z}}}_{\mathbf{p}}(i+1)=\hat{\textbf{{X}}}_{\mathbf{\Pi}}(i)+f_{\mathbf{m}}[ \hat{\textbf{{X}}}_{\mathbf{\Pi}2}(i)-\hat{\textbf{{X}}}_{\mathbf{\Pi}3}(i)]\] (29) where \(p=1\),\(2\),..., \(P\) is the individual's index of population; \(i\) is the generation; \(\hat{\textbf{{Z}}}_{\mathbf{p}}(i)=[z_{p1}(i),z_{p2}(i),\ldots,z_{pD}(i)]^{T}\) represents the \(p\)th mutant vector via the mutation operation; \(r1\), \(r2\) and \(r3\) are mutually different indices and also different from the running index, \(p\), randomly selected with uniform distribution from the set {1, 2,..., \(p-1\), \(p+1\),..., \(P\)}; and \(f_{m}>0\) is a mutation factor usually taken from the range [0.1, 1], and used to control the amplification of the difference between two parent individuals so as to avoid search stagnation. 6. For the components of each mutant vector, an index \(Rand(p)\)\(\in\){1, 2,..., \(D\)} is randomly chosen using uniform distribution, and the crossover is employed to create a trial vector \(\hat{\textbf{{U}}}_{\mathbf{p}}(i+1)=[u_{p1}(i+1),u_{p2}(i+1),\ldots,u_{pD}(i+1)]^ {T}\) by recombining parent and mutant vectors as the followings: \[u_{p,j}(i+1)=\left\{ \begin{array}{cc}z_{pj}(i+1),&if\;\;(rand(j)\leq CR)\\ x_{pj}(i),&if\;\;(rand(j)>CR)\end{array} \right.\;or\;\;(j=Rand(p))\] (30) where \(j=1\),\(2\),..., \(D\) is the component index in \(D\)-dimensional individual, and \(rand(j)\) is the \(j\)th evaluation of a uniform random number generation with [0, 1], and \(CR\) is a crossover or recombination rate in the range [0, 1]. 7. Repeat the steps (2)-(4) to calculate the allowable dynamic wrench capability in \(G\) using the trial vectors \(\hat{\textbf{{U}}}_{\mathbf{p}}(i+1)\), \(p=1\),..., \(P\), and then the cost function value of each trial vector \(\hat{\textbf{{U}}}_{\mathbf{p}}(i+1)\) is compared with that of its parent target vector \(\hat{\textbf{{X}}}_{\mathbf{p}}(i)\). This selection procedure is to decide if the trial vector \(\hat{\textbf{{U}}}_{\mathbf{p}}(i+1)\) becomes a member of the population of the next generation. Thus, \[\hat{\textbf{{X}}}_{\mathbf{p}}(i+1)=\left\{ \begin{array}{cc}\hat{\textbf{{U}}}_ {\mathbf{p}}(i+1),&if\;\;\;\;\;\;\;\;\;G(\hat{\textbf{{U}}}_{\mathbf{p}}(i+1))>G(\hat{ \textbf{{X}}}_{\mathbf{p}}(i))\\ \hat{\textbf{{X}}}_{\mathbf{p}}(i),&otherwise\end{array} \right.\] (31) In this case, if the allowable dynamic wrench capability in \(G\) of the target parent vector \(\hat{\textbf{{X}}}_{\mathbf{p}}(i)\) is larger than that of the trial vector, the target is allowed to advance to the next generation. Otherwise, the trial vector replaces the target vector to become a better offspring in the next generation. Repeat the steps beginning from step (2) until it has reached a stopping criterion in accordance with the user-defined conditions, usually a maximum generation number is set for the stop criterion. Thus, \(\hat{\mathbf{X}}_{\mathbf{best}}\) is the best individual vector for the optimal configuration with the best objective function value in this population.