# Temperature Regulation of Hot Vapor Preservation Treatment of Litch Based on PSO-Fuzzy PID
## 5 System Testing and Discussion  
### Simulation Test  
The simulation test environment was built in Simulink, and the control system was constructed as part 1 of Figure 7. The system is based on the PID controller. The system error \(e\) and the error change rate \(ec\) were input into the fuzzy controller, outputting \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\), and dynamically adjusting the PID controller parameters. The quantization and scaling factors \(G_{e}\), \(G_{ec}\), \(G_{p}\), \(G_{i}\), and \(G_{d}\) were added to the input and output ends of the fuzzy controller as the objectives of PSO optimization. The transfer function model of the Formula (6) was taken as the controlled object of the system, and Formulas (12) and (14) were taken as the system interference terms.  
The three schemes of PID, fuzzy PID, and PSO-optimized fuzzy PID were built into the platform at the same time, which is convenient to compare the simulation results. The system simulation model is shown in Figure 10.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Single Mass/g** & **Average Peel** & **Equivalent Ball** & **Fruit Density/kg/m\({}^{3}\)** & **Specific Heat Capacity/[J/(kg.*C)]** \\ \hline
20–25 & 1–1.5 & 19–31 & 932.89 & 3710 \\ \hline \end{tabular}
\end{table}
Table 3: Physical parameters of litchi fruits.  
Using the _assignin_ statement, the optimized parameters were assigned and stored in the workspace for Simulink simulation; using the _sim_ statement, the simulation model was called in the code file and the adaptation values were returned after running the calculations. The code is as follows:  
\[assignin('base^{\prime},G^{\prime},x(1));\] \[assignin('base^{\prime},G^{\prime},x(2));\] \[assignin('base^{\prime},Gp,x(3));\] \[assignin('base^{\prime},G^{\prime},x(4));\] \[assignin('base^{\prime},Gd^{\prime},x(5));\] \[assignin('Fuzzy\_PID\_Model',[0,1000]);\]  
By utilizing the unit step signal and setting a simulation time of 1000 s, we compared three control schemes and obtained the step response simulation curve shown in Figure 11. It is evident that the PID control scheme results in a faster rise time, but with a notable overshoot and an adjustment time of approximately 150 s after disturbance. On the other hand, the fuzzy PID control scheme significantly improves the overshoot phenomenon, while maintaining a similar adjustment time to the PID scheme. After PSO optimization, the interference adjustment time (IAT) is significantly reduced, with no discernible overshoot and excellent control performance.  
To evaluate the effectiveness of different control methods, performance indicators such as overshoot, rise time, and interference adjustment time (IAT) were utilized (Table 4). Compared with PID, the overshoot is reduced by 93.5% and the adjustment time is shortened by 46%. By utilizing fuzzy control to suppress overshoot, there is a further reduction  
Figure 10: Simulink simulation model.  
of 42.9% in overshoot and a 31% reduction in interference adjustment time. This results in an accelerated response time and faster attainment of steady state. Simulation results demonstrate that the fuzzy PID control scheme optimized by the particle swarm optimization algorithm effectively regulates the heat treatment temperature of litchi hot vapor preservation equipment, achieving the intended outcomes.