A fault diagnosis and analysis method and system for a vehicle-mounted brushless DC motor
By mapping the three-phase voltage and current data of the on-board brushless DC motor to the RGB color space, RGB images are generated, and image processing and analysis is used to use convolutional neural networks, the complex and long cycle problems of traditional fault diagnosis methods are solved, and efficient and intuitive fault diagnosis is achieved.
Patent Information
- Application Number
- CN202411828965.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-08
AI Technical Summary
The traditional fault diagnosis method of on-board brushless DC motors is complex and has a long cycle, making it difficult to achieve intuitive and efficient fault detection.
By mapping the three-phase voltage and current data of the motor to the RGB color space, RGB images are generated, and image processing and analysis are used for image processing and analysis by using convolutional neural networks, fault diagnosis is achieved.
This method converts the multi-dimensional electrical parameter information of the motor into color images, and uses image processing technology to extract rich feature information, which improves the accuracy and efficiency of fault diagnosis and reduces the threshold for professional knowledge.
Smart Images

Figure CN119780700A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor fault diagnosis, and in particular to fault detection and diagnosis of a vehicle-mounted brushless DC motor (BLDC). Specifically, the present invention relates to a technology for mapping the three-phase data of a motor into an RGB color space, and processing and analyzing the voltage and current signals of the brushless DC motor. Background Art
[0002] Brushless DC motors (BLDC) are widely used in various industrial equipment and power tools. Their performance stability directly affects the operating efficiency and safety of the equipment. Traditional fault diagnosis methods mainly rely on direct measurement and analysis of electrical parameters, such as voltage, current, and temperature. However, these methods often require complex algorithms and a large amount of data processing, resulting in a long fault diagnosis cycle and lack of intuitiveness. Summary of the invention
[0003] In recent years, image processing technology has been widely used in various fields, including fault diagnosis of industrial equipment. As a standard color representation method, RGB color mode can obtain rich color information by analyzing the changes in the three color channels of red, green and blue. Therefore, mapping the electrical parameters of the motor into the RGB color channel for processing may provide a new idea and method for motor fault diagnosis.
[0004] The object of the present invention is to provide a brushless DC motor fault diagnosis method based on image fusion, comprising: obtaining voltage and current data of the brushless DC motor, converting the voltage and current data into RGB images, extracting image feature information, constructing an RGB image data set, and dividing the data set into a training set and a verification set;
[0005] Build a convolutional neural network (CNN) classification model;
[0006] The convolutional neural network model is trained through the training set, and the trained convolutional neural network model is tested and optimized through the test set;
[0007] The real-time three-phase voltage and current data of the motor are collected and converted into real-time RGB images, which are diagnosed through the trained convolutional neural network model. If a fault is detected, an alarm signal is issued.
[0008] Furthermore, the construction of the RGB image data set also includes: filtering and normalizing the collected voltage and current data, performing bit stitching, converting to RGB values, sorting the RGB values into pixels of image data by time, forming an image in RGB mode and storing it to form an image data set.
[0009] Furthermore, the construction of the RGB image data set also includes: preprocessing the formed image, using the Canny edge detection algorithm to extract edge features in the image; performing texture analysis on the image to extract texture features of the image; performing color histogram analysis on the image to extract color histogram features of the image; fusing the texture features and color histogram features of the image to form a feature vector of the image and classifying faults based on the feature vector.
[0010] Furthermore, the texture features include contrast, correlation, energy and homogeneity; the color histogram features include: mean, standard deviation and peak value of RGB channels.
[0011] Furthermore, the fault classification includes: stator or rotor imbalance, electromagnetic interference, bearing failure, and electrical failure including short circuit and overload.
[0012] Furthermore, the architecture of the convolutional neural network CNN includes 3-5 convolutional layers, the convolution kernel size in the convolution layer is 3x3 or 5x5, and the ReLU activation function is used after each convolution layer; the pooling layer uses maximum pooling, the number of pooling layers is selected as 2-3 layers, the pooling kernel size is 2x2, and the pooling step is 2; 1-2 fully connected layers are selected; the output layer is a fully connected layer, using the Softmax activation function to output the probability distribution of each fault type, and the number of output neurons is the same as the number of fault classification categories.
[0013] Furthermore, the training convolutional neural network model includes: using a training set to train the convolutional neural network, adjusting the weight parameters of the model, and minimizing the classification error during training through an entropy loss function and a stochastic gradient function optimization algorithm; using a test set to evaluate the trained convolutional neural network, and evaluating the trained convolutional neural network by calculating the accuracy, precision, recall and F1 score of the model during the evaluation, and evaluating the classification effect of various faults through a confusion matrix analysis model during the evaluation, and optimizing the model according to the evaluation results.
[0014] Furthermore, dividing the data set into a training set and a validation set also includes labeling the images according to different fault types to construct a training set and a test set; standardizing the images so that they have the same size and pixel value range, and performing data augmentation operations, including rotation, scaling, translation, and flipping, to increase the diversity of training data and the robustness of the model.
[0015] The present invention also discloses a fault diagnosis and analysis system for a brushless DC motor using any of the above methods, comprising a data acquisition module, a data conversion module, an RGB image generation module, an image processing and analysis module, and a fault diagnosis result output module;
[0016] The data acquisition module is connected to the data conversion module and is used to collect electrical parameter data of the brushless DC motor in real time, convert analog signals of voltage and current data into digital signals and send them to the data conversion module. The data acquisition module is also used to collect real-time on-board cable information of the vehicle to provide detection data for the model;
[0017] The data conversion module is connected to the RGB image generation module and is used to encode the received voltage and current digital signals into RGB image data;
[0018] The RGB image generation module is connected to the image processing and analysis module, and is used to generate RGB images and apply image processing algorithms for analysis, provide motor state monitoring and fault diagnosis results, and send the motor state monitoring and fault diagnosis results to the image processing and analysis module;
[0019] The image processing and analysis module is connected to the fault diagnosis result output module and is used to process and analyze the generated RGB image to achieve fault diagnosis;
[0020] The fault diagnosis result output module is used to output the diagnosis result and to give an alarm or display.
[0021] Furthermore, the voltage and current data include the voltage and current U_A, U_B, U_C and I_A, I_B, I_C of each phase of the brushless DC motor; the sampling rate of the signal acquisition system is set to at least 2-10 times the frequency of the motor operating signal, and the resolution can be 12 bits or 16 bits.
[0022] Compared with the prior art, the above technical solution has the following beneficial effects:
[0023] 1. Map the three-phase voltage (U_A, U_B, U_C) and current (I_A, I_B, I_C) of the motor to the red, green, and blue channels in the RGB color mode. The corresponding RGB values are obtained by splicing the low-bit data of the voltage and current signals into the RGB channels. This method can compress the multi-dimensional electrical parameter information of the motor and convert it into information in a color image.
[0024] 2. Analyze the generated RGB images using image processing techniques that can extract rich feature information when processing color images. By converting electrical parameters into image data, existing image processing algorithms can be used to analyze the motor status. This method can utilize mature image processing tools and techniques to improve the accuracy and efficiency of diagnosis.
[0025] 3. After converting the motor electrical parameters into image data, existing image processing tools and algorithms (such as edge detection, feature extraction, etc.) can be applied to analyze the motor status. This method takes advantage of the maturity and efficiency of image processing technology and can quickly extract the characteristic information of motor faults.
[0026] 4. Existing motor fault diagnosis methods usually require engineers to have a deep background in motor theory and signal processing. By converting motor electrical parameters into RGB images and using image processing technology, the present invention reduces the threshold of professional knowledge and makes the diagnosis process more intuitive and easy to understand. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A structural block diagram of an embodiment of a vehicle-mounted brushless DC motor fault diagnosis and analysis system of the present invention is shown;
[0028] Figure 2 A flow chart showing an embodiment of a method for diagnosing a fault of a vehicle-mounted brushless DC motor according to the present invention is shown;
[0029] Figure 3 A convolutional neural network diagram of an embodiment of the present invention is shown;
[0030] Figure 4 A diagram showing an upper computer interface for application of a vehicle-mounted brushless DC motor fault diagnosis method of the present invention. DETAILED DESCRIPTION
[0031] The advantages of the present invention are further described below in conjunction with the accompanying drawings and specific embodiments.
[0032] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0033] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms "a", "the", and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0034] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0035] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "connection" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0036] In the following description, suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0037] like Figure 1 As shown, a fault diagnosis and analysis system for a vehicle-mounted brushless DC motor includes a data acquisition module, a data conversion module, an RGB image generation module, an image processing and analysis module, and a fault diagnosis result output module.
[0038] The data acquisition module is connected to the data conversion module and is used to collect electrical parameter data of the brushless DC motor in real time. The electrical parameter data includes voltage data (U_A, U_B, Y_C) and current data (I_A, I_B, I_C). The analog signals of the voltage and current data are converted into digital signals and sent to the data conversion module. The data acquisition module is also used to collect the vehicle's real-time on-board cable information to provide detection data for the model.
[0039] The data conversion module is connected to the RGB image generation module, and is used to encode the received voltage and current digital signals into RGB image data, wherein the R channel, G channel and B channel correspond to the data of phase A, phase B and phase C respectively, and convert the electrical parameter data into data in the RGB color mode and send it to the RGB image generation module.
[0040] The RGB image generation module is connected to the image processing and analysis module, and is used to generate RGB images and apply image processing algorithms for analysis, provide motor state monitoring and fault diagnosis results, and send the motor state monitoring and fault diagnosis results to the image processing and analysis module.
[0041] The image processing and analysis module is connected to the fault diagnosis result output module and is used to process and analyze the generated RGB image to achieve fault diagnosis.
[0042] The fault diagnosis result output module is used to output the diagnosis result and to give an alarm or display.
[0043] refer to Figure 2 The present invention also provides a method for implementing a brushless DC motor fault diagnosis and analysis system based on the brushless DC motor fault diagnosis and analysis system, and the specific steps include:
[0044] S1, obtain the voltage and current data of the brushless DC motor, convert the voltage and current data into RGB images, and construct the RGB image training set and test set;
[0045] S2, build a convolutional neural network model;
[0046] S3, training the convolutional neural network model through the training set, and testing the trained convolutional neural network model through the test set;
[0047] S4. Collect the real-time three-phase voltage and current signals of the motor and convert them into real-time RGB images, and perform diagnosis through the trained convolutional neural network model.
[0048] Furthermore, the S1 further includes:
[0049] S11, collecting analog signals of voltage and current data of the motor through a data acquisition module, and converting the analog signals output by the sensor into digital signals;
[0050] Specifically, voltage sensors and current sensors are installed on the three phases A, B, and C of the brushless DC motor to collect three-phase voltage (U_A, U_B, U_C) and three-phase current (I_A, I_B, I_C) signals in real time. Ensure that the sensor is firmly installed and the signal acquisition is accurate. The analog signal output by the sensor is converted into a digital signal through a signal acquisition system (such as a data acquisition card). Ensure that the signal acquisition system has sufficient sampling rate and resolution to meet the requirements of fault diagnosis. Further, the sampling rate requirement: the sampling rate of signal acquisition needs to be determined according to the frequency range of the signal. In order to capture high-frequency signals in the operation of the motor, the sampling rate should be at least 2-10 times the signal frequency. For the case where the operating frequency of the brushless DC motor is up to 10kHz, the sampling rate should reach more than 100kHz. Resolution requirements: The resolution determines the fineness of the sampled signal, and a resolution of 12 or 16 bits is an ideal choice. For example, a 16-bit resolution can divide the signal into 65536 different levels, so that small voltage and current changes can also be accurately captured. The collected digital signals are transmitted to the data processing system for subsequent processing.
[0051] S12, filtering and normalizing the voltage and current data;
[0052] Signal filtering: Filter the collected voltage and current signals to remove noise and interference to ensure signal purity. Common filtering methods include low-pass filtering, high-pass filtering and band-pass filtering.
[0053] Normalize the voltage and current signals and convert the signal values to the range of 0-255 to meet the requirements of RGB images. Specifically, the Min-Max normalization algorithm is used to normalize the voltage and current data. In order to convert the voltage and current signals into RGB images, the signal values need to be normalized to the range of 0-255. In an image in RGB888 format, the value range of each channel is 0 to 255, indicating an 8-bit color depth.
[0054] Min-Max normalization formula:
[0055]
[0056] Among them, NormalizedValue is the normalized data, SignalValue is the data to be normalized, MinValue is the minimum value in the input data set, and MaxValue is the maximum value in the input data set.
[0057] Determine the signal range: Determine the minimum value (Min Value) and maximum value (Max Value) of the signal by statistically analyzing the collected voltage and current signals.
[0058] Normalization: According to the above formula (1), each signal value is normalized to the range of 0-255 to facilitate subsequent conversion to RGB image format.
[0059] Optionally, Z-Score normalization or nonlinear normalization may also be used.
[0060] S13, performing bit stitching on the filtered and normalized voltage and current data through an RGB image generation module and converting them into RGB values.
[0061] The normalized voltage and current signals are converted into RGB image data according to the following bit splicing rules: red channel (R): R[7:0] = {UA[3:0], IA[3:0]}; green channel (G): G[7:0] = {UB[3:0], IB[3:0]}; blue channel (B): B[7:0] = {UC[3:0], IC[3:0]}.
[0062] Data splicing: Splice the lower 4 bits of the voltage and current signals to generate an 8-bit RGB value.
[0063] For example, for the red channel, the lower 4 bits of the voltage U_A and the lower 4 bits of the current I_A are concatenated to generate an 8-bit value for the red channel.
[0064] Specific splicing steps:
[0065] 1. Extract the lower 4 bits of data
[0066] Assuming that each voltage and current signal is an 8-bit integer (ranging from 0 to 255), extract the lower 4 bits of these signals. For example, extract the lower 4 bits of the voltage signal U_A and the current signal I_A: The lower 4 bits of the voltage signal U_A: U_A[3:0] The lower 4 bits of the current signal I_A: I_A[3:0].
[0067] 2. Bit concatenation to generate 8-bit RGB values
[0068] Using bit stitching technology, the lower 4 bits of the voltage signal and the current signal are combined to generate 8-bit RGB channel values. The specific formula is as follows: Red channel (R): R[7:0] = (U_A[3:0] << 4) | (I_A[3:0]); Green channel (G): G[7:0] = (U_B[3:0] << 4) | (I_B[3:0]); Blue channel (B): B[7:0] = (U_C[3:0] << 4) | (I_C[3:0]).
[0069] U_A[3:0]<<4: Shift the lower 4 bits of the voltage signal left by 4 bits so that it occupies the upper 4 bits of the 8-bit integer.
[0070] |(I_A[3:0]): Use the bitwise OR (|) operation to splice the lower 4 bits of the current signal to the lower 4 bits of the voltage signal. R is the red channel, G is the green channel, B is the blue channel, [n:m] is to take the data from the mth bit to the nth bit, << indicates a bitwise left shift operation, and | indicates a bitwise OR operation.
[0071] 3. Map the spliced data to an RGB image
[0072] The generated 8-bit red, green, and blue channel values are assigned to the pixels of the RGB image respectively. The color value (R, G, B) of each pixel corresponds to the voltage and current signals of the motor at a certain moment.
[0073] 4. Repeat processing of multiple sampling points
[0074] For each sampling point, the above operation is repeated to convert all three-phase voltage and current signals into corresponding RGB pixel values, and images are generated frame by frame.
[0075] S14, sorting the RGB values into pixels of image data according to time, forming an image in RGB mode and storing it;
[0076] Specifically, the generated RGB values are stored as image data to construct an RGB image. According to the time series of the acquired signal, each set of RGB values corresponds to a pixel point to generate a color image. Select a commonly used image format (such as PNG, JPEG) to store the generated RGB image for subsequent processing and analysis.
[0077] S15, preprocessing the generated image;
[0078] Read the generated RGB image. Convert the image to grayscale. Use Gaussian filtering to smooth the grayscale image and remove noise. Perform histogram equalization on the smoothed image to improve the contrast of the image.
[0079] S16, extracting edge features in the image through edge detection;
[0080] Specifically, the Canny edge detection algorithm is used to extract edge features in the image. Edge features can reflect changes in the motor's operating state, such as mechanical wear and vibration. Edge features usually refer to the following parameters:
[0081] Gradient Magnitude: Indicates the strength of the change in pixel values in an image. Strong gradient changes usually correspond to edge features.
[0082] Gradient direction: describes the directional information of gradient changes, which helps to identify the directionality of edges.
[0083] Edge contour: By further processing the gradient magnitude and direction, edge contours are extracted to identify and locate the boundaries of structures in the image.
[0084] These features can be used to analyze changes in the motor's operating status and perform classification and diagnosis through machine learning algorithms.
[0085] Furthermore, the specific steps of the Canny algorithm are as follows:
[0086] S161, performing image smoothing processing on the image;
[0087] Image smoothing (Gaussian Smoothing): Gaussian filtering is performed on the original image to reduce the interference of noise on edge detection. The Gaussian filter blurs the image through convolution operation, eliminating small noise but does not affect larger edge structures.
[0088] formula:
[0089] Where G(x,y) is a two-dimensional Gaussian function and σ is the standard deviation, which controls the blurriness of the filter.
[0090] S162, calculating the gradient magnitude and direction of the image;
[0091] Calculate the gradient magnitude and direction: Use the Sobel operator to calculate the gradient magnitude and gradient direction of the image. The Sobel operator obtains the gradient value by performing differential operations on the image in the horizontal and vertical directions.
[0092] Gradient Amplitude:
[0093] Among them, Gx and Gy are the gradients in the horizontal and vertical directions respectively.
[0094] Gradient direction:
[0095] S163, suppressing non-maximum values of the image by analyzing the gradient direction of each pixel, retaining edge pixels at local maximum values, and suppressing non-edge pixels.
[0096] Non-Maximum Suppression: Perform non-maximum suppression on the gradient magnitude map, retain edge pixels at local maxima, and suppress non-edge pixels. By analyzing the gradient direction of each pixel, only the maximum value pixels in the gradient direction are retained, and non-edge pixels are removed.
[0097] S164, performing double threshold detection on the image;
[0098] Specifically, a high threshold and a low threshold are set. The gradient amplitude is binarized, and pixels above the high threshold are judged as strong edge pixels, pixels below the low threshold are judged as non-edge pixels, and pixels above the low threshold and below the high threshold are judged as weak edges; the weak edge is connected to the strong edge pixel, and if the weak edge pixel is connected to the strong edge, the weak edge pixel is retained as the edge, otherwise it is suppressed; the edge image is output to obtain a binary image, where white pixels b represent edges and black pixels represent non-edge areas. White pixels are extracted edge features for further fault diagnosis.
[0099] S17, performing texture analysis on the image to extract texture features of the image;
[0100] By calculating the gray level co-occurrence matrix (GLCM), the texture features of the image are analyzed, including contrast, correlation, energy, and homogeneity. These texture features can be used to detect abnormalities in the motor's operating state, such as imbalance, electromagnetic interference, etc.
[0101] Specifically, the steps of calculating the gray level co-occurrence matrix include:
[0102] (1) Grayscale image conversion: grayscale the RGB image to obtain a grayscale image. Grayscale conversion can be completed using the following formula:
[0103] Gray=0.299×R+0.587×G+0.114×B (5)
[0104] Where R, G, B are the red, green, and blue channels of the RGB image respectively.
[0105] (2) Calculate the gray-level co-occurrence matrix (GLCM): Select a certain pixel offset distance and direction (e.g. horizontal, vertical, diagonal, etc.) and calculate the gray-level co-occurrence matrix. Each gray-level co-occurrence matrix describes the gray-level relationship between two pixels in the image.
[0106] Specifically: set the number of gray levels N (for example, 8 or 16 levels), and quantize the image to this level.
[0107] For each pair of pixels, calculate the combination between their gray values and fill the result in the matrix. For example, if the offset is 1 pixel and the direction is horizontal, the number of occurrences of each gray value pair (i, j) will be recorded in the corresponding position GLCM (i, j) of the matrix.
[0108] Extract texture features: Extract several commonly used texture features from GLCM, such as:
[0109] Contrast: A measure of the difference in pixel values in an image, indicating the roughness of the image texture.
[0110]
[0111] Correlation: Measures the correlation degree of gray values in an image and reflects the smoothness of the image.
[0112]
[0113] Energy: It measures the uniformity of the gray-level co-occurrence matrix elements and represents the sparsity of the image texture.
[0114]
[0115] Homogeneity: It measures the similarity of local areas of an image and indicates the smoothness of the image.
[0116]
[0117] These features can be used to detect anomalies in motor operation, such as mechanical imbalance or texture changes caused by electromagnetic interference.
[0118] S18, performing color histogram analysis on the image to extract color distribution characteristics of the image;
[0119] Calculate the color histogram of the RGB image and analyze the changes in color distribution. The color histogram can reflect the changes in voltage and current during the operation of the motor.
[0120] Specific steps:
[0121] 1. Calculate histograms by channel: Calculate histograms for each color channel (red, green, blue) of the RGB image. The histogram of each channel represents the distribution of the pixel values of that color channel in the image. Divide the pixel values of each channel into several "bins", for example, divide the pixel value range of 0-255 into 256 bins. Count the number of times the pixel value appears in each bin to form the histogram of the channel.
[0122] 2. Calculate the features of the color histogram
[0123] By analyzing the color histogram, the following features can be extracted:
[0124] Histogram mean: Calculates the center position of the histogram, reflecting the concentration of color distribution.
[0125] Histogram standard deviation: measures the degree of dispersion of color distribution.
[0126] Peak Value of the histogram: It represents the most common color value in the image.
[0127] These features can help detect changes in the voltage and current signals during motor operation. For example, changes in the histogram may indicate changes in motor load or power quality issues.
[0128] 3. Comparative analysis: Compare the color histograms under different operating conditions and analyze their differences. By comparing the color histogram features under normal and fault conditions, abnormalities in the motor's operating state can be discovered.
[0129] S19, fusing the texture features and color histogram features of the image to form a feature vector of the image and classifying the feature vector using a pre-trained machine learning model to determine whether the motor has a fault and the type of fault, and if a fault is detected, sending an alarm signal;
[0130] The texture features extracted from S17 include: contrast, correlation, energy, homogeneity, etc. (usually 4 dimensions); the color histogram features extracted from S18 include: mean, standard deviation, peak value, etc. of RGB channels (3 dimensions for each channel, 9 dimensions in total). The texture features and color histogram features are directly concatenated together. Assuming that the texture features have 4 dimensions and the color histogram features have 9 dimensions, the final feature vector will be a 13-dimensional vector.
[0131] For example: The final feature vector form can be expressed as:
[0132] Feature Vector=[Contrast,Correlation,Energy,Homogeneity,RGB MeanValues,RGB Std Deviation,RGB Peak Values]
[0133] This spliced feature vector combines texture and color information and can more comprehensively describe the motor operating status.
[0134] After feature fusion, the feature vectors are normalized so that each feature value is within the same scale range (for example, through Z-score normalization). This helps improve the performance of the machine learning model and prevents certain features from having too much or too little impact on the model. Z-score normalization formula:
[0135]
[0136] Among them, X is the eigenvalue, μ is the mean of the feature, and σ is the standard deviation of the feature.
[0137] Convolutional Neural Network (CNN) performs well in image processing and analysis, and is particularly suitable for RGB image classification tasks. By training the CNN model, automatic and high-precision fault diagnosis of brushless DC motors can be achieved.
[0138] Common types of failures include:
[0139] Stator or rotor imbalance: caused by mechanical wear or manufacturing defects, manifested as a significant change in texture characteristics (such as increased contrast).
[0140] Electromagnetic interference: caused by the influence of external electromagnetic environment, manifested as abnormal distribution of color histogram.
[0141] Electrical failure (e.g. short circuit, overload): Failure of the motor’s internal electrical components may result in a combination of changes in the color histogram and texture features.
[0142] Bearing failure: causes unstable motor operation, manifested as abnormal edge features and texture features
[0143] Machine learning models can be trained and optimized according to actual application needs.
[0144] The running status of the motor is judged based on the classification results, and if a fault is detected, an alarm signal is issued.
[0145] The alarm signal can be realized through hardware devices (such as indicator lights, sound alarms), or displayed through the software interface. The fault type and specific diagnosis results are displayed on the software interface to facilitate engineers to handle faults and perform maintenance.
[0146] See also Figure 3 The flowchart of the convolutional neural network and its training and optimization of the present invention is as follows:
[0147] 1. Data preparation: data set collection and annotation
[0148] A large number of RGB images generated by brushless DC motors in different operating states (including normal state and various fault states) are collected.
[0149] The images are labeled according to different fault types, and training and test sets are constructed.
[0150] Data preprocessing: Standardize the images to have the same size and pixel value range.
[0151] Perform data enhancement operations such as rotation, scaling, translation, flipping, etc. to increase the diversity of training data and the robustness of the model.
[0152] The details are as follows:
[0153] Dataset collection and annotation
[0154] 1. RGB image generation
[0155] ·Use the collected three-phase voltage (U_A, U_B, U_C) and current (I_A, I_B, I_C) signals of the brushless DC motor and convert them into RGB images through bit stitching. The generation rule of each channel (R, G, B) is as mentioned above: R[7:0]={U_A[3:0], I_A[3:0]}, G[7:0]={U_B[3:0], I_B[3:0]}, B[7:0]={U_C[3:0], I_C[3:0]}. The generated RGB image can reflect the state of the motor and has corresponding texture features and color features.
[0156] Data size:
[0157] Normal operation: Collect 10,000 images.
[0158] Fault conditions: For each major fault (e.g., short circuit, overload, bearing failure, etc.), 5,000 images were collected.
[0159] Assuming there are 5 major faults, the total data size is about 35,000 images.
[0160] Data annotation:
[0161] Each image needs to be labeled according to the corresponding operating status or fault type. For example, the labels can be divided into "normal", "short circuit fault", "overload fault", "bearing fault", etc.
[0162] 2. Construct training set and test set
[0163] 1) The dataset is divided into a training set and a test set with a ratio of 80:20. Specifically,
[0164] Training set: contains 28,000 images (normal state and various fault states).
[0165] Test set: contains 7,000 images and is used to evaluate model performance.
[0166] 2) Data Augmentation
[0167] Expand the size of the training set through data augmentation techniques. For example, increase the diversity of the data through rotation, scaling, flipping, etc.
[0168] After data augmentation, the number of images in the training set can be expanded to 80,000-140,000.
[0169] 3) Feature extraction: refer to S17 and S18 above
[0170] 4) Feature fusion and classification: Refer to S19 above. The texture features (4 dimensions) are fused with the color histogram features (768 dimensions) to form a 772-dimensional feature vector. The extracted texture features are concatenated with the color histogram features to generate a unified feature vector for input into the classification model.
[0171] Fault classification: Use the pre-trained CNN model to classify the fused feature vector. The input feature vector is forward propagated through the CNN model to obtain the final classification result. The model output is the probability value of each category, and the category corresponding to the maximum probability is taken as the final diagnosis result.
[0172] 3. Model selection and construction
[0173] The convolutional neural network consists of an input layer, multiple convolutional layers, a pooling layer, a fully connected layer, and an output layer. The convolutional layer extracts local features of the image through convolution operations, the pooling layer reduces the dimension of the feature map and enhances the robustness of the features, the fully connected layer synthesizes the extracted features, and the output layer performs classification. Convolutional neural network (CNN) is the mainstream model in image classification tasks, and is particularly suitable for extracting features of brushless DC motor fault images.
[0174] Input layer: accepts preprocessed RGB images.
[0175] Convolution layer: Use multiple convolution kernels to extract image features such as edges and textures.
[0176] Pooling layer: downsamples the feature map output by the convolutional layer to reduce the amount of calculation.
[0177] Fully connected layer: Flattens the feature map output by the pooling layer into a one-dimensional vector for feature synthesis.
[0178] Output layer: Use the Softmax activation function to output the probability distribution of fault types.
[0179] Specifically:
[0180] Input Layer
[0181] Accepts a normalized RGB image. Assume that the size of the input image is 64x64x3, where 64x64 is the spatial dimension and 3 represents the three RGB channels.
[0182] Convolutional Layer
[0183] Number of convolutional layers: Common CNN structures usually include 3-5 convolutional layers. The more layers there are, the stronger the model's expressive power will be, but it will also increase the amount of computation and the difficulty of training. The specific design should be selected based on the data scale and computing resources.
[0184] Number of convolution kernels: Each convolution layer uses multiple convolution kernels (filters) to extract different image features.
[0185] The number of convolution kernels in the first layer: usually starts with 32 or 64 convolution kernels. The more convolution kernels there are, the more image features can be captured. The number of convolution kernels in subsequent convolution layers: increases layer by layer, and the common designs are: 64, 128, 256 convolution kernels.
[0186] Convolution kernel size: Generally, 3x3 or 5x5 convolution kernels are selected. These two sizes can balance the detail of feature extraction and computational complexity.
[0187] Activation function: ReLU (Rectified Linear Unit) activation function is used after each convolution layer to enhance nonlinear expression capabilities.
[0188] Pooling Layer
[0189] Number of pooling layers: Usually one pooling layer is added after every two convolutional layers, for a total of 2-3 pooling layers.
[0190] Pooling method: Max Pooling is commonly used, with a pooling kernel size of 2x2 and a step size of 2, which is used to halve the size of the feature map, thereby reducing the amount of calculation and enhancing the robustness of the feature.
[0191] Fully connected layer
[0192] After convolution and pooling operations, the output feature map is flattened into a one-dimensional vector (flatten).
[0193] Number of fully connected layers: A common design is 1-2 fully connected layers. The number of neurons in the first fully connected layer is usually 512 or 1024. If a second fully connected layer is used, the number of neurons can be halved, such as 256 or 512.
[0194] Output Layer
[0195] The final output layer is a fully connected layer that uses the Softmax activation function to output the probability distribution of each fault type.
[0196] The number of output neurons is the same as the number of classification categories. Assuming there are 5 states (normal, short circuit, overload, bearing failure, etc.), the output layer has 5 neurons.
[0197] Furthermore, if Figure 3 As shown, the specific steps of S3 include:
[0198] S31. Use the training set to train the convolutional neural network and adjust the weight parameters of the model;
[0199] Optionally, the classification error is minimized during training by using an entropy loss function and a stochastic gradient function optimization algorithm.
[0200] S32. Use the test set to evaluate the trained convolutional neural network.
[0201] Optionally, the trained convolutional neural network is evaluated in the evaluation by calculating the accuracy, precision, recall, and F1 score of the model.
[0202] The accuracy rate is the proportion of the total samples of the sample station that are correctly predicted;
[0203] The precision rate is the proportion of samples predicted correctly to samples predicted positively and the proportion of samples predicted correctly to samples predicted positively;
[0204] The recall rate is the proportion of correctly predicted samples among the samples that are actually positive;
[0205] The F1 score is the harmonic mean of precision and recall.
[0206] The accuracy is calculated as follows:
[0207] The calculation formula for accuracy is:
[0208] The calculation formula for recall is:
[0209] The calculation formula of F1 score is:
[0210] Where TP is the number of true positive samples, TN is the number of true negative samples, FP is the number of false positive samples, and FN is the number of false negative samples. Optionally, in the evaluation, the classification effect of each type of fault is evaluated by a confusion matrix analysis model.
[0211] S33, judging whether the number of iterations has been reached;
[0212] If the number of iterations is reached, the training is terminated and the model parameters are saved; if the number of iterations is not reached, S31 is continued to train the convolutional neural network model.
[0213] Furthermore, the specific steps of S32 include:
[0214] S321. Input each image of the test set into the trained convolutional neural network model and calculate the output category probability of the model.
[0215] S322, record the prediction results of the model for each category and generate a confusion matrix, including the values of TP, TN, FP, and FN;
[0216] S323, calculating the accuracy, precision, recall and F1 score according to the confusion matrix;
[0217] S324. Judge the overall performance of the model based on the evaluation indicators. If the indicators are not ideal, you can further adjust the model's hyperparameters, or optimize the training data and model structure.
[0218] The three-phase voltage and current signals of the motor collected in real time are converted into RGB images and input into the trained CNN model for classification. The operating status and fault type of the motor are judged according to the probability distribution of the fault type output by the model.
[0219] like Figure 4 Shown is the host computer interface of the brushless DC motor fault diagnosis and analysis system.
[0220] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, disk, CD-ROM, etc.
[0221] It should be noted that the embodiments of the present invention can be implemented by hardware, software or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in processor control codes, such as such codes provided on a programmable memory or a data carrier such as an optical or electronic signal carrier.
[0222] In addition, although the operation of the method of the present invention is described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps described in the flow chart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution. It should also be noted that the features and functions of two or more devices according to the present invention can be embodied in one device. On the contrary, the features and functions of a device described above can be further divided into being embodied by multiple devices.
[0223] It should be noted that the embodiments of the present invention have better practicability and do not impose any form of limitation on the present invention. Any technician familiar with the field may use the technical content disclosed above to change or modify it into an equivalent effective embodiment. However, any modification or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A brushless DC motor fault diagnosis method, characterized in that: include: Obtain the voltage and current data of the brushless DC motor, convert the voltage and current data into RGB images, extract image feature information, construct an RGB image dataset, and divide the dataset into a training set and a validation set; Build a convolutional neural network (CNN) classification model; The convolutional neural network model is trained through the training set, and the trained convolutional neural network model is tested and optimized through the test set; The real-time three-phase voltage and current data of the motor are collected and converted into real-time RGB images, which are diagnosed through the trained convolutional neural network model. If a fault is detected, an alarm signal is issued.
2. The fault diagnosis method according to claim 1, characterized in that: The construction of the RGB image data set also includes: filtering and normalizing the collected voltage and current data, performing bit stitching, converting to RGB values, sorting the RGB values into pixels of image data by time, forming an RGB mode image and storing it to form an image data set.
3. The fault diagnosis method according to claim 2, characterized in that: The construction of the RGB image data set also includes: preprocessing the formed image, using the Canny edge detection algorithm to extract edge features in the image; performing texture analysis on the image to extract texture features of the image; performing color histogram analysis on the image to extract color histogram features of the image; fusing the texture features and color histogram features of the image to form a feature vector of the image and classifying the fault based on the feature vector.
4. The fault diagnosis method according to claim 3, characterized in that: The texture features include contrast, correlation, energy and homogeneity; the color histogram features include: mean, standard deviation and peak value of RGB channels.
5. The fault diagnosis method according to claim 1, characterized in that: The fault classification includes: stator or rotor imbalance, electromagnetic interference, bearing failure, and electrical failure including short circuit and overload.
6. The fault diagnosis method according to claim 1, characterized in that: The architecture of the convolutional neural network (CNN) consists of 3-5 convolutional layers, with convolution kernels of 3x3 or 5x5, and a ReLU activation function after each convolutional layer. The pooling layers all use maximum pooling, with 2-3 pooling layers, a pooling kernel of 2x2, and a pooling step of 2. 1-2 fully connected layers are selected. The output layer is a fully connected layer that uses the Softmax activation function to output the probability distribution of each fault type. The number of output neurons is the same as the number of fault classification categories.
7. The fault diagnosis method according to claim 1, characterized in that: The training convolutional neural network model includes: using a training set to train the convolutional neural network, adjusting the weight parameters of the model, and minimizing the classification error during training through an entropy loss function and a stochastic gradient function optimization algorithm; using a test set to evaluate the trained convolutional neural network, and evaluating the trained convolutional neural network by calculating the accuracy, precision, recall rate and F1 score of the model during the evaluation, and evaluating the classification effect of various faults through a confusion matrix analysis model during the evaluation, and optimizing the model according to the evaluation results.
8. The fault diagnosis method according to claim 1, characterized in that: Dividing the data set into training and validation sets also includes labeling the images according to different fault types to construct training and test sets; standardizing the images so that they have the same size and pixel value range, and performing data augmentation operations, including rotation, scaling, translation, and flipping, to increase the diversity of training data and the robustness of the model.
9. A brushless DC motor fault diagnosis and analysis system using the method according to any one of claims 1 to 8, characterized in that: It includes data acquisition module, data conversion module, RGB image generation module, image processing and analysis module and fault diagnosis result output module; The data acquisition module is connected to the data conversion module and is used to collect electrical parameter data of the brushless DC motor in real time, convert analog signals of voltage and current data into digital signals and send them to the data conversion module. The data acquisition module is also used to collect real-time on-board cable information of the vehicle to provide detection data for the model; The data conversion module is connected to the RGB image generation module and is used to encode the received voltage and current digital signals into RGB image data; The RGB image generation module is connected to the image processing and analysis module, and is used to generate RGB images and apply image processing algorithms for analysis, provide motor state monitoring and fault diagnosis results, and send the motor state monitoring and fault diagnosis results to the image processing and analysis module; The image processing and analysis module is connected to the fault diagnosis result output module and is used to process and analyze the generated RGB image to achieve fault diagnosis; The fault diagnosis result output module is used to output the diagnosis result and to give an alarm or display.
10. The fault diagnosis and analysis system according to claim 9, characterized in that: The voltage and current data include the voltage and current U_A, U_B, U_C and I_A, I_B, I_C of each phase of the brushless DC motor; the sampling rate of the signal acquisition system is set to at least 2-10 times the frequency of the motor operation signal, and the resolution can be 12 bits or 16 bits.