Underwater robot control algorithm based on bionic motion
By using a biomimetic motion-based underwater robot control algorithm, which dynamically corrects motion commands using environmental perception, attitude monitoring, and water flow visualization data, the algorithm solves the problems of trajectory deviation and decision-making deficiencies in complex underwater environments, enabling efficient and accurate robot operation in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI HAIDA COMMUNICATION CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional underwater robot control algorithms struggle to accurately perceive environmental changes in real time when faced with complex and ever-changing underwater environments. This leads to deviations in navigation trajectories, collisions, and mission failures. They also fail to respond quickly to obstacles and cannot effectively process massive amounts of environmental perception data to make accurate decisions.
The underwater robot control algorithm based on biomimetic motion derives initial motion commands by acquiring environmental perception data, combines attitude monitoring data and water flow visualization data to generate feature description values and compare them with historical feature databases or calculate similarity indicators, and dynamically corrects motion commands to adapt to complex underwater environments.
It improves the efficiency and accuracy of underwater robots in complex environments, enabling them to avoid obstacles in a timely manner, adapt to unknown environments, broaden their application scope, and ensure the successful completion of tasks.
Smart Images

Figure CN121995934A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater robot control technology, specifically to an underwater robot control algorithm based on biomimetic motion. Background Technology
[0002] The ocean covers approximately 71% of the Earth's surface and contains abundant resources such as oil, natural gas, minerals, and biological resources. It is also a crucial area of scientific research, playing a key role in everything from marine ecosystem studies to the exploration of global climate change. In military terms, the strategic significance of ocean space is increasingly prominent, with underwater monitoring and reconnaissance missions being vital for national defense. Underwater robots, as important tools for human exploration of the ocean, can push the limits of human underwater operations, such as withstanding high pressure and adapting to darkness and complex currents, enabling humans to gain a deeper and more comprehensive understanding of the ocean for resource exploration, scientific research, and military applications. In deep-sea oil and gas exploration, underwater robots can carry various sensors and equipment to conduct detailed surveys of seabed topography and geological structures, determining the distribution of oil and gas resources and providing crucial data for subsequent extraction operations. In marine scientific research, they can be used to collect marine biological samples, monitor marine environmental parameters, and help scientists unravel the mysteries of marine ecosystems.
[0003] Traditional underwater robot control algorithms exhibit significant limitations when facing complex and ever-changing underwater environments. In areas with strong currents, the speed and direction of the water flow are constantly changing. Traditional algorithms struggle to perceive these changes accurately in real time and adjust the robot's movement accordingly, leading to deviations in the robot's trajectory and potentially causing it to be swept away by the current, thus failing to complete its intended task. In rocky areas, robots need to precisely control their position and attitude to avoid collisions. However, traditional algorithms, due to their limited ability to perceive and analyze the surrounding environment, struggle to navigate nimbly through complex reef terrain, making them prone to collisions and damage to the robot's equipment.
[0004] Traditional algorithms lack a flexible mechanism for correcting initial motion commands. When the underwater environment changes dynamically, such as encountering sudden obstacles or abrupt changes in water flow, traditional algorithms cannot adjust the initial motion commands promptly and effectively. This is because traditional algorithms often make decisions based on pre-set rules and models, lacking the ability to respond quickly to real-time changes. In practical applications, when an underwater robot is moving according to the initial commands, if a large obstacle suddenly appears ahead, traditional algorithms may not be able to quickly perform avoidance maneuvers, leading to a collision between the robot and the obstacle.
[0005] Underwater environmental perception data contains a vast amount of information, such as sonar data, visual image data, and water flow velocity and direction data. Traditional control algorithms have limitations in processing this massive amount of data, failing to quickly and accurately extract key information for effective analysis and decision-making. Traditional sonar data processing algorithms may not be able to identify small targets in complex seabed topography in a timely manner, or, due to algorithmic limitations, may be unable to accurately identify marine life or other objects of interest when processing visual image data. This makes it difficult for underwater robots to make accurate judgments and decisions when facing complex environments, affecting their operational efficiency and accuracy. Summary of the Invention
[0006] The purpose of this invention is to provide an underwater robot control algorithm based on biomimetic motion to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, this invention provides a control algorithm for an underwater robot based on biomimetic motion, the algorithm comprising: Acquire environmental perception data of the underwater robot and derive initial motion commands based on the environmental perception data; The system acquires attitude monitoring data of the underwater robot and decides whether to correct the initial motion command based on the attitude monitoring data. When a correction is decided, it collects water flow visualization data around the underwater robot, extracts water flow pattern features from the water flow visualization data, generates feature description values based on the water flow pattern features, compares the feature description values with a historical feature database, and corrects the initial motion command based on the comparison results. When the historical feature database lacks identical feature description values, it calculates a similarity index between the feature description values and historical features, and corrects the initial motion command based on the similarity index.
[0008] Preferably, the step of deriving the initial motion command based on the environmental perception data includes: the environmental perception data includes water flow velocity information, water flow direction information, and water depth information; the initial motion command is obtained by: comparing the water flow velocity information with a standard velocity reference value to obtain a velocity adjustment factor, comparing the water flow direction information with a reference direction value to obtain a direction correction amount, and comparing the water depth information with a target depth reference value to obtain a depth offset amount; integrating the velocity adjustment factor, direction correction amount, and depth offset amount into a comprehensive parameter, and converting the comprehensive parameter into the initial motion command through a predefined mapping relationship.
[0009] Preferably, the step of deciding whether to correct the initial motion command based on the attitude monitoring data includes: extracting pitch angle data, roll angle data, and yaw angle data from the attitude monitoring data; calculating the difference between the pitch angle data and a stable pitch threshold to obtain pitch deviation; calculating the difference between the roll angle data and a stable roll threshold to obtain roll deviation; calculating the difference between the yaw angle data and a stable yaw threshold to obtain yaw deviation; comparing the pitch deviation, roll deviation, and yaw deviation with an allowable deviation range; and if any deviation exceeds the allowable deviation range, deciding to correct the initial motion command.
[0010] Preferably, the extraction of flow pattern features from the water flow visualization data includes: the water flow visualization data includes water flow velocity field image data and water flow vortex image data; the water flow velocity field image data is analyzed using an image processing algorithm to obtain velocity distribution features, the velocity distribution features including velocity gradient values and flow uniformity; the water flow vortex image data is parsed using a pattern recognition algorithm to obtain vortex features, the vortex features including vortex size and vortex intensity; the flow pattern features are composed of the velocity distribution features and the vortex features.
[0011] Preferably, generating feature description values based on the flow pattern characteristics includes: quantifying the flow pattern characteristics of each monitoring area, wherein the feature description values are obtained through the following calculations: dividing the velocity gradient value by the area to obtain the standardized velocity gradient; subtracting the flow uniformity from the ideal uniformity reference value to obtain the uniformity deviation; dividing the vortex size by the reference vortex size to obtain the size ratio; comparing the vortex intensity with an intensity threshold to obtain the intensity factor; and weighting and fusing the standardized velocity gradient, uniformity deviation, size ratio, and intensity factor to obtain the feature description value.
[0012] Preferably, comparing the feature description value with the historical feature database includes: traversing all historical feature description values in the historical feature database to find historical records that are consistent with the current feature description value; if a consistent historical record exists, then retrieving the historical motion command corresponding to the historical record and using the historical motion command as a correction reference; if no consistent historical record exists, then triggering the similarity index calculation process.
[0013] Preferably, when consistent historical records exist, the step of correcting the initial motion command based on the comparison results includes: extracting historical motion commands corresponding to all consistent historical records, calculating the average value of these historical motion commands as the average motion command; mixing the average motion command with the initial motion command, the mixing ratio being determined based on the number of historical records, and using the mixed command as the corrected motion command.
[0014] Preferably, the calculation of the similarity index between the feature description value and historical features includes: for each feature description value, calculating its Euclidean distance with each historical feature description value in the historical feature database, and taking the reciprocal of the minimum Euclidean distance as the similarity score; normalizing the similarity scores of all feature description values to obtain the similarity index.
[0015] Preferably, the step of correcting the initial motion command based on the similarity index includes: dividing the adjustment level according to the magnitude of the similarity index, the adjustment level including high adjustment level, medium adjustment level and low adjustment level; presetting an adjustment coefficient for each adjustment level, and multiplying the adjustment coefficient by the initial motion command to obtain the corrected motion command.
[0016] Preferably, the algorithm further includes a historical feature library update process: after the motion command correction is completed, the current feature description value and its corresponding corrected motion command are stored in the historical feature library.
[0017] Compared with the prior art, the beneficial effects of the present invention are: This algorithm acquires environmental perception data from underwater robots and derives initial motion commands based on this data. Underwater robots are equipped with advanced sonar sensors, vision sensors, and current sensors, which collect real-time information about the surrounding environment, such as obstacle locations, water flow speed and direction, and underwater topography. The algorithm quickly and accurately analyzes this rich perception data, generating corresponding initial motion commands based on different environmental conditions. When the sonar sensor detects an obstacle ahead, the algorithm rapidly calculates a safe avoidance path and generates corresponding motion commands, allowing the robot to change course in time to avoid the obstacle. This enables the robot to quickly adapt to complex and changing underwater environments, making accurate action decisions based on environmental information, whether in turbulent waters or reef-strewn areas, ensuring the successful completion of missions.
[0018] The algorithm uses attitude monitoring data to determine whether to correct initial motion commands, enabling the robot to dynamically adjust based on its real-time status. Equipped with high-precision inertial measurement units (IMUs) and other attitude monitoring devices, the robot provides real-time feedback on its attitude information, including roll, pitch, and yaw angles. Once attitude monitoring data shows that the robot's attitude deviates from the predetermined state, the algorithm initiates a command correction process. During correction, it collects visual data of the water flow around the robot, extracts water flow pattern features from this data, generates feature description values, and compares them with a historical feature database to correct the commands. When the underwater robot is performing seabed topographic mapping tasks, if attitude monitoring data indicates that the robot has tilted to a certain extent, the algorithm determines that command correction is necessary. By collecting visual water flow data, a special vortex-like feature is discovered in the water flow pattern. After generating corresponding feature description values and comparing them with a historical feature database, the algorithm determines that the robot's attitude change is caused by a localized strong water flow. Based on the comparison results, the algorithm corrects the initial motion commands, adjusting the robot's propulsion and rudder angle to restore the robot to the correct attitude and predetermined trajectory, making the robot's movement more closely match the dynamic changes of the actual underwater environment.
[0019] When the historical feature database lacks a record matching the currently generated feature description value, the algorithm calculates a similarity index between the feature description value and historical features, and adjusts the initial motion commands accordingly. This mechanism significantly enhances the robot's ability to cope with complex and unknown underwater environments. In some extreme underwater environments, such as deep-sea hydrothermal vents, environmental factors such as water flow characteristics, temperature, and chemical concentrations differ greatly from those in conventional sea areas, potentially leading to unprecedented water flow patterns. When the robot enters this area to perform exploration tasks, the generated water flow pattern feature description value cannot find a match in the historical feature database. In this case, the algorithm calculates a similarity index to find the most similar feature record in the historical database. Although not entirely identical, the algorithm can learn from the corresponding strategies of similar features to reasonably adjust the initial motion commands. The robot may adjust its propulsion power and direction of motion appropriately based on the similarity analysis results to adapt to the special water flow and environmental conditions of hydrothermal vents, avoiding mission failure or robot damage due to the inability to recognize new environmental features. This allows the robot to maintain a certain degree of adaptability and responsiveness when facing various unknown underwater situations, broadening its application scope and operational capabilities. Attached Figure Description
[0020] Figure 1 This is a schematic diagram illustrating the working principle of the underwater robot control algorithm based on biomimetic motion described in this invention. Figure 2 A flowchart for deriving initial motion commands based on environmental perception data; Figure 3This is a flowchart for deciding whether to modify the initial motion command based on attitude monitoring data. Detailed Implementation
[0021] 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.
[0022] Please see Figure 1 This invention provides a biomimetic motion-based underwater robot control algorithm, which includes a series of processing steps to achieve intelligent motion control. After the algorithm starts, it acquires environmental perception data of the underwater robot, which comes from various sensors installed on the robot body, including sonar, depth gauges, and current meters. The environmental perception data is used to derive initial motion commands, and the derivation process involves data parsing and parameter calculation. Simultaneously, the algorithm acquires attitude monitoring data of the underwater robot, provided by an inertial measurement unit, including angular velocity and acceleration information. Based on the attitude monitoring data, the algorithm executes decision logic to determine whether the initial motion commands need to be corrected. When the decision logic outputs a correction signal, the system activates the visual acquisition module to acquire visual data of the water flow around the underwater robot. The visual data of the water flow is acquired through a high-speed camera and includes a sequence of dynamic water flow images. Water flow pattern features are extracted from the visual data of the water flow, and these features characterize the key attributes of the current water flow environment. Feature description values are generated based on the water flow pattern features; these feature description values are digital representations used to quantify the water flow patterns. The algorithm compares the feature description values with a historical feature database stored in the robot's non-volatile memory. This database contains historical feature description values and corresponding motion commands. The initial motion commands are corrected based on the comparison results, and the correction process adjusts motion parameters to optimize robot motion stability. When the historical feature database lacks identical feature description values, the algorithm calculates a similarity index between the current feature description value and historical features. This similarity index reflects the degree of proximity between the current feature and historical features. The initial motion commands are then corrected based on the similarity index, which is used to weight and adjust the motion command components.
[0023] Example 1: See Figure 2The environmental perception data includes water flow velocity, direction, and depth information, which are collected in real time by a sensor array mounted on the underwater robot. Water flow velocity is measured by a Doppler current profiler. The Doppler current profiler emits sound pulses into the water and receives the echoes. By analyzing the frequency shift, the water flow velocity relative to the robot is calculated. Specifically, the Doppler current profiler emits sound pulses at a frequency of 1.2 MHz into the water. After receiving the echoes reflected by suspended particles in the water flow, analysis shows that the echo frequency shifts by 25 Hz compared to the emitted frequency. Based on the Doppler effect and the parameter of a sound velocity of 1500 m / s in water, the calculated water flow velocity relative to the robot is 0.0156 m / s.
[0024] Water flow direction information is acquired collaboratively by an electromagnetic current meter and a digital compass. The electromagnetic current meter senses the direction of the electromotive force generated by the water flow cutting magnetic lines of force, while the digital compass provides an absolute geographical reference orientation. The data from both are fused to calculate the deflection angle of the water flow relative to true north. Water depth information is measured by a high-precision pressure sensor. The sensor diaphragm senses the deformation caused by water pressure, and the current depth value is calculated by detecting the change in voltage output from the resistance strain gauge bridge and combining it with the water density parameter.
[0025] The generation of initial motion commands relies on a series of comparison and conversion operations. Water flow velocity information is compared with a standard velocity reference value, stored in the read-only memory of the underwater robot's control system, representing the ideal cruising speed for a specific mission mode. This comparison is performed by the microprocessor's arithmetic logic unit, calculating the algebraic difference between the measured water flow velocity and the standard velocity reference value, which is then input to the proportional-integral controller to generate a speed adjustment factor. The speed adjustment factor is a dimensionless scaling factor, ranging from 0.5 to 2.0, used to linearly adjust the thrust output of the thrusters. Water flow direction information is compared with a reference direction value, derived from the navigation path angle predetermined by the mission planning system. The comparison process calculates the vector angle between the water flow direction and the reference direction, which is then processed using trigonometric functions to obtain a direction correction. The direction correction is expressed in radians, with positive values indicating clockwise deflection and negative values indicating counterclockwise deflection. Water depth information is compared with a target depth reference value, set by the operator via a surface control console. The comparison results generate a depth deviation signal. After high-frequency noise is eliminated by a digital filter, the depth deviation signal is converted into a depth offset by a fuzzy logic controller. The depth offset is a signed displacement quantity in meters; a positive value indicates a dive command, and a negative value indicates an ascent command. The velocity adjustment factor, orientation correction, and depth offset need to be integrated into a comprehensive parameter. This integration process is completed in a digital signal processor, which encapsulates the three parameters into a multi-dimensional vector. The three parameters are the velocity adjustment factor, orientation correction, and depth offset calculated based on environmental perception data. Each dimension of the vector is normalized, ranging from -1 to +1. The normalized vector is then unified to the robot's body coordinate system through coordinate transformation. The origin of the coordinate system is located at the robot's center of mass, the X-axis points in the direction of travel, the Y-axis points to starboard, and the Z-axis points vertically downwards. The comprehensive parameter represents the original motion requirements driven by the current environmental perception data.
[0026] The synthesized parameters are converted into initial motion commands through a predefined mapping relationship. This mapping relationship is stored in non-volatile flash memory as a multidimensional lookup table, where the index key is the discretized value of the synthesized parameter. The mapping relationship is based on the underwater robot's hydrodynamic model, calibrated using computational fluid dynamics simulations and pool test data. The conversion process employs a bilinear interpolation algorithm. When the synthesized parameter falls between grid points in the lookup table, the algorithm calculates a smooth transition output based on the weight values of adjacent grid points. For example, if the index key of the discretized synthesized parameter is (0.7, -0.3, 0.2), it corresponds to the discretized results of the velocity adjustment factor, direction correction, and depth offset. Querying the multidimensional lookup table in the non-volatile flash memory, the four adjacent grid points near this index key correspond to propulsion motor speed commands of 1800 rpm, 1850 rpm, 1780 rpm, and 1830 rpm, rudder deflection angles of -5°, -3°, -6°, and -4°, and horizontal rudder deflection angles of 2°, 3°, 1°, and 2°. The weight values of adjacent grid points are calculated by bilinear interpolation algorithm, and the initial motion commands for a smooth transition are finally obtained: propulsion motor speed command 1815 rpm, rudder deflection angle -4.2°, and horizontal rudder deflection angle 2.1°.
[0027] The initial motion command specifically includes three control quantities: propulsion motor speed command, rudder deflection angle, and horizontal rudder deflection angle. The propulsion motor speed command is a pulse width modulation signal, with a duty cycle proportional to the target thrust. The rudder deflection angle, measured in degrees, controls the robot's horizontal steering. The horizontal rudder deflection angle, also measured in degrees, controls the robot's pitch attitude and depth changes. The generation process of the initial motion command has real-time requirements; the entire processing flow must be completed within the control cycle. The control cycle is triggered by a system timer interrupt, with a timer interrupt interval of one hundred milliseconds. At the beginning of each control cycle, sensor data is read in batches into the data buffer of the central processing unit via the serial peripheral interface bus. The data preprocessing module verifies and filters the raw sensor data, removing outliers and wild values. The verification algorithm uses a cyclic redundancy check (CRC) code to verify data integrity, and the filtering algorithm uses a fourth-order Butterworth low-pass digital filter to suppress measurement noise. The preprocessed environmental perception data is sent to the command generation pipeline, which uses a hardware accelerator to process the comparison and conversion operations of the three types of data in parallel. Hardware accelerators are dedicated computing units implemented using field-programmable gate arrays (FPGAs) that can perform multiple floating-point multiply-accumulate operations simultaneously.
[0028] The processing of water flow velocity information needs to consider the fluid viscosity effect. When the water flow velocity is low, the boundary layer effect is significant, and the velocity measurement value needs to be compensated for Reynolds number. The compensation algorithm queries a pre-stored viscosity correction coefficient table, which is indexed according to the roughness of the robot's shell and water temperature parameters. The calculation of the velocity adjustment factor introduces a nonlinear gain, which adaptively reduces the gain value under high-speed water flow conditions to prevent thruster overload. The processing of water flow direction information includes geomagnetic deflection compensation, as the geomagnetic azimuth angle measured by the digital compass deviates from true north. The compensation module calls the geomagnetic deflection model, which queries the world geomagnetic model database based on the robot's current latitude and longitude coordinates. First, the real-time latitude and longitude coordinates of the underwater robot are obtained. These coordinates are recorded by the GPS receiver on the robot and transmitted to the compensation module in real time through a serial peripheral interface. The geomagnetic deflection model called by the compensation module is a dedicated calculation model pre-stored in the robot control system. Its core function is to calculate the geomagnetic deflection angle (i.e., the angle between the geomagnetic north pole and true north) based on the latitude and longitude coordinates to eliminate the geomagnetic deviation when the digital compass measures the water flow direction. During model operation, the system first receives real-time latitude and longitude coordinates transmitted from GPS (e.g., 120.5°E, 30.2°N). Then, it accesses the World Geomagnetic Model Database via a built-in data interaction interface. This database is an industry-standard geomagnetic data set containing geomagnetic parameters (such as geomagnetic intensity and declination) for different latitude and longitude regions globally. The database data is periodically updated to the robot's non-volatile memory via a ground station. The model matches the corresponding region's geomagnetic declination data in the database based on the real-time latitude and longitude coordinates. This data is then fed back as a compensation value to the water flow direction calculation stage and fused with the raw water flow direction data measured by the electromagnetic current meter. Finally, accurate water flow direction information based on true north is obtained, providing precise data support for subsequent direction correction calculations.
[0029] The calculation of directional correction includes inertial compensation to offset changes in apparent water flow direction caused by the robot's own motion. Water depth information processing includes temperature and salinity compensation. Pressure sensor measurements are affected by changes in water density, which is a function of temperature and salinity. Temperature and conductivity sensors provide real-time compensation parameters, and the compensation algorithm uses international temperature scale formulas and practical salinity scale formulas to calculate the true water depth. Depth offset generation includes center-of-gravity height compensation to offset the impact of changes in the relative position of the robot's center of gravity and center of buoyancy on stability. The compensation amount is dynamically calculated based on the distribution of the robot's payload.
[0030] The vector encapsulation of synthesized parameters adopts homogeneous coordinate representation, facilitating rigid body transformations in three-dimensional space. Vector normalization uses the max-min normalization method, ensuring the normalized vector magnitude remains unit-1. The lookup table for mapping relationships employs a hierarchical storage structure, with the most frequently used mapping relationships cached in static random access memory (SRAM) to improve access speed. The interpolation algorithm includes boundary handling logic; when synthesized parameters exceed the lookup table range, the algorithm automatically switches to extrapolation mode, using the gradient of the nearest neighbor for linear extrapolation. The output interface of the initial motion command conforms to industry standard protocols. The propulsion motor speed command is sent to the motor driver via the controller area network bus, while the rudder and horizontal rudder deflection angles are output to the servo controller via a pulse width modulation interface. The entire command generation process features redundant design; each major calculation module has a backup unit, automatically switching to the backup unit when a main unit failure is detected. The system continuously monitors the quality indicators of command generation, including data freshness, numerical rationality, and continuity of change. Any abnormality in any indicator triggers a safety recovery process. The safety recovery process transfers control to the basic PID controller while recording fault data for subsequent analysis. The generation of initial motion commands is the foundation for the autonomous decision-making of underwater robots, and its accuracy and real-time performance directly affect the effect of subsequent command corrections.
[0031] Example 2: See Figure 3 Attitude monitoring data originates from a miniature inertial measurement unit integrated within the underwater robot's body. This unit comprises three MEMS gyroscopes and three MEMS accelerometers, capturing raw angular velocity and linear acceleration data along three orthogonal coordinate axes in real time at a sampling frequency of 1000 times per second. This raw data is transmitted to the main processor's data buffer via a high-speed serial peripheral interface. A dedicated sensor fusion coprocessor performs preprocessing, employing an adaptive Kalman filter algorithm to eliminate sensor random noise and temperature drift. Attitude calculations are then performed using quaternion differential equations, ultimately outputting pitch, roll, and yaw angle data expressed in Euler angles. The data update frequency is 200 Hz. The pitch angle data describes the underwater robot's rotation angle around its lateral axis, ranging from -180 degrees to +180 degrees. The roll angle data describes the underwater robot's tilt angle around its longitudinal axis, also ranging from -180 degrees to +180 degrees. Yaw angle data describes the underwater robot's azimuth angle around its vertical axis, ranging from 0 to 360 degrees. This attitude angle data is sent to the decision-making module, which accesses preset stable pitch, stable roll, and stable yaw thresholds stored in memory. The stable pitch threshold is the maximum allowable pitch angle determined based on the robot's hydrodynamic stability analysis, typically 15 degrees. The stable roll threshold is the maximum roll angle set based on anti-rollback requirements, typically 10 degrees. The stable yaw threshold is the maximum yaw deviation angle set to maintain heading stability, typically 20 degrees.
[0032] The calculation process is implemented by a digital comparator circuit. Pitch deviation is obtained by algebraic subtraction of pitch angle data with a stable pitch threshold; roll deviation is obtained by algebraic subtraction of roll angle data with a stable roll threshold; and yaw deviation is obtained by algebraic subtraction of yaw angle data with a stable yaw threshold. Assuming the pitch angle data extracted from attitude monitoring data is 12°, the roll angle data is 8°, and the yaw angle data is 18°, and the preset stable pitch thresholds are 15°, stable roll thresholds are 10°, and stable yaw thresholds are 20°, the algebraic subtraction calculations using the digital comparator circuit yield a pitch deviation of 12° - 15° = -3°, a roll deviation of 8° - 10° = -2°, and a yaw deviation of 18° - 20° = -2°.
[0033] Each deviation value is taken as its absolute value for subsequent processing. The decision logic unit compares the calculated pitch, roll, and yaw deviations with the allowable deviation range stored in the configuration register in real time. The allowable deviation range includes an upper and lower limit, forming a symmetrical interval. The comparison operation uses a parallel digital comparator. When the pitch deviation value is greater than the upper limit of the allowable deviation range, the comparator outputs a high-level signal. When the roll deviation value exceeds the limit of the allowable deviation range, the corresponding comparator triggers a status flag. When the yaw deviation value is outside the allowable deviation range, the logic circuit generates an interrupt request. The output signals of these three judgment conditions are sent to an OR logic gate circuit. As soon as any deviation exceeds the allowable deviation range, the OR gate immediately outputs a high-level correction trigger signal. The correction trigger signal is transmitted to the system main controller to start the motion command correction process. The acquisition of water flow visualization data starts immediately when the correction trigger signal is valid. The high-speed industrial camera mounted on the underwater robot's head begins to acquire water flow velocity field image data at a rate of 500 frames per second, while the auxiliary cameras on both sides of the robot synchronously acquire water flow vortex image data. Water flow velocity field image data was acquired using particle image velocimetry (PEV) technology. A camera captured the motion trajectories of tracer particles in the water, with each frame achieving a resolution of 2048×2048 pixels and a color depth of 16-bit grayscale. Water flow vortex image data was acquired using laser-induced fluorescence (LAF). Fluorescent dye injected into the water displayed vortex structures under laser illumination, achieving a dynamic range of 12 bits. All image data was transmitted to the image processing unit via a gigabit Ethernet interface, with real-time streaming protocols used to ensure data integrity during transmission.
[0034] Image processing algorithms analyze water flow velocity field image data. The analysis process begins with image enhancement preprocessing, employing an adaptive histogram equalization algorithm to enhance contrast, and using anisotropic diffusion filtering to eliminate image noise. Velocity distribution features are extracted using optical flow calculations, solving for the velocity vector of each pixel based on the Horn-Schunck optical flow equation. Velocity gradient values are obtained by calculating the difference between the velocity vectors of adjacent pixels, using the central difference method to calculate the gradient components in the X and Y directions. Flow uniformity is quantified by statistically analyzing the standard deviation of the velocity vectors across the entire region of interest, using a weighted statistical algorithm where the weight of the central region is higher than that of the edges. Pattern recognition algorithms parse water flow vortex image data, starting with image segmentation, using a region growing-based segmentation algorithm to identify vortex regions. Vortex features are extracted based on the segmented binary image; vortex size is obtained by calculating the pixel area of connected regions, and morphological opening operations are applied to eliminate noise. Vortex intensity is determined by analyzing the grayscale gradient of the vortex core region, calculating the weighted sum of the maximum and average gradient magnitudes. The flow pattern features are composed of velocity distribution features and vortex features. The feature vector includes five dimensions: the X component of the velocity gradient value, the Y component of the velocity gradient value, the flow uniformity index, the vortex size parameter, and the vortex intensity parameter.
[0035] The entire processing flow features a strict time synchronization mechanism. Attitude monitoring data acquisition and water flow visualization data acquisition are synchronized via hardware trigger signals, achieving microsecond-level timestamp accuracy. The decision-making module employs a pipelined architecture, allowing continuous real-time processing of attitude data streams. The image processing unit is equipped with a dedicated graphics processor, processing multiple video streams in parallel. The feature extraction algorithm is optimized, using fixed-point arithmetic to reduce computational latency. The generation cycle of water flow pattern features is controlled within 10 milliseconds, meeting the real-time control requirements of the underwater robot's high-speed movement. The data path adopts a redundant design, with backup channels for critical paths, automatically switching to backup paths when data errors are detected. All computation modules have self-checking functions, periodically executing built-in test programs to verify computational correctness. The system monitoring module tracks data processing load in real-time, dynamically adjusting computational resource allocation to ensure processing stability under high data flow. The collaborative work of attitude monitoring data decision-making and water flow pattern feature extraction forms the foundation for the underwater robot's intelligent adaptation to the water flow environment; the accuracy of feature extraction and the real-time nature of decision-making directly affect the quality of motion control.
[0036] Example 3: The water flow pattern feature data is stored in a temporary buffer in the form of a multidimensional vector. The process of generating feature description values begins with the quantization of the water flow pattern features of each monitoring area. The monitoring area is composed of grid cells divided by the image processing unit. Each grid cell corresponds to a physical space region with a size of 10 cm by 10 cm. The quantization process is performed by a digital signal processor. The processor reads the water flow pattern feature vector, which contains four components: velocity gradient value, flow uniformity, vortex size, and vortex intensity. The velocity gradient value is a two-dimensional vector that represents the rate of change of water flow velocity in the X and Y directions, with the unit being meters per second per meter. Flow uniformity is a scalar value ranging from 0 to 1. The higher the value, the more uniform the flow. The vortex size is represented by pixel area and is derived from the connected regions after image segmentation. The vortex intensity is a dimensionless coefficient calculated based on the grayscale gradient.
[0037] The feature description values are calculated using a weighted fusion method, and the fusion formula is as follows: Where: symbol The representative feature description value is a comprehensive scalar value; symbol The weights represent the standardized velocity gradient and range from 0 to 1; [symbol missing] Represents the standardized velocity gradient, obtained by dividing the velocity gradient value by the area of the region; symbol Weighting coefficients representing uniformity deviation; symbol Represents the uniformity deviation, obtained by subtracting the ideal uniformity reference value from the flow uniformity; symbol Weighting coefficients representing size proportions; symbol The dimensional proportion is obtained by dividing the volute dimension by the reference volute dimension; symbol The weighting coefficient representing the intensity factor; symbol The intensity factor is represented by a comparison between the vortex intensity and an intensity threshold. Weighting coefficient. , , , The system configuration parameters are set and pre-calibrated based on the motion characteristics of the underwater robot. The sum is 1 to ensure that the weighted fused feature description values have a consistent scale.
[0038] Standardized velocity gradient The calculation involves the normalization of velocity gradient values, which are extracted from velocity distribution characteristics and include X and Y components. When calculating the normalized velocity gradient, the square root of the sum of the squares of the two components is first taken to obtain the gradient magnitude. The gradient magnitude is then divided by the area of the region. The area is obtained by multiplying the number of pixels in the grid cell by the physical area corresponding to each pixel. The physical area is determined based on the camera calibration parameters. Normalizing the velocity gradient eliminates the influence of spatial scale, making monitoring areas of different sizes comparable. Uniformity deviation. The calculation uses arithmetic subtraction, subtracting the flow uniformity from the ideal uniformity reference value. The ideal uniformity reference value is set to 1, representing perfectly uniform flow. The uniformity deviation reflects the degree of deviation between the actual flow and the ideal state; a positive value indicates non-uniformity, and a negative value indicates excessive uniformity. (Size scale) The calculation requires a reference vortex size, which is derived from the average value of historical data. The unit is the same as the vortex size, and the scaling is done using division. The result is dimensionless and represents the current vortex size relative to the reference. Intensity factor The calculation is performed by comparing the vortex intensity with an intensity threshold, which is a fixed value set based on the fluid dynamics model. The comparison operation generates a coefficient. If the vortex intensity is greater than the threshold, the intensity factor is 1; otherwise, it is 0. However, for smoothing, linear interpolation is actually used to make the intensity factor change continuously between 0 and 1.
[0039] The weighted fusion process is performed in the floating-point unit. The calculation result of each component is cached in a register. Multiplication operations use hardware multipliers, and addition operations use accumulators. Feature description values... After calculation, the result is rounded to four decimal places and stored as a 32-bit floating-point number. Feature description value generation is performed in real-time, with each monitoring area calculated independently. Ultimately, the feature description values from all areas are combined into a feature description value array, the length of which equals the number of monitoring areas. This array represents a digital summary of the current water flow environment. The process of comparing the feature description values with a historical feature database begins after the feature description value array is generated. The historical feature database is a table stored in non-volatile memory, containing historical feature description value fields and historical motion command fields. Historical feature description values are stored as arrays in the same format. The comparison operation is performed by the database query module, which iterates through all historical records in the database. For each historical record, the historical feature description value array is compared with the current feature description value array to find a perfect match. The consistency judgment is based on an exact matching algorithm. The algorithm calculates the difference between each corresponding element in the two arrays. If the absolute value of all differences is less than a tolerance threshold (set to 0.001), it is considered a perfect match. The traversal process is accelerated using an index, which is built based on the hash value of the feature description value. The hash value is calculated using the MD5 algorithm to improve search efficiency.
[0040] If a consistent historical record exists, the query module retrieves the corresponding historical motion commands. These historical motion commands are sequences of previously corrected motion commands, stored as control parameter vectors. Multiple consistent historical records may exist; the query module collects the historical motion commands from all matching records, forming a command set. If no consistent historical record exists, the comparison process triggers a similarity index calculation process, handled by a dedicated similarity engine. Updates to the historical feature database are asynchronous. After motion command correction, the current feature description value and the corrected motion command are inserted as new records into the database. Transaction processing is used to ensure data consistency during insertion. The generation and comparison of feature description values are integrated into the underwater robot's control loop. The control loop cycle is 50 milliseconds. Within each cycle, new water flow pattern features are processed, the feature description value array is updated, and historical feature database queries are executed in parallel. The system is designed with a fault-tolerant mechanism. If access to the historical feature database times out, the comparison process continues using default parameters to avoid blocking the control loop. The accuracy of feature description value calculation is affected by the quality of sensor data. The system has built-in data verification logic to check the numerical range of the feature description value array. If an outlier is found, such as one that exceeds the reasonable range, the current data is discarded and replaced with the value from the previous period. The size of the historical feature database is limited by storage capacity. The system periodically cleans up old records. The cleanup strategy is based on timestamps, retaining the most recent 1000 records to ensure query performance.
[0041] The quantization process for generating feature description values includes a data standardization step. Each feature component is normalized before weighted fusion. The normalization method uses min-max scaling to map the component values to the 0-1 range, eliminating the influence of dimensions. Weighting coefficients , , , The configurability allows adaptation to different underwater environments. Coefficient values are remotely adjusted via ground station software, based on the robot's motion performance logs. The storage format of the feature description value array is optimized to a compact binary form, reducing memory footprint. Historical feature database lookup supports fuzzy matching, using approximate algorithms such as nearest neighbor search, but the main process relies on precise matching to ensure control determinism. The feature description value generation algorithm has been verified through simulation, using computational fluid dynamics data to simulate water flow patterns and verify the effectiveness of the weighted fusion formula. The historical feature database management includes backup functionality, periodically copying the database to secure storage to prevent data loss. The entire implementation emphasizes real-time performance and reliability; the computation latency of feature description values is controlled within 1 millisecond, and the average response time for historical feature database queries is less than 2 milliseconds, meeting the real-time decision-making requirements of underwater robots operating at high speeds.
[0042] Example 4: The condition for the existence of consistent historical records is established after the historical feature database query module completes the precise matching of the feature description value array. The number of matching records is recorded in the counter register. The operation of extracting historical motion commands corresponding to all consistent historical records is executed by the data retrieval subroutine. Historical motion commands are stored in the form of vectors in the binary large object field of the database. Each vector contains three components: thrust command, azimuth command, and pitch command. The retrieval process uses a database cursor to read matching records one by one and loads the historical motion commands into the memory work area. The calculation of the average value of historical motion commands as the average motion command is performed in the arithmetic logic unit. The average value calculation adopts the component-wise arithmetic mean method. Assume there are three consistent historical records in the historical feature database, with corresponding historical motion commands as follows: Command 1 (propeller motor speed 1750 rpm, rudder deflection angle -3°, horizontal rudder deflection angle 1.5°), Command 2 (propeller motor speed 1800 rpm, rudder deflection angle -5°, horizontal rudder deflection angle 2.5°), and Command 3 (propeller motor speed 1780 rpm, rudder deflection angle -4°, horizontal rudder deflection angle 2°). The arithmetic logic unit uses a component-wise arithmetic average method to calculate the average propeller motor speed as (1750 + 1800 + 1780) ÷ 3 = 1777 rpm, the average rudder deflection angle as (-3 - 5 - 4) ÷ 3 = -4°, and the average horizontal rudder deflection angle as (1.5 + 2.5 + 2) ÷ 3 = 2°, ultimately yielding the average motion command (1777 rpm, -4°, 2°).
[0043] For the thrust command component, the thrust command values from all matched historical motion commands are summed and divided by the number of matched records to obtain the average thrust command. The average value of the azimuth command component is calculated using the unit circle vector averaging method. Each azimuth command is converted into a unit vector, and the azimuth angle of the vector sum is used as the average azimuth command. The average value of the pitch command component is calculated directly using the arithmetic mean because the pitch angle range is between -90 degrees and 90 degrees, eliminating the circular jump problem. The average motion command is a new motion command vector, and its component values represent typical control parameters from historical experience.
[0044] The process of mixing the average motion command with the initial motion command employs a weighted averaging algorithm, with the mixing ratio determined based on the number of historical records. The mixing ratio is calculated using a lookup table, which is stored in the system's read-only memory. The design of the mixing ratio lookup table is based on the logarithm of the number of historical records; the more historical records, the higher the weight of the average motion command. The mixing operation is performed independently on each component of the motion command vector, and the calculation formula is as follows: The weighting coefficients range from 0 to 1, determined according to a mixing ratio lookup table. The mixed command serves as the corrected motion command, sent to the actuator to control the underwater robot's movement. The process for calculating the similarity index between feature description values and historical features is activated when no consistent historical records exist in the historical feature database. The similarity index is calculated based on the distance metric between the feature description value array and all historical feature description value arrays in the historical feature database. For each current feature description value array, its Euclidean distance to each historical feature description value array in the historical feature database is calculated. The Euclidean distance is calculated as the square root of the sum of the squares of the differences between corresponding elements in the two arrays. Distance calculations are processed in parallel using a floating-point arithmetic unit to improve computational efficiency. The reciprocal of the minimum Euclidean distance is used as the similarity score; the minimum Euclidean distance represents the historical feature most similar to the current feature.
[0045] The similarity scores are normalized using a min-max scaling method, which linearly transforms the scores to the interval between 0 and 1. The normalization formula is: The minimum and maximum possible scores are set based on historical statistics and are updated periodically to adapt to changes in data distribution. The similarity index is a scalar value; a higher value indicates a higher degree of similarity between the current feature and historical features. The calculation process for the similarity index between feature description values and historical features includes an outlier handling mechanism. If the calculated Euclidean distance is abnormally large, the system automatically activates a backup cosine similarity algorithm. Cosine similarity calculates the cosine of the angle between two feature vectors and is insensitive to amplitude variations. The calculation results of the similarity index are cached in a high-speed cache for subsequent instruction correction. The index structure of the historical feature library optimizes similarity search performance, using a kd-tree spatial partitioning method to accelerate nearest neighbor queries. See Table 1 for the correspondence between the mixing ratio and the number of historical records.
[0046] Table 1: Comparison Table of Mixing Ratio Parameters The mixing ratio parameter is automatically selected based on the range of historical data, and the weighting coefficient values are directly used for weighted average calculation. Tabular data is stored in the system's configuration memory and can be modified online via ground station software. The calibration of the weighting coefficient values is based on the underwater robot's dynamic response characteristics; control performance under different weights is determined through system identification experiments.
[0047] The mixed computation of initial and average motion commands includes saturation processing logic to prevent the corrected motion commands from exceeding the physical limits of the actuators. Each motion command component undergoes amplitude limiting after mixing, with the limiting range set according to the mechanical characteristics of the thruster and servo. The amplitude limiting range for the thrust command is 0 to 100%, corresponding to the fully closed to fully open state of the propulsion motor. The amplitude limiting range for the azimuth angle command is -180 degrees to 180 degrees, and the amplitude limiting range for the pitch angle command is -30 degrees to 30 degrees. Amplitude limiting is implemented in hardware using comparators and selectors to ensure real-time performance. The Euclidean distance calculation in the similarity index calculation process employs an optimized numerical method, using squared distance comparison to avoid square root operations and reduce computational load. The search for the minimum Euclidean distance uses a divide-and-conquer strategy, dividing the historical feature database into multiple subsets, calculating the minimum distance of each subset in parallel, and then merging the results. The normalization parameter for the similarity score is dynamically adjusted, based on a sliding window statistical analysis of historical scores, with the window size set to 100 samples. The normalization parameter is updated every 10 control cycles to adapt to changes in data distribution.
[0048] The calculation of the average value of historical motion commands includes data validity verification; each historical motion command participating in the averaging process undergoes a rationality check. The rationality check verifies whether the component values of the motion command are within the normal range, removing obviously abnormal historical records. The average value calculation uses a weighted averaging method, assigning higher weights to newer historical records to reflect the time decay effect. The weight coefficient is calculated based on the record's timestamp, with newer records having higher weights and older records having lower weights. The similarity index calculation between feature description values and historical features supports multiple distance metric algorithms, with the system automatically selecting the best algorithm based on the statistical characteristics of the feature data. In addition to Euclidean distance and cosine similarity, Mahalanobis distance calculation is also supported, which considers the covariance structure of the feature dimensions. The selection of the distance metric algorithm is based on the distribution characteristics of the feature data, using principal component analysis to evaluate the correlation between feature dimensions. The similarity index calculation results include a confidence assessment, calculated based on the statistical distribution of nearest neighbor distances. The entire process of initial motion command correction has strict time constraints; from historical record retrieval to command mixing, it must be completed within the control cycle. The standard length of the control cycle is 20 milliseconds, and the system uses a hardware timer to ensure real-time performance. The instruction correction module employs a pipelined architecture, allowing for the continuous processing of multiple feature description value arrays. The pipeline stages include record retrieval, average calculation, blending ratio determination, instruction blending, and amplitude limiting. Each stage has a bypass path; if a stage times out, the process continues using a default value, ensuring system robustness.
[0049] The historical feature database query optimization utilizes caching technology, storing frequently accessed historical records in static random access memory. The caching employs a least recently used replacement strategy to improve cache hit rate. Matching of the feature description value array uses an approximate matching method, allowing for a certain degree of error matching when an exact match fails. The error threshold is configurable and can be adjusted according to control accuracy requirements. The similarity index calculation results are used to evaluate matching quality; low similarity indices trigger the system's learning mechanism, adding new feature description values and corrected motion commands to the historical feature database. The initial motion command correction process is tightly integrated with the underwater robot's motion control system; corrected motion commands are directly sent to the servo controller and thruster driver. Command transmission uses a time-triggered bus protocol to ensure real-time performance and determinism. The system monitors the execution effect of the corrected motion commands, evaluating control performance through sensor feedback. Performance metrics are used to optimize the hybrid proportional parameters and similarity index calculation method. The adaptability of motion command correction enables the underwater robot to optimize its current behavior based on historical experience, improving motion stability in complex water flow environments.
[0050] Example 5: The similarity index is a floating-point number between 0 and 1. A higher value indicates a greater similarity between the current flow pattern and historical characteristics. The process of classifying adjustment levels based on the similarity index uses a threshold comparison method. The system presets two threshold boundaries: a high adjustment level threshold of 0.8, a medium adjustment level threshold of 0.5, and a low adjustment level threshold of 0.2. The similarity index is compared with these thresholds in real time. The comparison operation is performed by a digital comparator circuit. When the similarity index is greater than or equal to 0.8, it is classified as a high adjustment level; when the similarity index is between 0.5 and 0.8, it is classified as a medium adjustment level; when the similarity index is between 0.2 and 0.5, it is classified as a low adjustment level; when the similarity index is below 0.2, it is considered to have no similar historical experience, and a backup control strategy is adopted. Each adjustment level has a preset adjustment coefficient, which is stored in the configuration file of the underwater robot control system. The adjustment coefficient corresponding to the high adjustment level is 0.9, the medium adjustment level is 0.6, and the low adjustment level is 0.3. These coefficient values were determined based on extensive simulation experiments, reflecting different levels of confidence in varying degrees of similarity. The multiplication of the adjustment coefficients with the initial motion command is performed in a digital signal processor, with the multiplication operation conducted independently for each component of the motion command. The initial motion command consists of three components: thrust command, azimuth angle command, and pitch angle command. Each component is multiplied by an adjustment coefficient to scale the magnitude of the motion command. The corrected motion command is then sent to the actuators to control the underwater robot's thrusters and control surfaces.
[0051] The historical feature database update process begins after motion command correction is completed. The update process includes data verification and storage operations. The current feature description value and its corresponding corrected motion command are organized into a new record. The current feature description value is a digitized feature vector extracted from water flow visualization data, and the corrected motion command is a control command adjusted based on similarity indices. The data verification stage checks the completeness and rationality of the feature description value, verifying the correctness of the feature vector's dimensions and whether the values are within the valid range. Storage operations use database transaction processing to ensure the atomicity and consistency of data writes. New records are appended with timestamps and environmental context information, with timestamps accurate to milliseconds and environmental context including water temperature, water depth, and geographic location data. The calculation results of the similarity index affect the historical feature database update strategy. Updates under high similarity indices are cautious, only storing data when there are significant differences between the new data and existing records. Updates under medium similarity indices use a standard approach, directly adding new records. Updates under low similarity indices are aggressive, triggering optimization and reorganization of the historical feature database in addition to adding records. The historical feature database storage structure uses a B+ tree index, supporting efficient range queries and nearest neighbor searches. Database files are backed up regularly to non-volatile storage to prevent data loss.
[0052] The adjustment level classification has a hysteresis characteristic to prevent frequent level switching near threshold boundaries. The hysteresis loop width is set to 0.05, meaning that switching from a low level to a high level requires a similarity index of 0.85, while switching from a high level to a low level requires a similarity index below 0.75. This design reduces adjustment level oscillations and improves control system stability. The multiplication operation between the adjustment coefficient and the motion command includes saturation protection to ensure that the corrected command value does not exceed the physical limits of the actuator. The amplitude limit range for thrust commands is 0% to 100%, for azimuth commands it is -180 degrees to 180 degrees, and for pitch commands it is -30 degrees to 30 degrees. The historical feature database update process includes a data aging mechanism to automatically remove outdated historical records. The record lifecycle is set to 30 days; records exceeding this time limit are marked for deletion and periodically cleaned up by the garbage collection thread. Database performance monitoring tracks query response time and storage space utilization in real time, and automatically performs index rebuilding when performance degrades beyond a threshold. The feature description values are stored using a compression algorithm to reduce storage space usage. The compression algorithm is based on differential coding and Huffman coding.
[0053] The process of correcting initial motion commands based on similarity indices is synchronized with the underwater robot's motion control cycle, which is fixed at 20 milliseconds. Within each control cycle, the similarity indices are recalculated, the adjustment level is reassessed, and motion commands are corrected in real time. This design enables the underwater robot to quickly adapt to changes in the water flow environment and maintain motion stability. The historical feature database update operation is executed in a background thread, without affecting the timing performance of the real-time control task. The assignment of adjustment coefficients is based on fuzzy logic principles, and a non-linear mapping relationship exists between the similarity indices and the adjustment coefficients. This mapping relationship is defined through membership functions, which use triangular and trapezoidal shapes to cover the entire range of similarity indices. Fuzzy inference uses the Mamdani min-max method, and defuzzification uses the centroid method to calculate precise adjustment coefficient values. This design makes the transition between adjustment levels smoother, avoiding abrupt changes in control commands. The historical feature database update process includes a data quality assessment module to evaluate the consistency between new records and existing records. The consistency index is calculated based on the distance between the new record and its nearest historical record; if the distance is less than a threshold, the data is considered redundant, and no storage operation is performed. The data deduplication mechanism reduces database redundancy and improves storage efficiency. The storage format for feature description values includes version information, supporting backward compatibility of data structures. Database migration tools are responsible for data conversion between different versions.
[0054] The similarity index is calculated using a combination of multiple metrics, including Euclidean distance, cosine similarity, and edit distance. The results from different metrics are weighted and fused to obtain a comprehensive similarity index, with weight coefficients adaptively adjusted based on feature type. This multi-metric fusion method improves the accuracy of similarity assessment and reduces the limitations of a single metric. The similarity index calculation module is hardware-accelerated, using an FPGA to implement parallel distance calculations. The effect of initial motion command correction is monitored through sensor feedback; motion state data is compared with expected behavior, and deviation signals are used to optimize the mapping relationship of adjustment coefficients. An adaptive learning algorithm adjusts threshold boundaries and adjustment coefficient values based on control performance, enabling the system to continuously improve its correction strategy. Monitoring data is recorded in the operation log for offline analysis and parameter tuning. The historical feature database update process supports a distributed storage architecture; the historical feature databases of multiple underwater robots can be synchronized through an underwater communication network, achieving group knowledge sharing. The synchronization protocol uses a timestamp-based conflict resolution mechanism to ensure data consistency. Distributed storage improves the system's robustness and learning efficiency; a new robot can learn optimized control strategies from experienced robots.
[0055] The entire process of correcting initial motion commands based on similarity indices includes a complete error handling mechanism, with corresponding recovery strategies for abnormal situations such as sensor malfunctions, calculation timeouts, and storage failures. System health monitoring detects the operational status of each module in real time, automatically switching to degraded mode when an anomaly is detected. Degraded mode uses simplified fixed parameter control to ensure basic motion functions. Fault information is transmitted to the surface monitoring station via underwater acoustic communication, alerting the operator to intervene. A security mechanism for the historical feature database update process prevents invalid data from contaminating the database; data verification rules include range checks, format verification, and logical consistency checks. Digital signature technology ensures the integrity and authenticity of stored records, preventing malicious tampering. Access control lists restrict modification permissions to the historical feature database; only authenticated control modules can perform update operations. Security audit logs record all database access operations, supporting post-event traceability. The real-time performance of similarity index calculation and motion command correction has been verified through benchmark testing; the calculation latency is less than 2 milliseconds in the worst case, meeting the control requirements for high-speed underwater robot movement. The average response time for historical feature database updates is less than 5 milliseconds, and database query optimization enables the system to support high-speed retrieval of over 10,000 records. System resource utilization monitoring ensures that the computational load remains within a reasonable range, avoiding performance degradation caused by resource contention. A method for correcting initial motion commands based on similarity indices enables the underwater robot to optimize its current behavior using historical experience, and the historical feature database update process ensures the system continuously accumulates new knowledge. This self-learning and self-optimization capability allows the underwater robot to maintain excellent motion performance in complex and ever-changing marine environments, adapting to various water flow conditions. The adaptability of the control system continuously improves with increasing operating time; the enrichment of the historical feature database makes similarity matching more accurate and motion command corrections more refined.
[0056] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A control algorithm for underwater robots based on biomimetic motion, characterized in that, The algorithm is implemented through the following processing flow: Acquire environmental perception data of the underwater robot and derive initial motion commands based on the environmental perception data; The system acquires attitude monitoring data of the underwater robot and decides whether to correct the initial motion command based on the attitude monitoring data. When a correction is decided, it collects water flow visualization data around the underwater robot, extracts water flow pattern features from the water flow visualization data, generates feature description values based on the water flow pattern features, compares the feature description values with a historical feature database, and corrects the initial motion command based on the comparison results. When the historical feature database lacks identical feature description values, it calculates a similarity index between the feature description values and historical features, and corrects the initial motion command based on the similarity index.
2. The underwater robot control algorithm based on biomimetic motion according to claim 1, characterized in that, The process of deriving the initial motion command based on the environmental perception data includes: the environmental perception data includes water flow velocity information, water flow direction information, and water depth information; the initial motion command is obtained by: comparing the water flow velocity information with a standard velocity reference value to obtain a velocity adjustment factor; comparing the water flow direction information with a reference direction value to obtain a direction correction amount; comparing the water depth information with a target depth reference value to obtain a depth offset amount; integrating the velocity adjustment factor, direction correction amount, and depth offset amount into a comprehensive parameter; and converting the comprehensive parameter into the initial motion command through a predefined mapping relationship.
3. The underwater robot control algorithm based on biomimetic motion according to claim 1, characterized in that, The decision to correct the initial motion command based on the attitude monitoring data includes: extracting pitch angle data, roll angle data, and yaw angle data from the attitude monitoring data; calculating the difference between the pitch angle data and a stable pitch threshold to obtain the pitch deviation; calculating the difference between the roll angle data and a stable roll threshold to obtain the roll deviation; calculating the difference between the yaw angle data and a stable yaw threshold to obtain the yaw deviation; comparing the pitch deviation, roll deviation, and yaw deviation with the allowable deviation range; and if any deviation exceeds the allowable deviation range, deciding to correct the initial motion command.
4. The underwater robot control algorithm based on biomimetic motion according to claim 1, characterized in that, The extraction of flow pattern features from the water flow visualization data includes: the water flow visualization data includes water flow velocity field image data and water flow vortex image data; image processing algorithms are used to analyze the water flow velocity field image data to obtain velocity distribution features, which include velocity gradient values and flow uniformity; pattern recognition algorithms are used to parse the water flow vortex image data to obtain vortex features, which include vortex size and vortex intensity; the flow pattern features are composed of the velocity distribution features and vortex features.
5. The underwater robot control algorithm based on biomimetic motion according to claim 4, characterized in that, The step of generating feature description values based on the flow pattern characteristics includes: quantifying the flow pattern characteristics of each monitoring area; the feature description values are obtained through the following calculations: dividing the velocity gradient value by the area to obtain the standardized velocity gradient; subtracting the flow uniformity from the ideal uniformity reference value to obtain the uniformity deviation; dividing the vortex size by the reference vortex size to obtain the size ratio; comparing the vortex intensity with the intensity threshold to obtain the intensity factor; and weighting and fusing the standardized velocity gradient, uniformity deviation, size ratio, and intensity factor to obtain the feature description value.
6. The underwater robot control algorithm based on biomimetic motion according to claim 1, characterized in that, The step of comparing the feature description value with the historical feature database includes: traversing all historical feature description values in the historical feature database and searching for historical records that are consistent with the current feature description value; if a consistent historical record exists, then retrieving the historical motion command corresponding to the historical record and using the historical motion command as a correction reference; if no consistent historical record exists, then triggering the similarity index calculation process.
7. The underwater robot control algorithm based on biomimetic motion according to claim 6, characterized in that, When consistent historical records exist, the step of correcting the initial motion command based on the comparison results includes: extracting historical motion commands corresponding to all consistent historical records, calculating the average value of these historical motion commands as the average motion command; mixing the average motion command with the initial motion command, the mixing ratio being determined based on the number of historical records, and using the mixed command as the corrected motion command.
8. The underwater robot control algorithm based on biomimetic motion according to claim 6, characterized in that, The calculation of the similarity index between the feature description value and historical features includes: for each feature description value, calculating its Euclidean distance with each historical feature description value in the historical feature database, and taking the reciprocal of the minimum Euclidean distance as the similarity score; normalizing the similarity scores of all feature description values to obtain the similarity index.
9. The underwater robot control algorithm based on biomimetic motion according to claim 8, characterized in that, The step of correcting the initial motion command based on the similarity index includes: dividing the adjustment level according to the magnitude of the similarity index, the adjustment level including high adjustment level, medium adjustment level and low adjustment level; preset the adjustment coefficient for each adjustment level, and multiply the adjustment coefficient by the initial motion command to obtain the corrected motion command.
10. The underwater robot control algorithm based on biomimetic motion according to claim 1, characterized in that, The algorithm also includes a historical feature library update process: after the motion command correction is completed, the current feature description value and its corresponding corrected motion command are stored in the historical feature library.