Disclosure of Invention
The embodiment of the application aims to provide a method, a device, a medium and a terminal for identifying faults of a servo motor and training a model, which can improve the accuracy of fault judgment.
In a first aspect, an embodiment of the present application provides a method for training a failure recognition model of a servo motor, including the following steps:
acquiring source domain sample data and target domain sample data, wherein the target domain sample data comprises a plurality of sample data pairs, each sample data pair comprises a rotating speed of a servo motor with a fault and a first vibration curve graph at the rotating speed, and the source domain sample data comprises a plurality of second vibration curve graphs of a non-servo motor;
acquiring an initial neural network model;
initializing and training the initial neural network model according to the plurality of second vibration graphs, so as to obtain a first neural network model with initial model parameters;
and carrying out optimization training on initial model parameters of the first neural network model based on the plurality of sample data so as to obtain a servo motor fault identification model.
Optionally, in the method for training a failure recognition model of a servo motor according to the embodiment of the present application, each sample data pair in the target domain sample data further includes a driving voltage at a corresponding rotation speed;
and the step of optimally training the initial model parameters of the first neural network model by the plurality of sample data to obtain a servo motor fault recognition model comprises the following steps:
inputting the driving voltage, the rotating speed and the first vibration curve graph of each sample data pair into the first neural network model, and optimally training the initial model parameters of the first neural network model by the plurality of sample data pairs to obtain optimized target model parameters;
and obtaining a servo motor fault identification model according to the target model parameters and the first neural network model.
Optionally, in the method for training a failure recognition model of a servo motor according to the embodiment of the present application, the first vibration graph and the second vibration graph have the same size specification.
Optionally, in the method for training a failure recognition model of a servo motor according to the embodiment of the present application, the step of obtaining an initial neural network model includes:
and establishing an initial neural network model according to the parameter types in the sample data pair.
In a second aspect, the embodiment of the application also provides a method for identifying faults of a servo motor, which is a servo motor fault identification model established by adopting the method described in any one of the above; the method comprises the following steps:
acquiring an actual rotating speed of a motor to be detected and an actual vibration curve diagram detected by a vibration sensor arranged on the servo motor;
and inputting the actual rotating speed and the actual vibration curve graph into the servo motor fault identification model to judge the fault condition of the servo motor.
Optionally, in the method for identifying a fault of a servo motor according to the embodiment of the present application, the method further includes the following steps:
acquiring the actual driving voltage of a motor to be detected;
and the step of inputting the actual rotation speed and the actual vibration curve graph into the servo motor fault recognition model to judge the fault condition of the servo motor comprises the following steps:
and inputting the actual driving voltage, the actual rotating speed and the actual vibration curve graph into the servo motor fault identification model to judge the fault condition of the servo motor.
In a third aspect, a device for training a failure recognition model of a servo motor, includes:
a first acquisition module for acquiring source domain sample data and target domain sample data, the target domain sample data comprising a plurality of sample data pairs, each sample data pair comprising a rotational speed of a servo motor having a fault and a first vibration profile at the rotational speed, the source domain sample data comprising a plurality of second vibration profiles of a non-servo motor;
the second acquisition module is used for acquiring an initial neural network model;
the first training module is used for carrying out initial training on the initial neural network model according to the plurality of second vibration curves so as to obtain a first neural network model with initial model parameters;
and the second training module is used for carrying out optimization training on initial model parameters of the first neural network model based on the plurality of sample data so as to obtain a servo motor fault recognition model.
In a fourth aspect, an embodiment of the present application further provides a device for identifying a fault of a servo motor, where the method is used to establish a fault identification model of the servo motor; the device comprises:
the third acquisition module is used for acquiring the actual rotating speed of the motor to be detected and an actual vibration curve graph detected by a vibration sensor arranged on the servo motor;
and the identification module is used for inputting the actual rotating speed and the actual vibration curve graph into the servo motor fault identification model so as to judge the fault condition of the servo motor.
In a fifth aspect, embodiments of the present application further provide a terminal comprising a processor and a memory storing computer readable instructions that, when executed by the processor, perform the steps of any of the methods described above.
In a sixth aspect, embodiments of the present application further provide a medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of any of the methods described above.
As can be seen from the above, in the embodiments of the present application, by acquiring source domain sample data and target domain sample data, the target domain sample data includes a plurality of sample data pairs, each sample data pair includes a rotation speed of a servo motor having a fault and a first vibration graph at the rotation speed, and the source domain sample data includes a plurality of second vibration graphs of a non-servo motor; acquiring an initial neural network model; initializing and training the initial neural network model according to the plurality of second vibration graphs, so as to obtain a first neural network model with initial model parameters; and carrying out optimization training on initial model parameters of the first neural network model based on the plurality of sample data to obtain a servo motor fault identification model, wherein the initial neural network model is initialized and trained by adopting a vibration curve graph in source domain sample data, so that the defect of insufficient sample data of target domain sample data can be effectively overcome, the detection efficiency can be improved, and the detection cost can be saved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Description of the preferred embodiments
The following description of the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a method for training a failure recognition model of a servo motor according to an embodiment of the present application. The servo motor fault recognition model is used for carrying out fault recognition on the servo motor. The method comprises the following steps:
s101, acquiring source domain sample data and target domain sample data, wherein the target domain sample data comprises a plurality of sample data pairs, each sample data pair comprises a rotating speed of a servo motor with a fault and a first vibration curve graph at the rotating speed, and the source domain sample data comprises a plurality of second vibration curve graphs of a non-servo motor.
S102, acquiring an initial neural network model.
And S103, carrying out initialization training on the initial neural network model according to the plurality of second vibration curves so as to obtain a first neural network model with initial model parameters.
And S104, performing optimization training on initial model parameters of the first neural network model based on the plurality of sample data to obtain a servo motor fault recognition model.
Wherein in the step S101, the target field sample data includes a plurality of sample data pairs, each sample data pair includes a rotation speed of the servo motor having a fault and a first vibration profile at the rotation speed, and the source field sample data includes a second vibration profile of the plurality of non-servo motors. The first vibration curve and the second vibration curve are the same specification, that is, the same size. Of course, if the specifications in the first vibration profile and the second vibration profile in the plurality of sample data pairs are different, all the vibration profiles are adjusted to a fixed size standard by setting the size standard.
In step S102, an initial neural network model is established based on the parameter types and the number of parameter types of the sample data pairs. In some embodiments, the step S102 is: and establishing an initial neural network model according to the parameter types in the sample data pair.
In the step S103, the second vibration curve is input into the initial neural network model to perform training of initial model parameters, so as to obtain the first neural network model, and since the initial neural network model is initialized and trained by using the vibration curve in the source domain sample data, the defect of insufficient sample data of the target domain sample data can be effectively solved, the detection efficiency can be improved, and the detection cost can be saved.
In step S104, the first vibration graph needs to be preprocessed to improve accuracy and training efficiency. Specifically, the preprocessing includes at least one of a whitening process, a flipping process, and a clipping process.
Wherein in some embodiments, each of the sample data pairs in the target domain sample data further comprises a drive voltage at a corresponding rotational speed; the step S104 includes: s1041, inputting a driving voltage, a rotating speed and a first vibration curve graph of each sample data pair into the first neural network model, and optimally training initial model parameters of the first neural network model by the plurality of sample data pairs to obtain optimized target model parameters; s1042, obtaining a servo motor fault recognition model according to the target model parameters and the first neural network model.
And in the training process, after one sample data pair is input each time, calculating the damage function of the first neural network model, if the damage function is larger than a preset threshold value, continuing to input the sample data pair for training, and if the damage function is smaller than the preset threshold value, stopping training.
As can be seen from the above, in the embodiments of the present application, by acquiring source domain sample data and target domain sample data, the target domain sample data includes a plurality of sample data pairs, each sample data pair includes a rotation speed of a servo motor having a fault and a first vibration graph at the rotation speed, and the source domain sample data includes a plurality of second vibration graphs of a non-servo motor; acquiring an initial neural network model; initializing and training the initial neural network model according to the plurality of second vibration graphs, so as to obtain a first neural network model with initial model parameters; and carrying out optimization training on initial model parameters of the first neural network model based on the plurality of sample data to obtain a servo motor fault identification model, wherein the initial neural network model is initialized and trained by adopting a vibration curve graph in source domain sample data, so that the defect of insufficient sample data of target domain sample data can be effectively overcome, the detection efficiency can be improved, and the detection cost can be saved.
Referring to fig. 2, fig. 2 is a flowchart of a method for identifying a failure of a servo motor according to an embodiment of the present application. The servo motor fault recognition method adopts the servo motor fault recognition model established by any one of the methods; the servo motor fault identification method comprises the following steps:
s201, acquiring an actual rotating speed of a motor to be detected and an actual vibration curve diagram detected by a vibration sensor arranged on the servo motor.
S202, inputting the actual rotating speed and the actual vibration curve graph into the servo motor fault identification model to judge the fault condition of the servo motor.
In this step S201, the actual rotational speed of the servo motor may be detected by a rotational speed sensor, where the actual rotational speed is an average rotational speed within a preset time period, and the actual vibration profile is an actual vibration profile within the preset time period.
Wherein in some embodiments the method further comprises the steps of: and acquiring the actual driving voltage of the motor to be detected. Correspondingly, the step S202 includes: and inputting the actual driving voltage, the actual rotating speed and the actual vibration curve graph into the servo motor fault identification model to judge the fault condition of the servo motor.
Referring to fig. 3, fig. 3 is a structural diagram of a servo motor failure recognition model training apparatus according to some embodiments of the present application, where the servo motor failure recognition model training apparatus includes: a first acquisition module 301, a second acquisition module 302, a first training module 303, and a second training module 304.
The first obtaining module 301 is configured to obtain source domain sample data and target domain sample data, where the target domain sample data includes a plurality of sample data pairs, each sample data pair includes a rotation speed of a servo motor with a fault and a first vibration graph at the rotation speed, and the source domain sample data includes a plurality of second vibration graphs of a non-servo motor; the domain sample data includes a plurality of sample data pairs, each sample data pair including a rotational speed of the servo motor having a fault and a first vibration profile at the rotational speed, the source domain sample data including a plurality of second vibration profiles of the non-servo motor. The first vibration curve and the second vibration curve are the same specification, that is, the same size. Of course, if the specifications in the first vibration profile and the second vibration profile in the plurality of sample data pairs are different, all the vibration profiles are adjusted to a fixed size standard by setting the size standard.
Wherein, the second obtaining module 302 is configured to obtain an initial neural network model; the initial neural network model is built based on the number of parameter types of the sample data pairs. In some embodiments, the second obtaining module 302 is configured to build an initial neural network model according to the parameter types in the sample data pair.
The first training module 303 is configured to perform initial training on the initial neural network model according to the plurality of second vibration graphs, so as to obtain a first neural network model with initial model parameters; the first training module 303 performs training of initial model parameters by inputting the second vibration curve graph into the initial neural network model, so as to obtain a first neural network model, and since the initial neural network model is initialized and trained by using the vibration curve graph in the source domain sample data, the defect of insufficient sample data of the target domain sample data can be effectively solved, the detection efficiency can be improved, and the detection cost can be saved.
The second training module 304 is configured to perform optimization training on initial model parameters of the first neural network model based on the plurality of sample data, so as to obtain a servo motor fault recognition model. The first vibration profile needs to be preprocessed to improve accuracy and training efficiency. Specifically, the preprocessing includes at least one of a whitening process, a flipping process, and a clipping process.
Referring to fig. 4, fig. 4 is a block diagram of a fault recognition device for a servo motor according to some embodiments of the present application, and the fault recognition model for the servo motor is built by using the method described in one of the above; the device comprises: third acquisition module 401, identification module 402
The third obtaining module 401 is configured to obtain an actual rotation speed of a motor to be detected and an actual vibration graph detected by a vibration sensor installed on the servo motor;
the identification module 402 is configured to input the actual rotation speed and the actual vibration graph into the servo motor fault identification model, so as to determine a fault condition of the servo motor. The actual rotating speed of the servo motor is detected through a rotating speed sensor, wherein the actual rotating speed is an average rotating speed in a preset time period, and the actual vibration curve graph is an actual vibration curve graph in the preset time period.
Wherein in some embodiments the third acquisition module 401 is further configured to acquire an actual driving voltage of the motor to be detected. Correspondingly, the identification module 402 is configured to input the actual driving voltage, the actual rotational speed, and the actual vibration graph into the servo motor fault identification model, so as to determine a fault condition of the servo motor.
As can be seen from the above, in the embodiments of the present application, by acquiring source domain sample data and target domain sample data, the target domain sample data includes a plurality of sample data pairs, each sample data pair includes a rotation speed of a servo motor having a fault and a first vibration graph at the rotation speed, and the source domain sample data includes a plurality of second vibration graphs of a non-servo motor; acquiring an initial neural network model; initializing and training the initial neural network model according to the plurality of second vibration graphs, so as to obtain a first neural network model with initial model parameters; and carrying out optimization training on initial model parameters of the first neural network model based on the plurality of sample data to obtain a servo motor fault identification model, wherein the initial neural network model is initialized and trained by adopting a vibration curve graph in source domain sample data, so that the defect of insufficient sample data of target domain sample data can be effectively overcome, the detection efficiency can be improved, and the detection cost can be saved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and the present application provides a terminal 5, including: processor 501 and memory 502, the processor 501 and memory 502 being interconnected and in communication with each other by a communication bus 503 and/or other form of connection mechanism (not shown), the memory 502 storing a computer program executable by the processor 501, which when run by a computing device, the processor 501 executes to perform the method in any of the alternative implementations of the embodiments described above.
Embodiments of the present application provide a medium that, when executed by a processor, performs a method in any of the alternative implementations of the above embodiments. The storage medium may be implemented by any type of volatile or nonvolatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.