A tool contact workpiece detection method based on spectral flux
By arranging sensors on the tool spindle and combining wavelet threshold denoising and spectral flux analysis, the problems of long response time and high cost of CNC machine tool contact detection are solved, achieving more accurate and faster detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YOUJI TECH (SHANGHAI) CO LTD
- Filing Date
- 2024-07-05
- Publication Date
- 2026-06-02
AI Technical Summary
Existing methods for detecting contact collisions between CNC machine tool tools and workpieces have long response times, high costs, poor robustness, and are not suitable for modern intelligent CNC machine tools, depending on the specific machine tool and modeling requirements.
Signals are acquired by sensors mounted on the tool spindle. The optimal frequency band is selected through wavelet threshold denoising, sparsity index screening, and spectral flux analysis to detect the contact and separation process between the tool and the workpiece in real time.
It achieves more accurate and faster tool-workpiece contact detection, reduces detection costs, improves response time and detection efficiency, and is suitable for modern intelligent CNC machine tools.
Smart Images

Figure CN118875821B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tool anomaly detection technology, and in particular to a tool contact workpiece detection method based on spectral flux. Background Technology
[0002] CNC machine tools possess extremely high machining accuracy and repeatability. Through programming, they can adapt to different production and processing needs, automating various complex machining tasks while reducing manual tool changes and machine setup time, significantly improving production efficiency. In the machining process of CNC machine tools, the cutting tool plays a crucial role; its performance and selection directly affect machining efficiency, product quality, and production costs. Therefore, the scientific selection and management of cutting tools is a key research and application foundation in the field of precision manufacturing. The cutting tool is the part that directly contacts the workpiece; its geometric accuracy, material, and coating quality determine the fineness of the machined surface. The selection of the cutting tool directly affects the material removal rate and machining time. Overall, from improving production efficiency to ensuring machining quality, from reducing production costs to supporting environmental sustainability, the selection and management of cutting tools are key factors in achieving efficient and high-quality manufacturing. Therefore, it is necessary to conduct cutting tool and workpiece contact detection to monitor the health status of the cutting tool in real time. Cutting tool and workpiece contact detection can accurately determine the actual position of the cutting tool relative to the workpiece and precisely determine the machining start time. This is crucial for achieving high-precision machining. In addition, tool and workpiece contact detection can prevent machining errors caused by tool clamping errors or positioning errors. Effective contact detection technology can reduce machine tool downtime and the need for manual inspection, thereby improving overall production efficiency and enhancing the operational safety of CNC machine tools.
[0003] In the existing technology, the contact collision detection of CNC machine tool tools and workpieces mainly includes the following technical solutions. (1): Based on the real-time tool contact collision detection algorithm, the algorithm first uses axial bounding box (AABB) to establish a protection zone for the parts and tools in the preprocessing stage, and performs preliminary detection of contact collision (AABB is a simple and efficient collision detection tool. It uses cuboids aligned with the coordinate axes to surround objects with complex shapes. The edges of AABB are parallel to the coordinate axes, which simplifies the calculation. By creating AABB, a protection area is established for the parts and tools of the CNC machine tool. These protection zones are virtual cuboids that completely surround the parts and tools. These AABBs are used to perform preliminary collision detection of the protection zones). Then, the separation axis theory and cuboid intersection theory are used to perform real-time collision detection of the protection zones. (2): Using the OSG module in the VC.NET environment to represent line segments and obtain the intersection point of the line segments with the scene, the contact collision detection of the tool with the machined and non-machined objects in the scene is realized. (3): The camera is used to collect image data of the tool cutting the workpiece in real time, and edge detection is performed on the image to realize contour recognition, so as to realize the detection of whether the tool and the workpiece are in contact and collision. (4): Due to high cost, inconsistent machine tool rigidity and high failure rate, there are certain disadvantages to installing additional sensors. The perturbation observation theory based on sensorless information is not used. The estimated collision force information is integrated into two axes. The multivariate statistical process of collision force on two axes (spindle and workpiece axis) is used to detect tool contact and collision. (5): Based on the characteristics of a specific CNC machine tool, the traditional contact and collision detection algorithm of establishing and separating axes through tool space protection zone is combined with hierarchical mesh segmentation and octree optimization, which improves detection efficiency and accuracy. (6): Fanuc Corporation designed a machine tool with the function of detecting the contact between the tool and the workpiece. The machine tool is designed with an offset position detection unit and a contact point detection unit. The tool moves relative to the workpiece by using a movable axis to scan the surface of the workpiece. The contact between the tool and the workpiece is detected based on the position offset detected by the position offset detection unit. The position of the movable axis when the contact is detected is automatically set and stored as the starting point of the machining.
[0004] While the aforementioned technical solutions have achieved some success, realizing the claimed technical effects is actually contingent on the specific tool and machine tool usage context. Furthermore, other aspects require modeling and virtual control methods for detection, which have excessively long response times and are unsuitable for actual production processing. Using image data for detection requires a large amount of data to train the model, resulting in high detection costs and poor robustness. Relying on external hardware mechanical structures for detection is clearly unsuitable for modern, highly intelligent, and digital CNC machine tools. Considering all these factors, it is essential to provide a more efficient method for contact detection of tools and workpieces. Summary of the Invention
[0005] To overcome the shortcomings of existing CNC machine tool tool-workpiece contact collision detection methods, as described in the background section, due to technological limitations, this invention provides a tool contact detection method based on spectral flux that offers higher accuracy compared to traditional spatial modeling and virtual control methods under relevant process conditions. This method utilizes signals collected by a proprietary sensor mounted on the tool spindle to achieve tool contact detection, eliminating the need for additional sensors on the worktable, effectively reducing detection costs. It also features a faster response time and can detect the contact and separation process between the tool and workpiece in real time, providing favorable technical support for stable and reliable workpiece machining.
[0006] The technical solution adopted by this invention to solve its technical problem is:
[0007] A tool-workpiece contact detection method based on spectral flux is characterized by the following steps: S1: A sensor is arranged on the machine tool spindle to collect signals during the tool machining process, and the collected data is denoted as X = {x1, x2, ..., x...} n}, where n is the number of data points collected; S2: Preprocess the data obtained in step S1, specifically including data truncation, removing abnormal segments at the beginning or end of the collection, to obtain data D = {d1, d2, ..., d...} n}, where n is the number of data points collected. Then, by selecting an appropriate wavelet basis and decomposition level, wavelet threshold denoising is performed on the signal; S3: The optimal frequency band is selected for filtering of the data obtained in step S2, and a 1 / 3 binary tree filter bank is constructed. Specifically, based on the sparsity index Gini coefficient, the frequency band with the largest index is selected for filtering. This frequency band is the most impactful frequency band, and for the signal collected during tool processing, it is the frequency band with the most significant frequency conversion and modulation phenomena; S4: The spectral flux Flux(t) of the filtered signal is calculated. First, the short-time Fourier transform of the signal is calculated, the amplitude of each frame of the spectrum is calculated, and then the amplitude difference between adjacent frames is calculated. The summation and positive result are used to obtain the spectral flux. The time point of contact or collision between the tool and the workpiece is identified by the change of the spectral flux; S5: The data obtained in steps S1-S4 are used as the application software of the tool and workpiece contact detection system in the PC to detect the contact between the tool and the workpiece in real time during processing.
[0008] Furthermore, in step S1, the acoustic emission signal of the machine tool spindle is collected. During the operation of the machine tool spindle and the tool, the acoustic emission signal can provide key information about the cutting process, tool wear, and machine tool status. Specifically, the sampling frequency fs is set to 100000Hz.
[0009] Furthermore, in step S2, the data obtained in step S1 is preprocessed, which can improve the signal-to-noise ratio of the signal by removing background noise and other irrelevant noise, making the components in the acoustic emission signal directly related to the machine tool cutting process more obvious; wavelet threshold denoising includes the following sub-steps: (1): performing wavelet decomposition on the signal, the wavelet decomposition formula is The purpose of decomposition is to represent the signal at different frequency levels; (2): Set a threshold λ to process the wavelet coefficients X obtained after wavelet decomposition. j,k There are two threshold setting methods: hard threshold and soft threshold. Soft threshold denoising is used specifically, as shown in the formula... It is indicated that the soft thresholding method can reduce the coefficients, thereby achieving a smoother denoising effect; (3): using wavelet coefficients after thresholding. The signal is reconstructed using the inverse wavelet transform, as shown by the formula... This means that the denoised signal x is obtained. denoised [n].
[0010] Furthermore, in step S2, the soft threshold specifically uses a statistical threshold, that is, it is determined using a mean squared error estimation method. The statistical threshold involved adopts a general threshold, and the statistical threshold formula is:
[0011] Furthermore, in step S3, the optimal frequency band selection can improve the efficiency and accuracy of signal processing, reduce the computational burden, and increase the processing speed. In the most relevant frequency band, the signal features related to tool contact are more obvious, and feature extraction and subsequent analysis can be more accurate and sensitive, enabling more effective detection and monitoring of tool contact with the workpiece.
[0012] Furthermore, in step S3, the center frequencies of the filters used in constructing the 1 / 3 binary tree filter bank follow a 1 / 3 octave interval, as shown by formula f. c,n+1 =f c,n ×2 1 / 3 This indicates that it can cover a wider range of data frequencies; specifically, it includes the following steps: (1) Part of the analyzed signal passes through a higher frequency filter, and the other part passes through a lower frequency filter. This process is repeated at each level of the binary tree until the required frequency resolution is achieved. After frequency decomposition of the signal, specific frequency components can be selectively reconstructed. The reconstruction process is as follows: The reconstructed signal is used to analyze or extract specific information from the signal; (2): After decomposing the collected spindle acoustic emission signal into multiple sub-bands, the sparsity index Gini coefficient is calculated for each sub-band signal. The Gini coefficient is obtained by formula The definition is that, based on the calculated sparsity index, a frequency band with high sparsity can be adaptively selected as the optimal frequency band, and features can be extracted from the selected optimal frequency band for subsequent tool-workpiece contact analysis.
[0013] Furthermore, in step S4, the spectral flux is mainly used to quantify the degree of data spectral change between adjacent frames, and the short-time Fourier transform is given by the formula... Definition; The amplitude of the spectrum for each frame is calculated using the formula A(t,ω)=|X(t,ω)|, specifically, for each frame, the sum of the squares of the differences in amplitude between the spectrum and the previous frame is calculated, and then the square root is taken, using the formula ( This indicates that the calculation of spectral flux is achieved.
[0014] Compared with existing technologies, the advantages of this invention are as follows: This invention is mainly used to accurately and efficiently determine the start time of tool machining. First, sensors arranged on the machine tool collect signals during the machining process. Second, wavelet threshold denoising is used to denoise the signals. For the denoised signals, the optimal frequency band with the strongest impact is selected using the sparsity index Gini coefficient, and the signals in this frequency band are filtered out. Next, the spectral flux of the signal within the optimal frequency band is calculated, and the contact time between the tool and the workpiece is identified by the change in spectral flux. Finally, the effectiveness of this invention is verified by data obtained from actual engineering projects. Compared with existing traditional spatial modeling and virtual control methods for tool contact detection, this invention has a higher degree of accuracy. Since the detection of tool contact can be achieved using signals collected by sensors arranged on the spindle, there is no need to arrange additional sensors on the worktable, effectively reducing costs. It can detect the contact and separation of the tool and the workpiece in real time, and has a faster response time compared to traditional methods. Attached image description:
[0015] Figure 1 This is a schematic diagram of the structure of a certain type of milling machine;
[0016] Figure 2 This is a schematic diagram of the D2 end mill;
[0017] Figure 3 This is a schematic diagram of a cubic workpiece and its dimensions;
[0018] Figure 4 This is a flowchart of the present invention;
[0019] Figure 5 This is a schematic diagram of the spindle's acoustic emission signal;
[0020] Figure 6 This is a schematic diagram of the spindle acoustic emission signal after noise reduction;
[0021] Figure 7 This is a schematic diagram of optimal frequency band selection;
[0022] Figure 8 This is a schematic diagram of the signal within the optimal frequency band;
[0023] Figure 9 This is a schematic diagram of spectral flux;
[0024] Figure 10 This is a schematic diagram of acoustic emission signals collected from two locations. Detailed Implementation
[0025] This invention uses a certain type of milling machine to process cubic workpieces ( Figure 3 The workflow of this invention will be explained using horizontal milling as an example (as shown in the diagram). A schematic diagram of the milling machine structure is shown below. Figure 1As shown, the milling cutter used is model D2.0. Figure 2 As shown in the diagram, the workpiece being processed, its dimensions, and the processing location are as follows: Figure 3 As shown. The workpiece being machined is cubic in shape, with a length, width, and height of 10mm, 6mm, and 0.735mm, respectively. The milling depth is 0.2mm, and the machining is completed by multiple milling operations along the horizontal direction on the workpiece surface.
[0026] Figure 4 As shown, a tool-workpiece contact detection method based on spectral flux is described, with the following specific steps. Step one: An acoustic emission sensor is arranged on the machine tool spindle to collect the spindle's acoustic emission signal. The acoustic emission signal is a small sound fluctuation collected by the sensor from the workpiece or machine tool structure. These sound fluctuations usually originate from the process of material or structural deformation. During the operation of the machine tool spindle and tool, the acoustic emission signal can provide key information about the cutting process, tool wear, machine tool status, etc. Specifically, the spindle acoustic emission signal is collected throughout the entire machining process of a D2 milling cutter horizontally milling a workpiece. The sampling frequency fs is set to 100000Hz, and the collected raw data is X={x1,x2,...,x...} n}, where n is the number of data points collected, and the collected raw data is as follows: Figure 5 As shown. This step provides data for step two.
[0027] Step 2: Preprocess the original acoustic emission signal collected in Step 1. During machine tool operation, various noise sources exist in the environment, such as operating noise from other mechanical equipment and electrical noise. These noises can mix with the acoustic emission signal emitted from the spindle or tool, thus masking or distorting the useful signal. By removing background noise and other irrelevant noise, this step helps improve the signal-to-noise ratio, making the components directly related to the cutting process in the acoustic emission signal more prominent. This is crucial for subsequent signal analysis such as feature extraction, condition monitoring, and fault diagnosis. Specifically, wavelet threshold denoising is used to denoise the original spindle acoustic emission signal. Wavelet threshold denoising is a powerful signal processing method, particularly suitable for processing non-stationary signals that may be affected by various noise sources. The core idea of wavelet threshold denoising is to utilize the time-frequency localization characteristics of wavelet transform to decompose the signal into different frequency levels, and then achieve denoising by modifying the wavelet coefficients at these frequency levels. Wavelet threshold denoising includes the following steps: First, the signal needs to be decomposed using wavelets, as shown in formula (1).
[0028]
[0029] As shown, the purpose of decomposition is to represent the signal at different frequency levels, where X j,k The signal x[n] in the wavelet basis ψ j,kThe wavelet coefficients on the decomposition level are given by j, k is the coefficient index of that level, and the wavelet basis is ψ. j,k The wavelet coefficients X obtained after wavelet decomposition are obtained by extending and translating the mother wavelet ψ(t). j,k The signal includes different frequency components, and noise is usually more significant in the high-frequency part. Therefore, these coefficients are processed by setting a threshold λ. There are hard threshold and soft threshold methods. This invention uses soft threshold denoising, as expressed by formula (2).
[0030]
[0031] The soft thresholding method reduces the coefficients, thus achieving a smoother denoising effect. These are wavelet coefficients after thresholding. The choice of threshold is crucial to the denoising effect. In this invention, a statistical threshold is used, that is, the threshold is determined by the mean square error estimation method. A general threshold is adopted, which is determined by formula (3).
[0032]
[0033] Where σ is the standard deviation estimate of the noise, and N is the number of data sample points. Then, the wavelet coefficients after thresholding are used... The signal is reconstructed using inverse wavelet transform, as shown in equation (4).
[0034]
[0035] This means that the denoised signal x is obtained. denoised [n] In this invention, the Daubechies wavelet is used as the mother wavelet, and the decomposition level is set to 5 levels. The original main shaft acoustic emission signal is denoised. The denoised signal is as follows: Figure 6 As shown. The main purpose of this step is to preprocess the raw acoustic emission signals acquired during CNC machine tool operation to improve the signal-to-noise ratio. By removing background noise and other irrelevant noise, the components in the acoustic emission signal directly related to the cutting process become more apparent, which is crucial for subsequent signal analysis such as feature extraction, condition monitoring, and fault diagnosis.
[0036] Step 3, Optimal frequency band selection. Acoustic emission signals are generated by the contact and cutting action between the tool and the workpiece. This contact is usually accompanied by plastic deformation or fracture of the material. The collected acoustic emission waves usually contain multiple frequency components. By focusing on the optimal frequency band, the efficiency and accuracy of signal processing can be improved. Focusing on the most relevant frequency band can reduce the amount of data that needs to be processed, thereby reducing the computational burden and improving the processing speed. In addition, in the most relevant frequency band, the signal features related to tool contact may be more obvious. Therefore, feature extraction and subsequent analysis can be more accurate and sensitive, thereby achieving more effective detection and monitoring. Specifically, firstly, a 1 / 3 binary tree filter bank is constructed. The 1 / 3 binary tree filter is based on the binary tree data structure and the bandpass filtering principle. By decomposing the signal frequency components step by step, the purpose of accurate signal analysis is achieved. The input signal is passed through a series of bandpass filters. The center frequencies of these filters follow a 1 / 3 octave interval, that is, the center frequency of each filter is about 1 / 3 times the center frequency of the previous filter, as expressed by formula (5).
[0037] f c,n+1 =f c,n ×2 1 / 3 (5)
[0038] Among them, f c The center frequency of the current filter is represented by this design, which can cover a wide frequency range and ensure that various frequency components in the signal can be analyzed. Each filtering process can be regarded as a node on a binary tree, where each node represents a bandpass filter. The signal first passes through the top-level filter, and then the output signal is divided into two parts: one part of the signal passes through a higher frequency filter, and the other part passes through a lower frequency filter; this process is repeated at each level of the binary tree until the required frequency resolution is achieved. After frequency decomposition of the signal, specific frequency components can be selectively reconstructed. The reconstruction process is represented by formula (6).
[0039]
[0040] Where H(f) and L(f) represent high-pass and low-pass filters, respectively, and the reconstructed signal is used to analyze or extract specific information from the signal; after the collected spindle acoustic emission signal is decomposed into multiple sub-bands using 1 / 3 binary tree filtering technology, the sparsity index Gini coefficient is calculated for each sub-band signal, which is defined by formula (7).
[0041]
[0042] Where L represents the signal length, |S| kLet |S||1 represent the absolute value of the k-th value after the signal sequence is sorted in ascending order, and let |S||1 represent the L1 norm of the signal sequence S. The Gini coefficient reflects the sparsity of the signal in the corresponding frequency band. Since the rotation frequency is the main sparse component of the tool signal, a frequency band with higher sparsity may contain more rotation frequency and modulation information. Based on the calculated sparsity index, a frequency band with higher sparsity is adaptively selected as the optimal frequency band. Features are extracted from the selected optimal frequency band for subsequent analysis. In this example, the decomposition level is set to 5 levels. The optimal frequency band result obtained based on the Gini coefficient and 1 / 3 binary tree filtering is as follows. Figure 7 As shown, the brightest frequency band is the optimal frequency band with the strongest sparsity, with a center frequency of 25000Hz and a bandwidth of 16666Hz. The signal, its spectrum, and envelope spectrum within this frequency band are shown below. Figure 8 As shown. The main purpose of this step is to improve the efficiency and accuracy of acoustic emission signal processing through optimal frequency band selection, thereby more effectively detecting and monitoring the contact and cutting process between the tool and the workpiece.
[0043] Step four: Calculate the spectral flux of the signal within the optimal frequency band. Spectral flux is mainly used to quantify the degree of spectral change between adjacent frames. Spectral flux is widely used in music information retrieval, beat detection, and music structure analysis. It can effectively detect sudden changes in the signal, such as the rhythm point or the beginning of a note. Spectral flux is defined as the total change in spectral amplitude between two consecutive frames. Intuitively, it measures the amount of change in the signal spectrum from one frame to another. If the spectral difference between two frames is large, the value of spectral flux is high, and vice versa. Specifically, first, a short-time Fourier transform needs to be performed on the signal x(t) to obtain the spectral representation of each time frame t. The short-time Fourier transform is defined by formula (8).
[0044]
[0045] Where ω(n) is the window function; then the amplitude of the short-time Fourier transform of each frame of the signal is calculated, as expressed by formula (9).
[0046] A(t,ω)=|X(t,ω)| (9)
[0047] For each frame, calculate the sum of squares of the difference in spectral amplitude between it and the previous frame, and then take the square root, as expressed by formula (10).
[0048]
[0049] To calculate the spectral flux, in this example, the frame length is 70,000 points, meaning the response time is 0.7 seconds. A Hamming window is selected as the window function. The calculated spectral flux is as follows: Figure 9As shown, the points marked with pentagrams represent the points of greatest abrupt change in spectral flux, excluding the beginning and end point effects. These points represent the moments when the tool and workpiece come into contact. The main purpose of this step is to detect the moment of contact between the tool and workpiece by calculating the spectral flux of the signal within the optimal frequency band. By quantifying spectral changes, calculating the spectral amplitude of the short-time Fourier transform, and calculating the spectral flux, the abrupt change points can be detected. Through these steps, the contact moment between the tool and workpiece can be effectively detected, improving the accuracy and reliability of CNC machine tool operation. This is of great significance for monitoring the cutting process and performing condition diagnosis. S5: The data obtained in steps S1-S4 are used as the application software of the tool-workpiece contact detection system to detect the contact between the tool and workpiece in real time during machining.
[0050] To verify this result, the present invention arranges acoustic emission sensors on the machine tool spindle and worktable, and simultaneously collects acoustic emission signals from both locations. The results are as follows: Figure 10 As shown, the acoustic emission sensor on the worktable only collects the signal at the instant the tool contacts the workpiece. This moment coincides with the time point of sudden change in the spectral flux of the spindle acoustic emission signal. Therefore, it is proven that the present invention can detect the contact between the tool and the workpiece based on the spindle acoustic emission signal with a response time of 0.7 seconds.
[0051] Through the above technical solution, this invention is mainly used to accurately and efficiently determine the start time of tool machining. First, sensors arranged on the machine tool collect signals from the tool during machining. Second, wavelet threshold denoising is used to denoise the signals. For the denoised signals, the Gini coefficient, a sparsity index, is used to filter out the optimal frequency band with the strongest impact. Then, the spectral flux of the signal within the optimal frequency band is calculated, and the contact time between the tool and the workpiece is identified by the change in spectral flux. Finally, the effectiveness of this invention is verified by data obtained from actual engineering projects. Compared with existing traditional spatial modeling and virtual control methods for tool contact detection, this invention has a higher degree of accuracy. Since the detection of tool contact can be achieved using signals collected by sensors arranged on the spindle, there is no need to arrange additional sensors on the worktable, effectively reducing costs. It can detect the contact and separation of the tool and the workpiece in real time, and has a faster response time compared to traditional methods.
[0052] The foregoing has shown and described the basic principles and main features of the present invention, as well as its advantages. It will be apparent to those skilled in the art that the present invention is limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0053] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in the embodiments can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method of detecting tool contact with a workpiece based on spectral flux, the method comprising: The process includes the following steps: S1: Arrange sensors on the machine tool spindle to collect signals during the tool machining process; the collected data is recorded as follows: Where n is the number of data points collected; S2: Preprocess the data obtained in step S1, specifically including data truncation, removing abnormal segments at the beginning or end of the collection, to obtain the data. Where n is the number of data points collected, then wavelet threshold denoising is performed on the signal by selecting an appropriate wavelet basis and decomposition level; S3: The optimal frequency band is selected for filtering of the data obtained in step S2, and a 1 / 3 binary tree filter bank is constructed. Specifically, based on the sparsity index Gini coefficient, the frequency band with the largest index is selected for filtering. This frequency band is the most impactful and, for the signal collected during tool processing, is the frequency band where frequency conversion and modulation phenomena are most significant; S4: The spectral flux Flux(t) of the filtered signal is calculated. First, the short-time Fourier transform of the signal is calculated, the amplitude of each frame spectrum is calculated, and then the amplitude difference between adjacent frames is calculated. The spectral flux is mainly used to quantify the degree of change in the data spectrum between adjacent frames. The short-time Fourier transform is given by the formula definition, It is a window function; the amplitude is calculated for each frame of the spectrum using the formula. Specifically, for each frame, calculate the sum of squares of the differences in spectral amplitude between it and the previous frame, then take the square root, and use the formula... S1 indicates that the calculation of spectral flux is realized, and the time point of contact or collision between the tool and the workpiece is identified by the change of spectral flux; S5: The data obtained in steps S1-S4 are used in the application software of the tool and workpiece contact detection system in the PC to detect the contact between the tool and the workpiece in real time during processing; In step S1, the acoustic emission signal of the machine tool spindle is collected. In the operation of the machine tool spindle and the tool, the acoustic emission signal can provide key information about the cutting process, tool wear, and machine tool status. The specific sampling frequency fs is set to 100000Hz; In step S2, the data obtained in step S1 is preprocessed. By removing background noise and other irrelevant noise, the signal-to-noise ratio of the signal can be improved, making the components directly related to the machine tool cutting process in the acoustic emission signal more obvious; Wavelet threshold denoising includes the following sub-steps: (1): Wavelet decomposition of the signal. The purpose of decomposition is to represent the signal at different frequency levels. The wavelet decomposition formula is ,in It is a signal In wavelet base The wavelet coefficients on the decomposition level, j is the decomposition level, k is the coefficient index of that level, and the wavelet basis. By extending and translating the mother wavelet The wavelet coefficients obtained after wavelet decomposition are obtained. It includes different frequency components of the signal; (2): Set a threshold λ to process the wavelet coefficients obtained after wavelet decomposition. Specifically, soft thresholding is used for noise reduction, as shown in the formula. This indicates that the soft thresholding method can reduce the coefficients, thereby achieving a smoother denoising effect. (3): Using wavelet coefficients after thresholding. The signal is reconstructed using the inverse wavelet transform, as shown by the formula... This indicates that the denoised signal is obtained. In step S3, the center frequencies of the filters used in constructing the 1 / 3 binary tree filter bank follow a 1 / 3 octave interval, as shown by the formula. This indicates that it can cover a wider range of data frequencies. The center frequency of the current filter is indicated. Specifically, it includes the following steps: (1) Part of the analyzed signal passes through a higher frequency filter, and the other part passes through a lower frequency filter. This process is repeated at each level of the binary tree until the required frequency resolution is achieved. After frequency decomposition of the signal, specific frequency components can be selectively reconstructed. The reconstruction process follows the formula. This means that the reconstructed signal is used to analyze or extract specific information from the signal. and These represent the high-pass filter and the low-pass filter, respectively. The reconstructed signal is used to analyze or extract specific information from the signal; (2): After decomposing the collected spindle acoustic emission signal into multiple sub-bands, the sparsity index Gini coefficient is calculated for each sub-band signal. The Gini coefficient is obtained by formula Defined as follows: based on the calculated sparsity index, a frequency band with high sparsity can be adaptively selected as the optimal frequency band. Features are then extracted from the selected optimal frequency band for subsequent tool-workpiece contact analysis. Indicates signal length. This represents the absolute value of the k-th value after the signal sequence is sorted in ascending order. This represents the L1 norm of the signal sequence S.
2. A method of detecting tool-workpiece contact based on spectral flux according to claim 1, wherein, In step S2, the soft threshold specifically uses a statistical threshold, that is, a method of estimating the mean square difference is used to determine the soft threshold, and a general threshold is used for the statistical threshold. The statistical threshold formula is is the standard deviation estimate of the noise, and N is the number of data sample points.