A drilling peep sight lens self-cleaning method based on image sharpness recognition
Patent Information
- Application Number
- CN202511958170.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-12-23
AI Technical Summary
[0006]针对现有技术的不足,本发明提供了一种基于图像清晰度识别的钻孔窥视仪镜头自清洁方法,解决了现有技术难以区分探头运动模糊与镜头污渍遮挡而导致清洁机构频繁误触发的问题
1、本发明通过在被动监测阶段引入光流场分析逻辑,对比全局运动矢量与局部相对静止区域,能够有效区分探头快速移动产生的运动模糊与实际附着的镜头污渍,该机制避免了因钻孔作业中探头抖动导致的清洁功能误触发,在保证检测准确性的同时降低了系统功耗,延长了柔性清洁执行件的使用寿命。
Smart Images

Figure CN122085789B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial endoscopic inspection technology, specifically a self-cleaning method for the lens of a borehole inspection instrument based on image sharpness recognition. Background Technology
[0002] Borehole inspection cameras are mainly used for video inspection of underground boreholes, well shafts, and concealed works. The operating environment is usually characterized by high humidity, dust, and mud. As the core component for image acquisition, the lens is highly susceptible to image quality degradation due to the accumulation of various contaminants. Therefore, equipping these devices with self-cleaning functions has become a standard design feature.
[0003] Existing self-cleaning solutions mostly rely on a single image sharpness threshold to trigger the cleaning action. However, in actual operation, rapid movement or rotation of the probe, or vibration of the drilling rig, can also cause overall or localized blurring of the image. Conventional sharpness detection algorithms struggle to distinguish between motion blur caused by probe movement and substantial obstruction caused by dirt on the lens surface. This deficiency in the recognition logic leads to frequent false triggering of the cleaning mechanism during normal probe movement adjustments, resulting not only in wasted battery power but also accelerated wear on mechanical components such as the motor and scraper.
[0004] Furthermore, existing cleaning devices typically lack the ability to sense the physical properties of deposits. Without the introduction of expensive additional sensors, traditional techniques cannot effectively distinguish whether deposits on the lens surface are fluid mud, highly viscous oil, or hardened, dried crusts.
[0005] Limited by a lack of sensing capabilities, existing control systems often employ a single mechanical action with a fixed rotation speed and cycle to perform cleaning. When hard crusts are present on the lens surface, conventional scraping force may not be effective in removing the stains, and could even cause the motor to stall and overload. Furthermore, when dealing with sticky stains containing hard particles, using indiscriminate, forceful scraping can easily scratch the optical coating on the lens surface. This mismatch between a single control strategy and complex stain types limits the cleaning efficiency and lifespan of the equipment under complex operating conditions. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a self-cleaning method for borehole inspection camera lenses based on image sharpness recognition. This solves the problem of frequent false triggering of the cleaning mechanism due to the difficulty in distinguishing between probe motion blur and lens contamination in existing technologies. Furthermore, this invention also addresses the issue that traditional cleaning devices cannot detect the physical properties of deposits without adding external sensors, leading to a single control strategy that cannot simultaneously achieve efficient removal of hard crusts and protection of the lens coating.
[0007] The first aspect of the present invention provides a self-cleaning method for a borehole peephole lens based on image sharpness recognition. The method operates in a borehole peephole system comprising an imaging subsystem, a cleaning execution subsystem, and a central control unit.
[0008] This method performs motion blur determination based on optical flow during the passive monitoring phase. Real-time images are acquired through the imaging subsystem, and a sharpness evaluation value is calculated. When the sharpness is below a dynamic trigger threshold, the dense optical flow field of the image is calculated, and the distribution relationship between global and local motion vectors is analyzed. Only when the probe is detected to be in motion but a relatively stationary area exists in the image center is it determined to be dirt adhering to the lens surface, thus distinguishing image blur caused by probe motion from actual dirt occlusion.
[0009] After confirming the presence of the stain, the method enters the optomechanical coupling active detection phase. The central control unit generates a sinusoidal micro-vibration excitation signal with DC bias, driving a precision drive motor to generate micro-amplitude reciprocating vibrations in the flexible cleaning actuator. At this time, the system activates a hardware phase synchronization triggering mechanism, sending hardware pulses at specific phase points of the micro-vibration excitation signal cycle. The imaging subsystem responds to the rising edge of the pulse to trigger exposure acquisition. This mechanism ensures that the acquired micro-vibration image sequence is strictly locked to the phase of the motor vibration, eliminating the time delay error of software triggering.
[0010] Based on synchronously acquired data, this method performs multi-dimensional physical feature calculation and fusion. On one hand, it performs temporal cross-correlation analysis on the grayscale changes of the region of interest in the micro-vibration image sequence to extract the visual phase lag, which characterizes the response delay of the attachment relative to the motion of the actuator. On the other hand, it uses a sliding mode observer to calculate the electromagnetic torque from the real-time current feedback of the motor, and extracts the fundamental component with the same frequency as the excitation signal through spectrum analysis, separating the mechanical impedance characteristics reflecting the load damping and stiffness characteristics.
[0011] This method identifies stain types and executes corresponding cleaning strategies based on the combined relationship between visual phase hysteresis and mechanical impedance characteristics. For solid crust-type stains with visual phase hysteresis approaching zero and exhibiting high rigidity, a magnetic field orientation control algorithm is used to output a constant torque, combined with anti-jamming retraction logic for low-speed grinding. For non-Newtonian fluid stains with large visual phase lag and low damping coefficient, high-frequency small-amplitude reciprocating pulses are used to disrupt the surface tension of the fluid, and then the process is switched to unidirectional high-speed rotation to use centrifugal force to remove the stains. For stains containing high-viscosity media with large visual phase lag and high damping coefficient, a step acceleration command is output to generate instantaneous high shear force to peel off the media, and intermittent forward and reverse rotation is used to prevent re-adhesion.
[0012] Furthermore, this method incorporates closed-loop verification and baseline adaptive update mechanisms. After the cleaning operation is completed, the system reassesses the image sharpness. If cleaning fails but the retry limit is not reached, the control parameters are automatically adjusted to enhance the cleaning intensity; if the retry limit is reached and the image still cannot be cleared, it is determined that the current environment has undergone an irreversible change, the current state is updated to the new environmental baseline, and the dynamic trigger threshold is reset to prevent the system from getting stuck in repeated invalid operations.
[0013] This invention provides a self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition. It has the following beneficial effects: 1. This invention introduces optical flow field analysis logic in the passive monitoring stage, and compares the global motion vector with the local relatively static area. This can effectively distinguish between motion blur caused by rapid probe movement and actual lens dirt. This mechanism avoids false triggering of the cleaning function due to probe shaking during drilling operations. While ensuring detection accuracy, it reduces system power consumption and extends the service life of the flexible cleaning actuator.
[0014] 2. This invention adopts an active detection method that combines micro-vibration excitation with hardware phase synchronization acquisition, which achieves strict phase locking between visual imaging and mechanical vibration, eliminates time jitter error caused by software triggering, and by fusing visual phase hysteresis and mechanical impedance characteristics, the system can analyze the viscosity and stiffness properties of the attached material without adding additional sensors, thus achieving accurate classification of solid crusts, fluids and viscous media.
[0015] 3. This invention employs a differentiated motor control strategy based on stain classification results, applying appropriate mechanical action modes to deposits with different physical properties. This method utilizes constant torque grinding to address hard crusts and centrifugal or shear forces to handle fluids and viscous media. While improving the cleaning success rate, it avoids the risk of physical damage to the lens coating or motor overload caused by using a single high-intensity scraping mode. Attached Figure Description
[0016] Figure 1 This is a flowchart of the framework method of the present invention; Figure 2 This is a system device diagram of the present invention. Detailed Implementation
[0017] The technical solutions in 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.
[0018] See attached document Figure 1 -Appendix Figure 2 This invention discloses a self-cleaning method for borehole inspection camera lenses based on image sharpness recognition, comprising an imaging subsystem, a cleaning execution subsystem, and a central control unit. The imaging subsystem, the cleaning execution subsystem, and the central control unit are connected via an electrical bus and work together.
[0019] I. Imaging Subsystem.
[0020] The imaging subsystem is integrated at the front end of the probe and is configured to acquire images of the aperture wall and provide optomechanical coupling feedback signals.
[0021] Optical Acquisition Module: The optical acquisition module employs a wide-angle optical lens assembly to cover the field of view of the borehole inner wall. The outermost lens surface of the optical lens assembly is deposited with a diamond-like carbon (DLC) reinforced hydrophobic coating. The Mohs hardness setting (e.g., 9) of the DLC reinforced hydrophobic coating is greater than the Mohs hardness setting of the flexible cleaning actuator, preventing the flexible cleaning actuator from scratching the optical lens assembly during contact operations. A ring array of LED supplementary lighting beads is distributed around the optical lens assembly, providing an illumination field that matches the field of view of the optical lens assembly.
[0022] Photoelectric Conversion Unit: The core component of the photoelectric conversion unit is a CMOS image sensor, which connects to the embedded edge computing unit via I2C or SPI bus. The CMOS image sensor has an external hardware trigger pin, which is directly connected to the phase synchronization output of the cleaning execution subsystem via a shielded twisted-pair cable. The CMOS image sensor is configured to initiate exposure upon detecting the rising edge of the phase synchronization pulse signal, ensuring that image acquisition is synchronized with the phase of the mechanical micro-vibration. The CMOS image sensor is configured to support region of interest (ROI) windowing readout mode to improve the sampling frame rate.
[0023] Variable illumination control unit: The variable illumination control unit uses a PWM drive circuit to connect to LED fill light beads. The variable illumination control unit is configured to dynamically adjust the PWM duty cycle according to the proportion of highlight overflow pixels in the image, and limit the area ratio of the highlight area to below a preset threshold (e.g., 1%).
[0024] Embedded Edge Computing Unit: The embedded edge computing unit consists of a field-programmable gate array (FPGA) and a digital signal processor (DSP). The FPGA is configured to receive raw image data via the MIPICSI-2 interface and perform timing alignment; the DSP is configured to run sharpness evaluation algorithms and sparse optical flow tracing algorithms, calculating and outputting the optical flow displacement vector. .
[0025] II. Cleaning Execution Subsystem.
[0026] The cleaning execution subsystem is responsible for executing multi-mode cleaning actions and generating micro-vibration excitation signals.
[0027] Precision drive motor: The precision drive motor is a two-phase hybrid stepper motor, fixed to the probe frame base. The precision drive motor is equipped with a photoelectric encoder and works with a servo drive control unit to achieve micro-step control of at least 128 subdivisions. The basic step angle of the precision drive motor is 1.8 degrees.
[0028] Composite drive assembly: The composite drive assembly includes a rotating ring frame coaxially sleeved around the outer periphery of the optical lens assembly and a helical guide groove formed on the inner wall of the probe. The rotating ring frame is embedded in the helical guide groove via a protruding guide pin. The helix angle of the helical guide groove is set to 30 to 45 degrees, and the axial projected length of the helical guide groove is equal to the effective light transmission height of the optical lens assembly. Through the above mechanical constraints, the composite drive assembly converts the rotational torque of the precision drive motor into a helical feed motion along the axis of the optical lens assembly, enabling the rotating ring frame to cover the entire observation area of the optical lens assembly in a single stroke.
[0029] Flexible cleaning actuator: The flexible cleaning actuator is a ring-shaped scraper made of thermoplastic polyurethane elastomer (TPU), which is interference-fitted to the front end of the rotating ring frame. The Shore hardness of the flexible cleaning actuator is set to 60A to 80A. This hardness range gives the flexible cleaning actuator the shear stiffness to scrape off sticky stains, and is lower than the hardness of the diamond-like carbon reinforced hydrophobic coating.
[0030] Servo drive control unit: The servo drive control unit includes a dual H-bridge drive circuit and a current sampling circuit. The servo drive control unit is configured to switch between a vibration-induced mode and a standard drive mode. In vibration-induced mode, the servo drive control unit injects an alternating excitation current with DC bias into the windings of the precision drive motor, specifically the A-phase current. and B-phase current Follow the modulation formula below:
[0031]
[0032] in To maintain current, To lock the electrical angle, The amplitude of the perturbation. To detect the frequency, the servo drive control unit uses the aforementioned current to drive the rotor to generate micro-amplitude reciprocating torsion without full-step transitions, and outputs a synchronization pulse signal with the same frequency and phase as the alternating excitation current through a hardware port. The current sampling circuit is used to acquire the phase current of the precision drive motor and convert it into a digital signal. .
[0033] III. Central Control Unit.
[0034] The central control unit is the core of the entire borehole inspection camera lens self-cleaning system for computation and scheduling. From a hardware perspective, the central control unit is equipped with a memory and a processor, with the memory and processor electrically connected. The memory can be high-speed random access memory (RAM) or non-volatile memory (such as Flash Memory or EEPROM), and it internally stores a computer program (i.e., the adaptive cleaning control program described below). When the processor executes the computer program, it implements the steps of the method described in this invention.
[0035] Specifically, the central control unit uses a 32-bit industrial-grade microcontroller (MCU) as the main control chip. This microcontroller has a high-precision floating-point unit (FPU) to support optical flow calculation and spectrum analysis. The central control unit establishes bidirectional communication connections with the imaging subsystem and the cleaning execution subsystem through industrial standard buses (such as RS-485 bus or CAN bus).
[0036] At the logic control level, a finite state machine (FSM) program runs internally within the central control unit. The central control unit is configured to receive sharpness evaluation values from the imaging subsystem in real time. ), optical flow displacement vector ( ) and digital feedback signals from the cleaning execution subsystem ( Based on the characteristics of the input data, the processor scheduling system performs deterministic switching between states such as "environmental monitoring", "micro-vibration detection", "graded cleaning" and "closed-loop verification", and sends a drive parameter package containing speed curve planning and torque limit values to the servo drive unit of the cleaning execution subsystem.
[0037] The specific operation process of the intelligent adaptive cleaning method.
[0038] When the computer program stored in memory is executed by the processor, the following logical flow is implemented: Environmental adaptation baseline construction.
[0039] After the system is powered on and initialized, the control unit first enters the baseline calibration mode. In this mode, control commands keep the cleaning execution subsystem mechanically stationary and instruct the imaging subsystem to acquire a continuous sequence of reference images at a preset low frame rate (e.g., 10 fps).
[0040] The processor performs statistical analysis on the reference image sequence, calculates the sharpness evaluation value of each frame, and then calculates the arithmetic mean of sharpness in the current environment. ) and standard deviation ( Based on the statistical results, the processor sets a dynamic trigger threshold according to a formula. In subsequent operations, this dynamic trigger threshold... The value will be dynamically updated as the drilling depth increases (i.e., changes in lighting conditions and rock wall reflectivity) to offset the interference of background environment clarity fluctuations on the detection logic.
[0041] Passive visual monitoring and static mask generation.
[0042] During routine operations, the imaging subsystem acquires and uploads borehole images in real time. The processor calculates the sharpness evaluation value of the current frame image in real time and compares it with a dynamic trigger threshold. Compare them.
[0043] If the real-time clarity evaluation value is lower than The processor does not directly trigger cleaning; instead, it initiates a preliminary screening process based on dense optical flow. The processor calculates the global optical flow vector field of the current frame image, for any pixel in the image. Calculate its optical flow vector And calculate the global average motion vector. .
[0044] The judgment logic is as follows: If (This indicates that the probe is in motion), and simultaneously, there is a connected region in the center of the image. This ensures that all pixels within the region satisfy the following conditions. (Indicating that the region is stationary relative to the lens), then the processor determines that the connected region. This area was identified as a "suspected stain area." The processor then extracted the connected regions. The bounding rectangle coordinates are used to generate the region of interest (ROI) parameters, and the static mask flag is set.
[0045] Optomechanical coupling active detection.
[0046] When the static mask flag is detected to be set, the control unit suspends the regular image transmission task and enters the micro-vibration induced detection mode. The processor sends a micro-vibration excitation command to the cleaning execution subsystem, driving the flexible cleaning actuator to generate a frequency of... The sinusoidal micro-vibration. Simultaneously, based on the generated ROI parameters, the imaging subsystem performs high-frequency localized exposure and readout only on suspected contamination areas.
[0047] In this step, the processor acquires and processes two physical signals in parallel: Optical Dynamic Response: This method utilizes image processing algorithms to track the displacement response of texture feature points within a Region of Interest (ROI) under micro-vibration excitation, and calculates the phase hysteresis angle of the optical response relative to the mechanical excitation signal. .
[0048] Mechanical impedance feedback: Synchronously sample the phase current of the precision drive motor, and extract the DC resistance component through digital signal processing. and AC ripple component .
[0049] Multidimensional feature fusion and decision classification.
[0050] The processor constructs the physical feature vector of the current stain. The vector is then normalized. Subsequently, the normalized feature vector is compared with the preset cluster centers for various stains. Weighted Euclidean distance between :
[0051] in, These are the feature weight coefficients. Represents the feature dimension. The processor compares the distances between the cluster centers. The stain category is determined by the minimum distance. The corresponding categories (fluid type, solid crust type, or viscous medium type).
[0052] Adaptive strategy execution and closed-loop verification.
[0053] The central control unit retrieves the corresponding cleaning execution parameter package (including the target rotation speed) from the memory based on the determined stain type. Torque limit Pulse waveform and duration It then instructs the cleaning execution subsystem to perform physical cleaning actions.
[0054] After the cleaning process is completed, the central control unit requests the imaging subsystem to calculate the sharpness evaluation value again.
[0055] If the new clarity rating is restored to Once the static mask area disappears, the process returns to passive visual monitoring.
[0056] If the new clarity rating is still lower The central control unit determines whether the current number of retries has reached the preset limit. If not, it automatically adjusts the cleaning execution parameters (such as increasing the torque limit). If the limit has been reached, the central control unit performs a baseline update operation, forcibly marking the current environmental image status as the new clean baseline, and recalculating the dynamic trigger threshold accordingly to avoid the system from falling into an infinite loop.
[0057] The finite state machine operating inside the central control unit adopts a deterministic Moore-type state machine architecture. The current state of the state machine is stored in an 8-bit state register STATE_REG. The central control unit periodically executes corresponding control logic based on the value of the STATE_REG register. The finite state machine defines the following six states and their transition conditions: Initialization and calibration state (S_INIT,0x01) After system power-on reset, the status register STATE_REG is set to 0x01 by the hardware reset logic. In the initialization and calibration state, the central control unit performs peripheral driver loading, sensor self-test, and communication bus handshake. The central control unit reads the device ID registers of each sensor and driver chip via the I2C or SPI bus and compares the read IDs with preset values. Simultaneously, the central control unit masks all external interrupts except for the reset interrupt and sends a homing command to the cleaning execution subsystem, driving the flexible cleaning actuator back to the mechanical zero point. When the self-test flag FLAG_SELFTEST_OK is set, and the aforementioned baseline parameters ( After data acquisition and writing, the central control unit updates the status register STATE_REG to 0x02, and the system switches to passive monitoring mode.
[0058] Passive monitoring state (S_MONITOR, 0x02).
[0059] In passive monitoring mode, the central control unit enters a low-power idle mode, enabling only timer interrupts and UART receive interrupts. The central control unit periodically reads the sharpness evaluation values uploaded by the imaging subsystem. At this time, the central control unit pulls the sleep pin of the motor drive chip high, putting the motor drive circuit in a high-impedance state (High-Z).
[0060] Transfer condition A: If the sharpness evaluation value Less than the dynamic trigger threshold And the sliding window counter If an overflow occurs, the central control unit updates the status register STATE_REG to 0x03 and jumps to the active probe state.
[0061] Transfer condition B: If an external manual forced reset command is received, the central control unit will update the status register STATE_REG to 0x01 and jump to the initialization and calibration state.
[0062] Active probe state (S_PROBE, 0x03).
[0063] In active detection mode, the central control unit temporarily disables the Direct Memory Access (DMA) channel responsible for long-distance image transmission and increases the priority of the interrupt vector corresponding to the sensing feedback module to ensure real-time signal processing. The central control unit sends a micro-vibration command to the cleaning execution subsystem and starts a high-precision timer to synchronously trigger the acquisition of the imaging subsystem.
[0064] Transfer condition: When the perception feedback module completes the feature vector transfer... When the calculation is completed and the classification result code is returned, the central control unit updates the status register STATE_REG to 0x04 and jumps to the decision execution state. If within the preset time window... If no feedback is received within 200ms (e.g.), the central control unit triggers the timeout error handling logic and jumps to the abnormal trap state.
[0065] Decision execution state (S_ACTION, 0x04).
[0066] In the decision-making execution state, the central control unit retrieves the motor drive parameter package by looking up the classification result code in a table, and then starts the PWM generator to output the control waveform. The central control unit monitors the motor phase current feedback value in real time through the ADC channel. .
[0067] Transfer condition A: When the set action duration When the count ends or pulse counting is complete, the central control unit updates the status register STATE_REG to 0x05 and jumps to the verification and update state.
[0068] Transfer condition B: If the phase current feedback value is detected during execution. Exceeding the hardware security threshold The central control unit immediately triggers an overcurrent interrupt, shuts down the PWM output, updates the status register STATE_REG to 0x06, and forcibly jumps to the abnormal trap state.
[0069] Verification and update state (S_VERIFY, 0x05).
[0070] In the verification and update state, the central control unit requests the imaging subsystem to upload new sharpness evaluation values. .
[0071] Transition condition A: If This indicates successful cleaning; the central control unit clears the retry counter. Update the status register STATE_REG to 0x02 and return to passive monitoring state.
[0072] Transition condition B: If And retry counter Less than the maximum number of retries The central control unit updates the status register STATE_REG to 0x04 and re-enters the decision execution state.
[0073] Transfer condition C: If And retry counter Greater than or equal to the maximum number of retries The central control unit executes the baseline update algorithm, then updates the status register STATE_REG to 0x02 and returns to the passive monitoring state.
[0074] Exception trap state (S_TRAP, 0x06).
[0075] The anomaly trap state is used to handle system-level faults. In the anomaly trap state, the central control unit executes a safety shutdown sequence: pulls low the enable pin of the motor drive chip to cut off the motor power supply, writes the current fault code to the EEPROM log area, and sends an alarm frame to the ground host via the communication bus.
[0076] Transfer condition: The system remains in the abnormal trap state until it receives a hardware reset signal or an external "fault clearing" instruction. At this time, the status register STATE_REG is reset to 0x01.
[0077] The baseline calibration process is performed by an embedded edge computing unit and includes the following sub-steps: Sample acquisition under motion state constraints.
[0078] The embedded edge computing unit continuously reads the raw triaxial angular velocity data output from the microelectromechanical system (MEMS) inertial measurement unit (IMU) inside the probe via I2C or SPI interface. The embedded edge computing unit processes the raw triaxial angular velocity data. A moving average filter is applied to remove high-frequency measurement noise, resulting in a smoothed angular velocity vector. Embedded edge computing units calculate angular velocity vectors. The magnitude of the angular velocity vector, and the angular velocity vector The modulus value and the preset motion-rest threshold (For example (Compare)
[0079] If and only if the angular velocity vector The modulus is less than the motion-rest threshold. At that time, the embedded edge computing unit sends an acquisition command to the imaging subsystem to obtain the current frame image as a valid reference sample. Using inertial data as the trigger condition avoids acquiring images during probe movement or shaking, thus preventing low baseline evaluation values due to motion blur and ensuring that the baseline data accurately reflects the static transfer characteristics of the optical system. The embedded edge computing unit repeats the above judgment and acquisition process until the buffer queue is full. Frames (e.g.) ) Valid reference sample.
[0080] A clear metric based on thresholded gradient energy.
[0081] The embedded edge computing unit reads each frame of reference samples from the buffer queue. , reference sample The image is converted to grayscale, and a sharpness evaluation value is calculated using the improved Tenengrad gradient energy function. For any coordinate in the image... For each pixel, the embedded edge computing unit uses the Sobel operator to calculate the horizontal gradient. and vertical gradient :
[0082]
[0083] in This represents a two-dimensional convolution operation.
[0084] The embedded edge computing unit calculates the square of the gradient magnitude of each pixel. To suppress the impact of image sensor thermal noise on sharpness evaluation, the embedded edge computing unit introduces a gradient threshold. Only when Only then are the gradient magnitudes of individual pixels included in the total energy. Sharpness rating value. The calculation formula is as follows:
[0085] in These are the height and width of the image, respectively. For the step decision function: if The function value is 1 if it is true, otherwise it is 0.
[0086] Validity verification based on information entropy.
[0087] Embedded edge computing units calculate the one-dimensional information entropy of the average image of the reference sample sequence. This is to verify whether the current lighting environment meets the calibration conditions.
[0088]
[0089] in grayscale The probability density of occurrence in the image histogram.
[0090] Embedded edge computing units will increase information entropy Compared with the preset minimum texture entropy threshold Compare them. If information entropy... Less than the minimum texture entropy threshold This indicates that the current field of view is overexposed, completely dark, or facing a flat, solid-color area lacking texture features. In this case, the embedded edge computing unit terminates the calibration process and outputs an environmental error code to prevent the establishment of an invalid baseline model.
[0091] Statistical distribution modeling and parameter locking.
[0092] If the validity verification passes, the embedded edge computing unit calculates according to the following formula. Frame reference sample sharpness evaluation value sequence arithmetic mean and standard deviation :
[0093]
[0094] Embedded edge computing units will calculate the arithmetic mean. and standard deviation Write to non-volatile memory to lock the baseline parameters. Arithmetic mean. The standard deviation represents the expected ideal imaging sharpness under the current borehole wall geological conditions. This characterizes the permissible fluctuation range caused by system noise. Subsequent pollution detection thresholds will be strictly constructed based on these two statistical parameters to achieve adaptive adaptation to different geological texture environments.
[0095] The spatiotemporal difference algorithm runs in the DSP core of the embedded edge computing unit and includes the following specific steps: Global motion verification based on pyramid optical flow.
[0096] Embedded edge computing unit reads the current frame image And the previous frame image and the current frame image And the previous frame image implement Gaussian kernel smoothing is applied to suppress high-frequency noise. Embedded edge computing units are used in the previous frame image. Extract 300 to 500 FAST corner features (set to 300 to 500).
[0097] Embedded edge computing units construct a three-layer Gaussian pyramid, and the Lucas-Kanade sparse optical flow algorithm is used to track this... Feature points in the current frame image The position in the middle is used to obtain the set of displacement vectors of feature points. The embedded edge computing unit uses the RANSAC (Random Sample Consensus) algorithm to iteratively calculate the global average motion vector. :
[0098] in This is the set of feature point indices that are identified as interior points by the RANSAC algorithm.
[0099] Embedded edge computing units will average the global motion vector. The modulus and the preset minimum motion threshold (Set to 5.0 pixels) for comparison. If The embedded edge computing unit determines that the probe is in a relatively static state, directly outputs an empty ROI and exits the current algorithm loop, avoiding false positives caused by static background textures.
[0100] Pixel-level temporal variance analysis.
[0101] When the probe is determined to be in motion, the embedded edge computing unit establishes a length of... A circular image buffer (set to 5 to 10 frames). For each pixel in the image coordinate system. The embedded edge computing unit extracts the grayscale sequence of pixels in the buffer and calculates the temporal variance of the sequence. :
[0102] in This represents the average grayscale value of a pixel within a time window. Since lens smudges are absolutely stationary relative to the imaging sensor coordinate system, the time-domain variance... Theoretically, it is only affected by sensor readout noise (the value is low); however, the background texture of the aperture wall shifts with the movement of the probe, causing drastic fluctuations in the grayscale value projected onto the same pixel (temporal variance). (The value is relatively high).
[0103] Adaptive threshold segmentation and morphological filtering.
[0104] To adapt to noise levels under different illumination conditions, the embedded edge computing unit first calculates the mean of the temporal variance of the entire image. Embedded edge computing units set adaptive segmentation thresholds. ,in This is the sensitivity coefficient (set to 0.1 to 0.3).
[0105] Embedded edge computing units based on adaptive segmentation thresholds Generate a binary static mask :
[0106] at this time, The high-level areas in the image represent suspected stains.
[0107] Embedded edge computing units utilize rectangular structural elements For static masks Perform morphological opening operation (erosion followed by dilation):
[0108] This step is used to remove isolated tiny spots caused by sensor thermal noise, while also breaking up narrow, adhesive areas.
[0109] Connectivity component labeling is integrated with ROI.
[0110] Embedded edge computing unit on the processed mask The 8-neighborhood connected component labeling algorithm is used to extract several independent connected regions. The embedded edge computing unit calculates the pixel area of each connected region and discards those with areas smaller than [a certain value]. (e.g., a 50-pixel area).
[0111] For the remaining valid connected regions, the embedded edge computing unit calculates the bounding rectangle of each region. The embedded edge computing unit calculates the minimum bounding box containing all valid bounding rectangles, and expands outward from this bounding box. A boundary margin of 10 pixels (e.g., 10 pixels) is used to generate the final region of interest (ROI) coordinate parameters. The ROI parameters are written to the shared memory area for subsequent use by the active probing module.
[0112] The artifact separation logic operates within the perception feedback module and specifically includes the following steps: Full-cycle synchronous micro-vibration sampling.
[0113] The central control unit sends messages to the cleaning execution subsystem at a frequency of [frequency missing]. A sinusoidal micro-vibration excitation signal (set to 100Hz to 200Hz) drives the flexible cleaning actuator to generate micron-level vibrations. Simultaneously, the central control unit triggers the imaging subsystem to perform sequential data acquisition via a hardware interrupt pin. The imaging subsystem configures the sensor readout mode to region of interest (ROI) windowing mode and operates at a sampling frequency... Continuous data acquisition Frame image. To prevent spectral leakage during the Discrete Fourier Transform (DFT) process, the number of frames acquired is limited. The integer period sampling constraint must be met: ,in positive integers (e.g.) This ensures that the sampling time window covers at least 5 complete mechanical vibration cycles.
[0114] Construction of relative motion vector field.
[0115] The perception feedback module processes the acquired image sequences. Gaussian smoothing is performed for noise reduction. The perception feedback module uses the Gunnar Farneback dense optical flow algorithm to calculate the density of each pixel within the ROI region. Instantaneous displacement vector between adjacent frames The cumulative displacement vector is obtained by time integration. .
[0116] To eliminate common-mode motion components introduced by overall probe jitter or lens focusing assembly shake, the perception feedback module selects the background area surrounding the ROI boundary as the reference area. The perception feedback module calculates the median of the displacement vectors of all pixels within the reference area as the baseline motion vector. The perception feedback module calculates the relative displacement sequence of each pixel. :
[0117] The median statistical method can effectively suppress the reference drift caused by individual noise points or abrupt changes in local rock wall texture within the reference area.
[0118] Amplitude response extraction at a specific frequency.
[0119] The sensing feedback module provides feedback on the relative displacement sequence. Perform a Discrete Fourier Transform (DFT) on the magnitude sequence, calculating only the values at the excitation frequency. The spectral energy at that location. The sensing feedback module extracts the real part of the frequency response through orthogonal demodulation. and imaginary part response :
[0120]
[0121] The sensing feedback module calculates the vibration amplitude response of each pixel at the excitation frequency. :
[0122] Defect removal based on differences in physical impedance.
[0123] The sensing feedback module traverses the ROI region and responds according to the vibration amplitude. Binary classification of pixel attributes: For rigid optical defects such as lens scratches, coating peeling, or dead pixels, since these defects are physically fixed to the lens glass substrate, they cannot produce independent displacement relative to the lens, resulting in vibration amplitude response. Approaching zero (i.e.) ,in (This is the system noise floor threshold).
[0124] For flexible stains such as mud, water droplets, or oil, due to their mass and viscoelasticity, they will undergo relative deformation or displacement lags behind the excitation signal under the action of micro-vibration inertial force, resulting in a vibration amplitude response. Significantly higher than the system noise floor (i.e. ).
[0125] The perception feedback module generates an effective clean target mask based on the above physical criteria. :
[0126] The perception feedback module only uses the mask The coordinates of the area marked as 1 are sent to the subsequent cleaning strategy unit, thereby automatically filtering out rigid optical defects that do not need to be cleaned and cannot be removed, preventing the system from performing ineffective and repeated cleaning operations on scratches.
[0127] The micro-vibration excitation model is executed by a motor control unit integrated within the embedded edge computing unit. It aims to generate controllable, high-frequency micro-vibrations by driving the brushless motor of the cleaning execution subsystem through field-oriented control (FOC). The micro-vibration excitation model includes the following specific steps: Current command synthesis based on electronic spring stiffness.
[0128] The motor control unit uses direct digital frequency synthesis (DDS) technology to construct the quadrature axis (q-axis) current command. To lock the rotor position and superimpose vibrations without using mechanical brakes, the motor control unit synthesizes a composite signal containing both DC bias and AC excitation:
[0129] in, The stiffness-maintaining current is used to establish a constant positioning magnetic field in the air gap of the motor, so that the motor rotor behaves as if it is pulled by an "electronic spring" with specific torsional stiffness, thereby overcoming the static friction of the transmission mechanism and maintaining the mechanical zero point. This represents the amplitude of the micro-vibration excitation. The detection frequency is set to 100Hz to 500Hz. Simultaneously, the motor control unit sends a direct-axis (d-axis) current command. Set to 0 to maintain the maximum electromagnetic torque generated per unit current.
[0130] Vector modulation drive with dead zone compensation.
[0131] The motor control unit uses a space vector pulse width modulation (SVPWM) algorithm to transmit current commands. and This is mapped to the switching duty cycle of a three-phase full-bridge inverter circuit. The motor control unit inserts a dead time when generating the complementary PWM signal. (For example, 1.5μs), and enable the dead-time effect compensation algorithm to eliminate the distortion effect of dead time on the zero-crossing point of the small current waveform, ensuring the sinusoidal nature of the micro-vibration waveform. The power drive circuit drives the motor rotor to generate a micro-arc-level reciprocating torsion near the equilibrium position according to the PWM signal.
[0132] Observation of dynamic parameters without sensors.
[0133] Under low vibration conditions, the motor-soil coupling system follows the second-order mechanical dynamics equations:
[0134] in These represent the system's total moment of inertia, total viscous damping coefficient, and total elastic stiffness coefficient, respectively. Due to the extremely small amplitude of the micro-vibrations (less than the resolution of a Hall sensor), the motor control unit operates a high-bandwidth sliding mode observer (SMO) based on back electromotive force. The motor control unit acquires stator phase currents and bus voltages, and uses the sliding mode observer to estimate the rotor's instantaneous angular velocity in real time. and rotor mechanical angle It does not rely on physical location sensors.
[0135] Differential complex impedance calculation and property identification.
[0136] The motor control unit controls the electromagnetic torque. and estimated angular velocity Perform a Fast Fourier Transform (FFT) to extract the excitation frequency. Total mechanical complex impedance at the point :
[0137] To isolate the load impedance caused solely by dirt, the motor control unit reads a pre-stored reference motor no-load impedance. And calculate the load difference impedance. :
[0138] The real part The imaginary part of the viscosity damping increment characterizing the stain Characterizes the increase in contact stiffness of the stain.
[0139] Motor control unit based on and Numerical features are used to identify the physical properties of stains: like and The motor control unit determines that the deposited substance is sludge or viscous fluid; if and The motor control unit determines that the deposits are dry crusts or hard carbon deposits; if and The motor control unit determines that there is no adhering material or only slight floating dust. The above physical property determination results are sent to the central decision module for automatically matching a cleaning strategy of high-pressure water rinsing (for sticky materials) or mechanical scraping (for hard materials).
[0140] The high-frequency ROI synchronous acquisition logic is executed collaboratively by the imaging subsystem and the embedded edge computing unit, and specifically includes the following steps: Sensor window address mapping and alignment verification.
[0141] The embedded edge computing unit sends ROI configuration commands to the CMOS image sensor via the I2C or SCCB configuration bus. To meet the byte alignment requirements of the internal column readout circuitry of the CMOS image sensor, the embedded edge computing unit adjusts the horizontal starting coordinates. and width Perform step size verification, round down to an integer multiple of the minimum step size specified by the sensor hardware (e.g., 4 pixels), and generate a corrected register configuration value.
[0142] The embedded edge computing unit writes the corrected coordinate values into the row and column addressing registers of the CMOS image sensor, locking the effective readout area of the photosensitive array. At this point, the equivalent frame rate of the imaging subsystem... Determined by the number of vertical rows:
[0143] in, For single-line readout cycles, This refers to the number of vertical blanking lines. By reading only a few dozen rows of pixels containing the smudged area, the imaging subsystem concentrates the data transmission bandwidth on the effective information area, thus achieving an equivalent frame rate. The frequency was increased to over 200Hz to meet the frequency requirements for oversampling micro-vibration processes.
[0144] External frame synchronization triggering based on phase locking.
[0145] The central control unit generates a micro-vibration drive sine wave signal. Simultaneously, the phase angle of the driving sine wave signal is monitored in real time. When the phase of the driving sine wave signal reaches the preset trigger phase point... (For example At the moment of zero (i.e., when the zero point is reached), the central control unit outputs a high-precision frame synchronization pulse signal (FSIN) through the GPIO pin.
[0146] The CMOS image sensor is configured in external trigger slave mode. When the FSIN pin of the CMOS image sensor detects the rising edge of the frame synchronization pulse signal, it immediately resets the pixel charge integration circuit and opens the electronic shutter. This phase-based hardware triggering mechanism ensures that the exposure center moment of each frame strictly corresponds to a specific phase point of the micro-vibration period, eliminating random time jitter caused by software triggering and providing an accurate time-domain reference for subsequent frequency domain analysis based on the lock-in amplification principle.
[0147] Dynamic blur suppression and gain compensation.
[0148] Before entering the micro-vibration acquisition mode, the embedded edge computing unit forcibly disables the automatic exposure (AEC) and automatic white balance (AWB) algorithms of the CMOS image sensor, and locks the analog and digital gains to fixed values to ensure the consistency of grayscale values in the image sequence. The embedded edge computing unit then adjusts the acquisition based on the micro-vibration frequency. and physical amplitude Calculate the maximum exposure time under motion blur constraints :
[0149] in The maximum allowable motion blur threshold (e.g., 0.5 pixels) is set. The embedded edge computing unit sets the sensor's exposure time register to less than or equal to... The value of . To compensate for the decrease in image brightness caused by short exposure, the embedded edge computing unit synchronously increases the gain value of the variable gain amplifier (VGA) of the analog front end (AFE) to ensure that the image histogram distribution is in the linear response region.
[0150] DMA double-buffered pipelined transfer.
[0151] The CMOS image sensor outputs RAW format image data streams via the MIPICSI-2 high-speed differential interface. The embedded edge computing unit is configured with a direct memory access (DMA) controller to create two frame buffers, Buffer_A and Buffer_B, of equal capacity in system memory and initiates ping-pong buffered transfer mode.
[0152] The DMA controller writes the first frame of image data into Buffer_A. When the write is complete and a transmission completion interrupt is triggered, the DMA controller automatically switches the target address to Buffer_B to continue receiving the next frame of data, while simultaneously notifying the digital signal processing (DSP) core to begin processing the data in Buffer_A. The DSP core completes the optical flow calculation of the data in Buffer_A before Buffer_B becomes full, and this process repeats. This pipeline mechanism enables the parallel execution of image acquisition and algorithm processing tasks, ensuring continuous throughput of high frame rate data streams and preventing data overflow or frame loss due to processing delays.
[0153] The optical flow tracing logic runs within the DSP core of the embedded edge computing unit and is used to solve two consecutive frames of high-frequency ROI images. (Reference frame) and Dense displacement fields between (current frames). The logic employs the Gunnar Farneback algorithm, which includes the following specific steps: Calculation of convolution of polynomial expansion coefficients.
[0154] Embedded edge computing units will use images and It is considered a two-dimensional signal field. For each pixel in the image coordinate system... The embedded edge computing unit uses a local quadratic polynomial to fit the grayscale surface in the neighborhood:
[0155] in, for Symmetric coefficient matrix for coefficient vector It is a constant scalar.
[0156] To obtain the coefficients at each pixel in each frame of the image The embedded edge computing unit employs a one-dimensional discrete Gaussian smoothing filter (kernel size...). ,For example , The image is convolved in both the horizontal and vertical directions. The embedded edge computing unit calculates the local zeroth, first, and second moments of the image using specific confidence-weighted convolution kernels, thereby constructing... coefficient set and coefficient set .
[0157] Construction of displacement constraint equations.
[0158] Based on the principle of grayscale structure conservation, if pixel points Displacement Then the new image The local polynomial coefficients should be consistent with those of the original image. The coefficients are matched. The embedded edge computing unit defines intermediate variables to linearize the solution process:
[0159]
[0160] in This is the displacement estimate for the current iteration step. Ideal displacement vector. Satisfies a linear relationship:
[0161] Neighborhood weighted integral solution and singularity detection.
[0162] To address the single-point aperture issue and suppress noise, the embedded edge computing unit processes pixels... The neighborhood centered Perform weighted integration to construct a system of linear equations. :
[0163]
[0164] in This is the spatial integral weighting function.
[0165] Embedded edge computing units solve displacement vectors First, calculate the system matrix. determinant Embedded edge computing units will Compared with the preset singularity threshold Compare. If This indicates that the texture of a local area is missing or is in a flat area. The embedded edge computing unit forces the displacement vector of the point to be... Set to zero to avoid computational divergence caused by matrix non-invertibility or excessively large condition numbers; if Then, the solution is obtained using Cramer's Rule. .
[0166] Multiple iterations based on bilinear interpolation.
[0167] To handle large displacements and improve accuracy, the embedded edge computing unit performs multiple rounds of iterative correction. Before each iteration, the embedded edge computing unit calculates the displacement field based on the previous round's result. Reference image Perform a backward transformation (warping). Due to the displacement field Including floating-point components, the embedded edge computing unit uses bilinear interpolation to calculate grayscale values at non-integer coordinates, generating a resampled image. .
[0168] Embedded edge computing units utilize resampled images and the current frame The residual displacement field is recalculated and added to the total displacement field. After 3 to 5 iterations, the embedded edge computing unit outputs the final dense optical flow field. The optical flow field accurately characterizes the instantaneous motion state of all pixels within the ROI region under micro-vibration excitation.
[0169] The phase lag analysis logic operates within the digital signal processing (DSP) core of the sensing feedback module, and specifically includes the following steps: Digital orthogonal reference sequence generation.
[0170] The sensing feedback module reads the micro-vibration excitation frequency. and image acquisition frame rate The perception feedback module generates two data points with a length of [length missing] in its internal memory. Discrete orthogonal reference sequences: In-phase reference sequences and orthogonal reference sequence .
[0171]
[0172]
[0173] in For frame index ( To eliminate the Gibbs phenomenon and ensure the accuracy of orthogonal demodulation, the sequence length... Set to satisfy The minimum value of (integer) ensures that the sampling window covers an integer number of vibration cycles.
[0174] Main axis projection and multiply-accumulate demodulation.
[0175] The sensing feedback module reads the dense displacement vector field. The sensing feedback module calls upon the pre-stored unit vector of the main vibration direction based on the mechanical design parameters of the cleaning actuator. (For example (Representing horizontal vibration). The sensing feedback module calculates the scalar projection of the displacement vector onto the principal vibration direction. :
[0176] The sensing feedback module performs a multiply-accumulate (MAC) operation on the scalar projection sequence to calculate the in-phase components. and orthogonal components :
[0177]
[0178] Absolute phase lag solution.
[0179] The perception feedback module calculates the observed phase angle of each pixel relative to the excitation signal. and subtract the inherent system latency. To obtain the true material phase hysteresis :
[0180] in, These are pre-calibrated system parameters. The acquisition method is as follows: During the factory calibration phase, the control system performs micro-vibration tests on a rigid standard component (without viscous loss and theoretical hysteresis of 0), and stores the measured phase delay value as... This is used to compensate for fixed phase shifts caused by circuit transmission delays and mechanical transmission gaps. The sensing feedback module stores the calculation results into the phase distribution matrix. .
[0181] Stain rheological classification based on loss factor.
[0182] The perception feedback module traverses the phase distribution matrix Based on the magnitude of the phase lag angle (characterizing the tangent of the material loss angle) Logical determination of stain properties: like (set up The sensing feedback module determines that the deposit at the location is a high-stiffness, low-damping solid crust (such as dried carbon deposits or rock powder scale). Such substances approximate an elastic body, and their motion is essentially in phase with the excitation signal. The sensing feedback module marks the area as a "grinding-type cleaning target" and adds it to the stain attribute matrix. The value assigned to it is Type_A.
[0183] like (set up The sensing feedback module determines that the deposited material at the location is a high-viscosity, high-damping fluid or semi-fluid (such as sludge or water droplets). Due to internal friction, the movement of such substances significantly lags behind the excitation signal. The sensing feedback module marks the area as a "flushing-type cleaning target" and adds it to the stain attribute matrix. The value assigned to it is Type_B.
[0184] The perception feedback module will generate a stain attribute matrix The data is sent to the central control unit, which then selects the corresponding cleaning action (Type_A corresponds to high-frequency vibration of the mechanical scraper, and Type_B corresponds to pulse jet of the fluid nozzle).
[0185] The triboelectric impedance spectroscopy analysis logic, executed by the motor control unit, is used to quantify the contact interface characteristics between the cleaning actuator and the lens surface. The logic specifically includes the following steps: Linear sweep frequency excitation under orthogonal decoupling.
[0186] While maintaining the position loop closed state, the motor control unit generates a chirp current command with a frequency that increases linearly with time. :
[0187] in, The sweep frequency amplitude is set to 5% to 10% of the motor's rated current to ensure that the generated torque disturbance is sufficient to overcome the static friction dead zone without disrupting the position lock. to The scanning frequency band is set to 10Hz to 1000Hz.
[0188] The motor control unit will Superimposed on the quadrature axis (q-axis) current control loop, while simultaneously applying the direct axis (d-axis) current command. The value is forcibly locked to 0 to ensure that the injected disturbance energy is completely converted into tangential electromagnetic torque, eliminating the coupling interference of reluctance torque.
[0189] Frequency response function estimation based on cross-power spectrum.
[0190] The motor control unit synchronously collects the actual phase current of the motor within the sampling period. and rotor angular velocity To suppress spectral leakage caused by non-integer cycle sampling, the motor control unit first... and The sequence is weighted using a Hanning window.
[0191] Subsequently, the motor control unit performs a Fast Fourier Transform (FFT) on the weighted signal to calculate the current spectrum. and velocity spectrum To improve the signal-to-noise ratio, the motor control unit utilizes cross-power spectral density. and self-power spectral density Calculate the mechanical admittance frequency response function of the system (Using the H1 estimation algorithm):
[0192] in The cross-power spectrum of current and velocity. This is the self-power spectrum of the current. This represents the torque coefficient. The H1 estimation algorithm effectively eliminates the interference of measurement noise on the admittance amplitude, ensuring measurement accuracy under weak vibration signals.
[0193] Resonance mode parameter identification.
[0194] The motor control unit has a mechanical admittance spectrum modulus. The maximum peak value within a preset frequency band (e.g., near the system's first-order natural frequency) is searched to determine the resonant frequency. .
[0195] The motor control unit calculates the quality factor of the resonant mode based on the half-power bandwidth method. :
[0196] in and These represent the decrease in resonance peak amplitude to peak value. The frequency point at times (i.e., -3dB bandwidth).
[0197] Cleanliness determination based on damped dissipation logic.
[0198] The motor control unit determines the cleanliness level based on the influence of viscous damping on the mechanical resonance quality factor. When oil or mud is present on the lens surface, the contaminants introduce an additional equivalent viscous damping coefficient at the contact interface. This leads to an increase in the system's mechanical energy dissipation, resulting in a decrease in the measured quality factor. Significantly lower than the baseline value under clean conditions .
[0199] The motor control unit executes the following threshold comparison logic:
[0200] in This refers to the clean and dry surface quality factor measured during the system's factory calibration phase. This is a tolerance factor (e.g., 0.1). If the result is RESIDUAL_STAIN, the motor control unit triggers a new round of cleaning actions; if the result is CLEAN_COMPLETE, the cleaning task ends and the actuator retracts.
[0201] The feature mapping procedure, executed by the embedded edge computing unit, is used to convert heterogeneous physical sensing data into control parameters for actuators. The feature mapping procedure specifically includes the following steps: Physical feature extraction and Z-Score normalization.
[0202] The embedded edge computing unit reads three dimensions of physical characteristic data from the sensing feedback module: material loss angle and phase. (From phase lag analysis), mechanical resonance quality factor (From triboelectric impedance spectroscopy analysis) and average optical flow velocity scalar .
[0203] Among them, the average optical flow velocity scalar Dense optical flow displacement field output from the preceding steps The calculation shows that:
[0204] in For image acquisition frame rate, This represents the total number of pixels in the ROI region. The magnitude of the pixel displacement vector.
[0205] To standardize the dimensions of different physical quantities, the embedded edge computing unit utilizes factory calibration parameters (mean values) pre-stored in non-volatile memory. and standard deviation The original data is Z-score standardized to construct a three-dimensional feature input vector. :
[0206] High-dimensional spatial projection based on RBF kernel.
[0207] To address the issue that the physical properties of stains are inseparable in a low-dimensional linear space, the embedded edge computing unit introduces a radial basis function (RBF) as a kernel function. , input feature vector Implicit mapping to a high-dimensional Hilbert space. For each pre-trained support vector... The embedded edge computing unit calculates the kernel function value:
[0208] in For kernel width parameter, These are the support vector centers extracted during the training phase.
[0209] Decision based on the highest score across multiple categories.
[0210] The embedded edge computing unit employs a "one-vs-rest" strategy for multi-class classification. For the preset... Types of stains ( The embedded edge computing units calculate the linear discriminant score function corresponding to each category. :
[0211] in , and The first Each classifier corresponds to a Lagrange multiplier, label symbol, and bias term.
[0212] The embedded edge computing unit compares the score function values of all categories to determine the category to which the current stain belongs. :
[0213] The preset stain categories include: Type I (Viscous Fluid): Characterized by high viscosity ,Low ; Type II (hard crust): Characterized by low... ,high ,Low ; Type III (Loose Dust): Characterized by low... ,high ,high .
[0214] Look-up table for control parameters and gain correction.
[0215] The embedded edge computing unit determines the outcome based on the judgment result. Retrieve the baseline control vector from the parameter lookup table. Simultaneously, the embedded edge computing unit calculates the feature vector magnitude. As a gain coefficient for pollution level, the final control command is generated. :
[0216] in The fluid injection pressure, For mechanical scraping speed, This refers to the number of cleaning cycles; To adjust the gain for intensity, This is the effective threshold. Using the above formula, the embedded edge computing unit, based on determining the cleaning mode (such as high-pressure washing or mechanical grinding), further considers the "stubbornness" of the stain (as determined by...). (Quantitative) Dynamic fine-tuning of work intensity to achieve refined control.
[0217] The graded cleaning control program is stored in the non-volatile memory of the central control unit and is executed collaboratively by the motor drive circuit and the fluid pump drive circuit. The graded cleaning control program determines the type of stain based on the output of the previous steps. Based on the control parameter vector, the corresponding subroutine is called to perform multimodal driving of the cleaning actuator. The specific steps are as follows: Fluid shear cleaning control.
[0218] When the stain is determined to be Type III (loose dust), the central control unit executes a fluid shearing subroutine. The central control unit first sends a position control command to the cleaning motor, using a position loop to drive the cleaning actuator to rotate to a preset stopping angle. (For example, dead zones outside the field of view) ensure that the surface of the optical window is free from mechanical obstruction.
[0219] Subsequently, the central control unit outputs a high duty cycle (e.g., 90% to 100%) PWM modulation signal to the H-bridge drive circuit of the fluid pump, driving the fluid pump to operate at full speed. The central control unit adjusts the speed of the fluid pump to control the fluid flow rate at the nozzle outlet. Satisfying the turbulence condition:
[0220] in The density of the cleaning fluid, For dynamic viscosity, The characteristic length of the jet. The critical Reynolds number is set at 4000. During this process, the central control unit keeps the cleaning motor in a high-impedance open-circuit state (High-Z) or a position-locked state, using only the momentum exchange of the high Reynolds number fluid to peel off particles adhering to the surface.
[0221] Pulse shock and centrifugal dehydration control.
[0222] When the stain is determined to be Type I (viscous fluid), the central control unit executes a pulse cleaning and centrifugal dehydration sequence.
[0223] The central control unit first applies low-frequency pulse width modulation to the fluid pump. The central control unit uses frequency... (5Hz to 10Hz) Switching the on / off state of the fluid pump drive voltage generates periodic high-frequency pressure fluctuations in the delivery pipeline. :
[0224] in For pulse period, The duty cycle is used. This rapidly alternating fluid pressure acts on the surface of a non-Newtonian fluid-like stain, utilizing the shear-thinning effect to reduce the apparent viscosity of the stain.
[0225] After spraying is completed, the central control unit immediately switches the motor control mode to the speed loop, driving the cleaning actuator and the entire optical lens structure to rotate at high speed. The central control unit sets the rotational angular velocity. This makes the generated centrifugal force sufficient to overcome the surface tension of the liquid.
[0226] in The volume of the residual droplet. Radius of gyration The surface tension coefficient of the liquid. This refers to the contact line length. Through high-speed rotation, the central control unit tangentially ejects the emulsified oil-water mixture from the lens surface, preventing water stains left by natural drying from affecting image quality.
[0227] Constant torque closed-loop grinding control.
[0228] When the stain is determined to be Type II (hard crust), the central control unit switches the motor control strategy to torque loop mode under field-oriented control (FOC).
[0229] The central control unit drives the cleaning actuator (such as a brush head containing abrasive media) to contact the optical surface and reciprocate at a low speed. The central control unit collects real-time data from the motor. shaft current (Torque current component), and compared with the target torque current. By comparing the voltage vector dynamically adjusted through a PI regulator, the output electromagnetic torque is maintained. Constant:
[0230] in For extreme logarithms, It is a permanent magnet flux chain. The preset torque value is sufficient to destroy the shell structure.
[0231] At the same time, the central control unit executes anti-jamming monitoring logic: if within the monitoring time window The motor speed was detected within 200ms (for example). It remains at zero, and shaft current Continuously reaching the maximum amplitude value If this occurs, it is determined to be a "mechanical jam". At this time, the central control unit immediately terminates the current command and controls the motor to rotate in the opposite direction by a preset angle. Then, try to cut into the scraping area again, using the reciprocating alternating shear force to fatigue and destroy the adhesion point of the hard stain.
[0232] Serial combinational control based on state machines.
[0233] For the mixed-type stain determination result output by the feature mapping program, the central control unit executes cleaning actions according to a predefined state machine sequence: first, it enters the fluid shear cleaning control step to remove surface dust; then, it enters the constant torque closed-loop grinding control step to treat the underlying crust; finally, it enters the pulse impact and centrifugal dehydration control step for final cleaning and dehydration. After each sub-step is completed, the central control unit calls the aforementioned "triboelectric impedance spectrum analysis" program again to read the real-time quality factor. .like Cleanliness has been restored to the baseline value. The central control unit will skip subsequent steps and reset directly, thereby minimizing cleaning media consumption and system downtime.
[0234] The closed-loop validation procedure is executed by the central control unit and is used to determine the surface cleanliness and generate a compensation strategy after a single cleaning operation. The closed-loop validation procedure specifically includes the following steps: Visual residual calculation based on gradient energy.
[0235] After the cleaning action is terminated and the actuator is reset, the central control unit controls the image sensor to acquire the post-image of the optical surface. To detect the presence of residual oil films or particles on the surface that could cause image blurring, the central control unit calculates the average gradient energy of the resulting image within the region of interest (ROI). .
[0236] The central control unit uses the Sobel operator to calculate the horizontal gradient of each pixel. and the gradient in the vertical direction And calculate the normalized sum of squared gradients:
[0237] in This represents the total number of pixels in the ROI region.
[0238] The central control unit reads the preset cleanroom baseline energy value. (This value is obtained by calibrating the system against a standard test card under factory clean conditions, or by taking the gradient energy value of the highest-resolution frame from historical operation records.) The central control unit calculates the visual residual coefficient. :
[0239] like This indicates that the edge sharpness of the current image is lower than the baseline state, resulting in visual blurring.
[0240] Secondary identification of mechanical damping residuals.
[0241] While acquiring images, the central control unit again invokes the aforementioned "triboelectric impedance spectrum analysis" subroutine. The central control unit then injects a short-time linear frequency sweep current into the motor to re-identify the current mechanical resonance quality factor. .
[0242] The central control unit will Reference quality factor under clean conditions Compare and calculate the mechanical damping residual coefficient. :
[0243] Because residual viscous fluid or soft stains increase the system's equivalent viscous damping coefficient, leading to a broadening of the resonance peak and a decrease in the quality factor, therefore... The value directly reflects the physical magnitude of the sticky residue on the contact interface.
[0244] Multimodal fusion error decision.
[0245] The central control unit constructs a weighted fusion error function. To comprehensively evaluate the cleaning effect:
[0246] in and The preset weighting coefficients (satisfying) ), Let's define the unit step function. Introducing the unit step function. Its function is to filter out (i.e., the current state is better than the baseline value) to prevent the system from making incorrect compensation actions due to overfitting.
[0247] The central control unit will With convergence threshold (For example, 0.05) Compare: If The central control unit determines that the cleaning is satisfactory, ends the task, and resets; if... The central control unit determines that there are residual stains and triggers the parameter compensation logic.
[0248] Parameter compensation based on selective gain matrix.
[0249] When it is determined that cleaning compensation is needed, the central control unit bases its decision on visual residuals. and mechanical residuals Constructing the error vector .
[0250] The central control unit utilizes a selective gain matrix For the control parameter vector of the previous round Perform nonlinear incremental correction to generate a new round of control parameter vectors. :
[0251] The unfolded form is as follows:
[0252] in This is a preset sensitivity coupling matrix. For example, set... Large value and A small value means that when the visual residual is small... When the blockage is large (mainly non-viscous), the central control unit significantly increases the injection pressure. ;set up A large value means that when the mechanical residual... When the resistance is high (mainly viscous resistance), the central control unit primarily increases the mechanical speed significantly. Or torque limiting. Through matrix operations, the central control unit achieves decoupled compensation control for residual characteristics.
[0253] The central control unit utilizes the updated Perform compensatory cleaning until Or the maximum number of iterations has been reached. (To prevent infinite loops caused by hardware damage).
[0254] The adaptive learning program is executed by the central control unit after the cleaning task is completed, and is used to revise the prior model of the control system using task feedback data. The adaptive learning program specifically includes the following steps: Construction and storage of experience sample sets.
[0255] When the closed-loop verification program determines that the cleaning task is successful (i.e., the convergence condition is met), When this happens, the central control unit extracts key process data for this operation and constructs an experience sample record. .
[0256] Experience sample records Includes the following fields:
[0257] in, The original physical characteristic vector measured at the start of the operation (including unnormalized loss angle and phase) Quality Factor and optical flow velocity scalar ); This is the control parameter vector that ultimately enables the surface to meet cleanliness standards after iterative compensation through a closed-loop verification process. The stain category label determined by the feature mapping procedure.
[0258] The central control unit records the experience samples. Write to a circular buffer in non-volatile memory. If the buffer is full, overwrite the oldest historical data with the earliest timestamp.
[0259] Online correction of the control parameter benchmark library.
[0260] The central control unit uses experience sample records Update the parameter mapping table in the graded cleaning mode library. This includes updating the final execution parameters for this operation. Initial baseline parameters obtained from table lookup The presence of deviations (indicating that the preset parameters are insufficient to remove this type of stain under the current geological conditions) prompts the central control unit to use an Exponentially Weighted Moving Average (EWMA) algorithm to correct the corresponding category. Reference parameters:
[0261] in The parameter learning rate is set to 0.01 to 0.05. Through weighted update calculations, the central control unit gradually converges the reference control parameters to the actual effective operating parameters, thereby reducing the number of times closed-loop compensation is triggered in subsequent similar tasks.
[0262] Drift compensation of characteristic distribution statistical parameters.
[0263] To address sensor observation reference drift caused by equipment wear or environmental changes, the central control unit utilizes the original physical feature vector. Statistical parameters (mean vector) required for feature space mapping Sum of variance vectors Perform recursive updates.
[0264] The central control unit determines the type of stain currently identified. Perform the following update calculations respectively: Mean vector update:
[0265] Variance vector update:
[0266] in To update the forgetting factor (e.g., 0.005) statistically. This represents the Hadamard product (element-wise multiplication). The central control unit will update the... and (Right now The data is stored in the parameter area for Z-Score standardization calculation in the "feature space mapping" step of the next task, ensuring that the classifier always adapts to the current physical feature distribution.
[0267] Aging reset of clean physical benchmarks.
[0268] After each cleaning task is completed, the central control unit reads the measured mechanical resonance quality factor of the system under clean conditions. The central control unit maintains a length of (e.g., 5) is a recent clean status queue.
[0269] If all in the queue mean of values It stabilized within a new numerical range, and the mean value was consistent with the factory calibration value. If the deviation exceeds the preset aging threshold (e.g., a decrease of 15%), the central control unit determines that the system has experienced a permanent increase in mechanical damping (such as bearing wear or seal aging).
[0270] At this point, the central control unit performs a baseline reset operation, setting the system's current cleanliness reference baseline. Updated to :
[0271] Updated Cleanroom Reference Standards This will serve as the comparison denominator for the "triboelectric impedance spectroscopy analysis" and "closed-loop verification" steps in subsequent tasks. This reset mechanism eliminates fixed biases caused by equipment aging and prevents the closed-loop verification program from misjudging inherent damping caused by mechanical wear as residual stains, thereby avoiding the system falling into an ineffective dead-loop cleaning cycle.
[0272] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition, characterized in that, The method operates in a borehole inspection system comprising an imaging subsystem, a cleaning execution subsystem, and a central control unit. The cleaning execution subsystem includes a precision drive motor and a flexible cleaning actuator driven by the motor. The method includes the following steps: Step S1: Acquire real-time images through the imaging subsystem and calculate the image sharpness evaluation value. When the image sharpness evaluation value is lower than the preset dynamic trigger threshold, proceed to step S2. Step S2: Send a micro-vibration excitation signal to the precision drive motor to drive the flexible cleaning actuator to generate micro-amplitude reciprocating vibration, and simultaneously collect micro-vibration image sequences and real-time current feedback data of the motor during the vibration process; Step S3: Perform time-series analysis on the micro-vibration image sequence to extract the visual phase hysteresis, and simultaneously perform spectral analysis on the real-time current feedback data to extract mechanical impedance characteristics; Step S4: Perform feature fusion between the visual phase hysteresis and the mechanical impedance characteristics to identify the type of stains on the lens surface; Step S5: Based on the type of stain, invoke the corresponding cleaning control strategy to drive the precision drive motor to drive the flexible cleaning actuator to perform cleaning actions on the lens surface.
2. The self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition according to claim 1, characterized in that, In step S1, before proceeding to step S2 after determining that the image sharpness evaluation value is lower than a preset dynamic trigger threshold, a passive visual monitoring and screening step is also included: Calculate the dense optical flow field of the real-time image; If the global motion vector of the dense optical flow field is detected to be greater than the motion threshold, and there is a relatively static region in the center of the image where the local motion vector approaches zero, then the relatively static region is determined to be a static mask region, and step S2 is triggered. If the global motion vector is greater than the motion threshold and there is no relatively stationary region, then it is determined to be motion blur and step S2 is not triggered.
3. The self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition according to claim 1, characterized in that, In step S2, sending a micro-vibration excitation signal to the precision drive motor and simultaneously acquiring a micro-vibration image sequence specifically includes: The central control unit generates the micro-vibration excitation signal in the form of a sine wave with DC bias; The preset trigger phase point of each sinusoidal cycle of the micro-vibration excitation signal The imaging subsystem is sent a phase synchronization pulse signal via hardware circuitry. The imaging subsystem immediately triggers exposure acquisition upon receiving the rising edge of the phase synchronization pulse signal, ensuring that each frame of the micro-vibration image sequence is strictly locked to the phase of the micro-vibration excitation signal.
4. The self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition according to claim 1, characterized in that, In step S3, the specific processes for extracting the visual phase lag and extracting the mechanical impedance features include: In terms of extracting visual phase lag: the grayscale value of the pixel in the region of interest in the micro-vibration image sequence is sampled over time to obtain the grayscale change curve, and the phase difference between the grayscale change curve and the micro-vibration excitation signal is calculated using a cross-correlation algorithm as the visual phase lag. Regarding the extraction of mechanical impedance characteristics: the electromagnetic torque estimate is calculated from the real-time current feedback data using a sliding mode observer, and the fundamental component is extracted by performing a fast Fourier transform on it. The amplitude ratio of the fundamental component to the excitation signal is calculated to obtain the mechanical impedance modulus, which is then decomposed into damping coefficient components and stiffness coefficient components.
5. A self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition according to claim 4, characterized in that, Step S4 specifically includes: Construct a multidimensional feature vector containing the visual phase hysteresis, the damping coefficient component, and the stiffness coefficient component; The multidimensional feature vector is input into a preset classifier for judgment: If the visual phase hysteresis is greater than the hysteresis threshold and the damping coefficient component is low, the stain type is determined to be a non-Newtonian fluid stain. If the visual phase hysteresis is close to zero and the stiffness coefficient component is high, the stain type is determined to be a solid crust type stain. If the visual phase hysteresis is greater than the hysteresis threshold and the damping coefficient component is high, the stain type is determined to be a high-viscosity medium type stain.
6. The self-cleaning method for a borehole inspection instrument lens based on image sharpness recognition according to claim 5, characterized in that, In step S5, when the stain type is a non-Newtonian fluid stain, the cleaning control strategy is as follows: The precision drive motor is driven to perform high-frequency, small-amplitude reciprocating pulse motion, which disrupts the surface tension of the fluid. Then, it performs unidirectional high-speed rotational motion, using centrifugal force to throw the fluid away from the lens surface.
7. A self-cleaning method for a borehole inspection instrument lens based on image sharpness recognition according to claim 6, characterized in that, In step S5, when the stain type is a solid crust-like stain, the cleaning control strategy is as follows: The precision drive motor is driven by a magnetic field orientation control algorithm to output low-speed rotational motion in a constant torque mode to grind the shell; The motor speed is monitored in real time during the grinding process. If the speed is zero and the torque reaches the upper limit, the reverse retraction action is performed and the feed is restarted.
8. A self-cleaning method for a borehole inspection camera lens based on image sharpness recognition according to claim 6, characterized in that, In step S5, when the stain type is a high-viscosity media stain, the cleaning control strategy is as follows: The precision drive motor is driven to output a step-like acceleration command, which causes the flexible cleaning actuator to generate instantaneous high shear force to peel off the sticky medium. Then, intermittent forward and reverse rotation is used to prevent the medium from sticking back.
9. A self-cleaning method for a borehole inspection camera lens based on image sharpness recognition according to claim 6, characterized in that, The method further includes step S6: closed-loop verification and baseline update. After performing step S5, the image is acquired again and a new image sharpness evaluation value is calculated; If the new image sharpness evaluation value is greater than the dynamic trigger threshold, the cleaning is determined to be successful and the retry counter is reset; If the new image sharpness evaluation value is still lower than the dynamic trigger threshold, and the current number of retries has reached the preset maximum value, it is determined that the current environment has undergone an irreversible change. The current image sharpness evaluation value is then updated to the new environmental baseline sharpness, and the dynamic trigger threshold is recalculated accordingly.
10. A drilling inspection system with lens self-cleaning function, characterized in that, The system includes: The imaging subsystem is configured to acquire real-time images and micro-vibration image sequences of the borehole interior; The cleaning execution subsystem includes a precision drive motor and a flexible cleaning actuator that contacts the lens surface of the imaging subsystem; The central control unit is electrically connected to the imaging subsystem and the cleaning execution subsystem; The central control unit is equipped with a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the self-cleaning method for borehole inspection instrument lenses based on image sharpness recognition as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent cleaning monitoring system and method for ultrasonic image probe
CN120899409A
Drilling camera dynamic self-cleaning method and system based on multi-mode sensing linkage
CN121017195A