Milling surface roughness detection method and device, electronic equipment and vehicle

CN121213484BActive Publication Date: 2026-09-22FAW MOLD TECHNOLOGY (CHANGCHUN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511312869.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2026-09-22
Estimated Expiration
2045-09-15

AI Technical Summary

Technical Problem

[0005]本发明的目的在于提供一种铣削表面粗糙度检测方法、铣削表面粗糙度检测装置、电子设备及车辆,至少解决如何实时检测加工表面粗糙度的问题,解决如何测量环境不友好的问题,如何减少检测成本的问题中的一个技术问题

Benefits of technology

[0051]本申请通过实时确定待检测工件铣削表面的点云数据集,可以实现在加工过程中,实时检测工件铣削表面的粗糙度,以满足加工表面粗糙度检测的实时性要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121213484B_ABST
    Figure CN121213484B_ABST
Patent Text Reader

Abstract

The application discloses a milling surface roughness detection method and device, electronic equipment and vehicle, and relates to the technical field of machining. The method comprises the following steps: determining a point cloud data set of a milling surface of a workpiece to be detected in real time; segmenting the point cloud data set based on a deep layered feature learning model of a point set in a pre-improved metric space, extracting a first point cloud data set of the milling surface of the workpiece to be detected; slicing the first point cloud data set according to a milling processing track, obtaining a plurality of two-dimensional sections, and detecting the roughness of each two-dimensional section; and determining the roughness of the milling surface of the workpiece to be detected based on the detection result. While reducing the subjective error caused by manual detection, the detection time is greatly reduced, and the labor cost and time cost of milling surface roughness detection are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machining technology, and in particular to milling surface roughness detection methods, milling surface roughness detection devices, electronic equipment, and vehicles. Background Technology

[0002] In the machining process, surface roughness is typically considered a key indicator for evaluating machining quality. Surface roughness is generally formed by the machining method used and other factors, such as friction between the tool and the workpiece surface, plastic deformation of the surface metal during chip separation, and high-frequency vibrations in the machining system. Due to differences in machining methods and workpiece materials, the depth, density, shape, and texture of the marks left on the machined surface vary. Surface roughness directly affects the sealing performance, wear resistance, and fatigue strength of parts. Therefore, it is necessary to inspect the surface roughness of workpieces to determine whether it meets the required standards.

[0003] In related technologies, stylus method and optical method are generally used to detect the surface roughness of workpieces. However, stylus method requires the surface to be clean and the sensor to be in contact with the surface to be measured, while optical method has strict requirements for the measurement environment and the measuring instruments are expensive. In addition, a large amount of chips are generated during machining, and a large amount of coolant is sprayed throughout the process, leaving the workpiece surface covered with residual coolant, which is not a friendly measurement environment.

[0004] Therefore, the stylus method and optical method can only be used for offline measurement and cannot meet the real-time requirements of surface roughness detection. Summary of the Invention

[0005] The purpose of this invention is to provide a method, device, electronic equipment and vehicle for detecting the roughness of milled surfaces, at least to solve one of the technical problems of how to detect the roughness of machined surfaces in real time, how to measure in an environmentally unfriendly environment, and how to reduce detection costs.

[0006] This invention provides the following solution:

[0007] According to one aspect of the present invention, a method for detecting the roughness of milled surfaces is provided, comprising:

[0008] Real-time determination of the point cloud dataset of the milled surface of the workpiece to be inspected;

[0009] Based on a pre-improved Deep Hierarchical Feature Learning on Point Sets in a Metric Space (PointNet++) model, the point cloud dataset is segmented to extract the first point cloud dataset of the milled surface of the workpiece to be detected.

[0010] Based on the milling machining trajectory, the first point cloud dataset is sliced ​​to obtain multiple two-dimensional cross sections, and the roughness of each two-dimensional cross section is detected;

[0011] Based on the detection results, the roughness of the milled surface of the workpiece to be tested is determined.

[0012] Furthermore, the real-time determination of the point cloud dataset of the milled surface of the workpiece to be inspected includes:

[0013] Obtain the positioning information of the milled surface of the workpiece to be inspected;

[0014] Based on the positioning information, a structured light camera is used to acquire two-dimensional images and point cloud data of the milled surface of the workpiece to be inspected in real time, and the two-dimensional coordinates of each pixel in the two-dimensional image are determined.

[0015] Based on the conversion relationship between two-dimensional coordinates and three-dimensional point cloud coordinates, the pixel points are mapped to three-dimensional point cloud coordinates;

[0016] The grayscale value of the two-dimensional image is determined, and the grayscale value is merged with the three-dimensional coordinates of the pixel to obtain the point cloud dataset of the milled surface of the workpiece to be detected.

[0017] Furthermore, the improvement of the deep hierarchical feature learning model for point sets in the metric space includes:

[0018] An improved deep hierarchical feature learning model for point sets in metric space is proposed, based on a global context space attention mechanism and a penalty mechanism containing weight parameters.

[0019] Furthermore, the point cloud dataset is segmented based on a pre-improved deep hierarchical feature learning model of point sets in the metric space to extract the first point cloud dataset of the milled surface of the workpiece to be detected, including:

[0020] Based on a deep hierarchical feature learning model of point sets in metric space, the point cloud dataset is segmented to determine multiple segmentation regions of the point cloud dataset.

[0021] Collect local point cloud features for each segmented region and determine the global context features of the point cloud dataset;

[0022] Based on the global context space attention mechanism, the global context features and the local point cloud features are fused and enhanced to obtain the global attention point cloud features of the point cloud dataset;

[0023] By controlling the value of the weight parameter, the penalty mechanism is controlled to optimize the global attention point cloud features;

[0024] Determine the ideal features of the point cloud data, compare the ideal features with the optimized global attention point cloud features, until the comparison results reach the ideal level, determine the value of the weight parameter, and determine the foreground point cloud features of the global attention point cloud features.

[0025] Extract the foreground point cloud features and use the foreground point cloud features as the first point cloud dataset of the milled surface of the workpiece to be inspected.

[0026] Furthermore, the step of slicing the first point cloud dataset according to the milling trajectory to obtain multiple two-dimensional cross-sections, and detecting the roughness of each two-dimensional cross-section, includes:

[0027] Determine the cutting direction based on the direction of the milling trajectory;

[0028] According to the cutting direction, the first point cloud dataset is sliced ​​at a preset interval to obtain multiple two-dimensional cross sections;

[0029] For each of the two-dimensional cross sections, a circle is fitted to the first point cloud dataset to obtain multiple fitted circles;

[0030] Calculate the average and maximum spacing between adjacent fitted circles;

[0031] The roughness of the two-dimensional cross-section is detected based on the average spacing and the maximum spacing.

[0032] Furthermore, after detecting the roughness of the two-dimensional cross-section based on the average spacing and the maximum spacing, the method further includes:

[0033] Compare the average spacing with a preset first threshold, and the maximum spacing with a preset second threshold;

[0034] In response to the average spacing being less than or equal to the first threshold and the maximum spacing being less than or equal to the second threshold, the roughness of the corresponding two-dimensional cross-section is determined to be acceptable.

[0035] Furthermore, determining the roughness of the milled surface of the workpiece to be inspected based on the detection results includes:

[0036] If the roughness of each of the two-dimensional cross sections is qualified, then the roughness of the milled surface of the workpiece to be tested is determined to be qualified;

[0037] If the roughness of one or more of the two-dimensional cross sections is unqualified, then the roughness of the milled surface of the workpiece to be inspected is determined to be unqualified, and the position information corresponding to the unqualified two-dimensional cross section is determined.

[0038] According to a second aspect of the present invention, a milling surface roughness detection device is provided, comprising:

[0039] The data acquisition module is used to determine the point cloud dataset of the milled surface of the workpiece to be inspected in real time;

[0040] The data extraction module is used to segment the point cloud dataset based on a pre-improved deep hierarchical feature learning model of point sets in the metric space, and extract the first point cloud dataset of the milled surface of the workpiece to be detected.

[0041] The detection module is used to slice the first point cloud dataset according to the milling machining trajectory to obtain multiple two-dimensional cross sections, and to detect the roughness of each two-dimensional cross section;

[0042] The determination module is used to determine the roughness of the milled surface of the workpiece to be tested based on the detection results.

[0043] According to three aspects of the present invention, an electronic device is provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0044] The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the milling surface roughness detection method.

[0045] According to four aspects of the present invention, a computer-readable storage medium is provided, comprising: storing a computer program executable by an electronic device, wherein when the computer program is run on the electronic device, the electronic device causes the electronic device to perform the steps of a milling surface roughness detection method.

[0046] According to five aspects of the present invention, a vehicle is provided, comprising:

[0047] Electronic equipment for implementing the steps of a method for detecting the roughness of milled surfaces;

[0048] The processor runs a program that, when running, executes the steps of a milling surface roughness detection method based on data output from electronic devices.

[0049] Storage medium for storing a program that, when running, executes the steps of a milling surface roughness detection method based on data output from an electronic device.

[0050] The above solution achieves the following beneficial technical effects:

[0051] This application enables real-time detection of the roughness of the milled surface of the workpiece during the machining process by determining the point cloud dataset of the milled surface in real time, thereby meeting the real-time requirements for surface roughness detection.

[0052] This application uses a pre-modified PointNet++ to segment the point cloud dataset and extract the first point cloud dataset of the milled surface of the workpiece to be inspected. This ensures smoother segmentation of regions with continuous color and shape, and also optimizes the positioning accuracy of rough regions.

[0053] This application slices the first point cloud dataset using the milling machining trajectory to obtain multiple two-dimensional cross-sections, and detects the roughness of each two-dimensional cross-section, thereby improving detection efficiency and consistency, realizing rapid automated detection of milled surface roughness. While reducing the subjective errors caused by manual inspection, it significantly reduces the inspection time, lowers the labor and time costs of milled surface roughness detection, and reduces the impact of human subjective errors. Attached Figure Description

[0054] Figure 1 This is a flowchart of a surface roughness detection method provided by one or more embodiments of the present invention.

[0055] Figure 2 This is a schematic diagram of the roughness detection position structure provided in a specific embodiment of the present invention.

[0056] Figure 3 This is a schematic diagram of point cloud noise reduction provided in a specific embodiment of the present invention.

[0057] Figure 4 This is a schematic diagram of an improved PointNet++ implementation provided in a specific embodiment of the present invention.

[0058] Figure 5 This is a schematic diagram of an attention mechanism provided in a specific embodiment of the present invention.

[0059] Figure 6 This is a structural diagram of a penalty mechanism provided in a specific embodiment of the present invention.

[0060] Figure 7 This is an execution logic flowchart provided in a specific embodiment of the present invention.

[0061] Figure 8This is a structural diagram of a milling surface roughness detection device provided in one or more embodiments of the present invention.

[0062] Figure 9 This is a block diagram of an electronic device structure for a milling surface roughness detection method provided in one or more embodiments of the present invention. Detailed Implementation

[0063] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] Figure 1 This is a flowchart of a surface roughness detection method provided by one or more embodiments of the present invention.

[0065] like Figure 1 The surface roughness detection methods shown include:

[0066] Step S1: Determine the point cloud dataset of the milled surface of the workpiece to be inspected in real time.

[0067] In this embodiment, the workpiece to be inspected can be moved to the inspection position, and a structured light camera installed at the inspection position can be used to acquire two-dimensional images of the milled surface of the workpiece in real time.

[0068] The detection location and the location structure of the structured light camera can be found in [reference needed]. Figure 2 , Figure 2 This is a schematic diagram of the roughness detection position structure provided in a specific embodiment of the present invention. For example... Figure 2 As shown, it includes a lighting lamp 1, a milling head 2, a structured light camera 301, a robotic arm end effector 302, a robotic arm base 303, and a milled surface of the workpiece to be inspected 4.

[0069] Furthermore, by planning the camera's motion trajectory and controlling the movement of the robotic arm, real-time automated acquisition of point cloud data from the milled surface of the workpiece to be inspected is achieved. In this embodiment, multiple two-dimensional images can be captured, and any two-dimensional image and point cloud data have a small overlap at the edges with the edges of its two adjacent two-dimensional images and point cloud data, thereby ensuring the accuracy of subsequent processing.

[0070] In this embodiment, Figure 3 This is a schematic diagram of point cloud noise reduction provided in a specific embodiment of the present invention. For example... Figure 3As shown, a bilateral filter is used to denoise the 2D image and point cloud data to determine the point cloud dataset of the milled surface of the workpiece to be inspected. The bilateral filter, by considering the similarity between points (e.g., color, intensity, or spatial distance), effectively removes random noise without obscuring important structures in the point cloud data. It preserves the edges and feature boundaries of the point cloud data while smoothing it, ensuring accuracy for subsequent point cloud analysis and processing.

[0071] Step S2: Based on the pre-improved PointNet++, the point cloud dataset is segmented to extract the first point cloud dataset of the milled surface of the workpiece to be inspected.

[0072] Figure 4 This is a schematic diagram illustrating an improved PointNet++ implementation according to a specific embodiment of the present invention. For example... Figure 4 As shown, in this embodiment, PointNet++ is improved based on a global context space attention mechanism and a penalty mechanism containing weight parameters. The weight parameters are adjustable weight control parameters.

[0073] The point cloud dataset is segmented using a pre-modified PointNet++ to obtain foreground and background point cloud features. Point cloud features corresponding to confidence points below a set confidence threshold are removed, and the foreground point cloud features are clustered to extract the first point cloud dataset of the milled surface of the workpiece to be inspected.

[0074] Step S3: Based on the milling machining trajectory, slice the first point cloud dataset to obtain multiple two-dimensional cross sections, and detect the roughness of each two-dimensional cross section.

[0075] In this embodiment, the milling trajectory is the cutting direction of the workpiece to be inspected. The first point cloud dataset is sliced ​​according to the cutting direction to obtain multiple two-dimensional cross-sections. Each two-dimensional cross-section contains approximately 500-1000 points.

[0076] Furthermore, by performing circle fitting on each two-dimensional cross-section and calculating the average and maximum spacing between the fitted circles, the roughness of each two-dimensional cross-section is detected.

[0077] Step S4: Based on the detection results, determine the roughness of the milled surface of the workpiece to be inspected.

[0078] In this embodiment, if the roughness of each two-dimensional cross-section is acceptable, the roughness of the milled surface of the workpiece to be inspected is determined to be acceptable. If the roughness of one or more two-dimensional cross-sections is unacceptable, the roughness of the milled surface of the workpiece to be inspected is determined to be unacceptable. Furthermore, the positional information corresponding to the unacceptable two-dimensional cross-sections can be determined, thereby providing precise positioning information for the position of the unacceptable milled surface of the workpiece.

[0079] The surface roughness detection method provided in this embodiment uses a pre-improved PointNet++ to segment the point cloud dataset to optimize the positioning accuracy of rough areas. The first point cloud dataset is sliced ​​using the milling machining trajectory to obtain multiple two-dimensional cross-sections, and the roughness of each two-dimensional cross-section is detected to achieve a multi-dimensional quantitative evaluation of the surface roughness of the milled surface.

[0080] In this embodiment, the point cloud dataset of the milled surface of the workpiece to be detected can be determined in real time using the following implementation method.

[0081] First, obtain the positioning information of the milled surface of the workpiece to be inspected.

[0082] Furthermore, the transformation matrix between the robot base, the robot end effector coordinate system, the camera coordinate system, and the tooling coordinate system is obtained to achieve precise positioning of the milled surface to be measured, thereby obtaining the positioning information of the milled surface of the workpiece to be inspected.

[0083] Secondly, based on the positioning information, a structured light camera is used to acquire two-dimensional images and point cloud data of the milled surface of the workpiece in real time, and determine the two-dimensional coordinates of each pixel in the two-dimensional image. The structured light camera uses a specific coded structured light mode for shooting, which can improve the recognition of surface features and the measurement accuracy in the image.

[0084] Furthermore, based on the positioning information, the motion trajectory of the camera is planned, and the movement of the robot arm is controlled to realize the automated acquisition of two-dimensional images and point cloud data of the milled surface of the workpiece to be inspected. The two-dimensional coordinates of each pixel in the two-dimensional image are determined according to the camera coordinate system.

[0085] Then, based on the conversion relationship between two-dimensional coordinates and three-dimensional point cloud coordinates, the pixels are mapped to three-dimensional point cloud coordinates.

[0086] The conversion relationship between two-dimensional coordinates and three-dimensional point cloud coordinates can be determined through measurement and derivation. Taking point P as an example, the implementation method is as follows:

[0087] For the first measurement (at which point the robotic arm is in its initial posture), the transformation process of the coordinates of spatial point P between different coordinate systems is as follows:

[0088] After transformation from camera coordinate system to camera intrinsic parameters:

[0089] The original coordinates of spatial point P in the camera coordinate system are P0 (with the camera fixed, P0 remains unchanged). After applying the known camera intrinsic parameter transformation matrix T1, the transformed coordinates P1 in the camera coordinate system are obtained, i.e.:

[0090] (1)

[0091] Camera coordinate system → Robot end effector coordinate system:

[0092] We need to use the hand-eye matrix X to transform P1 in the camera coordinate system to P2 in the end-eye coordinate system, that is: (1-1)

[0093] From robot end-effector coordinate system to base coordinate system:

[0094] Given the robot end-effector-basis transformation matrix T3, transform P2 in the end-effector coordinate system to P3 in the basis coordinate system (basis fixed, spatial points fixed, P3 unchanged), that is: (1-2)

[0095] Combining equations (1), (1-1), and (1-2), we obtain the basic relation (2): Substituting P1 into P2, then into P3, we finally correlate P0 (camera-end fixed point) and P3 (robot base-end fixed point):

[0096] (2)

[0097] Move the robotic arm to the second pose, at which point:

[0098] The spatial point P remains stationary, the camera remains stationary until P0 and P3 remain unchanged; the robot arm's posture changes until the end-point-base transformation matrix becomes T3' (known); the camera's intrinsic parameters change due to the change in the measured posture until the transformation matrix becomes T1' (known, the new point cloud registration result); P2 in the end-point coordinate system becomes P2' (due to the change in robot arm posture), and P1 in the camera coordinate system becomes P1' (changing with T1').

[0099] Similarly, the coordinate transformation process for the second measurement is as follows:

[0100]

[0101] The second measurement relationship (3) is obtained by combining the equations:

[0102] (3) thereby determining the transformation relationship between two-dimensional coordinates and three-dimensional point cloud coordinates.

[0103] Furthermore, based on the Zhang Zhengyou calibration method, a camera intrinsic and extrinsic parameter matrix is ​​established, mapping 2D image pixels (i, j) to 3D point cloud coordinates (X, Y, Z) to achieve pixel-coordinate alignment. The specific formula is as follows:

[0104]

[0105] Where s is the scaling factor, K is the camera intrinsic parameter matrix, [RT] is the extrinsic parameter matrix, and (u, v) are pixel coordinates.

[0106] Finally, the grayscale values ​​of the two-dimensional image are determined, and the grayscale values ​​are merged with the three-dimensional coordinates of the pixels to obtain the point cloud dataset of the milled surface of the workpiece to be inspected.

[0107] In this embodiment, the grayscale value of the two-dimensional image is determined in the following way:

[0108] Gray-scale dynamic range compression compresses the original gray-scale values ​​of an image. Normalization The specific formula is as follows:

[0109]

[0110] In the formula, The maximum grayscale value of the current frame image. The minimum / maximum grayscale value of the current frame image.

[0111] Based on the determination that the normalized grayscale value g is used as the fourth dimension attribute of the point cloud and merged with the three-dimensional coordinates, enhanced point cloud data is generated. In this embodiment, merging grayscale values ​​can target common defects such as scratches and pits on the milled surface of the workpiece to be inspected, utilizing the grayscale gradient ( Identify edge regions. For pixels with abrupt changes in grayscale value (such as...) Threshold The corresponding point cloud points are marked as edge feature points and are retained in subsequent processing. At the same time, through color space conversion, the oxide layer or coolant residue area on the milled surface of the workpiece to be inspected is extracted to help distinguish the effective machined surface from noise.

[0112] In this embodiment, after determining the point cloud dataset, the point cloud dataset can be segmented based on a pre-improved deep hierarchical feature learning model of point sets in the metric space, and the first point cloud dataset of the milled surface of the workpiece to be detected can be extracted.

[0113] In this embodiment, based on PointNet++, the point cloud dataset is segmented to determine the segmentation regions of multiple point cloud datasets. This can be understood as a "grouping" operation in PointNet++. Local point cloud features are collected for each segmented region, and the global context features of the point cloud dataset are determined. For each local point cloud feature, Global Context Spatial Attention Module (GCSAM) attention is inserted. GCSAM attention is added to the "Feature Propagation" module of PointNet++. Based on this, the global context features and local point cloud features are fused and enhanced using the GCSAM attention mechanism to obtain the globally attention-enhanced point cloud features of the point cloud dataset.

[0114] Figure 5 This is a schematic diagram of an attention mechanism provided in a specific embodiment of the present invention. Figure 5 As shown, the GCSAM attention mechanism is divided into channel attention and spatial attention. It extracts units from the global context module (global average pooling + 1×1 convolution) to compress the global texture semantics (overall machining direction, spacing patterns of normal textures) of the milled surface of the workpiece into a global guiding vector. This global guiding vector is then fused with the local point cloud features of the segmented region (such as local slice features of 500-1000 points), allowing the local point cloud features of the segmented region to possess global feature information, thus outputting global attention point cloud features. Through the inserted GCSAM attention mechanism, it can be determined whether a sudden change in grayscale at a local point conforms to the grayscale trend of the global scratch, rather than random noise. PointNet++'s segmentation performance relies on "multi-level feature fusion": shallow features contain edge details (such as the 3D coordinate difference and grayscale gradient of defect edges), while deep features contain semantic information (such as the global judgment of whether the region belongs to a rough surface).

[0115] In the feature propagation stage, the GCSAM attention mechanism establishes a connection between "shallow details" and "deep semantics." Deep semantics (such as the "range of the global coarse region") guides the selection of shallow details (such as "whether the edge belongs to the boundary of the coarse region"); shallow details (such as the "precise coordinates of the defect edge") supplement the localization of deep semantics (such as "correcting the boundary range of the coarse region to avoid localization offset caused by semantic ambiguity"). This integration ensures that each point cloud data obtains a complete feature description of "details + semantics." For example, when segmenting "coarse regions," it can both lock the approximate range through deep semantics and accurately locate the region boundaries (such as the start and end points of scratches) through shallow details, avoiding the "boundary ambiguity" problem of traditional methods. The GCSAM attention mechanism first performs element-wise addition and fusion of "deep attention-optimized point cloud features" and "shallow original point cloud features": preserving edge details in the shallow layer (such as small height differences in defects) while incorporating deep global spatial attention optimization (such as suppressing noise in shallow features); then, it uses ReLU activation to filter effective features (removing negative noise signals), ultimately allowing the deep network to maintain a feature representation with "high resolution details + high semantic quality". By introducing the GCSAM attention mechanism, its unique mechanism enables the collaborative capture of local and global features, thereby enhancing the accuracy and richness of feature dimensions during feature extraction. In the feature propagation process, the attention mechanism builds an efficient fusion bridge, achieving deep integration of features at different levels. In this way, it ensures that each data point can obtain a more accurate and complete feature description, thus improving the quality and performance of the entire feature representation system.

[0116] This synergy avoids the problem that "deep networks can only learn semantics and lose details." For example, when segmenting "tiny pits" on a milled surface, deep networks can still retain the detailed features of the pit edges through quick connections to GCSAM, ensuring that the pit area is accurately segmented.

[0117] Furthermore, a penalty mechanism with a weighted (W) parameter is added. Figure 6 This is a structural diagram of the penalty mechanism provided in a specific embodiment of the present invention. Figure 6As shown, the ideal feature X is first determined. Based on the labeled data of the milled surface point cloud, the feature distribution of different regions (such as the effective machining area and the noise area) is statistically analyzed, and corresponding ideal feature templates are constructed. Then, the difference error X1' between the global attention point cloud features output by GCSAM and the ideal feature is calculated. For example, the L2 norm is used to calculate the feature vector difference of each point to obtain the error matrix. The W parameter is weighted with the error matrix to obtain the weighted error. In this embodiment, the larger the W parameter is, the stronger the amplification effect on the error. For effective region point cloud data, the larger the weighted error, the more the small difference between the feature of that point and the ideal feature will be amplified. During optimization, it is more inclined to adjust it to the ideal state and strengthen the effective feature. For noisy region points, the larger the weighted error, the more inclined it is to suppress its features and reduce noise interference.

[0118] Furthermore, by controlling the size of W, the penalty mechanism is optimized for the global attention point cloud features (X2'). Specifically, the weighted error is applied to the original attention features through "residual correction." The sigmoid function is used to map the weighted error to the [0,1] interval to obtain the feature suppression coefficient, which is then multiplied element-wise with the original attention features to achieve coefficient-wise attenuation of each point's features, thereby adjusting the feature weights. For noisy points, due to their large weighted error, the suppression coefficient is close to 1, and the features are significantly attenuated; for effective points, the weighted error is small, the suppression coefficient is close to 0, and the features are basically preserved or even implicitly enhanced. The w parameter is optimized through network training: based on the original segmentation loss (such as cross-entropy loss) in PointNet++, a constraint term related to the w parameter is added to form the total loss function. During training, the network weights and the w parameter are updated simultaneously using the gradient descent algorithm. If noise is misclassified as a valid region in the segmentation result, the total loss increases. Backpropagation will cause w to increase to enhance the suppression of noise points. If minor defects are missed, the total loss increases. Backpropagation will cause w to decrease appropriately to avoid over-suppressing weak features of valid regions, ultimately causing the w parameter to converge to the optimal value. That is, the ideal features of the point cloud data are obtained, and the ideal features are compared with the optimized global attention point cloud features until the comparison results reach the ideal level. The value of the weight parameter is determined, and the foreground point cloud features of the global attention point cloud features are determined. The foreground point cloud features are extracted and used as the first point cloud dataset of the milled surface of the workpiece to be inspected. In this embodiment, the addition of the W parameter penalty mechanism can make the module more sensitive to spatial information, make important feature regions more obvious, and increase the feature differences under different receptive fields, further improving the accuracy of feature segmentation.

[0119] In this embodiment, after obtaining the first point cloud dataset of the milled surface of the workpiece to be inspected, the first point cloud dataset can be sliced ​​to detect the roughness.

[0120] Specifically, the cutting direction can be determined based on the direction of the milling trajectory, which can be the X-axis direction of the tooling. Following the cutting direction, the first point cloud dataset is sliced ​​at a preset interval to obtain multiple two-dimensional cross-sections. The preset interval can be 0.2 mm, and each cross-section contains approximately 500-1000 points. For each two-dimensional cross-section's first point cloud dataset, a Random Sample Consensus (RANSAC) circle fitting algorithm is performed to obtain multiple fitted circles. During the circle fitting process, a distance threshold of 0.05 mm and a random sampling point count of 50 can be set. The optimal fitted circle parameters are determined by the maximum set of interior points to obtain multiple fitted circles. Furthermore, the average and maximum spacing between adjacent fitted circles are calculated, and the roughness of the two-dimensional cross-section is detected based on the average and maximum spacing.

[0121] The formula for calculating the average spacing is as follows:

[0122]

[0123] In the formula, Let be the average spacing, i be the i-th fitted circle, N be the number of fitted circles, and D be the diameter of the fitted circle.

[0124] The formula for calculating the maximum spacing is as follows:

[0125]

[0126] In the formula, This represents the maximum spacing.

[0127] After obtaining the average and maximum spacing between adjacent fitted circles, the average spacing is compared with a preset first threshold, and the maximum spacing is compared with a preset second threshold. If the average spacing is less than or equal to the first threshold and the maximum spacing is less than or equal to the second threshold, the roughness of the corresponding two-dimensional cross-section is determined to be acceptable.

[0128] Right now, The surface roughness of the corresponding two-dimensional cross-section is determined to be acceptable. Otherwise, it is considered unacceptable.

[0129] In this embodiment, if the roughness of each two-dimensional cross-section is qualified, the roughness of the milled surface of the workpiece to be inspected is determined to be qualified. If the roughness of one or more two-dimensional cross-sections is unqualified, the roughness of the milled surface of the workpiece to be inspected is determined to be unqualified, and the position information corresponding to the unqualified two-dimensional cross-sections is determined.

[0130] Figure 7 This is an execution logic flowchart provided in a specific embodiment of the present invention. Figure 7As shown, in this embodiment, the point cloud acquisition system uses a structured light camera to capture images of the milled surface of the workpiece to be inspected. The captured image grayscale or texture information is mapped to the corresponding point cloud, generating a point cloud with optical features. A complete surface model is constructed from multiple captured point cloud images. A surface roughness curve is fitted into the point cloud, the distance between adjacent roughness curves is calculated, and the calculated distance is compared with a preset distance threshold to calculate the surface roughness.

[0131] Further point cloud preprocessing establishes a correspondence between 2D image pixels and point cloud coordinates through calibration. Image grayscale values ​​or texture features are then appended to the 3D coordinate data as point cloud attributes. The mapped optical features are used to identify minute surface pits, scratches, and texture anomalies. Point cloud denoising typically employs bilateral filters.

[0132] Subsequently, point cloud segmentation based on the pre-improved PointNet++ is performed as follows: a GCSAM attention mechanism is inserted after the PointNet network in each group (segmentation region); a GCSAM attention mechanism is added to the feature propagation module to improve the accuracy of point cloud segmentation; and a W penalty mechanism is added, with an adjustable w parameter that controls the degree of comparison with the original features until the optimal value is obtained.

[0133] Finally, the results are processed and analyzed, specifically as follows: the point cloud is sliced ​​at equal intervals along the cutting direction, with a slice width of 0.1mm~0.5mm; RANSAC circle fitting is performed on the point cloud of each slice to extract the roughness curve height sequence; the average and maximum spacing between adjacent slices are calculated based on the fitted curve. The average spacing is compared with a preset first threshold, and the maximum spacing is compared with a preset second threshold. If the average spacing is less than or equal to the first threshold and the maximum spacing is less than or equal to the second threshold, the roughness of the corresponding two-dimensional section is determined to be acceptable. Otherwise, it is unacceptable.

[0134] The improved PointNet++ was used to segment the point cloud data, and the segmentation accuracy was significantly improved. The comparison results can be found in Table 1.

[0135] Table 1

[0136]

[0137] The comparison results of the milling surface roughness detection effect of the milling surface roughness detection method of the present embodiment can be referred to Table 2.

[0138] Table 2

[0139]

[0140] Figure 8This is a structural diagram of a milling surface roughness detection device provided in one or more embodiments of the present invention.

[0141] like Figure 8 The milling surface roughness detection device shown includes: a data acquisition module, a data extraction module, a detection module, and a determination module;

[0142] The data acquisition module is used to determine the point cloud dataset of the milled surface of the workpiece to be inspected in real time;

[0143] The data extraction module is used to segment the point cloud dataset based on a pre-improved deep hierarchical feature learning model of point sets in the metric space, and extract the first point cloud dataset of the milled surface of the workpiece to be inspected.

[0144] The detection module is used to slice the first point cloud dataset according to the milling machining trajectory to obtain multiple two-dimensional cross sections, and to detect the roughness of each two-dimensional cross section;

[0145] The determination module is used to determine the roughness of the milled surface of the workpiece to be inspected based on the inspection results.

[0146] In this embodiment, the data extraction module is used to acquire the positioning information of the milled surface of the workpiece to be inspected; based on the positioning information, a structured light camera is used to acquire two-dimensional images and point cloud data of the milled surface of the workpiece to be inspected in real time, and the two-dimensional coordinates of each pixel in the two-dimensional image are determined; according to the conversion relationship between two-dimensional coordinates and three-dimensional point cloud coordinates, the pixels are mapped to three-dimensional point cloud coordinates; the grayscale value of the two-dimensional image is determined, and the grayscale value is merged with the three-dimensional coordinates of the pixels to obtain the point cloud dataset of the milled surface of the workpiece to be inspected. An improved deep hierarchical feature learning model for point sets in the metric space is based on a global context space attention mechanism and a penalty mechanism containing weight parameters. Based on a deep hierarchical feature learning model of point sets in metric space, the point cloud dataset is segmented to determine segmentation regions of multiple point cloud datasets. Local point cloud features of each segmentation region are collected, and global context features of the point cloud dataset are determined. Based on a global context space attention mechanism, the global context features and local point cloud features are fused and enhanced to obtain global attention point cloud features of the point cloud dataset. The global attention point cloud features are optimized by controlling the value of the weight parameter and the penalty mechanism. The ideal features of the point cloud data are determined, and the ideal features are compared with the optimized global attention point cloud features until the comparison result reaches the ideal level. The value of the weight parameter is then determined, and the foreground point cloud features of the global attention point cloud features are determined. The foreground point cloud features are extracted and used as the first point cloud dataset of the milled surface of the workpiece to be inspected.

[0147] In this embodiment, the detection module is used to determine the cutting direction based on the direction of the milling trajectory; slice the first point cloud dataset at preset intervals according to the cutting direction to obtain multiple two-dimensional cross-sections; perform circle fitting on the first point cloud dataset of each two-dimensional cross-section to obtain multiple fitted circles; calculate the average distance and maximum distance between adjacent fitted circles; and detect the roughness of the two-dimensional cross-sections based on the average distance and the maximum distance. The average distance is compared with a preset first threshold, and the maximum distance is compared with a preset second threshold; in response to the average distance being less than or equal to the first threshold and the maximum distance being less than or equal to the second threshold, the roughness of the corresponding two-dimensional cross-section is determined to be acceptable. If the roughness of each two-dimensional cross-section is acceptable, the roughness of the milled surface of the workpiece to be inspected is determined to be acceptable; if the roughness of one or more two-dimensional cross-sections is unacceptable, the roughness of the milled surface of the workpiece to be inspected is determined to be unacceptable, and the position information corresponding to the unacceptable two-dimensional cross-section is determined.

[0148] Figure 9 This is a block diagram of an electronic device structure for a milling surface roughness detection method provided in one or more embodiments of the present invention.

[0149] like Figure 9 As shown, this application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0150] The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a method for detecting the roughness of a milled surface.

[0151] This application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a milling surface roughness detection method.

[0152] This application also provides a vehicle, including:

[0153] Electronic equipment for implementing steps based on a method for detecting the roughness of milled surfaces;

[0154] The processor runs a program that, when running, executes the steps of a milling surface roughness detection method based on data output from electronic devices.

[0155] Storage medium for storing a program that, when running, executes the steps of a milling surface roughness detection method based on data output from an electronic device.

[0156] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0157] The electronic device comprises a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on the operating system. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory. The operating system can be any one or more computer operating systems that control the electronic device through processes, such as Linux, Unix, Android, iOS, or Windows. Furthermore, in this embodiment of the invention, the electronic device can be a smartphone, tablet computer, or other handheld device, or a desktop computer, portable computer, or other electronic device; there is no particular limitation in this embodiment.

[0158] In this embodiment of the invention, the executing entity for electronic device control can be an electronic device itself, or a functional module within an electronic device capable of calling and executing a program. The electronic device can obtain the firmware corresponding to the storage medium. This firmware is provided by the supplier, and different storage media may have the same or different firmware; no limitation is made here. After obtaining the firmware corresponding to the storage medium, the electronic device can write this firmware into the storage medium; specifically, it burns the firmware corresponding to the storage medium into the storage medium. The process of burning the firmware into the storage medium can be implemented using existing technology, and will not be elaborated upon in this embodiment of the invention.

[0159] Electronic devices can also obtain reset commands corresponding to the storage media. The reset commands corresponding to the storage media are provided by the supplier. The reset commands corresponding to different storage media can be the same or different, and no restrictions are imposed here.

[0160] At this time, the storage medium of the electronic device is a storage medium on which the corresponding firmware has been written. The electronic device can respond to the reset command corresponding to the storage medium on which the corresponding firmware has been written, thereby resetting the storage medium on which the corresponding firmware has been written according to the reset command. The process of resetting the storage medium according to the reset command can be implemented by existing technology and will not be described in detail in this embodiment of the invention.

[0161] For ease of description, the above devices are described separately by function as various units and modules. Of course, in implementing this application, the functions of each unit and module can be implemented in one or more software and / or hardware.

[0162] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined.

[0163] For the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0164] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting the roughness of milled surfaces, characterized in that, The method for detecting the roughness of milled surfaces includes: Real-time determination of the point cloud dataset of the milled surface of the workpiece to be inspected; Based on a pre-improved deep hierarchical feature learning model for point sets in the metric space, the point cloud dataset is segmented to extract the first point cloud dataset of the milled surface of the workpiece to be detected; the improvement of the deep hierarchical feature learning model for point sets in the metric space includes: Based on the global context space attention mechanism and the penalty mechanism containing weight parameters, an improvement is made to the deep hierarchical feature learning model of point sets in the metric space. Based on the milling trajectory, the first point cloud dataset is sliced ​​to obtain multiple two-dimensional cross-sections, and the roughness of each two-dimensional cross-section is detected, including: Determine the cutting direction based on the direction of the milling trajectory; According to the cutting direction, the first point cloud dataset is sliced ​​at a preset interval to obtain multiple two-dimensional cross sections; For each of the two-dimensional cross sections, a circle is fitted to the first point cloud dataset to obtain multiple fitted circles; Calculate the average and maximum spacing between adjacent fitted circles; The roughness of the two-dimensional cross-section is detected based on the average spacing and the maximum spacing; Compare the average spacing with a preset first threshold, and the maximum spacing with a preset second threshold; In response to the average spacing being less than or equal to the first threshold and the maximum spacing being less than or equal to the second threshold, the roughness of the corresponding two-dimensional cross-section is determined to be acceptable. Based on the detection results, the roughness of the milled surface of the workpiece to be tested is determined.

2. The method for detecting the roughness of milled surfaces according to claim 1, characterized in that, The point cloud dataset for real-time determination of the milled surface of the workpiece to be inspected includes: Obtain the positioning information of the milled surface of the workpiece to be inspected; Based on the positioning information, a structured light camera is used to acquire two-dimensional images and point cloud data of the milled surface of the workpiece to be inspected in real time, and the two-dimensional coordinates of each pixel in the two-dimensional image are determined. Based on the conversion relationship between two-dimensional coordinates and three-dimensional point cloud coordinates, the pixel points are mapped to three-dimensional point cloud coordinates; The grayscale value of the two-dimensional image is determined, and the grayscale value is merged with the three-dimensional coordinates of the pixel to obtain the point cloud dataset of the milled surface of the workpiece to be detected.

3. The method for detecting the roughness of milled surfaces according to claim 1, characterized in that, The deep hierarchical feature learning model based on a pre-improved point set in the metric space segments the point cloud dataset and extracts the first point cloud dataset of the milled surface of the workpiece to be detected, including: Based on a deep hierarchical feature learning model of point sets in metric space, the point cloud dataset is segmented to determine multiple segmentation regions of the point cloud dataset. Collect local point cloud features for each segmented region and determine the global context features of the point cloud dataset; Based on the global context space attention mechanism, the global context features and the local point cloud features are fused and enhanced to obtain the global attention point cloud features of the point cloud dataset; By controlling the value of the weight parameter, the penalty mechanism is controlled to optimize the global attention point cloud features; Determine the ideal features of the point cloud data, compare the ideal features with the optimized global attention point cloud features, until the comparison results reach the ideal level, determine the value of the weight parameter, and determine the foreground point cloud features of the global attention point cloud features. Extract the foreground point cloud features and use the foreground point cloud features as the first point cloud dataset of the milled surface of the workpiece to be inspected.

4. The method for detecting the roughness of milled surfaces according to claim 1, characterized in that, Determining the roughness of the milled surface of the workpiece to be inspected based on the detection results includes: If the roughness of each of the two-dimensional cross sections is qualified, then the roughness of the milled surface of the workpiece to be tested is determined to be qualified; If the roughness of one or more of the two-dimensional cross sections is unqualified, then the roughness of the milled surface of the workpiece to be inspected is determined to be unqualified, and the position information corresponding to the unqualified two-dimensional cross section is determined.

5. A milling surface roughness detection device, characterized in that, The surface roughness detection device includes: The data acquisition module is used to determine the point cloud dataset of the milled surface of the workpiece to be inspected in real time; The data extraction module is used to segment the point cloud dataset based on a pre-improved deep hierarchical feature learning model for point sets in the metric space, and extract the first point cloud dataset of the milled surface of the workpiece to be inspected; the improvement of the deep hierarchical feature learning model for point sets in the metric space includes: Based on the global context space attention mechanism and the penalty mechanism containing weight parameters, an improvement is made to the deep hierarchical feature learning model of point sets in the metric space. The detection module is used to slice the first point cloud dataset according to the milling machining trajectory to obtain multiple two-dimensional cross-sections, and to detect the roughness of each two-dimensional cross-section, including: Determine the cutting direction based on the direction of the milling trajectory; According to the cutting direction, the first point cloud dataset is sliced ​​at a preset interval to obtain multiple two-dimensional cross sections; For each of the two-dimensional cross sections, a circle is fitted to the first point cloud dataset to obtain multiple fitted circles; Calculate the average and maximum spacing between adjacent fitted circles; The roughness of the two-dimensional cross-section is detected based on the average spacing and the maximum spacing; Compare the average spacing with a preset first threshold, and the maximum spacing with a preset second threshold; In response to the average spacing being less than or equal to the first threshold and the maximum spacing being less than or equal to the second threshold, the roughness of the corresponding two-dimensional cross-section is determined to be acceptable. The determination module is used to determine the roughness of the milled surface of the workpiece to be tested based on the detection results.

6. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory stores a computer program that, when executed by a processor, causes the processor to perform the steps of the milling surface roughness detection method as described in any one of claims 1 to 4.

7. A vehicle, characterized in that, include: An electronic device for implementing the steps of the milled surface roughness detection method as described in any one of claims 1 to 4; A processor that runs a program that, when the program is running, performs the steps of the surface roughness detection method as described in any one of claims 1 to 4 from data output by the electronic device. A storage medium for storing a program that, when run, performs the steps of the milling surface roughness detection method as described in any one of claims 1 to 4 on data output from an electronic device.

Citation Information

Patent Citations

  • Method, device, equipment for detecting surface roughness of weld joint side and storage medium

    CN109855574A

  • Milling surface roughness online monitoring method and system

    CN119772659A