Metal part surface roughness online measurement and feedback control method
By combining coded structured light projection and synchronous image acquisition with phase demodulation and multi-scale wavelet decomposition, the data acquisition and control problems in online measurement of surface roughness of metal parts were solved, and high-precision roughness parameter calculation and feedback control were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN MUZHONG TECHNOLOGY CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for online measurement of surface roughness of metal parts suffer from insufficient data acquisition and preprocessing, making it impossible to accurately capture the microscopic undulations of the surface, resulting in large deviations in the calculation of roughness parameters and making it difficult to achieve precise control.
By employing coded structured light projection and synchronous image acquisition, phase demodulation and multi-scale wavelet decomposition are performed. Combined with real-time processing parameter optimization, accurate target roughness values are generated and feedback control is implemented.
It achieves high-precision measurement and control of the surface roughness of metal parts, meets the requirements of precision machining, and ensures that the surface condition is stable and meets the preset process requirements.
Smart Images

Figure CN122033706A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of surface roughness measurement technology, and in particular to a method for online measurement and feedback control of surface roughness of metal parts. Background Technology
[0002] Existing technologies have significant shortcomings in the data acquisition and preprocessing stages of online measurement of surface roughness of metal parts. They fail to employ coded structured light projection and synchronous image acquisition to obtain surface information, relying solely on single imaging or contact measurement, making it difficult to accurately capture the microscopic undulations of the surface. Furthermore, the lack of targeted noise filtering and phase demodulation processing on the acquired images prevents the effective extraction of phase distribution data containing microscopic morphology, resulting in insufficient accuracy in subsequent 3D coordinate point cloud generation and a lack of reliable foundational data for roughness parameter calculation.
[0003] Existing technologies have significant shortcomings in the parameter calculation and feedback control of surface roughness for metal parts. They fail to dynamically determine the wavelet decomposition level based on theoretical residual height, relying solely on fixed-scale analysis of 3D point clouds, making it difficult to accurately separate microscopic undulation signals and interference components, resulting in large deviations in roughness parameter calculations. Furthermore, they fail to combine initial roughness parameters with real-time machining parameters for filtering optimization, relying only on single measurements to determine surface condition, thus failing to generate accurate target roughness values. Finally, the lack of a systematic deviation analysis and parameter adjustment command generation mechanism makes it difficult to achieve real-time closed-loop optimization of machining parameters, resulting in low control accuracy of surface roughness for metal parts and failing to meet the requirements of precision machining processes. Summary of the Invention
[0004] This invention provides an online measurement and feedback control method for the surface roughness of metal parts to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides an online measurement and feedback control method for the surface roughness of metal parts, comprising: S1. Project coded structured light onto the surface of the metal part to be tested, and simultaneously acquire the structured light image modulated on the surface to be tested to obtain the original stripe image of the metal part. S2. Perform phase demodulation on the original stripe image, extract phase distribution data containing micro-undulation features of the surface under test, and convert the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to the system calibration parameters. S3. Obtain the theoretical residual height in the current processing parameters, and dynamically determine the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, so as to perform multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud and obtain the initial roughness parameters of the surface to be tested. S4. Input the initial roughness parameters and the real-time collected spindle speed, feed rate, cutting depth and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured. S5. Based on the deviation between the target roughness value and the preset process target range, generate a processing parameter adjustment command for the surface to be tested; S6. The machining parameter adjustment command is sent to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part.
[0006] In a preferred embodiment, the process of projecting coded structured light onto the test surface of the metal part and simultaneously acquiring a structured light image modulated on the test surface to obtain the original stripe image of the metal part includes: When the metal part is processed to the measurement station corresponding to the surface to be measured, a synchronous trigger pulse signal for the surface to be measured is generated; The synchronous trigger pulse signal is simultaneously sent to the structured light projection device and the high-speed image acquisition device of the metal part, triggering the structured light projection device to project coded structured light stripes onto the surface under test, and simultaneously triggering the high-speed image acquisition device to acquire the structured light image modulated by the surface under test; The high-speed image acquisition device continuously acquires multiple frames of structured light images and extracts the image frames whose stripe contrast meets the imaging quality requirements from the multiple frames of structured light images as the original stripe images of the metal parts.
[0007] In a preferred embodiment, the step of performing phase demodulation on the original fringe image, extracting phase distribution data containing microscopic undulation features of the surface under test, and converting the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to system calibration parameters includes: Noise interference in the original stripe image is filtered out to obtain the enhanced stripe image of the surface under test; Extract the wrapping phase map representing the micro-undulations of the surface under test from the enhanced striped image; The package phase map is subjected to phase unrolling processing, and phase jumps in the package phase map are eliminated to obtain the absolute phase distribution data of the package phase map; Obtain the pre-calibrated system geometric parameters between the structured light projection device and the image acquisition device, and establish the mapping relationship between the phase in the absolute phase distribution data and the three-dimensional coordinates in the system geometric parameters based on the system geometric parameters; Based on the mapping relationship, a three-dimensional spatial coordinate point cloud of the surface to be measured is generated.
[0008] In a preferred embodiment, the step of obtaining the theoretical residual height from the current processing parameters, dynamically determining the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, and performing multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud to obtain the initial roughness parameters of the surface to be measured includes: The spindle speed, feed rate, and depth of cut are read from the CNC terminal, and the theoretical residual height of the surface under test is calculated under the current machining conditions in combination with the tool's geometric parameters. Based on the geometric relationship between the theoretical residual height and the tool path, the spatial frequency range corresponding to the theoretical residual height on the surface to be tested is determined, so as to obtain the separation frequency range of the surface to be tested. The frequency range to be separated is compared with the frequency band division characteristics of the wavelet basis function, and the number of wavelet decomposition layers that can decompose the signal components corresponding to the frequency range to be separated into the highest frequency detail coefficients is selected to obtain the dynamic decomposition layer of the frequency range to be separated. According to the dynamic decomposition layer, the three-dimensional spatial coordinate point cloud is decomposed into multi-scale wavelet decomposition to obtain the detail coefficients of the frequency band. The detail coefficients of the highest frequency band corresponding to the frequency range to be separated are extracted and used as the micro-undulation feature coefficients of the surface to be tested. Wavelet reconstruction is performed on the micro-undulation characteristic coefficients to obtain the micro-undulation morphology of the surface under test, and the initial roughness parameters of the surface under test are determined based on the micro-undulation morphology.
[0009] In a preferred embodiment, the formula for calculating the theoretical residual height is: ; In the formula, The theoretical residual height, For the tool radius, The feed rate is... The spindle speed, This represents the number of teeth on the cutting tool.
[0010] In a preferred embodiment, determining the initial roughness parameter of the surface to be tested based on the micro-undulation morphology includes: Extract the cross-sectional profile lines along the tool feed direction from the micro-undulation morphology to obtain the two-dimensional profile sequence of the surface to be measured. The two-dimensional contour sequence is subjected to zero-mean processing to eliminate the influence of the overall contour tilt on the roughness evaluation, and the baseline-adjusted contour sequence of the two-dimensional contour sequence is obtained. Identify the contour peaks and valleys in the contour sequence after the benchmark adjustment, and record the positions and amplitudes of the contour peaks and valleys; Based on the amplitude difference between the contour peak and the contour trough, the maximum peak-valley height of the surface under test within the sampling length is determined and used as the amplitude characteristic parameter in the initial roughness parameters of the surface under test. The number of contour peaks and valleys occurring per unit length is counted to determine the peak-valley density of the surface under test, which is then used as the spatial frequency characteristic parameter in the initial roughness parameters.
[0011] In a preferred embodiment, the step of inputting the initial roughness parameters along with the real-time acquired spindle speed, feed rate, depth of cut, and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured includes: Real-time acquisition of spindle speed, feed rate, depth of cut, and cumulative cutting time; The observation noise covariance parameter of the recursive filter is dynamically adjusted based on the variation range of the spindle speed and the feed rate. The initial roughness parameter is input as the observation value into the recursive filter, and the roughness value output at the previous moment and the observation noise covariance parameter are combined to calculate the preliminary update value at the current moment. Based on the accumulated cutting time, the initial update value is drift compensated to obtain the target roughness value of the surface to be tested.
[0012] In a preferred embodiment, the formula for calculating the initial update value is: ; In the formula, The initial update value, This is the roughness value output at the previous moment. The filter gain is determined based on the observed noise covariance parameter. The initial roughness parameters at the current moment.
[0013] In a preferred embodiment, generating the processing parameter adjustment instruction for the surface to be tested based on the deviation between the target roughness value and the preset process target range includes: Read the upper and lower threshold values of the preset process target range from the CNC terminal, and obtain the target roughness value at the current moment; The target roughness value is compared with the upper threshold and the lower threshold respectively to determine the direction and amount of deviation of the target roughness value relative to the preset process target range; Based on the deviation direction, a set of candidate adjustment strategies that match the deviation direction is selected from the adjustment strategies of the metal parts; Based on the magnitude of the deviation, a target adjustment strategy for the surface to be tested is determined from the set of candidate adjustment strategies; The adjustment information in the target adjustment strategy is converted into an instruction format that conforms to the CNC terminal communication protocol to generate the machining parameter adjustment instruction for the surface to be tested.
[0014] In a preferred embodiment, the step of transmitting the machining parameter adjustment command to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part includes: The machining parameter adjustment instructions are encapsulated into data frames according to the communication protocol supported by the CNC terminal to generate the instruction data packet for the metal part; The instruction data packet is sent to the receiving buffer of the CNC terminal; The CNC terminal reads the instruction data packet from the receiving buffer and performs integrity verification on the instruction data packet to confirm that no errors occurred during the transmission of the data packet, and obtains the verification and adjustment instruction for the metal part. Extract the parameter identifier to be adjusted and the corresponding adjustment amount from the verification-passed adjustment instruction, and generate the parameter adjustment value of the verification-passed adjustment instruction; The parameter adjustment value is written into the current machining parameter register of the CNC terminal, overwriting the original cutting parameters, so as to update the cutting parameters of the CNC terminal.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention provides high-quality data support for online measurement of surface roughness of metal parts through precise optical measurement and data processing. Encoded structured light is projected onto the surface to be measured while images are simultaneously acquired, and high-contrast original stripe images are selected. After noise filtering, phase demodulation, and unfolding processing, absolute phase data containing microscopic undulation features is extracted. Combined with system calibration parameters, a precise three-dimensional spatial coordinate point cloud is generated, comprehensively capturing surface micromorphological information and laying a reliable foundation for roughness parameter calculation.
[0016] 2. This invention significantly improves the measurement accuracy and control efficiency of surface roughness of metal parts by utilizing intelligent parameter optimization and closed-loop feedback control. It dynamically determines the wavelet decomposition level based on theoretical residual height, accurately extracting initial roughness parameters from the 3D point cloud; it integrates real-time machining process parameters and generates target roughness values through recursive filtering; and it generates targeted machining parameter adjustment instructions through deviation analysis and sends them to the CNC terminal, achieving real-time optimization of cutting parameters. This ensures that the surface roughness of metal parts stably meets preset process requirements, satisfying the high-precision control needs of precision machining. Attached Figure Description
[0017] Figure 1This is a flowchart illustrating an online measurement and feedback control method for the surface roughness of metal parts according to an embodiment of the present invention. The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0019] This application provides a method for online measurement and feedback control of the surface roughness of metal parts. The executing entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the method for online measurement and feedback control of the surface roughness of metal parts can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0020] Reference Figure 1 The diagram shown is a flowchart illustrating an online measurement and feedback control method for the surface roughness of metal parts according to an embodiment of the present invention. In this embodiment, the online measurement and feedback control method for the surface roughness of metal parts includes: S1. Project coded structured light onto the surface of the metal part to be tested, and simultaneously acquire the structured light image modulated on the surface to be tested to obtain the original stripe image of the metal part. In this embodiment of the invention, the step of projecting coded structured light onto the surface of the metal part to be tested and simultaneously acquiring a structured light image modulated on the surface to be tested to obtain the original stripe image of the metal part includes: When the metal part is processed to the measurement station corresponding to the surface to be measured, a synchronous trigger pulse signal for the surface to be measured is generated; The synchronous trigger pulse signal is simultaneously sent to the structured light projection device and the high-speed image acquisition device of the metal part, triggering the structured light projection device to project coded structured light stripes onto the surface under test, and simultaneously triggering the high-speed image acquisition device to acquire the structured light image modulated by the surface under test; The high-speed image acquisition device continuously acquires multiple frames of structured light images and extracts the image frames whose stripe contrast meets the imaging quality requirements from the multiple frames of structured light images as the original stripe images of the metal parts.
[0021] After the metal part is conveyed to the measurement station corresponding to the surface to be measured by the conveying mechanism, the position detection device of the measurement station monitors the position status of the part in real time. When the part is detected to be completely in the measurement area and the position is stable, the position detection device sends a position signal to the control unit. After receiving the signal, the control unit immediately generates a synchronous trigger pulse signal. This synchronous trigger pulse signal is used to accurately synchronize the working timing of the structured light projection device and the high-speed image acquisition device. The data source of this synchronous trigger pulse signal is the response result of the control unit to the part position signal.
[0022] The control unit sends a synchronous trigger pulse signal to both the structured light projection device and the high-speed image acquisition device via a signal transmission line. Upon receiving the pulse signal, the structured light projection device immediately activates its internal light source and generates a preset coded structured light stripe using a coding template. This stripe contains a black and white rectangular coding pattern with a stripe width of two millimeters. The coded structured light stripe is then precisely projected onto the surface of the metal part to be tested through the projection lens. Simultaneously, upon receiving the pulse signal, the high-speed image acquisition device automatically focuses its lens onto the surface to be tested, and the shutter quickly opens to acquire the structured light image modulated by reflection from the surface to be tested. This ensures that there is no time difference between the projection and acquisition actions. The data source of this modulated structured light image is the real-time capture result of the coded structured light stripe projected onto the surface to be tested by the high-speed image acquisition device.
[0023] The high-speed image acquisition device continuously acquires 20 frames of structured light images at a rate of 300 frames per second. After acquisition, the built-in image quality detection module analyzes the stripe contrast of each frame. By comparing the difference in gray values between the bright and dark areas of the stripes in the image, it determines whether the contrast meets the requirements. A contrast greater than 60 is set as the standard for acceptable imaging quality. Thirteen frames with contrast that meet the standard are selected and archived in the order of acquisition to obtain the original stripe image of the metal part. The data source of this original stripe image is the selection result of the image frames that meet the imaging quality requirements from the multiple frames of structured light images continuously acquired by the high-speed image acquisition device.
[0024] The beneficial effects are that it ensures strict synchronization between structured light projection and image acquisition, avoids imaging distortion caused by timing misalignment, and ensures that the image can truly reflect the state of the surface under test.
[0025] Encoded structured light can accurately capture microscopic surface undulations, providing a clear and effective image foundation for subsequent phase demodulation and improving the reliability of data processing.
[0026] High-contrast image frames are selected as the original stripe images to eliminate low-quality image interference, providing high-quality input for subsequent steps and ensuring the accuracy of roughness measurement.
[0027] S2. Perform phase demodulation on the original stripe image, extract phase distribution data containing micro-undulation features of the surface under test, and convert the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to the system calibration parameters. In this embodiment of the invention, the step of performing phase demodulation on the original stripe image, extracting phase distribution data containing microscopic undulation features of the surface under test, and converting the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to system calibration parameters includes: Noise interference in the original stripe image is filtered out to obtain the enhanced stripe image of the surface under test; Extract the wrapping phase map representing the micro-undulations of the surface under test from the enhanced striped image; The package phase map is subjected to phase unrolling processing, and phase jumps in the package phase map are eliminated to obtain the absolute phase distribution data of the package phase map; Obtain the pre-calibrated system geometric parameters between the structured light projection device and the image acquisition device, and establish the mapping relationship between the phase in the absolute phase distribution data and the three-dimensional coordinates in the system geometric parameters based on the system geometric parameters; Based on the mapping relationship, a three-dimensional spatial coordinate point cloud of the surface to be measured is generated.
[0028] The original stripe image is imported into the image denoising system. The original stripe image comes from qualified image frames screened by the high-speed image acquisition device. The system uses median filtering to process the image. By selecting the gray values of each pixel and its eight neighboring pixels in the image, the median value is taken as the new gray value of the pixel. This removes isolated noise points caused by ambient light interference and electronic noise from the device. For example, bright spots or dark spots with abrupt changes in gray value in the image are replaced with the median gray value of the surrounding pixels, making the stripe outline clearer. After processing, the enhanced stripe image of the surface to be tested is obtained. The data source of the enhanced stripe image is the result of the original stripe image after median filtering and denoising.
[0029] The enhanced fringe image is input into the phase extraction system. The system analyzes the grayscale variation pattern of the coded structured light fringes in the image to identify the alternation period of light and dark and the phase change characteristics of the fringes. Since there are micro-undulations on the surface under test, the projected fringes will produce corresponding deformations. The fringe deformation and the surface undulations form a one-to-one correspondence. By capturing the grayscale distribution difference corresponding to this deformation, the system extracts the phase information that can characterize the micro-undulation state of the surface under test. This phase information is presented in the form of an image to obtain the wrapping phase map of the surface under test. The data source of the wrapping phase map is the phase information extraction result corresponding to the fringe deformation and surface undulations in the enhanced fringe image. For example, when there is a 0.1 mm protrusion on the surface under test, obvious phase change fringes will appear at the corresponding position in the wrapping phase map.
[0030] The wrapped phase map is imported into the phase unfolding system. The phase values in the wrapped phase map are usually limited to a specific range, and there are phase jump phenomena caused by phase values exceeding the range. The system is based on the continuous stripe area in the wrapped phase map. Starting from the area with stable phase values, it gradually expands to the surrounding area according to the distribution order of the stripes. By comparing the phase difference of adjacent pixels, the position and magnitude of the phase jump are determined, and the phase values of the jump area are corrected and compensated. For example, when the phase difference between adjacent pixels exceeds 180 degrees, it is considered that there is a phase jump. By superimposing the phase value of 360 degrees, the phase change is made continuous. After eliminating all phase jumps, the absolute phase distribution data that can completely reflect the phase distribution of the surface under test is obtained. The data source of this absolute phase distribution data is the processing result of the wrapped phase map after phase unfolding and jump elimination.
[0031] The system geometric parameters between the pre-calibrated structured light projection device and the image acquisition device are obtained through system calibration experiments. These parameters include the installation distance between the projection device and the acquisition device, the lens focal length, and the optical axis angle. For example, the installation distance between the projection device and the acquisition device is set to 500 mm, the lens focal length to 50 mm, and the optical axis angle to 15 degrees. These parameters are determined and stored in the control unit through a special calibration plate and calibration process. After retrieving these system geometric parameters, the correspondence between each phase value in the absolute phase distribution data and the three-dimensional coordinates is established according to the imaging principle of structured light measurement. The spatial position of the point on the test surface corresponding to different phase values is clarified. The data source of this mapping relationship is the correlation establishment result between the system geometric parameters and the absolute phase distribution data.
[0032] Based on the established mapping relationship between phase and three-dimensional coordinates, each phase value in the absolute phase distribution data is transformed, and each phase value is mapped to a specific coordinate in three-dimensional space. For example, a certain phase value corresponds to a position of 200 mm on the X-axis, 150 mm on the Y-axis, and 80 mm on the Z-axis in three-dimensional space. All the transformed three-dimensional coordinates are organized according to their distribution order on the surface to be measured, forming a coordinate set that can comprehensively reflect the three-dimensional morphology of the surface to be measured, thus obtaining the three-dimensional spatial coordinate point cloud of the surface to be measured. The data source of this three-dimensional spatial coordinate point cloud is the integrated result of the three-dimensional coordinates after the absolute phase distribution data is transformed by the mapping relationship.
[0033] The beneficial effects are that noise interference in the original stripe image is filtered out, resulting in a clear enhanced stripe image, which provides a high-quality image basis for subsequent phase extraction and ensures the accuracy of the phase data.
[0034] By extracting the encapsulated phase map from the enhanced stripe image, the phase changes corresponding to the micro-undulations of the surface under test are accurately captured, providing core feature data for reconstructing the surface morphology.
[0035] Eliminating phase jumps in the wrapped phase map yields continuous and complete absolute phase distribution data, avoiding morphology reconstruction deviations caused by phase discontinuities.
[0036] By establishing a mapping relationship between phase and three-dimensional coordinates based on system geometric parameters, the accurate conversion of phase data to spatial coordinates is realized, providing a reliable basis for generating three-dimensional point clouds.
[0037] The system generates a three-dimensional spatial coordinate point cloud of the surface to be tested, which comprehensively and accurately reflects the three-dimensional morphology of the surface, laying a solid foundation for subsequent roughness parameter calculation.
[0038] S3. Obtain the theoretical residual height in the current processing parameters, and dynamically determine the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, so as to perform multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud and obtain the initial roughness parameters of the surface to be tested. In this embodiment of the invention, the step of obtaining the theoretical residual height in the current processing parameters, dynamically determining the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, and performing multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud to obtain the initial roughness parameters of the surface to be measured includes: The spindle speed, feed rate, and depth of cut are read from the CNC terminal, and the theoretical residual height of the surface under test is calculated under the current machining conditions in combination with the tool's geometric parameters. Based on the geometric relationship between the theoretical residual height and the tool path, the spatial frequency range corresponding to the theoretical residual height on the surface to be tested is determined, so as to obtain the separation frequency range of the surface to be tested. The frequency range to be separated is compared with the frequency band division characteristics of the wavelet basis function, and the number of wavelet decomposition layers that can decompose the signal components corresponding to the frequency range to be separated into the highest frequency detail coefficients is selected to obtain the dynamic decomposition layer of the frequency range to be separated. According to the dynamic decomposition layer, the three-dimensional spatial coordinate point cloud is decomposed into multi-scale wavelet decomposition to obtain the detail coefficients of the frequency band. The detail coefficients of the highest frequency band corresponding to the frequency range to be separated are extracted and used as the micro-undulation feature coefficients of the surface to be tested. Wavelet reconstruction is performed on the micro-undulation characteristic coefficients to obtain the micro-undulation morphology of the surface under test, and the initial roughness parameters of the surface under test are determined based on the micro-undulation morphology.
[0039] The formula for calculating the theoretical residual height is: ; In the formula, The theoretical residual height, For the tool radius, The feed rate is... The spindle speed, This represents the number of teeth on the cutting tool.
[0040] Determining the initial roughness parameters of the surface under test based on the micro-undulation morphology includes: Extract the cross-sectional profile lines along the tool feed direction from the micro-undulation morphology to obtain the two-dimensional profile sequence of the surface to be measured. The two-dimensional contour sequence is subjected to zero-mean processing to eliminate the influence of the overall contour tilt on the roughness evaluation, and the baseline-adjusted contour sequence of the two-dimensional contour sequence is obtained. Identify the contour peaks and valleys in the contour sequence after the benchmark adjustment, and record the positions and amplitudes of the contour peaks and valleys; Based on the amplitude difference between the contour peak and the contour trough, the maximum peak-valley height of the surface under test within the sampling length is determined and used as the amplitude characteristic parameter in the initial roughness parameters of the surface under test. The number of contour peaks and valleys occurring per unit length is counted to determine the peak-valley density of the surface under test, which is then used as the spatial frequency characteristic parameter in the initial roughness parameters.
[0041] The core parameters of the current machining process are directly read from the CNC terminal through the data interaction interface, including the spindle speed of 2,000 revolutions per minute, the feed rate of 300 millimeters per millimeter, and the depth of cut of 5 millimeters. At the same time, the geometric parameters of the tool are retrieved, such as the tool tip radius of 0.8 millimeters and the number of cutting edges of the tool. Combining the machining and cutting state reflected by these parameters, the influence of spindle speed on the fineness of material cutting, the effect of feed rate on the cutting trajectory spacing, and the material residue determined by the depth of cut and tool geometric parameters are analyzed. The theoretical residual height of the test surface under the current machining conditions is calculated to be 0.05 millimeters. The data source of this theoretical residual height is the comprehensive analysis result of the machining parameters and tool geometric parameters read by the CNC terminal.
[0042] The theoretical residual height is defined as the height of the unremoved material formed on the surface to be measured after cutting. The spacing and direction of the toolpath are directly related to the theoretical residual height. The larger the theoretical residual height, the longer the undulation period of the corresponding toolpath on the surface, and the lower the spatial frequency. Conversely, the smaller the theoretical residual height, the higher the spatial frequency. This spatial frequency directly corresponds to the surface roughness characteristic frequency determined by the cutting process of the metal part. Based on this geometric relationship, and combined with the current theoretical residual height of 0.05 mm, the spatial frequency range corresponding to it on the surface to be measured is determined to be 50 to 100 Hz per millimeter. This range can accurately cover the surface undulation signal dominated by the theoretical residual height, thus obtaining the frequency range to be separated on the surface to be measured. The data for this frequency range is derived from the relationship between the theoretical residual height and the toolpath geometry.
[0043] The frequency band division characteristics of the selected wavelet basis function are obtained in advance. These characteristics clarify the frequency range corresponding to each frequency band under different wavelet decomposition levels. For example, a single-level decomposition of a certain wavelet basis function can divide the signal into low-frequency approximation coefficients and high-frequency detail coefficients. The high-frequency detail coefficients correspond to frequencies above 100 Hz per millimeter. A two-level decomposition can further divide the high-frequency detail coefficients into two frequency bands: 50 to 100 Hz per millimeter and above 100 Hz per millimeter. To ensure the surface roughness evaluation of metal parts, only the micro-morphology directly related to the theoretical residual height is retained, and low-frequency shape errors and high-frequency noise interference are excluded. The frequency range to be separated (50 to 100 Hz per millimeter) is compared one by one with the frequency band division characteristics. It is found that when the wavelet decomposition level is two, the signal components corresponding to the frequency range to be separated can be accurately decomposed to the highest frequency detail coefficients. Therefore, two levels are selected as the dynamic decomposition level, and the dynamic decomposition level of the frequency range to be separated is obtained. The data source for the dynamic decomposition level is the comparison result between the frequency range to be separated and the frequency band division characteristics of the wavelet basis function.
[0044] The three-dimensional spatial coordinate point cloud is input into the wavelet decomposition system. This three-dimensional spatial coordinate point cloud is derived from the coordinate transformation result of the absolute phase distribution data. The multi-scale wavelet decomposition process is initiated according to the determined two-level dynamic decomposition layer. The first-level decomposition separates the low-frequency signal in the point cloud data from the high-frequency signal above 100 Hz per millimeter, obtaining the low-frequency approximation coefficient and high-frequency detail coefficient of the first level. The second-level decomposition further decomposes the high-frequency detail coefficient of the first level, separating two frequency band detail coefficients: 50 to 100 Hz per millimeter and above 100 Hz per millimeter. The highest frequency band detail coefficient corresponding to the 50 to 100 Hz frequency range to be separated is extracted. This coefficient specifically corresponds to the micro-undulations of the metal cutting surface caused by the theoretical residual height formed by the feed trajectory and tool geometry. Low-frequency shape errors and high-frequency measurement noise introduced by clamping, machine tool movement, etc. are eliminated. This coefficient can accurately reflect the micro-undulation characteristics of the test surface caused by the theoretical residual height. It is used as the micro-undulation characteristic coefficient of the test surface. The data source of this micro-undulation characteristic coefficient is the high-frequency band detail coefficient extraction result after the three-dimensional spatial coordinate point cloud is decomposed by multi-scale wavelet decomposition.
[0045] The extracted micro-undulation feature coefficients are input into a wavelet reconstruction system. Following the inverse process of wavelet decomposition, the system reconstructs the feature coefficients by recovering the signal layer by layer, restoring the micro-morphology of the surface under test corresponding to each coefficient. For example, the reconstructed surface exhibits a periodic undulation morphology with uniform spacing and a height of approximately 0.05 mm. This morphology represents the micro-undulation morphology of the surface under test, strictly corresponding to the micro-geometric morphology defined in the surface roughness definition of metal parts, eliminating macroscopic shape errors and intermediate waviness interference. Referring to surface roughness measurement standards, the arithmetic mean deviation and maximum profile height of the surface under test are calculated by statistically analyzing the deviation of each point in this micro-undulation morphology from the average plane. These are used as the initial roughness parameters of the surface under test. The data for these initial roughness parameters comes from the micro-undulation morphology analysis results after wavelet reconstruction of the micro-undulation feature coefficients.
[0046] The tool radius is derived from the inherent geometric parameters of the tool used in the current machining process. These parameters are core specification data determined during tool manufacturing and can be directly obtained from the tool's technical specification or the preset tool parameter library in the CNC machining system.
[0047] The feed rate is derived from the set value of the current machining process parameters in the CNC terminal. This value is determined and input into the CNC system when the machining process is compiled based on the machining requirements, and is used to control the movement speed of the tool during the machining process.
[0048] The spindle speed is derived from the machining process parameters configured on the CNC terminal. It is a spindle rotation rate parameter set to meet material cutting requirements and ensure machining quality and efficiency, and can be directly read from the process parameter interface of the CNC system.
[0049] The number of teeth on a cutting tool is derived from the structural parameters of the tool used. It is a fixed attribute of the tool itself and reflects the number of cutting edges that participate in the cutting process. It can be obtained through tool markings or technical documents.
[0050] The theoretical residual height obtained by this calculation can accurately reflect the height of material that has not been removed from the surface of the metal part after cutting by the tool under the current processing conditions. It intuitively reflects the basic undulation state of the surface under test under the combined effect of processing parameters and tool parameters, and provides direct and exclusive basic data support for the accurate separation, quantitative evaluation and process optimization of surface roughness of metal cutting.
[0051] As the tool radius increases, the theoretical residual height decreases because a larger radius tool can remove material more thoroughly during cutting, reducing the amount of unremoved material on the surface. As the feed rate increases, the theoretical residual height also increases because the faster tool movement speed increases the spacing between adjacent cutting paths, leading to more uncut material residue. As the spindle speed increases, the theoretical residual height decreases because higher speeds result in more cuts per unit time, leading to finer material removal and a lower residual height. Finally, as the number of tool teeth increases, the theoretical residual height decreases because more cutting edges can share the cutting load, resulting in denser cutting paths and less uncut material remaining on the surface.
[0052] A measurement section along the tool feed direction is selected from the micro-undulation morphology. This micro-undulation morphology is derived from the wavelet reconstruction results of the micro-undulation characteristic coefficients. The contour line is extracted within this section using an equal-interval sampling method. The sampling interval is set to 0.01 mm. Starting from one end of the section, the contour height data of each point is collected sequentially at intervals, for a total of one thousand sampling points. These sampling points are arranged in the collection order to form a two-dimensional contour sequence that can reflect the undulation changes of the measured surface along the feed direction. The data source of this two-dimensional contour sequence is the cross-sectional contour sampling results along the feed direction in the micro-undulation morphology.
[0053] The two-dimensional contour sequence is imported into the contour adjustment system. The system calculates the average height data of all contour points in the sequence. For example, the average height of all sampling points is calculated to be fifty micrometers. Then, the average height value is subtracted from the original height data of each contour point, so that the height data of all contour points fluctuates around zero after adjustment. This completely eliminates the influence of macroscopic plane tilt caused by installation error or processing tilt on the microscopic evaluation of surface roughness of metal parts, and obtains the baseline adjusted contour sequence of the two-dimensional contour sequence. The data source of the baseline adjusted contour sequence is the result of the two-dimensional contour sequence after zero mean processing.
[0054] For each contour point in the baseline-adjusted contour sequence, adjacent points are compared. Starting from the beginning of the sequence, the height relationship between the current point and the previous and next points is determined sequentially. If the height of the current point is higher than both the previous and next points, the point is determined to be a contour peak; if the height of the current point is lower than both the previous and next points, the point is determined to be a contour trough. For example, if the height of a point is 60 micrometers, and the height of the previous point is 58 micrometers and the height of the next point is 57 micrometers, this point is a contour peak. If the height of a point is 42 micrometers, and the height of the previous point is 46 micrometers and the height of the next point is 45 micrometers, this point is a contour trough. At the same time, the position number and corresponding height amplitude of each contour peak and contour trough in the sequence are recorded. The position and amplitude data of the contour peak and contour trough are obtained from the adjacent point comparison results of the baseline-adjusted contour sequence.
[0055] The sampling length is set to five millimeters, which covers five hundred consecutive sampling points in the two-dimensional profile sequence. Within this sampling length, the maximum height amplitude of all profile peaks and the minimum height amplitude of all profile troughs are selected, and the difference between the two is calculated. For example, if the maximum peak height amplitude within the sampling length is sixty-five micrometers and the minimum trough height amplitude is thirty-seven micrometers, the difference is twenty-eight micrometers. This difference is the maximum peak and valley height of the surface under test within the sampling length, which directly corresponds to the maximum height feature of the surface roughness of the metal part. It is used as the amplitude feature parameter in the initial roughness parameters of the surface under test. The data source of this amplitude feature parameter is the calculation result of the difference between the maximum amplitude of the profile peaks and troughs within the sampling length.
[0056] A measurement segment with a length of one millimeter is selected, containing one hundred continuous sampling points. The total number of contour peaks and valleys within this measurement segment is counted. For example, if fifteen contour peaks and fourteen contour valleys are found in this segment, the total number is twenty-nine. This number is the number of times peaks and valleys appear per unit length, which is the peak-valley density of the surface under test. This parameter directly reflects the density of the micro-undulations of the metal cutting surface and corresponds directly to the spatial frequency characteristics of surface roughness. It is used as the spatial frequency characteristic parameter in the initial roughness parameters. The data source of this spatial frequency characteristic parameter is the statistical result of the number of contour peaks and valleys per unit length.
[0057] The beneficial effect is that by combining machining and tool parameters to accurately calculate the theoretical residual height, a clear process correlation basis is provided for subsequent signal separation, ensuring that the roughness analysis fits the actual machining scenario.
[0058] By determining the frequency range to be separated through the geometric relationship between the theoretical residual height and the tool path, the signal range related to roughness can be accurately locked, avoiding interference from irrelevant frequencies.
[0059] Dynamic matching of wavelet decomposition levels enables precise separation of the target frequency signal down to the highest frequency detail coefficients, improving the targeting and accuracy of micro-undulation feature extraction.
[0060] The micro-undulation characteristic coefficients of the corresponding frequency band are extracted and the morphology is reconstructed to fully restore the micro-morphology of the surface under test related to roughness, providing a real morphological basis for parameter calculation.
[0061] The initial roughness parameters are determined based on the micro-undulation morphology, covering amplitude and spatial frequency characteristics, which comprehensively and accurately reflects the surface roughness state and provides reliable data support for subsequent optimization.
[0062] By integrating core parameters such as tool radius, feed rate, spindle speed, and number of tool teeth, the theoretical residual height of the surface under test under the current machining conditions is accurately quantified, providing a clear and objective process basis for subsequent roughness-related signal separation.
[0063] The formula is directly related to the processing technology and the surface undulation, which makes the calculation of the theoretical residual height have clear logic and repeatability, avoids the error caused by subjective estimation, and ensures the reliability of the data.
[0064] The calculation results can intuitively reflect the influence of each processing parameter on the surface residual height, providing key support for subsequent dynamic adjustment of the wavelet decomposition layer and accurate separation of roughness signals, and helping to improve the calculation accuracy of the initial roughness parameters.
[0065] The cross-sectional profile lines along the tool feed direction are extracted to generate a two-dimensional profile sequence, which accurately focuses on surface undulations directly related to the machining process, providing targeted data for roughness assessment.
[0066] Zero-mean processing eliminates the interference of overall profile tilt, making roughness assessment based solely on surface micro-undulations and improving the accuracy of parameter calculation.
[0067] Accurately identify the peaks and troughs of the contour and record key information to fully capture the core features of the surface micro-undulations, laying the foundation for subsequent parameter calculations.
[0068] Using the maximum peak-valley height as the amplitude characteristic parameter, it intuitively reflects the severity of surface undulations, which meets the core assessment requirements of roughness.
[0069] Using peak-valley density as a spatial frequency characteristic parameter, the density of surface undulations is quantified, enabling a multi-dimensional and accurate characterization of roughness and providing comprehensive data support for subsequent optimization.
[0070] S4. Input the initial roughness parameters and the real-time collected spindle speed, feed rate, cutting depth and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured. In this embodiment of the invention, the step of inputting the initial roughness parameters along with the real-time acquired spindle speed, feed rate, depth of cut, and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured includes: Real-time acquisition of spindle speed, feed rate, depth of cut, and cumulative cutting time; The observation noise covariance parameter of the recursive filter is dynamically adjusted based on the variation range of the spindle speed and the feed rate. The initial roughness parameter is input as the observation value into the recursive filter, and the roughness value output at the previous moment and the observation noise covariance parameter are combined to calculate the preliminary update value at the current moment. Based on the accumulated cutting time, the initial update value is drift compensated to obtain the target roughness value of the surface to be tested.
[0071] The formula for calculating the initial update value is: ; In the formula, The initial update value, This is the roughness value output at the previous moment. The filter gain is determined based on the observed noise covariance parameter. The initial roughness parameters at the current moment.
[0072] The recursive filter is specifically implemented using an adaptive Kalman filter. Its core is to dynamically adapt to the fluctuations of process parameters during the processing by adjusting the observation noise covariance parameter in real time, thereby ensuring the stability and accuracy of roughness calculation.
[0073] The CNC system continuously acquires core process parameters during the current machining process through its real-time data acquisition interface. The spindle speed is collected once per second by the speed sensor on the spindle, and the current speed is recorded as 2,200 revolutions per minute. The feed rate is monitored in real time by the displacement sensor of the feed axis, and the current value is 320 millimeters per millimeter. The depth of cut is determined by the tool feed stroke recording device, and the current value is 5.2 millimeters. The cumulative cutting time is started from the start of machining, and the system's built-in timer counts that 30 minutes of cutting has been accumulated at the current moment. These real-time acquired parameters together constitute the input process data of the recursive filter, and the data source of this input process data is the real-time monitoring results of each sensor and timer.
[0074] The baseline variation range for spindle speed and feed rate is set to 5%. The currently acquired spindle speed and feed rate are compared with the parameters from the previous moment, and the percentage change is calculated (the difference between the current and previous parameters). This difference is divided by the current parameter and then multiplied by 100%. The dynamic adjustment of the observed noise covariance parameter uses an empirical method of linear mapping. The specific calculation method is as follows: the observed noise covariance parameter at the current moment equals the baseline observed noise covariance value multiplied by one, plus an adjustment coefficient, and then multiplied by the difference between the parameter variation ratio and the baseline variation range. If this difference is negative, it is set to zero. The baseline observed noise covariance value is set to 0.02, and the adjustment coefficient is set to 0.05, which can be adjusted according to the machining material, with an adjustment range of 0.03 to 0.08. The baseline variation range is 5%. The core logic of this calculation method is that the covariance parameter is increased only when the parameter variation ratio exceeds the baseline range; otherwise, the baseline value remains unchanged.
[0075] For example, if the spindle speed was 2,000 revolutions per minute in the previous moment and is currently 2,200 revolutions per minute, the change is 10%, exceeding the baseline change by 5%. The calculation process for the current observation noise covariance parameter is: 0.02 multiplied by 1 plus 0.05 multiplied by 10% minus 5%, resulting in 0.025. This is adjusted towards increasing the value, reducing the filter's confidence in the observation to accommodate fluctuations caused by sudden parameter changes. If the feed rate changes from 310 mm / mm to 320 mm / mm, the change is approximately 3.2%, lower than the baseline change. In this case, the difference between the parameter change and the baseline change is negative, so it is calculated as zero. The observation noise covariance parameter remains unchanged at the baseline value of 0.02. Through this explicit linear mapping calculation method, dynamic adaptation to parameter changes is achieved, ensuring stable filtering effects. The data source for this observation noise covariance parameter is the comparison between the parameter change range and the baseline range, as well as the above empirical calculation results.
[0076] The filter gain is calculated based on the optimal gain calculation method of Kalman filtering, combined with the dynamically adjusted observation noise covariance parameter mentioned above. The core calculation method is as follows: the filter gain equals the state covariance of the previous time step, which reflects the estimation error of the roughness output value at the previous time step. This state covariance is divided by one minus the state covariance of the previous time step plus the dynamically adjusted observation noise covariance parameter at the current time step. The initial value of the state covariance of the previous time step is set to 0.01, and it is updated iteratively with the filtering process. The update method is: the state covariance of the current time step equals one minus the filter gain of the current time step multiplied by the state covariance of the current time step. The core logic of this calculation method is: if the observation noise covariance parameter is small, it indicates high confidence in the observation value, a small denominator value, and a large filter gain. In this case, the current observation value has a higher weight in the initial update value calculation. Conversely, if the observation noise covariance parameter is large, it indicates low confidence in the observation value, a large denominator value, and a small filter gain. In this case, the output value of the previous time step has a higher weight. This balances the weights of the observation value and the output value of the previous time step in the calculation, achieving adaptive filtering.
[0077] The initial roughness parameters, including the amplitude characteristic parameter of 28 micrometers and the spatial frequency characteristic parameter of 29 per millimeter, are used as observations and input into a pre-built adaptive Kalman filter. Simultaneously, the roughness values output by the filter at the previous moment are retrieved: the amplitude characteristic parameter is 26 micrometers and the spatial frequency characteristic parameter is 28 per millimeter. Combined with the dynamically adjusted observation noise covariance parameter (0.025 in this example) and the previous moment's state covariance (0.01 in this example), and substituted into the above filter gain calculation method, the calculated filter gain is approximately 0.2857. Subsequently, the filter integrates the weights of the observation values and the previous moment's output values using the above preliminary update value calculation method, smoothing both. In this embodiment, due to parameter abrupt changes, the filter gain is relatively small, and the previous moment's output value has a higher weight, weakening the impact of parameter abrupt changes. The calculated preliminary update value for the current moment's amplitude characteristic parameter is 27 micrometers, and the preliminary update value for the spatial frequency characteristic parameter is 28.5 per millimeter. The data source for this preliminary update value is the integrated calculation result of the observation values, the previous moment's output value, and the observation noise covariance parameter.
[0078] The drift compensation coefficient is set according to the length of the cumulative cutting time. When the cumulative cutting time is less than 30 minutes, the compensation coefficient is 0.01. After 30 minutes, the compensation coefficient increases by 0.005 for every 10 minutes. The current cumulative cutting time is 30 minutes, and the corresponding compensation coefficient is 0.01. This compensation coefficient is applied to the initial update value to correct the roughness drift caused by factors such as tool wear and temperature changes. For example, the initial update value of the amplitude characteristic parameter is 27 micrometers. Multiplying it by one and subtracting the compensation coefficient, the corrected amplitude characteristic parameter is 26.73 micrometers. The initial update value of the spatial frequency characteristic parameter is 28.5 per millimeter. Multiplying it by one and subtracting the compensation coefficient, the corrected spatial frequency characteristic parameter is 28.2 per millimeter. The two corrected parameters are combined to obtain the target roughness value of the surface to be measured. The data source of this target roughness value is the result of the initial update value after cumulative cutting time drift compensation.
[0079] The roughness value output at the previous moment comes from the output result of the recursive filter in the previous calculation cycle. This result was calculated at the previous moment by combining the initial roughness parameters, the observation noise covariance parameters, and the output value at an earlier moment. It has been stored in the filter's buffer unit for use at the current moment.
[0080] The initial roughness parameters at the current moment are derived from the analysis results of the micro-undulation morphology of the surface of the metal part to be tested. By extracting the two-dimensional contour sequence of the micro-undulation morphology, after zero-mean processing and identification of the contour peaks and valleys, the amplitude characteristic parameters and spatial frequency characteristic parameters are determined. The two together constitute the initial roughness parameters at the current moment.
[0081] The core significance of this calculation is to integrate the roughness output value from the previous moment with the initial roughness parameters at the current moment, and combine it with the filter gain dynamically calculated based on the observation noise covariance parameter to obtain the preliminary update value at the current moment. This not only preserves the roughness change trend reflected by historical data, but also incorporates the latest information from the current observation data. At the same time, by dynamically adjusting the filter gain, the impact of observation noise on the calculation results is reduced, so that the preliminary update value can more accurately reflect the roughness state of the surface under the current processing conditions.
[0082] When the initial roughness parameter at the current moment is greater than the roughness value output at the previous moment, the initial update value will increase towards the current initial roughness parameter based on the output value at the previous moment. The magnitude of the increase is determined by the filter gain; the larger the filter gain, the closer the increase is to the difference between the two. When the initial roughness parameter at the current moment is less than the roughness value output at the previous moment, the initial update value will decrease towards the current initial roughness parameter based on the output value at the previous moment. The magnitude of the decrease is also controlled by the filter gain; the larger the filter gain, the closer the decrease is to the difference between the two. When the initial roughness parameter at the current moment is equal to the roughness value output at the previous moment, the initial update value remains consistent with that value.
[0083] The beneficial effects are that real-time acquisition of core machining parameters and cumulative cutting time provides comprehensive and real-time input data for recursive filtering, ensuring that the target roughness value calculation fits the current machining state.
[0084] The observed noise covariance parameter is dynamically adjusted based on the changes in spindle speed and feed rate, so that the filter can adaptively adapt to the fluctuations in machining parameters and reduce the interference of parameter mutations on roughness calculation.
[0085] The initial roughness parameters are combined with the output value of the previous moment to calculate the preliminary update value, taking into account both observation data and historical trends, thereby improving the stability and continuity of the roughness value.
[0086] Drift compensation based on cumulative cutting time corrects roughness deviations caused by factors such as tool wear and temperature changes, further improving the accuracy of the target roughness value and providing a reliable basis for subsequent machining parameter adjustments.
[0087] By integrating the roughness output value from the previous moment with the current initial roughness parameter, and taking into account both historical data trends and real-time observation information, the initial update value is made to better reflect the actual processing status.
[0088] The filter gain is determined by the observation noise covariance parameter, and the weights of the observed values and historical values are dynamically balanced to reduce the interference of parameter fluctuations or measurement noise on the results and improve the stability of the initial update values.
[0089] It can quickly calculate the initial update value, ensuring the efficiency of target roughness value generation and providing timely data support for subsequent drift compensation and machining parameter adjustment.
[0090] S5. Based on the deviation between the target roughness value and the preset process target range, generate a processing parameter adjustment command for the surface to be tested; In this embodiment of the invention, generating a processing parameter adjustment instruction for the surface to be tested based on the deviation between the target roughness value and the preset process target range includes: Read the upper and lower threshold values of the preset process target range from the CNC terminal, and obtain the target roughness value at the current moment; The target roughness value is compared with the upper threshold and the lower threshold respectively to determine the direction and amount of deviation of the target roughness value relative to the preset process target range; Based on the deviation direction, a set of candidate adjustment strategies that match the deviation direction is selected from the adjustment strategies of the metal parts; Based on the magnitude of the deviation, a target adjustment strategy for the surface to be tested is determined from the set of candidate adjustment strategies; The adjustment information in the target adjustment strategy is converted into an instruction format that conforms to the CNC terminal communication protocol to generate the machining parameter adjustment instruction for the surface to be tested.
[0091] The adjustment strategy library for metal parts is pre-built based on historical machining big data and stored in the form of lookup tables. These tables contain preset adjustment schemes for machining parameters corresponding to different deviation directions and deviation levels, including adjustment methods and ranges for spindle speed, depth of cut, and feed rate. The strategy library is configured and permanently stored during system initialization and can be directly accessed. The parameters of the preset process target range are directly retrieved through the parameter reading interface of the CNC terminal. The upper limit threshold of the preset process target range is defined as 30 spatial frequency characteristic parameters and 30 amplitude characteristic parameters per millimeter, and the lower limit threshold is 25 spatial frequency characteristic parameters and 25 amplitude characteristic parameters per millimeter. At the same time, the target roughness value at the current moment is obtained from the output of the recursive filter. Its amplitude characteristic parameter is 26.73 micrometers and its spatial frequency characteristic parameter is 28.2 per millimeter. The data source of this target roughness value is the result of the initial update value after drift compensation.
[0092] The amplitude characteristic parameter of the current target roughness value, 26.73 micrometers, is compared with the upper threshold of 30 micrometers and the lower threshold of 25 micrometers. It is determined that this amplitude characteristic parameter is within the preset process target range, with a deviation of 1.73 micrometers above the lower threshold and 3.27 micrometers below the upper threshold. The spatial frequency characteristic parameter, 28.2 per millimeter, is compared with the upper threshold of 30 per millimeter and the lower threshold of 25 per millimeter. This parameter is also within the preset range, with a deviation of 3.2 per millimeter above the lower threshold and 1.8 per millimeter below the upper threshold. Therefore, it is clear that the deviation direction of the target roughness value relative to the preset process target range is that both the amplitude characteristic parameter and the spatial frequency characteristic parameter are within the range and biased towards the lower threshold. The deviation amount is the corresponding specific numerical difference, and the data source for this deviation direction and amount is the comparison result between the target roughness value and the upper and lower thresholds.
[0093] The adjustment strategy library for metal parts pre-stores adjustment schemes corresponding to different deviation directions. For example, when the target roughness value is higher than the upper threshold, the adjustment strategy is to reduce the feed rate and increase the spindle speed; when it is lower than the lower threshold, the adjustment strategy is to increase the feed rate and reduce the spindle speed; and when it is within the range and biased towards the lower threshold, the strategy is to maintain the current spindle speed and depth of cut and fine-tune the feed rate. Based on the previously determined deviation direction, schemes that maintain the current spindle speed and depth of cut and fine-tune the feed rate are selected from the adjustment strategy library to form a candidate adjustment strategy set. The data source for this candidate adjustment strategy set is the matching and screening results between the deviation direction and the adjustment strategy library.
[0094] A pre-established mapping relationship between deviation grading standards and parameter adjustment ranges forms the core decision-making logic of the strategy library. Deviations within one to two micrometers of amplitude characteristic parameters or one to three spatial frequency characteristic parameters per millimeter are considered small deviations, corresponding to a 5-millimeter fine-tuning of the feed rate. Deviations within two to three micrometers of amplitude characteristic parameters or three to five spatial frequency characteristic parameters per millimeter are considered medium deviations, corresponding to a 10-millimeter fine-tuning of the feed rate. Deviations exceeding these ranges are considered large deviations, corresponding to a 15-millimeter or greater fine-tuning of the feed rate. The system adjusts the spindle speed only when the deviation exceeds the process target range; when the deviation is within the process target range, it only fine-tunes the feed rate.
[0095] Based on this grading standard, the current amplitude characteristic parameter deviation of 1.73 micrometers and the spatial frequency characteristic parameter deviation of 3.2 units per millimeter are both classified as medium deviations. According to a preset mapping relationship, a scheme that maintains the current spindle speed of 2200 revolutions per minute and the cutting depth of 5.2 millimeters, while adjusting the feed rate from 320 millimeters per millimeter to 310 millimeters per millimeter, is selected from the candidate adjustment strategy set as the target adjustment strategy. The data source for this target adjustment strategy is the matching result between the deviation grading and the candidate adjustment strategy set.
[0096] The communication protocol of the CNC terminal requires that the instruction format include fields such as parameter type identifier, adjustment value, and execution time. The adjustment information in the target adjustment strategy is converted according to this format. The parameter type identifier is marked as feed rate, the adjustment value is filled in as 310 millimeters per millimeter, and the execution time is set to immediate execution. This ensures that the converted instruction can be accurately recognized and parsed by the CNC terminal to generate the machining parameter adjustment instruction for the surface to be measured. The data source of this machining parameter adjustment instruction is the result of the target adjustment strategy after conversion by the communication protocol format.
[0097] The beneficial effects are that it accurately reads the preset process target range threshold and the current target roughness value, providing a clear reference benchmark and real-time data support for deviation analysis, and ensuring the accuracy of the judgment basis.
[0098] By directly comparing with the upper and lower thresholds, the direction and specific amount of deviation are clearly defined, avoiding ambiguous judgments and providing a precise basis for the selection of subsequent adjustment strategies.
[0099] By filtering the candidate adjustment strategy set based on the deviation direction, the adjustment scheme can be targeted and filtered, improving the pertinence and efficiency of strategy selection and avoiding interference from ineffective strategies.
[0100] The target adjustment strategy is determined based on the magnitude of the deviation, so that the adjustment range is precisely matched with the degree of deviation, which ensures that the deviation is effectively corrected and avoids over-adjustment that may lead to new processing errors.
[0101] The target adjustment strategy is converted into an instruction format that can be recognized by the CNC terminal, ensuring that the adjustment information is accurately transmitted and executed, providing standardized and executable operation instructions for subsequent cutting parameter adjustments, and ensuring the smooth implementation of feedback control.
[0102] S6. The machining parameter adjustment command is sent to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part.
[0103] In this embodiment of the invention, the step of transmitting the machining parameter adjustment command to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part includes: The machining parameter adjustment instructions are encapsulated into data frames according to the communication protocol supported by the CNC terminal to generate the instruction data packet for the metal part; The instruction data packet is sent to the receiving buffer of the CNC terminal; The CNC terminal reads the instruction data packet from the receiving buffer and performs integrity verification on the instruction data packet to confirm that no errors occurred during the transmission of the data packet, and obtains the verification and adjustment instruction for the metal part. Extract the parameter identifier to be adjusted and the corresponding adjustment amount from the verification-passed adjustment instruction, and generate the parameter adjustment value of the verification-passed adjustment instruction; The parameter adjustment value is written into the current machining parameter register of the CNC terminal, overwriting the original cutting parameters, so as to update the cutting parameters of the CNC terminal.
[0104] The machining parameter adjustment instruction contains core information such as the parameter identifier to be adjusted, the adjustment value, and the execution time. The communication protocol supported by the CNC terminal requires that the data frame include a frame header, data segments, a checksum, and a frame tail. The frame header is used to identify the start of the instruction, the data segments store the core information of the adjustment instruction, the checksum is used to verify data integrity, and the frame tail indicates the end of the instruction. The machining parameter adjustment instruction is encapsulated according to this protocol format. For example, the frame header is set to a fixed two-digit hexadecimal value, the data segments are arranged in the order of parameter identifier, adjustment value, and execution time, the checksum is obtained by calculating the sum of the bytes in the data segments, and the frame tail is set to a fixed two-digit hexadecimal value. After encapsulation, an instruction data packet for the metal part is generated. The data source of this instruction data packet is the result of the machining parameter adjustment instruction encapsulated according to the communication protocol format.
[0105] Instruction data packets are sent to the CNC terminal via a wired Ethernet communication link. The transmission rate of the communication link is set to one gigabit per second. To ensure fast data transmission, the CNC terminal's receiving buffer is pre-allocated with ten megabytes of storage space, which is specifically used to receive externally sent instruction data. During the transmission process, the transmission rules of the communication protocol are followed, and instruction data packets are sent segment by segment in byte order until all data packets are transmitted to the receiving buffer. The data source of the instruction data packets in the receiving buffer is the encapsulated instruction data transmitted through the communication link.
[0106] The CNC terminal has a built-in data verification module. After reading the instruction data packet completely from the receiving buffer, the verification module extracts the checksum from the data packet and recalculates the byte sum of the data segment. The recalculated result is compared with the extracted checksum. If the two are completely consistent, it is confirmed that the data packet has not been lost or tampered with during transmission. If they are inconsistent, a transmission error is determined and a retransmission is requested. For example, if the byte sum of the data segment in the instruction data packet is 526 and the extracted checksum is also 526, the verification is determined to be successful, and the verification and adjustment instruction for the metal part is obtained. The data source for this verification and adjustment instruction is the instruction data packet in the receiving buffer that has been verified to be error-free.
[0107] The data segment of the verified adjustment instruction clearly marks the parameter identifier to be adjusted and the corresponding adjustment amount. The parameter identifier uses a unique character code to distinguish different cutting parameters. For example, "F" represents the feed rate, and the adjustment amount is the specific parameter value. The parameter identifier "F" and the corresponding adjustment amount of 310 mm per millimeter are extracted from the instruction. The parameter identifier and the adjustment amount are associated to generate the parameter adjustment value of the verified adjustment instruction. The data source of the parameter adjustment value is the extraction result of the core adjustment information in the verified adjustment instruction.
[0108] The current machining parameter register of the CNC terminal is used to store the cutting parameters being executed. Each parameter corresponds to an independent storage address. For example, the storage address corresponding to the feed rate is 0x0001. The parameter adjustment value of 310 mm per millimeter is written to this storage address, overwriting the original stored feed rate parameter of 320 mm per millimeter. During the writing process, the parameter update mechanism of the CNC system ensures that the data is written accurately. After the writing is completed, the cutting parameters of the CNC terminal are updated in real time, and the subsequent machining process will be executed according to the new feed rate parameter. The data source of the updated cutting parameters is the result of the parameter adjustment value overwriting the original data of the current machining parameter register.
[0109] The beneficial effects are that the machining parameter adjustment instructions are encapsulated according to the CNC terminal communication protocol, and standardized instruction data packets are generated to ensure that the adjustment information meets the terminal data reception format requirements and to guarantee the compatibility of data transmission.
[0110] The instruction data packet is sent to the CNC terminal's receiving buffer to enable the rapid transmission and temporary storage of adjustment instructions, providing stable data storage support for subsequent reading and verification.
[0111] Integrity checks confirm that data packets have no transmission errors, preventing adjustment instructions from becoming invalid due to data loss or tampering, and ensuring the accuracy of adjustment instructions that pass the check.
[0112] Extraction and verification clarify the specific adjustment objects and magnitudes by adjusting the parameter identifiers and adjustment amounts in the instructions, providing accurate core data for updating cutting parameters.
[0113] The parameter adjustment value is written to the current machining parameter register and overwrites the original parameter, realizing the real-time update of the cutting parameters, ensuring that subsequent machining is performed according to the optimized parameters, completing closed-loop feedback control, and ensuring that the surface roughness of the metal parts meets the preset requirements.
[0114] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0115] This application embodiment can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for online measurement and feedback control of surface roughness of metal parts, characterized in that, The method includes: S1. Project coded structured light onto the surface of the metal part to be tested, and simultaneously acquire the structured light image modulated on the surface to be tested to obtain the original stripe image of the metal part. S2. Perform phase demodulation on the original stripe image, extract phase distribution data containing micro-undulation features of the surface under test, and convert the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to the system calibration parameters. S3. Obtain the theoretical residual height in the current processing parameters, and dynamically determine the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, so as to perform multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud and obtain the initial roughness parameters of the surface to be tested. S4. Input the initial roughness parameters and the real-time collected spindle speed, feed rate, cutting depth and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured. S5. Based on the deviation between the target roughness value and the preset process target range, generate a processing parameter adjustment command for the surface to be tested; S6. The machining parameter adjustment command is sent to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part.
2. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 1, characterized in that, The process of projecting coded structured light onto the test surface of a metal part and simultaneously acquiring a structured light image modulated on the test surface to obtain the original stripe image of the metal part includes: When the metal part is processed to the measurement station corresponding to the surface to be measured, a synchronous trigger pulse signal for the surface to be measured is generated; The synchronous trigger pulse signal is simultaneously sent to the structured light projection device and the high-speed image acquisition device of the metal part, triggering the structured light projection device to project coded structured light stripes onto the surface under test, and simultaneously triggering the high-speed image acquisition device to acquire the structured light image modulated by the surface under test; The high-speed image acquisition device continuously acquires multiple frames of structured light images and extracts the image frames whose stripe contrast meets the imaging quality requirements from the multiple frames of structured light images as the original stripe images of the metal parts.
3. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 2, characterized in that, The step of performing phase demodulation on the original fringe image to extract phase distribution data containing microscopic undulation features of the surface under test, and converting the phase distribution data into a three-dimensional spatial coordinate point cloud of the surface under test according to system calibration parameters, includes: Noise interference in the original stripe image is filtered out to obtain the enhanced stripe image of the surface under test; Extract the wrapping phase map representing the micro-undulations of the surface under test from the enhanced striped image; The package phase map is subjected to phase unrolling processing, and phase jumps in the package phase map are eliminated to obtain the absolute phase distribution data of the package phase map; Obtain the pre-calibrated system geometric parameters between the structured light projection device and the image acquisition device, and establish the mapping relationship between the phase in the absolute phase distribution data and the three-dimensional coordinates in the system geometric parameters based on the system geometric parameters; Based on the mapping relationship, a three-dimensional spatial coordinate point cloud of the surface to be measured is generated.
4. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 3, characterized in that, The process of obtaining the theoretical residual height from the current processing parameters, dynamically determining the number of wavelet decomposition layers based on the spatial frequency of the theoretical residual height, and performing multi-scale wavelet decomposition on the three-dimensional spatial coordinate point cloud to obtain the initial roughness parameters of the surface to be measured includes: The spindle speed, feed rate, and depth of cut are read from the CNC terminal, and the theoretical residual height of the surface under test is calculated under the current machining conditions in combination with the tool's geometric parameters. Based on the geometric relationship between the theoretical residual height and the tool path, the spatial frequency range corresponding to the theoretical residual height on the surface to be tested is determined, so as to obtain the separation frequency range of the surface to be tested. The frequency range to be separated is compared with the frequency band division characteristics of the wavelet basis function, and the number of wavelet decomposition layers that can decompose the signal components corresponding to the frequency range to be separated into the highest frequency detail coefficients is selected to obtain the dynamic decomposition layer of the frequency range to be separated. According to the dynamic decomposition layer, the three-dimensional spatial coordinate point cloud is decomposed into multi-scale wavelet decomposition to obtain the detail coefficients of the frequency band. The detail coefficients of the highest frequency band corresponding to the frequency range to be separated are extracted and used as the micro-undulation feature coefficients of the surface to be tested. Wavelet reconstruction is performed on the micro-undulation characteristic coefficients to obtain the micro-undulation morphology of the surface under test, and the initial roughness parameters of the surface under test are determined based on the micro-undulation morphology.
5. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 4, characterized in that, The formula for calculating the theoretical residual height is: ; In the formula, The theoretical residual height, For the tool radius, The feed rate is... The spindle speed is... This represents the number of teeth on the cutting tool.
6. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 4, characterized in that, Determining the initial roughness parameters of the surface under test based on the micro-undulation morphology includes: Extract the cross-sectional contour lines along the tool feed direction from the micro-undulation morphology to obtain the two-dimensional contour sequence of the surface to be measured; The two-dimensional contour sequence is subjected to zero-mean processing to eliminate the influence of the overall contour tilt on the roughness evaluation, and the baseline-adjusted contour sequence of the two-dimensional contour sequence is obtained. Identify the contour peaks and valleys in the contour sequence after the benchmark adjustment, and record the positions and amplitudes of the contour peaks and valleys; Based on the amplitude difference between the contour peak and the contour trough, the maximum peak-valley height of the surface under test within the sampling length is determined and used as the amplitude characteristic parameter in the initial roughness parameters of the surface under test. The number of contour peaks and valleys occurring per unit length is counted to determine the peak-valley density of the surface under test, which is then used as the spatial frequency characteristic parameter in the initial roughness parameters.
7. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 6, characterized in that, The step of inputting the initial roughness parameters along with the real-time acquired spindle speed, feed rate, depth of cut, and cumulative cutting time into the recursive filter of the metal part to generate the target roughness value of the surface to be measured includes: Real-time acquisition of spindle speed, feed rate, depth of cut, and cumulative cutting time; The observation noise covariance parameter of the recursive filter is dynamically adjusted based on the variation range of the spindle speed and the feed rate. The initial roughness parameter is input as the observation value into the recursive filter, and the roughness value output at the previous moment and the observation noise covariance parameter are combined to calculate the preliminary update value at the current moment. Based on the accumulated cutting time, the initial update value is drift compensated to obtain the target roughness value of the surface to be tested.
8. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 7, characterized in that, The formula for calculating the initial update value is: ; In the formula, The initial update value, This is the roughness value output at the previous moment. The filter gain is determined based on the observed noise covariance parameter. The initial roughness parameters at the current moment.
9. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 8, characterized in that, The step of generating processing parameter adjustment instructions for the surface to be tested based on the deviation between the target roughness value and the preset process target range includes: Read the upper and lower threshold values of the preset process target range from the CNC terminal, and obtain the target roughness value at the current moment; The target roughness value is compared with the upper threshold and the lower threshold respectively to determine the direction and amount of deviation of the target roughness value relative to the preset process target range; Based on the deviation direction, a set of candidate adjustment strategies that match the deviation direction is selected from the adjustment strategies of the metal parts; Based on the magnitude of the deviation, a target adjustment strategy for the surface to be tested is determined from the set of candidate adjustment strategies; The adjustment information in the target adjustment strategy is converted into an instruction format that conforms to the CNC terminal communication protocol to generate the machining parameter adjustment instruction for the surface to be tested.
10. The method for online measurement and feedback control of surface roughness of metal parts as described in claim 9, characterized in that, The step of transmitting the machining parameter adjustment command to the CNC terminal of the metal part to adjust the subsequent cutting parameters of the metal part includes: The machining parameter adjustment instructions are encapsulated into data frames according to the communication protocol supported by the CNC terminal to generate the instruction data packet for the metal part; The instruction data packet is sent to the receiving buffer of the CNC terminal; The CNC terminal reads the instruction data packet from the receiving buffer and performs integrity verification on the instruction data packet to confirm that no errors occurred during the transmission of the data packet, and obtains the verification and adjustment instruction for the metal part. Extract the parameter identifier to be adjusted and the corresponding adjustment amount from the verification-passed adjustment instruction, and generate the parameter adjustment value of the verification-passed adjustment instruction; The parameter adjustment value is written into the current machining parameter register of the CNC terminal, overwriting the original cutting parameters, so as to update the cutting parameters of the CNC terminal.