# Design of a Parallel Quadruped Robot Based on a Novel Intelligent Control System
## 2 Materials and Methods
### Control System
#### 2.3.3 The Optimization of the Controller
\begin{array}{lcl}X_{best}^{t}+\beta\cdot\left|X_{i,j}^{ t}-X_{best}^{t}\right|&if&f_{i}>f_{g}\\ X_{i,j}^{t}+K\cdot\left(\frac{\left|X_{i,j}^{t}-X_{worst}^{t}\right|}{\left(f _{i}-f_{w}\right)+\varepsilon}\right)&if&f_{i}=f_{g}\end{array} \right. \tag{29}\]  
where \(X_{best}\) is the current global optimal position. \(\beta\) is the step-size control parameter. \(K\in[-1,1]\). \(f_{g}\) and \(f_{w}\) are the first and last digits of the fitness function, respectively. \(\varepsilon\) is a small constant that makes the divisor nonzero. In the cascade PID control process, it is necessary to optimize six parameters of cascade PID by SSA because manual adjustment of PID parameters is time-consuming and laborious, and high precision cannot be achieved. The parameters optimized by SSA will be input to the cascade PID controller before the robot operation; thus, the cascade PID parameters remain unchanged during the robot operation. The proportion factor of the fuzzy controller will directly affect the control precision of the fuzzy adaptive PID controller in the control process. Therefore, it is novel and important to choose SSA to optimize the proportion factor in this paper. The flow chart of the control system is shown in Figure 7.  
Figure 8a exhibits the comparison among SSA--the moth flame optimization algorithm (MFO) and particle swarm optimization algorithm (PSO) in terms of convergence speed and optimization accuracy when optimizing cascade PID controller. Figure 8b shows the comparison between SSA and other algorithms in terms of convergence speed and optimization accuracy when optimizing the fuzzy adaptive PID controller. It is proven that SSA has faster convergence speed and better optimization accuracy under the same conditions. The optimization results of cascade PID controller parameters using three different algorithms are shown in Table 4, and the optimization results of fuzzy adaptive PID controller proportion factor are shown in Table 5.  
Figure 8: Convergence rate curve of the fitness of angular displacement during the optimization process, (**a**) optimize the cascade PID controller, (**b**) optimize the fuzzy adaptive PID controller. Figure 7: Flow chart of the controller parameters optimized using SSA. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & \(\mathbf{k_{p1}}\) & \(\mathbf{k_{i1}}\) & \(\mathbf{k_{d1}}\) & \(\mathbf{k_{p2}}\) & \(\mathbf{k_{i2}}\) \\ \hline SSA & 20.0000 & 1.2977 & 19.8444 & 5.7473 & 19.4983 \\ MFO & 20.0000 & 0.0245 & 20.0000 & 19.5924 & 20.0000 \\ PSO & 20.0000 & 0.0000 & 20.0000 & 19.2943 & 0.0149 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Parameters factor optimization results of fuzzy controller. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & \(\mathbf{K_{up}}\) & \(\mathbf{K_{ui}}\) & \(\mathbf{K_{ud}}\) \\ \hline SSA & 19.9936 & 20.0000 & 20.0000 \\ MFO & 19.5910 & 0.0000 & 20.0000 \\ PSO & 19.6313 & 0.0000 & 20.0000 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Proportion factor optimization results of fuzzy controller. SSA has good performance in convergence speed and optimization accuracy compared with other algorithms, which is proven by the above results. Figure 9 demonstrates the comparison between the optimized fuzzy adaptive PID controller and the optimized cascade PID controller using SSA for the desired trajectory. The curve of the optimized fuzzy adaptive PID controller angular displacement is much closer to the desired curve. It is proven that the fuzzy adaptive PID controller is much better than the cascade PID controller in controlling the joint motor.