摘要:This paper presents a weight optimization method for a nonlinear model predictive controller (NMPC) based on the genetic algorithm (GA) for ship trajectory tracking. The weight coefficients Q and R of the objective function in NMPC are obtained via the real-time optimization of the genetic algorithm instead of the trial and error method, which improves the efficiency and accuracy of the controller. In addition, targeted improvements are made to the internal crossover operator, mutation operator, crossover rate, and mutation rate of the genetic algorithm. The simulation comparison of trajectory tracking between NMPC with real-time-optimized weight coefficients and the one with constant coefficients is performed. Finally, the simulation result shows that the controller with real-time-optimized weight coefficients has a better trajectory tracking effect than that with constant weight coefficients.