Ship fuzzy PID control method based on dynamic population cost induced particle swarm optimization

By using a dynamic population cost-induced particle swarm optimization method, the fuzzy parameters of the ship fuzzy PID controller are optimized, which solves the problem of fuzzy controllers relying on human experience and achieves stronger anti-disturbance capability and better control performance.

CN116300406BActive Publication Date: 2026-06-26DALIAN MARITIME UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DALIAN MARITIME UNIVERSITY
Filing Date
2023-03-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing fuzzy PID controllers, the membership function and fuzzy rule parameters rely on human experience, which can easily lead to local optima, resulting in a decrease in the efficiency and performance of ship dynamic positioning control.

Method used

A method based on dynamic population cost-induced particle swarm optimization is adopted. By establishing a mathematical model of the ship dynamic positioning system, a fuzzy PID controller is designed, and an improved particle swarm algorithm is used to optimize fuzzy parameters, adaptively adjust inertia weights and learning factors, and optimize fuzzy rule weights and quantization scaling factors.

Benefits of technology

The disturbance rejection capability of the fuzzy PID controller has been improved, the automatic positioning function of the ship has been realized, and the control performance and accuracy under complex sea conditions have been enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116300406B_ABST
    Figure CN116300406B_ABST
Patent Text Reader

Abstract

The application discloses a ship fuzzy PID control method based on dynamic population cost induced particle swarm optimization, and comprises the following steps: establishing a ship maneuvering motion mathematical model of a ship power positioning system in static water and a ship maneuvering motion mathematical model in wind and wave; designing a fuzzy PID controller, and correcting the actual position of the ship in a fixed coordinate system through the fuzzy PID controller; optimizing the fuzzy parameters of the fuzzy PID controller of the ship power positioning system by using an improved particle swarm algorithm, designing a fuzzy control system optimized by a particle swarm, and realizing the positioning control of the ship based on the fuzzy control system optimized by the particle swarm. The method solves the problem that the selection of the membership function and the setting of the fuzzy rule and other parameters in the existing fuzzy controller are all obtained from artificial experience, and the conventional PSO control method is prone to local optimization, thereby reducing the work efficiency and control efficiency of the user and affecting the performance of the ship power positioning control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship dynamic positioning, and in particular to a fuzzy PID control method for ships based on dynamic population cost-induced particle swarm optimization. Background Technology

[0002] With the development of the times and the expansion of marine engineering equipment, the function of ship dynamic positioning systems is no longer limited to simple dynamic positioning. Users have more diversified requirements for ship dynamic positioning systems. Therefore, new dynamic positioning control methods are increasingly appearing in dynamic positioning systems. Ship dynamic positioning control technology has gained theoretical and engineering practice recognition and achieved many successes in the past few decades. However, it still generally suffers from many nonlinear factors and uncertainties.

[0003] Fuzzy PID control has advantages such as low requirements for the model and the ability to effectively implement human control strategies and experience. However, since the selection of membership functions and the setting of parameters such as fuzzy rules in existing fuzzy controllers are all derived from human experience, and conventional PSO control methods are prone to getting trapped in local optima, thereby reducing the work efficiency and control efficiency of users, there will be a great deal of subjectivity, which will affect the performance of ship dynamic positioning control. Summary of the Invention

[0004] This invention provides a ship fuzzy PID control method based on dynamic population cost induced particle swarm optimization, which overcomes the problem that the selection of membership functions and the setting of parameters such as fuzzy rules in existing fuzzy controllers are all obtained from human experience, and conventional PSO control methods are prone to getting trapped in local optima, thereby reducing the work efficiency of users and control efficiency; therefore, there will be a lot of subjectivity, which will affect the performance of ship dynamic positioning control.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows:

[0006] A ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization includes:

[0007] Step S1: Establish a mathematical model of the ship's dynamic positioning system, which includes a mathematical model of ship maneuvering motion in still water and a mathematical model of ship maneuvering motion in wind and waves.

[0008] Step S2: Design a fuzzy PID controller, determine the fuzzy universe of discourse and membership function, and formulate fuzzy control rules;

[0009] The fuzzy PID controller is used to correct the actual position of the ship in a fixed coordinate system.

[0010] Step S3: The fuzzy parameters of the fuzzy PID controller of the ship's dynamic positioning system are optimized using an improved particle swarm optimization algorithm, and a fuzzy control system optimized by particle swarm optimization is designed.

[0011] Step S4: Implement positioning control of the ship based on a fuzzy control system optimized by particle swarm optimization.

[0012] Furthermore, the mathematical model for establishing the ship's dynamic positioning system in step S1 is specifically as follows:

[0013] Step S1.1: Establish the mathematical model of the ship's three degrees of freedom motion as follows:

[0014]

[0015] Where m is the mass of the ship; Represents fluid inertial force and fluid inertial torque; u is the linear velocity of movement (oscillation) along the x-direction; r is the angular velocity of rotation about the z-axis; x G Let X be the position of the center of gravity in the x-axis coordinate system of the hull; X is the force of movement (swing) along the x-direction, Y is the force of movement (sway) along the y-direction, and Z is the force of movement (heave) along the z-direction; the subscripts H, P, and R represent the hydrodynamic force of the hull, the propeller force, and the rudder force, respectively; I zz Let be the moment of inertia about the z-axis;

[0016] Step S1.2: Linearize the three-degree-of-freedom motion mathematical model of the ship to obtain the ship maneuvering motion mathematical model in still water. The corresponding model is:

[0017]

[0018] Among them, X u Y represents the fluid viscous force per unit velocity along the x-axis; v N represents the fluid viscous force per unit velocity along the y-axis. r The fluid torque per unit velocity about the z-axis; The additional mass caused by the hydrodynamic acceleration in the x-axis direction during the swaying direction; The additional mass caused by the hydrodynamic acceleration in the sway direction along the y-axis; The additional mass caused by hydrodynamic acceleration in the z-axis direction during the yaw direction; The additional mass caused by the hydrodynamic acceleration in the y-axis direction in the y-axis direction; The additional mass caused by the hydrodynamic acceleration in the z-axis direction along the yaw direction;

[0019] Step S1.3: Establish the mathematical model of ship maneuvering motion in wind and waves as follows:

[0020]

[0021] in, For the acceleration matrix, Represents the fluid inertial force and fluid inertial torque; v is the velocity matrix, v = [uvr] T ;τ t Let τ be the resultant external force matrix. t =[τ tx τ ty τ tn ] T , τ tx Let τ be the net external force along the x-axis. ty Let τ be the net external force along the y-axis. tn Let be the net external force along the z-axis; M is the mass matrix. m is the mass of the ship. Denotes the hydrodynamic derivative; D is the damping matrix. X u Y v ,、N r Y r N v The fluid viscous force or torque experienced per unit velocity.

[0022] Furthermore, the design of the fuzzy PID controller described in step S2 specifically involves...

[0023] Step S2.1: Using the established ship mathematical model, estimate the ship's position information caused by the effects of external environmental forces and propeller thrust on the ship; the external environmental forces include the forces exerted on the ship by sea wind, waves, and ocean currents;

[0024] The difference between the ship's actual position and the required target position is detected by the sensor measurement system and taken as the position deviation e; the position deviation e per unit time is taken as the error change rate ec.

[0025] The position deviation e and the error change rate ec are used as inputs to the fuzzy adaptive control algorithm.

[0026] Step S2.2: The fuzzy PID controller adopts a reference model of a dual-input, three-output fuzzy adaptive control algorithm; the dual inputs include the position deviation e and the error rate of change ec, and the three outputs include the compensation quantities Δk of the three PID control law parameters. p Δk i and Δk d ;

[0027] Step S2.3: By scaling the position deviation e and error change rate ec of different input channels to the same universe of discourse, and fuzzifying the position deviation e and error change rate ec according to the set membership function, the fuzzy quantity is obtained.

[0028] Step S2.4: Determine the compensation amount Δk for the three PID control law parameters based on the system characteristics. p Δk i and Δk d Fuzzy rules, expressed in formulaic form as follows:

[0029]

[0030] In the formula: n and m are subscripts, representing the nth row and mth column; k is the coefficient; Δk′ p For Δk p The correction amount; Δk′ i For Δk i The correction amount; Δk′ d For Δk d The correction amount; R kp Let e ​​and ec be the correction amount Δk′ p Fuzzy relationship; R ki Let e ​​and ec be the correction amount Δk′ i Fuzzy relationship; R kd Let e ​​and ec be the correction amount Δk′ d The fuzzy relationship is: E is the fuzzy value belonging to the deviation e; EC is the fuzzy value belonging to the deviation change rate ec.

[0031] Step S2.5: Substitute the fuzzy quantities into the fuzzy rules to perform fuzzy inference and obtain the fuzzy output quantity Δk′. p , Δk′ i and Δk′ i The calculation formula is:

[0032]

[0033] Step S2.6: Defuzzify the blurred output Δk′ p , Δk′ i and Δk′ d respectively with the quantization scaling factor k up k ui and k ud After multiplication, the precise correction Δk can be obtained. p Δk i and Δk d ;

[0034]

[0035] Based on the obtained precise correction amount Δk p Δk i and Δk d The three control law parameters of the PID controller are modified to obtain the final three control law parameters k of the PID controller. p k i and k d Its expression is:

[0036]

[0037] In the formula: k′ p 、k′ i 、k′ d These are the initial values ​​for the PID controller;

[0038] Step S2.7: Based on the three control law parameters k of the final PID controller p k i and k d By combining the correspondence between the PID controller output and the actuator, the fuzzy PID controller is obtained, and the calculation formula is as follows:

[0039] u(k)=Δu(k)+u(k-1)

[0040] =K p [e(k)-e(k-1)]+K i e(k)+K d [e(k)-2e(k-1)]+e(k-2)+u(k-1)

[0041] In the formula: u(k) is the output of the controller at time k; u(k-1) is the output at time k-1; Δu(k) is the correction at time k; e(k) is the error at time k; e(k-1) is the error at time k-1; e(k-2) is the error at time k-2.

[0042] Furthermore, in step S3, an improved particle swarm optimization algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller of the ship's dynamic positioning system.

[0043] Step S31: Determine the number of particles in the particle swarm, randomly initialize each particle, wherein the particle is the weight and quantization scaling factor of the fuzzy rule of the fuzzy PID controller; confirm the historical optimal position and global optimal position of each individual in the particle swarm.

[0044] Step S3.2: Adaptively adjust the particle population size based on the evolutionary estimated state using a dynamic population strategy;

[0045] The evolutionary estimation states include convergence states and escape states;

[0046] Step S3.3 evaluates the fitness value of each particle in the adaptively adjusted particle population. Let the Kth generation of the particle population S consist of particles x1(t), x2(t), ..., x s The fitness values ​​of the particles are composed of (t), where fitness1(t), fitness2(t), ..., fitness1(t). s (t), the average fitness value of the particle swarm is

[0047]

[0048] Define a particle's fitness value (t) as less than the average fitness value of particles in the population. Individuals that achieve the best results are called elite individuals, and the historical best position and global best position of individuals in the particle population are updated.

[0049] Define a particle's fitness value (t) as greater than the average fitness value of particles in the population. Individuals that are poorly performing are called inferior particles; the inferior particles are induced using an induction rule so that particles trapped in local optima leave the search area.

[0050] Step S3.4: Update the inertia weight w based on the minimum fitness value and average fitness value of the particle swarm using an adaptive adjustment strategy based on the fitness value;

[0051] The learning factors c1 and c2 are adjusted based on the relative difference between the fitness value of each particle and the fitness value of the locally optimal particle and the globally optimal particle.

[0052] Step S3.5: Calculate the elite mean deviation Δτ(t) of the particle swarm, using the following formula: fitness max (t) represents the fitness value of the particle in the global best position; This represents the average fitness value of all elite individuals.

[0053] Determine whether the mean deviation of elites Δτ(t) has reached the preset threshold. If yes, update the velocity and position of each particle. If no, retain all elite individuals with the best global position, initialize all suboptimal elite individuals according to the preset adjustment probability, and then update the velocity and position of each particle.

[0054] Step S3.6: Determine whether the preset maximum number of iterations for the particle population has been reached;

[0055] If so, select the optimal value for all values ​​based on the current particle's fitness value; output the fuzzy rule weights and quantization scaling factors corresponding to the optimal values ​​for all values; use the fuzzy rule weights and quantization scaling factors corresponding to the optimal values ​​for the adjustment of the PID controller.

[0056] If not, return to steps S3.2 to S3.5.

[0057] Furthermore, the step S3.2, which involves using a dynamic population strategy to adaptively adjust the particle population size based on the evolutionary estimated state, specifically involves...

[0058] Step S3.2.1: Calculate the average distance between the current particle i and all particles. The calculation formula is as follows:

[0059]

[0060] Where N and D represent the population size and particle dimension, respectively; the average distance d of the globally optimal particle is... i Let it be d g j represents the j-th particle; k represents the iteration number; This indicates the position of the i-th particle in the k-th iteration; This indicates the position of the j-th particle in the k-th iteration;

[0061] If d g d compared to other particles i If all values ​​are small, the population is in a "converged" state; when it is determined that the particles are in a "converged" evolutionary state, the population size of the particle swarm is increased by 1;

[0062] If d g d compared to other particles i If all particles are large, the population is in a "jump" state; when a particle is determined to be in a "jump" evolutionary state, the population size of the particle swarm is reduced by 1.

[0063] If it falls between the two, then nothing is done;

[0064] Step S3.2.2: After determining the evolutionary state of the particles, add or delete particles based on the principle of randomness, and delete particles in accordance with the principle that the current position and the historical position of the deleted particle cannot be the optimal position.

[0065] The position of the newly added particle is determined by the following formula:

[0066]

[0067] In the formula: d is an integer representing the current dimension; Indicates the position of the newly added particle; These are the upper and lower limits of the search space, respectively; gbest d The optimal location for the population; Gaussian(u,σ) 2 ) represents the Gaussian distribution function; u represents the mean; σ represents the standard deviation.

[0068] Furthermore, the calculation formula for the adaptive adjustment strategy of the fitness value described in step S3.4 is as follows:

[0069]

[0070] In the formula: w min This represents the set minimum inertia weight; w max This represents the maximum set inertia weight; f is the current particle's fitness value; f min f represents the minimum fitness value of the particle swarm; ave This represents the average fitness value of the particle swarm.

[0071] Furthermore, the adjustment formulas for adjusting learning factors c1 and c2 in step S3.4 are as follows:

[0072]

[0073] In the formula: k1 and k2 represent the inertia factor weights of c1 and c2, respectively, ranging from [0.3, 5]; f(p) represents the fitness value of particle i in the kth generation; in f(p) represents the fitness value of a locally optimal particle; gn ) represents the fitness value of the globally optimal particle.

[0074] Furthermore, in step S3.5, the position and velocity of the particles are updated using the following formula;

[0075]

[0076]

[0077] In the formula: This indicates particles with poor fitness values; ω represents the velocity of particle i in the (k+1)th iteration in the d-dimensional case; ω represents the inertia weight. c1 and c2 represent the velocity of particle i in the d-dimensional case at the k-th iteration; c1 and c2 represent the learning factors. This represents a uniformly distributed random number within the range [0, 2]. This represents the optimal position of i in the d-dimensional case at the k-th iteration; This represents the position of particle i in the d-dimensional case during the k-th iteration; This represents the position of particle i in the d-dimensional case during the (k+1)th iteration; This represents the optimal position of particle i in the entire population in the d-dimensional case at the k-th iteration.

[0078] Furthermore, the induction rule described in step S3.3 is as follows:

[0079]

[0080] In the formula: μ is the induction factor; η is a random number, η∈(0,1); k1 is defined as a positive integer less than 1; k2 is defined as a positive integer greater than 1; μ id (t+1) represents the induction factor of particle i at time t+1; fitness(x) i (t) represents the fitness value of particle i at iteration t); fitness(x) i (t-1)) represents the fitness value of particle i at the time of iteration t-1.

[0081] Beneficial Effects: This invention provides a fuzzy PID control method for ships based on dynamic population cost-induced particle swarm optimization. It estimates the evolutionary state of particles to change the population size; adaptively updates the inertia weights and learning factors based on the particle's fitness value; and determines the particle's evolutionary state by updating the local optimal fitness value and the overall optimal fitness value, reinitializing the particles to increase population diversity and convergence speed. An improved particle swarm optimization algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller in the ship's dynamic positioning system. By optimizing the fuzzy rule weights and quantization scaling factor of the fuzzy PID controller, the fuzzy PID controller has stronger anti-disturbance capabilities, achieving not only automatic ship positioning but also strong anti-interference ability and good control performance. It solves the problem that relying on manual experience cannot guarantee that the parameters of the fuzzy controller (such as the quantization scaling factor and rule weight coefficients) are adjusted to the optimal state, improving the controller's performance and accuracy, and enabling the ship's dynamic positioning system to adapt to complex sea conditions. Attached Figure Description

[0082] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0083] Figure 1 This is a flowchart of the ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to the present invention;

[0084] Figure 2 This is a schematic diagram of the fuzzy PID controller in the ship fuzzy PID control method based on dynamic population cost induced particle swarm optimization of the present invention.

[0085] Figure 3This is a flowchart of the improved particle swarm optimization algorithm for the ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization, as described in this invention. Detailed Implementation

[0086] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0087] This embodiment provides a fuzzy PID control method for ships based on dynamic population cost-induced particle swarm optimization, such as... Figure 1 As shown, it includes:

[0088] Step S1: Establish a mathematical model of the ship's dynamic positioning system, which includes a mathematical model of ship maneuvering motion in still water and a mathematical model of ship maneuvering motion in wind and waves.

[0089] Step S2: Design a fuzzy PID controller, determine the fuzzy universe of discourse and membership function, and formulate fuzzy control rules;

[0090] The fuzzy PID controller is used to correct the actual position of the ship in a fixed coordinate system.

[0091] Step S3: The fuzzy parameters of the fuzzy PID controller of the ship's dynamic positioning system are optimized using an improved particle swarm optimization algorithm, and a fuzzy control system optimized by particle swarm optimization is designed.

[0092] Step S4: Implement positioning control of the ship based on a fuzzy control system optimized by particle swarm optimization.

[0093] Based on the mathematical model of the ship dynamic positioning system, a fuzzy PID controller is designed. Taking the fuzzy PID controller as the optimization object, an improved particle swarm optimization algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller of the ship dynamic positioning system. The fuzzy rule weights and quantization scaling factors of the fuzzy PID controller are optimized, and the output parameters of the fuzzy PID controller are adjusted to make the fuzzy PID controller have stronger anti-disturbance ability. It not only realizes the function of automatic ship positioning, but also has strong anti-interference ability and good control performance.

[0094] In a specific embodiment, the mathematical model for establishing the ship's dynamic positioning system in step S1 is specifically as follows:

[0095] Step S1.1: Establish the mathematical model of the ship's three degrees of freedom motion as follows:

[0096] Establish mathematical models for the ship's translational and rotational motions:

[0097]

[0098] In the formula: v = [u, v, w, p, q, r] T Let be the velocity vector decomposed in the moving coordinate system; u is the linear velocity of movement (swing) along the x-axis; v is the linear velocity of movement (sway) along the y-axis; w is the linear velocity of movement (heave) along the z-axis; p is the angular velocity of rotation (roll) about the x-axis; q is the angular velocity of rotation (pitch) about the y-axis; r is the angular velocity of rotation (heave) about the z-axis; τ RB =[X,Y,Z,K,M,N] T This is the quantitative representation of the net external force and torque acting on a rigid body; X is the force of movement (swing) along the x-axis; Y is the force of movement (lateral sway) along the y-axis; Z is the force of movement (heavy sway) along the z-axis; K is the torque of rotation (roll) about the x-axis; M is the torque of rotation (pitch) about the y-axis; N is the torque of rotation (heavy sway) about the z-axis; M RB M is the inertia matrix of the rigid body system. RB The matrix form is expressed as:

[0099]

[0100] C RB(v) Let C be the centripetal force matrix of a rigid body Coriolis. RB(v) The matrix form is expressed as:

[0101]

[0102] Therefore, the mathematical model of the ship's three degrees of freedom motion is established as follows:

[0103]

[0104] In the formula: m is the mass of the ship; Represents fluid inertial force and fluid inertial torque; u is the linear velocity of movement (oscillation) along the x-direction; r is the angular velocity of rotation about the z-axis; x G Let X be the position of the center of gravity in the x-axis coordinate system of the hull; X is the force of movement (swing) along the x-direction, Y is the force of movement (sway) along the y-direction, and Z is the force of movement (heave) along the z-direction; the subscripts H, P, and R represent the hydrodynamic force of the hull, the propeller force, and the rudder force, respectively; I zz Let I be the moment of inertia about the z-axis; xy Let I be the moment of inertia about the x-axis and y-axis; xx Let I be the moment of inertia about the x-axis; yy Let I be the moment of inertia about the y-axis; xzLet I be the moment of inertia about the x-axis and z-axis; yz Let y be the moment of inertia about the y-axis and z-axis; G The position of the center of gravity in the y-axis coordinate system of the hull; z G This represents the position of the center of gravity in the z-axis coordinate system of the ship's hull.

[0105] Step S1.2: The mathematical model of the ship's three degrees of freedom motion is linearized. Since the hull is symmetrical, the differential equation of linear motion of the bare hull in still water is derived as follows (ignoring the influence of the rudder and hull), thus obtaining the mathematical model of the ship's maneuvering motion in still water. The corresponding model is:

[0106]

[0107] Among them, X u Y represents the fluid viscous force per unit velocity along the x-axis; v N represents the fluid viscous force per unit velocity along the y-axis. r The fluid torque per unit velocity about the z-axis; The additional mass caused by the hydrodynamic acceleration in the x-axis direction during the swaying direction; The additional mass caused by the hydrodynamic acceleration in the sway direction along the y-axis; The additional mass caused by hydrodynamic acceleration in the z-axis direction during the yaw direction; The additional mass caused by the hydrodynamic acceleration in the y-axis direction in the y-axis direction; The additional mass caused by the hydrodynamic acceleration in the z-axis direction along the yaw direction;

[0108] Step S1.3: Establish the mathematical model of ship maneuvering motion in wind and waves as follows:

[0109]

[0110] in, For the acceleration matrix, Represents the fluid inertial force and fluid inertial torque; v is the velocity matrix, v = [uvr] T ;τ t Let τ be the resultant external force matrix. t =[τ tx τ ty τ tn ] T , τ tx Let τ be the net external force along the x-axis. ty Let τ be the net external force along the y-axis. tnLet be the net external force along the z-axis; M is the mass matrix. m is the mass of the ship. Denotes the hydrodynamic derivative; D is the damping matrix. X u Y v ,、N r Y r N v The table represents the fluid viscous force or torque experienced per unit velocity, and Y r and N v The absolute value is usually very small.

[0111] Wind on the sea surface generates waves that interfere with the normal navigation of ships. The main methods for calculating wind loads are empirical methods and modular methods. The components of wind force in the x and y directions and the torque are calculated using the following formulas:

[0112]

[0113] In the formula: X wind Y wind N wind ρ represents the components of the wind load in the x and y directions, respectively; a air density; A uf A represents the projected area of ​​the ship's above-water portion; ul L is the side projection area of ​​the part above water; oa V is the length of the ship; wi C represents wind speed. x C y C n Let be the load coefficient and torque coefficient in the x and y directions, respectively, which are functions of the wind angle α. The equation is expressed as:

[0114]

[0115] In the formula: α represents the angle between the wind and the x-axis; C l,AF C t ε are coefficients; S l The distance from the centroid of the projected area of ​​the ship's above-water portion to the center of the ship; and

[0116] The forces and moments of the flow load can be expressed as:

[0117]

[0118] In the formula: X current Y current N current These represent the force components and torque in the x and y directions, respectively; ρ is the fluid density; A lf A llV represents the orthographic and lateral projection areas of the underwater portion of the ship; c β is the flow velocity; β is the flow direction angle; C x (β), C y (β), C n (β) is a function of the flow load coefficient with respect to β, which can be obtained from the following equation:

[0119]

[0120] In the formula: C L For the hull lift coefficient, C D For the hull drag coefficient, C m This is the hull torque coefficient.

[0121] The forces and moments of wave loads are obtained from the following empirical formulas:

[0122]

[0123] In the formula: X wave Y wave N wave These represent the force and torque components in the x and y directions, respectively; g is the acceleration due to gravity; ζ D λ is the average wave amplitude; λ is the wave wavelength; χ is the wave encounter angle; C XD (λ), C YD (λ), C ND (λ) is a function of wavelength λ, and under certain conditions, it can be approximately estimated by the following formula:

[0124]

[0125] In a specific embodiment, such as Figure 2 As shown, the design of the fuzzy PID controller in step S2 is specifically as follows:

[0126] Step S2.1: Using the established ship mathematical model, estimate the ship's position information caused by the effects of external environmental forces and propeller thrust on the ship; the external environmental forces include the forces exerted on the ship by sea wind, waves, and ocean currents;

[0127] The difference between the ship's actual position and the required target position is detected by the sensor measurement system and taken as the position deviation e; the position deviation e per unit time is taken as the error change rate ec.

[0128] The position deviation e and the error change rate ec are used as inputs to the fuzzy adaptive control algorithm.

[0129] Step S2.2: The fuzzy PID controller adopts a reference model of a dual-input, three-output fuzzy adaptive control algorithm; the dual inputs include the position deviation e and the error rate of change ec, and the three outputs include the compensation quantities Δk of the three PID control law parameters. p Δk i and Δk d ;

[0130] Step S2.3: By scaling the position deviation e and error change rate ec of different input channels to the same universe of discourse, and fuzzifying the position deviation e and error change rate ec according to the set membership function, the fuzzy quantity is obtained.

[0131] Selection of the fuzzy universe of discourse: The basic universe of discourse for the input variable position deviation e and the error rate of change ec is [-x e ,x e ],[-x ec ,x ec The input is set to [-33]. Since the input is continuous, considering the system's precision control requirements, the input is quantized into seven levels: {negative large, negative medium, negative small, zero, positive small, positive medium, positive large}, and the expression for the quantization factor is K. e =3 / x e ,K ec =3 / x ec Similarly, Δk p Δk i Δk d The quantization is the same as the input;

[0132] Determination of membership function: deviation e, error rate of change ec, and the three fuzzy variables Δk of the output. p Δk i Δk d The membership functions of the deviation e are both:

[0133] Large negative:

[0134] Negative middle:

[0135] Small negative:

[0136] zero:

[0137] True small:

[0138] middle:

[0139] Zhengda:

[0140] Step S2.4: Determine the compensation amount Δk for the three PID control law parameters based on the system characteristics. p Δk i and Δk d Fuzzy rules, expressed in formulaic form as follows:

[0141]

[0142] In the formula: n and m are subscripts, representing the nth row and mth column; k is the coefficient; Δk′ p For Δk p The correction amount; Δk′ i For Δk i The correction amount; Δk′ d For Δk d The correction amount; R kp Let e ​​and ec be the correction amount Δk′ p Fuzzy relationship; R ki Let e ​​and ec be the correction amount Δk′ i Fuzzy relationship; R kd Let e ​​and ec be the correction amount Δk′ d The fuzzy relationship is: E is the fuzzy value belonging to the deviation e; EC is the fuzzy value belonging to the deviation change rate ec.

[0143] Step S2.5: Substitute the fuzzy quantities into the fuzzy rules to perform fuzzy inference and obtain the fuzzy output quantity Δk′. p , Δk′ i and Δk′ i The calculation formula is:

[0144]

[0145] Step S2.6: Perform defuzzification using the centroid method, which is a known prior art. The inventive point of this application is to defuzzify the fuzzy output Δk′. p , Δk′ i and Δk′ d respectively with the quantization scaling factor k up k ui and k ud After multiplication, the precise correction Δk can be obtained. p Δk i and Δk d ;

[0146]

[0147] Based on the obtained precise correction amount Δk p Δk i and Δk dThe three control law parameters of the PID controller are modified to obtain the final three control law parameters k of the PID controller. p k i and k d Its expression is:

[0148]

[0149] In the formula: k′ p 、k′ i 、k′ d These are the initial values ​​for the PID controller;

[0150] Step S2.7: Based on the three control law parameters k of the final PID controller p k i and k d By combining the correspondence between the PID controller output and the actuator, the fuzzy PID controller is obtained, and the calculation formula is as follows:

[0151] u(k)=Δu(k)+u(k-1)

[0152] =K p [e(k)-e(k-1)]+K i e(k)+K d [e(k)-2e(k-1)]+e(k-2)+u(k-1)

[0153] In the formula: u(k) is the output of the controller at time k; u(k-1) is the output at time k-1; Δu(k) is the correction at time k; e(k) is the error at time k; e(k-1) is the error at time k-1; e(k-2) is the error at time k-2.

[0154] In a specific embodiment, such as Figure 3 As shown, in step S3, an improved particle swarm optimization algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller of the ship's dynamic positioning system.

[0155] Step S31: Determine the number of particles in the particle swarm, randomly initialize each particle, wherein the particle is the weight and quantization scaling factor of the fuzzy rule of the fuzzy PID controller; confirm the historical optimal position and global optimal position of each individual in the particle swarm.

[0156] Step S3.2: Adaptively adjust the particle population size based on the evolutionary estimated state using a dynamic population strategy;

[0157] The evolutionary estimation states include convergence states and escape states;

[0158] Step S3.3 evaluates the fitness value of each particle in the adaptively adjusted particle population. Let the Kth generation of the particle population S consist of particles x1(t), x2(t), ..., x s The fitness values ​​of the particles are composed of (t), where fitness1(t), fitness2(t), ..., fitness1(t). s (t), the average fitness value of the particle swarm is

[0159]

[0160] Define a particle's fitness value (t) as less than the average fitness value of particles in the population. Individuals that achieve the best results are called elite individuals, and the historical best position and global best position of individuals in the particle population are updated.

[0161] Define a particle's fitness value (t) as greater than the average fitness value of particles in the population. Individuals that do not meet the search criteria are called poor particles. If a poor particle does not meet the search criteria, it will be trapped in a local optimum and cannot escape. An induction rule is used to induce the poor particles to leave the search area.

[0162] Step S3.4: Update the inertia weight w based on the minimum fitness value and average fitness value of the particle swarm using an adaptive adjustment strategy based on the fitness value;

[0163] The learning factors c1 and c2 are adjusted based on the relative difference between the fitness value of each particle and the fitness value of the locally optimal particle and the globally optimal particle.

[0164] Step S3.5: Calculate the elite mean deviation Δτ(t) of the particle swarm, using the following formula: fitness max (t) represents the fitness value of the particle in the global best position; This represents the average fitness value of all elite individuals.

[0165] Determine whether the mean deviation of elites Δτ(t) has reached the preset threshold. If yes, update the velocity and position of each particle. If no, retain all elite individuals with the best global position, initialize all suboptimal elite individuals according to the preset adjustment probability, and then update the velocity and position of each particle.

[0166] Applying the elite mean deviation to the particle swarm optimization algorithm primarily involves observing the dispersion of the particle fitness function distribution. This allows us to detect whether the diversity of the population particles has been lost. A smaller Δτ(t) indicates a high degree of convergence in the fitness values ​​of the particles in optimal positions, suggesting premature convergence. The particles are concentrated in a specific area, and information transfer between them is also limited to this region. Therefore, it can be deduced that the updates to particle velocity and position will not change significantly in subsequent iterations. Conversely, a larger Δτ(t) indicates a lower degree of convergence among the optimal individuals, a more dispersed population distribution, and a larger search range, thus reducing the convergence speed. Therefore, the elite mean deviation can be used to analyze the dispersion of particles in the population.

[0167] If the elite average deviation Δτ(t) of the particles is less than a given threshold, it indicates that the particles lack activity, and the diversity among the population gradually disappears, making it impossible to continue searching and yielding poor search results. In this case, an induced migration operation using an elite preservation scheme is adopted for the particle swarm. Specifically, the fitness of the elite population, i.e., the particles, is adjusted. Particles with a fitness value better than the average fitness value (t) are retained, and all suboptimal elite individuals are initialized according to a preset adjustment probability P. After the initialization operation, the particles are randomly distributed in the search space, which improves the activity of the particles and allows them to search efficiently in a wider space.

[0168] Step S3.6: Determine whether the preset maximum number of iterations for the particle population has been reached;

[0169] If so, select the optimal value for all values ​​based on the current particle's fitness value; output the fuzzy rule weights and quantization scaling factors corresponding to the optimal values ​​for all values; use the fuzzy rule weights and quantization scaling factors corresponding to the optimal values ​​for the adjustment of the PID controller.

[0170] If not, return to steps S3.2 to S3.5.

[0171] In a specific embodiment, step S3.2, which involves using a dynamic population strategy to adaptively adjust the particle population size based on the evolutionary estimated state, specifically includes:

[0172] Step S3.2.1: Calculate the average distance between the current particle i and all particles. The calculation formula is as follows:

[0173]

[0174] Where N and D represent the population size and particle dimension, respectively; the average distance d of the globally optimal particle is... i Let it be dg j represents the j-th particle; k represents the iteration number; This indicates the position of the i-th particle in the k-th iteration; This indicates the position of the j-th particle in the k-th iteration;

[0175] If d g d compared to other particles i If all values ​​are small, the population is in a "converged" state. When it is determined that the particles are in a "converged" evolutionary state, it means that the particle swarm may be trapped in a local optimum. The population size of the particle swarm is increased by 1 to increase the diversity of the population.

[0176] If d g d compared to other particles i If all particles are large, the population is in a "jump out" state. When it is determined that a particle is in a "jump out" evolutionary state, it means that all particles are in a divergent state. The population size of the particle swarm is reduced by 1 to reduce the running time.

[0177] If it falls between the two, then nothing is done;

[0178] Step S3.2.2: After determining the evolutionary state of the particles, add or delete particles based on the principle of randomness, and delete particles in accordance with the principle that the current position and the historical position of the deleted particle cannot be the optimal position.

[0179] The position of the newly added particle is determined by the following formula:

[0180]

[0181] In the formula: d is an integer representing the current dimension; Indicates the position of the newly added particle; These are the upper and lower limits of the search space, respectively; gbest d The optimal location for the population; Gaussian(u,σ) 2 ) represents the Gaussian distribution function; u represents the mean; σ represents the standard deviation.

[0182] In specific embodiments, the PSO algorithm is prone to getting trapped in local optima. The inertia weight w is the most critical parameter affecting the global and local optimization of the PSO algorithm. When w is large, the global search capability is strong; when w is small, the local search capability is strong. To improve the performance of the algorithm, the improved PSO algorithm adopts a strategy of adaptively adjusting w with the current fitness value. The calculation formula of the adaptive fitness adjustment strategy is as follows:

[0183]

[0184] In the formula: w minThis represents the set minimum inertia weight; w max This represents the maximum set inertia weight; f is the current particle's fitness value; f min f represents the minimum fitness value of the particle swarm; ave This represents the average fitness value of the particle swarm.

[0185] When the individual fitness value f is good, a smaller w is used to perform a detailed local search of the current region; when the individual fitness value f is poor, a larger w is used to expand the search region, thereby improving the convergence speed of the algorithm and avoiding getting trapped in local optima.

[0186] In a specific embodiment, learning factors c1 and c2 represent the degree of learning from individual experience and group experience, respectively. When c1 = 0, the particle enters a "selfish state," not considering itself; when c2 = 0, the particle enters a "selfish state," only considering itself, and there is no information interaction between all particles; when neither c1 nor c2 is 0, the algorithm is more likely to maintain a balance between convergence speed and search effect. The strategy for adjusting the learning factors is to adjust c1 and c2 based on the relative difference between the fitness value of each particle and the fitness values ​​of the locally optimal particle and the globally optimal particle. This allows particles that were previously at the optimal solution to fly to the vicinity of the globally optimal solution more quickly, while particles near the optimal solution search for the optimal solution more slowly, avoiding missing the optimal solution due to flying too fast. The adjustment formula for learning factors c1 and c2 in step S3.4 is:

[0187]

[0188] In the formula: k1 and k2 represent the inertia factor weights of c1 and c2, respectively, ranging from [0.3, 5]; f(p) represents the fitness value of particle i in the kth generation; in f(p) represents the fitness value of a locally optimal particle; gn ) represents the fitness value of the globally optimal particle.

[0189] In a specific embodiment, the position and velocity of the particles in step S3.5 are updated using the following formula;

[0190]

[0191]

[0192] In the formula: This indicates particles with poor fitness values; ω represents the velocity of particle i in the (k+1)th iteration in the d-dimensional case; ω represents the inertia weight. c1 and c2 represent the velocity of particle i in the d-dimensional case at the k-th iteration; c1 and c2 represent the learning factors. This represents a uniformly distributed random number within the range [0, 2]. This represents the optimal position of i in the d-dimensional case at the k-th iteration; This represents the position of particle i in the d-dimensional case during the k-th iteration; This represents the position of particle i in the d-dimensional case during the (k+1)th iteration; This represents the optimal position of particle i in the entire population in the d-dimensional case at the k-th iteration.

[0193] In a specific embodiment, the induction rule in step S3.3 is as follows:

[0194]

[0195] In the formula: μ is the induction factor; η is a random number, η∈(0,1); k1 is defined as a positive integer less than 1; k2 is defined as a positive integer greater than 1; μ id (t+1) represents the induction factor of particle i at time t+1; fitness(x) i (t) represents the fitness value of particle i at iteration t); fitness(x) i (t-1) represents the fitness value of particle i at iteration time t-1. The fitness value of particle i at iteration time t is... i (t) is less than the fitness value at iteration time t-1. i (t-1) represents the particle temporarily moving towards the locally optimal fitness particle, causing the particle to get trapped in a local minimum. At this time, the induction factor η is multiplied by a positive number k2 greater than 1 to enhance the global optimization ability; when the fitness value of particle i at the t-th iteration is... i (t) is greater than the fitness value at iteration t-1. i (t-1) represents the particle not being able to find a better position, reducing search efficiency. This is achieved by multiplying the induction factor η by a positive number less than 1 to improve the particle's ability to search for local extrema, accelerate the convergence speed of the algorithm, and update the particle's position and velocity.

[0196] In ship dynamic positioning control systems, an improved particle swarm optimization algorithm is proposed and applied to the fuzzy PID controller of the ship dynamic positioning system. Based on the standard particle swarm algorithm, an improved particle swarm algorithm is proposed, and its working principle is as follows:

[0197] Particle swarm initialization, clearing the environment and reading the fuzzy controller. Main particle swarm parameters are set as follows: population size 100; learning factor 2; maximum number of generations 100; number of fuzzy rule weights 49; upper and lower limits of fuzzy rule weights [0,1]; quantization factor k. eand k ec Upper and lower limits [1,5], [0.1,1], scaling factor k up k ui and k ud Upper and lower limits [1,50], [1,100], [1,100]; initialization of position and velocity of fuzzy rule weight particle swarm (49-dimensional particles) and quantization scaling factor particle swarm (3-dimensional particles).

[0198] Initialize the fitness values ​​of the particle swarm, write the initialized particle values ​​into the fuzzy rule weights and quantization scaling factor parameters of the fuzzy controller, and obtain the optimal fitness values ​​of individuals and the optimal fitness values ​​of the swarm.

[0199] Entering the main loop, iterative optimization begins. First, Evolutionary State Estimation (ESE) is performed on the particles, and the population size is updated adaptively. Then, the elite mean deviation of the particle swarm is calculated, and it is determined whether the elite mean deviation meets the threshold condition. If it does not meet the threshold condition, initialization operations are performed on all elite individuals and suboptimal individuals, and their population size is updated. If the threshold condition is met, Pbest (the historical best position of each particle) and Gbest (the global best position of the entire swarm) are updated based on the fitness value. The velocity and position of each particle are also updated, and it is determined whether the particle velocity and position have exceeded the limits. The individual optimal fitness value, the swarm optimal fitness value, and the inertia weight and learning factor of each particle are updated, and it is determined whether the inertia weight and learning factor have exceeded the limits.

[0200] Determine whether the maximum number of iterations has been reached; if so, output the fuzzy rule weights and quantization scaling factors corresponding to all optimal values; finally, substitute the particle values ​​into the fuzzy rule weights and quantization scaling factor parameters, and adjust the output parameters of the fuzzy PID controller through the fuzzy rule weights and quantization scaling factors, thereby realizing the positioning of the ship's actual position in a fixed coordinate system.

[0201] The main strategy of this algorithm is to estimate the evolutionary state of particles to change the population size; adaptively update the inertia weights and learning factors based on the particle fitness values; and determine whether the particle evolutionary state is normal by checking the updated state of local optimal fitness values ​​and global optimal fitness values, reinitializing the particles to increase population diversity and convergence speed. An improved particle swarm optimization algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller in a ship dynamic positioning system. Taking the fuzzy PID controller as the optimization object, the fuzzy rule weights and quantization scaling factor of the fuzzy controller are optimized. The optimized fuzzy PID controller has stronger anti-disturbance capability than the conventional PID controller and the unoptimized fuzzy PID controller. It not only realizes the function of automatic ship positioning, but also has strong anti-interference capability and good control performance. However, the design cycle of the controller will be longer, which will have a significant impact on the robustness and control performance of the controller.

[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fuzzy PID control method for ships based on dynamic population cost-induced particle swarm optimization, characterized in that, include: Step S1: Establish a mathematical model of the ship's dynamic positioning system, which includes a mathematical model of ship maneuvering motion in still water and a mathematical model of ship maneuvering motion in wind and waves. Step S2: Design a fuzzy PID controller, determine the fuzzy universe of discourse and membership function, and formulate fuzzy control rules; The fuzzy PID controller is used to correct the actual position of the ship in a fixed coordinate system. The design of the fuzzy PID controller described in step S2 is specifically as follows: Step S2.1: Using the established ship mathematical model, estimate the ship's position information caused by the effects of external environmental forces and propeller thrust on the ship; the external environmental forces include the forces exerted on the ship by sea wind, waves, and ocean currents; The difference between the ship's actual position and the required target position is detected by a sensor measurement system and used as the position deviation. ; Position deviation per unit time As the rate of change of error ; and with positional deviation With error change rate As input to the fuzzy adaptive control algorithm; Step S2.2: The fuzzy PID controller adopts a reference model of a dual-input, three-output fuzzy adaptive control algorithm; the dual inputs include position deviation. With error change rate The three outputs include compensation values ​​for the three control law parameters of the PID controller. , as well as ; Step S2.3: By adjusting the positional deviation of different input channels With error change rate Scaling to a specific universe of discourse and adjusting the positional deviation according to a defined membership function. With error change rate Blur the image and obtain the fuzzy quantity; Step S2.4: Determine the compensation values ​​for the three PID control law parameters based on the system characteristics. , as well as Fuzzy rules, expressed in formulaic form as follows: In the formula: and The subscript indicates the first... Line 1 List; For coefficients; for The amount of correction; for The amount of correction; for The amount of correction; for and With correction amount The fuzzy relationship; for and With correction amount The fuzzy relationship; for and With correction amount The fuzzy relationship; It belongs to the deviation The fuzzy value; It belongs to the rate of change of deviation The fuzzy value; Step S2.5: Substitute the fuzzy quantities into the fuzzy rules to perform fuzzy inference and obtain the fuzzy output quantities. , as well as The calculation formula is: Step S2.6: Defuzzify the output quantity by defuzzification. , and Respectively with quantization scaling factor , as well as The precise correction can be obtained by multiplying them. , as well as ; Based on the obtained precise correction amount , as well as The three control law parameters of the PID controller are modified to obtain the final three control law parameters of the PID controller. , as well as Its expression is: In the formula: , , These are the initial values ​​for the PID controller; Step S2.7: Based on the three control law parameters of the final PID controller , as well as By combining the correspondence between the PID controller output and the actuator, the fuzzy PID controller is obtained, and the calculation formula is as follows: In the formula: For the controller in Output at any moment; for Output at any moment; for The amount of correction at any given time; for Time error; for Error in time; for Time error; Step S3: An improved particle swarm optimization (PSO) algorithm is used to optimize the fuzzy parameters of the fuzzy PID controller in the ship's dynamic positioning system, designing a PSO-optimized fuzzy control system. Specifically, step S3 involves using the improved PSO algorithm to optimize the fuzzy parameters of the fuzzy PID controller in the ship's dynamic positioning system. Step S31: Determine the number of particles in the particle swarm, randomly initialize each particle, wherein the particle is the weight and quantization scaling factor of the fuzzy rule of the fuzzy PID controller; confirm the historical optimal position and global optimal position of each individual in the particle swarm. Step S3.2: Adopt a dynamic population strategy to adaptively adjust the particle population size based on the evolutionary estimated state; The evolutionary estimation states include convergence states and escape states; Step S3.3 evaluates the fitness value of each particle in the adaptively adjusted particle population. Let the Kth generation of the particle population S consist of particles... Composition, the fitness value of the particles The average fitness value of the particle swarm is ; Define particle fitness value Less than the average fitness value of particles in the population Individuals that achieve the best results are called elite individuals, and the historical best position and global best position of individuals in the particle population are updated. Define particle fitness value Greater than the average fitness value of particles in the population Individuals that are poorly performing are called inferior particles; induction rules are used to induce these inferior particles to leave the search area, causing them to fall into local optima. Step S3.4: Update the inertia weight w based on the minimum fitness value and average fitness value of the particle swarm using an adaptive adjustment strategy based on the fitness value; The learning factor is adjusted based on the relative difference between the fitness value of each particle and the fitness values ​​of the locally optimal and globally optimal particles. , ; Step S3.5: Calculate the elite mean deviation of the particle swarm. The calculation formula is: , This represents the fitness value of a particle that is in the best global position. This represents the average fitness value of all elite individuals. Determine the mean deviation of elites If the preset threshold is reached, the velocity and position of each particle are updated; otherwise, all elite individuals with the best global position are retained, all suboptimal elite individuals are initialized according to the preset adjustment probability, and then the velocity and position of each particle are updated. Step S3.6: Determine whether the preset maximum number of iterations for the particle population has been reached; If so, select the optimal value for all values ​​based on the current particle's fitness value; output the fuzzy rule weights and quantization scaling factors corresponding to the optimal values ​​for all values. The fuzzy rule weights and quantization scaling factors corresponding to all optimal values ​​are used for the adjustment of the PID controller; If not, return to steps S3.2 to S3.5; Step S4: Implement positioning control of the ship based on a fuzzy control system optimized by particle swarm optimization.

2. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 1, characterized in that, The specific steps in step S1 for establishing the mathematical model of the ship's dynamic positioning system are as follows: Step S1.1: Establish the mathematical model of the ship's three degrees of freedom motion as follows: Where m is the mass of the ship; Represents fluid inertial force and fluid inertial torque; Let x be the linear velocity of the movement (oscillation) along the x-direction; The angular velocity of rotation about the z-axis; This represents the position of the center of gravity in the x-axis coordinate system of the ship. The force is the movement (oscillation) along the x-direction. The force is the movement (sway) along the y-direction. The force is the movement (heave) along the z-direction, with the subscript... , , These represent the ship's hydrodynamic forces, propeller forces, and rudder forces, respectively. Let be the moment of inertia about the z-axis; Step S1.2: Linearize the three-degree-of-freedom motion mathematical model of the ship to obtain the ship maneuvering motion mathematical model in still water. The corresponding model is: in, This represents the fluid viscous force per unit velocity along the x-axis. This represents the fluid viscous force per unit velocity along the y-axis. The fluid torque per unit velocity about the z-axis; The additional mass caused by the hydrodynamic acceleration in the x-axis direction during the swaying direction; The additional mass caused by the hydrodynamic acceleration in the sway direction along the y-axis; The additional mass caused by hydrodynamic acceleration in the z-axis direction during the yaw direction; The additional mass caused by the hydrodynamic acceleration in the y-axis direction in the y-axis direction; The additional mass caused by the hydrodynamic acceleration in the z-axis direction along the yaw direction; Step S1.3: Establish the mathematical model of ship maneuvering motion in wind and waves as follows: in, For the acceleration matrix, , Represents fluid inertial force and fluid inertial torque; For the velocity matrix, ; For the resultant external force matrix, , Let be the net external force acting along the x-axis. Let be the net external force along the y-axis. The net external force acting along the z-axis; For the quality matrix, m is the mass of the ship. Represents the hydrodynamic derivative; Here is the damping matrix. , , , The fluid viscous force or torque experienced per unit velocity.

3. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 2, characterized in that, Step S3.2 describes the adoption of a dynamic population strategy, which adaptively adjusts the particle population size based on the evolutionary estimated state. Specifically, Step S3.2.1: Calculate the current particle The average distance to all particles is calculated using the following formula: in and Representing the population size and particle dimension respectively; the average distance of the globally optimal particle is... Recorded as ; Indicates the first One particle; Indicates the number of iterations; Indicates the first The particle in the first The position of the next iteration; Indicates the first The particle in the first The position of the next iteration; like Compared to other particles If all values ​​are small, the population is in a "converged" state; when it is determined that the particles are in a "converged" evolutionary state, the population size of the particle swarm is increased by 1. like Compared to other particles If all are large, the population is in a "jump out" state; when a particle is determined to be in a "jump out" evolutionary state, the population size of the particle swarm is reduced by 1; If it falls between the two, then nothing is done; Step S3.2.2: After determining the evolutionary state of the particles, add or delete particles based on the principle of randomness, and delete particles in accordance with the principle that the current position and the historical position of the deleted particle cannot be the optimal position. The position of the newly added particle is determined by the following formula: In the formula: The integer represents the current dimension; Indicates the position of the newly added particle; , These are the upper and lower limits of the search space, respectively; This is the optimal position for the population; It is a Gaussian distribution function; This represents the mean; It represents the standard deviation.

4. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 3, characterized in that, The calculation formula for the adaptive adjustment strategy of the fitness value described in step S3.4 is as follows: In the formula: This indicates the minimum inertia weight set. This indicates the maximum set inertia weight; This is the current particle's fitness value; This represents the minimum fitness value of the particle swarm. This represents the average fitness value of the particle swarm.

5. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 4, characterized in that, Adjusting the learning factor as described in step S3.4 , The adjustment formula is: In the formula: , They represent and The inertia factor weights range from [0.3, 5]. Represents particles In the Fitness value of the second generation; This represents the fitness value of a locally optimal particle. This represents the fitness value of the globally optimal particle.

6. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 5, characterized in that, In step S3.5, the position and velocity of the particles are updated using the following formula; In the formula: This indicates particles with poor fitness values; Represents particles In the Speed ​​in the d-dimensional case during the next iteration; Indicates inertia weight; Represents particles In the Speed ​​in the d-dimensional case during the next iteration; and Indicates the learning factor; , , Indicates uniform distribution Internal random number, express In the The optimal position in the d-dimensional case during the next iteration; Represents particles In the The position in the d-dimensional case at the next iteration; Represents particles In the The position in the d-dimensional case at the next iteration; Represents particles In the The optimal position currently held by the entire population in the d-dimensional case during the next iteration.

7. The ship fuzzy PID control method based on dynamic population cost-induced particle swarm optimization according to claim 6, characterized in that, The induction rule mentioned in step S3.3 is: In the formula: It is an inducing factor; A random number, ; Defined as a positive integer less than 1; Defined as a positive integer greater than 1; Represents particles exist Inducing factors at any given time; Represents particles exist (fitness value at the next iteration) Represents particles exist The fitness value at the next iteration.