2.7.4. Simulation Analysis of BPNN–PID Control System Optimized by Genetic Algorithm

A model-based alternating–quantity spraying dominant system of liquid manure genetic algorithm was programmed using MATLAB to optimize BPNN–PID control.

The absolute error integral criterion was used to judge the performance index of each generation of individuals optimized using the genetic algorithm. The optimization process was ended when the population iteration reached the required performance index. If the required index was not reached, the optimal individual in the last generation of the population was considered as the result of the control model simulation analysis.

The control system input a step signal with amplitude of 2, and then output the compensation values ΔKP, ΔKI, and ΔKD of the BPNN regulator corresponding to individual chromosomes before randomly generating the initial population. The individual chromosome in the population was optimized using the genetic algorithm operator, and the population was iterated to the maximum genetic algebra.

The iterative optimization process of the best individual of genetic algorithm is exhibited in Figure 14.

The optimized BPNN algorithm was imported into the PID controller, and the control model was simulated. The simulation results are exhibited in Figure 15.

As shown in Figure 15, for BPNN–PID control in view of genetic algorithm optimization, the response time of the system was 4.68 s and the overshoot was 0.027. After the system ran stably, a small disturbance was observed. Compared with the classical PID control, the overshoot increased by 0.008, while the response time was reduced by 3.92 s. Compared with the fuzzy PID control, the overshoot increased by 0.008, while the response time was reduced by 2.53 s. Compared with the BPNN–PID control, the overshoot was reduced to 0.003 and the response time decreased by 2.29 s. To summarize, the genetic– algorithm–optimized BPNN-PID control system had faster response, a smaller overshoot, and a better overall control effect.

**Figure 14.** Iteration results of optimal population of genetic algorithm.

**Figure 15.** GA–BPNN–PID control system simulation waveform.
