Defect detection light source adaptive adjustment method and device

By acquiring and utilizing the structural and environmental information of the light source adjustment device to generate control signals, the automation and accuracy of light source adjustment are achieved, solving the problems of light source adjustment being easily affected by the environment and having limited accuracy in the existing technology, and improving detection efficiency and accuracy. .

CN118540837APending Publication Date: 2024-08-23SHENZHEN POLYTECHNIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410900790.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing light source adjustment method for industrial surface defect detection is greatly affected by noise, has low sensitivity, is easily affected by the environment, has limited adjustment accuracy, requires manual re-inspection and supplementary adjustment, and the adjustment process is complex and inefficient.

Method used

By obtaining the structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device, the error information is determined based on this information, and a control signal is generated to adjust the light source adjustment device until the light intensity difference is within the preset range. , using PID controller to achieve precise automatic adjustment.

Benefits of technology

It improves the automation and efficiency of light source adjustment, reduces the need for manual intervention, responds quickly to environmental changes, reduces adjustment delays, and improves detection accuracy and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540837A
    Figure CN118540837A
Patent Text Reader

Abstract

The invention provides a defect detection light source adaptive adjustment method. The method comprises the following steps: obtaining structure information, environment information, a current illumination intensity value and a target illumination intensity value of a light source adjustment device; determining error information according to the structure information and the environment information; and generating a control signal according to the current illumination intensity value, the target illumination intensity value and the error information, and adjusting the light source adjusting device according to the control signal. The environment information and the error information are obtained, the light source is adjusted through the environment information, and correction is carried out in combination with the error information, so that the defects that light source adjustment is easily influenced by the environment and the adjustment precision is limited are overcome, and the purposes of light source adjustment automation and efficiency improvement, manual intervention requirement reduction, working efficiency improvement, quick response and the like are achieved. Environmental changes are automatically adapted, and adjustment delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of light source adjustment, and in particular to a method and device for adaptively adjusting a defect detection light source. Background Art

[0002] Traditional industrial surface defect detection light sources are greatly affected by the environment, have low adjustment efficiency, and low stability. The use of photoelectric control technology and deep learning to automatically adjust the detection light source is the current development trend of adaptive light sources. It has been applied and promoted in some industrial fasteners and LCD screen glass substrate surface defect detection fields. In recent years, with the rapid development of machine learning technology, especially the increasing maturity of photoelectric control technology, the adjustment of defect detection light sources is not limited to traditional manual adjustment. Many new adjustment methods have been derived based on photoelectric control technology. The existing defect light source adjustment steps can be roughly divided into four steps: lighting environment analysis (analyzing the current lighting environment), light source debugging (finely adjusting the intensity and position of the light source), checking and adjusting the light source environment (evaluating the lighting environment after adjusting the light source), and real-time monitoring (human or machine real-time judgment of the lighting environment and immediate adjustment).

[0003] There are three common methods for analyzing the lighting environment: photodiode method, thermocouple method and photoelectric effect method. The photodiode method is a method of measuring the light intensity by converting the light signal into an electrical signal through a photodiode. The photodiode can convert the received light signal into an electric current, and the magnitude of the current is proportional to the light intensity. By measuring the magnitude of the current, the light intensity at the corresponding position can be obtained. The thermocouple method is a method of indirectly measuring the light intensity by measuring the temperature change caused by light. The thermocouple is composed of two wires of different metals. When one end is illuminated, due to the absorption of light and heat conduction, the heat generated by this end is greater than the other end, resulting in an electromotive force difference between the two ends. By measuring the magnitude of this electromotive force difference, the intensity of light can be obtained. The photoelectric effect method is a method of measuring light intensity by utilizing the ionization effect of light on the material. According to Einstein's photoelectric effect theory, when light is irradiated on the metal surface, the free electrons in the metal can be knocked out of the metal surface by the energy of light to form a current. By measuring the magnitude of this current, the intensity of light can be obtained.

[0004] The existing method of adjusting the light source is to adjust the light source to adapt to the current ambient light through the single-chip control system, identify the type of nut, and adjust the position angle of the light source. PC, MCU control system, LabVIEW and other control systems combined with sensors are several commonly used and stable parameter adjustment and adaptive systems. Sensors are used to collect changes in the lighting environment and changes in components, and adjust the light source. The consistency of the light source can reach up to 95%. The sensor collects the illuminance of the working surface and adjusts the brightness of the light source to the set estimated value. This algorithm can effectively collect and adjust the ambient light, and the implementation cost is low. The shortcomings of this method are that it is greatly affected by noise, has low sensitivity, is easily affected by the environment, has limited adjustment accuracy, and requires manual re-inspection and auxiliary adjustment.

[0005] There are also traditional light source adjustment methods that rely on operators to make adjustments based on experience, without a fixed operating mode, and the adjustment process is complicated and inefficient. Summary of the invention

[0006] In view of the above problems, the present application is proposed to provide a defect detection light source adaptive adjustment method that overcomes the above problems or at least partially solves the above problems, including: A defect detection light source adaptive adjustment method, comprising the steps of: S1. Obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; S2. determining error information according to the structural information and the environmental information; S3, generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal; S4. When the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeat steps S1-S3 until the difference between the current light intensity and the target light intensity is within a preset range.

[0007] Furthermore, the step of determining error information according to the structural information and the environmental information includes: Determining a first corresponding relationship between the tilt angle of the light source adjustment device and the motor driving force according to the structural information and the environmental information; Determine an angle error according to the first corresponding relationship; wherein the angle error is the difference between the expected angle and the actual angle; Error information is determined based on the angular error.

[0008] Furthermore, the error information includes a target error, a static error and a prediction error, and the step of determining the error information based on the angle error includes: generating a target error according to the angle error; Generate static error based on the target error described in history; Determining a prediction error based on the static error and the target error; The error information is determined according to the target error, the static error and the predicted error.

[0009] Furthermore, it also includes: Obtaining the adjustment speed of the current light intensity value; When the adjustment speed is lower than a preset value, the range of the historical target error for generating the static error is adjusted.

[0010] Furthermore, the step of generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal includes: Determining an adjustment signal according to the current light intensity and the target light intensity; A control signal is generated according to the adjustment signal and the error information.

[0011] Furthermore, the step of generating a control signal according to the adjustment signal and the error information includes: determining a first output signal according to the target error; generating a second output signal according to the static error and the first output signal; A control signal is generated according to the prediction error and the second output signal.

[0012] Furthermore, it also includes: The adjustment record of the current light intensity value is sent to the memory.

[0013] A defect detection light source adaptive adjustment device, comprising: An acquisition module is used to acquire structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; An error module, used to determine error information according to the structural information and the environmental information; wherein the error information includes a target error, a static error and a prediction error; an adjustment module, configured to generate a control signal according to the current light intensity value, the target light intensity value and the error information, and adjust the light source adjustment device according to the control signal; The detection module is used to repeat the adjustment when the difference between the current light intensity value and the target light intensity value exceeds a preset range.

[0014] A device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, any one of the above-mentioned methods for adaptively adjusting a defect detection light source is implemented.

[0015] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for adaptively adjusting a defect detection light source described in any one of the above is implemented.

[0016] This application has the following advantages: In the embodiments of the present application, compared with the shortcomings of the prior art, such as being greatly affected by noise, having low sensitivity, being easily affected by the environment, having limited adjustment accuracy, and requiring manual re-inspection and auxiliary adjustment, the present application provides a solution for adjusting the light source through environmental information and error information, specifically: a method for adaptively adjusting a defect detection light source, comprising the steps of: S1, obtaining structural information, environmental information, a current light intensity value, and a target light intensity value of a light source adjustment device; S2, determining error information based on the structural information and the environmental information; S3, generating a control signal based on the current light intensity value, the target light intensity value, and the error information, and adjusting the light source adjustment device based on the control signal; S4, when the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeating steps S1-S3 until the difference between the current light intensity value and the target light intensity value is within a preset range. By obtaining environmental information and error information, adjusting the light source based on the environmental information and making corrections based on the error information, the shortcomings of light source adjustment being easily affected by the environment and having limited adjustment accuracy are solved, and the automation and efficiency of light source adjustment are achieved, the need for manual intervention is reduced, work efficiency is improved, the response is fast, it can automatically adapt to environmental changes, and adjustment delays are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 It is a flowchart of the steps of a defect detection light source adaptive adjustment method provided by an embodiment of the present application; Figure 2 It is a structural block diagram of a defect detection light source adaptive adjustment device provided in one embodiment of the present application; Figure 3 It is a structural schematic diagram of a double-lifting-arm annular light source height adjustment device provided in one embodiment of the present application; Figure 4 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the objects, features and advantages of the present application more obvious and understandable, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0019] The inventors have found through analysis of the prior art that in the daily use of the existing CCD detector, the manual adjustment of the light source lifting arm height has insufficient accuracy and consistency. The manual adjustment of the light source height depends on the judgment of the operator, and it is difficult to achieve high accuracy and repeatability like automatic adjustment. It is easy to produce adjustment errors, which affects the quality of the work. Manual adjustment requires the operator to spend physical effort to operate, which is easy to cause fatigue and affect work efficiency. The response speed is slow. Compared with the rapid response of the automatic adjustment system, the manual reaction and operation speed are limited, and it is impossible to quickly adapt to changes in work requirements, affecting the smoothness of the overall work process. Lack of dynamic adaptability, in the face of environmental changes or load changes, manual adjustment is difficult to automatically adjust parameters like an adaptive control system to maintain optimal control performance. During manual operation, the operator may need to approach or contact the mechanical equipment, increasing the risk of accidents. Automatic adjustment can reduce direct operation by personnel and improve the safety level. In application scenarios where frequent or continuous height adjustment is required, manual adjustment greatly reduces the operating efficiency, affecting the illumination of the nut appearance and the imaging progress. The automatic adjustment system can realize complex control functions according to preset logic and algorithms, such as automatic memory of preset height, linkage control, etc., which are difficult to achieve with manual adjustment. Manual adjustment usually requires on-site operation, which limits the possibility of remote management and monitoring and is not conducive to the integration of modern intelligent management systems.

[0020] At present, the characteristic light intensity of most ambient light directly affects the exposure setting. Too strong light may lead to overexposure, which is manifested as loss of details in the highlight area (such as outdoor shooting on a sunny afternoon). Experimental data shows that when the ISO is fixed, the exposure time is shortened by half (the shutter speed is doubled), and the required aperture value needs to be reduced by about 1 stop to maintain the same exposure. Conversely, in a low-light environment, extending the exposure time or increasing the aperture can increase the image brightness, but it may be accompanied by increased noise and dynamic range compression.

[0021] The direction of light affects the texture and three-dimensionality of the image. Sidelighting and backlighting can enhance the outline of the subject and create dramatic shadows, but care should be taken to avoid highlight overflow and loss of details in the shadow area. In the experiment, the samples shot with sidelighting had a detail retention rate on the shadow side that was about 30% higher than those shot with frontlighting.

[0022] The color temperature change of natural light has a significant impact on the color tone of the photo. Mismatched white balance settings can cause color shifts. For example, when shooting under midday sunlight (about 5500K) with uncorrected indoor lighting (about 3000K), the color temperature shift is as high as 2500K, which is obviously blue. By adjusting the camera's white balance or post-processing, the true color can be effectively restored.

[0023] Shooting in high-contrast environments, such as direct sunlight, can easily lead to loss of detail in highlights or shadows without proper fill light or HDR technology. Experimental data shows that after turning on the HDR function, the dynamic range of the image is expanded by an average of 1EV to 2EV, effectively improving the expression of details.

[0024] Diffused light provides soft and uniform lighting, which is suitable for still life photography, but may reduce the contrast of the image. Experiments have shown that the edge sharpness of the image is reduced by about 10% when using a softbox compared to direct flash, but the appearance of the image texture appears more delicate.

[0025] During the propagation process, scattered light encounters particles in the medium (such as gas molecules, dust, etc.) and deviates from its original direction. This deviation causes the light that originally propagated in a straight line and carried specific information (such as object edges and texture details) to be scattered in other directions. When these scattered lights reach the imaging sensor or the human eye, they no longer accurately correspond to specific points in the scene, but are a mixture of information from multiple directions, thereby reducing the clarity and details of the image.

[0026] Scattered light produces non-directional illumination on the imaging plane, which increases the background brightness of the image (such as the gray fog of negative film or the brightness value of digital images). This uninformative additional brightness is superimposed on the light directly coming from the object, resulting in a reduction in the original difference between light and dark, that is, a reduction in contrast.

[0027] In the presence of scattered light, the distinction between details and edges becomes blurred. Because the direction of scattered light is random, the signal it forms on the detector is superimposed on the main signal, making it difficult to distinguish between the real features in the image and the artifacts caused by scattering, further reducing the contrast of the image. The process makes the energy distribution of light more uniform, rather than concentrated in a specific area, which is not conducive to imaging that requires high contrast to distinguish different areas or features.

[0028] Among the light received by the camera's photosensitive element, scattered light tends to smooth the shadows and highlights in the image, reducing the visual sense of depth and three-dimensionality, and further reducing the image's contrast and detail expression.

[0029] Reference Figure 1 , showing a defect detection light source adaptive adjustment method provided by an embodiment of the present application; The method comprises: S1. Obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; S2. determining error information according to the structural information and the environmental information; S3, generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal; S4. When the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeat steps S1-S3 until the difference between the current light intensity value and the target light intensity value is within a preset range.

[0030] In the embodiments of the present application, compared with the shortcomings of the prior art, such as being greatly affected by noise, having low sensitivity, being easily affected by the environment, having limited adjustment accuracy, and requiring manual re-inspection and auxiliary adjustment, the present application provides a solution for adjusting the light source through environmental information and error information, specifically: a method for adaptively adjusting a defect detection light source, comprising the steps of: S1, obtaining structural information, environmental information, a current light intensity value, and a target light intensity value of a light source adjustment device; S2, determining error information based on the structural information and the environmental information; S3, generating a control signal based on the current light intensity value, the target light intensity value, and the error information, and adjusting the light source adjustment device based on the control signal; S4, when the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeating steps S1-S3 until the difference between the current light intensity value and the target light intensity value is within a preset range. By obtaining environmental information and error information, adjusting the light source based on the environmental information and making corrections based on the error information, the shortcomings of light source adjustment being easily affected by the environment and having limited adjustment accuracy are solved, and the automation and efficiency of light source adjustment are achieved, the need for manual intervention is reduced, work efficiency is improved, the response is fast, it can automatically adapt to environmental changes, and adjustment delays are reduced.

[0031] Next, a defect detection light source adaptive adjustment method in this exemplary embodiment will be further described.

[0032] As described in step S1, the structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device are obtained.

[0033] In an embodiment of the present invention, the specific process of "obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device" in step S1 can be further explained in combination with the following description.

[0034] It should be noted that to obtain the structural information of the light source adjustment device, it is necessary to model the pitch viewing angle control system of the light source adjustment device. The model needs to reflect the relationship between the tilt angle of the light source adjustment device and the motor driving force, and include the influence of gravity, friction, inertia and other factors on the adjustment. The environmental information is the surrounding environmental conditions. The same degree of driving force will produce different deviations in different environments. The environmental information is included in the error analysis to ensure the stability of the error calculation. The current light information is the electrical signal sensed by the light sensor and converted into a numerical value of light intensity to facilitate the subsequent calculation of the error.

[0035] In a specific implementation, a double-arm ring light source is used as a light source adjustment device, referring to Figure 3 , which is a structural diagram of the double-arm ring light source provided in this embodiment. Through the two-way lifting arm, the height can be adjusted more stably and accurately, the system stability can be enhanced, the dynamic changes can be effectively responded to, the over-adjustment and oscillation can be reduced, and the accuracy of nut appearance defect detection can be greatly improved.

[0036] As described in step S2, error information is determined according to the structural information and the environmental information.

[0037] It should be noted that this embodiment uses a PID controller to achieve accurate automatic frequency modulation, and defines the error information as the difference between the expected horizontal angle (usually 0 degrees, representing complete horizontality) and the current actual measured angle. This error information is the input of the PID controller. PID controller design: Proportional term (P) as target error: adjusts the control output proportionally to the current error size and responds to the error quickly.

[0038] The integral term (I) acts as a static error: it accumulates past errors to eliminate steady-state errors and ensure long-term stability.

[0039] The differential term (D) is used as a prediction error: predict the error change trend, adjust the output in advance, reduce overshoot and improve response speed.

[0040] The PID parameters (Kp, Ki, Kd) are determined by trial and error, theoretical calculations, or automatic tuning methods (such as the Ziegler-Nichols law or software tools such as MATLAB's PID Tuner) to optimize system performance.

[0041] The current tilt angle of the lifting platform is continuously measured. The difference between the desired angle and the actual angle is calculated. Based on the current error and the state at the previous moment (error change rate), the control signal (such as the drive voltage or current of the motor) is calculated through the PID formula. The calculated control signal is sent to the driving mechanism of the lifting platform to adjust the position of the platform. The above process is repeated to form a closed-loop control until the platform angle reaches and remains in the desired horizontal state.

[0042] In an embodiment of the present invention, the specific process of "determining error information according to the structural information and the environmental information" in step S120 can be further explained in combination with the following description.

[0043] As described in the following steps, a first corresponding relationship between the tilt angle of the light source adjustment device and the motor driving force is determined according to the structural information and the environmental information; Determine an angle error according to the first corresponding relationship; wherein the angle error is the difference between the expected angle and the actual angle; Error information is determined based on the angular error.

[0044] It should be noted that the light source adjustment device adjusts the light intensity value by adjusting the angle brightness of the light source. The light source adjustment device is further adjusted through the error information obtained to avoid mechanical errors generated during the adjustment, thereby greatly improving the accuracy of nut appearance defect detection.

[0045] In one embodiment of the present invention, the specific process of "the error information includes a target error, a static error and a prediction error, and the error information is determined according to the angle error" can be further explained in combination with the following description.

[0046] As described in the following steps, generating a target error according to the angle error; As described in the following steps, a static error is generated based on the target error described in history; As described in the following steps, a prediction error is determined according to the static error and the target error.

[0047] It should be noted that the target error is to adjust the control output proportionally according to the current error size and respond to the error quickly. The static error is the accumulated past error, which is used to eliminate the steady-state error and ensure long-term stability. It is determined by the target error. The predicted error is to predict the error change trend, adjust the output in advance, reduce overshoot and improve the response speed, and is determined by integrating the target error and the static error.

[0048] In one embodiment of the present invention, it also includes: As described in the following steps, the adjustment speed of the current light intensity value is obtained; As described in the following steps, when the adjustment speed is lower than a preset value, the range of the historical target error for generating the static error is adjusted.

[0049] It should be noted that the static error is generated by the historical target error. Too many historical records may cause the system response speed to slow down, or even cause integral saturation (the integral term is too large, causing it to exceed the output range of the controller). Therefore, it is necessary to adjust the judgment range of the historical target error to ensure the stability of the static error while ensuring the stability of the system operating speed and operating status.

[0050] As described in step S3, a control signal is generated according to the current light intensity value, the target light intensity value and the error information, and the light source adjustment device is adjusted according to the control signal.

[0051] In one embodiment of the present invention, the specific process of "generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal" in step S3 can be further explained in combination with the following description.

[0052] As described in the following steps, determining an adjustment signal according to the current light intensity and the target light intensity; As described in the following steps, a control signal is generated according to the adjustment signal and the error information.

[0053] In an embodiment of the present invention, the specific process of “generating a control signal according to the adjustment signal and the error information” can be further explained in combination with the following description.

[0054] As described in the following steps, determining a first output signal according to the target error; As described in the following steps, a second output signal is generated according to the static error and the first output signal; As described in the following steps, a control signal is generated according to the prediction error and the second output signal.

[0055] It should be noted that in order to achieve accurate position compensation through the PID controller, first of all, it is necessary to continuously measure the actual position of the light source adjustment device, which can be achieved through an encoder, sensor or other detection equipment, and compare the actual position with the expected position (set point, adjustment position to achieve the target light value). The error is calculated as the expected position minus the current actual position.

[0056] Target error, or proportional term (K_p \cdot e(t)): K_p is the proportional gain, e(t) is the error at the current moment, and "\cdot" represents the product of the controller's proportional gain (K_p) and the current error (e(t)). In other words, (K_p \cdot e(t)) calculates the product of the error (e(t)) and the proportional coefficient (K_p), which is the most basic component of the PID controller and is used to adjust the output to respond proportionally to the current error value.

[0057] The proportional gain K_p determines the immediate response strength to the error cdot e(t) at the current moment. If the error is large, the controller outputs a large correction signal to quickly reduce the error; if the error is small, a small correction signal is output. Adjustment steps: Increasing K_p can speed up the system response and reduce the steady-state error, but too large a value will cause system oscillation. It is necessary to find a suitable value through experiments to make the system both fast and stable.

[0058] Static error, and the integral term (K_i \int_{0}^{t} e(\tau) d\tau): (K_i) is the integral gain, which is a scalar value that determines the strength of the integral action. It controls the degree of influence of the error accumulation on the controller output. In simple terms, the larger (K_i), the greater the influence of historical errors on the current control action. It is mainly used to eliminate the steady-state error in the system, that is, the difference between the expected value and the actual output value after there is no external interference and the system is stable. Since the integral term will continue to accumulate past errors, even if the error is small, the integral term will gradually increase over time, prompting the system to adjust until it reaches or approaches the set value. It integrates the accumulation of errors over time, and even if the error is small, the integral term will gradually increase over time, helping the system to eventually reach zero error. Adjustment steps: Appropriately increasing K_i can eliminate static errors, but too large will cause the system to respond slowly and even produce integral saturation (when the integral term is too large and exceeds the controller output range). Careful adjustment is required to ensure that the system is stable and can effectively eliminate steady-state errors.

[0059] (e(\tau)) is the error: at any time (\tau), here (\tau) is a universal time variable, which is used to mark the time span from the time when the system starts to run or consider to the current moment of discussion. The error (e(\tau)) is defined as the difference between the reference or setpoint and the actual output value of the system, that is, (e(\tau) = r(\tau) - y(\tau)), where (r(\tau)) is the reference and (y(\tau)) is the actual output of the system. The error is the core feedback signal of PID control, which directly reflects the deviation between the control target and the actual performance, and is the basis for calculating the proportional term, integral term and differential term.

[0060] Integral interval ([0, t]): The integral interval represents the time range from the starting point in time (usually when the system is started or reset) to the current time (t). This means that the integral term accumulates all errors since the system started running. By accumulating errors throughout the process, the integral term can reflect the impact of the system's historical behavior on the current control decision. It is particularly suitable for eliminating long-standing small errors and ensuring that the system can eventually accurately reach the set value.

[0061] Prediction error, i.e. the differential term (K_d \frac{de(t)}{dt}): (K_d) is the derivative gain: The derivative gain is a scalar value that determines the strength of the derivative action, that is, the degree to which the error change rate affects the control output. It measures the sensitivity of the controller to system changes. When (K_d) is large, the derivative controller reacts quickly to error changes, helps to suppress rapidly changing errors, reduce overshoot, and improve the dynamic performance of the system. However, too large (K_d) will increase the noise sensitivity of the system and may cause unnecessary fluctuations.

[0062] ( \frac{de(t)}{dt} ) is the rate of change of error (Derivative of Error): It represents the rate of change of error (e(t)) over time (t), that is, the derivative of error with respect to time. It is an immediate reflection of the current trend of the system. By considering the trend of error change rather than just the current error value, the differential term can predict future states and adjust the control output in advance, thereby reducing response time and overshoot and improving the dynamic response performance of the system.

[0063] (frac represents a fraction in the differential term, frac{de(t)}dt} represents a fraction with a denominator of de(t) and a numerator of dt, which can be read as de(t) divided by dt.) Where U(t) is the output signal of the PID controller at time t, which is used to drive the controlled process or system to make its behavior close to the desired behavior. K_p (proportional gain) is a constant that determines the proportional relationship between the error e(t) and the controller's immediate output. The larger the K_p, the stronger the controller's immediate reaction is for the same error. It affects the stability and response speed of the system. e(t): The error signal, defined as the difference between the set point (or desired value) and the actual process output value. That is, (e(t) = SP - PV), where SP is the set point and PV is the process variable. The error e(t) indicates the deviation between the current state of the system and the target state. K_i (integral gain): Another constant that is proportional to the accumulation of error over time. K_i controls the strength of the integral action, that is, the longer the error exists, the greater its cumulative effect (through integration), which helps to eliminate static errors (steady-state errors). But too large K_i may cause system instability. ∫_0^te(τ) dτ: This term represents the integral of the error e(τ) with respect to time τ from the start of time to the current time t. It accumulates the errors throughout the process, helping the system eventually reach and remain near the set point, even if there are persistent small errors. K_d (differential gain): Another constant, which is proportional to the rate of change of the error e(t) (i.e., the derivative of the error with respect to time). K_d introduces predictive control, which can adjust the output in advance according to the trend of error changes, helping to reduce overshoot and improve system response speed. However, it is sensitive to noise, so it should be used with caution in systems with high noise. Output execution: Convert the control signal calculated by PID into a specific control action, such as adjusting the voltage or current of the lifting motor to change the power or speed of the lifting drive system.

[0064] As an example, the light intensity is accurately adjusted through a single-chip microcomputer. The sensor uses a photoresistor or a photodiode as a light intensity sensor to convert the light intensity into an electrical signal. The single-chip microcomputer: Arduino is used to collect data, calculate control signals and output control commands. The actuator: a PWM-controlled LED drive circuit is used to adjust the brightness of the light source.

[0065] The specific workflow is as follows: MCU initialization, including setting timer interrupts (for periodic sampling and control), initializing PID parameters (Kp, Ki, Kd), and setting the target light intensity value. Data collection: The MCU periodically reads the electrical signal of the light sensor through the ADC (analog to digital converter) and converts it into the value of light intensity. Calculate error: Calculate the difference between the current light intensity and the target light intensity, that is, the error. PID calculation: Proportional term: directly adjusts the output based on the size of the error.

[0066] Integral term: accumulates all past errors and helps to eliminate static errors.

[0067] Differential term: predict the error change trend and reduce overshoot and oscillation.

[0068] Combining these three parts, we get the control signal (such as PWM duty cycle). Output control signal: The control signal calculated by the PID algorithm is output to the actuator to adjust the brightness of the light source. For example, if PWM is used to control an LED, the control signal will determine the PWM duty cycle, which in turn changes the brightness of the LED. Closed-loop feedback: The adjusted light intensity is captured by the sensor again and returns to the first step to continue the error calculation, forming a closed-loop control. By observing the response of the system, the PID parameters are continuously adjusted to achieve a fast response and stability at the target light intensity.

[0069] In one embodiment of the present invention, it also includes: The adjustment record of the current light intensity value is sent to the memory.

[0070] It should be noted that storing the adjustment records facilitates error analysis of subsequent adjustments, thereby speeding up error adjustment.

[0071] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0072] Reference Figure 2 , showing a defect detection light source adaptive adjustment device provided by an embodiment of the present application; Specifically include: An acquisition module 210 is used to acquire structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; An error module 220, configured to determine error information based on the structural information and the environmental information; An adjustment module 230, configured to generate a control signal according to the current light intensity value, the target light intensity value and the error information, and adjust the light source adjustment device according to the control signal; The detection module 240 is used to repeatedly adjust when the difference between the current light intensity value and the target light intensity value exceeds a preset range until the difference between the current light intensity and the target light intensity is within a preset range.

[0073] In one embodiment of the present invention, the error module 220 includes: A first correspondence submodule, configured to determine a first correspondence between the tilt angle of the light source adjustment device and the motor driving force according to the structural information and the environmental information; An angle error submodule, used to determine an angle error according to the first corresponding relationship; wherein the angle error is a difference between a desired angle and an actual angle; The error information submodule is used to determine error information according to the angle error.

[0074] In one embodiment of the present invention, the error information submodule includes: A target error submodule, used for generating a target error according to the angle error; A static error submodule, used for generating a static error according to the target error described in history; A prediction error submodule, used to determine a prediction error based on the static error and the target error; The error information determination submodule is used to determine the error information according to the target error, the static error and the predicted error.

[0075] In one embodiment of the present invention, it also includes: An adjustment speed acquisition submodule, used to obtain the adjustment speed of the current light intensity value; The adjusting submodule is used to adjust the range of the historical target error for generating the static error when the adjusting speed is lower than a preset value.

[0076] In one embodiment of the present invention, the adjustment module 230 includes: An adjustment signal submodule, used to determine an adjustment signal according to the current light intensity and the target light intensity; The control signal submodule is used to generate a control signal according to the adjustment signal and the error information.

[0077] In one embodiment of the present invention, the control signal submodule includes: A first output signal submodule, configured to determine a first output signal according to the target error; A second output signal submodule, configured to generate a second output signal according to the static error and the first output signal; The control signal generating submodule is used to generate a control signal according to the prediction error and the second output signal.

[0078] In one embodiment of the present invention, it also includes: The storage submodule is used to send the adjustment record of the current light intensity value to the memory.

[0079] Reference Figure 4, showing a computer device of a defect detection light source adaptive adjustment method of the present invention, which may specifically include the following: The computer device 12 is in the form of a general-purpose computing device, and the components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).

[0080] The bus 18 represents one or more of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, a processor, or a local bus 18 using any of a variety of bus 18 architectures. These architectures include, by way of example, but are not limited to, an Industry Standard Architecture (ISA) bus 18, a Micro Channel Architecture (MAC) bus 18, an Enhanced ISA bus 18, an Audio Video Electronics Standards Association (VESA) local bus 18, and a Peripheral Component Interconnect (PCI) bus 18.

[0081] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0082] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42, which are configured to perform the functions of various embodiments of the present invention.

[0083] A program / utility 40 having a set (at least one) of program modules 42 may be stored in, for example, a memory, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0084] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, cameras, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs)), wide area networks (WANs), and / or public networks (e.g., the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34, etc.

[0085] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a defect detection light source adaptive adjustment method provided in an embodiment of the present invention.

[0086] That is, when the processing unit 16 executes the above program, the following steps are achieved: S1, obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; S2. determining error information according to the structural information and the environmental information; wherein the error information includes target error, static error and prediction error; S3, generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal; S4. When the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeat steps S1-S3.

[0087] In an embodiment of the present invention, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a defect detection light source adaptive adjustment method as provided in all embodiments of the present application is implemented: That is, when the program is executed by the processor, the following steps are implemented: S1, obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; S2. determining error information according to the structural information and the environmental information; wherein the error information includes target error, static error and prediction error; S3, generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal; S4. When the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeat steps S1-S3.

[0088] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device.

[0089] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0090] The computer program code for performing the operation of the present invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.

[0091] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0092] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0093] The above is a detailed introduction to the method and device for adaptively adjusting a defect detection light source provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A defect detection light source adaptive adjustment method, characterized in that: Includes steps: S1. Obtaining structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; S2, determining error information according to the structural information and the environmental information; S3, generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal; S4. When the difference between the current light intensity value and the target light intensity value exceeds a preset range, repeat steps S1-S3 until the difference between the current light intensity and the target light intensity is within a preset range.

2. The defect detection light source adaptive adjustment method according to claim 1, characterized in that: The step of determining error information according to the structural information and the environmental information comprises: Determining a first corresponding relationship between the tilt angle of the light source adjustment device and the motor driving force according to the structural information and the environmental information; Determine an angle error according to the first corresponding relationship; wherein the angle error is the difference between the expected angle and the actual angle; Error information is determined based on the angular error.

3. The defect detection light source adaptive adjustment method according to claim 2, characterized in that: The error information includes a target error, a static error and a prediction error. The step of determining the error information based on the angle error includes: generating a target error according to the angle error; Generate static error based on the target error described in history; A prediction error is determined according to the static error and the target error.

4. The defect detection light source adaptive adjustment method according to claim 3, characterized in that: Also includes: Obtaining the adjustment speed of the current light intensity value; When the adjustment speed is lower than a preset value, the range of the historical target error for generating the static error is adjusted.

5. The defect detection light source adaptive adjustment method according to claim 3, characterized in that: The step of generating a control signal according to the current light intensity value, the target light intensity value and the error information, and adjusting the light source adjustment device according to the control signal comprises: Determining an adjustment signal according to the current light intensity and the target light intensity; A control signal is generated according to the adjustment signal and the error information.

6. The defect detection light source adaptive adjustment method according to claim 5, characterized in that: The step of generating a control signal according to the adjustment signal and the error information comprises: determining a first output signal according to the target error; generating a second output signal according to the static error and the first output signal; A control signal is generated according to the prediction error and the second output signal.

7. The defect detection light source adaptive adjustment method according to claim 1, characterized in that: Also includes: The adjustment record of the current light intensity value is sent to the memory.

8. A defect detection light source adaptive adjustment device, characterized in that: include: An acquisition module is used to acquire structural information, environmental information, current light intensity value and target light intensity value of the light source adjustment device; an error module, configured to determine error information according to the structural information and the environmental information; an adjustment module, configured to generate a control signal according to the current light intensity value, the target light intensity value and the error information, and adjust the light source adjustment device according to the control signal; The detection module is used to repeatedly adjust when the difference between the current light intensity value and the target light intensity value exceeds a preset range until the difference between the current light intensity value and the target light intensity value is within a preset range.

9. A device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the method for adaptively adjusting a defect detection light source as claimed in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for adaptively adjusting a defect detection light source according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Non-woven fabric defect detection method

    CN119624875A