# Dung Beetle Optimized Fuzzy PID Algorithm Applied in Four-Bar Target Temperature Control System
## 3 Results  
### Dung Beetle Optimization Fuzzy PID Simulation  
Having outlined the optimization process of the dung beetle optimization algorithm, we first initialized the parameter settings, defined the quantization factor and the scaling factor, set the population size to 50, and set the maximum number of iterations to 100. By writing the main program code for the dung beetle optimization and the code for the fitness calculation subfunction and compiling and running on MATLAB2019 software, we obtained the evolution process curves of the quantization factor and the scaling factor, as shown in Figures 10 and 11. After running 30 iterations and recording the final fitness values of each run, the statistical analysis results are presented in Table 4.  
Figure 11: Proportional factor optimization curve. Figure 10: Iteration curve. In the Simulink simulation platform, we construct simulation models for the dung beetle algorithm-optimized fuzzy PID control, particle swarm optimization (PSO) optimized fuzzy PID, fuzzy PID, and classical PID control to compare the effects of temperature changes. The simulation models are illustrated in Figure 12.  
By using the trial-and-error method, the following initial values of the classical PID were obtained: \(Kp\) = 8.27, \(Ki\) = 0.22, and \(Kd\) = 0.41. These values were used as the initial ones for the classical PID, fuzzy PID, particle swarm optimization (PSO) optimized fuzzy PID, and dung beetle algorithm-optimized fuzzy PID. For the fuzzy PID, after 100 iterations of optimization with the dung beetle algorithm, the most suitable scaling factor was obtained. The specific optimized values of the scaling factor are shown in Table 5. \begin{table}
\begin{tabular}{c c c c} \hline
**ITAE Average** &
\begin{tabular}{c} **ITAE Standard** \\ **Deviation** \\ \end{tabular} & **ITAE Min** & **ITAE Max** \\ \hline
2474.7133 & 0.3791 & 2474.2137 & 2475.6608 \\ \hline \end{tabular}
\end{table} 
Table 4: Fitness function statistical analysis. Figure 12: System simulation diagram. A sensitivity study was carried out on the three parameters _Kp_, _Ki_, and _Kd_, which were varied separately to obtain different simulation results and compare them, as shown in Figure 13.  
To verify the superiority of the scale factor, the initial temperature was set to 0 \({}^{\circ}\)C, and the target temperature was set to 25 \({}^{\circ}\)C. A simulation platform was constructed using MATLAB2019/Simulink to perform simulations on the temperature control system of the four-bar target in the MRTD (minimum resolvable temperature difference) tester. The simulation compared the performance of four different control strategies: traditional PID control, fuzzy PID control, particle swarm optimization of fuzzy PID, and fuzzy PID control optimized by the dung beetle optimization (DBO) algorithm. By observing key performance indicators such as heating speed, overshoot, settling time, and steady-state error, a detailed analysis of the response characteristics and temperature control effectiveness of each control strategy was conducted. The results are illustrated in Figure 14.  
By comparing these response curves, it is evident that the dung beetle optimization-enhanced fuzzy PID control exhibits superiority in aspects such as system response time,  
Figure 14: Comparison chart of traditional PID, fuzzy PID, particle swarm fuzzy PID, and dung beetle fuzzy PID. Figure 13: Sensitivity analysis of _Kp_, _Ki_, and _Kd_. overshoot, and oscillation effects. The simulation experiments not only confirm the importance of scale factor adjustment but also demonstrate the effectiveness of the optimization algorithm in enhancing the performance of the temperature control system, as shown in Table 6.  
From Table 6, it can be observed that compared to traditional PID control, fuzzy PID reduces overshoot by approximately 3.6%, with the system still exhibiting mild oscillations.