Hydrofoil unmanned surface vehicle underwater communication system and method based on stm32 and ofdm

By combining STM32 and OFDM technology with LDPC encoding, an underwater communication system for hydrofoil unmanned surface vessels (USVs) was designed. This system solves the problems of reliability and real-time performance in underwater communication, and achieves efficient data transmission and system integration, making it suitable for USV platforms.

CN122293477APending Publication Date: 2026-06-26WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN UNIV OF TECH
Filing Date
2026-03-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing underwater acoustic communication technologies suffer from poor reliability, high error rate, insufficient real-time performance, and low system integration in underwater environments, failing to meet the real-time data transmission requirements of unmanned surface vessels.

Method used

Using STM32 and OFDM technology, combined with low-density parity-check code (LDPC) and orthogonal frequency division multiplexing (OFDM) modulation, an underwater communication system for a hydrofoil unmanned surface vessel is designed. The system includes a main control module, an underwater acoustic communication module, and a sensor interface module. Through channel coding, data encapsulation and transmission, and reception and error control, efficient data scheduling and resistance to frequency-selective fading are achieved.

Benefits of technology

It improves the reliability and real-time performance of underwater communication, reduces the bit error rate by an order of magnitude, increases the data transmission rate to 50Mbps, and reduces the system size and power consumption, making it suitable for unmanned surface vessel platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122293477A_ABST
    Figure CN122293477A_ABST
Patent Text Reader

Abstract

This invention discloses an underwater communication system and method for a hydrofoil unmanned surface vessel (USV) based on STM32 and OFDM, belonging to the field of underwater acoustic communication technology. It includes: a main control module, employing an STM32F407 series microcontroller as the core processor, responsible for protocol processing, data scheduling, and control of the entire communication process; an underwater acoustic communication module, including an underwater acoustic modem, used to integrate a preamplifier and impedance matching circuit using orthogonal frequency division multiplexing (OFDM) technology; and a sensor interface module, providing a waterproof RS485 interface for connecting a six-axis gyroscope, accelerometer, and velocity sensor. This invention effectively overcomes underwater multipath fading and noise interference through the combined use of OFDM and LDPC encoding. In typical underwater environments, the bit error rate can be reduced by an order of magnitude compared to traditional FSK systems. OFDM technology improves spectrum utilization, enabling data transmission rates up to 50Mbps, meeting the high-speed backhaul requirements of real-time video and large amounts of sensor data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater acoustic communication technology, specifically to an underwater communication system and method for hydrofoil unmanned surface vessels based on STM32 and OFDM. Background Technology

[0002] Reliable communication is crucial for the control and data transmission of hydrofoil unmanned surface vessels (USVs) during diving missions. However, the underwater environment severely attenuates radio signals, necessitating the use of underwater acoustic communication. Existing underwater acoustic communication technologies suffer from the following problems: Poor transmission reliability: The complex underwater acoustic channel is subject to multipath effects, frequency-selective fading, and background noise interference, resulting in high bit error rates in traditional communication methods. Insufficient real-time performance: Existing systems often employ simple modulation and demodulation techniques, resulting in low data transmission rates that cannot meet the real-time transmission requirements of large amounts of information such as USV attitude and sensor data. Low system integration: Communication and control modules are often independent, failing to achieve hardware resource coordination and efficient data scheduling, leading to high power consumption and large size. To address these issues, we propose an underwater communication system and method for hydrofoil USVs based on STM32 and OFDM. Summary of the Invention

[0003] To address the aforementioned technical issues, an underwater communication system and method based on STM32 and OFDM for hydrofoil unmanned surface vessels is provided. This technical solution resolves the interference problem of communication signals caused by the complex underwater environment.

[0004] To achieve the above objectives, the technical solution adopted by this invention is: an underwater communication system for a hydrofoil unmanned surface vessel based on STM32 and OFDM, comprising: The main control module uses an STM32F407 series microcontroller as the core processor, which is responsible for protocol processing, data scheduling and control of the entire communication process. The underwater acoustic communication module, including an underwater acoustic modem, is used to integrate a preamplifier and impedance matching circuit using orthogonal frequency division multiplexing technology; The sensor interface module provides a waterproof RS485 interface for connecting a six-axis gyroscope, accelerometer, and velocity sensor. The communication interface module is equipped with waterproof RS232 and RJ45 underwater optical communication interfaces for connecting with the main control module on board and the control console on the water.

[0005] The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM, the communication steps are as follows: S1. Real-time data acquisition and preprocessing: The STM32 controller acquires data from the sensor and calls the built-in dynamic compression algorithm to compress the data. S2, Channel coding and OFDM modulation: Low-density parity-check code is used to perform channel coding on the compressed data, which is then handed over to an underwater acoustic modem for OFDM modulation. The data is divided into multiple subcarriers to resist frequency selective fading. S3. Data encapsulation and transmission: According to the dedicated UCIE underwater acoustic communication protocol, the data is encapsulated into a fixed-format frame structure, including start character, data length, data type identifier, specific data and CRC check, and transmitted through the underwater acoustic transducer. S4. Reception and Error Control: The receiver performs OFDM demodulation and low-density parity check code decoding. The system adopts a timeout retransmission mechanism, and the transmitter buffers data until it receives an acknowledgment signal from the receiver.

[0006] Preferably, in step S1, the STM32 connects to different sensors via GPIO and I2C interfaces, and uses DMA and timers to adapt analog and digital sensors; after moving average and IIR filtering for noise reduction, outliers are processed according to thresholds, and timestamps are generated by combining RTC to standardize the data into structured frames; the dynamic compression algorithm is based on STM32 hardware acceleration.

[0007] Preferably, the dynamic compression algorithm first extracts the rate of change and periodic features of the preprocessed data, determines the data type to select a strategy, divides the data into blocks of fixed length, sets a dynamic threshold based on features to distinguish key values ​​from redundant values, uses difference encoding for smooth data, and uses segmented fitting combined with difference encoding for bursty data. The checksum is calculated, and the checksum and the original data feature parameters are encapsulated into a compressed frame. Every 10-20 blocks of data are processed, the compression rate and decompression error are statistically analyzed, and the threshold is dynamically adjusted.

[0008] Preferably, in step S2, channel coding involves adding a frame synchronization header and length identifier to the compressed data frame, generating parity bits according to the LDPC code pattern, performing parity matrix multiplication using the STM32 hardware accelerator, concatenating the original data with the parity bits to form an encoded data block, and then converting the data block into baseband symbols based on the symbol rate determined by the underwater acoustic channel bandwidth.

[0009] Preferably, in step S2, OFDM modulation groups the mapped symbols according to the number of subcarriers, inserts pilot symbols and guard intervals to block inter-subcarrier interference and inter-symbol interference; performs an inverse fast Fourier transform on each group of symbols to convert the frequency domain signal into a time domain waveform; converts it into an analog signal by a digital-to-analog converter, suppresses out-of-band radiation by low-pass filtering, and then sends it to the transmitter transducer of the underwater acoustic modem; the subcarrier anti-fading design allocates critical data to intermediate subcarriers and non-critical data to edge subcarriers, using the parallel transmission characteristics of multiple subcarriers to combat the frequency-selective fading of the underwater acoustic channel.

[0010] Preferably, the data encapsulation step in step S3 is as follows: The frame start identifier is determined, and a special byte sequence specified by the protocol is used as the frame header for the receiving end to synchronize frame boundaries; Insert a 1-byte data length field to record the total number of bytes for subsequent data types and specific data. Add a 1-byte data type identifier to distinguish compressed data, control commands, and status information; The compressed data block, which has been preprocessed by LDPC encoding and OFDM modulation, is written as the core payload of the frame; The CRC checksum generation calculates a 16-bit CRC checksum value based on the data length, data type, and specific data field, and appends it to the end of the payload for the receiving end to verify the integrity of data transmission. The frame end and encapsulation completion are marked by the frame end identifier specified in the protocol, forming a complete frame structure; The STM32, triggered by transmission, sends the encapsulated frame data to the underwater acoustic modem via the UART interface. After completing the final processing of OFDM modulation, the electrical signal is converted into an acoustic signal and transmitted through the underwater acoustic transducer.

[0011] Preferably, the frame start identifier is determined by selecting a 2-4 byte sequence with strong autocorrelation and weak cross-correlation based on the characteristics of the underwater acoustic channel, statistically analyzing the common payload byte distribution, using escape characters to handle conflicts, balancing length and complexity, selecting a 3-4 byte frame header, verifying synchronization performance under different signal-to-noise ratios through simulation tests, and incorporating the optimized sequence into the protocol specification as a fixed frame start identifier.

[0012] Preferably, in step S4, the acoustic wave is converted into a digital signal via a transducer and ADC after receiving and error control. During OFDM demodulation, the cyclic prefix is ​​removed by frame header synchronization, the frequency domain is converted by FFT and fading is compensated by pilot equalization, and then the binary sequence is demapped by the soft decision constellation. After deinterleaving, the error is corrected through multiple rounds of LDPC decoding, the UCIE frame structure is parsed and CRC check is performed. If the check passes, the payload is extracted; if it fails, the frame is marked as erroneous. The transmitting end uses a circular buffer to store unacknowledged frames and a timer monitors for timeouts. If the receiving end successfully parses the frame, it sends an ACK; if it fails three times in a row, it sends a NACK. If the transmitting end does not receive an ACK or NACK within the timeout period, it retransmits the signal. Failure triggers an alarm.

[0013] Preferably, the electrical signal output from the receiving transducer is first passed through a preamplifier to suppress background noise, and then through a bandpass filter to filter out out-of-band interference. The ADC sampling uses oversampling technology, and combined with digital downconversion, the signal is converted to baseband.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention effectively overcomes underwater multipath fading and noise interference through the combined use of OFDM and LDPC coding. In typical underwater environments, the bit error rate can be reduced by an order of magnitude compared to traditional FSK systems. OFDM technology improves spectrum utilization, enabling data transmission rates up to 50Mbps, which can meet the high-speed backhaul requirements of real-time video and large amounts of sensor data. The integrated design based on STM32 reduces the number of external components, lowers system size and power consumption, and is suitable for unmanned surface vessel platforms with limited space and energy. Attached Figure Description

[0015] Figure 1 This is a system framework diagram of the present invention; Figure 2 This is a flowchart of the steps of the present invention. Detailed Implementation

[0016] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.

[0017] Reference Figure 1 As shown, the underwater communication system for a hydrofoil unmanned surface vessel based on STM32 and OFDM includes: The main control module uses an STM32F407 series microcontroller as the core processor, which is responsible for protocol processing, data scheduling and control of the entire communication process. The underwater acoustic communication module, including an underwater acoustic modem, is used to integrate a preamplifier and impedance matching circuit using orthogonal frequency division multiplexing technology; The sensor interface module provides a waterproof RS485 interface for connecting a six-axis gyroscope, accelerometer, and velocity sensor. The communication interface module is equipped with waterproof RS232 and RJ45 underwater optical communication interfaces for connecting with the main control module on board and the control console on the water.

[0018] The main control module and the underwater acoustic communication module are connected via an SPI interface. The STM32 sends the data to be transmitted to the underwater acoustic modem and receives the demodulated feedback signal at the same time. The main control module and the sensor interface module are connected to a waterproof RS485 interface via a USART peripheral. The STM32 periodically sends read commands to receive raw data from the six-axis gyroscope, accelerometer, and velocity sensor. The main control module is connected to the onboard main control module via a waterproof RS232 interface to transmit unmanned surface vessel attitude control commands and navigation data short frame information. The main control module connects to the underwater optical communication module via a waterproof RJ45 interface, enabling high-definition status data and high-bandwidth video stream transmission. When underwater acoustic communication is interfered with, the RJ45 optical communication interface can be used as a backup link. The STM32 monitors the link quality in real time and automatically switches to ensure that critical data is not lost. The sensor interface adopts a bus design, so the failure of a single sensor does not affect the communication of other devices, improving the system's fault tolerance.

[0019] The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM, the communication steps are as follows: S1. Real-time data acquisition and preprocessing: The STM32 controller acquires data from the sensor and calls the built-in dynamic compression algorithm to compress the data. S2, Channel coding and OFDM modulation: Low-density parity-check code is used to perform channel coding on the compressed data, which is then handed over to an underwater acoustic modem for OFDM modulation. The data is divided into multiple subcarriers to resist frequency selective fading. S3. Data encapsulation and transmission: According to the dedicated UCIE underwater acoustic communication protocol, the data is encapsulated into a fixed-format frame structure, including start character, data length, data type identifier, specific data and CRC check, and transmitted through the underwater acoustic transducer. S4. Reception and Error Control: The receiver performs OFDM demodulation and low-density parity check code decoding. The system adopts a timeout retransmission mechanism, and the transmitter buffers data until it receives an acknowledgment signal from the receiver.

[0020] In S1 of this application, the STM32 directly controls the sensor to acquire and execute the dynamic compression algorithm. On the one hand, it improves data quality and reduces invalid transmission through local preprocessing; on the other hand, the dynamic compression adaptively adjusts the strategy according to the data characteristics, which can compress the data volume by 30%-60%, reducing the transmission pressure of the underwater channel. At the same time, the hardware computing power of the STM32 ensures that the compression time is controlled at the microsecond level, without affecting real-time performance. S2 employs a dual guarantee of LDPC coding combined with OFDM modulation: LDPC coding, through multiple rounds of iterative error correction, can reduce the bit error rate of underwater acoustic channels by 1-2 orders of magnitude under low signal-to-noise ratio conditions; OFDM divides data into multiple subcarriers for parallel transmission, utilizing the frequency diversity characteristics of subcarriers to effectively resist frequency-selective fading in underwater channels, improving transmission reliability by more than 40% compared to single-carrier modulation; S3 encapsulates a fixed frame structure according to the UCIE protocol, achieving frame synchronization through a start character, and using CRC check to quickly verify data integrity, avoiding frame boundary blurring or data tampering caused by underwater noise; the structured frame format allows the receiver to quickly parse the data, adapting to the differentiated processing needs of various data types and improving communication interoperability.

[0021] The S4 timeout retransmission mechanism forms a closed-loop feedback: the sending end buffers unacknowledged data and dynamically monitors timeouts; the receiving end recovers the data through OFDM demodulation and LDPC decoding, and then provides ACK / NACK feedback to ensure that erroneous data can be retransmitted in a timely manner; the maximum number of retransmissions is limited to avoid channel congestion; combined with the buffer management strategy, the data delivery success rate can still be maintained above 90% in high error rate scenarios, ensuring reliable interaction between unmanned surface vessel status data and control commands.

[0022] In step S1, the STM32 connects to different sensors via GPIO and I2C interfaces, and uses DMA and timers to adapt analog and digital sensors. After moving average and IIR filtering for noise reduction, outliers are processed according to thresholds, and timestamps are generated by combining RTC to standardize the data into structured frames. The dynamic compression algorithm is based on STM32 hardware acceleration.

[0023] This application is compatible with analog and digital sensors through GPIO and I2C interfaces, taking into account diverse data requirements; DMA enables continuous sampling without CPU intervention, avoiding the impact of processor load on the sampling interval, and, together with the timer, generates precise trigger signals to ensure stable data time granularity, providing a reliable time reference for subsequent analysis; moving average and IIR filtering are used to specifically suppress high-frequency noise and interference in specific frequency bands.

[0024] The dynamic compression algorithm first extracts the rate of change and periodic features of the preprocessed data, determines the data type to select a strategy, divides the data into blocks of fixed length, sets dynamic thresholds based on features to distinguish key values ​​from redundant values, uses difference encoding for smooth data, and employs segmented fitting combined with difference encoding for bursty data. The algorithm calculates the checksum, encapsulates the checksum and original data feature parameters into a compressed frame, and calculates the compression ratio and decompression error every 10-20 blocks of data, dynamically adjusting the threshold accordingly.

[0025] This application first distinguishes between gradual and sudden data through feature extraction, and then selects differential encoding and piecewise fitting + differential encoding to avoid the inefficiency caused by "one-size-fits-all" compression. For slowly changing temperature data, differential encoding can reduce redundancy by more than 50%. For high-frequency vibration data, piecewise fitting uses parameterization to represent continuous abrupt changes, increasing the compression rate to 30%-40% and significantly reducing the amount of data transmitted.

[0026] In step S2, channel coding adds a frame synchronization header and length identifier to the compressed data frame, generates parity bits according to the LDPC code pattern, performs parity matrix multiplication through the STM32 hardware accelerator, concatenates the original data with the parity bits to form an encoded data block, and converts the data block into baseband symbols based on the symbol rate determined by the underwater acoustic channel bandwidth.

[0027] This application generates parity bits according to the code pattern and concatenates them with the original data. It utilizes the sparse parity-check matrix characteristics of LDPC codes to achieve deep error correction. In the high-noise and multi-interference environment of underwater acoustic channels, the bit error rate is reduced by 1-2 orders of magnitude. The STM32 hardware accelerator completes the parity-check matrix multiplication, reducing the encoding time to 1 / 5 of that implemented in software, thus avoiding slowing down the pace of real-time communication. The addition of frame synchronization headers and length markers provides the receiver with clear frame boundaries and data volume guidance, solving the problem of frame alignment difficulties caused by multipath effects in underwater signals. The symbol rate is dynamically determined based on the channel bandwidth to avoid inter-symbol interference caused by excessively high rates, ensuring the stability of symbol-level transmission.

[0028] In step S2, OFDM modulation groups the mapped symbols according to the number of subcarriers, inserts pilot symbols and guard intervals to block inter-carrier and inter-symbol interference; performs an inverse fast Fourier transform on each group of symbols to convert the frequency domain signal into a time domain waveform; converts it into an analog signal by a digital-to-analog converter, suppresses out-of-band radiation by low-pass filtering, and then sends it to the transmitter transducer of the underwater acoustic modem; the subcarrier anti-fading design allocates critical data to the middle subcarriers and non-critical data to the edge subcarriers, using the parallel transmission characteristics of multiple subcarriers to combat the frequency-selective fading of the underwater acoustic channel.

[0029] The guard interval inserted in this application can effectively block inter-symbol interference. Its length is greater than the maximum delay spread of the underwater acoustic channel, avoiding interference from the multipath reflection signal of the previous symbol to the current symbol. The periodic insertion of pilot symbols provides the receiver with a basis for real-time channel estimation. Combined with the equalization algorithm to compensate for the amplitude / phase distortion between subcarriers, the interference between subcarriers is suppressed by more than 60%, ensuring the orthogonality of multi-subcarrier parallel transmission. The data is distributed to multiple subcarriers, and the spectral efficiency is improved by utilizing the parallel transmission characteristics.

[0030] The data encapsulation step in step S3 is as follows: The frame start identifier is determined, and a special byte sequence specified by the protocol is used as the frame header for the receiving end to synchronize frame boundaries; Insert a 1-byte data length field to record the total number of bytes for subsequent data types and specific data. Add a 1-byte data type identifier to distinguish compressed data, control commands, and status information; The compressed data block, which has been preprocessed by LDPC encoding and OFDM modulation, is written as the core payload of the frame; The CRC checksum generation calculates a 16-bit CRC checksum value based on the data length, data type, and specific data field, and appends it to the end of the payload for the receiving end to verify the integrity of data transmission. The frame end and encapsulation completion are marked by the frame end identifier specified in the protocol, forming a complete frame structure; The STM32, triggered by transmission, sends the encapsulated frame data to the underwater acoustic modem via the UART interface. After completing the final processing of OFDM modulation, the electrical signal is converted into an acoustic signal and transmitted through the underwater acoustic transducer.

[0031] This application's data encapsulation, through structured design and multiple safeguards, enhances the reliability and efficiency of underwater communication. It employs a fixed frame structure with a special byte sequence as the frame header and a protocol-defined frame tail. Combined with a 1-byte data length and type identifier, this allows the receiving end to quickly synchronize frame boundaries and predict processing methods, improving parsing efficiency by over 40%. A 16-bit CRC checksum is calculated for core data segments, forming a double safeguard with LDPC encoding, achieving an error detection rate exceeding 99.9% and reducing invalid data flow. The STM32 interface connects to an underwater acoustic modem via a UART interface, adapting to underwater anti-interference requirements. The compact frame structure is suitable for low-bandwidth channels, and the dedicated UCIE protocol ensures compatibility between devices. Data type identifiers reserve extension bits, and an escape mechanism avoids conflicts, enhancing protocol robustness and scalability, laying a standardized foundation for reliable end-to-end communication.

[0032] The frame start identifier is determined by selecting a 2-4 byte sequence with strong autocorrelation and weak cross-correlation based on the characteristics of the underwater acoustic channel, statistically analyzing the common payload byte distribution, and using escape characters to handle conflicts. By balancing length and complexity, a 3-4 byte frame header is selected. After simulation testing, the synchronization performance is verified under different signal-to-noise ratios. The optimized sequence is then incorporated into the protocol specification as a fixed frame start identifier.

[0033] This application selects 2-4 byte sequences with strong autocorrelation and weak cross-correlation, which can be quickly identified in underwater environments with severe multipath interference and noise. The receiver can accurately lock the frame boundary through sequence matching, improving the synchronization success rate by more than 50%. By statistically analyzing the payload byte distribution, high-frequency sequences are avoided, and potential conflicts are handled with escape characters to prevent data segments from erroneously triggering frame synchronization, thus controlling the false synchronization rate to within 10%. -6 the following.

[0034] In step S4, the acoustic wave is converted into a digital signal via a transducer and ADC after receiving and error control. During OFDM demodulation, the cyclic prefix is ​​removed by frame header synchronization, the frequency domain is converted by FFT, and fading is compensated by pilot equalization. The binary sequence is then demapped by a soft-decision constellation, deinterleaved, and then iteratively corrected by LDPC decoding. The UCIE frame structure is parsed and CRC check is performed. If the check passes, the payload is extracted; if it fails, an error frame is marked. The transmitting end stores unacknowledged frames in a circular buffer, and a timer monitors for timeouts. If the receiving end successfully parses the frame, it sends an ACK; if it fails three times in a row, it sends a NACK. If the transmitting end times out without receiving an ACK or receives a NACK, it retransmits the signal. Failure triggers an alarm.

[0035] The electrical signal output from the receiving transducer is first passed through a preamplifier to suppress background noise, and then through a bandpass filter to filter out out-of-band interference. The ADC sampling uses oversampling technology, and combined with digital downconversion, the signal is converted to baseband.

[0036] This application employs OFDM demodulation to eliminate inter-symbol interference through frame header synchronization and cyclic prefix removal. FFT conversion combined with pilot equalization precisely compensates for frequency-selective fading, and soft-decision demapping preserves symbol confidence information. LDPC decoding undergoes multiple iterations to correct errors, and deinterleaving disperses burst interference, improving data reconstruction accuracy by over 30% under low signal-to-noise ratio conditions. A multi-layered verification mechanism quickly identifies invalid data. After parsing the UCIE frame structure, CRC check and LDPC decoding form a dual verification, rapidly identifying transmission errors and preventing invalid data from entering subsequent processing. The mechanism for marking erroneous frames provides a clear basis for subsequent retransmissions, reducing resource waste.

[0037] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. An underwater communication system for a hydrofoil unmanned surface vessel based on STM32 and OFDM, characterized in that, include: The main control module uses an STM32F407 series microcontroller as the core processor, which is responsible for protocol processing, data scheduling and control of the entire communication process. The underwater acoustic communication module, including an underwater acoustic modem, is used to integrate a preamplifier and impedance matching circuit using orthogonal frequency division multiplexing technology; The sensor interface module provides a waterproof RS485 interface for connecting a six-axis gyroscope, accelerometer, and velocity sensor. The communication interface module is equipped with waterproof RS232 and RJ45 underwater optical communication interfaces for connecting with the main control module on board and the control console on the water.

2. An underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM, applied to the underwater communication system of the hydrofoil unmanned surface vessel based on STM32 and OFDM as described in claim 1, characterized in that, The communication steps are as follows: S1. Real-time data acquisition and preprocessing: The STM32 controller acquires data from the sensor and calls the built-in dynamic compression algorithm to compress the data. S2, Channel coding and OFDM modulation: Low-density parity-check code is used to perform channel coding on the compressed data, which is then handed over to an underwater acoustic modem for OFDM modulation. The data is divided into multiple subcarriers to resist frequency selective fading. S3. Data encapsulation and transmission: According to the dedicated UCIE underwater acoustic communication protocol, the data is encapsulated into a fixed-format frame structure, including start character, data length, data type identifier, specific data and CRC check, and transmitted through the underwater acoustic transducer. S4. Reception and Error Control: The receiver performs OFDM demodulation and low-density parity check code decoding. The system adopts a timeout retransmission mechanism, and the transmitter buffers data until it receives an acknowledgment signal from the receiver.

3. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 2, characterized in that: In step S1, the STM32 connects to different sensors via GPIO and I2C interfaces, and uses DMA and timers to adapt analog and digital sensors. After moving average and IIR filtering for noise reduction, outliers are processed according to thresholds, and timestamps are generated by combining RTC to standardize the data into structured frames. The dynamic compression algorithm is based on STM32 hardware acceleration.

4. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 3, characterized in that: The dynamic compression algorithm first extracts the rate of change and periodic features of the preprocessed data, determines the data type to select a strategy, divides the data into blocks of fixed length, sets dynamic thresholds based on features to distinguish key values ​​from redundant values, uses difference encoding for smooth data, and adopts segmented fitting combined with difference encoding for bursty data. Calculate the checksum, encapsulate the checksum and original data feature parameters into a compressed frame, and calculate the compression ratio and decompression error every 10-20 blocks of data, dynamically adjusting the threshold.

5. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 2, characterized in that: In step S2, channel coding adds a frame synchronization header and length identifier to the compressed data frame, generates parity bits according to the LDPC code pattern, performs parity matrix multiplication through the STM32 hardware accelerator, and concatenates the original data with the parity bits to form an encoded data block. The data block is converted into baseband symbols by determining the symbol rate based on the underwater acoustic channel bandwidth.

6. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 2, characterized in that: In step S2, OFDM modulation groups the mapped symbols according to the number of subcarriers, inserts pilot symbols and guard intervals to block inter-carrier interference and inter-symbol interference; and performs an inverse fast Fourier transform on each group of symbols to convert the frequency domain signal into a time domain waveform. The signal is converted into an analog signal by a digital-to-analog converter, and after being filtered by a low-pass filter to suppress out-of-band radiation, it is sent to the transmitter transducer of the underwater acoustic modem. The subcarrier anti-fading design allocates critical data to the middle subcarriers and non-critical data to the edge subcarriers, using the parallel transmission characteristics of multiple subcarriers to combat the frequency-selective fading of the underwater acoustic channel.

7. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 2, characterized in that, The data encapsulation step in step S3 is as follows: The frame start identifier is determined, and a special byte sequence specified by the protocol is used as the frame header for the receiving end to synchronize frame boundaries; Insert a 1-byte data length field to record the total number of bytes for subsequent data types and specific data. Add a 1-byte data type identifier to distinguish compressed data, control commands, and status information; The compressed data block, which has been preprocessed by LDPC encoding and OFDM modulation, is written as the core payload of the frame; The CRC checksum generation calculates a 16-bit CRC checksum value based on the data length, data type, and specific data field, and appends it to the end of the payload for the receiving end to verify the integrity of data transmission. The frame end and encapsulation completion are marked by the frame end identifier specified in the protocol, forming a complete frame structure; The STM32, triggered by transmission, sends the encapsulated frame data to the underwater acoustic modem via the UART interface. After completing the final processing of OFDM modulation, the electrical signal is converted into an acoustic signal and transmitted through the underwater acoustic transducer.

8. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 7, characterized in that: The frame start identifier is determined by selecting a 2-4 byte sequence with strong autocorrelation and weak cross-correlation based on the characteristics of the underwater acoustic channel, statistically analyzing the common payload byte distribution, and using escape characters to handle conflicts. By balancing length and complexity, a 3-4 byte frame header is selected. After simulation testing, the synchronization performance is verified under different signal-to-noise ratios. The optimized sequence is then incorporated into the protocol specification as a fixed frame start identifier.

9. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 2, characterized in that: In step S4, the acoustic wave is converted into a digital signal via transducer and ADC after receiving and error control. During OFDM demodulation, the cyclic prefix is ​​removed by frame header synchronization, the frequency domain is converted by FFT and fading is compensated by pilot equalization, and then the binary sequence is obtained by soft decision constellation demapping. After deinterleaving, the error is corrected by LDPC decoding through multiple rounds of iteration, the UCIE frame structure is parsed and CRC check is performed. If the check passes, the payload is extracted; if it fails, the frame is marked as erroneous. The sending end uses a circular buffer to store unacknowledged frames, and a timer monitors for timeouts. The receiving end sends an ACK if it successfully parses the frame, and sends a NACK if it fails three times in a row. If the sending end does not receive an ACK or receives a NACK within the timeout period, it will retransmit the frame. Failure triggers an alarm.

10. The underwater communication method for a hydrofoil unmanned surface vessel based on STM32 and OFDM according to claim 9, characterized in that: The electrical signal output from the receiving transducer is first passed through a preamplifier to suppress background noise, and then through a bandpass filter to filter out out-of-band interference. The ADC sampling uses oversampling technology, and combined with digital downconversion, the signal is converted to baseband.