Disclosure of Invention
Aiming at the defects or improvement demands of the prior art, the invention provides a method and a system for detecting the state of an intersection point hole boring cutter, which are used for solving the technical problem that the state of the intersection point hole boring cutter cannot be accurately detected in the prior art.
In order to achieve the above object, in a first aspect, the present invention provides a method for detecting a boring tool state of an intersection hole, comprising, after each completion of a machining of a workpiece, performing the following detection operations based on collected machining time sequence data in a machining process of the workpiece and a tool rake face image after the completion of the machining of the workpiece:
inputting processing time sequence data into a rear tool face abrasion bandwidth detection model to obtain abrasion bandwidth of a rear tool face of a tool, wherein the processing time sequence data comprises a tool cutting force signal, a tool vibration signal and a machine tool motor current signal;
Detecting a wearing area in the cutter front cutter face image, and calculating the area ratio of the wearing area to the cutter front cutter face image to be used as the wearing ratio of the cutter front cutter face;
When the obtained abrasion bandwidth is larger than a preset bandwidth threshold value or the obtained abrasion ratio is larger than a preset proportion, judging that the boring cutter of the intersection point hole is in a damaged state currently, otherwise, judging that the boring cutter of the intersection point hole is in an unbroken state currently;
the position and the visual angle of an image acquisition device adopted for acquiring the front cutter face image of the cutter are the same relative to the cutter.
Further preferably, the rear tool face abrasion bandwidth detection model comprises a MCNN network, an attention mechanism module, a GRU network and a perceptron which are connected in sequence;
the MCNN network is used for extracting features of different scales of the processing time sequence data;
the attention mechanism module is used for calculating the weights of the features of different scales of the processing time sequence data based on the attention mechanism, and carrying out weighted summation on the features of different scales to obtain fusion features;
the GRU network is used for extracting time sequence characteristics of the fusion characteristics;
The perceptron is used for mapping the time sequence characteristics into corresponding cutter back face abrasion bandwidths.
Further preferably, the GRU network is BiGRU network.
Further preferably, the flank wear bandwidth detection model is trained by:
The method comprises the steps of acquiring a first training set, wherein the first training set comprises processing time sequence data of different cutters in different cutter processing processes, and corresponding labels are actually measured abrasion bandwidths of rear cutter surfaces of the cutters;
inputting each piece of processing time sequence data in the first training set into a rear cutter face abrasion bandwidth detection model to obtain a detection result of abrasion bandwidth of a corresponding cutter rear cutter face;
the tool flank wear bandwidth detection model is trained by minimizing the difference loss between the detection result of the tool flank wear bandwidth and the corresponding label.
It is further preferred that the image segmentation model is used to detect the wear area in the tool rake image.
Further preferably, the image segmentation model includes an image encoder, a hint encoder, and a mask decoder;
the image encoder is used for encoding the cutter front cutter face image into an image embedding vector;
The prompt encoder is used for encoding foreground priori information of the cutter front face image into a prompt embedded vector;
The mask decoder is used for carrying out mask processing on the image embedded vector and the prompt embedded vector to obtain a mask image of a wearing region in the cutter front face image, and further obtain the wearing region in the cutter front face image.
Further preferably, the image segmentation model is trained by:
The second training set comprises cutter front face images of different cutters after each cutter is processed, and corresponding labels are real mask images of abrasion areas in the cutter front face images;
Inputting each cutter front face image in the second training set into an image segmentation model to obtain a mask image of a corresponding abrasion area;
The image segmentation model is trained by minimizing the loss of difference between mask images and corresponding labels in the worn region.
In a second aspect, the invention provides a system for detecting the state of an intersection point hole boring tool, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the method for detecting the state of the intersection point hole boring tool provided by the first aspect of the invention when executing the computer program.
In a third aspect, the present invention provides a system for monitoring the condition of an intersection point hole boring tool, comprising:
The data acquisition module is used for acquiring processing time sequence data of each tool of the workpiece in the processing process and a tool front surface image after one tool is processed, wherein the processing time sequence data comprises a tool cutting force signal, a tool vibration signal and a machine tool motor current signal;
the state detection module is used for executing the detection method of the state of the boring tool for the intersection point hole provided by the first aspect of the invention.
In a fourth aspect, the present invention also provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where the computer program, when executed by a processor, controls a device where the storage medium is located to execute the method for detecting a state of an intersection hole boring tool provided in the first aspect of the present invention.
In general, through the above technical solutions conceived by the present invention, the following beneficial effects can be obtained:
1. The invention provides a detection method of the state of an intersection hole boring cutter, which is based on multi-mode data for detection, wherein the acquired processing time sequence data in the processing process of a cutter and the acquired image of the front cutter surface of the cutter after the processing of the cutter are used as detection indexes of the state of the intersection hole boring cutter, the abrasion bandwidth and the abrasion ratio of the image of the front cutter surface of the cutter are respectively correspondingly acquired, the condition of processing precision is represented by the abrasion bandwidth, the abrasion of the rear cutter surface of the cutter is larger when the abrasion bandwidth is larger, the processing precision is influenced, the condition of surface roughness is represented by the abrasion ratio, and the abrasion of the front cutter surface of the cutter is larger when the abrasion ratio is larger, and the surface roughness of a workpiece is influenced. The invention considers the requirements of processing precision and surface roughness in all aspects, and realizes the accurate detection of the state of the boring tool for the intersection point hole.
2. The rear tool face abrasion bandwidth detection model comprises a MCNN network, an attention mechanism module, a GRU network and a perception machine which are sequentially connected, wherein after the characteristics of different scales of processing time sequence data are extracted through the MCNN network, the attention mechanism module distributes weights for the characteristics of different scales, fusion is carried out according to the weights, and finally the time sequence characteristics of the fused characteristics are further extracted through the GRU network, so that the depth characteristic extraction from a space scale to a time sequence dimension is realized, and the detection precision of the abrasion bandwidth of the rear tool face of the tool is improved.
3. Furthermore, in the method for detecting the state of the boring tool with the intersection point hole, which is provided by the invention, a BiGRU network is adopted in a tool rear face abrasion bandwidth detection model, and a bidirectional circulation structure is utilized to connect two hidden layers with opposite propagation directions to the same output layer, so that the hidden layers can process an input sequence from front to back and can process the input sequence from back to front, thereby better capturing context information in the sequence and further improving the detection precision of the abrasion bandwidth of the tool rear face.
4. The image segmentation model comprises an image encoder, a prompt encoder and a mask decoder, wherein the image encoder is used for encoding a front image of the cutter into an image embedded vector, the prompt encoder is used for encoding foreground priori information of the front image of the cutter into a prompt embedded vector, and a segmentation mask is predicted according to the image embedded vector and the prompt embedded vector, so that the priori information and original image information are fully utilized, and the front image of the cutter can be segmented more flexibly and accurately.
5. The invention provides a method for detecting the state of an intersection point hole boring tool, which can directly deploy a rear tool face abrasion bandwidth detection model to the local for use without relying on a cloud computing mode, reduces the dependence on network transmission and meets the requirements of real-time monitoring and fault diagnosis in the processing process.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
In order to achieve the above object, in a first aspect, the present invention provides a method for detecting a boring tool state of an intersection hole, as shown in fig. 1, including, after each machining of a workpiece is completed, performing the following detection operations based on collected machining time sequence data in a machining process of the workpiece and a tool front face image after the machining of the workpiece is completed:
Inputting processing time sequence data into a rear cutter face abrasion bandwidth detection model to obtain abrasion bandwidth of a rear cutter face of a cutter, wherein the processing time sequence data comprises a cutter cutting force signal, a cutter vibration signal and a machine tool motor current signal;
Detecting a wearing area in the cutter front cutter face image, and calculating the area ratio of the wearing area to the cutter front cutter face image to be used as the wearing ratio of the cutter front cutter face;
When the obtained abrasion bandwidth is larger than a preset bandwidth threshold value or the obtained abrasion proportion is larger than a preset proportion, judging that the boring cutter of the intersection point hole is in a damaged state currently and needs to be replaced;
the position and the visual angle of an image acquisition device adopted for acquiring the front cutter face image of the cutter are the same relative to the cutter.
In general, during the machining of the blade body intersection hole, the tool is considered to be replaced if the flank wear value is generally greater than 0.1mm or the rake wear area is greater than 0.037. In an alternative embodiment, the preset bandwidth threshold and the preset ratio take values of 0.1mm and 0.037, respectively.
The flank wear bandwidth detection model may be a deep learning model, or may be a model such as CNN, LSTM, GRU, transformer.
Preferably, in an alternative embodiment, the rear tool face abrasion bandwidth detection model comprises a MCNN network, an attention mechanism module, a GRU network and a perceptron which are connected in sequence;
the MCNN network is used for extracting features of different scales of the processing time sequence data;
the attention mechanism module is used for calculating the weights of the features of different scales of the processing time sequence data based on the attention mechanism, and carrying out weighted summation on the features of different scales to obtain fusion features;
the GRU network is used for extracting time sequence characteristics of the fusion characteristics;
The perceptron is used for mapping the time sequence characteristics into corresponding cutter back face abrasion bandwidths.
Specifically, the MCNN network comprises a plurality of parallel feature extraction layers, in the embodiment shown in fig. 2, MCNN comprises an input layer, a feature extraction layer and a pooling layer which are sequentially connected, the feature extraction layer comprises 3 parallel feature extraction layers which are connected in parallel, the input layer comprises a convolution layer, a BN layer and a pooling layer which are sequentially connected, each parallel feature extraction layer comprises a convolution layer, a BN layer and an activation layer which are sequentially connected, and the convolution kernels of the convolution layers in the three parallel feature extraction layers are 3*3, 5*5 and 7*7 respectively. In an alternative embodiment, the convolution layer employs a two-dimensional convolution layer Conv2d, the pooling layer employs an average pooling layer AvePool, and the activation layer employs a rectifying linear unit ReLU. It should be noted that this is only one embodiment, and the pooling layer may also be a maximum pooling layer, a global pooling layer, etc., and the activation layer may also be a leak ReLU, sigmoid, etc., which is not limited herein.
In this embodiment, convolution kernels of three sizes, 3, 5, and 7, are selected. Since the input data is long, large convolution kernels and pooling layers are applied to the input layer to learn the global features. The number of convolution kernels in the feature extraction layer is greater than the number of convolution kernels in the input layer, in this embodiment, the number of convolution kernels in the input layer is 16, and each convolution layer in the feature extraction layer is doubled to 32. Finally, three averaging pooling operations are used for fast downsampling.
The convolution layers with the convolution kernels with the larger sizes are used for obtaining wide receptive fields and global features, the convolution layers with the smaller sizes are used for learning high-level features, and a batch normalization layer (BN layer) is added after each convolution layer, so that internal covariate offset can be reduced.
In this embodiment, a full connection layer is further disposed between the MCNN network and the attention mechanism module, and two dropout layers are disposed in the full connection layer to avoid the problem of overfitting.
The receptive field of the convolution kernel is locally limited and typically requires stacking multiple layers in order to correlate different portions of the image. To solve this problem, by introducing autonomous hints, a method of implementing an attention mechanism by Query (Query), key (Key) and Value (Value) was devised. { a 1,a2,…,an } is a vectorized input vector, q, k, v are Query (Query), key (Key), value (Value) vectors, respectively. The Query is an autonomous prompt, which is a feature vector of subjective consciousness, the Key is a non-autonomous prompt, which is a salient feature information vector of an object, and the Value is a feature vector representing the object itself. From this point of view, the attention mechanism is to realize the attention weight distribution to Value through the attention convergence of Query and Key, and generate the final output result. Taking the attention mechanism of the a 1 vector and other vectors as an example, the q vector of the a 1 vector and the k vector of other input vectors are multiplied respectively and pass through a softmax layer to obtain the matching value of the a 1 vector and the other input vectors, and the matching value is multiplied by the v vector weight of each input vector to obtain the output vector. This process can be formulated as
Wherein Q, K, V is the matrix representation of q, k, v of each input vector, d k is a scaling factor, which acts to make the dot product result fall in the region with larger gradient of the softmax function, thereby accelerating the training process of the model.
On the basis of the above, each input vector needs to be position-coded, so that the network can learn the position relation between the inputs. There are various implementations of position coding, in this embodiment, the classical sin and cos coding methods in the transducer original text are used, and the formulas are as follows:
wherein PE represents position coding, pos represents the position of the input vector (i.e. token) to be solved in the whole input vector, the position coding is a vector (embedding), i represents the index of each element in the vector, and d model represents the vector dimension of the position coding.
The GRU network obtains tool state degradation information in the data by selectively retaining and utilizing the input information x t of the previous time state information h t-1 and the current time t. In general, in the neural network, information is transmitted from front to back, but in the boring process, the current time state information of the tool is influenced by both historical data and future operation, so that the current time state information has a larger relation with the front and back time information, and therefore, in an alternative embodiment, a BiGRU network is preferably adopted, a BiGRU network utilizes a bidirectional circulation structure, and the front and back hidden layers with opposite propagation directions are connected to the same output layer, so that the hidden layers can process an input sequence from front to back and can process the input sequence from back to front, and the context information in the sequence can be better captured.
The updated memory formula is as follows:
Wherein the closer z t is to 1, the smaller the influence of the previous time h t-1 on the calculation of the current time h t, and the closer z t is to 0, the hidden state of the current time candidate is represented The less memory, the more memory is made for the previous state.
In an alternative embodiment, the flank wear bandwidth detection model is trained by:
The method comprises the steps of acquiring a first training set, wherein the first training set comprises processing time sequence data of different cutters in different cutter processing processes, and corresponding labels are actually measured abrasion bandwidths of rear cutter surfaces of the cutters;
inputting each piece of processing time sequence data in the first training set into a rear cutter face abrasion bandwidth detection model to obtain a detection result of abrasion bandwidth of a corresponding cutter rear cutter face;
the tool flank wear bandwidth detection model is trained by minimizing the difference loss between the detection result of the tool flank wear bandwidth and the corresponding label.
In an alternative embodiment, data acquisition is performed in a horizontal boring processing scene, the used tool is a triangular boring tool, and the used workpiece is a titanium alloy test piece. Vibration, cutting force and current signals are collected through a sensor, and then high-quality discrete data of boring processing are finally obtained through an AD conversion module. And acquiring a cutter front face image by an industrial camera. All signals were acquired at a frequency of 10kHz for 50 s. The data set was randomly divided into training, validation and test sets, accounting for 80%, 10% and 10% of the data set, respectively. The model is initialized with random weights using xavier initialization techniques and optimized using Adam optimizer.
After training, the performance of the model is evaluated by adopting evaluation indexes such as MAE, MSE, R 2, and the rear face abrasion bandwidth detection model respectively reaches 6.03, 9.01 and 9.04 on MAE, MSE, R 2 evaluation indexes, which is shown in fig. 3.
There are many ways to detect the worn region in the tool rake image, and for example, a threshold segmentation method, a Grabcut algorithm method, or the like may be used.
In an alternative embodiment, an image segmentation model is used to detect the worn region in the tool rake image. The image segmentation model may be a SAM model, a threshold segmentation model, or the like.
In addition, an image segmentation algorithm can be used for detecting the abrasion area in the cutter front tool face image, such as a Grabcut algorithm.
In an alternative embodiment, the image segmentation model comprises an image encoder, a hint encoder and a mask decoder;
the image encoder is used for encoding the cutter front cutter face image into an image embedding vector;
The prompting encoder is used for encoding foreground priori information of the cutter front face image into a prompting embedded vector, wherein the foreground priori information can be a mask matrix, a boundary box or an identification point for identifying a foreground region (or a background region) or a text where the foreground region (or the background region) is located;
The mask decoder is used for carrying out mask processing on the image embedded vector and the prompt embedded vector to obtain a mask image of a wearing region in the cutter front face image, and further obtain the wearing region in the cutter front face image.
At this time, the ratio of the number of non-zero pixels in the mask image of the worn area to the number of all pixels in the mask image can be calculated as the worn duty ratio of the tool rake face.
Preferably, the image encoder is a visual transducer pre-trained based on visual attention for encoding the tool rake image into a map-embedded vector;
The cue encoder encodes background points, masks, bounding boxes or texts into embedded vectors in real time, is used for generating cue embedded vectors of cues (namely positions, texts and the like), and sends the cue embedded vectors and the image embedded vectors into a mask decoder;
The lightweight mask decoder predicts the segmentation mask according to the embedded vectors from the image encoder and hint encoder, which maps the image embedded, hint embedded, and output markers to the mask and outputs them. In an alternative embodiment, the mask decoder uses immediate self-attention and cross-attention in both directions (from hint embedding to image embedding back). This layout enhances the dataset and allows the model to learn and improve over time, making it efficient and flexible.
It should be noted that, the image segmentation model may directly adopt the existing pre-trained image segmentation model, or may be used after further fine tuning of the pre-trained image segmentation model, or may also be directly trained. The existing pre-trained image segmentation model receives the training of millions of images and billions of order of magnitude masks, and the data set of the model is carefully planned to cover a wide range of fields, objects and scenes, so that the model can be well generalized to different tasks, and therefore effective mask segmentation can be returned for any prompt. In general, the prompt, i.e. the segmentation task, may be information such as foreground, background points, text, etc., and in the required working condition of the present invention, indicates the content to be segmented in the image, i.e. the worn area.
In an alternative embodiment, the image segmentation model is trained by:
The second training set comprises cutter front face images of different cutters after each cutter is processed, and corresponding labels are real mask images of abrasion areas in the cutter front face images;
Inputting each cutter front face image in the second training set into an image segmentation model to obtain a mask image of a corresponding abrasion area;
The image segmentation model is trained by minimizing the loss of difference between mask images and corresponding labels in the worn region.
It should be noted that the foregoing training method may be used for both fine tuning and training.
The method for detecting the state of the boring cutter for the intersection point hole can be applied to boring scenes, can be deployed on notebook computers on production sites, and is used for monitoring the health state of the cutter in real time.
In a second aspect, the invention provides a system for detecting the state of an intersection point hole boring tool, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the method for detecting the state of the intersection point hole boring tool provided by the first aspect of the invention when executing the computer program.
The related technical solution is the same as the method for detecting the state of the boring tool for the intersection point hole provided in the first aspect of the present invention, and is not described herein.
In a third aspect, the present invention provides a monitoring system for the state of an intersection point hole boring tool, as shown in fig. 4, including:
The data acquisition module is used for acquiring processing time sequence data of each tool of the workpiece in the processing process and a tool front surface image after one tool is processed, wherein the processing time sequence data comprises a tool cutting force signal, a tool vibration signal and a machine tool motor current signal;
the state detection module is used for executing the detection method of the state of the boring tool for the intersection point hole provided by the first aspect of the invention.
In an alternative embodiment, the data acquisition module is used for acquiring multi-source data in the machining process and comprises a time sequence signal acquisition module and an image acquisition device, wherein the time sequence signal acquisition module is used for acquiring machining time sequence data in the machining process of each tool of a workpiece, and the image acquisition device is used for acquiring an image of the tool after machining of each tool is completed.
Specifically, as shown in fig. 5, the time sequence signal acquisition module comprises a sensor, a main control module and an analog-to-digital converter, wherein the sensor comprises a moment sensor, an acceleration sensor and a current sensor, the moment sensor is arranged on a workpiece and is used for acquiring cutting force signals, the acceleration sensor is arranged on a cutter handle and is used for acquiring vibration signals, and the current sensor is arranged on a machine tool motor and is used for acquiring current signals. The master control module is used for sending a start/end signal to each sensor to ensure the synchronism of the acquired data, and the analog-to-digital converter is used for converting the analog signal returned by the sensor into a digital signal, so that the computer can conveniently read and store the digital signal. The image acquisition device comprises a camera, such as an industrial area array camera.
The related technical solution is the same as the method for detecting the state of the boring tool for the intersection point hole provided in the first aspect of the present invention, and is not described herein.
In a fourth aspect, the present invention also provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, where the computer program, when executed by a processor, controls a device where the storage medium is located to execute the method for detecting a state of an intersection hole boring tool provided in the first aspect of the present invention.
The related technical solution is the same as the method for detecting the state of the boring tool for the intersection point hole provided in the first aspect of the present invention, and is not described herein.
It will be readily appreciated by those skilled in the art that the foregoing description is merely a preferred embodiment of the invention and is not intended to limit the invention, but any modifications, equivalents, improvements or alternatives falling within the spirit and principles of the invention are intended to be included within the scope of the invention.