Optical fiber detection method, device, electronic equipment and storage medium
By introducing the second-order relation of optical fiber calibration in the optical fiber detection device, the accurate evaluation of optical fiber transmission efficiency is achieved, and the problems of complex and high cost of optical fiber detection operations in the prior art are solved, thereby reducing the detection threshold and cost.
Patent Information
- Application Number
- CN202411801007.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The lack of a fiber detection method with simple operation and low labor costs in the prior art has resulted in the fiber detection work relying on professional and technical personnel and expensive optical power meters, which increases the detection cost and threshold.
By designing an optical fiber detection method and device, the device includes an optical fiber calibration function and an optical fiber detection function, and the transmission efficiency of the optical fiber is detected using a second-order relationship of optical fiber calibration. This method does not require a professional optical power meter, and can achieve accurate evaluation through ADC value acquisition and simple mathematical calculations.
The threshold and cost of fiber detection are reduced, so that fiber quality inspection can be easily carried out in various application scenarios without the need for professional and technical personnel.
Smart Images

Figure CN119269042B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical device technology, and in particular to an optical fiber detection method, device, electronic equipment and storage medium. Background Art
[0002] In the fields of medicine and industry, the application of fiber optic lighting is becoming more and more extensive, such as endoscopes and microscopes in the medical field; machine vision used in automation in the industrial field, etc. Because the scenes involved have strict requirements on light intensity, and the optical fiber itself is soft and easy to break, the transmission efficiency of the optical fiber itself for light intensity is extremely important. Therefore, optical fiber detection has become an indispensable part of the above application scenarios.
[0003] When checking the transmission efficiency of optical fiber, it is usually done by specialized technicians who use optical power meters to connect the light source and the optical fiber. After the connection is completed, turn on the light source, wait for the optical power count value to stabilize, record the value and compare it with the output range calibrated in the product specification to determine whether the optical fiber transmission efficiency is qualified. However, in daily use, there may not be an optical power meter in the scene, and the operators may not master the use and detection methods of the optical power meter; therefore, in the work of optical fiber detection, it is generally the supplier who appoints technicians to conduct regular inspections. As a result, not only does it increase manpower, but the operation may be affected by damage to the optical fiber during use.
[0004] Therefore, considering the above problems, the prior art lacks a light detection method that is simple to operate and has low labor costs. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present application provides an optical fiber detection method, device, electronic device and storage medium, which are applied in the field of medical device technology.
[0006] In a first aspect, a fiber optic detection method is provided, the method being applied to a fiber optic detection device, the fiber optic detection device being connected to a light source device via an optical fiber, and being used to detect the transmission efficiency of the optical fiber, the fiber optic detection device comprising at least a fiber optic calibration function and a fiber optic detection function, the method comprising:
[0007] S1: Under the optical fiber calibration function, the first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device, and the second ADC value of the light intensity received by the optical fiber detection device are obtained; the first ADC value and the second ADC value are obtained in multiple groups corresponding to different light intensities output by the light source device;
[0008] S2: Select multiple groups of the first ADC value and the second ADC value to generate a second-order relationship for optical fiber calibration: y = a*x^2 + b*x + c, where y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively;
[0009] S3: obtaining, under the optical fiber detection function, a third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device, and a fourth ADC value of the light intensity received by the optical fiber detection device, and substituting the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value;
[0010] S4: comparing the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, then displaying that the optical fiber detection has passed, otherwise, displaying that the optical fiber detection has failed.
[0011] The present application proposes a fiber detection method, which is applied to a fiber detection device. The fiber detection device is connected to a light source device through an optical fiber, so that the fiber detection device can detect the transmission efficiency of the optical fiber after receiving the light intensity output by the light source device. The method mainly realizes the detection of the fiber transmission efficiency through two main steps of fiber calibration and fiber detection. In the fiber calibration stage, a second-order relationship is established by obtaining the first ADC value of the light intensity output by multiple groups of light source devices and the second ADC value of the light intensity received by the fiber detection device. This relationship reflects the relationship between the light intensity received after the light source output and the optical fiber transmission, and takes into account the nonlinear characteristics that may exist in the optical fiber transmission process. In the fiber detection stage, the fourth ADC value actually received is substituted into the calculation using the second-order relationship obtained by calibration to obtain a fifth ADC value of the light intensity output by the light source device in theory. By comparing this theoretical fifth ADC value with the third ADC value of the actual light intensity output by the light source, it can be judged whether the transmission efficiency of the optical fiber is within the allowable error range. This method does not require the use of a professional optical power meter, nor does it require the operation of professional technicians. By performing simple ADC value acquisition and mathematical calculation by the fiber detection device, an accurate evaluation of the optical fiber transmission efficiency can be achieved. This greatly reduces the threshold and cost of fiber optic detection, making it easy to perform fiber optic quality inspection in various application scenarios.
[0012] Further, in step S1, the first instruction information at least includes a preset PWM value, and the preset PWM value ranges from 0 to 100;
[0013] Step S1 includes:
[0014] S11: Under the optical fiber calibration function, the light source device returns first feedback information according to the first instruction information sent by the optical fiber detection device. When the optical fiber detection device receives the first feedback information, the light source device parses the first instruction information and outputs light intensity according to the preset PWM value in the first instruction information.
[0015] S12: sequentially acquiring the first ADC value of the light intensity output by the light source and the second ADC value of the light intensity received by the optical fiber detection device in the value range of the preset PWM value from 0% to 100%; the first ADC value and the second ADC value under the same preset PWM value are a group.
[0016] The present application proposes a fiber detection method, which ensures the comprehensiveness and representativeness of the data by setting a preset PWM value range and gradually collecting the first ADC value and the second ADC value. This method not only improves the accuracy and reliability of data acquisition, but also provides a solid data foundation for the subsequent generation of accurate fiber calibration second-order relationship, thereby improving the accuracy and reliability of the entire fiber detection process.
[0017] Further, the optical fiber detection device includes at least two light intensity acquisition modules. In step S12, obtaining the second ADC value of the light intensity received by the optical fiber detection device includes:
[0018] S121: Acquire a sixth ADC value and a seventh ADC value of light intensity received by two light intensity acquisition modules in the optical fiber detection device;
[0019] S122: After performing median filtering on the sixth ADC value and the seventh ADC value, calculate the average to obtain the second ADC value.
[0020] A fiber optic detection method proposed in the present application can simultaneously acquire two sets of light intensity data by using two light intensity acquisition modules, thereby reducing the impact of failure or error of a single acquisition module on the overall measurement result; median filtering is performed on the two sets of data acquired, thereby effectively removing outliers or noise interference and improving the stability and reliability of the data; and the average value of the two sets of data after filtering is calculated, thereby further improving the accuracy of the second ADC value finally obtained.
[0021] Furthermore, the optical fiber detection device also includes an optical power calibration function, the serial port on the optical fiber detection device is connected to the serial port on the light source device, the optical fiber of the light source device is respectively connected to the optical power meter and the optical fiber detection device, and the method also includes:
[0022] S5: When the optical power meter is connected to the light source device through an optical fiber, under the optical power calibration function, the light source device outputs different degrees of light intensity according to the first instruction information sent by the optical fiber detection device, and the optical power value of the optical power meter at this time is obtained; after the optical power value is collected, the light source device outputs different degrees of light intensity according to the first instruction information sent by the optical fiber detection device, and obtains the second ADC value of the optical fiber detection device receiving different degrees of light intensity; wherein the light intensity output by the light source device when obtaining the optical power value is consistent with the light intensity output by the light source device when obtaining the second ADC value; and the second ADC value and the optical power value are obtained in multiple groups respectively;
[0023] S6: When the preset PWM value corresponding to the last second ADC value obtained is 100%, select multiple groups of the second ADC values and the optical power value to generate a second-order relationship for optical power calibration: y1 = a1*x^2 + b1*x + c1, where y1 is the optical power value; x is the second ADC value; a1, b1, and c1 are second-order coefficients respectively;
[0024] S7: Save the second-order relational expression of the optical power calibration, and display that the optical power calibration is successful.
[0025] The present application proposes a fiber detection method, which improves the accuracy of fiber detection by establishing a corresponding relationship between the second ADC value and the optical power value. The introduction of the optical power meter provides a reliable reference standard for calibration, and the use of the second-order relationship can better fit the nonlinear relationship and further improve the calibration accuracy.
[0026] Furthermore, the optical fiber detection device also includes an optical power display function, and after step S7, the following steps are included:
[0027] S71: acquiring an eighth ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical power display function, and substituting the eighth ADC value as x into the optical power calibration second-order relationship to obtain a ninth ADC value;
[0028] S72: Display the ninth ADC value as optical power.
[0029] Furthermore, the optical fiber detection device also includes a collection sensitivity setting function, the optical fiber detection device at least includes an acquisition module, the acquisition module is provided with a sensor and a digital potentiometer, the sensor is used to collect light intensity data of the light intensity received by the optical fiber detection device; the sensor is connected to the digital potentiometer, and the digital potentiometer is connected to the MCU; after the sensor collects the light intensity data, the light intensity data is converted into a voltage, and after passing through the digital potentiometer, the MCU reads the voltage and converts it into an ADC value for display; the digital potentiometer is an adjustable gear resistor, and the gear number value of the digital potentiometer is the sensitivity value.
[0030] Furthermore, the method further comprises:
[0031] S8: Under the acquisition sensitivity setting function, after the light source device emits light intensity, the optical fiber detection device collects the tenth ADC value of the light intensity and the sensitivity value;
[0032] S9: Determine whether the range of the tenth ADC value meets the range of the preset ADC value. When the range of the tenth ADC value does not meet the range of the preset ADC value, adjust the sensitivity value, and read the ADC value of the light intensity collected by the optical fiber detection device again under the adjusted sensitivity value until the range of the ADC value meets the range of the preset ADC value.
[0033] In a second aspect, an optical fiber detection device is provided, the device comprising:
[0034] Acquisition module: Acquiring a first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber calibration function, and a second ADC value when the optical fiber detection device receives the light intensity; the first ADC value and the second ADC value are obtained in multiple groups corresponding to different light intensities output by the light source device;
[0035] A first calculation module: selecting multiple groups of the first ADC values and the second ADC values to generate a second-order relationship for optical fiber calibration: y = a*x^2 + b*x + c, wherein y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively;
[0036] The second calculation module is used to obtain a third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber detection function, and a fourth ADC value when the optical fiber detection device receives the light intensity, and substitute the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value;
[0037] Detection module: compare the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, then display that the optical fiber detection is passed, otherwise, display that the optical fiber detection is failed.
[0038] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any of the above methods are executed.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above methods are executed.
[0040] Beneficial effects: The optical fiber detection method, device, electronic device and storage medium proposed in the present application are applied to the optical fiber detection device. The optical fiber detection device is connected to the light source device through the optical fiber, so that the optical fiber detection device can detect the transmission efficiency of the optical fiber after receiving the light intensity output by the light source device. The method mainly realizes the detection of the optical fiber transmission efficiency through two main steps of optical fiber calibration and optical fiber detection. In the optical fiber calibration stage, a second-order relationship is established by obtaining the first ADC value of the light intensity output by multiple groups of light source devices and the second ADC value of the light intensity received by the optical fiber detection device. This relationship reflects the relationship between the light intensity received after the light source output and the optical fiber transmission, and takes into account the nonlinear characteristics that may exist in the optical fiber transmission process. In the optical fiber detection stage, the fourth ADC value actually received is substituted into the calculation using the second-order relationship obtained by calibration to obtain a fifth ADC value of the light intensity output by the theoretical light source device. By comparing this theoretical fifth ADC value with the third ADC value of the actual light intensity output by the light source, it can be judged whether the transmission efficiency of the optical fiber is within the allowable error range. This method does not require the use of a professional optical power meter, nor does it require the operation of professional technicians. By simply collecting ADC values and performing mathematical calculations with the optical fiber detection device, an accurate evaluation of the optical fiber transmission efficiency can be achieved. This greatly reduces the threshold and cost of fiber optic detection, making it easy to perform fiber optic quality inspection in various application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flow chart of an optical fiber detection method proposed in this application.
[0042] Figure 2 This is a structural diagram of an optical fiber detection device proposed in this application.
[0043] Figure 3 A schematic diagram of the structure of the electronic device provided in this application.
[0044] Description of reference numerals: 201, acquisition module; 202, first calculation module; 203, second calculation module; 204, detection module; 301, processor; 302, memory; 303, communication bus; 3, electronic device. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application usually described and marked in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0046] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first, second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0047] The following disclosure provides many different implementations or examples for achieving the purpose of the present invention, which solve the problems in the prior art that the optical fiber detection method is complex to operate, requires professional personnel to operate, has high labor costs, and cannot meet the needs of daily rapid detection.
[0048] Please refer to Figure 1 , a fiber optic detection method, the method is applied to a fiber optic detection device, the fiber optic detection device is connected to a light source device through an optical fiber, and is used to detect the transmission efficiency of the optical fiber, the fiber optic detection device at least includes a fiber optic calibration function and a fiber optic detection function, and the method includes:
[0049] S1: Under the optical fiber calibration function, the light source device outputs a first ADC value of the light intensity according to the first instruction information sent by the optical fiber detection device, and a second ADC value when the optical fiber detection device receives the light intensity; the first ADC value and the second ADC value are obtained in multiple groups corresponding to different light intensities output by the light source device;
[0050] S2: Select multiple groups of first ADC values and second ADC values to generate a second-order relationship for optical fiber calibration: y = a*x^2 + b*x+ c, where y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively;
[0051] S3: Under the optical fiber detection function, the light source device outputs a third ADC value of the light intensity according to the first instruction information sent by the optical fiber detection device, and a fourth ADC value when the optical fiber detection device receives the light intensity, and substitutes the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value;
[0052] S4: comparing the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, it is displayed that the optical fiber detection has passed, otherwise, it is displayed that the optical fiber detection has failed.
[0053] The optical fiber detection device at least includes a display screen, a button located on one side of the display screen, an optical fiber interface connected to one end of the optical fiber, and a serial port connected to a data line. The light source device at least includes a light source that can emit light, an optical fiber interface connected to the other end of the optical fiber, and a serial port connected to a data line. The optical fiber is connected between the optical fiber detection device and the light source device through two optical fiber interfaces, so that the optical fiber detection device can detect the transmission efficiency of the optical fiber.
[0054] The method includes two main steps: optical fiber calibration and optical fiber detection. In the optical fiber calibration stage, a second-order relation for optical fiber calibration is established by obtaining the first ADC value of the output light intensity of multiple groups of light source devices and the second ADC value of the received light intensity of the optical fiber detection device. This relation reflects the relationship between the output of the light source and the light intensity received after optical fiber transmission. The second-order relation is chosen instead of a linear relation because optical fiber transmission may have nonlinear loss, and the second-order relation can more accurately describe this characteristic.
[0055] In the fiber detection stage, the fourth ADC value actually received is substituted as x in the calculation using the second-order relationship of fiber calibration to obtain a fifth ADC value of the theoretical light source device output light intensity. By comparing this theoretical fifth ADC value with the third ADC value of the actual light source output light intensity, it can be determined whether the transmission efficiency of the optical fiber is within the allowable error range.
[0056] In a specific embodiment, the optical fiber detection device is a portable device that integrates a collection module, a data processing module and a display interface. The optical fiber detection device is connected to a light source device through a standard optical fiber. The light source of the light source device can be an LED lamp with adjustable output light intensity.
[0057] During the fiber calibration phase, the fiber detection device first sends a series of preset PWM values ranging from 0% to 100% to the light source device. For each PWM value, the light source device outputs the corresponding light intensity, and the fiber detection device records the first ADC value (feedback from the light source device) at the light source output end and the second ADC value at the fiber output end. Thus, 11 sets of corresponding relationship data can be obtained.
[0058] The fiber optic detection equipment uses the least squares method to select two sets of data (for example, data when the PWM values are 30 and 70) to fit the second-order relationship: y = ax^2 + bx + c. Assume that the fitted relationship is: y = 0.002x^2 +1.5x + 10.
[0059] During the fiber detection phase, the fiber detection device sends a specific PWM value, such as 50%, to the light source device. The light source device outputs the corresponding light intensity, and the fiber detection device records the third ADC value at the light source output end and the fourth ADC value at the fiber output end. Substituting the fourth ADC value into the second-order relationship obtained above, the fifth ADC value can be calculated.
[0060] Finally, the fifth ADC value is compared with the third ADC value. Assuming that the preset allowable error range is 5%, when the calculated error exceeds 5%, the optical fiber transmission efficiency is poor, so the optical fiber detection fails.
[0061] In another embodiment, the optical fiber detection device can integrate multiple light intensity acquisition modules to improve the measurement accuracy. When obtaining the second ADC value and the fourth ADC value, two light intensity acquisition modules can be used simultaneously for measurement, and then the measurement results are median filtered and averaged to reduce the measurement error. This method can effectively reduce the error that may be caused by a single sensor and improve the accuracy of the overall measurement.
[0062] Traditional fiber optic detection methods usually require the use of expensive optical power meters and professional operators, which not only increases the detection cost, but also limits the popularity of the detection. The method proposed in this application only requires a simple ADC module and basic mathematical calculations to achieve accurate fiber optic transmission efficiency detection. Compared with traditional detection methods, the protection method proposed in this application improves the accuracy of detection. In addition, the method of this application does not need to directly measure the optical power, but judges the quality of the optical fiber by comparing the calculated value and the actual value. This indirect measurement method greatly simplifies the operation process, allowing non-professionals to easily complete fiber optic detection work. This not only reduces labor costs, but also improves detection efficiency.
[0063] Further, in step S1, the first instruction information at least includes a preset PWM value, and the preset PWM value has a value range of 0% to 100%;
[0064] Step S1 includes:
[0065] S11: Under the optical fiber calibration function, the light source device returns first feedback information according to the first instruction information sent by the optical fiber detection device. When the optical fiber detection device receives the first feedback information, the light source device parses the first instruction information and outputs light intensity according to the preset PWM value in the first instruction information.
[0066] S12: sequentially obtaining a first ADC value of the light intensity output by the light source and a second ADC value of the light intensity received by the optical fiber detection device in a range of 0% to 100% of the preset PWM value; the first ADC value and the second ADC value under the same preset PWM value are a group.
[0067] Among them, in this application, the optical fiber detection device includes multiple functions. When the user selects the optical fiber calibration function on the display screen, the MCU obtains the information on the display screen that the function is triggered, and generates a first instruction information and sends it to the light source device.
[0068] Among them, the first instruction information is the instruction information sent by the optical fiber detection device to the light source device through the serial port, and the instruction content includes at least a preset PWM value, wherein the preset PWM value can be implemented in a variety of ways, for example, 8-bit, 10-bit or 12-bit PWM control can be adopted, depending on the hardware platform used. The value range of the preset PWM value is 0% to 100%, which provides a standardized range. The preset PWM value is strongly corresponding to the light intensity output by the light source, and different preset PWM values correspond to different light intensities. In addition, the first instruction information also includes the function selected on the display screen of the optical fiber detection device, and the ADC value corresponding to the light intensity output by the light source device. When the optical fiber detection device sends the first instruction information, the ADC value corresponding to the light intensity output by the light source device is 0. After the light source device parses the content of the first instruction information and outputs the light intensity according to the content of the first instruction information, the ADC value corresponding to the light intensity output by the light source device will change.
[0069] In actual applications, first, the fiber optic detection device generates a first instruction message containing a preset PWM value. This preset PWM value is selected from the range of 0% to 100%, for example, it can start from 0% and increase by 1% each time. Next, the fiber optic detection device sends this first instruction message to the light source device. After receiving this instruction, the light source device will return a first feedback message, indicating that it has successfully received and is ready to execute the instruction. This process ensures the communication synchronization between the two devices and avoids possible data loss or errors. After the fiber optic detection device receives the first feedback message, the light source device begins to parse the first instruction message and outputs the corresponding light intensity according to the preset PWM value therein. In this process, the light source device may need to convert the PWM value into an actual driving current through an internal lookup table or calculation formula to ensure that there is an accurate correspondence between the output light intensity and the PWM value.
[0070] Then, the fiber optic detection device starts to collect data. It first records the first ADC value of the light intensity output by the light source device, which directly reflects the output intensity of the light source. At the same time, the fiber optic detection device also records the light intensity it receives, which is the second ADC value. This value reflects the light intensity after transmission through the optical fiber and contains the transmission characteristic information of the optical fiber. Repeat this process, using a different preset PWM value each time, until the entire range from 0% to 100% is covered. In this way, a series of data pairs can be obtained, each of which contains the first ADC value and the second ADC value at a specific PWM value.
[0071] This systematic data collection process provides the necessary data foundation for the subsequent generation of accurate second-order relationships for optical fiber calibration. By analyzing these data, a relationship model between the light source output and the received light intensity after optical fiber transmission can be established, thereby achieving accurate description and calibration of optical fiber transmission characteristics.
[0072] Compared with the traditional fiber optic detection method, the technical solution of this application has the function of accurately controlling the output of the light source device. By presetting the PWM value, the light intensity range from the lowest to the highest can be covered, ensuring the comprehensiveness of the data. And through the systematic data collection process, a large number of data points are obtained, providing a solid foundation for subsequent data analysis. By introducing a feedback mechanism, the reliability of the data collection process is improved, and possible errors and uncertainties are reduced. And this can be realized automatically, which greatly reduces the need for manual operation, improves efficiency and reduces errors.
[0073] Further, the optical fiber detection device includes at least two light intensity acquisition modules. In step S12, obtaining a second ADC value of the light intensity received by the optical fiber detection device includes:
[0074] S121: Acquire a sixth ADC value and a seventh ADC value of light intensity received by two light intensity acquisition modules in the optical fiber detection device;
[0075] S122: After performing median filtering on the sixth ADC value and the seventh ADC value, calculate the average to obtain a second ADC value.
[0076] Among them, in practical applications, the present application can improve the reliability and accuracy of data acquisition by using two light intensity acquisition modules to acquire light intensity data. Specifically: using two light intensity acquisition modules can simultaneously acquire two sets of light intensity data (the sixth ADC value and the seventh ADC value). This redundant design can reduce the impact of a single acquisition module failure or error on the overall measurement result. Performing median filtering on the two sets of data acquired can effectively remove outliers or noise interference and improve the stability and reliability of the data. Calculating the average value of the two sets of data after filtering further improves the accuracy of the second ADC value finally obtained.
[0077] In order to further improve the accuracy of the second ADC value, the two light intensity acquisition modules can use the same or different types of photosensitive elements to provide complementary measurement capabilities. For example, one module can use a photodiode with higher sensitivity but narrower dynamic range, while the other module can use a photomultiplier tube with wider dynamic range but slightly lower sensitivity. This configuration can obtain accurate measurement results under different light intensity conditions.
[0078] Furthermore, the optical fiber detection device also includes an optical power calibration function, the serial port on the optical fiber detection device is connected to the serial port on the light source device, the optical fiber of the light source device is respectively connected to the optical power meter and the optical fiber detection device, and the method also includes:
[0079] S5: When the optical power meter is connected to the light source device through the optical fiber, under the optical power calibration function, the light source device outputs different degrees of light intensities according to the first instruction information sent by the optical fiber detection device, and the optical power value of the optical power meter at this time is obtained; after the optical power value is collected, the light source device outputs different degrees of light intensities according to the first instruction information sent by the optical fiber detection device, and the second ADC value of the optical fiber detection device receiving different degrees of light intensities is obtained; wherein the light intensity output by the light source device when the optical power value is obtained is consistent with the light intensity output by the light source device when the second ADC value is obtained; and multiple groups of the second ADC value and the optical power value are obtained respectively;
[0080] S6: When the preset PWM value corresponding to the last second ADC value obtained is 100%, multiple groups of second ADC values and optical power values are selected to generate a second-order relationship for optical power calibration: y1 = a1*x^2 + b1*x + c1, where y1 is the optical power value; x is the second ADC value; a1, b1, and c1 are second-order coefficients respectively;
[0081] S7: Save the second-order relation of optical power calibration, and display that the optical power calibration is successful.
[0082] The optical fiber detection device also includes an optical power calibration function, and the optical fiber detection device is provided with a serial port for connecting a data line, and the serial port can connect the light source device to the optical fiber detection device through the data line. The method includes obtaining a second ADC value and an optical power value under the optical power calibration function, generating an optical power calibration second-order relation, and saving the relation.
[0083] In a specific implementation, the optical fiber detection device is always connected to the light source device. On this basis, an optical power meter is used to connect to the light source device. At this time, the light source device first outputs the light intensity according to the first instruction information sent by the optical fiber detection device, and reads the optical power value of the optical power meter. Then, the optical power value can be manually recorded and input into the internal memory of the optical fiber detection device for storage. After that, the connection between the optical power meter and the light source device is disconnected, and the second ADC value when the optical fiber detection device receives the light intensity is obtained. When the preset PWM value corresponding to the last second ADC value is 100%, it means that the optical fiber detection device has completed the collection of the second ADC value. At this time, multiple groups of optical power values and second ADC values can be selected to generate a second-order relationship for optical power calibration to realize the optical power calibration function.
[0084] Among them, in some specific implementations, the serial port of the optical fiber detection equipment can adopt multiple standard interfaces such as RS232, RS485 or USB to adapt to different light source equipment. The selection of the optical power meter can be carried out according to the measurement range and accuracy requirements. For example, an optical power meter with a range of -70dBm to +10dBm and an accuracy of ±0.1dB can be selected. When obtaining the second ADC value and the optical power value, multiple light intensity levels can be set, such as a preset PWM value with a value range of 0%-100%, and the corresponding second ADC value and optical power value under the preset PWM value are obtained respectively, so as to obtain a wider light intensity range and improve the accuracy of calibration.
[0085] When generating the optical power calibration second-order relationship, the least square method can be used for fitting to obtain the best fitting curve. The coefficients a1, b1, and c1 in the second-order relationship y1 = a1*x^2 + b1*x + c1 can be obtained through actual calculation. After the fitting is completed, the optical fiber detection device saves the optical power calibration relationship in the internal memory and displays the information of successful calibration.
[0086] Furthermore, the optical fiber detection device also includes an optical power display function, and after step S7, the following steps are included:
[0087] S71: Under the optical power display function, the light source device outputs an eighth ADC value of the light intensity according to the first instruction information sent by the optical fiber detection device, and substitutes the eighth ADC value as x into the optical power calibration second-order relationship to obtain a ninth ADC value;
[0088] S72: Display the ninth ADC value as the optical power.
[0089] Among them, in actual application, the optical fiber detection device sends a first instruction information containing a preset PWM value to the light source device through the serial port. After receiving the instruction, the light source device outputs the corresponding light intensity according to the preset PWM value. The optical fiber detection device obtains the eighth ADC value through its light intensity acquisition module, and the eighth ADC value reflects the actual situation of the current optical fiber transmission. Substitute the eighth ADC value into the second-order relationship established in the optical power calibration process: y1 = a1*x^2 + b1*x + c1, and the calculated y1 value is the ninth ADC value, which represents the actual optical power value. The optical fiber detection device displays this optical power value on its integrated LCD screen, and the unit can be dBm or mW.
[0090] Traditional methods usually require professional optical power meters and skilled technicians, which are complicated to operate and costly. The solution of this application integrates the optical power display function into the optical fiber detection equipment, greatly simplifying the operation process. And operators can quickly obtain optical power data without professional training, which improves work efficiency. In addition, the solution of this application improves the accuracy of optical power display by using a calibrated second-order relationship, which can better adapt to the characteristics of different light sources and optical fibers compared to simple linear conversion.
[0091] Furthermore, the optical fiber detection equipment also includes a collection sensitivity setting function. The optical fiber detection equipment at least includes an acquisition module. The acquisition module is provided with a sensor and a digital potentiometer. The sensor is used to collect light intensity data of the light intensity received by the optical fiber detection equipment; the sensor is connected to the digital potentiometer, and the digital potentiometer is connected to the MCU; after the sensor collects the light intensity data, the light intensity data is converted into a voltage. After passing through the digital potentiometer, the MCU reads the voltage and converts it into an ADC value for display; the digital potentiometer is an adjustable gear resistor, and the gear number value of the digital potentiometer is the sensitivity value.
[0092] Among them, this application realizes the sensitivity adjustment of light intensity acquisition by adding an acquisition sensitivity setting function in the optical fiber detection device. Specifically: the sensor in the acquisition module is used to collect the light intensity data received by the optical fiber detection device to provide raw data for subsequent sensitivity settings. The acquisition module is provided with a sensor and a digital potentiometer, the digital potentiometer is connected to the MCU, and the MCU is provided with an ADC pin, which can convert the read voltage into the corresponding ADC value for display.
[0093] In practical applications, the acquisition module can use various types of sensors to realize the collection of light intensity data. For example, photoelectric sensors such as photodiodes, photoresistors or photomultiplier tubes can be used. These sensors can convert the received light signals into electrical signals, thereby realizing the collection of light intensity data. The digital potentiometer is a programmable resistor. The resistance of the digital potentiometer is essentially written into the gear through the program. The chip of the digital potentiometer will calculate the corresponding resistance according to the gear value. Different resistance gears can be adjusted manually. When the adjusted gear value is low, its resistance is small. After passing through the digital potentiometer, the change in voltage is small, so that the change in ADC value corresponding to different light intensities is small. The ADC value with a small change is not conducive to the subsequent fitting calculation. Therefore, when the change in ADC value is small, you can choose to increase the resistance of the digital potentiometer to obtain an ADC value with a large change, so that in the subsequent fitting calculation, the result is more accurate. The gear value of the digital potentiometer is the sensitivity value. For example, if the gear of the digital potentiometer is 1, the sensitivity value is 1.
[0094] The connection between the digital potentiometer and the MCU can be realized in many ways, such as serial communication interface (SPI, I2C, etc.) or parallel data bus. This flexible connection method allows the system to adapt to different hardware configurations and application requirements.
[0095] After receiving the voltage, the MCU will convert it into an ADC value for display.
[0096] Furthermore, the method also includes:
[0097] S8: Under the acquisition sensitivity setting function, after the light source device emits light intensity, the optical fiber detection device collects the tenth ADC value of the light intensity and the sensitivity value;
[0098] S9: Determine whether the range of the tenth ADC value meets the range of the preset ADC value. When the range of the tenth ADC value does not meet the range of the preset ADC value, adjust the sensitivity value, and read the ADC value of the light intensity collected by the optical fiber detection device again after the adjusted sensitivity value, until the range of the ADC value meets the range of the preset ADC value.
[0099] Among them, in this application, after the user selects the acquisition sensitivity setting function on the display screen, the light source device emits light intensity, the sensor in the acquisition module collects the data signal of the light intensity, and converts the data signal into a voltage and sends it to the MCU. The MCU reads the voltage and converts the voltage into an ADC value for display.
[0100] Among them, the range of preset ADC values is customized according to user needs. When the range of the tenth ADC value does not meet the range of preset ADC values, adjust the sensitivity value (that is, adjust different gear values and change the resistance of the digital potentiometer). After each adjustment, the system needs to re-collect the ADC value and compare it. In order to improve efficiency, a maximum number of cycles can be set (such as 10 times). If the requirement is not met after exceeding this number, the system will prompt the user to check the fiber connection or light source status.
[0101] In some specific embodiments, for example, the light source device emits a light intensity of 0%-100%. After receiving the light intensity, the sensor converts it into a corresponding voltage, wherein the minimum voltage is 0.5V and the maximum voltage is 1.2V. After passing through the digital potentiometer, the resistance of the digital potentiometer is 5kΩ. When it reaches the MCU, the converted tenth ADC value ranges from 620 to 1489, and the preset ADC value range customized by the user according to the needs is between 1240 and 2978. The resistance of the adjusted digital positioner is 30kΩ, so that the range of the adjusted ADC value meets the range of the preset ADC value. This makes the ADC value involved in the subsequent fitting calculation more accurate, and the evaluation of the optical fiber transmission efficiency more accurate.
[0102] The sensitivity setting button can be designed in various forms, such as a physical button, such as an up and down adjustment button, or a virtual slider or a digital input box on a touch screen, and the sensitivity setting can be repeatedly adjusted. By setting the sensitivity setting, the resistance of the digital potentiometer can be quickly adjusted, which is more convenient for users to use.
[0103] In a second aspect, an optical fiber detection device comprises:
[0104] Acquisition module 201: Acquiring a first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber calibration function, and a second ADC value when the optical fiber detection device receives the light intensity; the first ADC value and the second ADC value are respectively obtained in multiple groups corresponding to different light intensities output by the light source device;
[0105] The first calculation module 202: selects multiple groups of first ADC values and second ADC values to generate a second-order relationship for optical fiber calibration: y = a*x^2 + b*x + c, where y is the first ADC value; x is the second ADC value; a, b, c are second-order coefficients respectively;
[0106] The second calculation module 203: obtains the third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber detection function, and the fourth ADC value when the optical fiber detection device receives the light intensity, and substitutes the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value;
[0107] The detection module 204 compares the fifth ADC value with the third ADC value, and if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, it is displayed that the optical fiber detection has passed; otherwise, it is displayed that the optical fiber detection has failed.
[0108] Among them, the optical fiber detection device is applied to any of the above optical fiber detection methods, and the accurate detection of optical fiber transmission efficiency is achieved through the collaborative work of multiple modules. The acquisition module 201 is responsible for collecting calibration data to provide a basis for subsequent calculations. The first calculation module 202 uses the acquired calibration data to establish a second-order relationship for optical fiber calibration. The second calculation module 203 obtains a new ADC value during actual detection and calculates using the previously established relationship. The detection module 204 determines whether the transmission efficiency of the optical fiber meets the requirements by comparing the calculated theoretical value with the actual measured value.
[0109] Under the optical fiber calibration function, the acquisition module 201 can obtain the first ADC value of the light intensity output by the light source device and the second ADC value of the light intensity received by the optical fiber detection device in a variety of ways. For example, a timed sampling method can be used to continuously obtain multiple sets of data within a preset time interval; the sampling frequency can also be adaptively adjusted according to the gradient of the light intensity change to ensure that more data points are obtained when the light intensity changes greatly. These data reflect the transmission characteristics of the optical fiber under different light intensities and provide a comprehensive basis for subsequent calculations and analysis.
[0110] When the first calculation module 202 selects two sets of first ADC values and second ADC values to generate the second-order relationship of optical fiber calibration, it can use mathematical methods such as least squares method to determine the second-order coefficients a, b and c. This method not only takes into account the nonlinear characteristics of optical fiber transmission, but also effectively reduces the influence of random errors and improves the accuracy of calibration.
[0111] During actual detection, the second calculation module 203 can use real-time calculation to immediately substitute the fourth ADC value obtained into the optical fiber calibration second-order relationship to obtain the fifth ADC value. This real-time calculation method can quickly respond to changes in optical fiber transmission efficiency, which is conducive to timely discovery of potential problems.
[0112] When comparing the fifth ADC value with the third ADC value, the detection module 204 can set a dynamic preset allowable error range. For example, the percentage of the allowable error can be adjusted according to the light intensity, allowing a larger relative error at low light intensity, and requiring stricter error control at high light intensity. This flexible error control strategy can adapt to the needs of different application scenarios and improve the reliability of detection.
[0113] Please refer to Figure 3 , Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the present application provides an electronic device 3, including: a processor 301 and a memory 302, the processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not shown), the memory 302 stores computer-readable instructions executable by the processor 301, when the electronic device is running, the processor 301 executes the computer-readable instructions to execute the method in any optional implementation of the above embodiment to achieve the following functions: Under the optical fiber calibration function, a first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device, and a second ADC value when the optical fiber detection device receives the light intensity are obtained; multiple groups of the first ADC value and the second ADC value are obtained corresponding to different light intensities output by the light source device; two groups of first ADC values and second ADC values are selected to generate a second-order relation for optical fiber calibration: y = a*x^2 + b*x^2 +c, where y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively; obtaining the third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber detection function, and the fourth ADC value when the optical fiber detection device receives the light intensity, and substituting the fourth ADC value as x into the second-order relationship of the optical fiber calibration to obtain the fifth ADC value; comparing the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within the preset allowable error range, it is displayed that the optical fiber detection passes, otherwise, it is displayed that the optical fiber detection fails.
[0114] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method in any optional implementation of the above embodiment is executed to implement the following functions: obtaining a first ADC value of the light intensity output by a light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber calibration function, and a second ADC value when the optical fiber detection device receives the light intensity; the first ADC value and the second ADC value are respectively obtained in multiple groups corresponding to different light intensities output by the light source device; selecting two groups of first ADC values and second ADC values to generate a second-order relational formula for optical fiber calibration: y= a*x^2 + b*x + c, wherein y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively; obtaining a third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber detection function, and a fourth ADC value when the optical fiber detection device receives the light intensity, and substituting the fourth ADC value as x into the second-order relational formula for optical fiber calibration to obtain a fifth ADC value; comparing the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, then displaying that the optical fiber detection is passed, otherwise, displaying that the optical fiber detection fails.
[0115] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0116] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0118] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0119] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for detecting an optical fiber, characterized in that: The method is applied to an optical fiber detection device, the optical fiber detection device is connected to a light source device via an optical fiber, and is used to detect the transmission efficiency of the optical fiber. The optical fiber detection device at least includes an optical fiber calibration function and an optical fiber detection function. The method includes: S1: Under the optical fiber calibration function, the first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device, and the second ADC value when the optical fiber detection device receives the light intensity are obtained; the first ADC value and the second ADC value are respectively obtained in multiple groups corresponding to different light intensities output by the light source device; the first instruction information at least includes a preset PWM value, and the value range of the preset PWM value is 0% to 100%; S2: Select multiple groups of the first ADC value and the second ADC value to generate a second-order relationship for optical fiber calibration: y = a*x^2 +b*x + c, where y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively; S3: obtaining, under the optical fiber detection function, a third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device, and a fourth ADC value of the light intensity received by the optical fiber detection device, and substituting the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value; S4: comparing the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, then the optical fiber detection is displayed as passed, otherwise, the optical fiber detection fails; The optical fiber detection device also includes an optical power calibration function, the serial port on the optical fiber detection device is connected to the serial port on the light source device, the optical fiber of the light source device is respectively connected to the optical power meter and the optical fiber detection device, and the method further includes: S5: When the optical power meter is connected to the light source device through an optical fiber, under the optical power calibration function, the light source device outputs different degrees of light intensity according to the first instruction information sent by the optical fiber detection device, and the optical power value of the optical power meter at this time is obtained; after the optical power value is collected, the light source device outputs different degrees of light intensity according to the first instruction information sent by the optical fiber detection device, and the second ADC value of the optical fiber detection device receiving different degrees of light intensity is obtained; wherein the light intensity output by the light source device when obtaining the optical power value is consistent with the light intensity output by the light source device when obtaining the second ADC value; and the second ADC value and the optical power value are obtained in multiple groups respectively; S6: When the preset PWM value corresponding to the last second ADC value obtained is 100%, select multiple groups of the second ADC values and the optical power value to generate a second-order relationship for optical power calibration: y1 = a1*x^2 + b1*x + c1, where y1 is the optical power value; x is the second ADC value; a1, b1, and c1 are second-order coefficients respectively; S7: Save the optical power calibration second-order relationship, indicating that the optical power calibration is successful; The optical fiber detection device also includes an optical power display function, and after step S7, the following steps are included: S71: obtaining an eighth ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical power display function, substituting the eighth ADC value as x into the optical power calibration second-order relationship to obtain a ninth ADC value; S72: Display the ninth ADC value as optical power.
2. A method for detecting optical fiber according to claim 1, characterized in that: In step S1, step S1 includes: S11: Under the optical fiber calibration function, the light source device returns first feedback information according to the first instruction information sent by the optical fiber detection device. When the optical fiber detection device receives the first feedback information, the light source device parses the first instruction information and outputs light intensity according to the preset PWM value in the first instruction information. S12: sequentially acquiring the first ADC value of the light intensity output by the light source and the second ADC value of the light intensity received by the optical fiber detection device in the value range of the preset PWM value from 0% to 100%; the first ADC value and the second ADC value under the same preset PWM value are a group.
3. A method for detecting optical fiber according to claim 2, characterized in that: The optical fiber detection device includes at least two light intensity acquisition modules. In step S12, obtaining the second ADC value of the light intensity received by the optical fiber detection device includes: S121: Acquire a sixth ADC value and a seventh ADC value of light intensity received by two light intensity acquisition modules in the optical fiber detection device; S122: After performing median filtering on the sixth ADC value and the seventh ADC value, calculate the average to obtain the second ADC value.
4. The optical fiber detection method according to claim 1, characterized in that: The optical fiber detection device also includes a collection sensitivity setting function. The optical fiber detection device at least includes a collection module. The collection module is provided with a sensor and a digital potentiometer. The sensor is used to collect light intensity data of the light intensity received by the optical fiber detection device; the sensor is connected to the digital potentiometer, and the digital potentiometer is connected to the MCU; after the sensor collects the light intensity data, the light intensity data is converted into a voltage. After passing through the digital potentiometer, the MCU reads the voltage and converts it into an ADC value for display; the digital potentiometer is an adjustable gear resistor, and the gear number value of the digital potentiometer is the sensitivity value.
5. A method for detecting optical fiber according to claim 4, characterized in that: The method further comprises: S8: Under the acquisition sensitivity setting function, after the light source device emits light intensity, the optical fiber detection device collects the tenth ADC value of the light intensity and the sensitivity value; S9: Determine whether the range of the tenth ADC value meets the range of the preset ADC value. When the range of the tenth ADC value does not meet the range of the preset ADC value, adjust the sensitivity value, and read the ADC value of the light intensity collected by the optical fiber detection device again under the adjusted sensitivity value until the range of the ADC value meets the range of the preset ADC value.
6. An optical fiber detection device, characterized in that: The step applied to the method of any one of claims 1 to 5, wherein the device comprises: Acquisition module: Acquiring a first ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber calibration function, and a second ADC value when the optical fiber detection device receives the light intensity; the first ADC value and the second ADC value are obtained in multiple groups corresponding to different light intensities output by the light source device; The first calculation module: selects multiple groups of the first ADC value and the second ADC value to generate a second-order relationship for optical fiber calibration: y = a*x^2 + b*x + c, wherein y is the first ADC value; x is the second ADC value; a, b, and c are second-order coefficients respectively; The second calculation module is used to obtain a third ADC value of the light intensity output by the light source device according to the first instruction information sent by the optical fiber detection device under the optical fiber detection function, and a fourth ADC value when the optical fiber detection device receives the light intensity, and substitute the fourth ADC value as x into the optical fiber calibration second-order relationship to obtain a fifth ADC value; Detection module: compare the fifth ADC value with the third ADC value, if the error between the fifth ADC value and the third ADC value is within a preset allowable error range, then display that the optical fiber detection is passed, otherwise, display that the optical fiber detection is failed.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 5 are executed.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Method, device and mobile terminal for calibrating light sensor
CN109059987A
Optical module SOA input and output optical power monitoring method based on PID algorithm
CN116155374A
Medical light source convenient for checking optical energy transmission efficiency of optical fiber
CN218186758U