Point spectrum intelligent controller and its measurement method
By employing a multi-core architecture and real-time data processing method in a point-spectral intelligent controller, the time deviation and attitude tilt issues of multi-channel spectral measurement systems were resolved, enabling high-precision spectral data acquisition and analysis, and improving the accuracy of industrial testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳市华众自动化工程有限公司
- Filing Date
- 2026-04-21
- Publication Date
- 2026-06-23
AI Technical Summary
Existing multi-channel spectral measurement systems suffer from time deviations during dynamic acquisition, insufficient computing resources to support complex real-time filtering, and sensor tilt leading to decreased measurement accuracy, making it difficult to meet the needs of high-precision industrial testing.
A point spectral intelligent controller is adopted, including a communication interface module, a data acquisition and synchronization module, a storage module, and a data processing module. It utilizes a heterogeneous multi-core architecture, a global synchronization trigger signal, spatial collaborative filtering, attitude calculation, and a spectral-geometric bidirectional correction unit to achieve parallel processing and real-time correction of multi-channel spectral data.
Nanosecond-level synchronous exposure of multi-channel sensor arrays was achieved, eliminating time distortion during dynamic measurement, improving the signal-to-noise ratio, and acquiring real microstructure and material spectral data under non-perpendicular incidence conditions, thus improving measurement accuracy.
Smart Images

Figure CN122260989A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation measurement technology, and in particular to a point spectral intelligent controller and its measurement method. Background Technology
[0002] With the increasing demands for online inspection efficiency in precision manufacturing, array-based measurement using multispectral sensors has become a crucial method for acquiring information on the surface morphology and material composition of objects. However, existing general-purpose controllers, limited by serial I / O architecture and finite instruction cycles, often struggle to achieve nanosecond-level synchronous triggering and parallel reception of multiple signals when processing multi-channel high-frequency data. This results in time deviations in the data from different measurement points during dynamic measurements, leading to motion distortion. Furthermore, the real-time floating-point computation requirements of massive spectral data can easily compete with network communication protocol stack maintenance tasks for processor resources, causing data transmission delays or system response blockages.
[0003] Furthermore, in practical measurement applications targeting rough surfaces or non-stationary conditions, relying solely on traditional time-domain filtering algorithms is insufficient to suppress flying point noise while maintaining the dynamic response characteristics of the signal. More critically, most existing measurement systems assume that the sensor's optical axis is absolutely perpendicular to the measured surface, lacking adaptive sensing and dynamic compensation capabilities for probe orientation or workpiece tilt. When there is an angle between the measuring optical axis and the surface normal, the distance deviation caused by geometric projection and the light intensity signal attenuation due to bidirectional reflection distribution characteristics can lead to significant errors in flatness assessment and material discrimination, making it difficult to meet the requirements of high-precision industrial inspection. Summary of the Invention
[0004] The purpose of this invention is to provide a point spectrum intelligent controller and its measurement method, which solves the problems of time deviation, insufficient computing power to support real-time complex filtering, and decreased measurement accuracy due to sensor tilt during dynamic acquisition in existing multi-channel spectral measurements.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] Point spectral intelligent controller, including:
[0007] The communication interface module is used to realize data interaction and command transmission between the controller and external devices;
[0008] The data acquisition synchronization module is connected to the communication interface module and is used to generate a global synchronization trigger signal to trigger the multispectral sensor array, receive multi-channel spectral data in parallel, and construct the original measurement vector matrix.
[0009] The storage module is used to store system programs, configuration parameters, and cache real-time spectral data;
[0010] The data processing module is connected to the communication interface module, the data acquisition synchronization module and the storage module via an internal high-speed bus. It is used to read the data in the storage module and perform spatial collaborative filtering, attitude calculation, spectral-geometric bidirectional correction and plane fitting operations.
[0011] The data processing module adopts a heterogeneous multi-core architecture that includes a main processor unit and a coprocessor unit.
[0012] Preferably, the data acquisition and synchronization module includes:
[0013] The global clock management unit is used to build the system's master clock network;
[0014] The parallel triggering logic unit generates a global synchronous trigger signal that is distributed to all sensing units based on the preset exposure time control register parameters.
[0015] A multi-channel data receiving interface unit is used to capture a serial bit stream from a multispectral sensor array through a parallel receiving channel and convert it into parallel data;
[0016] The data alignment and buffering unit is used to extract the original vertical distance value, the original light intensity value of the corresponding ultraviolet band, visible light band and near-infrared band, construct a four-dimensional original measurement vector, and assemble it into an original measurement vector matrix.
[0017] Preferably, the data processing module includes:
[0018] The spatial collaborative filtering unit is used to perform minimum mean square filtering with spatial constraints on the original measurement vector matrix and output the filtered distance matrix.
[0019] The attitude calculation unit is used to reconstruct the three-dimensional point cloud and perform statistical analysis on the filtered distance matrix, and calculate the normal vector and tilt angle of the surface of the object being measured.
[0020] A spectral-geometric bidirectional correction unit is used to perform coordinate correction in the geometric dimension and spectral intensity compensation in the physical dimension in parallel according to the tilt angle.
[0021] The plane fitting and evaluation unit is used to construct the evaluation reference surface and calculate the flatness evaluation index.
[0022] Preferably, the step of performing a least mean square filter process with spatial constraints on the original measurement vector matrix specifically includes:
[0023] Construct a spatial neighborhood set of the target measurement point, and calculate the spatial difference metric between the original distance signal of the target measurement point and the distance signals of the effective nodes in its neighborhood;
[0024] The total error function is constructed by combining the time-domain error with the normalized spatial difference measure and introducing spatial constraint coefficients.
[0025] The iteration step size of the filter is dynamically adjusted based on the magnitude of the total error function, the weight vector of the filter is updated, and the filtered distance value is calculated.
[0026] Preferably, the filtered distance matrix is used for 3D point cloud reconstruction and statistical analysis to calculate the normal vector and tilt angle of the surface of the measured object, specifically including:
[0027] The filtered distance matrix is mapped to a 3D point cloud dataset based on the sensor array spacing parameters;
[0028] Calculate the covariance matrix of the 3D point cloud dataset, and perform eigenvalue decomposition on the covariance matrix;
[0029] Extract the unit eigenvector corresponding to the smallest eigenvalue as the normal vector of the surface of the object being measured;
[0030] Based on the normal vector of the surface of the object under test, calculate the tilt angle of the object under test relative to the reference coordinate system in the X-axis direction, the tilt angle in the Y-axis direction, and the combined tilt angle.
[0031] Preferably, the spectral-geometric bidirectional correction unit includes:
[0032] The geometric correction subunit, based on the tilt angle, uses the principle of rotation matrix transformation to map the vertical distance value in the filtered distance matrix back to the ideal horizontal reference plane, and calculates the corrected vertical height.
[0033] The physical light intensity correction subunit, based on the tilt angle, uses a pre-stored photometric correction index and a reverse compensation model to perform gain compensation on the original light intensity values of the ultraviolet, visible, and near-infrared bands, and calculates the corrected light intensity values.
[0034] Preferably, the construction of the evaluation benchmark surface and the calculation of the flatness evaluation index specifically include:
[0035] Based on the principle of least squares, an ideal evaluation reference surface is constructed using the height data processed by the spectral-geometric bidirectional correction unit, and the plane parameter solution vector is solved.
[0036] Calculate the local deviation value of each measuring point relative to the evaluation reference surface;
[0037] Based on the local deviation values, the peak-valley flatness index and the root mean square flatness index are calculated, and the peak-valley flatness index is compared with the preset flatness tolerance threshold to generate a status flag bit.
[0038] Preferably, the storage system program, configuration parameters, and cached real-time spectral data are specifically stored in the following logical address space:
[0039] The configuration parameter area is used to store sensor array topology parameters, filtering algorithm control parameters, and flatness determination thresholds.
[0040] A high-speed circular buffer is mapped to a raw data area and a processing result area, used to support direct memory access and writing by the data acquisition synchronization module and reading by the data processing module;
[0041] The model lookup table area is used to store the numerical table of the tangent function required for geometric correction and the table of correction coefficients of the bidirectional reflectance distribution function required for photometric correction.
[0042] The historical data log area is used to cyclically record flatness evaluation indicators and judgment status.
[0043] Preferably, the process of enabling data interaction and command transmission between the controller and external devices specifically includes:
[0044] Adaptive network transmission is supported at the physical layer via Ethernet physical layer transceivers.
[0045] Multiple socket connections are maintained at the logical layer using multiplexing technology, respectively adapting to Modbus TCP protocol, S7 protocol and MQTT protocol;
[0046] When a data packet is received, the packet header structure and function code are parsed, and the external instructions are converted into internal register access operations.
[0047] When sending measurement data, a data packet containing a sequence number is generated, and a retransmission timer is started to execute reliable transmission based on the application layer acknowledgment mechanism.
[0048] The measurement method of the point spectrum intelligent controller includes the following steps:
[0049] S1. Generate a global synchronization trigger signal to control the multispectral sensor array to acquire data in parallel and construct an original measurement vector matrix containing distance information and multi-band light intensity information;
[0050] S2. Introduce spatial neighborhood difference constraints and perform adaptive filtering on the original measurement vector matrix;
[0051] S3. Perform principal component analysis on the filtered data, extract the surface normal vector and calculate the spatial tilt angle;
[0052] S4. Based on the spatial tilt angle, perform inverse rotation correction of geometric height and bidirectional reflectance distribution function compensation of spectral intensity in parallel.
[0053] S5. Construct a least-squares evaluation reference surface based on the corrected data, calculate the flatness index, and output the measurement results.
[0054] In summary, the present invention has at least one of the following beneficial technical effects:
[0055] 1. This invention solves the problems of timing deviation and excessive main processor load in high-frequency parallel acquisition of multi-channel sensor arrays by using FPGA to build a parallel IO controller and global synchronization trigger logic in the data acquisition synchronization module, combined with a direct memory access transmission mechanism. It achieves nanosecond-level synchronous exposure of all measurement points and high-speed throughput of large-scale matrix data, effectively eliminating time distortion in the dynamic measurement process.
[0056] 2. This invention introduces a spatial neighborhood difference metric as a constraint term on the basis of the traditional time-domain least mean square algorithm, which solves the problem that single time-domain filtering is difficult to distinguish between flying point noise on rough surfaces and abrupt changes in the true shape. It achieves the effect of effectively suppressing high-frequency random jump noise while rapidly tracking signal changes, thereby improving the signal-to-noise ratio of point cloud data.
[0057] 3. This invention integrates attitude calculation based on principal component analysis and a spectral-geometric bidirectional correction unit. It uses statistical methods to calculate the normal vector and tilt angle of the measured surface, and performs inverse rotation of geometric coordinates and spectral intensity compensation based on the BRDF model in parallel. This solves the problems of geometric projection error and misjudgment of light energy attenuation caused by sensor installation tilt or workpiece placement deviation. It achieves the effect of obtaining real micromorphology and accurate material spectral data even under non-perpendicular incident conditions. Attached Figure Description
[0058] Figure 1 This is a diagram of the controller module architecture of the present invention. Detailed Implementation
[0059] Please see the appendix Figure 1 The point spectrum intelligent controller 10 adopts a modular embedded architecture, mainly including a communication interface module 11 interconnected via an internal high-speed bus, a data acquisition and synchronization module 12, a data processing module 13, and a storage module 14. Each module is integrated on the same printed circuit board or interconnected via a backplane, and is provided with a stable power supply suitable for industrial environments by a power management unit (PMU).
[0060] The data processing module 13 is the core computing unit of the controller, employing a heterogeneous multi-core architecture to meet high computing power requirements. Specifically, this module includes: a main processor unit, using a high-performance embedded microprocessor, for running the operating system, managing the TCP / IP protocol stack, and task scheduling; and a coprocessor unit, using a digital signal processor (DSP) or floating-point unit (FPU), specifically configured to perform intensive mathematical operations such as matrix multiplication, eigenvalue decomposition, and adaptive filtering. This architecture enables parallel processing of communication management and complex calculations without blocking each other.
[0061] The data acquisition synchronization module 12 is implemented based on a field-programmable gate array (FPGA) or complex programmable logic device (CPLD) and is used for synchronous triggering and parallel reception of multiple sensor signals. Its internal logic configuration is a parallel I / O controller, with independent data reception channels corresponding to the number of sensors and a set of global synchronization trigger signal generators. The trigger signal generators are connected to all sensing units via hardware wiring to ensure that the entire array completes exposure and sampling within the same clock cycle. This module is connected to the data processing module 13 via a high-speed parallel bus (such as FMC or PCIe) and uses direct memory access (DMA) technology to directly write the acquired raw data to the storage module 14 without main processor intervention.
[0062] The communication interface module 11 is responsible for data interaction with external devices. At the physical layer, this module integrates an Ethernet physical layer transceiver and serial communication circuit, supporting adaptive network transmission and RS-485 / RS-232 serial communication; at the logic layer, it embeds a hardware protocol stack acceleration engine, supporting fast parsing and verification of industrial protocols such as Modbus TCP and MQTT, reducing the load on the main processor.
[0063] Storage module 14 includes non-volatile memory and volatile memory. Non-volatile memory (such as eMMC) is used to store firmware programs, system configuration parameters (including sensor calibration parameters, filter weights and photometric correction tables) and historical records; volatile memory (such as DDR SDRAM) is divided into multiple circular buffers to temporarily store real-time spectral data streams written at high speed by data acquisition synchronization module 12 for processing by data processing module 13.
[0064] The communication interface module 11, through the cooperation of hardware protocol stack and software logic, achieves compatibility support for multiple industrial standard protocols such as Modbus TCP, S7 and MQTT, ensuring the real-time performance and reliability of measurement command issuance and result data upload.
[0065] The working logic of the communication interface module 11 specifically includes the following sub-steps:
[0066] S110: Multiprotocol port listening and connection establishment.
[0067] The communication interface module 11 initializes the network protocol stack and starts the TCP Server mode by default, listening on the standard port 502 to adapt to Modbus TCP protocol requests. Simultaneously, this module supports configuration in TCP Client mode or opening specific ports (e.g., port 102 for S7 communication, port 1883 for MQTT communication). For concurrent connection requests, the communication interface module 11 employs multiplexing technology (such as IO Multiplexing) to maintain multiple socket connections, ensuring uninterrupted data link with the MES system or cloud platform while interacting with the host computer. During connection establishment, the communication interface module 11 executes a three-way handshake process and configures TCP Keep-Alive parameters, setting the heartbeat keep-alive interval to automatically detect and disconnect abnormal dead links, releasing system resources.
[0068] S120: Standardized instruction frame parsing and verification.
[0069] When a data packet is received from the host computer 30, the communication interface module 11 first identifies the packet header structure. For the Modbus TCP protocol, the communication interface module 11 parses the MBAP packet header. This packet header contains a 2-byte transaction identifier used to associate request and response packets; a 2-byte protocol identifier, which, for the Modbus TCP protocol, is checked to ensure it is a fixed value of 0x0000; a 2-byte length field indicating the total number of bytes for the subsequent unit identifier, function code, and data field; and a 1-byte unit identifier used to address the target device in multi-device cascading scenarios.
[0070] The communication interface module 11 can read the length field value and count the number of bytes actually received in the receive buffer. If the actual number of received bytes is less than the value indicated by the length field, the module starts a receive timeout timer to wait for subsequent data packets; if the two are the same, it is determined that the frame reception is complete and enters the function code parsing stage. For function code 0x03 (read holding register), the module extracts the starting address and the number of registers and triggers the read logic; for function code 0x10 (write multiple registers), the module extracts the parameter data and writes it to the configuration area.
[0071] If an error in the protocol identifier or a failure of CRC / LRC check is found during the parsing process (for serial links), the module generates an error response frame containing the exception code and sends it back to the sending end.
[0072] S130: Siemens S7 protocol frame encapsulation and decapsulation.
[0073] When the communication interface module 11 operates in S7 mode, it encapsulates S7 communication frames based on the RFC1006 standard. Upon receiving data, the module first strips the TPKT header (containing the version number and reserved bits) and the COTP header (containing the PDU type and length) to extract the S7 PDU. The module parses the ROSCTR field in the S7 PDU to identify the request type, and parses the function code (such as 0x04 Read Var, 0x05 Write Var) and the data block (DB) index address. By establishing a mapping table between the PLC address and the controller's internal registers, the communication interface module 11 converts the DB read / write instructions issued by the PLC into memory access operations within the controller, achieving seamless integration with the Siemens automation system.
[0074] S140: Reliable transmission and confirmation mechanism for data results.
[0075] After processing and encapsulating the measurement data, the communication interface module 11 executes the data transmission task. For industrial control scenarios with extremely high real-time requirements, the communication interface module 11 supports the application layer acknowledgment (ACK) mechanism.
[0076] Specifically, when the communication interface module 11 sends a JSON data packet containing the measurement results, it generates a globally unique sequence number in the packet header. After the data packet is sent, the module starts a retransmission timer (adjustable from 200ms to 500ms by default). After successfully receiving and parsing the data, the receiving end (host computer or MES) must return an ACK confirmation message containing the same sequence number and a successful verification identifier.
[0077] The communication interface module 11 monitors the return channel. If a matching ACK message is received before the retransmission timer overflows, the data in the sending buffer is cleared, marking the transmission as successful. If no ACK is received after the timer overflows, or a NACK (unacknowledged) message is received, the communication interface module 11 immediately triggers the retransmission logic. The retransmission strategy adopts an exponential backoff algorithm, meaning the retransmission interval increases with the number of retransmissions to avoid exacerbating network congestion. When the number of retransmissions reaches a preset threshold (e.g., 3 times) and still fails, the module triggers a communication fault alarm and transfers the data to the breakpoint resume area of the local non-volatile memory for automatic retransmission after network recovery.
[0078] S150: MQTT message publishing and quality of service control.
[0079] For IoT transmission scenarios, communication interface module 11 implements MQTT protocol client functionality. The module connects to the message broker server based on a pre-configured Broker address and selects a publishing topic based on the type of measurement data. The module supports three Quality of Service (QoS) levels: QoS 0 (at most once), QoS 1 (at least once), and QoS 2 (exclusively once). For core measurement data, the default configuration is QoS 1 or QoS 2, utilizing the built-in PUBACK / PUBREC / PUBREL / PUBCOMP message exchange process of the MQTT protocol to ensure data is not lost or duplicated in complex wide area network environments. Simultaneously, the module encapsulates data in JSON format in the payload and performs AES encryption on key fields to ensure data security during public network transmission.
[0080] The data acquisition synchronization module 12 serves as a bridge connecting the multispectral sensor array 20 and the data processing module 13. It is mainly implemented by programmable logic circuits inside the field programmable gate array (FPGA), specifically including a global clock management unit 121, a parallel trigger logic unit 122, a multi-channel data receiving interface unit 123, and a data alignment and buffering unit 124.
[0081] The working logic of the data acquisition and synchronization module 12 is implemented through the following sub-steps:
[0082] S210: Nanosecond-level global synchronization trigger signal generation.
[0083] The global clock management unit 121 utilizes the phase-locked loop (PLL) or mixed-mode clock manager (MMCM) inside the FPGA to build a high-precision, low-jitter system master clock network (e.g., 100MHz or higher frequency) to provide a unified time reference for the entire module.
[0084] When a data acquisition start command is received from the data processing module 13, the parallel trigger logic unit 122 generates a global synchronization trigger signal based on the clock signal provided by the global clock management unit 121. To ensure the consistency of the exposure time of all sensing units in the 5×5 array, the trigger signal is distributed to 25 physical output pins through the global clock tree resources or low-skew wiring network inside the FPGA.
[0085] The parallel trigger logic unit 122 also contains an exposure time control register, which stores preset exposure duration parameters. The pulse width of the trigger signal is precisely modulated by this parameter to adapt to the illumination requirements of different surface reflectivities of the measured object. Under the action of the rising edge (or falling edge, depending on the sensor timing requirements) of the trigger signal, the 25 sensing units in the multispectral sensor array 20 simultaneously open the electronic shutter for photoelectric conversion within the same clock cycle, ensuring that the measurement data at different spatial locations have strict time alignment characteristics and eliminating motion blur and temporal distortion caused by line scanning or point-by-point scanning.
[0086] S220: Multi-channel parallel data stream reception and deserialization.
[0087] After exposure and analog-to-digital conversion are completed, the 25 sensing units output measurement data in parallel through their respective independent data buses. The multi-channel data receiving interface unit 123 instantiates 25 independent data receiving channels in the FPGA logic. For high-speed serial differential signals (such as LVDS) or synchronous serial signals (such as SPI) output by the sensors, each receiving channel is configured with independent serial deserializer (SerDes) or shift register logic.
[0088] The multi-channel data receiving interface unit 123 controls all receiving channels to operate under the same sampling clock domain, capturing bit streams from 25 sensing units in parallel. The receiving logic performs frame header detection and boundary identification on the data stream, converting the serial bit stream into parallel data words. Due to the fully parallel hardware logic architecture, the reading time of the 25 data channels depends only on the transmission rate of a single sensor, and does not increase linearly with the number of sensors, thus ensuring the system's high frame rate acquisition capability.
[0089] S230: Multispectral Data Analysis and Vector Space Mapping.
[0090] The received raw data frame contains spectral confocal distance information and multi-band light intensity information. The data alignment and buffering unit 124 receives parallel data words from the multi-channel data receiving interface unit 123, performs protocol parsing, and extracts the raw vertical distance value. And the original light intensity values for the corresponding ultraviolet, visible, and near-infrared bands. , , .
[0091] To facilitate subsequent algorithm processing, the data alignment and buffering unit 124 maps the physical channel ID to a logical two-dimensional matrix index. ,in For each measurement point, this unit constructs a standard four-dimensional original measurement vector. :
[0092] ;
[0093] In the formula, This is the original vertical distance value; This represents the original light intensity value corresponding to the ultraviolet band; This represents the original light intensity value in the visible light band; This represents the original light intensity value in the near-infrared band. This is a standard four-dimensional original measurement vector.
[0094] This vector structure solidifies the correspondence between distance geometry and spectral physical quantities, providing a unified data benchmark for subsequent heterogeneous data fusion processing.
[0095] S240: Matrixed data buffer and DMA transfer.
[0096] The 25 constructed raw measurement vectors were assembled into a complete raw measurement vector matrix. The data alignment and buffering unit 124 is configured with a dual-port random access memory (RAM) or a first-in-first-out queue (FIFO) as a cache area inside the FPGA.
[0097] Each time a frame of matrix data is assembled and written to the buffer, the data alignment and buffer unit 124 triggers the internally integrated Direct Memory Access (DMA) controller. The DMA controller takes over bus control, uses burst transfer mode to move the entire frame of matrix data in the buffer to the pre-allocated shared memory area in the storage module 14, and sends an interrupt signal to the data processing module 13 after the transfer is complete. This mechanism realizes pipelined operation of data acquisition and data processing, allowing the data processing module 13 to focus on complex algorithm operations without consuming CPU resources to poll or interfere with the underlying data reception process.
[0098] The data processing module 13 integrates a spatial collaborative filtering unit 131, which is configured to process the raw measurement vector matrix cached in the storage module 14. Perform spatially constrained collaborative filtering.
[0099] The working logic of the spatial collaborative filtering unit 131 is implemented through the following sub-steps:
[0100] S310: Neighborhood spatial index construction and data retrieval.
[0101] Spatial collaborative filtering unit 131 first reads the current time from storage module 14 via direct memory access or high-speed bus. The original measurement vector matrix. For each target measurement point in the matrix. The address generation logic within a cell automatically constructs its spatial neighborhood set. In one embodiment, the neighborhood set is defined as an 8-neighborhood structure centered on the target measurement point, i.e., containing... to The adjacent nodes within the range. For measurement points located at the edge of the array, the cells use a mirror-fill or zero-fill strategy to complete the neighborhood data, in order to ensure the uniformity of matrix operation dimensions.
[0102] S320: Parallel computation of spatial difference measurement.
[0103] To identify whether a target measurement point is an isolated noise point, the spatial collaborative filtering unit 131 is equipped with a difference calculation logic circuit. This circuit extracts the original distance signal of the target measurement point. Calculate the spatial difference metric by taking the distance signals of all valid nodes in its neighborhood. This metric characterizes the degree of abrupt change at the current measurement point relative to the local microenvironment, and its calculation formula is as follows:
[0104] ;
[0105] In the formula, Represents the neighborhood set The number of valid nodes in the middle, These are the index coordinates of the nodes within the neighborhood. Indicates the index of the current discrete sampling time. For spatial difference measurement, The original distance signal of the target measurement point. Indicates the coordinates within the neighborhood. Adjacent nodes at the same time The collected raw vertical distance measurements. When When the value is significantly higher than the preset threshold, it indicates that there is a drastic change in space at the measurement point, which is very likely a measurement flypoint caused by a rough surface.
[0106] S330: Construction and Constraint Introduction of Total Error Function.
[0107] The spatial collaborative filtering unit 131 internally runs an improved least mean square (LMS) algorithm. Unlike traditional LMS, which relies solely on prediction errors in the time dimension, this unit introduces spatial constraint terms in the error calculation stage. The unit is equipped with a spatial constraint factor register to store configurable coefficients. The operational logic incorporates time-domain errors. Combined with a normalized spatial difference measure, a total error function is generated. :
[0108] ;
[0109] In the formula, This is the current output estimate of the filter; For the desired signal, a smoothed estimate or neighborhood mean from the previous time step is typically taken. The hyperbolic tangent function is used to map spatial difference measures to the interval [−1,1] to prevent the error function from diverging due to individual extreme noise points; These are spatial constraint coefficients, used to adjust the weights of the influence of spatial geometric features on the filtering process; This is the total error function.
[0110] S340: Adaptive step size adjustment and weight update.
[0111] To achieve a balance between rapidly tracking signal changes and suppressing noise, the spatial collaborative filtering unit 131 implements a variable step-size update strategy. The step-size calculation logic within the unit is based on the total error function. The iteration step size of the dynamic adjustment filter of the magnitude The step size adjustment formula is as follows:
[0112] ;
[0113] In the formula, The initial step size parameter is stored in the register. To adjust the sensitivity coefficient, The total error function, This is the iteration step size of the filter. This logic ensures that the step size is automatically reduced when a large total error is detected (i.e., there are significant temporal abrupt changes or spatial discontinuities). To avoid violent oscillations in the filter output, increase the step size in the stable signal region to accelerate convergence.
[0114] Based on the calculated total error and dynamic step size, the unit updates the filter's weight vector. And calculate the final filtered output. :
[0115] ;
[0116] ;
[0117] In the formula, The input signal vector, For the final filtered output, This is the updated filter weight vector for the next time step. The total error function, This represents the iteration step size of the filter. After the above processing, the spatial collaborative filtering unit 131 outputs the filtered distance matrix of the entire array. This matrix retains the true low-frequency morphological features of the measured object while filtering out high-frequency random noise caused by the rough surface, providing a high signal-to-noise ratio data foundation for subsequent attitude calculation. For the matrix multiplication and accumulation operations involved in the LMS algorithm, the data processing module 13 calls its internal floating-point unit (FPU) or DSP instruction set for hardware acceleration.
[0118] The data processing module 13 integrates an attitude calculation unit 132, which is configured to perform statistical analysis on the distance data processed by the spatial collaborative filtering unit 131 to perform tilt attitude calculation based on principal component analysis (PCA).
[0119] The working logic of attitude calculation unit 132 is implemented through the following sub-steps:
[0120] S350: Reconstruction of a 3D point cloud dataset.
[0121] The attitude calculation unit 132 first receives the filtered range matrix output from the spatial collaborative filtering unit 131. Since the original matrix only contains two-dimensional indices... and vertical distance information This unit needs to convert the data into 3D point cloud data in a physical space coordinate system. The unit reads the sensor array spacing parameters stored in the configuration area. (e.g., 5mm or 10mm), according to the formula and Calculate the planar coordinates of each measuring point. Based on this, construct a 3D point cloud dataset containing all valid measuring points:
[0122] ;
[0123] In the formula, This represents the total number of valid measurement points (N=25 for a complete 5×5 array). This step realizes the mapping from the discrete sensor pixel space to the physical metric space.
[0124] S360: Construction and calculation of the covariance matrix.
[0125] To analyze the spatial distribution characteristics of the point cloud data, the attitude calculation unit 132 calculates the covariance matrix of the point cloud dataset. First, it calculates the geometric center coordinates of the point cloud. :
[0126] ;
[0127] In the formula, For the first The coordinate vector of each measurement point; This represents the coordinate vector of the geometric center (or centroid) of the calculated point cloud dataset, typically containing... Three components; This indicates the total number of valid measurement points involved in the calculation (in the 5×5 array of this embodiment, the maximum value is 25). This variable represents the traversal index of the measurement points, with values ranging from 1 to N.
[0128] Subsequently, a 3×3 covariance matrix C is calculated based on the decentralized data. This matrix C characterizes the dispersion and correlation of the point cloud data in three spatial dimensions, and the calculation formula is as follows:
[0129] ;
[0130] In the formula, The calculated three-dimensional point cloud covariance matrix is a 3×3 symmetric matrix. The denominator represents the total number of valid measurement points. Used to achieve unbiased estimation; This represents the traversal index of the measurement point, with values ranging from 1 to... ; Indicates the first A column vector of three-dimensional coordinates of each measurement point; This represents the column vector of coordinates of the geometric center (mean) of the point cloud calculated in the previous steps; Indicates the first The deviation vector of each measurement point relative to the geometric center (decentralized vector); The transpose operator for vectors, used here to convert a column vector into a row vector, thereby making... This forms a 3×3 outer product matrix.
[0131] Since this step involves a large number of floating-point multiplication and addition operations, the attitude calculation unit 132 directly calls the coprocessor or hardware accelerator in the data processing module 13 to execute in parallel to ensure the real-time performance of the calculation.
[0132] S370: Eigenvalue decomposition and normal vector extraction.
[0133] Attitude calculation unit 132 performs eigenvalue decomposition on the covariance matrix C. This is achieved by solving the characteristic equation. We obtain three non-negative eigenvalues and arrange them in descending order as follows: Simultaneously, calculate the unit eigenvectors corresponding to these three eigenvalues. , , In the technical context of this invention, eigenvalues and It characterizes the extent to which the data extends within the measured plane, while the minimum eigenvalue... This characterizes the dispersion of the data in the direction perpendicular to the plane (i.e., plane thickness or noise variance). Therefore, the minimum eigenvalue... Corresponding feature vector Geometrically equivalent to the normal vector of the fitted plane. The attitude calculation unit 132 extracts this feature vector. As a core parameter describing the spatial attitude of the measured object, this method has stronger noise robustness compared to the traditional three-point method for calculating the normal vector because it utilizes statistical information from all measurement points, rather than relying solely on local data.
[0134] S380: Analysis of spatial tilt angle.
[0135] Based on the extracted normal vector The attitude calculation unit 132 calculates the tilt angle of the object relative to the X and Y axes of the reference coordinate system.
[0136] For the tilt angle in the X-axis direction , defined as the angle between the projection of the normal vector onto the YZ plane and the Z-axis, is calculated using the following formula:
[0137] ;
[0138] For the tilt angle in the Y-axis direction , defined as the angle between the projection of the normal vector onto the XZ plane and the Z-axis, is calculated using the following formula:
[0139] ;
[0140] In addition, this unit also calculates the overall tilt angle. This is used for subsequent spectral intensity correction.
[0141] ;
[0142] In the formula, The ideal optical axis direction of the sensor array; It represents the angle between the projection vector of the normal vector of the measured surface onto the YZ plane and the Z-axis (the direction of the sensor's principal optical axis), that is, the component angle of rotation around the X-axis; It represents the angle between the projection vector of the normal vector of the measured surface onto the XZ plane and the Z-axis, that is, the component angle of rotation about the Y-axis; Indicates the overall tilt angle; This represents the arctangent trigonometric function, used to convert slope values into angle values; This represents the unit normal vector extracted in the preceding steps. Component values in the X-axis direction; Represents the unit normal vector Component values in the Y-axis direction; Represents the unit normal vector Component values in the Z-axis direction.
[0143] Calculated , and The data is written into the shared register of the data processing module and passed as input parameters to the subsequent spectral-geometric bidirectional correction unit 133. The calculation of the arctangent and inverse cosine functions is implemented at the hardware level using a lookup table method or the CORDIC algorithm (coordinate rotation digital computer algorithm) to meet the timing requirements of high-frequency measurements.
[0144] The data processing module 13 integrates a spectral-geometric bidirectional correction unit 133, which contains a geometric correction subunit 1331 and a physical light intensity correction subunit 1332. The two subunits share the tilt angle parameter, but work independently and in parallel on the data stream.
[0145] The working logic of the spectral-geometric bidirectional correction unit 133 is implemented through the following sub-steps:
[0146] S391: Inverse rotation correction of geometric coordinates.
[0147] The geometric correction subunit 1331 reads the tilt angle output by the attitude calculation unit 132. and The sub-unit outputs the filtered distance matrix from the spatial collaborative filtering unit 131. Its main function is to map the measurement data based on the tilted plane back to the ideal horizontal reference plane, eliminating projection errors caused by the sensor's optical axis not being parallel to the normal of the measured surface. For each measurement point in the array... This subunit reads its planar coordinates in the sensor coordinate system. and and the filtered vertical distance Based on the principle of rotation matrix transformation, the corrected vertical height is calculated. The specific calculation formula is as follows:
[0148] ;
[0149] In the formula, This indicates the logical index after geometric skew compensation. The corrected vertical distance value at that location (i.e., the relative height after removing the macro tilt component). This represents the original distance value of the current measuring point after spatial collaborative filtering, which was output in the preceding step S340. This indicates the row and column indices of the measurement points in the sensor array; Indicates the first The physical lateral coordinate distance of the line measurement point relative to the geometric center of the sensor array in the X-axis direction (this value is determined by the sensor unit pitch). Indicates the first The physical longitudinal coordinate distance of the measurement points relative to the geometric center of the sensor array in the Y-axis direction; This represents the tangent trigonometric function operator; This indicates the tilt angle of the measured surface (or probe) around the X-axis, calculated in the preceding S380 step. This indicates the tilt angle of the measured surface (or probe) around the Y-axis, calculated in the preceding S380 step.
[0150] The geometric correction subunit 1331 is internally configured with a tangent function lookup table (LUT) or a hardware CORDIC arithmetic module for fast acquisition. and The system provides high-precision numerical values. By subtracting this deviation term from the original measurement, the system performs a mathematical operation to "virtually flatten" the measured surface, resulting in corrected height data. It only includes microscopic surface undulations (i.e., flatness error) of the object, while eliminating the component of macroscopic orientation tilt. This ensures that the subsequent flatness evaluation algorithm targets the manufacturing tolerances of the object itself, rather than positioning errors during assembly or placement.
[0151] S392: Physical compensation of spectral intensity based on BRDF model.
[0152] At the same time, the physical light intensity correction subunit 1332 reads the original spectral intensity data of each measuring point. and overall tilt angle Because multispectral sensors are based on the principle of reflection measurement, when the incident light ray makes an angle with the surface normal, the received reflected light energy will attenuate according to the bidirectional reflection distribution function (BRDF). Without correction, the energy attenuation caused by tilting will be misinterpreted by the system as a darkening of the material color or a change in coating thickness. The physical light intensity correction subunit 1332 has a built-in photometric correction parameter register group, which stores the photometric correction indices for the ultraviolet, visible, and near-infrared bands, respectively. These indices are determined based on the Lambertian reflectance model or pre-calibrated material reflectance characteristic curves. This sub-unit is for each wavelength band. The corrected light intensity value was calculated using a reverse compensation model. :
[0153] ;
[0154] In the formula, This is the original measured light intensity for this wavelength band. To take into account the incident tilt angle, To compensate for the gain factor. When When it increases, As the angle decreases, the compensation gain factor increases, thereby offsetting the light energy loss caused by tilt. This step restores the measurement data under non-perpendicular incidence conditions to physical quantities under equivalent perpendicular incidence conditions. The physical light intensity correction subunit 1332 uses a floating-point multiplier and exponential operation logic circuit to perform the above calculations and repackages the corrected light intensity values for the three bands.
[0155] S393: Reorganization and output of the corrected data vector.
[0156] After completing the bidirectional correction of geometric and physical dimensions, the spectral-geometric bidirectional correction unit 133 will correct the geometric height. With the corrected spectral intensity Alignment is performed to construct a corrected measurement vector. The vector is then transmitted to the plane fitting and evaluation unit 134 and the data area of the storage module. Through the aforementioned bidirectional correction mechanism, the system establishes a decoupled representation of the geometric shape and physical properties of the measured object, enabling the controller to accurately invert the surface material uniformity or coating thickness using the corrected spectral data while evaluating flatness, and the measurement results of these two dimensions do not interfere with each other. For intermediate variables and calculation results involved in the correction process, the data processing module 13 uses double-precision floating-point format for storage and transmission to minimize the cumulative impact of truncation error on measurement accuracy.
[0157] The data processing module 13 integrates a plane fitting and evaluation unit 134, which performs the flatness calculation task. This unit uses the geometrically corrected height data output from the previous steps to construct an ideal evaluation reference surface based on the least squares method, and quantifies the micro-geometric error of the measured surface based on this reference surface to generate a flatness evaluation index that conforms to industry standards.
[0158] The working logic of the plane fitting and evaluation unit 134 is specifically implemented through the following sub-steps:
[0159] S410: Construction of the least squares evaluation benchmark surface.
[0160] Although the preceding spectral-geometric bidirectional correction unit 133 has already corrected the tilt of the data, in order to meet the requirements of the minimum condition or least squares median condition in the GB / T 11337 standard for flatness measurement, the plane fitting and evaluation unit 134 needs to recalculate a mathematically ideal reference plane based on the corrected dataset. This unit sets the ideal plane equation as z = ax + by + c based on the least squares principle. To determine the optimal plane parameters (including the residual slope a in the X direction, the residual slope b in the Y direction, and the height intercept c), the unit constructs an objective function, defined as the sum of the squares of the vertical distances from all measurement points to the fitted plane.
[0161] Subsequently, based on the extreme value theorem, the unit takes the partial derivatives of the parameters in the objective function and sets them to zero, thereby constructing a normal system of equations containing three linear equations. The plane fitting and evaluation unit 134 solves this system of linear equations using Gaussian elimination or LU decomposition algorithm, directly obtaining the exact plane parameter solution vector [a,b,c] that minimizes the sum of squared residuals. T This step establishes a unique benchmark for flatness evaluation, eliminating the slight tilting effect left over from numerical calculation errors during the correction process.
[0162] S420: Local deviation calculation and core index generation.
[0163] After determining the evaluation reference plane, the plane fitting and evaluation unit 134 calculates the local deviation value of each measuring point relative to the reference plane. This deviation value characterizes the degree of undulation of the microstructure of the measured surface relative to the ideal plane, and its value is equal to the corrected height value of the measuring point minus the calculated height value of the ideal plane at the corresponding position. Based on the calculated deviation set, this unit calculates two core flatness evaluation indicators in parallel to comprehensively describe the surface quality:
[0164] Peak-to-valley flatness (FLTt): This parameter characterizes the maximum range of surface undulations and is of great significance for assessing the airtightness of sealing surfaces. Its value is defined as the sum of the maximum positive deviation and the maximum negative deviation (absolute value) in the deviation set, i.e., the difference between the maximum and minimum values.
[0165] Root mean square flatness (FLTq): Used to characterize the overall statistical flatness and average roughness of a surface. Its value is defined as the square root of the arithmetic mean of the squares of the local deviations at all measurement points. The plane fitting and evaluation unit 134 is equipped with dedicated comparator logic and accumulator circuitry, capable of performing maximum value search, minimum value search, and sum of squares accumulation operations for the above indicators within a single instruction cycle.
[0166] S430: Tolerance determination and data encapsulation.
[0167] The plane fitting and evaluation unit 134 further compares the calculated FLTt with the flatness tolerance threshold Tflat preset in the parameter area of the storage module. If FLTt ≤ Tflat, the unit generates a qualified (OK) status flag; otherwise, it generates an unqualified (NG) flag. Finally, the unit packages the calculated flatness indices FLTt and FLTq, along with the status flags, and the corrected spectral intensity data and tilt angle data output from the previous steps, into the output buffer. The data structure clearly associates the physical meaning of each index with the corresponding measurement point, ensuring that the host computer system can directly parse and use it for process closed-loop control.
[0168] The storage module 14 is not only a passive container for physical data, but also supports the high-speed real-time operation and parameter configuration flexibility of the point spectrum intelligent controller through hierarchical address space mapping and specific read and write strategies.
[0169] The storage module 14 is logically divided into a configuration parameter area, a high-speed circular buffer, a model lookup table area, and a historical data log area through a hierarchical address space mapping strategy to support the efficient operation of the system.
[0170] The configuration parameter area is located in non-volatile storage medium and is used to persistently store system control parameters. Specifically, this includes: sensor array topology parameters (such as the physical spacing and relative coordinates of each sensing unit), providing a baseline for point cloud reconstruction; and filtering algorithm control parameters (such as spatial constraint coefficients and step size sensitivity) and flatness determination thresholds. This area is equipped with a CRC check mechanism to ensure the integrity of parameter loading during system initialization.
[0171] A high-speed circular buffer is mapped into DDR volatile memory and divided into a raw data area and a processing result area. This area is specifically designed to accommodate DMA transfers. The data acquisition synchronization module 12 cyclically writes the latest acquired raw measurement vector matrix through the DMA controller, while the data processing module 13 retrieves data in parallel through a read pointer. This ping-pong buffering mechanism ensures the parallel execution of front-end acquisition and complex back-end correction operations, avoiding data blocking.
[0172] The Model Lookup Table (LUT) area pre-stores high-precision mathematical model data, designed to accelerate the computation of the spectral-geometric bidirectional correction unit 133. This area includes: a geometric correction LUT, storing pre-computed rotation matrix elements or tangent function values based on tilt angle indices; and a photometric correction LUT, storing bidirectional reflectance distribution function (BRDF) correction coefficients for different spectral bands. The data processing module significantly improves processing efficiency by replacing complex real-time floating-point operations with table lookups and linear interpolation.
[0173] The historical data log area is used to cyclically record flatness evaluation indicators (such as peak-valley values and root mean square values) and judgment status, supporting historical tracing by external host computers. In addition, the storage module 14 integrates power loss protection logic. When an abnormal power drop is detected, it uses the short-term power provided by the onboard energy storage element to quickly write the key statistical data in memory to the non-volatile storage unit to prevent data loss.
[0174] The measurement method of the point spectral intelligent controller described below can be referred to in correspondence with the point spectral intelligent controller described above.
[0175] This invention also provides a measurement method for a spectral intelligent controller, comprising the following steps:
[0176] S1. Generate a global synchronization trigger signal to control the multispectral sensor array to acquire data in parallel and construct an original measurement vector matrix containing distance information and multi-band light intensity information;
[0177] S2. Introduce spatial neighborhood difference constraints and perform adaptive filtering on the original measurement vector matrix;
[0178] S3. Perform principal component analysis on the filtered data, extract the surface normal vector and calculate the spatial tilt angle;
[0179] S4. Based on the spatial tilt angle, perform inverse rotation correction of geometric height and bidirectional reflectance distribution function compensation of spectral intensity in parallel.
[0180] S5. Construct a least-squares evaluation reference surface based on the corrected data, calculate the flatness index, and output the measurement results.
[0181] The controller in this embodiment can be used to execute the above method embodiments, and its principle and technical effect are similar, so it will not be described again here.
Claims
1. A point spectrum intelligent controller, characterized in that, include: The communication interface module is used to realize data interaction and command transmission between the controller and external devices; The data acquisition synchronization module is connected to the communication interface module and is used to generate a global synchronization trigger signal to trigger the multispectral sensor array, receive multi-channel spectral data in parallel, and construct the original measurement vector matrix. The storage module is used to store system programs, configuration parameters, and cache real-time spectral data; The data processing module is connected to the communication interface module, the data acquisition synchronization module and the storage module via an internal high-speed bus. It is used to read the data in the storage module and perform spatial collaborative filtering, attitude calculation, spectral-geometric bidirectional correction and plane fitting operations. The data processing module adopts a heterogeneous multi-core architecture that includes a main processor unit and a coprocessor unit.
2. The point spectrum intelligent controller according to claim 1, characterized in that, The data acquisition and synchronization module includes: The global clock management unit is used to build the system's master clock network; The parallel triggering logic unit generates a global synchronous trigger signal that is distributed to all sensing units based on the preset exposure time control register parameters. A multi-channel data receiving interface unit is used to capture a serial bit stream from a multispectral sensor array through a parallel receiving channel and convert it into parallel data; The data alignment and buffering unit is used to extract the original vertical distance value, the original light intensity value of the corresponding ultraviolet band, visible light band and near-infrared band, construct a four-dimensional original measurement vector, and assemble it into an original measurement vector matrix.
3. The point spectrum intelligent controller according to claim 1, characterized in that, The data processing module includes: The spatial collaborative filtering unit is used to perform minimum mean square filtering with spatial constraints on the original measurement vector matrix and output the filtered distance matrix. The attitude calculation unit is used to reconstruct the three-dimensional point cloud and perform statistical analysis on the filtered distance matrix, and calculate the normal vector and tilt angle of the surface of the object being measured. A spectral-geometric bidirectional correction unit is used to perform coordinate correction in the geometric dimension and spectral intensity compensation in the physical dimension in parallel according to the tilt angle. The plane fitting and evaluation unit is used to construct the evaluation reference surface and calculate the flatness evaluation index.
4. The point spectrum intelligent controller according to claim 3, characterized in that, The process of performing a minimum mean square filter with spatial constraints on the original measurement vector matrix specifically includes: Construct a spatial neighborhood set of the target measurement point, and calculate the spatial difference metric between the original distance signal of the target measurement point and the distance signals of the effective nodes in its neighborhood; The total error function is constructed by combining the time-domain error with the normalized spatial difference measure and introducing spatial constraint coefficients. The iteration step size of the filter is dynamically adjusted based on the magnitude of the total error function, the weight vector of the filter is updated, and the filtered distance value is calculated.
5. The point spectrum intelligent controller according to claim 3, characterized in that, The filtered distance matrix is used for 3D point cloud reconstruction and statistical analysis to calculate the normal vector and tilt angle of the surface of the measured object, specifically including: The filtered distance matrix is mapped to a 3D point cloud dataset based on the sensor array spacing parameters; Calculate the covariance matrix of the 3D point cloud dataset, and perform eigenvalue decomposition on the covariance matrix; Extract the unit eigenvector corresponding to the smallest eigenvalue as the normal vector of the surface of the object being measured; Based on the normal vector of the surface of the object under test, calculate the tilt angle of the object under test relative to the reference coordinate system in the X-axis direction, the tilt angle in the Y-axis direction, and the combined tilt angle.
6. The point spectrum intelligent controller according to claim 3, characterized in that, The spectral-geometric bidirectional correction unit includes: The geometric correction subunit, based on the tilt angle, uses the principle of rotation matrix transformation to map the vertical distance value in the filtered distance matrix back to the ideal horizontal reference plane, and calculates the corrected vertical height. The physical light intensity correction subunit, based on the tilt angle, uses a pre-stored photometric correction index and a reverse compensation model to perform gain compensation on the original light intensity values of the ultraviolet, visible, and near-infrared bands, and calculates the corrected light intensity values.
7. The point spectrum intelligent controller according to claim 3, characterized in that, The construction of the evaluation benchmark surface and the calculation of the flatness evaluation index specifically include: Based on the principle of least squares, an ideal evaluation reference surface is constructed using the height data processed by the spectral-geometric bidirectional correction unit, and the plane parameter solution vector is solved. Calculate the local deviation value of each measuring point relative to the evaluation reference surface; Based on the local deviation values, the peak-valley flatness index and the root mean square flatness index are calculated, and the peak-valley flatness index is compared with the preset flatness tolerance threshold to generate a status flag bit.
8. The point spectrum intelligent controller according to claim 1, characterized in that, The storage system program, configuration parameters, and cached real-time spectral data are specifically stored in the following logical address space: The configuration parameter area is used to store sensor array topology parameters, filtering algorithm control parameters, and flatness determination thresholds. A high-speed circular buffer is mapped to a raw data area and a processing result area, used to support direct memory access and writing by the data acquisition synchronization module and reading by the data processing module; The model lookup table area is used to store the numerical table of the tangent function required for geometric correction and the table of correction coefficients of the bidirectional reflectance distribution function required for photometric correction. The historical data log area is used to cyclically record flatness evaluation indicators and judgment status.
9. The point spectrum intelligent controller according to claim 1, characterized in that, The implementation of data interaction and command transmission between the controller and external devices specifically includes: Adaptive network transmission is supported at the physical layer via Ethernet physical layer transceivers. Multiple socket connections are maintained at the logical layer using multiplexing technology, respectively adapting to Modbus TCP protocol, S7 protocol and MQTT protocol; When a data packet is received, the packet header structure and function code are parsed, and the external instructions are converted into internal register access operations. When sending measurement data, a data packet containing a sequence number is generated, and a retransmission timer is started to execute reliable transmission based on the application layer acknowledgment mechanism.
10. A measurement method for a point spectral intelligent controller, comprising the point spectral intelligent controller according to any one of claims 1-9, characterized in that, Includes the following steps: S1. Generate a global synchronization trigger signal to control the multispectral sensor array to acquire data in parallel and construct an original measurement vector matrix containing distance information and multi-band light intensity information; S2. Introduce spatial neighborhood difference constraints and perform adaptive filtering on the original measurement vector matrix; S3. Perform principal component analysis on the filtered data, extract the surface normal vector and calculate the spatial tilt angle; S4. Based on the spatial tilt angle, perform inverse rotation correction of geometric height and bidirectional reflectance distribution function compensation of spectral intensity in parallel. S5. Construct a least-squares evaluation reference surface based on the corrected data, calculate the flatness index, and output the measurement results.