Underwater robot thrust allocation method based on double-branch physical perception neural network
Patent Information
- Application Number
- CN202611275088.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-09-22
AI Technical Summary
[0004]目前,水下机器人推力分配方法主要存在以下几方面问题:其一,伪逆法通过广义逆矩阵将期望广义力映射为推力指令,计算简单但受限于推力布置矩阵的病态条件数,对输入噪声的放大效应显著,分配精度不足;其二,序列二次规划、粒子群优化等在线迭代求解方法虽能处理约束条件,但单次求解耗时长,难以满足水下机器人高频实时控制需求;其三,现有基于神经网络的方法多采用单路前馈结构,各输出通道被同等对待,无法对纵倾力矩和偏航力矩等精细化维度进行差异化处理,在小尺度物理量的预测上精度低于传统伪逆法;其四,现有方法均未将推力布置矩阵所表达的物理规律显式编码至损失函数中,物理可信性不足
[0041]1.本发明通过引入独立的力矩修正分支,将其输出的修正量叠加至主干网络对应的输出上,实现了对纵倾力矩和偏航力矩两个通道的针对性增强,有效提升了该两个通道的预测准确性,使推力分配在所有六个自由度上的精度均得到保障。
Smart Images

Figure CN122795035A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater robot thrust distribution technology, and more specifically, to an underwater robot thrust distribution method based on a dual-branch physical perception neural network. Background Technology
[0002] Underwater robots are playing an increasingly important role in fields such as marine resource exploration and underwater facility inspection. For example, the small cable-controlled underwater robot M6 is equipped with six magnetically coupled thrusters, four of which are arranged in a vector direction in the horizontal direction and two in the vertical direction. This thruster layout enables the underwater robot M6 to have all-directional anti-current capabilities and good maneuverability and stability underwater.
[0003] Thrust distribution is a crucial component of the underwater robot's motion control system. Its task is to rationally distribute the expected generalized forces (longitudinal force, lateral force, vertical force, roll moment, pitch moment, and yaw moment) calculated by the motion controller to each thruster, generating thrust commands for each thruster. The quality of the thrust distribution method directly affects the underwater robot's motion control accuracy, energy efficiency, and system reliability.
[0004] Currently, the thrust allocation methods for underwater robots mainly suffer from the following problems: First, the pseudo-inverse method maps the desired generalized force into thrust commands through a generalized inverse matrix. While computationally simple, it is limited by the ill-conditioned number of the thrust arrangement matrix, resulting in a significant amplification effect on input noise and insufficient allocation accuracy. Second, although online iterative solution methods such as sequential quadratic programming and particle swarm optimization can handle constraints, each solution is time-consuming, making it difficult to meet the high-frequency real-time control requirements of underwater robots. Third, existing neural network-based methods mostly adopt a single-path feedforward structure, treating each output channel equally and failing to differentiate for finer dimensions such as pitch and yaw moments, resulting in lower accuracy than traditional pseudo-inverse methods in predicting small-scale physical quantities. Fourth, existing methods do not explicitly encode the physical laws expressed by the thrust arrangement matrix into the loss function, leading to insufficient physical reliability.
[0005] There is currently no description of thrust distribution methods for a six-thruster vector configuration. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a thrust distribution method for underwater robots based on a dual-branch physical perception neural network.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] A thrust distribution method for underwater robots based on a dual-branch physical sensing neural network includes the following steps:
[0009] Step S1: Based on the spatial position and installation angle of the underwater robot thrusters, establish a thruster vector arrangement matrix. The thruster vector arrangement matrix is used to describe the positive physical relationship of the thrust command of each thruster being mapped to the generalized force.
[0010] Step S2: Cartesian product sampling is performed within the thruster thrust command range. The generalized force corresponding to each group of sampled thrust commands is calculated using the thruster vector arrangement matrix, and a training dataset containing the expected generalized force and thrust command is generated.
[0011] Step S3: Construct a dual-branch deep neural network that includes a backbone network and a torque correction branch. The backbone network outputs the preliminary predicted values of all thrust commands, and the torque correction branch outputs the correction amount of the torque channel and superimposes it onto the corresponding output of the backbone network.
[0012] Step S4: Construct a loss function that includes a physical consistency loss term. The physical consistency loss term encodes the physical laws expressed by the thruster vector arrangement matrix into the loss function. Train a dual-branch deep neural network using the training dataset.
[0013] Step S5: Perform real-time thrust allocation using the trained dual-branch deep neural network.
[0014] Furthermore, in step S1, the underwater robot is equipped with six thrusters. Four horizontal thrusters are arranged in a vector arrangement below the center of gravity of the underwater robot, and the thrust axis forms a 30° angle with the X-axis of the underwater robot's body coordinate system. Two vertical thrusters are arranged symmetrically above the center of gravity of the underwater robot, and the thrust axis is along the Z-axis of the body coordinate system.
[0015] Furthermore, step S2 includes the following steps:
[0016] Step S21: Sample the thrust commands of each thruster within a preset range by performing Cartesian product sampling at fixed step sizes to generate a thrust command sample set covering the complete thrust space;
[0017] Step S22: Calculate the generalized force corresponding to each set of thrust command samples using the thruster vector arrangement matrix to form input-output data pairs;
[0018] Step S23: Add Gaussian white noise to the input data and output data respectively;
[0019] Step S24: Divide all data into training set, validation set and test set according to a preset ratio.
[0020] Furthermore, in step S3, the backbone network is a multi-layer fully connected feedforward network, and the torque correction branch is a multi-layer fully connected feedforward network with a width smaller than that of the backbone network. The torque correction branch only corrects the thrust channels corresponding to the pitch moment and yaw moment.
[0021] Furthermore, the torque correction branch outputs thrust corrections for the pitch and yaw moments. These thrust corrections are multiplied by a correction factor and then added to the corresponding outputs of the main network to achieve refined correction of the thrust commands corresponding to the pitch and yaw moments.
[0022] Furthermore, in step S4, the physical consistency loss term is the mean square value of the deviation between the thrust command predicted by the dual-branch deep neural network and the expected generalized force after being synthesized by the thruster vector arrangement matrix, and its expression is:
[0023]
[0024] In the formula, Arrange the thruster vector matrix; The thrust command is predicted by a dual-branch deep neural network; For the generalized force of expectation; The Euclidean norm of a vector; This represents the number of samples used in a single training iteration.
[0025] Furthermore, in step S4, the loss function also includes a weighted mean square error loss term and an energy penalty loss term. The weighted mean square error loss term assigns a higher weight coefficient to the thrust command corresponding to the pitch moment and yaw moment than to other dimensions.
[0026] Furthermore, the energy penalty loss term is the mean square value of the thrust command predicted by the two-branch deep neural network, and its expression is:
[0027]
[0028] In the formula, The number of samples used in a single training iteration; The thrust command is predicted by a dual-branch deep neural network; This represents the Euclidean norm of a vector.
[0029] Furthermore, step S5 includes the following steps:
[0030] Step S51: Deploy the trained dual-branch deep neural network into the control system of the underwater robot for thrust distribution calculation.
[0031] Step S52: During actual operation, the motion controller calculates the current desired generalized force in real time;
[0032] Step S53: Input the desired generalized force into the dual-branch deep neural network and obtain the final thrust command of each thruster through one forward propagation calculation.
[0033] Step S54: The thrust command is sent to each thrust actuator to realize the real-time thrust distribution to the underwater robot.
[0034] The present invention also provides an underwater robot thrust distribution system based on a dual-branch physical sensing neural network, the system comprising:
[0035] The thruster vector arrangement matrix construction module is used to build the thruster vector arrangement matrix of the underwater robot thruster system;
[0036] The training dataset generation module is used to generate a training dataset covering the entire thrust space based on the thruster vector arrangement matrix;
[0037] The dual-branch deep neural network module, which includes a backbone network and a torque correction branch, is used to map the desired generalized force into thrust commands for each thruster.
[0038] The training module is used to train a dual-branch deep neural network based on a loss function.
[0039] The deployment inference module is used to deploy the trained dual-branch deep neural network to the underwater robot control system and perform real-time thrust distribution.
[0040] The beneficial effects of this invention are:
[0041] 1. This invention introduces an independent torque correction branch and superimposes its output correction amount onto the corresponding output of the backbone network, thereby achieving targeted enhancement of the pitch moment and yaw moment channels, effectively improving the prediction accuracy of these two channels, and ensuring the accuracy of thrust distribution across all six degrees of freedom.
[0042] 2. This invention uses the physical mapping relationship expressed by the thruster vector arrangement matrix as a consistency constraint embedded in the loss function, so that the network is continuously guided by physical laws while fitting the training data, which reduces the deviation between the network prediction results and the physical model, and enhances the reliability and interpretability of the allocation results under actual operating conditions.
[0043] 3. This invention transfers the complex iterative optimization process to the offline training stage. In actual operation, only one forward propagation of the neural network is needed to obtain all thrust commands, which greatly reduces the online computing burden and effectively avoids the computing delay caused by iterative solutions, enabling the thrust allocation module to fully adapt to the real-time control requirements of underwater robots. Attached Figure Description
[0044] Figure 1 This is a flowchart of an underwater robot thrust allocation method based on a dual-branch physical perception neural network in this embodiment;
[0045] Figure 2 This is a framework diagram of an underwater robot thrust distribution system based on a dual-branch physical perception neural network in this embodiment;
[0046] Figure 3 This is a schematic diagram of one layout of the thrusters in this embodiment;
[0047] Figure 4 This is an architecture diagram of a dual-branch deep neural network in this embodiment;
[0048] Figure 5 This is an architecture diagram of a single-branch neural network in the existing technology;
[0049] Figure 6a This is a graph showing how the loss function changes with the training cycle during the training of the dual-branch deep neural network in this embodiment.
[0050] Figure 6b This is a graph showing how the weighted mean square error loss term changes with the training period during the training of the dual-branch deep neural network in this embodiment.
[0051] Figure 6c This is a graph showing how the physical consistency loss term changes over the training period during the training of the dual-branch deep neural network in this embodiment.
[0052] Figure 6d This is a graph showing how the energy penalty loss term changes with the training cycle during the training of the dual-branch deep neural network in this embodiment.
[0053] Figure 7 This is a comparison chart of the root mean square error of the method and the pseudo-inverse method in each degree of freedom in this embodiment;
[0054] Figure 8a In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions above;
[0055] Figure 8b In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions above;
[0056] Figure 8c In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions above;
[0057] Figure 8d In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions above;
[0058] Figure 8e In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions above;
[0059] Figure 8f In this embodiment, the method and the pseudo-inverse method differ in degrees of freedom. A comparison chart of error distributions.
[0060] Figure labels: Thruster vector arrangement matrix construction module 1, training dataset generation module 2, dual-branch deep neural network module 3, training module 4, deployment inference module 5. Detailed Implementation
[0061] 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, and 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.
[0062] Example: A thrust allocation method for underwater robots based on a dual-branch physical perception neural network. The method first establishes a thruster vector arrangement matrix based on the spatial position and installation angle of the underwater robot's thrusters. This matrix describes the positive physical relationship between the thrust commands of each thruster and the generalized force. Second, a Cartesian product sampling strategy is used to generate a training dataset covering the complete thrust space, and random noise is injected to enhance the model's robustness. Then, a dual-branch deep neural network is constructed, including a backbone network and a torque correction branch. The backbone network outputs preliminary predictions of all thrust commands, while the correction branch specifically refines the thrust channels corresponding to the pitch and yaw moments. Simultaneously, a physical perception loss function is designed, incorporating a weighted combination of three terms: weighted mean square error loss, physical consistency loss, and energy penalty loss. This explicitly encodes the physical laws expressed by the thruster vector arrangement matrix into the loss function. Finally, the trained network is deployed in the underwater robot control system to achieve end-to-end real-time mapping from the desired generalized force to the thrust commands of each thruster. The thrust commands of each thruster are converted into motor current commands according to a linear relationship and then executed to achieve a physically feasible high-precision thrust output.
[0063] like Figure 1 As shown, the method includes the following steps:
[0064] Step S1: Based on the spatial position and installation angle of the underwater robot thrusters, establish a thruster vector arrangement matrix. The thruster vector arrangement matrix is used to describe the positive physical relationship of the thrust command of each thruster being mapped to a generalized force.
[0065] This step aims to establish a thruster vector arrangement matrix, which describes the positive physical relationship between the thrust command of each thruster and the generalized force, providing a benchmark for subsequent training data generation and physical consistency loss calculation.
[0066] Specifically, the steps include:
[0067] Step S11: Establish the body coordinate system of the underwater robot, with the center of gravity as the origin, the X-axis pointing forward of the underwater robot, the Y-axis pointing to the starboard side of the underwater robot, and the Z-axis pointing downward of the underwater robot.
[0068] Step S12: Determine the position coordinates and installation angle of each thruster in the body coordinate system. For example... Figure 3 As shown, the underwater robot M6 is equipped with a total of six thrusters, four of which are horizontal thrusters and two of which are vertical thrusters. The four horizontal thrusters are arranged in a vector shape below the center of gravity of the underwater robot, and the thrust axis is at a 30° angle with the X-axis of the body coordinate system. The two vertical thrusters are symmetrically arranged above the center of the underwater robot, and the thrust axis is along the Z-axis of the body coordinate system.
[0069] Step S13: Based on the thruster position coordinates and installation angle, establish the thruster vector arrangement matrix B of the underwater robot M6. , (for the set of real numbers), satisfying This formula expresses the thrust command from each thruster. The physical mapping relationship of the generalized force F is calculated in the forward direction, where, For the generalized force of expectation, For longitudinal force, It is a lateral force. For vertical force, For the tilting moment, For the pitching moment, For yaw moment, It is the transpose operator; , which are the thrust commands for each propeller. , , , , and Each command corresponds to a thrust command for one of the six thrusters.
[0070] The specific form of the thruster vector arrangement matrix B is as follows:
[0071]
[0072] In the formula, The installation angle of the horizontal thruster. ; The vertical distance from the horizontal thruster to the center of gravity. =0.0605; The lateral distance from the vertical thruster to the center of gravity. =0.129; and These are the equivalent arms of the front horizontal thruster and the rear horizontal thruster, respectively. , ,in =0.175452, =0.184548, where represents the longitudinal lever arm of the front and rear horizontal thrusters, respectively. =0.127626, =0.122374, which are the lateral lever arms of the front and rear horizontal thrusters, respectively.
[0073] Further, in step S2, Cartesian product sampling is performed within the thruster thrust command range, the generalized force corresponding to each group of sampled thrust commands is calculated using the thruster vector arrangement matrix, and a training dataset containing the expected generalized force and thrust commands is generated.
[0074] This step aims to provide high-quality training samples covering the entire thrust space for the dual-branch deep neural network, ensuring that the network has good generalization ability across the global thrust range.
[0075] Specifically, the steps include:
[0076] Step S21: Set the sampling range of thrust commands for each thruster, and sample the thrust commands of the six thrusters by Cartesian product at a fixed step size to generate a thrust command sample set covering the complete thrust space.
[0077] Step S22: Using the established thruster vector arrangement matrix B, calculate the expected generalized force F corresponding to each group of thrust command samples to form an input-output data pair. The input is the desired generalized force, and the output is the corresponding thrust command.
[0078] Step S23: Add Gaussian white noise to the input data and output data respectively to simulate the sensor measurement noise and thruster output uncertainty in the actual system.
[0079] Step S24: Divide all data into training set, validation set and test set according to a preset ratio.
[0080] Further, in step S3, a dual-branch deep neural network is constructed, which includes a backbone network and a torque correction branch. The backbone network outputs the preliminary predicted values of all thrust commands, and the torque correction branch outputs the correction amount of the torque channel and superimposes it onto the corresponding output of the backbone network.
[0081] This step aims to achieve hierarchical decoupling and division of labor optimization for global prediction of all thrust commands and fine-grained correction of torque channels through a dual-branch network structure.
[0082] Specifically, such as Figure 4 As shown, a dual-branch deep neural network with six-dimensional input and six-dimensional output is constructed. The input layer receives the expected generalized force corresponding to each set of thrust command samples, and the output layer outputs the thrust commands for each thruster. The backbone network is a multi-layer fully connected feedforward network responsible for the initial prediction of all six-dimensional thrust commands. The torque correction branch is a multi-layer fully connected feedforward network with a width smaller than the backbone network. Its input is the six-dimensional expected generalized force, and its output is a two-dimensional correction amount, corresponding to the thrust correction for pitch moment and yaw moment, respectively. During correction, the thrust correction amount is multiplied by a correction coefficient and added to the corresponding output of the backbone network to achieve fine-grained correction of the thrust commands corresponding to pitch moment and yaw moment.
[0083] The torque correction branch shares input with the backbone network, but its parameters are learned independently. The output layer of the dual-branch deep neural network is a fully connected layer with no additional activation function constraints; the output value range is adaptively determined by the training data.
[0084] Further, in step S4, a loss function containing a physical consistency loss term is constructed. The physical consistency loss term encodes the physical laws expressed by the thruster vector arrangement matrix into the loss function. A dual-branch deep neural network is trained using the training dataset.
[0085] This step aims to explicitly encode the physical laws expressed by the thruster vector arrangement matrix into the loss function, guiding the dual-branch deep neural network to learn a mapping relationship that satisfies both data fitting accuracy and physical consistency constraints.
[0086] Specifically, the steps include:
[0087] Step S41: Construct a physical perception loss function containing a weighted combination of three terms. The expression is:
[0088]
[0089] In the formula, As a weighted mean square error loss term, the thrust commands corresponding to pitch moment and yaw moment are assigned a higher weight coefficient than other dimensions; As a physical consistency loss term, the physical laws expressed by the thruster vector arrangement matrix B are explicitly encoded into the loss function. middle; This is an energy penalty term; , and These are the weighting coefficients for each loss term.
[0090] Physical consistency loss term The expression is:
[0091]
[0092] In the formula, Arrange the thruster vector matrix; The thrust command is predicted by a dual-branch deep neural network; For the generalized force of expectation; The Euclidean norm of a vector; This represents the number of samples used in a single training iteration.
[0093] Energy penalty item The expression is:
[0094]
[0095] In the formula, The number of samples used in a single training iteration; The thrust command is predicted by a dual-branch deep neural network; This represents the Euclidean norm of a vector.
[0096] Step S42: The AdamW optimizer is used to optimize the parameters of the dual-branch deep neural network, and the initial learning rate and weight decay coefficient are set.
[0097] Step S43: The learning rate is dynamically adjusted using a learning rate scheduling strategy;
[0098] Step S44: Use a gradient clipping strategy to limit the gradient range to prevent gradient explosion;
[0099] Step S45: Perform multiple rounds of iterative training on the training set. After each training cycle, evaluate the model performance on the validation set and use an early stopping strategy to prevent overfitting.
[0100] Further, in step S5, real-time thrust allocation is performed using the trained dual-branch deep neural network.
[0101] This step aims to deploy the trained network in the actual control system to achieve end-to-end real-time mapping from the desired generalized force to the thruster thrust.
[0102] Specifically, the steps include:
[0103] Step S51: The trained dual-branch deep neural network is deployed in the control system of the underwater robot for thrust distribution calculation.
[0104] Step S52: During actual operation, the motion controller calculates the current desired generalized force in real time.
[0105] Step S53: The desired generalized force is input into the dual-branch deep neural network. Through one forward propagation, the backbone network outputs the global thrust command, and the torque correction branch outputs the torque channel correction amount and superimposes it to calculate the final thrust command of each thruster. The single inference time of this method can be stably controlled within the control cycle required by the real-time control system.
[0106] Step S54: The thrust command is sent to each thrust actuator to realize the real-time thrust distribution to the underwater robot.
[0107] In practical engineering applications, there is a physical relationship between the output thrust of the propeller motor and the electrode current of the motor. For ducted propeller propellers driven by permanent magnet synchronous motors or brushless DC motors, the electromagnetic torque output by the motor is proportional to the electrode current, and the propeller thrust and electromagnetic torque are approximately linearly related within a certain speed range. Therefore, a mapping relationship from thrust command to current command can be established.
[0108] In this embodiment, the thrust-current mapping relationship of each thruster is described using a linear model, wherein... For the first The thrust command of each thruster For the corresponding drive current command, For the first Thrust coefficient of each thruster (unit: N / A). Thrust coefficient The parameters are determined by the structural parameters of the thruster (including motor torque constant, propeller diameter, duct geometry, etc.) and can be obtained through the thruster's factory performance parameters or hydrodynamic calibration experiments.
[0109] In actual deployment, after the thrust command is converted into a current command, the current closed-loop control module of the motor driver performs current tracking to drive the thruster to output actual thrust.
[0110] This embodiment also provides an underwater robot thrust distribution system based on a dual-branch physical perception neural network, such as... Figure 2 As shown, the system includes a thruster vector arrangement matrix construction module 1, a training dataset generation module 2, a dual-branch deep neural network module 3, a training module 4, and a deployment inference module 5. The thruster vector arrangement matrix construction module 1 is connected to the training dataset generation module 2 and the training module 4. The training dataset generation module 2 is connected to the dual-branch deep neural network module 3. The dual-branch deep neural network module 3 is connected to the training module 4. The training module 4 is connected to the deployment inference module 5. The deployment inference module 5 is connected to the thruster actuator.
[0111] The thruster vector arrangement matrix construction module 1 is used to establish a thruster vector arrangement matrix that describes the mapping relationship between the desired generalized force and the thrust command of each thruster, based on the spatial position and installation angle of the underwater robot thrusters.
[0112] Training dataset generation module 2 is used to perform Cartesian product sampling within the working range of thrust commands of each thruster, calculate the generalized force corresponding to each group of sampled thrust commands using the thruster vector arrangement matrix, and divide the input and output data into training set, validation set and test set according to the proportion after adding Gaussian white noise, thus generating training dataset.
[0113] The dual-branch deep neural network module 3 includes a backbone network and a torque correction branch. The backbone network is used to output the preliminary predicted values of all thrust commands, while the torque correction branch is used to output the correction amounts of the pitch moment and yaw moment corresponding to the thrust channels and superimpose them onto the corresponding outputs of the backbone network, thereby realizing the end-to-end mapping from the desired generalized force to the thrust commands of each thruster.
[0114] Training module 4 is used to construct a physical perception loss function that includes weighted mean square error loss, physical consistency loss and energy penalty loss. The training dataset is used to perform parameter optimization training on a two-branch deep neural network. The physical consistency loss term explicitly encodes the physical laws expressed by the thruster vector arrangement matrix into the loss function.
[0115] Deployment inference module 5 is used to deploy the trained dual-branch deep neural network in the underwater robot control system. During actual operation, it receives the expected generalized force calculated in real time by the motion controller, obtains the real-time thrust command of each thruster through one forward propagation, and sends it to the thruster actuator.
[0116] The effectiveness of the method proposed in this embodiment is verified below:
[0117] like Figure 3 As shown, the underwater robot M6 is equipped with six thrusters, four of which are horizontal thrusters. , , and The thrusters are arranged in a vector configuration below the center of gravity of the underwater robot, with the thrust axis forming a 30° angle with the X-axis; the two vertical thrusters ( and The thrusters are symmetrically arranged above the center of the underwater robot, with their thrust axes along the Z-axis. The position coordinates of each thruster in the body coordinate system are as follows:
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124] The units for all the coordinates above are meters.
[0125] The specific numerical form of the thruster vector arrangement matrix B, established based on the above position coordinates and installation angles, is as follows:
[0126]
[0127] The condition number of the matrix is calculated to be 6.47, which means that the input error will be amplified by a factor of 6.47 when the pseudo-inverse method is used to solve the problem.
[0128] Generate training data according to step S2, in Cartesian product sampling was performed within the range with a step size of 0.06, generating a total of 1,771,561 samples. Gaussian white noise with an amplitude of 0.008 was added to the input and output data, and then the data was divided into training, validation, and test sets at 70%, 15%, and 15% respectively.
[0129] Construct a dual-branch deep neural network following step S3. For example... Figure 4 As shown, the backbone network employs a three-layer hidden structure with 64, 32, and 16 neurons in each layer, respectively. Each hidden layer sequentially contains a fully connected layer, a layer normalization layer, and a ReLU activation function layer. The first two hidden layers each have a Dropout layer (with a ratio of 0.05) to prevent overfitting, and the Dropout layer follows the ReLU activation function layer. The torque correction branch uses a two-layer hidden structure with 32 and 16 neurons in each layer, respectively. Each hidden layer sequentially contains a fully connected layer and a ReLU activation function layer. The correction coefficient is 0.15. The dual-branch deep neural network uses Kaiming's normal initialization to initialize the fully connected layers, and the bias is initialized to zero.
[0130] Design the loss function and train the network according to step S4. The weighted mean square error loss term assigns a weight vector to each thrust command as follows: Weighting coefficient , and The values were 1.0, 0.05, and 0.001, respectively. The AdamW optimizer was used with an initial learning rate of 0.0005 and a weight decay coefficient of 1 × 10⁻⁶. -5 The batch size is set to 512, and a cosine annealing learning rate scheduling and early stopping strategy are adopted.
[0131] To verify the effectiveness of the method proposed in this embodiment, three methods are compared:
[0132] 1. Pseudo-inverse method, using Moore-Penrose generalized inverse matrix Directly calculate thrust command , as the benchmark method;
[0133] 2. Single-branch neural network methods, such as Figure 5 As shown, a standard fully connected network with a structure of 6-64-32-16-6 is used as a comparison.
[0134] 3. The dual-branch deep neural network proposed in this embodiment, such as... Figure 4 As shown, the backbone network structure is 6-64-32-16-6, the torque correction branch structure is 6-32-16-2, and the correction coefficient is 0.15.
[0135] Table 1 shows a comparison of the root mean square error (RMSE) of the three methods at each degree of freedom.
[0136] Table 1. Comparison of root mean square errors of the three thrust distribution methods
[0137]
[0138] As shown in Table 1, the pseudo-inverse method is limited by the condition number (6.47) of the thruster vector arrangement matrix B, and the input noise is amplified by 6.47 times. The overall root mean square error is 0.080533, and the error is relatively large in all six degrees of freedom.
[0139] Single-branch neural networks outperformed the pseudo-inverse method in four degrees of freedom (longitudinal force, lateral force, vertical force, and heel moment) (improvement of 7.0% to 8.3%), but failed to surpass it in the heel and yaw moment channels, showing negative improvements (-11.0% and -14.6%). This is because single-branch deep neural networks treat all output channels equally, failing to differentiate for finer dimensions such as moments, thus limiting the prediction accuracy of small-scale physical quantities. This phenomenon is prevalent in existing single-branch neural network thrust allocation methods.
[0140] like Figure 7 ,as well as Figures 8a-8fAs shown, the dual-branch deep neural network proposed in this embodiment achieves a positive improvement over the pseudo-inverse method in all six degrees of freedom, with an overall root mean square error of 0.075445, representing a 6.3% improvement over the pseudo-inverse method. In the four degrees of freedom—longitudinal force, lateral force, vertical force, and heel moment—the dual-branch deep neural network performs comparably to the single-branch neural network. In the heel moment and yaw moment channels, the dual-branch deep neural network reverses the negative improvement of the single-branch neural network into a positive improvement, increasing performance by 12.6 and 18.1 percentage points, respectively.
[0141] This invention introduces a moment correction branch, specifically targeting the pitch and yaw moments for refined correction, effectively compensating for errors in moment prediction by the backbone network. The moment correction branch shares input with the backbone network but learns its parameters independently. Combined with the weighting coefficients of moment channel 2.0 in the weighted loss function, it forms a three-in-one collaborative optimization of "structure-constraint-task". The aforementioned validation data demonstrates that the design of the moment correction branch fundamentally solves the problem of insufficient moment prediction accuracy in single-branch neural networks.
[0142] The method of this invention utilizes the physical perception loss function. The physical laws expressed by the thruster vector arrangement matrix B are explicitly encoded into the training process. Experiments show that the physical loss continuously and steadily decreases during training, verifying that the deviation between the output of the dual-branch deep neural network and the expected generalized force is continuously reduced after being synthesized by the thruster vector arrangement matrix, and the allocation result has good physical reliability.
[0143] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A thrust distribution method for underwater robots based on a dual-branch physical perception neural network, characterized in that, The steps include the following: Step S1: Based on the spatial position and installation angle of the underwater robot thrusters, establish a thruster vector arrangement matrix. The thruster vector arrangement matrix is used to describe the positive physical relationship of the thrust command of each thruster being mapped to the generalized force. Step S2: Cartesian product sampling is performed within the thruster thrust command range. The generalized force corresponding to each group of sampled thrust commands is calculated using the thruster vector arrangement matrix, and a training dataset containing the expected generalized force and thrust command is generated. Step S3: Construct a dual-branch deep neural network that includes a backbone network and a torque correction branch. The backbone network outputs the preliminary predicted values of all thrust commands, and the torque correction branch outputs the correction amount of the torque channel and superimposes it onto the corresponding output of the backbone network. Step S4: Construct a loss function that includes a physical consistency loss term. The physical consistency loss term encodes the physical laws expressed by the thruster vector arrangement matrix into the loss function. Train a dual-branch deep neural network using the training dataset. Step S5: Perform real-time thrust allocation using the trained dual-branch deep neural network.
2. The underwater robot thrust distribution method based on a dual-branch physical perception neural network according to claim 1, characterized in that, In step S1, the underwater robot is equipped with six thrusters. Four horizontal thrusters are arranged in a vector arrangement below the center of gravity of the underwater robot, and the thrust axis forms a 30° angle with the X-axis of the underwater robot's body coordinate system. Two vertical thrusters are arranged symmetrically above the center of gravity of the underwater robot, and the thrust axis is along the Z-axis of the body coordinate system.
3. The thrust distribution method for underwater robots based on a dual-branch physical perception neural network according to claim 1, characterized in that, Step S2 includes the following steps: Step S21: Sample the thrust commands of each thruster within a preset range by performing Cartesian product sampling at fixed step sizes to generate a thrust command sample set covering the complete thrust space; Step S22: Calculate the generalized force corresponding to each set of thrust command samples using the thruster vector arrangement matrix to form input-output data pairs; Step S23: Add Gaussian white noise to the input data and output data respectively; Step S24: Divide all data into training set, validation set and test set according to a preset ratio.
4. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 1, characterized in that, In step S3, the backbone network is a multi-layer fully connected feedforward network, and the torque correction branch is a multi-layer fully connected feedforward network with a width smaller than that of the backbone network. The torque correction branch only corrects the thrust channels corresponding to the pitch moment and yaw moment.
5. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 4, characterized in that, The torque correction branch outputs the thrust correction amount for the pitch moment and yaw moment. The thrust correction amount is multiplied by the correction coefficient and then added to the corresponding output of the main network to achieve fine-grained correction of the thrust command corresponding to the pitch moment and yaw moment.
6. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 1, characterized in that, In step S4, the physical consistency loss term is the mean square value of the deviation between the thrust command predicted by the dual-branch deep neural network and the expected generalized force after being synthesized by the thruster vector arrangement matrix. Its expression is: In the formula, Arrange the thruster vector matrix; The thrust command is predicted by a dual-branch deep neural network; For the generalized force of expectation; The Euclidean norm of a vector; This represents the number of samples used in a single training iteration.
7. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 1, characterized in that, In step S4, the loss function also includes a weighted mean square error loss term and an energy penalty loss term. The weighted mean square error loss term assigns a higher weight coefficient to the thrust command corresponding to the pitch moment and yaw moment than to other dimensions.
8. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 7, characterized in that, The energy penalty loss term is the mean square value of the thrust command predicted by the two-branch deep neural network, and its expression is: In the formula, The number of samples used in a single training iteration; The thrust command is predicted by a dual-branch deep neural network; This represents the Euclidean norm of a vector.
9. The thrust distribution method for an underwater robot based on a dual-branch physical perception neural network according to claim 1, characterized in that, Step S5 includes the following steps: Step S51: Deploy the trained dual-branch deep neural network into the control system of the underwater robot for thrust distribution calculation. Step S52: During actual operation, the motion controller calculates the current desired generalized force in real time; Step S53: Input the desired generalized force into the dual-branch deep neural network and obtain the final thrust command of each thruster through one forward propagation calculation. Step S54: The thrust command is sent to each thrust actuator to realize the real-time thrust distribution to the underwater robot.
10. An underwater robot thrust distribution system based on a dual-branch physical perception neural network for implementing the method of claim 1, characterized in that, The system includes: The thruster vector arrangement matrix construction module (1) is used to establish the thruster vector arrangement matrix of the underwater robot thruster system; Training dataset generation module (2) is used to generate a training dataset covering the entire thrust space based on the thruster vector arrangement matrix; The dual-branch deep neural network module (3) includes a backbone network and a torque correction branch, which is used to map the desired generalized force into thrust commands for each thruster. Training module (4) is used to train a dual-branch deep neural network based on a loss function; The deployment inference module (5) is used to deploy the trained dual-branch deep neural network to the underwater robot control system and perform real-time thrust distribution.