Method for improving flatness measurement accuracy

By using a staggered layout of the regional sensor array on the robotic arm and signal processing technology, the problem of noise interference in PCB board measurement by laser displacement sensors has been solved, achieving high-precision and low-cost flatness detection, which is suitable for automated production lines.

CN122329201APending Publication Date: 2026-07-03NANTONG XINKE INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG XINKE INTELLIGENT TECH CO LTD
Filing Date
2026-05-19
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing laser displacement sensors are affected by noise interference in PCB board flatness measurement, resulting in insufficient measurement accuracy and difficulty in meeting high-precision detection requirements. Furthermore, improving hardware performance would significantly increase costs.

Method used

A robotic arm-based regional sensor array is used, and virtual measurement points are constructed to improve accuracy through staggered layout and signal processing techniques, including mean filtering, synchronous triggering, weighted averaging and system error compensation.

Benefits of technology

Without increasing hardware investment, it significantly improves measurement accuracy to 0.01 mm level, is robust, adaptable to complex working conditions, reduces costs, and supports automated and unmanned production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122329201A_ABST
    Figure CN122329201A_ABST
Patent Text Reader

Abstract

This invention relates to the field of PCB board flatness inspection technology, and discloses a method for improving the accuracy of flatness measurement. The method includes: integrating sensors based on a robotic arm and forming a regional sensor array through a staggered layout; performing mean filtering and synchronous triggering processing on the signals collected by each sensor; constructing a virtual measurement point height value by weighted averaging and fusing the readings of different sensors in the core measurement group based on the measurement results of the regional sensor array; calculating the local plane tilt angle using the readings of the reference measurement group and the height value of the virtual measurement point; and controlling the robotic arm to drive the regional sensor array to scan the surface of the workpiece to be measured, thereby fitting the surface morphology of the workpiece and achieving high-precision flatness inspection. This invention meets the stringent requirements for flatness inspection during PCB board drilling, and can achieve the detection accuracy of high-performance sensors using low-performance sensors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of PCB board flatness inspection technology, and more specifically, to a method for improving the accuracy of flatness measurement. Background Technology

[0002] In the printed circuit board (PCB) manufacturing process, the flatness of the PCB board is one of the key factors affecting the drilling quality. To ensure drilling position accuracy and processing quality, the mounting flatness of the PCB board needs to be accurately inspected before drilling. As electronic products develop towards miniaturization and high density, the requirements for the accuracy of PCB board flatness inspection are increasing. Traditional contact measurement methods are inefficient and easily damage the board surface. Non-contact laser displacement sensors, due to their advantages such as fast measurement speed and no damage to the workpiece, have become the mainstream technology for PCB board flatness inspection and are gradually being applied in automated production lines.

[0003] Currently, laser displacement sensors are widely used in industrial production to measure the flatness of PCB boards. These sensors emit a laser beam to illuminate the surface being measured, and use an optical detector to receive the reflected light signal and convert it into displacement data, thus achieving non-contact height measurement. However, in actual measurement, the measurement accuracy of the sensor is limited by a variety of factors, including thermal noise generated by the internal chip and resistors of the sensor, intensity fluctuations of the laser source, background noise generated by the detector during photoelectric conversion, reading fluctuations caused by power supply ripple, interference from ambient light and electromagnetic fields, signal changes caused by surface roughness, dust, and oil contamination of the measured object, and relative displacement caused by mechanical vibration. These random and unavoidable minute changes will manifest as noise in the measurement data, directly affecting the accuracy and stability of the measurement results.

[0004] Current technologies primarily rely on improving sensor hardware performance to enhance measurement accuracy, such as using higher-precision laser sources, more sensitive detectors, or more stable circuit designs. However, this approach significantly increases hardware costs, and even with high-precision sensors, the impact of various types of noise cannot be fundamentally eliminated. Taking PCB board drilling as an example, existing sensors with an accuracy of 0.05 mm are insufficient to meet increasingly stringent flatness detection requirements. Achieving a detection accuracy of 0.01 mm requires high-performance sensors, leading to a substantial increase in equipment costs for automated production lines. This hinders the widespread application of high-precision detection technology in small and medium-sized enterprises. Therefore, there is an urgent need for a technology that can effectively improve measurement accuracy and eliminate noise interference without significantly increasing hardware investment.

[0005] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention

[0006] In view of the problems in the related technologies, the present invention proposes a method to improve the accuracy of flatness measurement, so as to overcome the above-mentioned technical problems existing in the existing related technologies.

[0007] Therefore, the specific technical solution adopted by the present invention is as follows: A method for improving the accuracy of flatness measurement, the method comprising: The gripper bracket based on the robotic arm integrates several sensors and forms a regional sensor array through a staggered layout. In this regional sensor array, the laser points of some sensors are focused on the same area as the core measurement group, while the laser points of the remaining sensors are offset to adjacent areas as the reference measurement group. During the measurement process of the regional sensor array, the signals collected by each sensor are subjected to mean filtering and synchronous triggering to suppress random noise and ensure data synchronization. Based on the measurement results of the regional sensor array, the height value of the virtual measurement point is constructed by weighted averaging and fusing the readings of different sensors in the core measurement group, and the local plane tilt angle is calculated using the readings of the reference measurement group and the height value of the virtual measurement point. By controlling a robotic arm to drive an array of regional sensors to scan the surface of the workpiece, the height values ​​of virtual measurement points at different locations and the local plane tilt angle are obtained to fit the surface morphology of the workpiece and achieve high-precision flatness detection.

[0008] Furthermore, the staggered layout includes a one-front-multiple-back layout and a diamond-shaped distribution layout. The one-front-multiple-back layout includes: a core measurement group containing at least three sensors, whose laser points are projected onto mutually close central areas; a reference measurement group containing at least one sensor, whose laser point is separated from the laser point area of ​​the core measurement group by a predetermined distance. The diamond-shaped distribution layout includes: at least three sensors whose laser points are close to each other to form a core measurement group; at least one sensor whose laser point is separated from the laser point area of ​​the core measurement group by a predetermined distance to form a reference measurement group; and at least four sensors whose laser points are located at the vertices of the diamond-shaped areas, with the distance between adjacent sensors in the reference measurement group and the core measurement group being greater than the distance between adjacent sensors within the core measurement group.

[0009] Furthermore, the sensor includes a laser displacement sensor; the area sensor array contains at least four sensors; mean filtering is achieved by averaging the continuous multiple sample values ​​of each sensor; and synchronous triggering processing is achieved by simultaneously controlling all laser displacement sensors to acquire data at a certain moment.

[0010] Furthermore, the weighted average fusion of different sensor readings from the core measurement group includes a calibration stage and a real-time measurement stage; the calibration stage is used to obtain system error compensation parameters, and the real-time measurement stage is used to correct errors based on the system error compensation parameters and output measurement results.

[0011] Furthermore, the calibration stage includes: controlling the robotic arm to grasp the sensor array in the area so that all laser points simultaneously illuminate the standard plate, and recording the reference readings of each sensor at this time; calculating the difference between the reference readings of each sensor in the core measurement group, and storing this difference as a system error for error compensation during the real-time measurement stage; wherein, the accuracy of the standard plate is higher than the individual measurement accuracy of the sensor.

[0012] Furthermore, the real-time measurement stage includes: synchronously triggering all sensors in the regional sensor array to sample and obtain real-time raw readings of the core measurement group and the reference measurement group; performing system error compensation on the real-time raw readings of each sensor in the core measurement group to obtain corrected readings; performing weighted average fusion of the corrected readings of the core measurement group to obtain the fused height value of the virtual measurement point; calculating the height of the reference point based on the readings of the reference measurement group, and combining the fused height value of the virtual measurement point with the known horizontal distance between the two to calculate the local plane tilt angle as the flatness detection result.

[0013] Furthermore, the systematic error compensation for the real-time raw readings of each sensor in the core measurement group includes: subtracting the systematic error recorded by the sensor during the calibration phase from the real-time raw readings of each sensor in the core measurement group to obtain the corrected reading.

[0014] Furthermore, the weighted average fusion of the corrected readings of the core measurement group yields the fusion height value of the virtual measurement point. This includes: when using a fixed weight fusion method, adding the corrected readings of each sensor in the core measurement group and dividing by the number of sensors to obtain the fusion height value of the virtual measurement point.

[0015] Furthermore, the weighted average fusion of the corrected readings of the core measurement group also includes an adaptive weighted fusion method, which specifically includes: calculating the variance of the readings of each sensor in the core measurement group in real time within the most recent preset number of cycles; if the variance of the readings is larger, it indicates that the sensor data jitter is greater; assigning adaptive weights according to the reciprocal of the variance of the readings of each sensor, so that sensors with large variances of readings receive smaller adaptive weights and sensors with small variances of readings receive larger adaptive weights; and multiplying the corrected readings of each sensor in the core measurement group by their corresponding adaptive weights and summing the results to obtain the fusion height value of the virtual measurement point.

[0016] Further, calculating the local plane tilt angle includes: obtaining the difference between the fused height value of the virtual measurement point and the height of the reference point as the height difference; dividing the height difference by the known horizontal distance between the virtual measurement point and the reference point to obtain the local plane tilt angle.

[0017] The beneficial effects of this invention are as follows: (1) This invention achieves a significant improvement in measurement accuracy without changing the structure of the drilling machine table by using a staggered layout of the regional sensor array and multi-sensor fusion. Compared with the traditional single-sensor measurement method, this invention uses multiple sensors in the core measurement group to perform redundant measurements on the same area. It also suppresses random noise such as laser light source intensity fluctuation, detector photoelectric conversion noise, and ambient light interference by mean filtering. Then, it eliminates systematic deviations such as sensor chip thermal noise and power supply ripple by system error compensation. Finally, it constructs virtual measurement points by weighted average fusion, so that the ordinary laser displacement sensor with an original accuracy of 0.05 mm can achieve a detection accuracy of 0.01 mm, which is equivalent to improving the measurement accuracy by 5 times. This effectively solves the strict requirements of PCB board drilling for flatness detection, while significantly reducing the hardware investment cost of the sensor and achieving the detection accuracy of a high-performance sensor with a low-performance sensor.

[0018] (2) The adaptive weighted fusion mechanism introduced in this invention can automatically identify and reduce the influence of unreliable sensors, significantly improving the robustness of the measurement system under complex working conditions. In the actual PCB board inspection process, when a sensor causes a sudden signal change due to local dust, oil stains, roughness changes, or reflectivity differences on the PCB board surface, the system calculates the variance of each sensor's readings within the most recent preset number of cycles in real time, and automatically assigns weights based on the reciprocal of the variance, so that sensors with stable readings receive larger weights and sensors with severe reading jitter receive smaller weights. This avoids the problem of overall measurement result distortion caused by interference from a single sensor, ensuring that the measurement system can maintain high precision and high stability even under conditions of variable PCB board surface conditions and complex production environments, with a positioning accuracy of ±0.001 mm and a yield rate of over 99%.

[0019] (3) This invention realizes the automation and unmanned operation of PCB board flatness inspection. By using a robotic arm to drive a regional sensor array to scan the surface of the workpiece to be tested, the height values ​​of virtual measurement points at different positions and the local plane tilt angle are obtained. The PCB board surface morphology is fitted and the presence of warping deformation is automatically determined, replacing the traditional manual inspection method and providing strong support for enterprises to reduce costs and increase efficiency. This method does not change the drilling machine table structure and is applicable to all drilling machines on the market. The cycle time is shortened by 30%-50%, supporting 24-hour continuous production. The algorithm supports rapid order switching, adapting to the flexible production needs of small batches and multiple varieties. It reduces the dependence on manual labor and skilled workers, effectively improving key production indicators such as production cycle time, yield, and equipment OEE, and promoting the transformation and upgrading of the PCB board drilling industry towards intelligent manufacturing. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating a method for improving the accuracy of flatness measurement according to an embodiment of the present invention; Figure 2 This is a flowchart of the real-time measurement stage in a method for improving flatness measurement accuracy according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a one-front-multiple-rear layout in a method for improving flatness measurement accuracy according to an embodiment of the present invention; Figure 4 This is a schematic diagram of a rhombus distribution layout in a method for improving the accuracy of flatness measurement according to an embodiment of the present invention; Figure 5 This is a detailed implementation diagram of a method for improving the accuracy of flatness measurement according to an embodiment of the present invention. Detailed Implementation

[0022] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.

[0023] According to an embodiment of the present invention, a method for improving the accuracy of flatness measurement is provided.

[0024] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, according to an embodiment of the present invention, a method for improving the accuracy of flatness measurement is provided, the method comprising: The gripper bracket based on the robotic arm integrates several sensors and forms a regional sensor array through a staggered layout. In this regional sensor array, the laser points of some sensors are focused on the same area as the core measurement group, while the laser points of the remaining sensors are offset to adjacent areas as the reference measurement group. During the measurement process of the regional sensor array, the signals collected by each sensor are subjected to mean filtering and synchronous triggering to suppress random noise and ensure data synchronization. Based on the measurement results of the regional sensor array, the height value of the virtual measurement point is constructed by weighted averaging and fusing the readings of different sensors in the core measurement group, and the local plane tilt angle is calculated using the readings of the reference measurement group and the height value of the virtual measurement point. By controlling a robotic arm to drive an array of regional sensors to scan the surface of the workpiece, the height values ​​of virtual measurement points at different locations and the local plane tilt angle are obtained to fit the surface morphology of the workpiece and achieve high-precision flatness detection.

[0025] In one embodiment, the staggered layout includes a front-and-back layout and a diamond-shaped distribution layout. The front-and-back layout includes: a core measurement group comprising at least three sensors, whose laser points are projected onto mutually adjacent central regions; a reference measurement group comprising at least one sensor, whose laser point is separated from the laser point region of the core measurement group by a predetermined distance; and a diamond-shaped distribution layout including: at least three sensors whose laser points are close together to form a core measurement group; at least one sensor whose laser point is separated from the laser point region of the core measurement group by a predetermined distance to form a reference measurement group; and at least four sensors whose laser points are located at the vertices of the diamond-shaped regions, with the distance between adjacent sensors in the reference measurement group and the core measurement group being greater than the distance between adjacent sensors within the core measurement group.

[0026] In one embodiment, the sensor includes a laser displacement sensor; the area sensor array contains at least four sensors; mean filtering is achieved by averaging multiple consecutive sample values ​​from each sensor; and synchronous triggering is achieved by simultaneously controlling all laser displacement sensors to acquire data at a certain moment.

[0027] In one embodiment, the weighted average fusion of different sensor readings from the core measurement group includes a calibration stage and a real-time measurement stage; wherein, the calibration stage is used to obtain system error compensation parameters, and the real-time measurement stage is used to correct errors based on the system error compensation parameters and output measurement results.

[0028] In one embodiment, the calibration stage includes: controlling the robotic arm to grasp the sensor array in the area so that all laser points simultaneously illuminate the standard plate, and recording the reference readings of each sensor at this time; calculating the difference between the reference readings of each sensor in the core measurement group, and storing the difference as a system error for error compensation during the real-time measurement stage; wherein the accuracy of the standard plate is higher than the individual measurement accuracy of the sensor.

[0029] In one embodiment, such as Figure 2 As shown, the real-time measurement stage includes: synchronously triggering all sensors in the regional sensor array to sample and obtain real-time raw readings of the core measurement group and the reference measurement group; performing system error compensation on the real-time raw readings of each sensor in the core measurement group to obtain corrected readings; performing weighted average fusion of the corrected readings of the core measurement group to obtain the fused height value of the virtual measurement point; calculating the height of the reference point based on the readings of the reference measurement group, and combining the fused height value of the virtual measurement point and the known horizontal distance between them to calculate the local plane tilt angle as the flatness detection result.

[0030] In one embodiment, compensating for system errors in the real-time raw readings of each sensor in the core measurement group includes: subtracting the system error recorded by the sensor during the calibration phase from the real-time raw readings of each sensor in the core measurement group to obtain a corrected reading; The expression for systematic error is: error_sys12=d1_base-d2_base; error_sys13=d1_base-d3_base; In the formula, error_sys12 is the systematic error between the first and second sensors in the core measurement group; error_sys13 is the systematic error between the first and third sensors in the core measurement group; d1_base, d2_base, and d3_base are the reference readings recorded by the first, second, and third sensors during the calibration phase, respectively. The expression for correcting the reading is: d1_corrected=d1-error_sys12; d2_corrected=d2; d3_corrected=d3-error_sys13; In the formula, d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors, respectively; d1, d2, and d3 are the real-time raw readings of the first, second, and third sensors, respectively; and the second sensor serves as the reference sensor and is not subject to error compensation.

[0031] In one embodiment, the weighted average fusion of the corrected readings of the core measurement group to obtain the fusion height value of the virtual measurement point includes: when using a fixed weight fusion method, the corrected readings of each sensor in the core measurement group are added together and then divided by the number of sensors to obtain the fusion height value of the virtual measurement point. The expression for the fused height value of virtual measurement points under the fixed-weight fusion method is: dA_fused=(d1_corrected+d2_corrected+d3_corrected) / 3; In the formula, dA_fused is the fusion height value of the virtual measurement point; d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors in the core measurement group, respectively.

[0032] In one embodiment, the weighted average fusion of the corrected readings of the core measurement group further includes an adaptive weighted fusion method, specifically including: calculating in real time the variance of the readings of each sensor in the core measurement group within the most recent preset number of cycles; if the variance of the readings is larger, it indicates that the sensor data jitter is greater; assigning adaptive weights according to the reciprocal of the variance of the readings of each sensor, so that sensors with large variances of readings receive smaller adaptive weights and sensors with small variances of readings receive larger adaptive weights; and multiplying the corrected readings of each sensor in the core measurement group by their corresponding adaptive weights and summing the results to obtain the fusion height value of the virtual measurement point. The expression for adaptive weights is: w1=(1 / var1) / (1 / var1+1 / var2+1 / var3); w2=(1 / var2) / (1 / var1+1 / var2+1 / var3); w3=(1 / var3) / (1 / var1+1 / var2+1 / var3); In the formula, w1, w2, and w3 are the adaptive weights of the first, second, and third sensors in the core measurement group, respectively; var1, var2, and var3 are the reading variances of the first, second, and third sensors, respectively. The expression for the fused height value of virtual measurement points under the adaptive weighted fusion method is: dA_fused=w1×d1_corrected+w2×d2_corrected+w3×d3_corrected; In the formula, dA_fused is the fusion height value of the virtual measurement point; d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors in the core measurement group, respectively.

[0033] In one embodiment, calculating the local plane tilt angle includes: obtaining the difference between the fused height value of the virtual measurement point and the height of the reference point as the height difference; dividing the height difference by the known horizontal distance between the virtual measurement point and the reference point to obtain the local plane tilt angle; The expression for the local plane tilt angle is: θ = arctan(Δh / L); Δh = dA_fused - dB; In the formula, θ is the local plane tilt angle; Δh is the height difference; dA_fused is the fused height value of the virtual measurement point; dB is the height of the reference point; and L is the known horizontal distance between the virtual measurement point and the reference point.

[0034] Specifically, this invention proposes a method to improve the accuracy of flatness measurement. By installing and integrating four or more laser displacement sensors on the gripper bracket of a robotic arm, the accuracy is improved through sensor "misalignment" and "signal conditioning". The detection accuracy is improved through algorithms of "differential measurement" and "data fusion". The core of the invention is "using multiple low-precision sensors to construct a high-precision virtual measurement point through algorithms". Furthermore, this invention can verify and eliminate errors caused by measurement noise.

[0035] Specifically, the technical solution and algorithm of this invention are as follows: I. Mechanical Structure Design (Offset Placement) The layout scheme of the present invention can adopt a one-front-multiple-back layout or a diamond distribution layout, including a "one-front-three-back" or "diamond" staggered layout.

[0036] like Figure 3 As shown, Scheme A (one in front and three behind): the laser points of the three sensors (S1, S2, S3) are projected into a circular area with a diameter of 100-200mm (almost a single point); the laser point of the fourth sensor (S4) is next to this area, offset from the large circle by about 200-300mm.

[0037] like Figure 4As shown, Scheme B (diamond layout): 4 sensor laser points are projected onto the four corners of a diamond. The size of the diamond is set according to the size of the workpiece, such as 400mm×300mm. The distance between points S1, S2, and S3 is no more than 200mm, and the distance between S4 and S2 is about 400mm.

[0038] Specifically, the purpose of this invention is to use S1, S2, and S3 as a core group to jointly measure the height of a "virtual point." Their readings should be identical; any discrepancies arise from noise and error. S4 is used as a reference group to provide reference heights for adjacent areas to calculate local tilt angles.

[0039] II. Electrical Connections and Signal Conditioning The hardware of this invention can be a PLC or industrial computer + 4-channel high-speed digital acquisition card (or directly use the Ethernet / RS485 bus function built into the sensor).

[0040] It should be noted that the "adjustment of sensing signal" in this invention is not hardware adjustment, but real-time signal processing through software algorithms, including: 1) mean filtering: averaging the 5-10 consecutive sampling values ​​of each sensor to suppress random noise; 2) synchronous triggering: all 4 sensors must be triggered simultaneously to ensure that the data is a "snapshot" at the same moment, avoiding errors introduced by robot arm tremors or workpiece movement.

[0041] III. Core Algorithms and Computation Methods It should be noted that the core of the algorithm of this invention is "using multiple low-precision sensors to construct a high-precision virtual measurement point through an algorithm," specifically including: Step 1: Calibration (must be completed before measurement).

[0042] Specifically, the present invention is calibrated on a standard flat plate, as follows: 1) The robotic arm grasps the sensor array and makes all four light spots shine on a standard flat plate (a standard flat plate gauge block with an accuracy higher than ±0.05 mm, and the gauge block accuracy can be selected as ±0.005 mm).

[0043] 2) Record the readings of the four sensors at this time: d1_base, d2_base, d3_base, d4_base.

[0044] 3) At this point, the readings of S1, S2, and S3 should theoretically be equal. The slight difference between them is the "systematic error." Record this error: error_sys12=d1_base-d2_base; error_sys13=d1_base-d3_base; Step 2: Real-time measurement and data processing.

[0045] This embodiment uses a "one-front-three-back" layout as an example, measured at points A (S1, S2, S3) and point B (S4). See the layout diagrams for both scheme A and scheme B. Figure 3 and Figure 4 The actual calculation principle and method are the same.

[0046] 1) Simultaneously read the raw values ​​of 4 sensors: d1, d2, d3, d4.

[0047] 2) Calculate the "fusion height value" of point A. The purpose of this step is to measure the same point using three sensors, which can significantly reduce random errors. Calculate the weighted average. Since the readings of the three sensors are theoretically of the same reliability, the arithmetic average can be directly calculated: dA_fused = (d1 + d2 + d3) / 3; the specific correction method is that if a sensor is found to have significantly more noise, it can be given a smaller weight.

[0048] 3) Compensation for systematic errors: The system errors recorded during the calibration phase are compensated back to obtain a more accurate height of point A.

[0049] d1_corrected=d1-error_sys12; d2_corrected=d2 (as a baseline); d3_corrected=d3-error_sys13; dA_fused=(d1_corrected+d2_corrected+d3_corrected) / 3; Specifically, dA_fused here describes an advanced algorithm that further eliminates errors at the measurement points.

[0050] 4) Calculate the local plane tilt (using the misaligned S4): S4 measures the height of point B, dB = d4.

[0051] The height difference between point A and point B is Δh = dA_fused - dB.

[0052] Specifically, the horizontal distance L between points A and B is known (a fixed value determined during mechanical design, such as...). Figure 5 As shown, these are the dimensions in two horizontal directions.

[0053] Calculate the local tilt angle at point A: θ = arctan(Δh / L); since θ is very small, we can approximate it as θ≈Δh / L (radian value).

[0054] according to Figure 5 Calculation: Assume Δh is 0.1 mm (value has been enlarged), refer to... Figure 5 If L is set to 700mm, then θ≈0.1 / 700≈0.00014.

[0055] 5) Final output: Specifically, the absolute height dA_fused of point A is finally obtained, and the accuracy of this value is much higher than that of a single sensor; the plane tilt angle θ at point A.

[0056] It should be noted that the principle of accuracy improvement in this invention is as follows: ①Averaging effect: Assume that the random noise of each sensor is δ and they are uncorrelated. After the three readings are fused, the amplitude of the random noise will be reduced to 1 / sqrt(3)≈58% of the original. The accuracy of 0.05mm becomes about 0.029mm.

[0057] ② Error compensation: System errors recorded during the calibration phase (such as those caused by standard gauge blocks or the initial offset of the sensor itself) are compensated by the software, eliminating system deviations.

[0058] ③ Differential Measurement: When calculating the height of point A, this invention essentially deals with the relative relationship between the three values ​​(d1, d2, d3). The overall up-and-down movement of the robot and the slight positional change of the workpiece have a common effect on these three points. When calculating (d1+d2+d3) / 3, the common error is largely canceled out, while the tiny differences between them (i.e., the undulations of the workpiece surface in a small area) are preserved and amplified; this is equivalent to turning an absolute measurement into a relative measurement, thus significantly improving accuracy.

[0059] IV. Flatness Judgment: If a robotic arm scans the workpiece surface with this array, a series of dA_fused and θ values ​​can be obtained, which can then be used to fit the morphology of the entire surface and calculate the flatness.

[0060] To facilitate understanding of the above technical solution of the present invention, the following is a specific explanation using the example of online detection of PCB board mounting flatness in a PCB board drilling production line: This embodiment addresses the flatness inspection requirements before drilling PCB boards by employing a region sensor array integrated on a robotic arm to achieve high-precision measurement. The implementation process begins with mechanical design, followed by the fabrication of a custom fixture. Four laser displacement sensors are integrated into the gripper bracket of the robotic arm, achieving a one-front-three-rear or diamond-shaped staggered layout. Taking the one-front-three-rear layout as an example, the laser points of the three front sensors S1, S2, and S3 are projected onto a centrally located area, forming the core measurement group. The laser point of the rear sensor S4 is approximately 50mm away from the core measurement group's laser point area, serving as the reference measurement group. In terms of electrical connections, ensuring synchronous triggering and acquisition of signals from the four sensors is crucial for suppressing mechanical vibrations and electromagnetic interference in the PCB production line.

[0061] The system calibration phase is a crucial step in improving measurement accuracy. A robotic arm is controlled to move the sensor array onto a standard flat plate, whose flatness accuracy is higher than that of a single laser displacement sensor. For example... Figure 2 As shown, data is synchronously acquired on a standard flat panel, and the reference readings d1_base, d2_base, and d3_base of each sensor are recorded. Then, the system errors error_sys12=d1_base-d2_base and error_sys13=d1_base-d3_base are calculated and stored in the system for error compensation during real-time measurement. This calibration method can effectively eliminate systematic deviations such as thermal noise generated by the sensor chip and resistors during operation, and reading fluctuations caused by power supply ripple.

[0062] When writing the program, the complete algorithm flow was implemented: synchronous reading, mean filtering, fusion calculation, error compensation, and tilt angle calculation. In the real-time measurement phase, after the PCB board is placed on the worktable, the system synchronously triggers all sensors to sample, acquiring the real-time raw readings d1, d2, d3, and dB of the core measurement group and the reference measurement group. The raw signals from each sensor are subjected to mean filtering, which suppresses random noise such as intensity fluctuations of the laser source, background noise generated during the photoelectric conversion of the detector, and interference from ambient light and electromagnetic fields by averaging multiple consecutive sampled values. Then, system error compensation is performed on the real-time raw readings of each sensor in the core measurement group, calculating the corrected readings d1_corrected=d1-error_sys12, d2_corrected=d2, and d3_corrected=d3-error_sys13. The second sensor, serving as the reference sensor, does not undergo error compensation.

[0063] For the fusion of corrected readings, the system provides two methods: fixed-weight fusion and adaptive-weighted fusion. When the PCB board surface is clean and the measurement environment is stable, the fixed-weight fusion method is used. The corrected readings of each sensor in the core measurement group are added together and then divided by the number of sensors to obtain the fusion height value of the virtual measurement point, dA_fused=(d1_corrected+d2_corrected+d3_corrected) / 3.

[0064] In actual PCB board inspection, if a sensor (such as S3) experiences a sudden signal change due to localized dust, oil, roughness variations, or reflectivity differences on the PCB surface, its reading may suddenly "drift significantly." Simple averaging will be biased by this drift, leading to a decrease in the accuracy of that measurement point. To address this issue, the system introduces an adaptive weighted fusion function, which can automatically identify and reduce the impact of unreliable sensors. Specifically, it calculates the variances var1, var2, and var3 of the readings of each sensor in the core measurement group over the most recent N periods in real time. A larger variance indicates greater data jitter and more severe noise interference from that sensor. Taking the calculation of the variance var1 of S1 as an example, assuming that at a certain moment, the five most recent readings of S1 are [0.101, 0.099, 0.100, 0.102, 0.098] (unit: mm), first calculate the average value μ1 = (0.101 + 0.099 + 0.100 + 0.102 + 0.098) / 5 = 0.100, then calculate the variance var1 = [(0.101 - 0.100)]. 2 +(0.099-0.100) 2 +(0.100-0.100) 2 +(0.102-0.100) 2 +(0.098-0.100) 2 ] / (5-1)=[0.000001+0.000001+0+0.000004+0.000004] / 4=0.0000025. If the readings of S2 and S3 fluctuate greatly due to interference, their variance will be much greater than var1.

[0065] Adaptive weights are assigned based on the reciprocals of the reading variances of each sensor, calculated using the formulas w1=(1 / var1) / (1 / var1+1 / var2+1 / var3), w2=(1 / var2) / (1 / var1+1 / var2+1 / var3), and w3=(1 / var3) / (1 / var1+1 / var2+1 / var3). This assigns smaller adaptive weights to sensors with larger reading variances and larger adaptive weights to sensors with smaller reading variances. Then, the corrected readings of each sensor in the core measurement group are multiplied by their corresponding adaptive weights and summed to obtain the fused height value of the virtual measurement point. dA_fused=w1×d1_corrected+w2×d2_corrected+w3×d3_corrected; In this way, the weight of the sensor that performs stably at the current measurement point will automatically increase; the weight of the sensor that drifts due to a sudden change in the surface condition of the PCB board will automatically decrease. The measurement system then has the function of automatic correction, effectively avoiding the problem of overall measurement result distortion caused by interference from a single sensor.

[0066] Meanwhile, the reference point height dB is calculated based on the readings of the reference measurement group. Combined with the fused height value dA_fused of the virtual measurement point and the known horizontal distance L between them, the height difference Δh = dA_fused - dB is obtained. The height difference is divided by the known horizontal distance to calculate the local plane tilt angle θ = arctan(Δh / L). This tilt angle can be used to determine whether the PCB board is warped on the workbench, ensuring that the PCB board is in a suitable flat state during drilling.

[0067] During the testing and verification phase, a stepped workpiece with a known height difference (such as a gauge block) was used to test the system, checking the accuracy and repeatability of the measurement results. By controlling a robotic arm to drive a regional sensor array to scan the PCB board surface, the system acquires the fused height values ​​and local plane tilt angles of virtual measurement points at different locations. These data are then fitted to the PCB board surface morphology, ultimately achieving high-precision flatness detection. Practical tests show that using this method, a flatness detection accuracy of 0.01 mm can be achieved with a standard laser displacement sensor with an accuracy of 0.05 mm. This effectively improves measurement accuracy without significantly increasing hardware investment, meeting the stringent flatness requirements of PCB board drilling and providing a reliable guarantee for quality control in automated production lines.

[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for improving the accuracy of flatness measurement, characterized in that, include: Based on the integration of several sensors by a robotic arm, and the formation of a regional sensor array through a staggered layout; In this sensor array, the laser points of some sensors are focused in the same area as the core measurement group, while the laser points of the remaining sensors are shifted to adjacent areas as the reference measurement group. During the measurement process of the regional sensor array, the signals collected by each sensor are subjected to mean filtering and synchronous triggering to suppress random noise and ensure data synchronization. Based on the measurement results of the regional sensor array, the height value of the virtual measurement point is constructed by weighted averaging and fusing the readings of different sensors in the core measurement group, and the local plane tilt angle is calculated using the readings of the reference measurement group and the height value of the virtual measurement point. By controlling a robotic arm to drive an array of regional sensors to scan the surface of the workpiece, the height values ​​of virtual measurement points at different locations and the local plane tilt angle are obtained to fit the surface morphology of the workpiece and achieve high-precision flatness detection.

2. The method for improving flatness measurement accuracy according to claim 1, characterized in that, The staggered layout methods include a one-front-multiple-back layout and a diamond-shaped distribution layout; The aforementioned front-and-back layout includes: the core measurement group comprising at least three sensors, the laser points of which are projected onto mutually close central regions; and the reference measurement group comprising at least one sensor, the laser point of which is separated from the laser point region of the core measurement group by a predetermined distance. The rhomboid distribution layout includes: laser points of at least three sensors close to each other to form a core measurement group; laser points of at least one sensor separated from the laser point area of ​​the core measurement group by a preset distance to form a reference measurement group; laser points of at least four sensors are respectively located at the vertices of the rhomboid area, and the distance between adjacent sensors in the reference measurement group and the core measurement group is greater than the distance between adjacent sensors in the core measurement group.

3. The method for improving flatness measurement accuracy according to claim 2, characterized in that, The sensor includes a laser displacement sensor; The regional sensor array contains at least four sensors; The mean filtering is achieved by averaging the continuous multiple sampling values ​​of each sensor, and the synchronous triggering process is achieved by simultaneously controlling all laser displacement sensors to acquire data at a certain moment.

4. The method for improving flatness measurement accuracy according to claim 1, characterized in that, The weighted average fusion of different sensor readings from the core measurement group includes a calibration phase and a real-time measurement phase. The calibration stage is used to obtain system error compensation parameters, and the real-time measurement stage is used to correct errors based on the system error compensation parameters and output measurement results.

5. The method for improving flatness measurement accuracy according to claim 4, characterized in that, The calibration phase includes: By controlling the sensor array in the gripping area of ​​the robotic arm, all laser points are simultaneously illuminating the standard flat plate, and the reference readings of each sensor are recorded at this time. Calculate the difference between the reference readings of each sensor in the core measurement group, and store this difference as a system error for error compensation during the real-time measurement phase. The accuracy of the standard flat plate is higher than that of the individual sensor measurement.

6. The method for improving flatness measurement accuracy according to claim 5, characterized in that, The real-time measurement phase includes: The system synchronously triggers all sensors in the regional sensor array to sample and obtain real-time raw readings of the core measurement group and the reference measurement group. System error compensation is performed on the real-time raw readings of each sensor in the core measurement group to obtain corrected readings; The weighted average of the corrected readings of the core measurement group is then fused to obtain the fused height value of the virtual measurement point. The height of the reference point is calculated based on the readings of the reference measurement group. The fused height value of the virtual measurement point and the known horizontal distance between them are then combined to calculate the local plane tilt angle, which is used as the flatness detection result.

7. The method for improving flatness measurement accuracy according to claim 6, characterized in that, The systematic error compensation for the real-time raw readings of each sensor in the core measurement group includes: Subtract the systematic error recorded by the sensor during the calibration phase from the real-time raw readings of each sensor in the core measurement group to obtain the corrected readings; The expression for the systematic error is: error_sys12=d1_base-d2_base; error_sys13=d1_base-d3_base; In the formula, error_sys12 is the systematic error between the first and second sensors in the core measurement group; error_sys13 is the systematic error between the first and third sensors in the core measurement group; d1_base, d2_base, and d3_base are the reference readings recorded by the first, second, and third sensors during the calibration phase, respectively. The expression for the corrected reading is: d1_corrected=d1-error_sys12; d2_corrected=d2; d3_corrected=d3-error_sys13; In the formula, d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors, respectively; d1, d2, and d3 are the real-time raw readings of the first, second, and third sensors, respectively; and the second sensor serves as the reference sensor and is not subject to error compensation.

8. The method for improving flatness measurement accuracy according to claim 6, characterized in that, The step of weighted averaging and fusing the corrected readings of the core measurement group to obtain the fused height value of the virtual measurement point includes: When using the fixed-weight fusion method, the fusion height value of the virtual measurement point is obtained by adding the corrected readings of each sensor in the core measurement group and dividing by the number of sensors. The expression for the fused height value of the virtual measurement point under the fixed-weight fusion method is: dA_fused=(d1_corrected+d2_corrected+d3_corrected) / 3; In the formula, dA_fused is the fusion height value of the virtual measurement point; d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors in the core measurement group, respectively.

9. The method for improving flatness measurement accuracy according to claim 6, characterized in that, The weighted averaging of the corrected readings of the core measurement group also includes an adaptive weighted fusion method, specifically including: The variance of readings of each sensor in the core measurement group is calculated in real time within the most recent preset number of cycles. The larger the variance of readings, the greater the data jitter of that sensor. Adaptive weights are assigned based on the reciprocal of the reading variance of each sensor, so that sensors with large reading variances receive smaller adaptive weights and sensors with small reading variances receive larger adaptive weights. The fused height value of the virtual measurement point is obtained by multiplying the corrected readings of each sensor in the core measurement group by the corresponding adaptive weights and summing the results. The expression for the adaptive weight is: w1=(1 / var1) / (1 / var1+1 / var2+1 / var3); w2=(1 / var2) / (1 / var1+1 / var2+1 / var3); w3=(1 / var3) / (1 / var1+1 / var2+1 / var3); In the formula, w1, w2, and w3 are the adaptive weights of the first, second, and third sensors in the core measurement group, respectively; var1, var2, and var3 are the reading variances of the first, second, and third sensors, respectively. The expression for the fused height value of the virtual measurement point under the adaptive weighted fusion method is: dA_fused=w1×d1_corrected+w2×d2_corrected+w3×d3_corrected; In the formula, dA_fused is the fusion height value of the virtual measurement point; d1_corrected, d2_corrected, and d3_corrected are the corrected readings of the first, second, and third sensors in the core measurement group, respectively.

10. The method for improving flatness measurement accuracy according to claim 6, characterized in that, The calculation of the local plane tilt angle includes: The difference between the fused height value of the virtual measurement point and the height of the reference point is obtained as the height difference; Divide the height difference by the known horizontal distance between the virtual measurement point and the reference point to obtain the local plane tilt angle; The expression for the local plane tilt angle is: θ = arctan(Δh / L); Δh = dA_fused - dB; In the formula, θ is the local plane tilt angle; Δh is the height difference; dA_fused is the fused height value of the virtual measurement point; dB is the height of the reference point; and L is the known horizontal distance between the virtual measurement point and the reference point.