Local path planning method for unmanned surface vehicle based on residual dynamics compensation
By constructing a lightweight fully connected neural network on the unmanned surface vessel (USV) for dynamic compensation, the problem of inaccurate prediction of inertial gliding distance in USV path planning was solved, achieving high-precision, real-time local path planning, improving obstacle avoidance safety and reducing costs.
Patent Information
- Application Number
- CN202611133715.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-08-25
AI Technical Summary
Existing unmanned surface vessel path planning algorithms cannot accurately predict inertial gliding distances when considering the fluid-added mass and nonlinear resistance unique to the water surface environment. Furthermore, the computational burden of complex analytical hydrodynamic models is large, making it difficult to balance modeling accuracy with real-time planning.
A residual dynamics compensation-based method is adopted. By controlling the unmanned vessel to perform maneuvers to collect state vectors, a lightweight fully connected neural network is constructed and trained. A lightweight fully connected neural network is generated, and a dynamic velocity window is generated by combining the dynamic window method to perform local path planning. Physical consistency constraint filtering and multi-objective weighted evaluation are then performed to generate a corrected predicted trajectory.
It significantly improves the dynamic obstacle avoidance safety of medium and large unmanned vessels, reduces engineering implementation costs, meets the real-time response requirements of embedded devices, has higher safety and interpretability, and can achieve high-precision dynamic correction within the control cycle of the DWA algorithm.
Smart Images

Figure CN122631101A_ABST
Abstract
Description
Technical Field
[0001] This invention discloses a local path planning method for unmanned surface vessels based on residual dynamics compensation, belonging to the field of unmanned vessel automatic navigation and control technology. Background Technology
[0002] With the in-depth development of marine resources, autonomous path planning technology for unmanned surface vessels (USVs) has become particularly crucial. The marine environment is complex and ever-changing, and while existing path planning methods each have their own focus, they all have limitations: Artificial potential field method: While providing a smooth path, it doesn't consider the USV's own kinematic constraints (such as turning radius), leading to significant discrepancies between simulation and actual navigation performance. Vector field histogram method (VFH): Although computationally efficient, it relies excessively on the completeness of sensor information and histogram resolution, easily leading to information loss or computational redundancy. Dynamic window method (DWA): As the most widely used algorithm, while considering motion performance, it still suffers from two major drawbacks: poor policy adaptability: The evaluation weights [α, β, γ] of traditional DWA are usually fixed and cannot be automatically adjusted when the environment changes, easily leading to path planning failure.
[0003] Existing dynamic window methods, based on simplified rigid body kinematics models, neglect the nonlinear hydrodynamic characteristics of medium and large USVs, such as fluid inertia and added mass, leading to model prediction distortion. During deceleration, the inertial glide distance cannot be estimated, resulting in predicted trajectories that are significantly shorter than the actual trajectories and increasing the risk of collisions. Introducing complex analytical hydrodynamic models such as MMG can improve accuracy, but the computational load is too large, making it difficult to meet real-time obstacle avoidance requirements under the limited computing power of embedded devices, and failing to balance modeling accuracy and real-time planning. Summary of the Invention
[0004] The purpose of this invention is to provide a local path planning method for unmanned surface vessels based on residual dynamics compensation, in order to solve the problems in the prior art. The DWA algorithm, based on rigid body kinematics model, ignores the fluid-added mass and nonlinear resistance unique to the water surface environment, which leads to the inability to accurately predict the inertial gliding distance after power cut-off. The complex analytical hydrodynamic model has too much computational load and cannot take into account both modeling accuracy and real-time planning.
[0005] Local path planning methods for unmanned surface vessels based on residual dynamics compensation include: S1. Control the unmanned surface vessel to perform maneuvers and collect state vectors. Calculate the velocity residual between the real-time velocity of the unmanned surface vessel and the velocity predicted by the nominal rigid body kinematics model based on the state vectors. S2. Using the velocity residual as the supervision signal, construct a lightweight fully connected neural network. Use the state vector as the input to train the neural network. Construct a loss function to constrain the neural network training. When the loss function value does not decrease within a preset number of consecutive training cycles, stop training and generate the completed lightweight fully connected neural network. S3. Deploy the trained lightweight fully connected neural network onto the unmanned surface vessel, generate a dynamic velocity window using the dynamic window method, and construct a candidate instruction set based on the discrete points in the dynamic velocity window. S4. Combine the candidate instruction set with the current velocity of the unmanned surface vessel to construct a state vector. Input the state vector into the trained lightweight fully connected neural network. Perform physical consistency constraint filtering on the original output of the lightweight fully connected neural network to obtain the dynamic residual value under the current working condition. Calculate the theoretical velocity of the unmanned surface vessel using the nominal rigid body kinematics model. Calculate the nominal velocity using the dynamic residual value under the current working condition. Update the position of the unmanned surface vessel using the nominal velocity and generate a corrected predicted trajectory. S5. Construct an evaluation function to perform multi-objective weighted evaluation on each corrected predicted trajectory, select the discrete point with the largest evaluation function as the optimal control, and convert the optimal control into the speed command of the unmanned surface vessel propulsion system by using inverse kinematics.
[0006] S1 includes S1.1, controlling the unmanned surface vessel to perform three sets of maneuvers, including step acceleration gliding, zigzag turning, and restricted random maneuvers; step acceleration gliding involves applying maximum thrust to the unmanned surface vessel from rest, reaching a predetermined maximum speed, and then stopping the application of thrust, recording the nonlinear water damping coefficient and longitudinal inertia of the unmanned surface vessel during the free gliding process to rest; zigzag turning involves periodically alternating positive and negative angular velocity commands at a constant speed to excite the unmanned surface vessel to roll and yaw, recording the heading response hysteresis characteristics; restricted random maneuvers include randomly changing linear velocity and angular velocity commands within the legal state space.
[0007] S1 includes S1.2, data collection based on the maneuvering motions of the unmanned surface vessel. state quantity at time 1 , , For true linear velocity, For true angular velocity, For linear velocity commands, This is an angular velocity command; collection The real speed of unmanned surface vessels at all times Theoretical velocity is calculated using the nominal rigid body kinematic model. and calculate and The difference : ; The nominal state transition equation is: ; ; In the formula, For prediction based on the nominal transfer equation Timeline velocity, For prediction based on the nominal transfer equation angular velocity at time, The time constant of the linear velocity channel. The time constant of the angular velocity channel. To control the cycle.
[0008] S2 includes constructing a lightweight fully connected neural network, which is a fully connected feedforward neural network, including an input layer, a hidden layer, and an output layer; The input layer has a dimension of 4 and receives normalized data. The hidden layers consist of three layers, all using the same activation function. The output layer has a dimension of 2, uses linear activation, and outputs linear velocity residuals. and angular velocity residual ; The mean squared error combined with the L2 regularization term is used as the loss function. : ; In the formula, For training batch size, For the first The true residual label of each sample For the first The predicted value for each sample, The regularization coefficient is . These are the network weight parameters. It is the L2 norm. This is the index of the network weight parameters.
[0009] S3 includes, S3.1, deploying the trained lightweight fully connected neural network to the surface unmanned vessel computer platform and integrating it into the Dynamic Window Method (DWA) for local path planning; S3 includes S3.2, and DWA's velocity space sampling and dynamic window based on , Based on the physical performance limitations of the underlying motor, a dynamic speed window is generated. : ; ; ; In the formula, , To replace the variable, For the maximum linear deceleration, For maximum angular acceleration, Intersection symbol; Will Discrete points within Construct a candidate instruction set, For the index of discrete points, For the first linear velocity at discrete points For the first Angular velocity at discrete points.
[0010] S4 includes, S4.1, and... Perform residual inference, including constructing the current state vector based on the candidate instruction set and the current velocity of the unmanned surface vessel. ,Will Input the trained lightweight fully connected neural network and output the network's original predictions. By sequentially applying static zero residual constraints, residual amplitude saturation constraints, and motion direction consistency constraints, the dynamic residual values under the current working condition are obtained. , For the predicted linear velocity residual, For the predicted angular velocity residual, The linear velocity residual under the current operating conditions. This represents the angular velocity residual under the current operating conditions. The static zero residual constraint includes setting the static state threshold as... ,when , , and When, set ; Residual amplitude saturation constraints include setting an upper limit for the linear velocity residual amplitude. and the upper limit of the amplitude of the angular velocity residual ,right and Perform hard limiting: ; ; In the formula, For symbolic functions, Minimum value function Absolute value symbol; Consistency constraints on motion direction include, if ,set up .
[0011] S4 includes S4.2, which involves recursive deduction, including setting the prediction time domain. The time step is Let the prediction step index be... , , Within each prediction step, steps S4.2.1, S4.2.2, and S4.2.3 are executed to generate a result containing... Corrected predicted trajectory for each trajectory point; S4.2.1 Calculate the theoretical speed: ; ; In the formula, For the first The nominal linear velocity of a step. For the first The nominal angular velocity of the step. For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.2, will Overlay and : ; ; In the formula, For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.3, Utilization and Updated location of unmanned surface vessel: ; ; ; In the formula, For the first Predicted heading angle of unmanned surface vessels For the first The x-coordinate of the predicted trajectory point of the unmanned surface vessel. For the first The vertical coordinates of the predicted trajectory points of the unmanned surface vessel.
[0012] S5 includes, S5.1, for each corrected predicted trajectory, performing a multi-objective weighted evaluation using an evaluation function, defining the evaluation function. : ; In the formula, For course evaluation, For obstacle avoidance evaluation, For speed evaluation, For the normalization operator, The weighting coefficients for course evaluation. The weighting coefficients for obstacle avoidance evaluation. These are the weighting coefficients for speed evaluation; Traverse the candidate instruction set and select The largest set of instructions is denoted as ,Will The optimal control law for the current control cycle.
[0013] S5 includes, S5.2, and will The kinematics are converted into rotational speed commands for the left and right thrusters of the unmanned surface vessel through inverse kinematics: ; ; In the formula, This is the left thruster speed command. This is the rotational speed command for the right thruster. The distance between the left and right thrusters. This is the speed / rotational speed mapping coefficient.
[0014] S5 includes S5.3, where the unmanned surface vessel's (USV) bottom-level controller receives rotation speed commands, drives the motor, and controls the USV to complete the current cycle's motion before entering... At any given time, repeat steps S3 to S5.
[0015] Compared to existing technologies, this invention offers the following advantages: By introducing a residual neural network to dynamically compensate for the underlying trajectory deduction model, this invention accurately predicts motion lag and gliding deviation caused by large inertia, significantly improving the dynamic obstacle avoidance safety of medium and large unmanned surface vessels (USVs). It employs a data-driven approach, collecting data through specific maneuver tests on actual vessels to complete model training and deployment, avoiding the dependence of traditional analytical hydrodynamic models on expensive towing pool experiments and precision instruments. Compared to the MMG model, which relies on complex parameter measurements, this solution eliminates the need for expensive experimental facilities and physical parameter calibration, significantly shortening the development cycle and reducing engineering implementation costs and barriers. It achieves high-precision dynamic correction without affecting the 10Hz to 20Hz control cycle of the DWA algorithm, meeting the millisecond-level real-time response requirements of embedded edge computing devices. Compared to end-to-end methods, it offers higher security and interpretability; when the neural network fails, the system can automatically degrade to rely on the nominal model to maintain a baseline plan. The input features of the residual prediction network cover the current state command and historical acceleration sequences from the past N time points. Attached Figure Description
[0016] Figure 1 This is a flowchart of the technology of this invention; Figure 2 This invention relates to a lightweight fully connected neural network structure; Figure 3 It is a graph showing how the training set loss and validation set loss change with the number of training rounds; Figure 4 This is a comparison chart of the speed predictions of the actual hull, the nominal model, and the residual compensation model under the measured stop-and-slide segment; Figure 5 It is a comparison chart of the cumulative distance predictions of the real hull, the nominal model, and the residual compensation model under the measured stop-and-go planing segment; Figure 6 This is a statistical comparison chart of the speed prediction errors of the nominal model and the residual compensation model on multiple measured gliding segments; Figure 7 This is a statistical comparison chart of the distance prediction errors of the nominal model and the residual compensation model on multiple measured gliding segments; Figure 8 This is a comparison chart of the actual value of the test cluster line velocity residual and the MLP prediction value; Figure 9 This is a comparison chart of the actual values of the test set angular velocity residuals and the MLP predicted values; Figure 10 This is a distribution diagram of the prediction error of the test set linear velocity residual; Figure 11 This is a distribution diagram of the prediction error of the angular velocity residuals of the test set; Figure 12 It is a trajectory comparison chart; Figure 13 This is a comparison chart of the analytical residual placeholder model trajectories of traditional DWA and residual compensation DWA; Figure 14 This is a comparison chart of the actual MLP residual compensation trajectories of traditional DWA and residual compensation DWA; Figure 15 It is the true MLP residual compensation linear velocity response of traditional DWA and residual compensation DWA; Figure 16 It is the true MLP residual compensation angular velocity response of traditional DWA and residual compensation DWA. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention are described clearly and completely below. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0018] Local path planning methods for unmanned surface vessels based on residual dynamics compensation include: S1. Control the unmanned surface vessel to perform maneuvers and collect state vectors. Calculate the velocity residual between the real-time velocity of the unmanned surface vessel and the velocity predicted by the nominal rigid body kinematics model based on the state vectors. S2. Using the velocity residual as the supervision signal, construct a lightweight fully connected neural network. Use the state vector as the input to train the neural network. Construct a loss function to constrain the neural network training. When the loss function value does not decrease within a preset number of consecutive training cycles, stop training and generate the completed lightweight fully connected neural network. S3. Deploy the trained lightweight fully connected neural network onto the unmanned surface vessel, generate a dynamic velocity window using the dynamic window method, and construct a candidate instruction set based on the discrete points in the dynamic velocity window. S4. Combine the candidate instruction set with the current velocity of the unmanned surface vessel to construct a state vector. Input the state vector into the trained lightweight fully connected neural network. Perform physical consistency constraint filtering on the original output of the lightweight fully connected neural network to obtain the dynamic residual value under the current working condition. Calculate the theoretical velocity of the unmanned surface vessel using the nominal rigid body kinematics model. Calculate the nominal velocity using the dynamic residual value under the current working condition. Update the position of the unmanned surface vessel using the nominal velocity and generate a corrected predicted trajectory. S5. Construct an evaluation function to perform multi-objective weighted evaluation on each corrected predicted trajectory, select the discrete point with the largest evaluation function as the optimal control, and convert the optimal control into the speed command of the unmanned surface vessel propulsion system by using inverse kinematics.
[0019] S1 includes S1.1, controlling the unmanned surface vessel to perform three sets of maneuvers, including step acceleration gliding, zigzag turning, and restricted random maneuvers; step acceleration gliding involves applying maximum thrust to the unmanned surface vessel from rest, reaching a predetermined maximum speed, and then stopping the application of thrust, recording the nonlinear water damping coefficient and longitudinal inertia of the unmanned surface vessel during the free gliding process to rest; zigzag turning involves periodically alternating positive and negative angular velocity commands at a constant speed to excite the unmanned surface vessel to roll and yaw, recording the heading response hysteresis characteristics; restricted random maneuvers include randomly changing linear velocity and angular velocity commands within the legal state space.
[0020] S1 includes S1.2, data collection based on the maneuvering motions of the unmanned surface vessel. state quantity at time 1 , , For true linear velocity, For true angular velocity, For linear velocity commands, This is an angular velocity command; collection The real speed of unmanned surface vessels at all times Theoretical velocity is calculated using the nominal rigid body kinematic model. and calculate and The difference : ; The nominal state transition equation is: ; ; In the formula, For prediction based on the nominal transfer equation Timeline velocity, For prediction based on the nominal transfer equation angular velocity at time, The time constant of the linear velocity channel. The time constant of the angular velocity channel. To control the cycle.
[0021] S2 includes constructing a lightweight fully connected neural network, which is a fully connected feedforward neural network, including an input layer, a hidden layer, and an output layer; The input layer has a dimension of 4 and receives normalized data. The hidden layers consist of three layers, all using the same activation function. The output layer has a dimension of 2, uses linear activation, and outputs linear velocity residuals. and angular velocity residual ; The mean squared error combined with the L2 regularization term is used as the loss function. : ; In the formula, For training batch size, For the first The true residual label of each sample For the first The predicted value for each sample, The regularization coefficient is . These are the network weight parameters. It is the L2 norm. This is the index of the network weight parameters.
[0022] S3 includes, S3.1, deploying the trained lightweight fully connected neural network to the surface unmanned vessel computer platform and integrating it into the Dynamic Window Method (DWA) for local path planning; S3 includes S3.2, and DWA's velocity space sampling and dynamic window based on , Based on the physical performance limitations of the underlying motor, a dynamic speed window is generated. : ; ; ; In the formula, , To replace the variable, For the maximum linear deceleration, For maximum angular acceleration, Intersection symbol; Will Discrete points within Construct a candidate instruction set, For the index of discrete points, For the first linear velocity at discrete points For the first Angular velocity at discrete points.
[0023] S4 includes, S4.1, and... Perform residual inference, including constructing the current state vector based on the candidate instruction set and the current velocity of the unmanned surface vessel. ,Will Input the trained lightweight fully connected neural network and output the network's original predictions. By sequentially applying static zero residual constraints, residual amplitude saturation constraints, and motion direction consistency constraints, the dynamic residual values under the current working condition are obtained. , For the predicted linear velocity residual, For the predicted angular velocity residual, The linear velocity residual under the current operating conditions. This represents the angular velocity residual under the current operating conditions. The static zero residual constraint includes setting the static state threshold as... ,when , , and When, set ; Residual amplitude saturation constraints include setting an upper limit for the linear velocity residual amplitude. and the upper limit of the amplitude of the angular velocity residual ,right and Perform hard limiting: ; ; In the formula, For symbolic functions, Minimum value function Absolute value symbol; Consistency constraints on motion direction include, if ,set up .
[0024] S4 includes S4.2, which involves recursive deduction, including setting the prediction time domain. The time step is Let the prediction step index be... , , Within each prediction step, steps S4.2.1, S4.2.2, and S4.2.3 are executed to generate a result containing... Corrected predicted trajectory for each trajectory point; S4.2.1 Calculate the theoretical speed: ; ; In the formula, For the first The nominal linear velocity of a step. For the first The nominal angular velocity of the step. For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.2, will Overlay and : ; ; In the formula, For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.3, Utilization and Updated location of unmanned surface vessel: ; ; ; In the formula, For the first Predicted heading angle of unmanned surface vessels For the first The x-coordinate of the predicted trajectory point of the unmanned surface vessel. For the first The vertical coordinates of the predicted trajectory points of the unmanned surface vessel.
[0025] S5 includes, S5.1, for each corrected predicted trajectory, performing a multi-objective weighted evaluation using an evaluation function, defining the evaluation function. : ; In the formula, For course evaluation, For obstacle avoidance evaluation, For speed evaluation, For the normalization operator, The weighting coefficients for course evaluation. The weighting coefficients for obstacle avoidance evaluation. These are the weighting coefficients for speed evaluation; Traverse the candidate instruction set and select The largest set of instructions is denoted as ,Will The optimal control law for the current control cycle.
[0026] S5 includes, S5.2, and will The kinematics are converted into rotational speed commands for the left and right thrusters of the unmanned surface vessel through inverse kinematics: ; ; In the formula, This is the left thruster speed command. This is the rotational speed command for the right thruster. The distance between the left and right thrusters. This is the speed / rotational speed mapping coefficient.
[0027] S5 includes S5.3, where the unmanned surface vessel's (USV) bottom-level controller receives rotation speed commands, drives the motor, and controls the USV to complete the current cycle's motion before entering... At any given time, repeat steps S3 to S5.
[0028] The local path planning system for unmanned surface vessels (USVs) used in this invention includes a data acquisition and processing module, a residual prediction network module, and a residual compensation DWA planning module. The data acquisition and processing module is responsible for acquiring the actual vessel state sequence containing inertial dynamic characteristics. The residual prediction network module uses a lightweight fully connected neural network (MLP) to fit nonlinear hydrodynamic errors. The residual compensation DWA planning module superimposes the residuals output by the network into the DWA state transition equation in real time to correct the trajectory prediction.
[0029] In open, calm waters, the unmanned surface vessel (USV) was controlled to perform three specific maneuvers: a step acceleration-glide test, which involved applying maximum thrust from a standstill to a predetermined maximum speed and then suddenly dropping to zero, recording the entire process of the hull gliding freely to a standstill to accurately obtain the nonlinear water damping coefficient and longitudinal inertia, providing key data for correcting the deceleration prediction error of the DWA algorithm; a zigzag turn test, which involved applying periodic rudder angle commands at a constant speed with high-frequency switching to strongly excite the ship's roll and bow dynamics, specifically designed to capture the lag characteristics in heading response caused by fluid added mass and turning damping; and a restricted random maneuver test, which involved randomly varying linear and angular velocity commands within a legal state space, enhancing the diversity of the dataset and the model's generalization ability by filling in general motion states.
[0030] The specific control parameters for the Z-shaped turn include three basic linear velocity commands: 0.25 m / s, 0.45 m / s, and 0.65 m / s (constant speed), with corresponding equivalent alternating angular velocity command amplitudes of... rad / s rad / s and rad / s (applied positive and negative angular velocity); the switching interval between adjacent positive and negative steering commands is approximately 14s, and the complete positive and negative cycle is approximately 28.4s.
[0031] The heading response hysteresis is specifically manifested as a longer response delay and rise time. The 10% response delay after an angular velocity step change is approximately 1.7s, and the rise time from 10% to 90% is approximately 3.67s. This hysteresis characteristic is expressed through the angular velocity residual. With linear velocity residual Perform joint characterization.
[0032] The specific constraints on the legal state space of restricted random maneuvers include linear velocity. m / s, angular velocity rad / s, instruction space limited to m / s and The maximum linear acceleration / deceleration (rad / s) and angular acceleration / deceleration constraints must be met within the control period, and a safe clearance between the candidate trajectory and obstacles must be strictly guaranteed. m.
[0033] Static state threshold Set to 0.001. Specifically, this refers to the current linear velocity of the unmanned surface vessel. Current angular velocity Linear velocity command and angular velocity command When the absolute values of both are less than 0.001 (in m / s and rad / s respectively), the hull is determined to be in an absolutely or approximately stationary state. To effectively shield the sensor's measurement noise, the actuator's mechanical dead zone, and the neural network's minute numerical drift near zero input, when the above conditions are met, the system triggers a stationary zero residual constraint, outputting the linear velocity residual... and angular velocity residual Force zeroing.
[0034] For course evaluation, used to assess the course of an unmanned surface vessel under given instructions. The deviation between the predicted trajectory's final heading and the target point's heading. A smaller deviation results in a higher evaluation value. Its mathematical formula is defined as: ; In the formula, This is the azimuth angle of the target point relative to the current coordinate system. The heading angle is the predicted trajectory end of the unmanned surface vessel after a preset prediction time domain.
[0035] For obstacle avoidance evaluation, it is used to assess the performance of unmanned surface vessels under given instructions. The minimum safe clearance between the predicted trajectory and surrounding obstacles. The greater the distance, the higher the evaluation value. In conjunction with the foregoing embodiments of this invention, its mathematical formula is defined as: ; Among them, minimum safe clearance The calculation formula is: ; In the formula, To predict the position coordinates on the trajectory, For the first The location coordinates of the obstacles Let be the equivalent radius of the unmanned surface vessel. The radius of expansion of the obstacle; The upper limit of the cutoff distance is set to ignore safety obstacles that are far enough away.
[0036] This is a speed evaluation method used to encourage unmanned surface vessels to travel at higher speeds while ensuring safety, thereby reducing arrival time. Its mathematical formula is defined as: ; In the formula, This is the current sampled linear velocity command. This represents the maximum linear velocity allowed for unmanned surface vessels within the legal state space.
[0037] In a preferred embodiment of the present invention, the upper limit of the linear velocity residual amplitude is defined in the residual amplitude saturation constraint. Take 0.16 m / s as the upper limit of the angular velocity residual amplitude. The value is set to 0.12 rad / s. As a preferred embodiment of the present invention, the prediction time domain is set... =4.0s, time step =0.1s, then the number of recursive steps .
[0038] The method flow of this invention is as follows: Figure 1 As shown, the sensor output and After velocity space sampling, it is divided into three branches. The first branch generates multiple sets of data. Then, specific maneuver data is collected, dataset construction is performed (residual labels are calculated), and then a lightweight residual network is trained. After training, the model parameters are saved and passed to the second branch. The second branch takes the current state as input to the residual prediction neural network and outputs... Then Input a physical constraint filter; the third branch uses the nominal kinematic model to calculate the velocity residual as network supervision, combines the second and third branches, performs compensation superposition, then performs trajectory extrapolation and position update, finally constructs an evaluation function to score, and outputs the best result.
[0039] The lightweight fully connected neural network structure of this invention is as follows: Figure 2 As shown, the input layer of the model has a dimension of 4 and receives an input vector, where and These respectively represent the current true linear velocity and true angular velocity of the unmanned surface vessel. and These represent the linear velocity command and the angular velocity command, respectively. The hidden layer of the model consists of three fully connected layers with 64, 64, and 32 neurons, respectively, and each hidden layer is configured with the ReLU activation function. The output layer of the model has a dimension of 2, uses a linear output form, and the output vector is... , representing the predicted linear velocity residual and angular velocity residual, respectively. Further, the training strategy of the model includes: performing standardized preprocessing on the input feature data and output residual labels, and dividing the dataset into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively. The training process is based on backpropagation using the Adam optimizer, with the following hyperparameters configured: batch size set to 64, maximum training epochs set to 300; initial learning rate set to 0.001, combined with a piecewise decay mechanism, i.e., multiplying the learning rate by 0.9 every 50 training epochs; the objective function uses mean squared error loss (MSE), with an additional weight coefficient of . The L2 regularization term is used. Preferably, the training process is configured with an early stopping mechanism based on the validation set. Training stops when the validation set loss does not show a decreasing trend for 20 consecutive rounds, and the network weights that achieve the minimum validation set loss are output as the final model. After training, the network weight parameters are saved to the shipboard computing platform (such as JetsonOrin). The trained neural network parameters are deployed to the shipboard computing platform and integrated into the DWA online planning loop.
[0040] The following is a further explanation with reference to the embodiments. Multi-dimensional performance verification was carried out based on data collected from actual ships, including residual network training convergence, open-loop prediction accuracy, cross-condition generalization ability, and closed-loop obstacle avoidance control performance.
[0041] First, a residual dynamics training set is constructed using straight line, steering, system identification, and random maneuver data to train a lightweight MLP residual prediction network. Figure 3 This is a graph showing how the training set loss and validation set loss change with the number of training epochs. Figure 3 It can be seen that both the training loss and the validation loss gradually decrease and tend to stabilize during the training process, indicating that the constructed residual prediction network can converge effectively without obvious training divergence.
[0042] Under emergency braking and free-gliding conditions, traditional nominal first-order response models, lacking characterization of complex nonlinear water damping, longitudinal inertia of the hull, and propulsion lag characteristics, are prone to predicting excessively rapid speed decay, thus underestimating the actual gliding distance of the unmanned vessel. Figure 4 and Figure 5 This is a comparison chart showing the predicted speeds and cumulative taxiing distances of the actual hull, nominal model, and residual compensation model during a measured taxiing segment with the thrusters stopped. Figure 4 and Figure 5 It can be seen that during the stop-and-slide process, the nominal model predicts a speed that is significantly lower than the actual hull speed, resulting in a large deviation in the prediction of the cumulative sliding distance. However, after introducing MLP residual compensation, the predicted speed curve is closer to the actual speed curve, and the prediction result of the cumulative sliding distance is also significantly closer to the actual measurement result.
[0043] Statistical analysis was performed on multiple measured gliding segments. Figure 6 and Figure 7 This is a statistical comparison of the prediction errors of the nominal model and the residual compensation model on multiple measured gliding segments. Figure 6 and Figure 7As can be seen, after adopting the residual compensation method of this invention, the root mean square error (RMSE) of the linear velocity prediction decreased from 0.274 m / s to 0.055 m / s, and the cumulative gliding distance prediction error decreased from 0.944 m to 0.163 m, with an error reduction of over 80%. These results demonstrate that the method of this invention can effectively correct the underestimation of the gliding distance of unmanned surface vessels (USVs) on large inertial water surfaces by traditional nominal models, providing a reliable model basis for dynamic compensation in subsequent DWA trajectory extrapolation.
[0044] To verify the generalization ability of the residual prediction network under different motion conditions, test set samples were input into the trained MLP network, and the velocity residuals output by the network were compared with the actual residuals. Figure 8 and Figure 9 This is a comparison chart of the actual velocity residuals and the MLP predictions for the test set. Figure 8 and Figure 9 It can be seen that the predicted results of linear velocity residual and angular velocity residual can follow the actual residual change trend well, indicating that the trained network can not only fit a single coasting condition, but also effectively model the dynamic deviations in the steering, acceleration and deceleration and compound maneuvering processes.
[0045] Figure 10 and Figure 11 Test set velocity residual prediction error distribution diagram. (From...) Figure 10 and Figure 11 It can be seen that the residual prediction error of the test set is mainly concentrated near zero, exhibiting a standard zero-mean normal distribution (Gaussian distribution), and the error standard deviation is extremely small (e.g., the standard deviation of the linear velocity error is only 0.0040). This indicates that the residual prediction network proposed in this invention still has good prediction stability on test samples that are not directly involved in training, and can extract the common laws in the bottom dynamic response of unmanned surface vessels, rather than just performing memory-based fitting on specific trajectories.
[0046] This paper compares the traditional DWA, nominal model trajectory extrapolation method, and the residual compensation DWA method proposed in this invention. Figure 12 This is a comparison chart of the trajectories from the three methods. Figure 12 It is known that traditional DWA predicts candidate trajectories based solely on nominal models, failing to fully consider the inertial slippage effect of the ship during turning and deceleration. This leads to deviations between the predicted trajectory and the actual executed trajectory, making it highly susceptible to local deadlocks or collisions with obstacles in narrow passages. In contrast, the method of this invention introduces MLP residual compensation terms during the DWA candidate trajectory derivation process, enabling the predicted trajectory to reflect the ship's motion lag and slippage trend in advance, triggering large-angle safety avoidance actions ahead of time, and successfully and smoothly traversing complex obstacle areas, thereby significantly improving the safety margin of local path planning.
[0047] Figure 13 and Figure 14 This is a path comparison diagram between traditional DWA and residual compensation DWA. Figure 13 and Figure 14 It is known that traditional DWA tends to generate overly optimistic trajectory predictions near obstacles, making the actual trajectory closer to the obstacle's safety boundary. The residual compensation DWA of this invention can correct the velocity state in advance during the trajectory extrapolation stage, generating a more conservative and continuous obstacle avoidance trajectory, effectively avoiding dangerous collisions caused by sideslip of underactuated hulls.
[0048] Figure 15 and Figure 16 This is a comparison chart of the speed response of traditional DWA and residual compensated DWA. Figure 15 As shown in the figure, the residual compensation method can more accurately reflect the actual changing trends of the ship's linear velocity and angular velocity, avoiding the nominal model's overly rapid estimation of velocity decay and steering response. Therefore, by introducing residual dynamic compensation, this invention effectively solves the problem of inaccurate path planning for large unmanned surface vessels under underactuated and high inertia conditions, significantly improving the safety of autonomous navigation.
[0049] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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 local path planning method for unmanned surface vessels based on residual dynamics compensation, characterized in that, include: S1. Control the unmanned surface vessel to perform maneuvers and collect state vectors. Calculate the velocity residual between the real-time velocity of the unmanned surface vessel and the velocity predicted by the nominal rigid body kinematics model based on the state vectors. S2. Using the velocity residual as the supervision signal, construct a lightweight fully connected neural network. Use the state vector as the input to train the neural network. Construct a loss function to constrain the neural network training. When the loss function value does not decrease within a preset number of consecutive training cycles, stop training and generate the completed lightweight fully connected neural network. S3. Deploy the trained lightweight fully connected neural network onto the unmanned surface vessel, generate a dynamic velocity window using the dynamic window method, and construct a candidate instruction set based on the discrete points in the dynamic velocity window. S4. Combine the candidate instruction set with the current velocity of the unmanned surface vessel to construct a state vector. Input the state vector into the trained lightweight fully connected neural network. Perform physical consistency constraint filtering on the original output of the lightweight fully connected neural network to obtain the dynamic residual value under the current working condition. Calculate the theoretical velocity of the unmanned surface vessel using the nominal rigid body kinematics model. Calculate the nominal velocity using the dynamic residual value under the current working condition. Update the position of the unmanned surface vessel using the nominal velocity and generate a corrected predicted trajectory. S5. Construct an evaluation function to perform multi-objective weighted evaluation on each corrected predicted trajectory, select the discrete point with the largest evaluation function as the optimal control, and convert the optimal control into the speed command of the unmanned surface vessel propulsion system by using inverse kinematics.
2. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 1, characterized in that, S1 includes S1.1, controlling the unmanned surface vessel to execute three sets of maneuvers, including step acceleration gliding, zigzag turning, and restricted random maneuvers; step acceleration gliding involves applying maximum thrust to the unmanned surface vessel from rest, stopping the application of thrust after reaching a predetermined maximum speed, and recording the nonlinear water damping coefficient and longitudinal inertia of the unmanned surface vessel during the free gliding process to rest; zigzag turning involves periodically alternating positive and negative angular velocity commands at a constant speed to excite the unmanned surface vessel to roll and pitch, and recording the heading response hysteresis characteristics; restricted random maneuvers include randomly changing linear velocity and angular velocity commands within the legal state space.
3. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 2, characterized in that, S1 includes S1.2, data collection based on the maneuvering motions of the unmanned surface vessel. state quantity at time 1 , , For true linear velocity, For true angular velocity, For linear velocity commands, This is an angular velocity command; collection The real speed of unmanned surface vessels at all times Theoretical velocity is calculated using the nominal rigid body kinematic model. and calculate and The difference : ; The nominal state transition equation is: ; ; In the formula, For prediction based on the nominal transfer equation Timeline velocity, For prediction based on the nominal transfer equation angular velocity at time, The time constant of the linear velocity channel. The time constant of the angular velocity channel. To control the cycle.
4. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 3, characterized in that, S2 includes constructing a lightweight fully connected neural network, which is a fully connected feedforward neural network, including an input layer, a hidden layer, and an output layer; The input layer has a dimension of 4 and receives normalized data. The hidden layers consist of three layers, all using the same activation function. The output layer has a dimension of 2, uses linear activation, and outputs linear velocity residuals. and angular velocity residual ; The mean squared error combined with the L2 regularization term is used as the loss function. : ; In the formula, For training batch size, For the first The true residual label of each sample For the first The predicted value for each sample, The regularization coefficient is . These are the network weight parameters. It is the L2 norm. This is the index of the network weight parameters.
5. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 4, characterized in that, S3 includes, S3.1, deploying the trained lightweight fully connected neural network to the surface unmanned vessel computer platform and integrating it into the Dynamic Window Method (DWA) for local path planning; S3 includes S3.2, and DWA's velocity space sampling and dynamic window based on , Based on the physical performance limitations of the underlying motor, a dynamic speed window is generated. : ; ; ; In the formula, , To replace the variable, For the maximum linear deceleration, For maximum angular acceleration, Intersection symbol; Will Discrete points within Construct a candidate instruction set, For the index of discrete points, For the first linear velocity at discrete points For the first Angular velocity at discrete points.
6. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 5, characterized in that, S4 includes, S4.1, and... Perform residual inference, including constructing the current state vector based on the candidate instruction set and the current velocity of the unmanned surface vessel. ,Will Input the trained lightweight fully connected neural network and output the network's original predictions. By sequentially applying static zero residual constraints, residual amplitude saturation constraints, and motion direction consistency constraints, the dynamic residual values under the current working condition are obtained. , For the predicted linear velocity residual, For the predicted angular velocity residual, The linear velocity residual under the current operating conditions. This represents the angular velocity residual under the current operating conditions. The static zero residual constraint includes setting the static state threshold as... ,when , , and When, set ; Residual amplitude saturation constraints include setting an upper limit for the linear velocity residual amplitude. and the upper limit of the amplitude of the angular velocity residual ,right and Perform hard limiting: ; ; In the formula, For symbolic functions, Minimum value function Absolute value symbol; Consistency constraints on motion direction include, if ,set up .
7. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 6, characterized in that, S4 includes S4.2, which involves recursive deduction, including setting the prediction time domain. The time step is Let the prediction step index be... , , Within each prediction step, steps S4.2.1, S4.2.2, and S4.2.3 are executed to generate a result containing... Corrected predicted trajectory for each trajectory point; S4.2.1 Calculate the theoretical speed: ; ; In the formula, For the first The nominal linear velocity of a step. For the first The nominal angular velocity of the step. For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.2, will Overlay and : ; ; In the formula, For the first Predicted linear velocity of the step, For the first Predicted angular velocity of the step; S4.2.3, Utilization and Updated location of unmanned surface vessel: ; ; ; In the formula, For the first Predicted heading angle of unmanned surface vessels For the first The x-coordinate of the predicted trajectory point of the unmanned surface vessel. For the first The vertical coordinates of the predicted trajectory points of the unmanned surface vessel.
8. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 7, characterized in that, S5 includes, S5.1, for each corrected predicted trajectory, performing a multi-objective weighted evaluation using an evaluation function, defining the evaluation function. : ; In the formula, For course evaluation, For obstacle avoidance evaluation, For speed evaluation, For the normalization operator, The weighting coefficients for course evaluation. The weighting coefficients for obstacle avoidance evaluation. These are the weighting coefficients for speed evaluation; Traverse the candidate instruction set and select The largest set of instructions is denoted as ,Will The optimal control law for the current control cycle.
9. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 8, characterized in that, S5 includes, S5.2, and will The kinematics are converted into rotational speed commands for the left and right thrusters of the unmanned surface vessel through inverse kinematics: ; ; In the formula, This is the left thruster speed command. This is the rotational speed command for the right thruster. The distance between the left and right thrusters. This is the speed / rotational speed mapping coefficient.
10. The local path planning method for unmanned surface vessels based on residual dynamics compensation according to claim 9, characterized in that, S5 includes S5.3, where the unmanned surface vessel's (USV) bottom-level controller receives rotation speed commands, drives the motor, and controls the USV to complete the current cycle's motion before entering... At any given time, repeat steps S3 to S5.