Servo motor control method and system with anomaly detection function

By constructing a three-dimensional speed image and anomaly tree, combined with a convolutional neural network to detect abnormalities of the servo motor, the problem of inaccurate abnormal detection of servo motors is solved, and more accurate abnormal judgment is achieved.

CN120281239AActive Publication Date: 2025-07-08CHENGDU TEXTILE COLLEGE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510727628.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-07-08
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

In the prior art, the abnormal detection of servo motors is not accurate enough, and it is difficult to effectively determine whether there is an abnormality.

Method used

By obtaining the servo position and servo speed at multiple motion time points of the servo motor, a three-dimensional velocity image and anomaly tree are constructed, combined with a convolutional neural network for abnormal detection, and using the difference between the predicted position and the actual position to determine whether there is anomaly.

Benefits of technology

It improves the accuracy of abnormal detection of servo motors, reduces the difference between the neural network detection output and actual position, and achieves more accurate abnormal judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281239A_ABST
    Figure CN120281239A_ABST
Patent Text Reader

Abstract

The invention discloses a servo motor control method and system with an anomaly detection function. And according to the time point, carrying out abnormity judgment on the servo speed. And if so, acquiring the servo position of the predicted time point according to the servo position of the historical time point. And constructing an abnormal tree according to the predicted position corresponding to the predicted time point and the actual position, representing the time point by the abnormal tree by using a hierarchy, and representing the predicted position and the actual position by using two nodes in one hierarchy. The abnormal tree is converted into an abnormal matrix, and the incidence relation between the predicted position and the actual position is detected according to convolution. The predicted position of the predicted time point is compared with the corresponding actual position to serve as a first judgment anomaly. And performing secondary abnormality judgment by using the change of the difference between the actual position and the predicted position so as to reduce the difference between the output data detected by the neural network and the actual position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a servo motor control method and system with an anomaly detection function. Background Art

[0002] Currently, in servo control, position control is a common working mode. In this mode, the controller specifies the target position by sending a series of pulse signals, and the driver adjusts the position according to these pulses. The servo motor can convert the voltage signal into servo speed to drive the controlled object. It controls the rotation of the motor by receiving pulse signals. The servo motor works in a closed-loop system and can feedback the servo position and servo speed in real time. The servo motor for servo control can be used for data collection, visualization, and data analysis, and can also perform anomaly detection. And how to more accurately judge whether the anomaly detection of the servo motor is accurate is also a problem. Summary of the Invention

[0003] The purpose of the present invention is to provide a servo motor control method and system with an anomaly detection function to solve the above problems existing in the prior art.

[0004] In a first aspect, an embodiment of the present invention provides a servo motor control method with an anomaly detection function, including: Obtain multiple waiting-for-opportunity information; the waiting-for-opportunity information includes the servo position and servo speed at multiple motion time points; the servo position represents the position of the device controlled by the servo motor from the servo motor; the servo speed represents the speed of rotation of the servo motor at the current time point; one waiting-for-opportunity information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle; Based on the servo speeds at multiple motion time points, discriminate anomalies to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at multiple motion time points of multiple action cycles; Through a trained prediction position network, based on the three-dimensional speed image and the servo positions at multiple motion time points, jointly use the servo speed and servo position to discriminate the change of the servo position at multiple motion time points to obtain a predicted position; the predicted position represents the servo position predicted at the prediction time point; Multiple prediction time points correspond to obtaining multiple predicted positions; Based on multiple prediction time points and the corresponding predicted positions, construct an anomaly tree; the anomaly tree represents the predicted positions and actual positions at multiple prediction time points; Based on the anomaly tree and the servo speeds at multiple motion time points, detect the tree structure and judge whether there is an anomaly.

[0005] Optionally, the servo speed based on the abnormal tree and multiple motion time points, the detection tree structure, and the determination of whether it is abnormal include: Using the parent representation method, convert the abnormal tree into an abnormal matrix; Based on the abnormal matrix and the servo speed at multiple motion time points, through the trained first convolutional neural network and second convolutional neural network, obtain the first abnormal feature; the first abnormal feature represents the feature of whether the abnormal matrix for detecting the servo speed abnormality is also abnormal in position; Based on the abnormal matrix, detect the change between the predicted position and the actual position, and obtain the second abnormal feature; the second abnormal feature represents the difference between the predicted position and the actual position at a time point; Obtain the first historical abnormal feature; the first historical abnormal feature represents the feature output after the abnormal matrix at the historical time point is input into the trained first convolutional neural network; Calculate the Mahalanobis distance between the first historical abnormal feature and the first abnormal feature to obtain the first abnormal value; the first abnormal value represents the gap between the state of the servo motor at the current time point and the state of the servo motor at the historical time point; Calculate the variance of multiple values in the second abnormal feature to obtain the second abnormal value; the second abnormal value represents the gap between the predicted position and the actual position of the servo motor at multiple motion time points; If the first abnormal value is greater than the first threshold, or the second abnormal value is greater than the second threshold, it is set as abnormal.

[0006] Optionally, through the trained predicted position network, based on the three-dimensional velocity image and the servo position at multiple motion time points, using the servo speed and servo position to jointly determine the change of the servo position at multiple motion time points, and obtain the predicted position, including: Based on the servo position at multiple motion time points, detect the change of the servo position in different action cycles to obtain multiple time position images; the time position image represents the waiting position corresponding to the same motion time point in multiple action cycles; Input the time position image into the position convolutional network to obtain the position feature map; multiple time position images correspond to obtain multiple position feature maps; Segment the three-dimensional velocity image by motion time point to obtain multiple time velocity images; the time velocity image represents the waiting speed corresponding to the motion time point in multiple action cycles; Input the time velocity image into the velocity convolutional network to detect the relationship between the waiting speeds of the motion time point in multiple action cycles, and obtain the velocity feature map; multiple time velocity images correspond to obtain multiple velocity feature maps; Fuse the position feature map and the velocity feature map to obtain the velocity trajectory feature map; Multiple motion time points correspond to obtaining multiple velocity trajectory feature maps; Input the multiple velocity trajectory feature maps into a temporal convolutional network in order from the earliest to the latest time point to detect the changes in adjacent action cycles and obtain the predicted position.

[0007] Optionally, based on the anomaly matrix and the servo velocities at multiple motion time points, through a trained first convolutional neural network and a second convolutional neural network, a first anomaly feature is obtained, including: Input the anomaly matrix into the trained first convolutional neural network to detect anomalies globally and obtain a first detection feature; the first convolutional neural network includes a 2*2 convolutional kernel; Calculate the variance of the standby velocities corresponding to multiple action cycles in the three-dimensional velocity image at the same motion time point to obtain a velocity offset value; multiple motion time points correspond to obtaining multiple velocity offset values; Take the motion time points with velocity offset values greater than the variance threshold as marked motion time points; In the anomaly matrix, extract the nodes corresponding to the marked motion time points to obtain a marked anomaly matrix; Input the marked anomaly matrix into the second convolutional neural network to detect anomalies locally and obtain a second detection feature; Fuse the first detection feature and the second detection feature to obtain a first anomaly feature.

[0008] Optionally, based on the anomaly matrix, detect the changes between the predicted position and the actual position to obtain a second anomaly feature, including: Obtain a step value; the step value is a positive even number; Use a 2*u two-dimensional convolutional kernel and take the step value as the step to perform convolution in the column direction of the anomaly matrix to find the change in the correlation between the predicted position and the actual position and obtain multiple differential position features; Take the average of multiple differential position features at the same level to obtain a second anomaly feature; u represents the number of columns of the anomaly matrix.

[0009] Optionally, based on the servo positions at multiple motion time points, detect the changes in the servo positions in different action cycles to obtain multiple time position images, including: Fit the servo positions at multiple motion time points from smallest to largest to obtain a three-dimensional trajectory curve; the three-dimensional trajectory curve represents the positions of the device controlled by the servo motor at multiple motion time points; Draw the three-dimensional trajectory curve in a three-dimensional trajectory image; Multiple action cycles correspond to obtaining multiple three-dimensional trajectory images; Arrange multiple three-dimensional trajectory images according to time points from early to late to obtain an arranged trajectory image; Segment the arranged trajectory image at the same motion time points to obtain multiple time-position images.

[0010] Optionally, constructing an anomaly tree based on multiple prediction time points and corresponding predicted positions includes: Obtain the root node; Obtain multiple actual positions corresponding to multiple prediction time points; Obtain a first time point and a second time point among multiple prediction time points; the first time point is earlier than the second time point; Take the predicted position corresponding to the first time point as the left node of the root node; Take the actual position corresponding to the first time point as the right node of the root node; Take the predicted position corresponding to the second time point as the left child node of the node corresponding to the actual position of the first time point; Take the actual position corresponding to the second time point as the right child node of the node corresponding to the actual position of the first time point; Construct 2v child nodes corresponding to v prediction time points to obtain an anomaly tree; One level of the anomaly tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.

[0011] Optionally, the predicted position network includes a temporal convolutional network, a velocity convolutional network, and a position convolutional network; Backward train the temporal convolutional network, the velocity convolutional network, and the position convolutional network to obtain a trained predicted position network.

[0012] Optionally, discriminating anomalies based on the servo speeds at multiple motion time points to obtain a three-dimensional velocity image includes: In a binary image, mark the positions corresponding to the servo speeds at multiple motion time points and set the value to 1 to obtain a servo speed image; the length of the binary image represents the motion time points, and the width represents the servo speeds; Obtain multiple servo speed images corresponding to multiple action cycles; Overlay the multiple servo speed images to obtain a three-dimensional velocity image; Obtain a 2*n*m three-dimensional convolutional kernel; n corresponds to the length of the three-dimensional velocity image; m corresponds to the width of the three-dimensional velocity image; With a stride of 2, convolve the three-dimensional convolutional kernel in the height direction of the three-dimensional velocity image to detect the change in servo speeds between adjacent two action cycles and determine whether there are anomalies; If the servo speed is normal, output a three-dimensional speed image. If the servo speed is abnormal, send a warning signal.

[0013] In a second aspect, an embodiment of the present invention provides a servo motor control system with an abnormality detection function, including: An acquisition module, configured to acquire a plurality of waiting information; the waiting information includes the servo position and servo speed at a plurality of motion time points; the servo position represents the position of the device controlled by the servo motor relative to the servo motor; the servo speed represents the speed of rotation of the servo motor at the current time point; one piece of waiting information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle; A servo speed detection module, configured to determine abnormalities based on the servo speeds at a plurality of motion time points and obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at a plurality of motion time points in a plurality of action cycles; A servo position detection module, configured to, through a trained prediction position network, based on the three-dimensional speed image and the servo positions at a plurality of motion time points, jointly determine the change in the servo positions at a plurality of motion time points using the servo speed and servo position to obtain a predicted position; the predicted position represents the servo position predicted at the prediction time point; a plurality of predicted positions are obtained corresponding to a plurality of prediction time points; An abnormal tree module, configured to construct an abnormal tree based on a plurality of prediction time points and the corresponding predicted positions; the abnormal tree represents the predicted positions and actual positions at a plurality of prediction time points; An abnormality detection module, configured to detect the tree structure based on the abnormal tree and the servo speeds at a plurality of motion time points and determine whether there is an abnormality.

[0014] Compared with the prior art, the embodiments of the present invention achieve the following beneficial effects: In the present invention, in the order of time points, the one-dimensional servo speed is converted into a three-dimensional speed image and abnormalities are judged. The servo speed is used as a prior judgment for abnormality judgment. If it is normal, then the servo position is judged. The servo position at the prediction time point is obtained based on the servo position at the historical time point. The predicted position corresponding to the prediction time point and the actual position are used to construct an abnormal tree. The abnormal tree uses levels to represent time points, and two nodes in one level represent the predicted position and the actual position. The abnormal tree is converted into an abnormal matrix. According to convolution, the correlation between the predicted position and the actual position is detected. The predicted position at the prediction time point is compared with the corresponding actual position as the first discrimination of abnormality. And the change in the difference between the actual position and the predicted position is used for secondary discrimination of abnormality, achieving the technical effect of reducing the difference between the output data detected by the neural network and the actual position. Description of the Drawings

[0015] Figure 1It is a flowchart of a servo motor control method with an anomaly detection function provided by an embodiment of the present invention.

[0016] Figure 2 It is a schematic diagram of the relationship between historical time points and predicted time points in a flowchart of a servo motor control method with an anomaly detection function provided by an embodiment of the present invention.

[0017] Figure 3 It is a schematic diagram of the conversion process of converting an anomaly tree into an anomaly matrix in a flowchart of a servo motor control method with an anomaly detection function provided by an embodiment of the present invention.

[0018] Figure 4 It is a schematic diagram of the relationship between a time position image, an arrangement trajectory image, and a three-dimensional trajectory image in a flowchart of a servo motor control method with an anomaly detection function provided by an embodiment of the present invention.

[0019] Figure 5 It is a schematic diagram of the relationship between a time speed image, a three-dimensional speed image, and a servo speed image in a flowchart of a servo motor control method with an anomaly detection function provided by an embodiment of the present invention. Detailed implementation manners

[0020] The present invention will be described in detail below with reference to the accompanying drawings.

[0021] Embodiment 1: As Figure 1 shown, an embodiment of the present invention provides a servo motor control method with an anomaly detection function, and the method includes: S101: Obtain multiple waiting information; the waiting information includes the servo position and servo speed at multiple motion time points; the servo position represents the position of the device controlled by the servo motor relative to the servo motor; the servo speed represents the speed of rotation of the servo motor at the current time point; one piece of waiting information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle.

[0022] Among them, for example, the first action cycle is [1, 2, 3, 4, 5, 6], the second action cycle is [7, 8, 9, 10, 11, 12], and the third action cycle is [13, 14, 15, 16, 17, 18], where 1 represents the 1st hour, 2 represents the 2nd hour,..., and 18 represents the 18th hour. The time points corresponding to the 1st motion time point in each action cycle are [1, 7, 13], and the time points corresponding to the 2nd motion time point in each action cycle are [2, 8, 14].

[0023] Among them, the number of motion time points in multiple action cycles is the same.

[0024] Among them, one action cycle represents the time length for the servo motor to complete one action. The actions corresponding to multiple waiting opportunity information have the same action cycles. For example, when the servo motor controls the robot to complete a hand-raising action, it is one action cycle. Completing the same hand-raising action multiple times results in multiple action cycles and multiple waiting opportunity information.

[0025] Among them, the servo speed is usually expressed in revolutions per minute (RPM) or angular velocity (rad / s). The servo speed of the servo motor can be precisely adjusted by the controller. For example, in equipment such as machining centers and 3D printers, the motor can be set to run at a constant speed or change speed according to a specific curve. The servo speed affects the production efficiency of the equipment. In applications such as automated equipment, conveyor belts, and robots, the faster the speed, the higher the work efficiency.

[0026] S102: Based on the servo speeds at multiple motion time points, determine anomalies to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at multiple motion time points of multiple action cycles.

[0027] S103: Through the trained prediction position network, based on the three-dimensional speed image and the servo positions at multiple motion time points, jointly use the servo speed and servo position to determine the change in the servo position at multiple motion time points to obtain a predicted position; the predicted position represents the servo position predicted at the prediction time point; Among them, in this embodiment, the prediction time point represents the next time point after the latest time point corresponding to the input three-dimensional speed image.

[0028] S104: Multiple predicted positions are obtained corresponding to multiple prediction time points.

[0029] Among them, the relationship between multiple prediction time points and predicted positions is as Figure 2 shown.

[0030] S105: Based on multiple prediction time points and the corresponding predicted positions, construct an anomaly tree; the anomaly tree represents the predicted positions and actual positions at multiple prediction time points.

[0031] Among them, the actual position at the prediction time point represents the position actually reached by the equipment controlled by the servo motor at the prediction time point.

[0032] S106: Based on the anomaly tree and the servo speeds at multiple motion time points, detect the tree structure and determine whether there are anomalies.

[0033] Optionally, the detecting the tree structure and determining whether there are anomalies based on the anomaly tree and the servo speeds at multiple motion time points includes: Using the parent representation method, convert the anomaly tree into an anomaly matrix.

[0034] Among them, the first column of the anomaly matrix represents the value of the node in the anomaly tree, the second column of the anomaly matrix represents the level of the node in the anomaly tree, and the third column of the anomaly matrix represents whether the node in the anomaly tree is a left node or a right node.

[0035] Among them, the conversion process of converting the anomaly tree into an anomaly matrix is as Figure 3 shown. In this embodiment, B, C, D, E, F, and G are used to represent the values of the nodes in the anomaly tree, non - negative integers starting from 0 are used to represent the levels of the anomaly tree, 1 is used to represent the left node of the anomaly tree, and 2 is used to represent the right node of the anomaly tree. As Figure 3 shown, B represents the left node at level 0, C represents the right node at level 0, and D represents the left node at level 1.

[0036] Among them, the anomaly matrix uses the level to represent the corresponding time point, 2 represents the actual position, and 1 represents the predicted position. Features can be added to obtain the difference between the actual position and the predicted position.

[0037] Among them, the parent representation method is equivalent to virtual storage rather than the actual computer storage location.

[0038] Based on the anomaly matrix and the servo speeds at multiple motion time points, through the trained first convolutional neural network and the second convolutional neural network, a first anomaly feature is obtained. The first anomaly feature represents the feature of whether the anomaly matrix detecting the servo speed anomaly is also abnormal in terms of position.

[0039] Among them, the first convolutional neural network is a Convolutional Neural Networks (CNN). The first convolutional neural network outputs two values, one representing anomaly and the other representing normal. The first anomaly feature is the feature before classification when two values are output.

[0040] Among them, anomaly matrices at multiple historical time points are obtained and input into the first convolutional neural network to obtain historical anomaly features and historical anomaly values. The historical anomaly value is the value after classification of the historical anomaly feature. In this embodiment, the softmax function is used for classification. The historical anomaly value and the labeled anomaly value are used to train the first convolutional neural network to obtain the trained first convolutional neural network. The labeled anomaly value is 1 representing anomaly and 0 representing normal. The cross - entropy loss function is used to calculate the loss for backward training.

[0041] Based on the anomaly matrix, the changes between the predicted position and the actual position are detected to obtain a second anomaly feature; the second anomaly feature represents the difference between the predicted position and the actual position at a time point.

[0042] Among them, each value in the second abnormal feature represents the feature of the change between the predicted position and the actual position of adjacent motion time points.

[0043] Obtain the first historical abnormal feature; the first historical abnormal feature represents the feature output after the abnormal matrix of historical time points is input into the trained first convolutional neural network.

[0044] Among them, in this embodiment, the latest time point corresponding in the abnormal matrix of the historical time points is earlier than the latest time point in the three-dimensional velocity image. The relationship between the historical time points and the predicted time points is as Figure 2 shown.

[0045] Calculate the Mahalanobis distance between the first historical abnormal feature and the first abnormal feature to obtain the first abnormal value; the first abnormal value represents the gap between the state of the servo motor at the current time point and the state of the servo motor at the historical time point.

[0046] Among them, in this embodiment, the Mahalanobis distances are calculated respectively for the values with the same subscripts of the first historical abnormal feature and the first abnormal feature, and used as the values of the first abnormal value with the same subscripts.

[0047] Among them, . x represents the first historical abnormal feature, y represents the first abnormal feature, x and y are two one-dimensional vectors. Σ is the covariance matrix. Σ^(-1) is the inverse matrix of the covariance matrix. DM(x,y) represents the first abnormal value.

[0048] Calculate the variance of multiple values in the second abnormal feature to obtain the second abnormal value.

[0049] If the first abnormal value is greater than the first threshold, or the second abnormal value is greater than the second threshold, it is set as abnormal.

[0050] Among them, if the first abnormal value is less than or equal to the first threshold, or the second abnormal value is less than or equal to the second threshold, it means that the state of the servo motor is normal.

[0051] Among them, in this embodiment, the first threshold is 1 and the second threshold is 0.5.

[0052] Optionally, the trained prediction position network, based on the three-dimensional velocity image and the servo positions of multiple motion time points, uses the servo speed and servo position to jointly determine the change of the servo positions of multiple motion time points, and obtains the predicted position, including: Based on the servo positions at multiple motion time points, detect the changes in the servo positions in different action cycles to obtain multiple time-position images; the time-position images represent the waiting positions corresponding to the same motion time point in multiple action cycles; the motion time point represents the time point counted from the starting time point in the action cycle. Input the time-position images into a position convolutional network to obtain position feature maps; multiple time-position images correspondingly obtain multiple position feature maps.

[0053] Among them, the position feature map represents the relationship of the waiting positions at the same motion time point in multiple action cycles.

[0054] Among them, the position convolutional network is a Convolutional Neural Networks (CNN).

[0055] Segment the three-dimensional velocity image by motion time point to obtain multiple time-velocity images; the time-velocity images represent the waiting velocities corresponding to the motion time point in multiple action cycles.

[0056] Among them, the relationship between the time-velocity image, the three-dimensional velocity image, and the servo velocity image is as Figure 5 shown.

[0057] Input the time-velocity images into a velocity convolutional network to detect the relationship of the waiting velocities at the motion time point in multiple action cycles and obtain velocity feature maps; multiple time-velocity images correspondingly obtain multiple velocity feature maps.

[0058] Among them, the velocity convolutional network is a Recurrent Neural Network (RNN).

[0059] Fuse the position feature map and the velocity feature map to obtain a velocity trajectory feature map.

[0060] Among them, the velocity trajectory feature map represents the common changes in the positions and velocities in multiple action cycles at the same motion time point.

[0061] Among them, in this embodiment, a pyramid structure is adopted for fusion. After converting the position feature maps and velocity feature maps with different sizes into the same size, the corresponding positions are averaged.

[0062] Multiple motion time points correspondingly obtain multiple velocity trajectory feature maps.

[0063] Arrange the multiple velocity trajectory feature maps in order from the earliest time point to the latest time point and input them into a time convolutional network in sequence to detect the changes in adjacent action cycles and obtain predicted positions.

[0064] Among them, if the first action cycle is [1, 2, 3, 4, 5, 6], the second action cycle is [7, 8, 9, 10, 11, 12], and the third action cycle is [13, 14, 15, 16, 17, 18], 1 represents the 1st hour, 2 represents the 2nd hour, …, 18 represents the 18th hour. The first action cycle, the second action cycle, and the third action cycle are input into the temporal convolutional network in sequence.

[0065] Among them, the temporal convolutional network is a temporal convolutional network (TCN), which is a time series prediction model based on the convolutional neural network (CNN).

[0066] Optionally, the servo speed based on the anomaly matrix and multiple motion time points obtains the first anomaly feature through the trained first convolutional neural network and second convolutional neural network, including: Input the anomaly matrix into the trained first convolutional neural network to detect anomalies as a whole and obtain the first detection feature. The first convolutional neural network contains a 2*2 convolutional kernel.

[0067] Among them, in this embodiment, the first convolutional neural network is a convolutional neural network (Convolutional Neural Networks, CNN), which contains a 2*2 convolutional kernel, takes a stride of 2, traverses the anomaly matrix for convolution, and makes an overall judgment to obtain the first detection feature.

[0068] Among them, taking a stride of 2 and convolving the 2*2 convolutional kernel on the marked anomaly matrix means detecting only the correlation between the predicted position and the actual position in each layer of the anomaly tree, rather than detecting the correlation between adjacent layers.

[0069] Calculate the variance of the waiting speeds corresponding to multiple action cycles at the same motion time point in the three-dimensional speed image to obtain the speed offset value; multiple speed offset values are obtained corresponding to multiple motion time points.

[0070] Take the motion time points with speed offset values greater than the variance threshold as the marked motion time points.

[0071] Among them, in this embodiment, the variance threshold is 0.5.

[0072] Among them, if the speed offset value is less than or equal to the variance threshold, it means that the device controlled by the servo motor is operating normally.

[0073] Among them, the speed offset value being greater than the variance threshold means that the deviation of the speed of the device controlled by the servo motor due to external forces is greater than the preset deviation.

[0074] In the anomaly matrix, extract the nodes corresponding to the marked motion time points to obtain the marked anomaly matrix.

[0075] Among them, if the marked motion time point is 1, extract the nodes corresponding to B and C in the anomaly tree, that is, extract the first and second rows in the anomaly matrix as the marked anomaly matrix.

[0076] Input the marked anomaly matrix into the second convolutional neural network to locally detect anomalies and obtain the second detection feature.

[0077] Among them, in this embodiment, the second convolutional neural network is a Convolutional Neural Networks (CNN), which includes a 2*2 convolutional kernel, with a stride of 2, and traverses the marked anomaly matrix for convolution to obtain the second detection feature.

[0078] Fuse the first detection feature and the second detection feature to obtain the first anomaly feature.

[0079] Among them, in this embodiment, the fusion method is to average the values of the first detection feature and the second detection feature at the marked motion time point, and use the averaged value to replace the value of the second detection feature at the marked motion time point to obtain the first anomaly feature.

[0080] Optionally, based on the anomaly matrix, detecting the change between the predicted position and the actual position to obtain the second anomaly feature includes: Obtain a stride value; the stride value is a positive even number; Use a 2*u two-dimensional convolutional kernel, with the stride value as the stride, and perform convolution in the column direction of the anomaly matrix to find the change in the correlation relationship between the predicted position and the actual position, and obtain multiple differential position features.

[0081] Among them, in this embodiment, the fact that the stride value is a positive even number is determined by the existence of two nodes in each layer.

[0082] Among them, in this embodiment, the two-dimensional convolutional kernel of 2*u corresponds to a Convolutional Neural Networks (CNN) that outputs two values, one representing anomaly and the other representing normal. The second anomaly feature is the feature before classification when the two values are output. Train the 2*u two-dimensional convolutional kernel with the output values of the convolutional neural network (Convolutional Neural Networks, CNN) corresponding to the historical data and the marked anomaly values. The marked anomaly value is 1 for anomaly and 0 for normal. Use the cross-entropy loss function to calculate the loss for backward training.

[0083] Average the multiple differential position features at the same level to obtain a second abnormal feature.

[0084] u represents the number of columns of the abnormal matrix.

[0085] Wherein, u is a positive integer.

[0086] Optionally, detecting the change of the servo position in different action cycles based on the servo positions at multiple motion time points to obtain multiple time-position images, including: Fit the servo positions at multiple motion time points in ascending order of the motion time points to obtain a three-dimensional trajectory curve; the three-dimensional trajectory curve represents the positions of the device controlled by the servo motor at multiple motion time points.

[0087] Wherein, the positions at multiple motion time points are positions in three dimensions.

[0088] Wherein, in this embodiment, the servo position at one motion time point is marked with 1 in a three-dimensional image. The initial value of the three-dimensional image is 0. The marked servo position in the three-dimensional image represents the servo position of the device controlled by the servo motor at multiple motion time points. Multiple three-dimensional images are obtained at multiple motion time points. The marked positions in multiple three-dimensional images are fused into 1 three-dimensional image. Fit the corresponding positions in sequence from the earliest time point to the latest time point to obtain a three-dimensional trajectory curve.

[0089] Wherein, in this embodiment, polynomial fitting is adopted.

[0090] Draw the three-dimensional trajectory curve in a three-dimensional trajectory image.

[0091] Multiple action cycles correspondingly obtain multiple three-dimensional trajectory images.

[0092] Arrange multiple three-dimensional trajectory images in order from the earliest time point to the latest time point to obtain an arranged trajectory image.

[0093] Wherein, the arranged trajectory image is a three-dimensional image. The length of the arranged trajectory image is equal to the length of the three-dimensional trajectory image, the height of the arranged trajectory image is equal to the height of the three-dimensional trajectory image, and the width of the arranged trajectory image is equal to the product of the number of three-dimensional trajectory images and the width of the three-dimensional trajectory image.

[0094] Segment the arranged trajectory image at the same motion time points to obtain multiple time-position images.

[0095] Wherein, the time-position image is a two-dimensional image; the length of the time-position image is equal to the product of the number of three-dimensional trajectory images and the width of the three-dimensional trajectory image; the width of the time-position image is equal to the height of the three-dimensional trajectory image.

[0096] Among them, the relationship between the time position image, the arrangement trajectory image, and the three-dimensional trajectory image is as Figure 4 shown.

[0097] Optionally, constructing an anomaly tree based on multiple prediction time points and corresponding predicted positions includes: Obtaining the root node.

[0098] Obtaining multiple actual positions corresponding to multiple prediction time points.

[0099] Obtaining a first time point and a second time point among multiple prediction time points; the first time point is earlier than the second time point.

[0100] Taking the predicted position corresponding to the first time point as the left child node of the root node.

[0101] Taking the actual position corresponding to the first time point as the right child node of the root node.

[0102] Taking the predicted position corresponding to the second time point as the left child node of the node corresponding to the actual position of the first time point.

[0103] Taking the actual position corresponding to the second time point as the right child node of the node corresponding to the actual position of the first time point.

[0104] Constructing 2v child nodes corresponding to v prediction time points to obtain an anomaly tree.

[0105] Where v is a positive integer.

[0106] One level of the anomaly tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.

[0107] Optionally, the predicted position network includes a time convolutional network, a speed convolutional network, and a position convolutional network.

[0108] Backward training the time convolutional network, the speed convolutional network, and the position convolutional network to obtain a trained predicted position network.

[0109] Specifically, in this embodiment, during the training process, the opportunistic information of historical time points is input into the predicted position network to obtain historical predicted positions. The labeled positions are obtained; the labeled positions represent the actual positions reached by the devices controlled by the servo motors corresponding to the historical predicted positions. Calculating the loss between the labeled positions and the historical predicted positions through a cross-entropy loss function, and backward training the time convolutional network, the speed convolutional network, and the position convolutional network to obtain a trained predicted position network.

[0110] Optionally, determining anomalies based on the servo speeds at multiple motion time points to obtain a three-dimensional speed map includes: In a binary image, mark the positions corresponding to the servo speeds at multiple motion time points, set the values to 1, and obtain a servo speed image; the length of the binary image represents the motion time points, and the width represents the servo speeds.

[0111] Among them, the initial values in the binary image are all 0.

[0112] Among them, the servo speed image is a discrete dot graph.

[0113] Multiple action cycles correspond to obtaining multiple servo speed images.

[0114] Among them, one servo speed image corresponds to one action cycle.

[0115] Overlay multiple servo speed images to obtain a three-dimensional speed image.

[0116] Among them, in this embodiment, the servo speed images corresponding to the action cycles from the earliest to the latest time points are overlaid in sequence.

[0117] Obtain a 2*n*m three-dimensional convolution kernel.

[0118] n corresponds to the length of the three-dimensional speed image; m corresponds to the width of the three-dimensional speed image.

[0119] Among them, n and m are positive integers.

[0120] With a step size of 2, perform convolution on the three-dimensional convolution kernel in the height direction of the three-dimensional speed image to detect the change in the servo speed between adjacent two action cycles and determine whether there is an abnormality.

[0121] Among them, in this embodiment, the 2*n*m three-dimensional convolution kernel corresponds to a three-dimensional convolutional neural network (3DConvolutional Neural Networks, 3D CNN). Use marked outliers to train the three-dimensional convolutional neural network (3D Convolutional Neural Networks, 3D CNN) corresponding to the three-dimensional convolution kernel. If there is an abnormality, the marked outlier value is 1, and if there is no abnormality, the marked outlier value is 0.

[0122] If there is no abnormality in the servo speed, output the three-dimensional speed image. If there is an abnormality in the servo speed, send a warning signal.

[0123] Embodiment 2: Based on the above servo motor control method with an anomaly detection function, the present invention embodiment also provides a servo motor control system with an anomaly detection function, and the system includes: An acquisition module is used to acquire multiple opportunity information; the opportunity information includes servo positions and servo speeds at multiple movement time points; the servo position indicates the position of a device controlled by a servo motor from the servo motor; the servo speed indicates the speed of rotation of the servo motor at the current time point; one opportunity information corresponds to one action cycle; the movement time point indicates a time point measured from the starting time point in the action cycle.

[0124] The servo speed detection module is used to identify abnormalities based on the servo speeds at multiple motion time points and obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at multiple motion time points in multiple action cycles.

[0125] The servo position detection module is used to obtain a predicted position by using a trained prediction position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, using the servo speed and servo position to jointly determine the changes in the servo positions at multiple motion time points; the predicted position represents the servo position predicted at the predicted time point; and multiple predicted positions are obtained corresponding to multiple prediction time points.

[0126] The abnormal tree module is used to construct an abnormal tree based on multiple predicted time points and corresponding predicted positions; the abnormal tree represents the predicted positions and actual positions of the multiple predicted time points.

[0127] The abnormality detection module is used to detect the tree structure based on the abnormal tree and the servo speeds at multiple motion time points to determine whether it is abnormal.

[0128] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0129] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0130] Each component embodiment of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the device according to the embodiments of the present invention. The present invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing part or all of the methods described herein. Such a program for implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

Claims

1. A servo motor control method with an abnormal detection function, characterized in that, Including: Obtaining a plurality of waiting information; the waiting information includes the servo position and servo speed at multiple motion time points; the servo position represents the position of the device controlled by the servo motor from the servo motor; the servo speed represents the speed of rotation of the servo motor at the current time point; one waiting information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle; Based on the servo speeds at multiple motion time points, determining anomalies to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at multiple motion time points of multiple action cycles; Through the trained prediction position network, based on the three-dimensional speed image and the servo positions at multiple motion time points, using the servo speed and servo position to jointly determine the change of the servo position at multiple motion time points, obtaining a predicted position; the predicted position represents the servo position predicted at the prediction time point; Multiple predicted positions are obtained corresponding to multiple prediction time points; Based on multiple prediction time points and the corresponding predicted positions, constructing an anomaly tree; the anomaly tree represents the predicted positions and actual positions at multiple prediction time points; Based on the anomaly tree and the servo speeds at multiple motion time points, detecting the tree structure to determine whether there is an anomaly.

2. The servo motor control method with an anomaly detection function according to claim 1, characterized in that, The detecting the tree structure based on the anomaly tree and the servo speeds at multiple motion time points to determine whether there is an anomaly includes: Using the parent representation method to convert the anomaly tree into an anomaly matrix; Based on the anomaly matrix and the servo speeds at multiple motion time points, through the trained first convolutional neural network and second convolutional neural network, obtaining a first anomaly feature; the first anomaly feature represents the feature of whether the anomaly matrix detecting the servo speed anomaly is also abnormal in position; Based on the anomaly matrix, detecting the change between the predicted position and the actual position, obtaining a second anomaly feature; the second anomaly feature represents the difference between the predicted position and the actual position at one time point; Obtaining a first historical anomaly feature; the first historical anomaly feature represents the feature output after the anomaly matrix at the historical time point is input into the trained first convolutional neural network; Calculating the Mahalanobis distance between the first historical anomaly feature and the first anomaly feature to obtain a first anomaly value; the first anomaly value represents the gap between the state of the servo motor at the current time point and the state of the servo motor at the historical time point; Calculating the variance of multiple values in the second anomaly feature to obtain a second anomaly value; the second anomaly value represents the gap between the predicted position and the actual position of the servo motor at multiple motion time points; If the first anomaly value is greater than the first threshold or the second anomaly value is greater than the second threshold, it is set as an anomaly.

3. The servo motor control method with an anomaly detection function according to claim 1, wherein The obtaining the predicted position through the trained prediction position network, based on the three-dimensional speed image and the servo positions at multiple motion time points, using the servo speed and servo position to jointly determine the change of the servo position at multiple motion time points includes: Based on the servo positions at multiple motion time points, detecting the change of the servo position in different action cycles to obtain a plurality of time-position images; the time-position image represents the waiting positions corresponding to the same motion time point in multiple action cycles; Input the time-position image into the position convolutional network to obtain a position feature map; multiple time-position images correspondingly obtain multiple position feature maps; Segment the three-dimensional velocity image at the motion time points to obtain multiple time-velocity images; the time-velocity images represent the waiting velocities corresponding to the motion time points in multiple action cycles; Input the time-velocity images into the velocity convolutional network to detect the relationship of the waiting velocities at the motion time points in multiple action cycles, and obtain a velocity feature map; multiple time-velocity images correspondingly obtain multiple velocity feature maps; Fuse the position feature map and the velocity feature map to obtain a velocity trajectory feature map; Multiple motion time points correspondingly obtain multiple velocity trajectory feature maps; According to the time points from early to late, input the multiple velocity trajectory feature maps into the time convolutional network in sequence to detect the changes in adjacent action cycles, and obtain the predicted position.

4. The servo motor control method with an anomaly detection function according to claim 2, characterized in that, Based on the abnormal matrix and the servo velocities at multiple motion time points, through the trained first convolutional neural network and the second convolutional neural network, obtain the first abnormal feature, including: Input the abnormal matrix into the trained first convolutional neural network to detect the abnormality as a whole, and obtain a first detection feature; the first convolutional neural network includes a 2*2 convolutional kernel; Calculate the variance of the waiting velocities corresponding to multiple action cycles at the same motion time point in the three-dimensional velocity image to obtain a velocity offset value; multiple motion time points correspondingly obtain multiple velocity offset values; Take the motion time points with velocity offset values greater than the variance threshold as marked motion time points; In the abnormal matrix, extract the nodes corresponding to the marked motion time points to obtain a marked abnormal matrix; Input the marked abnormal matrix into the second convolutional neural network to detect the abnormality locally and obtain a second detection feature; Fuse the first detection feature and the second detection feature to obtain the first abnormal feature.

5. The servo motor control method with an abnormality detection function according to claim 2, characterized in that Based on the abnormal matrix, detect the changes between the predicted position and the actual position to obtain the second abnormal feature, including: Obtain a step value; the step value is a positive even number; Use a 2*u two-dimensional convolutional kernel and take the step value as the step to perform convolution in the column direction of the abnormal matrix to find the change in the correlation relationship between the predicted position and the actual position, and obtain multiple differential position features; Take the average value of multiple differential position features at the same level to obtain the second abnormal feature; u represents the number of columns of the abnormal matrix.

6. The servo motor control method with an abnormal detection function according to claim 3, characterized in that, Based on the servo positions at multiple motion time points, detect the changes in the servo positions in different action cycles to obtain multiple time-position images, including: Fit the servo positions at multiple motion time points from small to large to obtain a three-dimensional trajectory curve; the three-dimensional trajectory curve represents the positions of the device controlled by the servo motor at multiple motion time points; Draw the three-dimensional trajectory curve in a three-dimensional trajectory image; Multiple action cycles correspondingly obtain multiple three-dimensional trajectory images; Arrange the multiple three-dimensional trajectory images according to the time points from early to late to obtain an arranged trajectory image; Segment the arranged trajectory image at the same motion time point to obtain multiple time-position images.

7. The servo motor control method with an anomaly detection function according to claim 1, characterized in that Based on multiple prediction time points and the corresponding predicted positions, construct an abnormal tree, including: Obtain the root node; Obtain multiple actual positions corresponding to multiple prediction time points; Obtain a first time point and a second time point among the multiple prediction time points; the first time point is earlier than the second time point; Take the predicted position corresponding to the first time point as the left node of the root node; Take the actual position corresponding to the first time point as the right node of the root node; Take the predicted position corresponding to the second time point as the left child node of the node corresponding to the actual position of the first time point; Take the actual position corresponding to the second time point as the right child node of the node corresponding to the actual position of the first time point; Construct 2v child nodes corresponding to v prediction time points to obtain an anomaly tree; One level of the anomaly tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.

8. The servo motor control method with an anomaly detection function according to claim 2, characterized in that, The predicted position network includes a temporal convolutional network, a velocity convolutional network, and a position convolutional network; Backward train the temporal convolutional network, the velocity convolutional network, and the position convolutional network to obtain a trained predicted position network.

9. The servo motor control method with an anomaly detection function according to claim 1, characterized in that, Based on the servo velocities at multiple motion time points, discriminate anomalies to obtain a three-dimensional velocity image, including: In the binary image, mark the positions corresponding to the servo velocities at multiple motion time points as 1 to obtain a servo velocity image; the length of the binary image represents the motion time points, and the width represents the servo velocities; Obtain multiple servo velocity images corresponding to multiple action cycles; Overlay the multiple servo velocity images to obtain a three-dimensional velocity image; Obtain a three-dimensional convolutional kernel of 2*n*m; n corresponds to the length of the three-dimensional velocity image; m corresponds to the width of the three-dimensional velocity image; With a stride of 2, perform convolution of the three-dimensional convolutional kernel in the height direction of the three-dimensional velocity image to detect the change in servo velocity between adjacent two action cycles and determine whether there are anomalies; If there are no anomalies in the servo velocity, output the three-dimensional velocity image; if there are anomalies in the servo velocity, send a warning signal.

10. A servo motor control system with an abnormal detection function, characterized in that, Including: An acquisition module for acquiring multiple waiting information; the waiting information includes the servo positions and servo velocities at multiple motion time points; the servo position represents the position of the device controlled by the servo motor relative to the servo motor; the servo velocity represents the speed of rotation of the servo motor at the current time point; one waiting information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle; A servo velocity detection module for discriminating anomalies based on the servo velocities at multiple motion time points to obtain a three-dimensional velocity image; the three-dimensional velocity image represents the servo velocities at multiple motion time points of multiple action cycles; A servo position detection module for, through the trained predicted position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, jointly discriminate the change in the servo positions at multiple motion time points using the servo velocity and the servo position to obtain predicted positions; the predicted position represents the servo position predicted at the prediction time point; multiple predicted positions are obtained corresponding to multiple prediction time points; An anomaly tree module for constructing an anomaly tree based on multiple prediction time points and the corresponding predicted positions; the anomaly tree represents the predicted positions and actual positions at multiple prediction time points; An anomaly detection module, which is used to detect a tree structure and determine whether there is an anomaly based on the anomaly tree and the servo speeds at multiple motion time points.

Citation Information

Patent Citations

  • Servo motor rotating speed adjusting method and system based on three-dimensional fuzzy control

    CN111181467A

  • Multi-dimensional time series data real-time anomaly detection method using unsupervised deep neural network

    CN113568774A

  • Multi-layer framework intelligent operation and maintenance and predictive maintenance method and system for rail transit platform door

    CN119539768A

  • Wind driven generator anomaly detection method and system based on SCADA periodic data

    CN120042753A

  • Diagnosis device, diagnosis method, and diagnosis program

    US20230204457A1