# Dynamic Modeling and Optimization of Tension Distribution for a Cable-Driven Parallel Robot
## 4 Optimization Algorithm of Tension Distribution
### Cable Tension Optimization Model  
In order to operate steadily for the robot, the huge tension difference between any two cables needs to be avoided. Therefore, it is of great importance for cable tension distribution to make the tension difference between any two cables as small as possible. So, the minimum variance is selected as the optimization objective of the tension distribution. When the end-effector of the cable-drive parallel robot operates normally, the \(i\)th cable tension must be within a range, i.e.,  
\[T_{i,\text{min}}\leq T_{i}\leq T_{i,\text{max}},\quad i=1,2,\dots,8 \tag{14}\]  
Setting \(\mathbf{T}_{\text{min}}=[T_{1,\text{min}},T_{2,\text{min}},T_{3,\text{min}},  
\[\left\{\begin{array}{l}\sum\limits_{i=1}^{8}T_{i}s_{\theta_{i}}c_{\phi_{i}}+F_{ r,x}=m\dot{v}_{x}\\ \sum\limits_{i=1}^{8}T_{i}s_{\theta_{i}}s_{\phi_{i}}+F_{r,y}=m\dot{v}_{y}\\ \sum\limits_{i=1}^{8}T_{i}c_{\theta_{i}}+F_{r,z}=m\dot{v}_{z}\\ \sum\limits_{i=1}^{8}\left(r_{i,y}T_{i}c_{\theta_{i}}-r_{i,z}T_{i}s_{\theta_{i }}s_{\phi_{i}}\right)+M_{r,x}=I_{xx}\dot{\omega}_{x}+I_{yy}\dot{\omega}_{y}+I_ {xz}\dot{\omega}_{z}+h_{x}\big{(}\omega_{x},\omega_{y},\omega_{z}\big{)}\\ \sum\limits_{i=1}^{8}\left(-r_{i,x}T_{i}c_{\theta_{i}}-r_{i,z}T_{i}s_{\theta_{ i}}c_{\phi_{i}}\right)+M_{r,y}=I_{xy}\dot{\omega}_{x}+I_{yy}\dot{\omega}_{y}+I_ {yz}\dot{\omega}_{z}+h_{y}\big{(}\omega_{x},\omega_{y},\omega_{z}\big{)}\\ \sum\limits_{i=1}^{8}\left(r_{i,x}T_{i}s_{\theta_{i}}c_{\theta_{i}}-r_{i,y}T_ {i}s_{\theta_{i}}s_{\phi_{i}}\  
coordinates of \(P_{i}\) and \(B_{i}\) are (\(P_{i,x}\), \(P_{i,y}\), \(P_{i,z}\)) and (\(B_{i,x}\), \(B_{i,y}\), \(B_{i,z}\)), respectively. Based on the Euclidean formula, the Euclidean distance between \(P_{i}\) and \(B_{i}\) is calculated as follows:  
\[\|\mathbf{D}_{i}\|=\sqrt{\left(B_{i,x}-P_{i,x}\right)^{2}+\left(B_{i,y}-P_{i,y} \right)^{2}+\left(B_{i,z}-P_{i,z}\right)^{2}} \tag{24}\]  
The \(\theta_{i}\) represents the intersection angle between the position vector \(\mathbf{D}_{i}\) and the positive direction of the \(z_{I}\) axis. As a result, the cosine of \(\theta_{i}\) is the projection of \(\mathbf{D}_{i}\) along the \(z\)-axis. It can be obtained as follows:  
\[\begin{array}{c}\cos(\theta_{i})=\frac{\mathbf{D}_{i}\cdot\mathbf{n}_{z}}{\|\mathbf{D}_{ i}\|\|\mathbf{n}_{z}\|}=\frac{\left[ \begin{array}{cc}B_{i,x}-P_{i,x}&B_{i,y}-P_{i,y}&B_{i,z}-P_{i,z} \end{array} \right]^{T}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!tension value is randomly distributed between the preset minimum tension \(T_{\text{min}}\) and the maximum tension \(T_{\text{max}}\). \[T_{i}=T_{\text{min}}+(T_{\text{max}}-T_{\text{min}})\cdot rand\] (30) Determine the fitness function. The fitness function is the objective function of the optimization problem. The objective of the optimization is to minimize the variance of the cable tension distribution and introduce the stiffness coefficient to make the tension distribution more uniform and continuous. The objective function is Equation (16). (5) The introduction of force and moment equation constraints. When calculating the fitness function, it is necessary to ensure that the cable tension satisfies the balance equation of force and moment. The force and moment balance equation of the cable robot is shown in Equation (32).