Multi-feature-based magnetostrictive displacement sensor detection method and device
Through multi-feature signal recognition technology, including feature extraction, dimensionless processing and particle swarm algorithm selection, combined with the support vector machine classification model, the problem of inconsistent signal quality of magnetostrictive displacement sensors is solved, automated detection is realized, and detection accuracy is improved. Productivity.
Patent Information
- Application Number
- CN202411623360.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-01-14
AI Technical Summary
During the production and application of magnetostrictive displacement sensors, due to uneven raw materials, production process errors, environmental interference and other factors, the signal quality is inconsistent, which affects the detection accuracy and repetition of the sensor. Traditional detection methods rely on manual labor and are difficult to ensure signal quality. Causes factory qualified but may make errors or fail to work on site.
Using detection methods based on multi-feature signal recognition, through feature extraction, dimensionless processing, particle swarm algorithm feature selection and support vector machine classification model, the automatic identification of low-quality signals is achieved, and production efficiency and factory yield are improved.
It improves the accuracy of signal recognition, realizes automatic detection, reduces computing power requirements and iterations, avoids manual dependence and threshold settings, and improves the detection accuracy and stability of the sensor.
Smart Images

Figure CN119309484A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a detection method and device of a displacement sensor, and in particular to a detection method and device of a magnetostrictive displacement sensor based on multi-feature signal recognition. Background Art
[0002] The magnetostrictive displacement sensor is a non-contact, wear-free displacement sensor, which is widely used in displacement measurement in hydraulic cylinders, die-casting machines, etc. The magnetostrictive displacement sensor uses a waveguide wire as a key measuring element. An excitation pulse is passed through the waveguide wire. The annular magnetic field generated by the excitation pulse on the waveguide wire interacts with the position detection magnet to generate a position detection signal. The position detection signal is transmitted along the waveguide wire and received by the detection coil. The actual position of the position detection magnet can be calculated based on the time it takes for the position detection signal to transmit on the waveguide wire. The position detection magnet is non-contact with the waveguide wire, so there is no wear. The actual detection application of the sensor has a long service life and is stable and reliable.
[0003] Since it is difficult to ensure the consistency of raw materials (uneven stress in waveguide wires, differences in permanent magnets, differences in analog chips), the consistency of production (mechanical structure process errors, etc.), and the consistency of the sensor working environment (vibration conditions, electromagnetic interference conditions, etc.), each sensor will have different waveform signal quality, which directly affects the key performance of the sensor such as detection accuracy and repeatability.
[0004] When the sensor leaves the factory, the traditional method of detecting signal quality only focuses on the amplitude of the signal. If the amplitude meets the design requirements, it is qualified, and it is extremely dependent on manual work. At the same time, the method of using a single parameter as a qualification criterion may result in the situation that the sensor is qualified at the factory, but errors or non-operation occur at the site (especially in complex environments). Summary of the invention
[0005] In order to solve the problems and needs in the background technology, the present invention proposes a magnetostrictive displacement sensor detection method and device based on multi-feature signal recognition. The present invention first extracts the features of the magnetostrictive signal, then selects the features sensitive to signal distortion based on the binary particle swarm algorithm, and then uses the classification method based on the support vector machine to identify the signal to obtain the signal recognition result, thereby achieving the purpose of automatically identifying low-quality signals and improving the sensor production efficiency and factory yield.
[0006] The technical solution of the present invention is as follows:
[0007] 1. A magnetostrictive displacement sensor detection method based on multiple features
[0008] 1) collecting signal data of a magnetostrictive displacement sensor and extracting several magnetostrictive signal features thereof to obtain multiple feature data sets;
[0009] 2) performing dimensionless processing on the magnetostrictive signal features in each feature data set to obtain a corresponding processed feature data set;
[0010] 3) After performing feature selection on multiple processed feature data sets, a signal distortion sensitive feature set is obtained;
[0011] 4) After training the LS-SVM classification model using the signal distortion sensitive feature set, the magnetostrictive displacement sensor detection model is obtained;
[0012] 5) Calculate the signal distortion sensitivity characteristics corresponding to the magnetostrictive displacement sensor to be detected and input them into the magnetostrictive displacement sensor detection model, and the model outputs the corresponding detection results.
[0013] The magnetostrictive signal characteristics include time domain statistical characteristics and power spectrum domain statistical characteristics.
[0014] The time domain statistical characteristics include skewness, kurtosis, peak-to-peak value, kurtosis factor, root mean square, standard deviation, peak factor, shape factor, impulse factor and margin factor.
[0015] The power spectrum domain statistical features include power spectrum root mean square, power spectrum standard deviation and power spectrum center.
[0016] The specific aspects of 3) are:
[0017] After performing feature selection on multiple processed feature data sets using binary particle swarm optimization algorithm, a signal distortion sensitive feature set is obtained.
[0018] In the above 4), the training method of the LS-SVM classification model adopts the leave-one-out cross-validation method.
[0019] In the above 4), the kernel function of the LS-SVM classification model is a Gaussian radial basis function.
[0020] 2. A magnetostrictive displacement sensor detection device based on multiple features
[0021] A feature extraction module is used to extract features from the collected signal data of the magnetostrictive displacement sensor to obtain a number of magnetostrictive signal features, thereby generating a plurality of feature data sets;
[0022] A dimensionless processing module, used for performing dimensionless processing on the extracted magnetostrictive signal features to obtain processed features;
[0023] A feature selection module is used to perform feature selection on the processed features to generate signal distortion sensitive features;
[0024] A sensor detection module, used for training the LS-SVM classification model using a signal distortion sensitive feature set and storing a magnetostrictive displacement sensor detection model;
[0025] The detection result output module is used to extract the signal distortion sensitivity feature corresponding to the magnetostrictive displacement sensor signal to be detected and input it into the magnetostrictive displacement sensor detection model to obtain the detection result output by the model.
[0026] 3. A computer device
[0027] The device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the magnetostrictive displacement sensor detection method based on multiple features when executing the computer program.
[0028] 4. A computer-readable storage medium
[0029] The medium stores a computer program, and when the computer program is executed by a processor, the steps of the magnetostrictive displacement sensor detection method based on multiple features are implemented.
[0030] The beneficial effects of the present invention are:
[0031] Compared with traditional methods, the method proposed in the present invention has a higher recognition accuracy; at the same time, the present invention does not require a priori threshold setting to achieve automatic recognition of magnetostrictive displacement sensor signals, and has the advantages of extremely low computing power requirements and a small number of iterations. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The figure is a flow chart of the method of the present invention.
[0033] Figure 2 It is a framework diagram of the device and acquisition module of the present invention.
[0034] Figure 3 This is the control flow chart of the microcontroller.
[0035] Figure 4 It is a device framework diagram of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0037] The present invention proposes a magnetostrictive displacement sensor detection method based on multiple features, the method comprising the following steps:
[0038] 1) Collect signal data of magnetostrictive displacement sensor and extract several magnetostrictive signal features to obtain multiple feature data sets; magnetostrictive signal features include time domain statistical features and power spectrum domain statistical features. Time domain statistical features include skewness (SF1), kurtosis (SF2), peak-to-peak value (SF3), kurtosis factor (SF4), root mean square (SF5), standard deviation (SF6), peak factor (SF7), shape factor (SF8), pulse factor (SF9) and margin factor (SF10). 10 ). The statistical features in the power spectrum domain include the root mean square power spectrum (SF 11 ), power spectrum standard deviation (SF 12 ) and the power spectrum center (SF 13 ).
[0039] 2) After dimensionless processing of the magnetostrictive signal features in each feature data set, the corresponding processed feature data set is obtained; after dimensionless processing, different features are converted to the same scale range to eliminate the adverse effects of singular feature data. Specifically, the MSQI index (Magnetostrictive Signal Quality Index) is used, and the formula is as follows:
[0040]
[0041] In the formula, e represents the base of natural logarithm (taken as 2.72), F measure Represents the quality characteristics of the test signal (SF1~SF 13 ), F ref Represents the quality characteristics of the test signal
[0042] 3) After performing feature selection on multiple processed feature data sets using the binary particle swarm optimization algorithm (BPSO), a signal distortion sensitive feature set is obtained, that is, a sensitive feature subset most relevant to magnetostrictive signal distortion is selected, and redundant weakly correlated features are removed; let MSQI j ={sf1,sf2,…,sf n} is the feature set of the jth class, where n j is the number of samples of the jth class, each feature vector sf i (i=1,…,n j ) is γ. The goal of feature selection is to extract the original feature dataset MSQI j Select (ξ×n j ) feature subset, where ξ<γ. Using binary coding {0 1 01…001 γ} represents feature selection, where bits ‘0’ and ‘1’ respectively indicate whether the corresponding feature is selected, and the initial solution of the binary code is randomly given (1 or 0).
[0043] The fitness function of BPSO is the ratio of the intra-class distance to the inter-class distance. At the same time, the Mahalanobis distance, which is not affected by the dimension and can eliminate the interference of correlation between variables, is used as the metric. Let the intra-class Mahalanobis distance of the jth class be d j , which is defined as follows:
[0044]
[0045] In the formula, c j is the centroid vector of the jth class, p is the number of classes (two classes in this embodiment, normal signal and distorted signal), ψ is the feature set MSQI j The covariance matrix of , T represents the matrix transpose, so the average intra-class distance of all p classes is
[0046] Similarly, the inter-class distance dd refers to the distance from the centroid of class 1 to the centroid of class 2, which can be expressed as:
[0047]
[0048] Where ξ is the variance of the centroid vector c1.
[0049] Therefore, combining the above intra-class distance and inter-class distance, the fitness function defined in exponential form can be expressed as follows:
[0050]
[0051] Where τ is a positive number that is as small as possible to ensure that the denominator is not zero.
[0052] By evaluating the fitness function value of each particle in each iteration, the signal distortion sensitive feature set with the largest separable distribution is finally selected.
[0053] 4) The signal distortion sensitive feature set is divided into a training set and a test set. After the LS-SVM classification model is trained with the training set, the magnetostrictive displacement sensor detection model is obtained; wherein, the kernel function of the LS-SVM classification model is a Gaussian radial basis function. The training method of the LS-SVM classification model adopts the leave-one-out cross-validation method. The LS-SVM classification model is used for distortion recognition to achieve the purpose of automatically identifying low-quality signals.
[0054] 5) The test set is input into the magnetostrictive displacement sensor detection model, and the model outputs the corresponding detection results.
[0055] The present invention also proposes a magnetostrictive displacement sensor detection device based on multiple features, such as Figure 4 As shown, the device comprises:
[0056] A feature extraction module is used to extract features from the collected signal data of the magnetostrictive displacement sensor to obtain a number of magnetostrictive signal features, thereby generating a plurality of feature data sets;
[0057] A dimensionless processing module, used for performing dimensionless processing on the extracted magnetostrictive signal features to obtain processed features;
[0058] A feature selection module is used to perform feature selection on the processed features to generate signal distortion sensitive features;
[0059] A sensor detection module, used for training the LS-SVM classification model using a signal distortion sensitive feature set and storing a magnetostrictive displacement sensor detection model;
[0060] The detection result output module is used to extract the signal distortion sensitivity feature corresponding to the magnetostrictive displacement sensor signal to be detected and input it into the magnetostrictive displacement sensor detection model to obtain the detection result output by the model.
[0061] like Figure 2 and Figure 3 As shown in the figure, it is realized by AD module 1, microcontroller 2 and PC 3. Microcontroller 2 is used to collect signals through SPI external ADC module 1. DMA is used to transfer the collected data to the network interface for transmission to reduce the delay. Finally, the signal characteristic parameter calculation and evaluation are completed on the PC 3 software platform. The detection device design is as follows Figure 2 shown.
[0062] The main control program of microcontroller 2 realizes the functions of the entire signal acquisition module. On the one hand, it sends the sampling configuration parameters sent by the user end to ADC module 1 to control the acquisition. On the other hand, it reads the waveform data collected and stored by ADC and sends it to the user end for display through the network after preprocessing. The main control program flow of microcontroller 2 is as follows Figure 3 As shown, after the program is started, the device is initialized first, and then the default parameters are sent to ADC module 1 for initialization configuration. A variable is used to record the working mode. When its value is 1, it represents the parameter configuration mode, and when it is 2, it represents the acquisition mode for waveform reading.
[0063] The acquisition mode is responsible for executing waveform sampling, receiving waveforms at a certain repetition frequency, and sending an interrupt after completing the acquisition. When the main control receives the interrupt, it will configure and call DMA to upload the waveform data through the network. Finally, the interrupt is cleared, the SRAM is switched to connect with AD, and the next acquisition completion interrupt is waited for.
[0064] Configuration mode is a working mode for sending parameters to the configuration instructions received by the network. The int variable paraType is used to record the parameter type to be configured. Each bit of the binary representation of paraType represents a parameter of the acquisition configuration. By analyzing which bits of paraType are set to 1, we can get which parameters need to be updated. When the network receives a configuration instruction, it will be parsed by the network receiving thread, the corresponding position of paraType will be set to 1 and the working mode will be set to configuration mode. After the parameters are sent, the next cycle will enter the acquisition mode.
[0065] The front end of PC Terminal 3 adopts WPF architecture to realize the setting operation area related to parameters and waveforms, the spectrum analysis drawing area of the collected signal, and the display area of the signal characteristic value. The setting operation area is mainly used for acquisition settings, start and stop operations, signal saving and import, and measurement of the similarity between the waveform signal and the reference signal. The signal spectrum analysis area draws the waveform diagram of the signal, the waveform signal magnification diagram, the amplitude-frequency phase-frequency characteristics, and the power spectrum and power spectrum density. The signal characteristic value display area displays the value of the signal characteristic, and finally the MSQMI index used for signal evaluation.
[0066] The following modules are designed at the back end of the PC terminal 3 to support the functions described in the present invention: (1) Communication module: responsible for communicating with the lower computer and obtaining signals from the lower computer; (2) Waveform import module: responsible for obtaining the waveform read by the lower computer and importing it into the upper computer; (3) Analysis algorithm module: core module, responsible for scheduling different analysis algorithms; (4) Time-frequency analysis module: performing time-frequency domain analysis such as fast Fourier transform (FFT); (5) Statistical analysis module: performing statistical analysis of signals, such as calculating mean, variance, etc.; (6) Feature extraction module: extracting signal features for further analysis; (7) Result processing module: organizing the analysis results and preparing them for output in a format suitable for display, including data binding module and drawing module; (8) Storage module: persistently storing the verified results.
[0067] Finally, it should be noted that the above embodiments and explanations are only used to illustrate the technical solution of the present invention rather than to limit it. Those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope disclosed in the technical solution of the present invention, which should be included in the scope of protection of the claims of the present invention.
Claims
1. A magnetostrictive displacement sensor detection method based on multiple features, characterized in that: The following steps are involved: 1) collecting signal data of a magnetostrictive displacement sensor and extracting several magnetostrictive signal features thereof to obtain multiple feature data sets; 2) performing dimensionless processing on the magnetostrictive signal features in each feature data set to obtain a corresponding processed feature data set; 3) After performing feature selection on multiple processed feature data sets, a signal distortion sensitive feature set is obtained; 4) After training the LS-SVM classification model using the signal distortion sensitive feature set, the magnetostrictive displacement sensor detection model is obtained; 5) Calculate the signal distortion sensitivity characteristics corresponding to the magnetostrictive displacement sensor to be detected and input them into the magnetostrictive displacement sensor detection model, and the model outputs the corresponding detection results.
2. The magnetostrictive displacement sensor detection method based on multiple features according to claim 1 is characterized in that: The magnetostrictive signal characteristics include time domain statistical characteristics and power spectrum domain statistical characteristics.
3. The magnetostrictive displacement sensor detection method based on multiple features according to claim 2 is characterized in that: The time domain statistical characteristics include skewness, kurtosis, peak-to-peak value, kurtosis factor, root mean square, standard deviation, peak factor, shape factor, impulse factor and margin factor.
4. The magnetostrictive displacement sensor detection method based on multiple features according to claim 2 is characterized in that: The power spectrum domain statistical features include power spectrum root mean square, power spectrum standard deviation and power spectrum center.
5. The magnetostrictive displacement sensor detection method based on multiple features according to claim 1 is characterized in that: The specific aspects of 3) are: After performing feature selection on multiple processed feature data sets using binary particle swarm optimization algorithm, a signal distortion sensitive feature set is obtained.
6. The magnetostrictive displacement sensor detection method based on multiple features according to claim 1 is characterized in that: In the above 4), the training method of the LS-SVM classification model adopts the leave-one-out cross-validation method.
7. The magnetostrictive displacement sensor detection method based on multiple features according to claim 1 is characterized in that: In the above 4), the kernel function of the LS-SVM classification model is a Gaussian radial basis function.
8. A magnetostrictive displacement sensor detection device based on multiple features, characterized in that: include: A feature extraction module is used to extract features from the collected signal data of the magnetostrictive displacement sensor to obtain a number of magnetostrictive signal features, thereby generating a plurality of feature data sets; A dimensionless processing module, used for performing dimensionless processing on the extracted magnetostrictive signal features to obtain processed features; A feature selection module is used to perform feature selection on the processed features to generate signal distortion sensitive features; A sensor detection module, used for training the LS-SVM classification model using a signal distortion sensitive feature set and storing a magnetostrictive displacement sensor detection model; The detection result output module is used to extract the signal distortion sensitivity feature corresponding to the magnetostrictive displacement sensor signal to be detected and input it into the magnetostrictive displacement sensor detection model to obtain the detection result output by the model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.