Controller fault detection method and system
Through the graph neural network model, the real-time operation data of the electric tricycle controller is analyzed, which solves the problems of fault detection accuracy and slow response speed in the existing technology, and accurately detects and early warnings of controller faults, ensuring the safe operation of the electric tricycle.
Patent Information
- Application Number
- CN202411739556.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing electric tricycle controller fault detection methods have low diagnostic accuracy and slow response speed, and cannot detect faults in real time, resulting in safety hazards.
The graph neural network model is used to analyze the real-time controller operation data, and the sensor collects data in real time, preprocesses data, and builds a graph neural network model to detect faults in the controller, and early warnings are made based on the detection results.
Accurate detection and early warning of controller faults is realized, the accuracy and timeliness of fault detection are improved, and a complete fault detection system is formed, providing comprehensive monitoring and early warning of electric tricycle controller faults.
Smart Images

Figure CN119536228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis, and in particular to a controller fault detection method and system. Background Art
[0002] As an important means of transportation, electric tricycles play an important role in daily life and cargo transportation. As the core component of electric tricycles, the performance and stability of the controller are directly related to the operating efficiency and safety of electric tricycles. However, most of the existing electric tricycle controller fault detection methods rely on traditional fault diagnosis technologies, such as detecting parameters such as current and voltage to determine whether the controller is faulty. These methods often have problems such as low diagnostic accuracy, slow response speed, and inability to detect in real time, resulting in the inability to provide timely warning and repair when the controller fails, posing a safety hazard to the operation of the electric tricycle. Therefore, how to provide an efficient and accurate controller fault detection method and system has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of the above-mentioned technical deficiencies, an object of the present invention is to provide a controller fault detection method and system to solve the problems of low diagnostic accuracy and slow response speed in the prior art.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a controller fault detection method, the method comprising: Step S100: collecting controller operation data in real time through sensors; Step S200: preprocessing the collected data; Step S300: Using historical controller operation data to build a graph neural network model; Step S400: Analyze the real-time controller operation data through the graph neural network model to detect faults in the controller; Step S500: issuing an early warning according to the fault detection result.
[0005] Preferably, in a possible implementation of the first aspect, the sensor includes a temperature sensor, a current sensor, a voltage sensor and a Hall sensor, and the collected controller operation data includes controller internal temperature data, motor current data, power supply voltage data, motor voltage data and motor rotor position data.
[0006] Preferably, in a possible implementation manner of the first aspect, the data preprocessing includes data cleaning and data standardization.
[0007] Preferably, in a possible implementation manner of the first aspect, the historical controller operation data includes historical controller internal temperature data, historical motor current data, historical power supply voltage data, historical motor voltage data, historical motor rotor position data and historical fault data.
[0008] Preferably, in a possible implementation of the first aspect, the graph neural network model includes: The input layer is used to receive the pre-processed controller operation data; The graph construction layer is used to build a graph structure based on the relationship between the various components of the controller; A graph convolution layer is used to perform convolution operations on the graph structure to extract the features of the controller operation data; The fully connected layer is used to map the extracted controller operation data features to the preset fault categories; The output layer is used to output the probability of the occurrence of the preset fault category.
[0009] Preferably, in a possible implementation manner of the first aspect, step S400 specifically includes: Input the real-time controller operation data into the graph neural network model; The graph neural network model processes the input data and outputs the probability of a preset fault category; When the probability of occurrence of a certain preset fault type exceeds a preset threshold, it is determined that a fault of this type exists.
[0010] Preferably, in a possible implementation manner of the first aspect, step S500 specifically includes: Determine the fault type according to the fault detection result; Generate fault warning signals and sound an alarm through a preset alarm device; Record the fault information in the fault log.
[0011] In a second aspect, the present invention provides a controller fault detection system, the system comprising: Data acquisition module, used to collect controller operation data in real time through sensors; Data preprocessing module, used to clean and standardize the collected data; A model building module, used to build a graph neural network model using pre-processed historical controller operation data; The fault detection module is used to analyze the real-time controller operation data through the graph neural network model to detect faults in the controller; The early warning module is used to issue early warnings based on fault detection results.
[0012] The beneficial effects of the present invention are: by using a graph neural network model to analyze the real-time controller operation data, the present invention can realize accurate detection and early warning of controller faults, greatly improving the accuracy and timeliness of fault detection. At the same time, the present invention also forms a complete fault detection system through the mutual cooperation of the data acquisition module, the data preprocessing module, the model building module, the fault detection module and the early warning module, realizing all-round monitoring and early warning of controller faults. In addition, the present invention also has the advantages of simple operation and strong applicability, and can be widely used in the controller fault detection of various electric tricycles, providing a strong guarantee for the safe operation of electric tricycles. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0014] Figure 1 A flow chart of a controller fault detection method is provided for the present application.
[0015] Figure 2 A system structure diagram of a controller fault detection is provided for this application.
[0016] Explanation of the accompanying drawings: 1-data acquisition module, 2-data preprocessing module, 3-model building module, 4-fault detection module, 5-early warning module. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Embodiment 1: Figure 1 As shown, the present invention provides a controller fault detection method, the method comprising: Step S100: Collect controller operation data in real time through sensors.
[0019] Specifically, the sensors include temperature sensors, current sensors, voltage sensors and Hall sensors, and the collected controller operation data include controller internal temperature data, motor current data, power supply voltage data, motor voltage data and motor rotor position data.
[0020] The temperature sensor is deployed inside the controller to accurately measure the temperature of the controller when it is working. It senses the heat changes inside the controller and converts them into electrical signals, which are then collected and converted into temperature data. The temperature data inside the controller is used to monitor the temperature of the controller and prevent failures caused by overheating.
[0021] The current sensor is connected in series in the main circuit of the motor to measure the working current of the motor. By sensing the change of the current, it is converted into corresponding electrical signals. These signals are then collected and converted into current data to monitor the operating status of the motor. The motor current data is used to monitor the working status of the motor and prevent motor damage caused by excessive current.
[0022] The voltage sensor is deployed between the power line and the motor power line to measure the power supply voltage and motor voltage. It senses the voltage change and converts it into an electrical signal. These signals are then collected and converted into voltage data to analyze the stability of the power supply and the voltage requirements of the motor. The power supply voltage data is used to analyze the stability of the power supply and prevent equipment failures caused by voltage fluctuations; the motor voltage data is used to analyze the voltage requirements of the motor and ensure that the motor works at the appropriate voltage.
[0023] The Hall sensor is deployed inside the motor to measure the position of the motor rotor. It uses the Hall effect principle to measure the position of the motor rotor by sensing the change of the magnetic field, and then converts this information into electrical signals for collection and processing to obtain the motor rotor position data. The motor rotor position data is used to control the operation of the motor and improve the efficiency and stability of the motor.
[0024] In this embodiment, the temperature sensor adopts the FST600-901A model, the current sensor adopts the CHCS-CAB series, the voltage sensor adopts the LEM LV 25-P model, and the Hall sensor adopts the CA09H1500 series. First, the sensors deployed on the electric tricycle controller collect the operation data of the controller in real time, convert these data into electrical signals, and transmit the data to the control center through the CAN bus. The control center chip adopts STM32F767ZI, which uses the ARMCortex-M7 processor with a main frequency of up to 216MHz and is equipped with a high-speed cache, providing excellent computing performance and capable of supporting the operation of complex deep learning algorithms.
[0025] Step S200: preprocessing the collected data.
[0026] Specifically, data preprocessing includes data cleaning and data standardization.
[0027] First, data cleaning is performed. This aims to identify and correct errors, outliers, duplicate values, and missing values in the data set. For outlier detection and processing, the statistical 3σ principle is used. This principle assumes that the data follows a normal distribution. By calculating the mean (μ) and standard deviation (σ) of the data, values that exceed the mean ± 3 times the standard deviation are considered outliers. For detected outliers, the numpy.mean() and numpy.std() functions in the numpy library are used to calculate the mean and standard deviation, and conditional replacement is performed using the numpy.where() function.
[0028] For duplicate value detection and processing, the unique identifier of the dataset is used to automatically identify and delete duplicate rows through the DataFrame.drop_duplicates() function in the Pandas library to ensure the uniqueness of the dataset.
[0029] In terms of missing value processing, when there are few missing values, the method of deleting records containing missing values is adopted; when there are many missing values, the mean method is used to fill them according to the distribution characteristics of the data. The DataFrame.fillna() function in the Pandas library is used for filling, and the DataFrame.dropna() function is used for deletion, so as to effectively handle missing values.
[0030] After data cleaning, data standardization is performed. Considering that the controller operation data contains features with different dimensions and distribution characteristics such as temperature, current, and voltage, Z-score standardization is selected as the main standardization method. This method can convert the original data into a standard normal distribution with a mean of 0 and a standard deviation of 1, thereby eliminating the dimensional differences between different features and improving the efficiency and accuracy of model training. Use the StandardScaler class in the sklearn.preprocessing module to implement Z-score standardization.
[0031] Step S300: Use historical controller running data to build a graph neural network model.
[0032] Specifically, the historical controller operation data includes historical controller internal temperature data, historical motor current data, historical power supply voltage data, historical motor voltage data, historical motor rotor position data and historical fault data. The historical controller operation data is obtained from the control center chip.
[0033] The graph neural network model includes an input layer for receiving preprocessed controller operation data; a graph construction layer for constructing a graph structure based on the relationship between the various components of the controller; a graph convolution layer for performing convolution operations on the graph structure to extract controller operation data features; a fully connected layer for mapping the extracted controller operation data features to preset fault categories; and an output layer for outputting the probability of the occurrence of preset fault categories.
[0034] In this embodiment, the function of the input layer is to receive the preprocessed controller operation data and convert it into a suitable format. A data class named ControllerDataset is defined, which inherits from torch.utils.data.Dataset. In the initialization method of the ControllerDataset class, a parameter named preprocessed_data is received, which is a dictionary containing preprocessed data. Then the __len__ and __getitem__ methods are implemented to return the total number of samples in the dataset and load a single sample, respectively. When loading a single sample, the corresponding sample is taken from preprocessed_data, and the input features (input_features) and labels (labels) are extracted, and then returned. Finally, the DataLoader class is used to load the data, set the batch size to 32, and shuffle the data order at the beginning of each training cycle.
[0035] The function of the graph construction layer is to build a graph structure based on the relationship between the various components of the controller. A function called build_graph is defined to implement this function. The function receives two parameters: node_features and edge_index. node_features is a tensor of shape [num_nodes, num_node_features], which represents the features of the node; edge_index is a tensor of shape [2, num_edges], which represents the start and end points of the edge. Inside the function, the torch_geometric.data.Data class is used to create a graph data object and set its node features and edge index. Finally, the function returns the constructed graph data object.
[0036] The graph convolution layer is the core part of the graph neural network, which is responsible for performing convolution operations on the graph structure to extract features. A class named GCNModel is defined to implement the function of the graph convolution layer. This class inherits from torch.nn.Module, and defines two graph convolution layers (self.conv1 and self.conv2) and a fully connected layer (self.linear) in the initialization method. In the forward method, a graph data object is received as input, and its node features (x) and edge index (edge_index) are extracted. Then, two graph convolution layers and a ReLU activation function are used to extract features in sequence, and finally the features are mapped to the preset fault categories through the fully connected layer, and the logarithmic probability is output.
[0037] The function of the fully connected layer and the output layer is to map the features extracted by the graph convolution layer to the preset fault categories and output the probability of each category. The extracted features are mapped to the fault categories through the fully connected layer and the logarithmic probability is output.
[0038] Finally, the history controller is used to run the data to train and validate the model. The loss function and optimizer are defined, and the training loop and validation loop are set. In the training loop, the model is first set to training mode and the total loss is initialized to 0. Then each batch of data in the data loader is traversed, the graph data object is constructed and its label is set. Next, forward propagation is performed to calculate the output and loss, and backpropagation is performed to optimize the model parameters, and finally an optimal graph neural network model is obtained.
[0039] Step S400: Analyze the real-time controller operation data through the graph neural network model to detect faults in the controller.
[0040] Specifically, the real-time controller operation data is input into the graph neural network model; the graph neural network model processes the input data and outputs the probability of a preset fault category; when the probability of a preset fault category exceeding a preset threshold, it is determined that this type of fault exists.
[0041] In this embodiment, the pre-processed real-time controller operation data is first obtained from the control center. These data are collected and transmitted to the control center in real time by sensors, including information such as the controller internal temperature, motor current, power supply voltage, motor voltage, and motor rotor position. After pre-processing, these data are organized into a format suitable for model input.
[0042] Then, these real-time data are input into the trained graph neural network model. After receiving these data, the model performs convolution operations on the graph structure according to the relationship graph between the various components of the controller to extract the deep features of the controller operation data. These features can reflect the current operating status of the controller and possible fault information.
[0043] Next, the model maps the extracted features to the preset fault categories. In this embodiment, the fault categories include internal overheating of the controller caused by poor heat dissipation, component aging or overload; abnormal current fluctuations caused by motor overload, short circuit or internal circuit defects of the controller; unstable or low power supply voltage causing abnormal operation of the controller; internal circuit failure of the motor or controller indicated by abnormal voltage and abnormal Hall sensor signal that may cause motor commutation failure.
[0044] Finally, the existence of a fault is determined based on the fault category probability output by the model. When the probability of a certain fault category occurring exceeds 0.4, it is determined that this type of fault exists.
[0045] Step S500: issuing an early warning according to the fault detection result.
[0046] Specifically, the fault type is determined based on the fault detection result; a fault warning signal is generated, and an alarm is issued through a preset alarm device; and the fault information is recorded in a fault log.
[0047] In this embodiment, after a fault is detected in the controller, the early warning process is entered. First, the system determines the type of fault based on the output of the graph neural network model. After determining the type of fault, the system generates a fault early warning signal. This signal immediately triggers the preset alarm device, which notifies the operator or maintenance personnel in a timely manner through sound and light warnings.
[0048] At the same time, in order to ensure the traceability of fault information and facilitate subsequent analysis, the system will also record the fault information in detail in the fault log, which includes the time and type of fault.
[0049] Embodiment 2: Figure 2 As shown, the present invention provides a controller fault detection system, the system comprising: Data acquisition module 1, used to collect controller operation data in real time through sensors; Data preprocessing module 2, used for data cleaning and data standardization of the collected data; Model building module 3, used to build a graph neural network model using pre-processed historical controller operation data; Fault detection module 4, used to analyze the real-time controller operation data through the graph neural network model to detect faults in the controller; The early warning module 5 is used to issue an early warning according to the fault detection result.
[0050] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A controller fault detection method, characterized in that: The method comprises: Step S100: collecting controller operation data in real time through sensors; Step S200: preprocessing the collected data; Step S300: Using historical controller operation data to build a graph neural network model; Step S400: Analyze the real-time controller operation data through the graph neural network model to detect faults in the controller; Step S500: issuing an early warning according to the fault detection result.
2. The controller fault detection method according to claim 1, characterized in that: The sensors include a temperature sensor, a current sensor, a voltage sensor and a Hall sensor, and the collected controller operation data include controller internal temperature data, motor current data, power supply voltage data, motor voltage data and motor rotor position data.
3. The controller fault detection method according to claim 1, characterized in that: The data preprocessing includes data cleaning and data standardization.
4. The controller fault detection method according to claim 1, characterized in that: The historical controller operation data includes historical controller internal temperature data, historical motor current data, historical power supply voltage data, historical motor voltage data, historical motor rotor position data and historical fault data.
5. The controller fault detection method according to claim 1, characterized in that: The graph neural network model includes: The input layer is used to receive the pre-processed controller operation data; The graph construction layer is used to build a graph structure based on the relationship between the various components of the controller; A graph convolution layer is used to perform convolution operations on the graph structure to extract the features of the controller operation data; The fully connected layer is used to map the extracted controller operation data features to the preset fault categories; The output layer is used to output the probability of the occurrence of the preset fault category.
6. The controller fault detection method according to claim 1, characterized in that: The step S400 specifically includes: Input the real-time controller operation data into the graph neural network model; The graph neural network model processes the input data and outputs the probability of a preset fault category; When the probability of occurrence of a certain preset fault type exceeds a preset threshold, it is determined that a fault of this type exists.
7. The controller fault detection method according to claim 1, characterized in that: The step S500 specifically includes: Determine the fault type according to the fault detection result; Generate fault warning signals and sound an alarm through a preset alarm device; Record the fault information in the fault log.
8. A controller fault detection system, characterized in that: The system comprises: Data acquisition module, used to collect controller operation data in real time through sensors; Data preprocessing module, used to clean and standardize the collected data; A model building module, used to build a graph neural network model using pre-processed historical controller operation data; The fault detection module is used to analyze the real-time controller operation data through the graph neural network model to detect faults in the controller; The early warning module is used to issue early warnings based on fault detection results.