Sonar-based real-time calculation method and system for cylinder displacement
By combining the sonar ranging mechanism and the central control module, the problem of mechanical sensors being easily affected by the environment in existing hydraulic cylinder displacement detection methods is solved, and high-precision and stable real-time calculation of hydraulic cylinder displacement is achieved.
Patent Information
- Application Number
- CN202511125676.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing methods for detecting cylinder displacement rely on mechanical sensors, which are susceptible to the effects of high-pressure oil environment and temperature changes, resulting in short lifespan and decreased accuracy.
A real-time displacement calculation system for hydraulic cylinders based on sonar is adopted. Through the combination of sonar ranging mechanism, main control module and multiple sub-modules, multiple echo superposition, feature extraction and Kalman filtering are realized to ensure the accuracy and stability of displacement calculation.
It improves the accuracy of displacement calculation and data traceability of long-stroke hydraulic cylinders under complex working conditions, and realizes highly stable and real-time displacement detection.
Smart Images

Figure CN120990960B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydraulic equipment measurement and control technology, and more specifically, to a method and system for real-time calculation of cylinder displacement based on sonar. Background Technology
[0002] In hydraulic systems, the cylinder is a key actuator, and the accurate acquisition of the piston rod (4) position directly affects the stability and safety of equipment operation control. Existing cylinder displacement detection methods mostly rely on mechanical sensors, magnetostrictive sensors, or potentiometers. These types of sensors are easily affected by factors such as high-pressure oil environment, temperature changes, and long-term wear, resulting in problems such as short lifespan and decreased accuracy.
[0003] To address the above problems, this invention proposes a solution. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a sonar-based real-time calculation method and system for hydraulic cylinder displacement to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] The real-time calculation system for cylinder displacement based on sonar includes a cylinder body (2), a piston rod (4), a sonar ranging mechanism (1) set at the tail end of the cylinder body (2), and a main control module (8) connected thereto.
[0007] The sonar ranging mechanism (1) includes a sonar sensor (1) located at the tail end of the cylinder (2), an ultrasonic transmitter (6) located at the front end of the sonar sensor (1), and an ultrasonic receiver (7).
[0008] The cylinder body (2) has a liquid inlet P1 and a liquid inlet P1P2 on its side wall. The liquid inlet P1 is used to extend the jack, and the liquid inlet P1P2 is used to retract the jack.
[0009] The main control module (8) includes: a data acquisition submodule, a sound velocity conversion submodule, a zero reference reading submodule, a displacement calculation submodule, a filtering correction submodule, and a data output submodule. The signals of each submodule are connected to form a data processing closed loop.
[0010] The acquisition submodule is used to receive the echo signal output by the sonar ranging mechanism (1); during the calibration stage, it is used to trigger the sonar pulse transmission at each corresponding step position where the piston rod (4) moves point by point at a constant step distance and continuously sample the entire waveform of the echo signal, record the echo waveform, timestamp and step position index, and perform alignment superposition and extraction of rising edge, peak value and envelope features for multiple echo waveforms at the same step position; during the operation stage, it is used to periodically sample the real-time echo waveform and extract the time difference between adjacent measurements.
[0011] The sound velocity conversion submodule is used to calculate the sound wave propagation speed based on the current oil temperature. During the calibration phase, it is used to establish a binding data table between the sound wave propagation speed and the step position index and echo waveform. During the operation phase, it is used to output the real-time sound wave propagation speed.
[0012] The displacement calculation submodule is used to calculate the amplitude change rate, peak drift rate and envelope distortion rate based on the bound data table during the calibration stage, combined with the rising edge, peak value and envelope characteristics, and generate fluctuation anomaly values. The fluctuation anomaly values are sorted and the step position with the largest fluctuation anomaly value is selected to form the main step position. A comprehensive feature vector is constructed and a feature correction chain is formed. During the operation stage, the comprehensive feature vector is called to match the real-time echo waveform to determine the time feature point, and the difference is calculated by combining the time difference and the real-time sound wave propagation speed to generate the initial displacement value. During the maintenance stage, the feature correction chain is triggered to perform maintenance synchronous correction after the piston rod (4) is pushed to the limit position and the echo waveform and oil temperature are reacquired. The secondary feature position is selected according to the confidence level to realize feature retrieval and replacement.
[0013] The filtering correction submodule is used to perform Kalman filtering and time window smoothing on the initial displacement value;
[0014] The data output submodule outputs the final displacement result to the host computer or actuator.
[0015] In a preferred embodiment, sonar pulses are transmitted multiple times to record the echo waveforms. The rising edge, peak value, and falling edge of the echo waveforms are analyzed to determine stable time feature points and write them into a feature parameter table.
[0016] In a preferred embodiment, after the time feature points are determined, the multiple echo times are uniformly processed to generate echo time determination rules and saved. During the normal operation phase, sonar pulses are periodically emitted, echo waveforms are recorded, time feature points are matched, and the difference is calculated and written into the displacement calculation sequence.
[0017] In a preferred embodiment, the piston rod (4) is moved gradually from the zero position with a constant step distance. At each step distance position, the unique index value of the step distance position is acquired and recorded. A sonar pulse is emitted at the step distance position, the timestamp and echo signal are recorded, and the entire waveform curve is continuously sampled and recorded. Then, the oil temperature value is acquired by the temperature sensor.
[0018] In a preferred embodiment, the piston rod (4) stroke is segmented to establish a one-to-one correspondence between the step position and the temperature sensor, and the piston rod (4) is pushed forward to record the step position index and write it into the position index record table;
[0019] The temperature sensor is matched to obtain the oil temperature value and write it into the position and temperature mapping table. Sonar pulses are emitted multiple times at each step position to record the echo waveform and write it into the waveform recording table.
[0020] The rising edge, peak value, envelope, and falling edge features are extracted and written into the feature data record table to construct a waveform time series feature dataset. The waveform time series feature data under different oil temperature values are compared and calculated to obtain the fluctuation anomaly value.
[0021] In a preferred embodiment, the fluctuation anomalies within the entire stroke range are sorted, and the step position with the largest fluctuation anomaly value is extracted to be identified as the main step position. The amplitude characteristics, peak position characteristics, and envelope shape characteristics of the main step position, along with the sound velocity data, are written into a comprehensive feature vector record table to construct a comprehensive feature vector.
[0022] After real-time echo data acquisition, matching and correction operations are performed, and waveform matching parameters at adjacent step positions are updated layer by layer to form a multi-level feature correction chain;
[0023] The sonar pulse is emitted to calculate the initial displacement value and output the displacement sequence. The piston rod (4) is pushed to the design limit position to reacquire the echo waveform and temperature value, update the feature record and correct it synchronously.
[0024] In a preferred embodiment, the step position with the second highest outlier is selected and written into the secondary feature correction segment table, and the amplitude standard deviation, the maximum drift of the peak position and the rate of change of the envelope curve shape are calculated and written into the sensitivity record.
[0025] Calculate the feature confidence Pi and write it into the feature confidence table and secondary feature correction pool. Obtain the step position feature parameter set with the highest Pi value to replace the main step position and perform matching and correction.
[0026] In a preferred embodiment, the oil temperature value is collected, the sound velocity data is converted, the echo time difference and sound velocity data are calculated to obtain the initial value of real-time displacement, and the real-time displacement data is output. When the machine is stopped for maintenance, the piston rod (4) is pushed to the limit position to collect data again and update the calibration record table.
[0027] The technical effects and advantages of the sonar-based real-time calculation method and system for hydraulic cylinder displacement of this invention are as follows:
[0028] This invention establishes a multi-dimensional binding of position, waveform, and sound velocity by acquiring echo, time, and temperature sound velocity data point by point during the calibration phase, completely avoiding the defects of applying a single feature throughout the entire stroke. Through multiple echo superpositions and feature extraction, fluctuation anomalies are calculated, and the main positions are selected to form a comprehensive feature vector, ensuring that the matching process during operation is always based on real features. During operation, the comprehensive feature vector is called to perform point-by-point matching of real-time echoes, and displacement is calculated by combining the sound velocity converted from real-time temperature. Kalman filtering and time window smoothing are then applied to achieve high data stability and real-time performance. During the maintenance phase, features are re-acquired and updated at extreme positions, triggering synchronous correction of the feature chain and ensuring the continued effectiveness of features during long-term operation. This method significantly improves the accuracy of displacement calculation and data traceability for long-stroke hydraulic cylinders under complex operating conditions. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the sonar-based real-time calculation method and system module for hydraulic cylinder displacement according to the present invention.
[0030] Figure 2 This is a timing diagram of the real-time calculation method and system for hydraulic cylinder displacement based on sonar of the present invention.
[0031] Figure 3 This is a schematic diagram of the sonar ranging mechanism (1) in the oil cylinder in this invention.
[0032] Figure 4 for Figure 3 The working principle and enlarged schematic diagram of the transmitting and receiving structure of the sonar sensor (1) are shown.
[0033] Label Explanation:
[0034] Sonar sensor (1)
[0035] Hydraulic cylinder body (3)
[0036] Piston rod (4)
[0037] Mounting hole (5)
[0038] Ultrasonic transmitter (6)
[0039] Ultrasonic receiver head (7)
[0040] Liquid inlet P1 (P1)
[0041] Liquid inlet P2 (P2)
[0042] Jack extension direction (A)
[0043] The jack is retracted in the direction of (B). Detailed Implementation
[0044] 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. Example
[0045] This invention discloses a real-time calculation method for hydraulic cylinder displacement based on sonar, such as... Figure 2 As shown, it includes:
[0046] Drive the piston rod (4) to move point by point according to a constant step distance. At each step distance position, emit a sonar pulse, record the echo waveform, timestamp and position index, collect the corresponding oil temperature and convert the sound speed, and establish a binding data table.
[0047] The echo waveforms at each step position are aligned and superimposed, and the rising edge, peak value, and envelope features are extracted. The amplitude change rate, peak drift rate, and envelope distortion rate are calculated and fluctuation anomalies are generated. After sorting, the step position with the largest fluctuation anomaly is selected, and a comprehensive feature vector is established.
[0048] During operation, sonar pulses are emitted, real-time echo waveforms are recorded, and comprehensive feature vectors are called for matching to obtain time feature points. The displacement is calculated by combining the real-time sound velocity. At the same time, Kalman filtering and time window smoothing are performed to process and record the displacement sequence.
[0049] Push the piston rod (4) to the limit position to reacquire echo and temperature data, update sound velocity and waveform features, trigger synchronous correction of feature chain, filter secondary feature positions, and retrieve and replace features according to confidence level.
[0050] like Figure 3 and Figure 4 As shown, the present invention discloses a real-time cylinder displacement calculation device based on sonar, comprising: a cylinder body (2), a piston rod (4) installed inside the cylinder body (2), a piston (3) disposed at the front end of the piston rod (4), and a sonar ranging mechanism (1) disposed at the rear end of the cylinder body (2).
[0051] The sonar ranging mechanism (1) includes a mounting hole (5) and a sonar sensor (1) disposed in the mounting hole (5). The front end of the sonar sensor (1) is provided with an ultrasonic transmitter (6) and an ultrasonic receiver (7).
[0052] The cylinder body (2) is provided with a liquid inlet P1 and a liquid inlet P1P2 on its side wall. The liquid inlet P1 is used to inject hydraulic oil into the rear chamber of the piston (3) during the extension of the jack, and the liquid inlet P1P2 is used to inject hydraulic oil into the front chamber of the piston rod (4) during the retraction of the jack, thereby driving the piston rod (4) to reciprocate along the axial direction of the cylinder body (2).
[0053] The piston (3) has a target echo surface with good reflection characteristics at its front end, which forms a fixed ranging structure closed loop with the ultrasonic transmitter (6) and ultrasonic receiver (7) in the sound wave propagation path.
[0054] In actual use, the mechanical structure uses a hydraulic system to control the inlet P1 and inlet P1P2 to achieve the reciprocating motion of the piston rod (4) within the cylinder (2). During each control cycle, the sonar sensor (1) emits a sound wave signal and receives the echo signal reflected from the target surface of the piston (3). The ultrasonic transmitter (6) and ultrasonic receiver (7) are used to complete the transmitting and receiving actions, respectively. By calculating the time difference between transmitting and receiving and combining it with the sound velocity value after the current oil temperature conversion, the sound wave propagation distance can be obtained. By comparing the difference with the initial reference position, the real-time displacement value of the piston rod (4) can be obtained.
[0055] Before the hydraulic cylinder is put into use, the processing parameters for the sonar echo signal are specifically adjusted. Specifically, a transmission command is issued to the sonar probe via a control program, causing the probe to emit sonar pulses multiple times during the calibration phase. After each pulse transmission, the returned echo signal is received via a signal acquisition interface, and the complete echo waveform is recorded chronologically using a high-sampling-rate data acquisition card.
[0056] The echo waveform data is obtained from the actual echo return signal of the sonar probe, and all records are saved in the data buffer to ensure that the data source is clear and traceable.
[0057] After data acquisition, waveform analysis algorithms are used to analyze the rising edge, peak value, and falling edge of each echo point by point. During the analysis, all waveform characteristics are compared, and the stability of each characteristic point under multiple transmitted echoes is statistically analyzed. The time characteristic point with the most stable waveform characteristics and the least noise impact under various operating conditions is determined and written into the characteristic parameter table as the time determination point.
[0058] Furthermore, after the time feature point is determined, the echo times of multiple records are standardized based on this feature point, and the determination rule for the echo time is calculated through time series comparison. This rule uses the selected feature point as the unique benchmark and is saved as a callable feature parameter record after data writing operations.
[0059] After the hydraulic cylinder enters the normal operating phase, the sonar probe periodically emits sonar pulses according to a preset rhythm. The timing circuit automatically generates a timestamp and writes it into the data sequence each time it is emitted. After the echo signal returns, the real-time waveform is recorded through the same signal acquisition interface, and the established echo time determination rules are called to perform envelope extraction and feature point matching on the current echo. The difference between the matched time feature points and the emission timestamp is calculated, and the difference result is directly written into the displacement calculation sequence. The time recording of each echo is based on the same determination benchmark, which achieves high consistency and high accuracy of time recording under actual operating conditions.
[0060] It should be noted that during the continuous operation of the long-stroke cylinder, the piston rod (4) surface has slight differences at different positions due to machining tolerances and wear. The oil film thickness and surface roughness in local areas are also unevenly distributed, resulting in changes in echo amplitude and waveform distortion when the sonar pulse propagates and reflects in different sections. In the existing scheme, the echo time extraction adopts a unified time judgment point and a unified waveform threshold throughout the entire stroke. During calibration, only a set of feature judgment rules are established at the initial position, and then this set of rules is directly applied throughout the entire stroke range. The difference in echo characteristics in different sections is ignored. When the piston rod (4) enters a section with significantly different waveform characteristics, the existing unified threshold and unified feature point cannot accurately identify the real echo in this section. It is easy to extract the delay peak or misjudge the local echo, thus continuously generating deviation in this section. This causes the displacement calculation curve to jump, lag, or accumulate errors in some stroke sections, ultimately reducing the overall displacement calculation accuracy. Therefore, in this embodiment, during the calibration stage before the cylinder is put into use, the feature judgment rule of a single segment is no longer directly applied to the entire stroke. Instead, the piston rod (4) is first driven at a low speed with a constant step distance, so that it moves gradually from the zero position. Each time a step distance position is reached, the built-in displacement encoder is called to obtain and record the unique index value of that step distance position.
[0061] Subsequently, the sonar probe is controlled to emit a sonar pulse at the corresponding step position. The timing circuit records the timestamp at the moment of emission, and the high sampling rate acquisition card receives the echo signal and continuously samples and records the entire waveform curve. Each set of echo data acquired is directly derived from the actual echo return at the corresponding step position and corresponds one-to-one with the timestamp and position index.
[0062] Furthermore, in this embodiment of the invention, to achieve non-contact, high-precision displacement measurement, the sonar probe structure is positioned at the center of the bottom of the cylinder (2), coaxially with the piston rod (4). This structure serves as a fixed starting point for the sonar pulse propagation path, ensuring that the echo signal always corresponds to the target area at the bottom of the piston rod (4) during propagation, effectively reducing the risk of echo distortion caused by sensor installation misalignment. This arrangement constitutes the basic reference path between the transmission time point and the echo time difference in this invention, and is the physical structural starting point for performing subsequent propagation time difference calculations and displacement derivations.
[0063] Simultaneously, multiple temperature sensors arranged in the oil cavity are used to collect oil temperature data. Specifically, the temperature sensors are pre-arranged at fixed points along the axial and radial directions of the cavity, forming a temperature monitoring matrix covering the entire stroke range. Then, a spatial matching algorithm is used to calculate and match the current step position with the monitoring matrix, selecting the temperature sensor closest to that step position, and obtaining the real-time oil temperature value from that sensor.
[0064] The acquired oil temperature data is converted into temperature and sound velocity characteristic curves that have been pre-established and calibrated through physical experiments to obtain sound velocity data at the current step position. This sound velocity data is then bound to the index of the step position, ensuring that each step position not only has an independent spatial index and echo waveform, but also sound velocity data with a clear source that corresponds to the real-time state of the oil. Together, these three elements constitute complete basic calibration data.
[0065] The temperature-velocity of sound characteristic curve is established based on physical acoustic experimental data, obtained by collecting multiple sets of temperature and velocity data in a dedicated oil medium. The curve can be expressed as a polynomial fitting relationship: C(T) = a0 + a1·T + a2·T² + a3·T³;
[0066] Where C(T) represents the sound velocity data, T represents the oil temperature value collected at the corresponding step position, and a0, a1, a2, and a3 are coefficients obtained through experimental calibration.
[0067] Furthermore, the piston rod (4) stroke is segmented so that each step position can find the nearest temperature sensor placement point in space and establish a one-to-one correspondence, so that each step position not only has an independent position index, but also is bound to specific temperature sensor measurement point data.
[0068] Specifically, when the piston rod (4) advances to a certain step position with a constant step distance, the built-in displacement encoder is first called to read the step position and complete the zero-point calibration. The obtained pulse count value is converted into a unique position index and a timestamp is added and written into the position index record table. Then, based on the spatial coordinates of the step position, the stored temperature sensor matrix is calculated and matched by a pre-configured spatial matching algorithm. The matrix contains the coordinates and numbers of all temperature sensors arranged in the axial and radial directions of the oil cavity. Then, the Euclidean distance between the current step position and each temperature sensor is calculated in turn and the temperature sensor number with the smallest Euclidean distance is selected. The real-time data output of the temperature sensor with the number is called through the temperature acquisition interface to obtain the oil temperature value with the timestamp. The oil temperature value is bound to the step position index and written into the position and temperature mapping table, thus forming a one-to-one correspondence in space.
[0069] Immediately after mapping is completed, the sonar probe is triggered to emit pulse signals multiple times at the step position. Each emission is recorded in real time by a timing circuit with a timestamp. After the echo returns, continuous full-segment sampling is performed by a high sampling rate acquisition card. The acquired data is bound to the corresponding step position index and timestamp in chronological order and written into the waveform record table to ensure that the waveform data source is clear and corresponds precisely to the spatial position.
[0070] Subsequently, all waveform data recorded during multiple transmissions at the same step distance position were retrieved, aligned along the time axis, and then point-to-point superposition was performed after eliminating minor deviations between samples using linear interpolation. During the superposition process, the amplitude values of each sampling point were accumulated and averaged to generate a noise-suppressed superimposed waveform. The superimposed waveform was then sequentially processed using a feature analysis algorithm. The first derivative was used to identify the change points in the amplitude rise segment to determine the rising edge characteristics. Then, the second derivative and a sliding window were used to locate the maximum amplitude point to determine the peak time position and peak amplitude. Finally, the Hilbert transform was called to extract the envelope curve and calculate the maximum value, width, and shape of the envelope.
[0071] Next, the falling edge termination point and amplitude change rate are extracted by the change of the derivative of the falling segment. All extracted feature parameters are written into the feature data record table of the step position in time order to form a waveform time series feature dataset composed of amplitude sequence, peak position sequence, envelope shape parameter and edge change parameter.
[0072] Then, combined with the oil temperature value bound to that position, the waveform time series feature data under different oil temperature conditions are compared. Various ratio features are obtained by calculating the amplitude change rate, peak drift rate and envelope distortion rate. Then, the fluctuation anomaly value of that step position is output by normalization algorithm and bound to the position index and written into the feature record table.
[0073] Specifically, the amplitude change rate R1, peak drift rate R2, and envelope distortion rate R3 are calculated separately. Using a normalization algorithm, each ratio feature is transformed to the 0-1 interval, and then linearly combined. The calculation formula is: Fluctuation outlier = Q1·R1_norm + Q2·R2_norm + Q3·R3_norm;
[0074] Where R1_norm represents the normalized value of the amplitude change rate, R2_norm represents the normalized value of the peak drift rate, R3_norm represents the normalized value of the envelope distortion rate, Q1 represents the weight of the normalized value of the amplitude change rate, Q2 represents the weight of the normalized value of the peak drift rate, and Q3 represents the weight of the normalized value of the envelope distortion rate.
[0075] The amplitude change rate is calculated by comparing the peak amplitude of the superimposed waveform with the reference amplitude at the step position, and the formula is: amplitude change rate R1=(A_max-A_ref) / A_ref;
[0076] Where A_max represents the peak amplitude of the current superimposed waveform, and A_ref represents the reference peak amplitude recorded at this step position during the calibration phase.
[0077] The peak drift rate is calculated by comparing the current peak time position of the superimposed waveform with the reference peak time position. The formula is: Peak drift rate R2 = (T_peak - T_ref) / T_ref;
[0078] Where T_peak represents the peak time position of the current superimposed waveform, and T_ref represents the reference peak time position recorded at this step position during the calibration phase.
[0079] The envelope distortion rate is calculated by comparing the current waveform envelope width with the reference envelope width, and the formula is: envelope distortion rate R3 = (W_env - W_ref) / W_ref;
[0080] Where W_env represents the width of the current waveform envelope, and W_ref represents the reference envelope width recorded at this step position during the calibration phase.
[0081] Furthermore, after calculating the fluctuation anomaly values for all step positions within the entire stroke range, the sorting operation program is called to sort the fluctuation anomaly value field in the feature record table in descending order. Based on the sorting results, each item is retrieved to extract the step position with the largest fluctuation anomaly value, and the index of this step position is used as a unique identifier to confirm it as the main step position.
[0082] It should be noted that the position index is a unique identifier for each step position, which is directly derived from the pulse count value output and recorded by the built-in displacement encoder during the calibration stage. After zero-point calibration, it is written into the index record table to ensure the uniqueness and traceability of the index.
[0083] The sound velocity data comes from the oil temperature value obtained by calling the temperature sensor matrix during the calibration stage. It is converted through a pre-established temperature-sound velocity characteristic curve and bound to the location index. It is stored in the data table as a physical parameter for converting echo time into spatial distance to ensure the accuracy of the ranging results.
[0084] Next, using the index of the main step position as the primary key, the amplitude characteristics, peak position characteristics, and envelope shape characteristics obtained from waveform analysis during the calibration phase are retrieved from the feature data record table. These characteristics, along with the sound velocity data bound to the position, are written into the comprehensive feature vector record table to form a comprehensive feature vector containing a unique position index for spatial positioning, sound velocity data for time-distance conversion, and key feature parameters for waveform matching.
[0085] Centered on this comprehensive feature vector, the real-time echo data, after acquisition, first calls the matching and correction operation. Following the feature matching algorithm, it compares the amplitude, peak value, and envelope parameters of the real-time echo waveform with those in the comprehensive feature vector point by point, correcting the time feature points. After correction, based on the adjacency relationship of the position index, it selects step positions adjacent to the main position layer by layer according to the step size order. It then calls the merging correction algorithm to fuse the local waveform features recorded during the calibration phase at adjacent positions with the main comprehensive feature vector, compares the differences, and updates the waveform matching parameters of adjacent positions. The updated waveform matching parameters are then progressively passed to the next layer of adjacent positions, and this process is repeated cyclically, ultimately forming a multi-level feature correction chain that expands outward from the main step position as the core.
[0086] As the main integrated features expand outward, at the beginning of each sampling cycle, the sonar control command is invoked to drive the sonar probe to emit a pulse at the current step position of the hydraulic cylinder. The timing circuit records the emission timestamp, and the echo returns through the signal interface. The high sampling rate acquisition card then performs full-segment sampling, and the sampled data is written to the real-time waveform buffer using the timestamp and position index as keys.
[0087] Subsequently, the data retrieval logic is invoked, using the current position index as the primary key to extract the waveform matching features and corresponding sound velocity data updated through the ripple mechanism from the feature record table. The waveform matching calculation function is invoked to perform point-by-point comparison of the amplitude, peak position, and envelope curve of the real-time echo data. The time difference calculation formula is invoked to calculate the propagation time based on the matched time feature points and the transmission timestamp. The distance conversion is performed in conjunction with the retrieved sound velocity data, and the initial displacement value of the current sampling period is output and written to the real-time displacement buffer.
[0088] Next, the Kalman filter algorithm is used to perform state prediction and observation update on the real-time displacement sequence. The state vector and covariance matrix of the previous period are loaded, the difference between the predicted value and the current initial displacement value is calculated, and weighted fusion is performed according to the preset Kalman gain. The filtered displacement estimate is output and written to the filter output table. Then, the displacement estimate of multiple repeated echoes within the same sampling period is retrieved using a time window smoothing algorithm. The mean and standard deviation within the window are calculated, and outliers exceeding the threshold range are removed using a rejection function. The smoothed displacement data output is written to the final displacement sequence.
[0089] To make the Kalman filtering operation clearer, the core formula is explained below:
[0090] In the state prediction stage, the state equation is established using the motion law of the piston rod (4) in the hydraulic system:
[0091] X_k-=F·X_{k-1}+B·U_{k-1};
[0092] Where X_k- represents the predicted state vector, F represents the state transition matrix, X_{k-1} represents the state vector of the previous sampling period, B represents the control matrix, and U_{k-1} represents the control quantity.
[0093] During the observation update phase, the predicted value is fused with the sonar ranging data in the current sampling period. The update formula is: X_k=X_k-+K_k(Z_k−H·X_k-);
[0094] Where X_k represents the updated state vector, K_k represents the Kalman gain, Z_k represents the observation value, and H represents the observation matrix.
[0095] Furthermore, the specific threshold range depends on the specific experimental conditions. In order to make the time window smoothing algorithm clearer, the processing logic is explained in detail below: within the same sampling period, the displacement estimate of multiple consecutive echoes is averaged, and the calculation formula is: S_win=(ΣX_i) / n;
[0096] Where S_win represents the smoothed displacement value within the window, X_i represents the filtered displacement estimate obtained from each echo calculation within the window, and n represents the number of samples within the window.
[0097] The S_win value is compared with the Kalman filter output value. If there are outlier measurements that deviate from the preset threshold, they are removed by the elimination function. The final real-time displacement data is then output and written into the real-time displacement sequence table.
[0098] During long-term operation, in order to prevent feature drift caused by wear on the surface of the piston rod (4) or changes in temperature distribution, the piston rod (4) is pushed to the design limit position by the hydraulic drive. The sonar control command is used to execute pulse transmission and echo acquisition. The same waveform matching calculation function is used to obtain the ranging result at this position. Then, the current ranging result is compared with the initial calibration record point by point by the data comparison function. If a deviation is detected, the mechanical adjustment program is called to adjust the installation angle of the sonar probe. Then, the temperature acquisition interface is called again to obtain the temperature value at the limit position. The new sound velocity data is calculated by the temperature and sound velocity characteristic curve function. Then, the waveform analysis algorithm is used to extract the amplitude, peak position and envelope curve features of the reacquired echo waveform. The updated sound velocity data is bound to the new waveform features and written into the feature record corresponding to the position index. The feature outward expansion algorithm is triggered to synchronously correct the feature parameters of the adjacent positions. The updated feature parameters are written into the feature record table of all affected positions, so that the parameter chain of the main feature outward is synchronously corrected, and the overall feature chain is refreshed.
[0099] Subsequently, the sorting and retrieval logic is invoked to scan the fluctuating outlier results in descending order, and the top k step positions of the second highest outlier and feature matching residual values that are still within the preset threshold range after calculation by the residual evaluation function are selected. These position indices are then written into the secondary feature correction segment table.
[0100] Then, using data statistics functions, real-time echo data recorded in the most recent operating cycle is retrieved for each secondary feature correction segment. The amplitude standard deviation of the segment is calculated according to the sampling time axis. The peak analysis function is called to calculate the maximum drift of the peak position. The envelope analysis function is called to calculate the rate of change of the shape of the envelope curve. The three indicators are combined into a fluctuation sensitivity parameter group and written into the sensitivity record of the corresponding segment.
[0101] Then, using the feature confidence calculation function, the feature confidence Pi of each segment is calculated by combining the weights of each indicator. The Pi value is then bound to the corresponding position index and written into the feature confidence table. All secondary feature correction segments are sorted in descending order of Pi value, and the output results are written into the secondary feature correction pool.
[0102] To clarify the calculation process of the feature confidence Pi, the mathematical expression is explained below:
[0103] The feature confidence score Pi is calculated by weighting the amplitude standard deviation S_amp, the maximum peak position drift D_peak, and the envelope curve shape change rate C_env from the fluctuation sensitivity parameter set. The formula is as follows:
[0104] Pi=W1·f1(S_amp)+W2·f2(D_peak)+W3·f3(C_env);
[0105] Where W1 represents the weight of the amplitude standard deviation S_amp, W2 represents the weight of the maximum drift of the peak position D_peak, W3 represents the weight of the rate of change of the envelope curve shape C_env, and f1, f2, and f3 are mapping functions after normalizing the original indicators.
[0106] Meanwhile, during operation, the feature outward ripple link continuously calls the matching monitoring logic to detect the waveform matching status of the segment where the main trunk step position is located in real time. When an abnormal trend is detected, such as waveform matching failure, continuous echo time offset, or sound velocity data not matching real-time propagation characteristics, the secondary feature correction pool is used to retrieve the confidence ranking results, select the step position index with the highest Pi value, call the feature retrieval function to obtain its feature parameter set, replace the feature matching parameters of the current main trunk region, re-execute the matching and correction operation, write the updated feature parameters back to the main trunk feature vector, and continue to drive the feature outward ripple link to perform progressive expansion, realizing the immediate takeover and seamless switching of the main trunk feature matching logic, and ensuring that the feature correction link has continuous verification and failure replacement capabilities.
[0107] Furthermore, after obtaining the time data, the temperature data acquisition command is called, and the temperature sensor arranged near the inner wall of the oil cavity continuously outputs the oil temperature value. Each temperature value is timestamped and written into the temperature cache table. Then, the temperature-to-sound speed conversion function is called, and the real-time temperature value is input into the sound speed characteristic curve established by physical acoustic experimental data and corrected by specific oil medium calibration data. The real-time sound speed data at the corresponding moment is output and written into the sound speed record table. The displacement calculation function is called, and the current echo time difference is multiplied with the sound speed data at that moment to obtain the instantaneous distance. The zero reference record table is called to read the zero reference distance stored during calibration, and the difference calculation is performed. The initial real-time displacement value of the current piston rod (4) is output and written into the displacement cache table.
[0108] The sound velocity characteristic curve is derived from physical acoustic experimental data and corrected by calibration data of a specific oil medium, ensuring that the source of the sound velocity calculation is clear and the data is reliable.
[0109] Furthermore, using Kalman filtering, state prediction and observation updates are performed on the real-time initial displacement values in the displacement buffer table. The state prediction model is loaded based on the motion law established by the piston rod (4) in the hydraulic system. The observation update value calls the sonar ranging data in the current sampling period. The predicted value and the observed value are weighted and fused through Kalman gain, and the filtered displacement estimate is output and written into the filter output table, effectively eliminating short-term anomalies caused by sonar multipath effect, mechanical vibration and hydraulic fluctuation.
[0110] The displacement estimates of multiple repeated echoes within the same sampling period are processed by a time window smoothing algorithm, and the mean value is jointly compared with the predicted value output by the Kalman filter. Outlier measurements that deviate from the preset threshold are removed, and the final real-time displacement data is output and written into the real-time displacement sequence table.
[0111] During the long-term operation of the hydraulic cylinder, when the shutdown maintenance window is triggered, the drive control command is called to push the piston rod (4) to the limit position of the mechanical design, and the sonar control command is called to emit pulses, collect echoes and perform the same time difference and sound speed calculation as the operation phase to obtain the instantaneous distance of the limit position.
[0112] like Figure 3 As shown, the sonar ranging structure used in this invention includes a cylinder (2) 3, a piston rod (4) 4, and a sonar sensor (1) 1 arranged on the central axis of the bottom of the cylinder (2). The sonar sensor (1) 1 is fixedly installed at the bottom of the cylinder (2) 3 by fasteners and emits sonar pulses toward the axial lower end of the piston rod (4) 4. The echo propagates along the liquid medium and is reflected back from the bottom of the piston rod (4).
[0113] like Figure 4 As shown, the sonar sensor (1) 1 integrates multiple ultrasonic transmitters 6 and multiple ultrasonic receivers 7. The transmitters 6 transmit ultrasonic waves into the hydraulic cavity in a high-frequency periodic manner, and the receivers 7 receive the echo signals in real time. The sonar propagation distance is calculated by the time difference between transmission and reception and the speed of sound in the liquid, and then the displacement of the piston rod (4) 4 relative to the bottom of the cylinder (2) 3 is calculated.
[0114] The sonar sensor (1) 1 and the cylinder (2) 3 are fixedly positioned by a mechanical mounting bracket to ensure that the sonar emission direction is aligned with the axis of the piston rod (4), and the sensor probe is sealed to prevent hydraulic oil from entering the signal interface area, thus ensuring the long-term stable operation of the system.
[0115] The distance is compared point by point with the initial calibration record by the comparison function. If a deviation is found, the mechanical adjustment command is called to readjust the installation angle of the sonar probe. Then, the temperature value is re-acquired, the temperature-to-sound velocity conversion function is called to update the sound velocity data at this location, and the waveform analysis algorithm is called to re-extract the waveform features. The updated zero reference distance and feature data are written into the calibration record table to ensure the accuracy of subsequent displacement calculations.
[0116] During the echo signal processing in each sampling period, the time window smoothing algorithm is called to perform a moving average on multiple consecutive echo data. The average of the same instantaneous displacement value is calculated multiple times and then compared with the Kalman filter output value to remove outlier data. The updated smoothed displacement value is then written into the final output table, so that the displacement sequence maintains long-term consistency and high confidence in high-frequency reciprocating motion and complex environments.
[0117] This invention also proposes a real-time calculation system for hydraulic cylinder displacement based on sonar, such as... Figure 1 As shown, it includes:
[0118] The sonar ranging mechanism (1) has a signal output terminal connected to a central control module (8). The central control module (8) is used to receive the echo signal output by the sonar ranging mechanism (1), process the data, and calculate the real-time displacement. Specifically, it includes:
[0119] Acquisition submodule: used to acquire the echo waveform and corresponding timestamp output by the sonar sensor (1) and record it to the buffer;
[0120] The sound velocity conversion submodule calculates the current propagation sound velocity by calling the preset temperature-sound velocity characteristic curve based on the real-time oil temperature.
[0121] Zero-reference reading submodule: calls the reference distance data established by the piston rod (4) at the initial position as the reference for subsequent calculations;
[0122] Displacement calculation submodule: Calculates the current distance based on the echo propagation time difference and the current sound speed, and performs difference calculation with zero reference to obtain the real-time displacement value;
[0123] The filtering correction submodule uses the Kalman filter algorithm and sliding window smoothing mechanism to denoise and dynamically adjust the initial displacement value, and outputs a high-confidence displacement estimation result.
[0124] Data output submodule: Writes the final real-time displacement to the output buffer for the upper control system or hydraulic actuator to read.
[0125] The main control module (8) forms a highly coupled non-contact displacement ranging system with the sonar ranging mechanism (1) and the cylinder (2) structure, which has the characteristics of high structural integration and strong adaptability to working conditions.
[0126] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0127] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0128] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0129] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0131] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A real-time calculation system for hydraulic cylinder displacement based on sonar, characterized in that: It includes a cylinder (2), a piston rod (4), a sonar ranging mechanism (1) located at the tail end of the cylinder (2), and a main control module (8) connected thereto. The sonar ranging mechanism (1) includes a sonar sensor (1) located at the tail end of the cylinder (2), an ultrasonic transmitter (6) located at the front end of the sonar sensor (1), and an ultrasonic receiver (7). The cylinder body (2) has a liquid inlet P1 and a liquid inlet P1P2 on its side wall. The liquid inlet P1 is used to extend the jack, and the liquid inlet P1P2 is used to retract the jack. The main control module (8) includes: a data acquisition submodule, a sound velocity conversion submodule, a zero reference reading submodule, a displacement calculation submodule, a filtering correction submodule, and a data output submodule. The signals of each submodule are connected to form a data processing closed loop. The acquisition submodule is used to receive the echo signal output by the sonar ranging mechanism (1); during the calibration stage, it is used to trigger the sonar pulse transmission at each corresponding step position where the piston rod (4) moves point by point at a constant step distance and continuously sample the entire waveform of the echo signal, record the echo waveform, timestamp and step position index, and perform alignment superposition and extraction of rising edge, peak value and envelope features for multiple echo waveforms at the same step position; during the operation stage, it is used to periodically sample the real-time echo waveform and extract the time difference between adjacent measurements. The sound velocity conversion submodule is used to calculate the sound wave propagation speed based on the current oil temperature. During the calibration phase, it is used to establish a binding data table between the sound wave propagation speed and the step position index and echo waveform. During the operation phase, it is used to output the real-time sound wave propagation speed. The displacement calculation submodule is used to calculate the amplitude change rate, peak drift rate and envelope distortion rate based on the bound data table during the calibration stage, combined with the rising edge, peak value and envelope characteristics, and generate fluctuation anomaly values. The fluctuation anomaly values are sorted and the step position with the largest fluctuation anomaly value is selected to form the main step position. A comprehensive feature vector is constructed and a feature correction chain is formed. During the operation stage, the comprehensive feature vector is called to match the real-time echo waveform to determine the time feature point, and the difference is calculated by combining the time difference and the real-time sound wave propagation speed to generate the initial displacement value. During the maintenance stage, the feature correction chain is triggered to perform maintenance synchronous correction after the piston rod (4) is pushed to the limit position and the echo waveform and oil temperature are reacquired. The secondary feature position is selected according to the confidence level to realize feature retrieval and replacement. The filtering correction submodule is used to perform Kalman filtering and time window smoothing on the initial displacement value; The data output submodule outputs the final displacement result to the host computer or actuator.
2. A sonar-based real-time calculation method for hydraulic cylinder displacement, based on the sonar-based real-time calculation system for hydraulic cylinder displacement as described in claim 1, characterized in that: Multiple sonar pulses are transmitted to record the echo waveforms. The rising edge, peak value, and falling edge of the echo waveforms are analyzed to determine stable time feature points, which are then written into the feature parameter table.
3. The real-time calculation method for hydraulic cylinder displacement based on sonar according to claim 2, characterized in that: After determining the time feature points, the echo times of multiple echoes are standardized to generate echo time determination rules and are saved. During normal operation, sonar pulses are periodically emitted, echo waveforms are recorded, time feature points are matched, and the difference is calculated and written into the displacement calculation sequence.
4. The real-time calculation method for hydraulic cylinder displacement based on sonar according to claim 3, characterized in that; The piston rod (4) is moved gradually from the zero position with a constant step distance. At each step distance position, the unique index value of the step distance position is obtained and recorded. At the step distance position, a sonar pulse is emitted, the timestamp and echo signal are recorded, and the entire waveform curve is continuously sampled and recorded. Then, the oil temperature value is collected by the temperature sensor.
5. The sonar-based real-time calculation method for hydraulic cylinder displacement according to claim 4, characterized in that: The piston rod (4) stroke is segmented to establish a one-to-one correspondence between the step position and the temperature sensor. The piston rod (4) is pushed forward to record the step position index and write it into the position index record table. The temperature sensor is matched to obtain the oil temperature value and write it into the position and temperature mapping table. Sonar pulses are emitted multiple times at each step position to record the echo waveform and write it into the waveform recording table. The rising edge, peak value, envelope, and falling edge features are extracted and written into the feature data record table to construct a waveform time series feature dataset. The waveform time series feature data under different oil temperature values are compared and calculated to obtain the fluctuation anomaly value.
6. The real-time calculation method for hydraulic cylinder displacement based on sonar according to claim 5, characterized in that: The fluctuation anomalies within the entire stroke range are sorted, and the step position with the largest fluctuation anomaly value is extracted to be identified as the main step position. The amplitude characteristics, peak position characteristics, and envelope shape characteristics of the main step position, along with the sound velocity data, are written into the comprehensive feature vector record table to construct the comprehensive feature vector. After real-time echo data acquisition, matching and correction operations are performed, and waveform matching parameters at adjacent step positions are updated layer by layer to form a multi-level feature correction chain; The sonar pulse is emitted to calculate the initial displacement value and output the displacement sequence. The piston rod (4) is pushed to the design limit position to reacquire the echo waveform and temperature value, update the feature record and correct it synchronously.
7. The sonar-based real-time calculation method for hydraulic cylinder displacement according to claim 6, characterized in that: The step position with the second highest outlier is selected and written into the secondary feature correction segment table. The amplitude standard deviation, the maximum drift of the peak position, and the rate of change of the envelope curve shape are calculated and written into the sensitivity record. Calculate the feature confidence Pi and write it into the feature confidence table and secondary feature correction pool. Obtain the step position feature parameter set with the highest Pi value to replace the main step position and perform matching and correction.
8. The sonar-based real-time cylinder displacement calculation method according to claim 7, characterized in that; Collect oil temperature value, convert sound velocity data, calculate echo time difference and sound velocity data to obtain real-time initial displacement value, and output real-time displacement data. When the machine is stopped for maintenance, push the piston rod (4) to the limit position to re-collect and update the calibration record table.
Citation Information
Patent Citations
Hydraulic oil cylinder displacement detection system and hydraulic oil cylinder displacement detection method
CN119042193A