# Optimization of Ship Permanent Magnet Synchronous Motor ADRC Based on Improved QPSO
## 5 Simulation Experiments and Results Comparison
2: while Terminate condition has not been met do  
3: Compute \(c1(i)\) and \(c2(i)\) according to Equation (21)  
4: for \(i\gets 1\) to \(N\) do  
5: if \(f(x(i))\) <\(f(a)\) then  
6: Compute \(w(i)\) according to Equation (19)  
7: end if  
8: Compute \(v(i)\) according to Equation (16)  
9: Compute \(x(i)\) according to Equation (17)  
10: Evaluate particle fitness, \(f(x(i))\)  
11: Update the best personal solution, \(p(i)\)  
12: Update the best global solution, \(g(i)\)  
13: end for  
14: for \(j\gets 1\) to cross-pool do  
15: Crossover (_seed_1, _seed_2) according to Equation (22)  
16: Evaluate particle fitness, \(f(x(j))\)  
17: Update the best global solution, \(g(j)\)  
18: end for  
19: for \(k\gets 1\) to mutation pool do  
20: Mutation (_seed_3) according to Equation (24)  
21: Evaluate particle fitness, \(f(x(k))\)  
22: Update the best global solution, \(g(k)\)  
23: end for  
24: end while  
25: Select the best solution, _gbest_(\(t\))The motor's initial speed is set to 1000 r/min, simulating a no-load startup scenario. In practical applications, the motor must rapidly accelerate to the preset speed during startup to ensure stable power output. At 0.1 s, an external load of 7 Nm is applied, simulating the instantaneous load change encountered by the motor during no-load startup, requiring the motor to adjust its output power accordingly. At 0.2 s, the motor speed drops from 1000 r/min to 900 r/min, and further to 800 r/min at 0.4 s. To better simulate real-world conditions, a noise module is added during the simulation, generating Gaussian noise to model environmental disturbances, such as temperature fluctuations, mechanical vibrations, and voltage variations, which affect motor speed. The frequency and amplitude of the noise are random, causing fluctuations in the speed curve and reflecting the motor's performance under nonideal conditions. The simulation results, shown in Figure 8, demonstrate the motor's response to load changes and noise interference. Figure 12 shows that the PSO-ADRC controller exhibits significant fluctuations during the system response, especially after load disturbances, with a slower response and higher steady-state error. The ICFO-ADRC controller optimizes the control parameters further using the improved chicken flock optimization algorithm. While it converges faster than PSO, it has a larger overshoot, indicating that there is still room for improvement in stability and speed. The IPSO-ADRC controller improves response speed with the enhanced particle swarm optimization algorithm, showing better performance and smaller steady-state errors. The QPSO-ADRC controller outperforms all other strategies, recovering quickly and smoothly to a steady state in the initial phase, with the smallest steady-state error and the fastest response time. Its curve closely matches the ideal state with minimal oscillation, confirming the advantages of QPSO-ADRC in both response speed and stability. Robustness is a critical characteristic in practical control applications [29]. To verify the robustness of QPSO-ADRC, the motor speed is set to 1000 r/min. External loads are applied at 0.1 s and 0.12 s, and reduced at 0.124 s. A real-time noise module is also added during the simulation to simulate environmental disturbances that the motor may encounter during operation. The experimental results, shown in Figures 13 and 14, indicate that the QPSO-ADRC system recovers to a steady state quickly, with minimal overshoot throughout the process. QPSO-ADRC outperforms other control methods, which exhibit larger overshoot and oscillation after load disturbances, along with longer response times. Although ICFO-ADRC recovers well initially after load disturbances, its recovery speed is slower than that of QPSO-ADRC. QPSO-ADRC can quickly and smoothly return to the target speed without excessive oscillation. In summary, QPSO-ADRC shows significant advantages in handling complex conditions like load disturbances and noise interference, with strong robustness. Figure 11: Time Comparison.