Underwater vehicle pose control method based on BP neural network PID control

By using a BP neural network to self-tune the PID control parameters, the problems of low positioning and attitude determination accuracy and efficiency of the submersible in complex sea conditions were solved. This enabled efficient depth and orientation control of the main thruster + auxiliary thruster system, thereby improving the autonomous navigation capability of the submersible.

CN122018281APending Publication Date: 2026-05-12THE 20TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORP
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE 20TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORP
Filing Date
2025-10-16
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing underwater vehicle navigation control systems employ fixed-parameter PID control algorithms, which cannot adaptively adjust to ocean current disturbances and complex sea conditions, resulting in reduced positioning and attitude determination accuracy and efficiency. Furthermore, there is a lack of depth and orientation control methods for main thruster + auxiliary thruster systems.

Method used

A PID control method based on BP neural network was adopted, and the PID control parameters were self-tuned by BP neural network. A navigation control method suitable for the main thruster + auxiliary thruster system of submarine was designed. The nonlinear mapping capability of BP neural network was used to achieve adaptive optimization of PID control parameters.

Benefits of technology

It improves the accuracy and efficiency of depth and orientation control of underwater vehicles in complex sea conditions, ensuring autonomous and safe navigation of underwater vehicles, saving energy and improving response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018281A_ABST
    Figure CN122018281A_ABST
Patent Text Reader

Abstract

The invention provides an underwater vehicle pose control method based on BP neural network PID control, which realizes self-tuning of PID control parameters for a'main thrust and auxiliary thrust 'thruster system of an underwater vehicle, and helps to improve the precision and efficiency of depth-keeping and directional control in the presence of disturbance. According to the method, three parameters of PID control have the characteristics of mutual cooperation and mutual restriction, a conventional PID controller has fixed parameters and does not have adaptive ability, and by means of the mapping ability of a BP neural network to a nonlinear function, the optimal solutions of various nonlinear combinations of the three parameters in the PID controller can be obtained through self-learning, so that the optimal solutions of the nonlinear combinations of the three parameters in the PID controller can be obtained. Depth-keeping and directional control precision and dynamic performance of the underwater vehicle under complex sea conditions are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of neural networks, and in particular to a control method based on neural networks. Background Technology

[0002] Current underwater vehicle navigation control systems widely employ PID control algorithms, whose control parameters are fixed and cannot adjust automatically with changing conditions. This leads to reduced accuracy and efficiency in positioning and attitude determination under disturbances. The purpose of this invention is to design a PID control method capable of self-tuning parameters, making it suitable for automatic navigation control of underwater vehicle systems to improve the performance of positioning and attitude determination.

[0003] Currently, various types of underwater vehicles (UVs) are widely used in scenarios such as seabed resource exploration, marine scientific discovery, rescue of distressed submarines, global climate change research, marine archaeology, and seabed military target detection, holding an important strategic position in building a maritime power. During operation, UVs face complex and unpredictable ocean currents and rugged and varied seabed topography. Ensuring autonomous, safe, and reliable navigation control is fundamental to their deep-sea exploration.

[0004] Taking a distressed submarine rescue scenario as an example, the lifeboat will sail with the support mother ship to the area where the distressed submarine is located. After the mother ship deploys the lifeboat, the lifeboat needs to navigate and dive to the location of the distressed submarine, adjust its attitude, and dock with the submarine using its docking skirt to transfer the trapped personnel. The entire process is subject to many interference factors such as ocean currents, complex terrain, and target movement. Therefore, the depth-holding and orientation control performance of the lifeboat is extremely important.

[0005] There are already many research results on the navigation control system of underwater vehicles. For example, the patent No. 201811580167.4 applied for by Ocean University of China designed a PID motion control method for underwater robots based on ESO; the patent No. 202310921070.X applied for by Nanjing University of Posts and Telecommunications designed a depth-keeping control method for underwater robots based on fuzzy PID; and the patent No. 201811013607.8 applied for by Huazhong University of Science and Technology designed a bow and stern combined steering control strategy for depth control of underwater vehicles.

[0006] The drawbacks of existing technology are:

[0007] Current navigation control algorithms are mostly classical PID control and its variants, with fixed parameters. Under disturbances such as ocean current disturbances and target drift, the optimal solution of the controller parameters changes continuously. Traditional PID controllers have poor robustness and are prone to control deviations because their parameters cannot be self-tuned.

[0008] To achieve both maneuverability when approaching a target and stability when braving waves and currents, underwater vehicles need to be equipped with multiple pairs of thrusters, as well as bow and stern rudders. The servo motors operate at high cruising speeds, and precise positioning and attitude control is mainly achieved through the thruster system. However, current research on underwater vehicle navigation control methods rarely includes specific depth- and orientation control methods for "main thruster + auxiliary thruster" systems. Summary of the Invention

[0009] To overcome the shortcomings of existing technologies, this invention provides a submarine attitude control method based on BP neural network PID control. This invention focuses on the "main thruster + auxiliary thruster" propulsion system of a submarine, studies the navigation control method, and proposes a submarine attitude control method based on BP (Back Propagation) neural network PID control. This method achieves self-tuning of PID control parameters, which helps improve the accuracy and efficiency of depth and orientation control under disturbance conditions.

[0010] The technical solution adopted by this invention to solve its technical problem is:

[0011] S1: Determine the structure of the BP neural network, including the number of layers and the number of nodes in each layer, select the initial values ​​of the connection weights between each layer, and select the activation function;

[0012] S2: Forward network computation;

[0013] S3: Select the performance index function E(k) as the square of the output error:

[0014] (10)

[0015] Where r(k) is the set heading angle, and y(k) is the actual heading angle at the current moment, i.e., the heading angle measured by the compass after the control law u(k) output by the PID controller acts on the controlled object. The incremental PID control law is as follows:

[0016] (11)

[0017] In the formula, e(k) is the output error at the current moment, that is, the error between the set heading angle and the actual heading angle, which is r(k)-y(k), and the control parameter K... P K I K D This is the output O1 of the BP neural network. (3) (k) 、O2 (3) (k), O3 (3) (k);

[0018] S4: If the performance index function E(k) is less than or equal to the threshold, the training phase ends; otherwise, the error is propagated in the reverse direction, and the weights are modified layer by layer according to the gradient descent method so that the network weight coefficients are adjusted according to the learning rate η until the performance index E(k) is less than or equal to the threshold.

[0019] S5: Increment k by 1, return the updated weights from S4 to S2 and start the calculation again. If the performance index function E(k) is less than or equal to the threshold, it means that the BP neural network has met the requirements. Fix the network parameters, which are the connection weights between neurons in adjacent layers, and end the training phase to enter the working phase; otherwise, continue training.

[0020] S6: During the working phase, when calculating the error e(k), the turning method needs to be considered: When the submersible adjusts its heading, it can choose to turn left or right. In order to save energy and improve response speed, the minimum path turning should be selected, that is, the path with the absolute value of the difference within 180° should be selected for turning. Therefore, the error value e(k) is converted to the range of −180° to 180°. When the error is positive, it turns right, and when the error is negative, it turns left.

[0021] S7: The operation of the propeller is jointly controlled by a proportional valve and two solenoid valves, one for left and one for right. The proportional valve controls the speed of the propeller, and the output of the solenoid valve is an on / off signal that controls whether the propeller is working. Taking the left turn of the hull as an example, the bow thruster proportional valve controls the speed of the bow thruster, the bow thruster solenoid valve to the left is open, and the bow thruster solenoid valve to the right is closed, together controlling the bow to move to the left. At the same time, the stern thruster proportional valve controls the speed of the stern thruster, the stern thruster solenoid valve to the left is closed, and the stern thruster solenoid valve to the right is open, together controlling the stern to move to the right. The bow and stern work together to make the hull turn to the left.

[0022] In S1, the BP neural network is used to fine-tune the PID control parameters; therefore, the output layer has 3 nodes, each corresponding to the proportional coefficient K of the PID control. P Integral coefficient K I and differential coefficient K D The input to the BP neural network includes the set heading angle, the actual output value, the error, and the bias term. The bias term is set to 1, so the number of nodes in the input layer is 4. The number of hidden layers in the BP neural network is set to 1, and the number of nodes is set to 5. The final structure of the BP neural network is as follows: the input layer contains 4 nodes, namely the set value, the actual value, the error, and the bias term; the hidden layer contains 5 nodes; and the output layer contains 3 nodes: the proportional coefficient, the integral coefficient, and the derivative coefficient.

[0023] The initial values ​​for the connection weights of both the hidden layer and the output layer are chosen as random values ​​in the range [-1, 1].

[0024] The activation function for the hidden layer is the hyperbolic tangent function.

[0025] (1)

[0026] Where e is the base of the natural logarithm, the derivative of the activation function of the hidden layer is:

[0027] (2)

[0028] The output layer nodes are K P K I and K D K P K I and K D Since the number cannot be less than zero, a non-negative hyperbolic tangent function is chosen as the activation function for the output layer.

[0029] (3)

[0030] The derivative of the activation function of the output layer is:

[0031] (4).

[0032] In S2, the output of the input layer of the BP neural network is:

[0033] (5)

[0034] In the formula, x i (k) represents the input of the neural network input layer at the current time, and the superscript (1) represents the input layer;

[0035] The input to the hidden layer is:

[0036] (6)

[0037] In the formula, ω ji (2) (k) represents the connection weight between hidden layer neuron j and input layer neuron i, and the superscript (1) represents the hidden layer;

[0038] The output of the hidden layer is:

[0039] (7)

[0040] In the formula, f() is the hyperbolic tangent function shown in formula (1);

[0041] The input to the output layer is:

[0042] (8)

[0043] In the formula, ω lj (3)(k) represents the connection weight between output layer neuron l and hidden layer neuron j;

[0044] The output of the output layer is:

[0045] (9)

[0046] In equation (9), g() is the non-negative hyperbolic tangent function shown in equation (1.3);

[0047] In step S4, the learning rate η is 0.3, and the formula for calculating the weight update of the output layer is:

[0048] (12)

[0049] In the formula,

[0050] (13)

[0051] g'() is the derivative of the non-negative hyperbolic tangent function in formula (4);

[0052] The formula for calculating the weight update of the hidden layer is:

[0053] (14)

[0054] In the formula,

[0055] (15)

[0056] f'( ) is the derivative of the hyperbolic tangent function in formula (2);

[0057] In S6, the specific calculation method falls into four categories:

[0058] 1. If ,and ,but ;

[0059] 2. If ,and ,but ;

[0060] 3. If ,and ,but ;

[0061] 4. If ,and ,but .

[0062] In S7, to prevent the thruster from starting frequently, a dead zone of ±0.5° is set according to the automatic orientation accuracy requirements. If the error is within the dead zone, the orientation target is considered to have been reached, and all directional solenoid valves are closed. At this time, the thruster does not work.

[0063] When the error is outside the dead zone, the hull steering is controlled by opening / closing solenoid valves in different directions, and the propeller speed is controlled by proportional valves. The control input of the proportional valves is derived from a PID control law based on a BP neural network. Once the BP neural network enters a stable operating phase, it continuously adjusts the proportional coefficient K of the three control parameters of the PID control law. P Integral coefficient K I and differential coefficient K D After optimization, the output of the PID controller, after being distributed by thrust, becomes the proportional valve control quantity for controlling the thrust speed of the bow and stern sides.

[0064] An electronic device includes: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the methods described above.

[0065] A computer-readable storage medium storing program code that can be invoked by a processor to perform the method described above.

[0066] The beneficial effect of this invention is due to the use of PID control of the three parameters K. P K I K D Characterized by mutual cooperation and constraint, conventional PID controllers have fixed parameters and lack adaptive capabilities. During submersible operation, as sea conditions change, the control parameters cannot always be guaranteed to be at the optimal solution, resulting in overshoot of the control input and frequent start-stop of the thrusters. This invention utilizes the mapping capability of BP neural networks to nonlinear functions, enabling the optimal solution for various nonlinear combinations of the three parameters in the PID controller to be obtained through self-learning. This ensures the depth-keeping, orientation control accuracy, and dynamic performance of the submersible under complex sea conditions.

[0067] Meanwhile, this invention also designs a navigation control method suitable for the "main thrust + auxiliary thrust" propulsion system of underwater vehicles, ensuring that the underwater vehicle can complete automatic depth and automatic orientation operations with a strategy that saves more energy and responds faster. Attached Figure Description

[0068] Figure 1 This is a schematic diagram of the directional control principle of an underwater vehicle.

[0069] Figure 2 A diagram of a three-layer BP neural network.

[0070] Figure 3 The diagram below shows the control flow of the present invention, using directional control as an example. Detailed Implementation

[0071] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0072] The steps of this embodiment of the invention are as follows:

[0073] A "main thruster + auxiliary thruster" propulsion system typically includes an even number of main thrusters, an even number of vertical thrusters (e.g., left vertical thruster + right vertical thruster), an even number of lateral thrusters (e.g., bow thruster + stern thruster), and bow and stern rudders. The bow and stern thrusters provide lateral thrust for controlling the submarine's turning direction, achieving directional control; the left and right vertical thrusters provide upward thrust and pitch moment for depth control. The degrees of freedom of the bow and stern thrusters and the left and right vertical thrusters are decoupled, allowing for independent control with similar logic. This explanation focuses on directional control.

[0074] The orientation control process of the submersible is as follows: the actual heading angle of the hull is measured by the compass and compared with the set heading angle to obtain the error e and the error change rate. The control logic is PID control based on BP neural network. After obtaining the control law u, the thrust is distributed to the bow and stern thrusters to achieve the maintenance of the heading angle of the submersible.

[0075] The BP neural network part of the control logic is used to find the optimal solution for the three control parameters of the PID controller, and includes a training phase and an operating phase. The purpose of the training phase is to enable the connection weights between each neuron to self-correct according to certain learning rules. When the set performance indicators meet the requirements, the training phase ends and the system enters the stable operating phase.

[0076] The algorithm steps during the training phase are as follows:

[0077] S1: Determine the structure of the BP neural network, including the number of layers and the number of nodes in each layer, select the initial values ​​of the connection weights between each layer, and select the activation function;

[0078] The BP neural network is used to fine-tune the parameters of PID control; therefore, the output layer has 3 nodes, each corresponding to the proportional coefficient K of the PID control. P Integral coefficient K I and differential coefficient K DThe input to the BP neural network includes the set heading angle, the actual output value, the error, and the bias term. The bias term is set to 1, therefore the number of nodes in the input layer is 4. When determining the number of nodes and the number of hidden layers, these should be minimized as much as possible to reduce the system size, reduce system complexity, and shorten the learning time. In PID control applications, one or two hidden layers are sufficient to meet the requirements. Therefore, the BP neural network of this invention has 1 hidden layer and 5 nodes. The final BP neural network structure is as follows: the input layer contains 4 nodes, namely the set value, the actual value, the error, and the bias term; the hidden layer contains 5 nodes; and the output layer contains 3 nodes: the proportional coefficient, the integral coefficient, and the derivative coefficient.

[0079] The initial values ​​for the connection weights of both the hidden layer and the output layer are chosen as random values ​​in the range [-1, 1].

[0080] The activation function for the hidden layer is the hyperbolic tangent function.

[0081] (1)

[0082] Where e is the base of the natural logarithm, the derivative of the activation function of the hidden layer is:

[0083] (2)

[0084] The output layer nodes are K P K I and K D K P K I and K D Since the number cannot be less than zero, a non-negative hyperbolic tangent function is chosen as the activation function for the output layer.

[0085] (3)

[0086] The derivative of the activation function of the output layer is:

[0087] (4)

[0088] S2: Forward network computation;

[0089] The output of the input layer of the BP neural network is:

[0090] (5)

[0091] In the formula, x i (k) represents the input of the neural network input layer at the current time, and the superscript (1) represents the input layer;

[0092] The input to the hidden layer is:

[0093] (6)

[0094] In the formula, ω ji (2) (k) represents the connection weight between hidden layer neuron j and input layer neuron i, and the superscript (1) represents the hidden layer;

[0095] The output of the hidden layer is:

[0096] (7)

[0097] In the formula, f() is the hyperbolic tangent function shown in formula (1);

[0098] The input to the output layer is:

[0099] (8)

[0100] In the formula, ω lj (3) (k) represents the connection weight between output layer neuron l and hidden layer neuron j;

[0101] The output of the output layer is:

[0102] (9)

[0103] In equation (9), g() is the non-negative hyperbolic tangent function shown in equation (1.3);

[0104] S3: Select the performance index function E(k) as the square of the output error:

[0105] (10)

[0106] Where r(k) is the set heading angle, and y(k) is the actual heading angle at the current moment, i.e., the heading angle measured by the compass after the control law u(k) output by the PID controller acts on the controlled object. The incremental PID control law is as follows:

[0107] (11)

[0108] In the formula, e(k) is the output error at the current moment, that is, the error between the set heading angle and the actual heading angle, which is r(k)-y(k), and the control parameter K... P K I K D This is the output O1 of the BP neural network. (3) (k) 、O2 (3) (k), O3 (3) (k);

[0109] S4: If the performance index function E(k) is less than or equal to the threshold, the training phase ends; otherwise, the error is propagated in the reverse direction, and the weights are modified layer by layer according to the gradient descent method so that the network weight coefficients are adjusted according to the learning rate η until the performance index E(k) is less than or equal to the threshold.

[0110] With a learning rate η of 0.3, the formula for calculating the weight update of the output layer is as follows:

[0111] (12)

[0112] In the formula,

[0113] (13)

[0114] g'() is the derivative of the non-negative hyperbolic tangent function in formula (4);

[0115] The formula for calculating the weight update of the hidden layer is:

[0116] (14)

[0117] In the formula,

[0118] (15)

[0119] f'( ) is the derivative of the hyperbolic tangent function in formula (2);

[0120] S5: Increment k by 1, return the updated weights from S4 to S2 and start the calculation again. If the performance index function E(k) is less than or equal to the threshold, it means that the BP neural network has met the requirements. Fix the network parameters, which are the connection weights between neurons in adjacent layers, and end the training phase to enter the working phase; otherwise, continue training.

[0121] After the BP neural network enters the working phase, the parameters of the PID control law are optimized. The steps of the attitude control method for the "main thruster + auxiliary thruster" propulsion system of a submarine designed in this invention are as follows:

[0122] S6: During the operational phase, when calculating the error e(k), the turning method needs to be considered: When the submersible adjusts its heading, it chooses to turn left or right. To save energy and improve response speed, the minimum path turning should be selected, that is, the path with the absolute value of the error difference within 180°. Therefore, the error value e(k) is converted to the range of −180° to 180°. A positive error indicates a right turn, and a negative error indicates a left turn. The specific calculation method involves four cases:

[0123] 1. If ,and ,but ;

[0124] 2. If ,and ,but ;

[0125] 3. If ,and ,but ;

[0126] 4. If ,and ,but .

[0127] S2: The operation of the propeller is jointly controlled by a proportional valve and two solenoid valves, one for left and one for right. The proportional valve controls the speed of the propeller, and the output of the solenoid valve is an on / off signal that controls whether the propeller is working. Taking the left turn of the hull as an example, the bow thruster proportional valve controls the speed of the bow thruster, the bow thruster solenoid valve to the left is open, and the bow thruster solenoid valve to the right is closed, together controlling the bow to move to the left; at the same time, the stern thruster proportional valve controls the speed of the stern thruster, the stern thruster solenoid valve to the left is closed, and the stern thruster solenoid valve to the right is open, together controlling the stern to move to the right. The bow and stern work together to make the hull turn to the left.

[0128] To prevent the thrusters from starting frequently, a dead zone of ±0.5° is set according to the automatic orientation accuracy requirements. If the error is within the dead zone, the orientation target is considered to have been reached, and all directional solenoid valves are closed. At this time, the thrusters do not work.

[0129] When the error is outside the dead zone, the hull steering is controlled by opening / closing the solenoid valves in different directions, and the propeller speed is controlled by the proportional valve; wherein, the control quantity of the proportional valve is derived from the aforementioned PID control law based on the BP neural network, as shown in formula (11). The BP neural network, which has entered the stable working stage, continuously adjusts the proportional coefficient K of the three control parameters in formula (11). P Integral coefficient K I and differential coefficient K D After optimization, the output of the PID controller, after being distributed by thrust, becomes the proportional valve control quantity for controlling the thrust speed of the bow and stern sides.

Claims

1. A method for attitude control of a submersible based on BP neural network PID control, characterized in that... Includes the following steps: S1: Determine the structure of the BP neural network, including the number of layers and the number of nodes in each layer, select the initial values ​​of the connection weights between each layer, and select the activation function; S2: Forward network computation; S3: Select the performance index function E(k) as the square of the output error: (10) Where r(k) is the set heading angle, and y(k) is the actual heading angle at the current moment, i.e., the heading angle measured by the compass after the control law u(k) output by the PID controller acts on the controlled object. The incremental PID control law is as follows: (11) In the formula, e(k) is the output error at the current moment, that is, the error between the set heading angle and the actual heading angle, which is r(k)-y(k), and the control parameter K... P K I K D This is the output O1 of the BP neural network. (3) (k) 、O2 (3) (k) 、O3 (3) (k); S4: If the performance index function E(k) is less than or equal to the threshold, the training phase ends; otherwise, the error is propagated in the reverse direction, and the weights are modified layer by layer according to the gradient descent method so that the network weight coefficients are adjusted according to the learning rate η until the performance index E(k) is less than or equal to the threshold. S5: Increment k by 1, return the updated weights from S4 to S2 and start the calculation again. If the performance index function E(k) is less than or equal to the threshold, it means that the BP neural network has met the requirements. Fix the network parameters, which are the connection weights between neurons in adjacent layers, and end the training phase to enter the working phase; otherwise, continue training. S6: During the working phase, when calculating the error e(k), the turning method needs to be considered: When the submersible adjusts its heading, it can choose to turn left or right. In order to save energy and improve response speed, the minimum path turning should be selected, that is, the path with the absolute value of the difference within 180° should be selected for turning. Therefore, the error value e(k) is converted to the range of −180° to 180°. When the error is positive, it turns right, and when the error is negative, it turns left. S7: The operation of the propeller is jointly controlled by a proportional valve and two solenoid valves, one for left and one for right. The proportional valve controls the speed of the propeller, and the output of the solenoid valve is an on / off signal that controls whether the propeller is working. Taking the left turn of the hull as an example, the bow thruster proportional valve controls the speed of the bow thruster, the bow thruster solenoid valve to the left is open, and the bow thruster solenoid valve to the right is closed, together controlling the bow to move to the left. At the same time, the stern thruster proportional valve controls the speed of the stern thruster, the stern thruster solenoid valve to the left is closed, and the stern thruster solenoid valve to the right is open, together controlling the stern to move to the right. The bow and stern work together to make the hull turn to the left.

2. The underwater vehicle attitude control method based on BP neural network PID control according to claim 1, characterized in that: In S1, the BP neural network is used to fine-tune the PID control parameters; therefore, the output layer has 3 nodes, each corresponding to the proportional coefficient K of the PID control. P Integral coefficient K I and differential coefficient K D The input to the BP neural network includes the set heading angle, the actual output value, the error, and the bias term. The bias term is set to 1, so the number of nodes in the input layer is 4. The number of hidden layers in the BP neural network is set to 1, and the number of nodes is set to 5. The final structure of the BP neural network is as follows: the input layer contains 4 nodes, namely the set value, the actual value, the error, and the bias term; the hidden layer contains 5 nodes; and the output layer contains 3 nodes: the proportional coefficient, the integral coefficient, and the derivative coefficient. The initial values ​​for the connection weights of both the hidden layer and the output layer are chosen as random values ​​in the range [-1, 1]. The activation function for the hidden layer is the hyperbolic tangent function. (1) Where e is the base of the natural logarithm, the derivative of the activation function of the hidden layer is: (2) The output layer nodes are K P K I and K D K P K I and K D Since the number cannot be less than zero, a non-negative hyperbolic tangent function is chosen as the activation function for the output layer. (3) The derivative of the activation function of the output layer is: (4)。 3. The underwater vehicle attitude control method based on BP neural network PID control according to claim 2, characterized in that: In S2, the output of the input layer of the BP neural network is: (5) In the formula, x i (k) represents the input of the neural network input layer at the current time, and the superscript (1) represents the input layer; The input to the hidden layer is: (6) In the formula, ω ji (2) (k) represents the connection weight between hidden layer neuron j and input layer neuron i, and the superscript (1) represents the hidden layer; The output of the hidden layer is: (7) In the formula, f() is the hyperbolic tangent function shown in formula (1); The input to the output layer is: (8) In the formula, ω lj (3) (k) represents the connection weight between output layer neuron l and hidden layer neuron j; The output of the output layer is: (9) In equation (9), g() is the non-negative hyperbolic tangent function shown in equation (1.3).

4. The underwater vehicle attitude control method based on BP neural network PID control according to claim 3, characterized in that: In step S4, the learning rate η is 0.3, and the formula for calculating the weight update of the output layer is: (12) In the formula, (13) g'() is the derivative of the non-negative hyperbolic tangent function in formula (4); The formula for calculating the weight update of the hidden layer is: (14) In the formula, (15) f'( ) is the derivative of the hyperbolic tangent function in formula (2).

5. The underwater vehicle attitude control method based on BP neural network PID control according to claim 1, characterized in that: In S6, the specific calculation method falls into four categories:

1. If ,and ,but ; 2. If ,and ,but ; 3. If ,and ,but ; 4. If ,and ,but .

6. The underwater vehicle attitude control method based on BP neural network PID control according to claim 1, characterized in that: In S7, to prevent the thruster from starting frequently, a dead zone of ±0.5° is set according to the automatic orientation accuracy requirements. If the error is within the dead zone, the orientation target is considered to have been reached, and all directional solenoid valves are closed. At this time, the thruster does not work. When the error is outside the dead zone, the hull steering is controlled by opening / closing solenoid valves in different directions, and the propeller speed is controlled by proportional valves. The control input of the proportional valves is derived from a PID control law based on a BP neural network. Once the BP neural network enters a stable operating phase, it continuously adjusts the proportional coefficient K of the three control parameters of the PID control law. P Integral coefficient K I and differential coefficient K D After optimization, the output of the PID controller is distributed with thrust to obtain the proportional valve control quantity that controls the thrust speed of the bow and stern sides.

7. An electronic device, characterized in that, include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1-6.