Servo motor control method and system with abnormality detection function
By constructing a three-dimensional speed image and anomaly tree and combining it with a convolutional neural network to detect the servo position and speed of the servo motor, the problem of inaccurate anomaly detection of the servo motor is solved, and accurate judgment and real-time monitoring of the servo motor status are achieved.
Patent Information
- Application Number
- CN202510727628.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing technology does not accurately detect abnormalities in servo motors, making it difficult to effectively determine the operating status of the servo motors.
By acquiring the servo position and servo speed information of the servo motor, constructing a three-dimensional speed image and anomaly tree, and combining convolutional neural networks for abnormal feature detection, the anomaly is judged based on the difference between the predicted position and the actual position. Multiple neural network models are used for feature extraction and fusion to achieve accurate judgment of the servo motor status.
The accuracy of servo motor anomaly detection is improved, the difference between the neural network detection output and the actual position is reduced, and real-time monitoring of the servo motor status and abnormality warning are realized.
Smart Images

Figure CN120281239B_ABST
Abstract
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 abnormality detection function. Background Art
[0002] Currently, position control is a common operating mode in servo control. In this mode, the controller specifies the target position by sending a series of pulse signals, and the driver adjusts the position based on these pulses. The servo motor can convert the voltage signal into servo speed, thereby driving the controlled object. It controls the rotation of the motor by receiving pulse signals. The servo motor operates in a closed-loop system and can provide real-time feedback on the servo position and servo speed. Servo-controlled servo motors can be used for data collection, visualization, and data analysis, as well as for anomaly detection. However, how to more accurately determine the accuracy of servo motor anomaly detection is also a problem. Summary of the Invention
[0003] The object of the present invention is to provide a servo motor control method and system with an abnormality detection function to solve the above-mentioned 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 abnormality detection function, comprising:
[0005] Acquire multiple waiting information; the waiting information includes servo positions and servo speeds at multiple motion time points; the servo position indicates the position of the device controlled by the servo motor relative to the servo motor; the servo speed indicates the speed of the servo motor rotation at the current time point; one waiting information corresponds to one motion cycle; the motion time point indicates a time point measured from the start time point of the motion cycle;
[0006] Based on the servo speed at multiple motion time points, abnormalities are identified to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speed at multiple motion time points in multiple action cycles;
[0007] Using a trained prediction position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, the servo velocity and servo position are used to jointly discriminate changes in the servo positions at the multiple motion time points to obtain a predicted position; the predicted position represents the servo position predicted at the predicted time point;
[0008] Multiple prediction time points correspond to multiple prediction positions;
[0009] Constructing an anomaly tree based on multiple predicted time points and corresponding predicted positions; the anomaly tree represents the predicted positions and actual positions of the multiple predicted time points;
[0010] Based on the abnormal tree and the servo speeds at multiple motion time points, the tree structure is detected to determine whether it is abnormal.
[0011] Optionally, detecting the tree structure based on the abnormal tree and the servo speeds at multiple motion time points to determine whether it is abnormal includes:
[0012] Using a parent representation method, the anomaly tree is converted into an anomaly matrix;
[0013] Based on the abnormal matrix and the servo speeds at multiple motion time points, a first abnormal feature is obtained through the trained first convolutional neural network and the second convolutional neural network; the first abnormal feature indicates whether the abnormal matrix for detecting the abnormal servo speed is also abnormal in position;
[0014] Based on the anomaly matrix, detecting a change between the predicted position and the actual position to obtain a second anomaly feature; the second anomaly feature represents a difference between the predicted position and the actual position at a time point;
[0015] Obtaining a first historical anomaly feature; wherein the first historical anomaly feature represents a feature output after an anomaly matrix at a historical time point is input into a trained first convolutional neural network;
[0016] Calculating the Mahalanobis distance between the first historical abnormal feature and the first abnormal feature to obtain a first abnormal value; the first abnormal value represents the difference between the state of the servo motor at the current time point and the state of the servo motor at the historical time point;
[0017] Calculating the variance of multiple values in the second abnormal feature to obtain a second abnormal value; the second abnormal value represents the difference between the predicted position and the actual position of the servo motor at multiple movement time points;
[0018] 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.
[0019] Optionally, the method of using a trained prediction position network to jointly discriminate changes in the servo positions at multiple motion time points using the servo speed and servo position based on the three-dimensional velocity image and the servo positions at multiple motion time points to obtain the predicted position includes:
[0020] Based on the servo positions at multiple motion time points, detecting changes in the servo positions in different motion cycles to obtain multiple time position images; the time position images represent the corresponding servo positions at the same motion time point in multiple motion cycles;
[0021] The time position image is input into the position convolution network to obtain a position feature map; multiple time position images correspond to multiple position feature maps;
[0022] Segmenting the three-dimensional velocity image by motion time points to obtain a plurality of time velocity images; the time velocity images represent the corresponding skew velocity at the motion time points in a plurality of action cycles;
[0023] The time-speed image is input into the speed neural network to detect the relationship between the motion time point and the skew speed in multiple action cycles to obtain a speed feature map; multiple time-speed images correspond to multiple speed feature maps;
[0024] Fuse the position feature map and the speed feature map to obtain the speed trajectory feature map;
[0025] Multiple speed trajectory feature maps are obtained corresponding to multiple motion time points;
[0026] According to the time points from early to late, multiple speed trajectory feature maps are sequentially input into the temporal convolutional network to detect the changes in adjacent action cycles and obtain the predicted position.
[0027] Optionally, the first abnormal feature is obtained based on the abnormal matrix and the servo speeds at multiple motion time points by using a trained first convolutional neural network and a trained second convolutional neural network, including:
[0028] Inputting the anomaly matrix into a trained first convolutional neural network to detect anomalies as a whole and obtain a first detection feature; the first convolutional neural network includes a 2*2 convolution kernel;
[0029] Calculate the variance of the waiting speed corresponding to multiple motion cycles at the same motion time point in the three-dimensional velocity image to obtain a velocity offset value; obtain multiple velocity offset values corresponding to multiple motion time points;
[0030] The movement time point where the speed offset value is greater than the variance threshold is used as the marked movement time point;
[0031] In the anomaly matrix, the nodes corresponding to the marked motion time points are extracted to obtain the marked anomaly matrix;
[0032] Inputting the labeled anomaly matrix into a second convolutional neural network, locally detecting anomalies, and obtaining a second detection feature;
[0033] The first detection feature and the second detection feature are fused to obtain a first abnormal feature.
[0034] Optionally, detecting a change between the predicted position and the actual position based on the anomaly matrix to obtain a second anomaly feature includes:
[0035] Obtain a step value; the step value is a positive even number;
[0036] A 2*u two-dimensional convolution kernel is used to perform convolution in the column direction of the anomaly matrix with a step value as the step, to find the change of the correlation between the predicted position and the actual position, and obtain a plurality of difference position features;
[0037] The plurality of difference position features of the same level are averaged to obtain a second anomaly feature;
[0038] u represents the number of columns of the anomaly matrix.
[0039] Optionally, the servo positions based on a plurality of motion time points are detected to obtain a plurality of time position images by detecting the change of the servo positions in different action cycles, including:
[0040] The servo positions of the plurality of motion time points are fitted according to the 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 the plurality of motion time points;
[0041] The three-dimensional trajectory curve is drawn in a three-dimensional trajectory image;
[0042] A plurality of three-dimensional trajectory images are obtained corresponding to a plurality of action cycles;
[0043] The plurality of three-dimensional trajectory images are arranged according to the time points from early to late to obtain an arranged trajectory image;
[0044] The arranged trajectory image is segmented with the same motion time points to obtain a plurality of time position images.
[0045] Optionally, the anomaly tree is constructed based on a plurality of prediction time points and corresponding prediction positions, including:
[0046] A root node is obtained;
[0047] A plurality of actual positions corresponding to a plurality of prediction time points are obtained;
[0048] A first time point and a second time point are obtained from the plurality of prediction time points; the first time point is earlier than the second time point;
[0049] The prediction position corresponding to the first time point is taken as the left node of the root node;
[0050] The actual position corresponding to the first time point is taken as the right node of the root node;
[0051] The prediction position corresponding to the second time point is taken as the left child node of the node corresponding to the actual position of the first time point;
[0052] The actual position corresponding to the second time point is taken as the right child node of the node corresponding to the actual position of the first time point;
[0053] v prediction time points correspond to construct 2v sub-nodes, to obtain an anomaly tree;
[0054] One level of the anomaly tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.
[0055] Optionally, the predicted position network comprises a time convolution network, a speed neural network and a position convolution network.
[0056] The time convolution network, the speed neural network and the position convolution network are trained backwardly to obtain a trained predicted position network.
[0057] Optionally, the servo speed based on the plurality of motion time points is used to determine the anomaly to obtain a three-dimensional speed image, comprising:
[0058] In a binary image, the positions corresponding to the servo speed of the plurality of motion time points are marked with a value of 1 to obtain a servo speed image; the length of the binary image represents the motion time point, and the width represents the servo speed.
[0059] A plurality of action cycles correspond to obtain a plurality of servo speed images.
[0060] The plurality of servo speed images are superimposed to obtain a three-dimensional speed image.
[0061] A three-dimensional convolution kernel of 2*n*m is obtained.
[0062] n corresponds to the length of the three-dimensional speed image; m corresponds to the width of the three-dimensional speed image.
[0063] With a step of 2, the three-dimensional convolution kernel is convolved in the height direction of the three-dimensional speed image to detect the change of the servo speed of adjacent two action cycles and determine whether there is an anomaly.
[0064] If the servo speed does not have an anomaly, the three-dimensional speed image is output, and if the servo speed has an anomaly, a warning signal is sent.
[0065] In a second aspect, an embodiment of the present application provides a servo motor control system with an anomaly detection function, comprising:
[0066] An acquisition module is configured to acquire a plurality of servo information; the servo information comprises servo positions and servo speeds of a plurality of motion time points; the servo position represents the position of a device controlled by the servo motor from the servo motor; the servo speed represents the speed of the servo motor at the current time point; one servo information corresponds to one action cycle; the motion time point represents the time point counted from the starting time point in the action cycle.
[0067] The servo speed detection module is used for judging the abnormality based on the servo speed of the plurality of motion time points, and obtaining a three-dimensional speed image; the three-dimensional speed image represents the servo speed of the plurality of motion time points of the plurality of motion cycles;
[0068] The servo position detection module is used for judging the change of the servo position of the plurality of motion time points by using the servo speed and the servo position based on the three-dimensional speed image and the servo position of the plurality of motion time points through the trained prediction position network, and obtaining a prediction position; the prediction position represents the predicted servo position at a prediction time point; a plurality of prediction positions are obtained by corresponding a plurality of prediction time points;
[0069] The abnormality tree module is used for constructing an abnormality tree based on the plurality of prediction time points and the corresponding prediction positions; the abnormality tree represents the prediction position and the actual position of the plurality of prediction time points;
[0070] The abnormality detection module is used for detecting the tree structure based on the abnormality tree and the servo speed of the plurality of motion time points, and judging whether it is abnormal.
[0071] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0072] In the present application, the one-dimensional servo speed is converted into a three-dimensional speed image in the order of time points, and the abnormality is judged. The servo speed is used as the prior judgment of the abnormality. If it is normal, the servo position is further judged. The servo position of the prediction time point is obtained according to the servo position of the historical time point. The prediction position corresponding to the prediction time point and the actual position are used to construct an abnormality tree. The abnormality tree represents the time points by levels, and represents the prediction position and the actual position by two nodes in one level. The abnormality tree is converted into an abnormality matrix. According to the convolution, the correlation between the prediction position and the actual position is detected. The prediction position of the prediction time point is compared with the corresponding actual position, which is used as the first judgment of the abnormality. The change of the difference between the actual position and the prediction position is used for the second judgment of the abnormality, so as to reduce the difference between the output data of the neural network detection and the actual position. BRIEF DESCRIPTION OF DRAWINGS
[0073] Figure 1 It is a flow chart of a servo motor control method provided by the embodiment of the present application and having an abnormality detection function.
[0074] Figure 2 It is a schematic diagram of the relationship between the historical time point and the prediction time point in the flow chart of the servo motor control method provided by the embodiment of the present application and having an abnormality detection function.
[0075] Figure 3 It is a schematic diagram of the conversion process of the conversion of the abnormality tree into the abnormality matrix in the flow chart of the servo motor control method provided by the embodiment of the present application and having an abnormality detection function.
[0076] Figure 4 This is a schematic diagram of the relationship between the time position image, the arrangement trajectory image and the three-dimensional trajectory image in the flow chart of a servo motor control method with an abnormality detection function provided by an embodiment of the present invention.
[0077] Figure 5 This is a schematic diagram of the relationship between a time speed image, a three-dimensional speed image, and a servo speed image in a flow chart of a servo motor control method with an abnormality detection function provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The present invention will be described in detail below with reference to the accompanying drawings.
[0079] Example 1: Figure 1 As shown, an embodiment of the present invention provides a servo motor control method with an abnormality detection function, the method comprising:
[0080] S101: Acquire multiple servo information; the servo information includes the servo position and servo speed of multiple motion time points; the servo position indicates the position of the device controlled by the servo motor from the servo motor; the servo speed indicates the speed of rotation of the servo motor at the current time point; one servo information corresponds to one action cycle; the motion time point indicates the time point measured from the starting time point in the action cycle.
[0081] For example, if the first motion cycle is [1, 2, 3, 4, 5, 6], the second motion cycle is [7, 8, 9, 10, 11, 12], and the third motion cycle is [13, 14, 15, 16, 17, 18], 1 represents the first hour, 2 represents the second hour, and so on, 18 represents the eighteenth hour. The first motion time point corresponds to the time point of each motion cycle as [1, 7, 13], and the second motion time point corresponds to the time point of each motion cycle as [2, 8, 14].
[0082] The number of motion time points in the plurality of motion cycles is the same.
[0083] An action cycle represents the length of time it takes a servo motor to complete one action. Multiple action cycles corresponding to multiple waiting information correspond to the same action. For example, a servo motor controlling a robot to raise its hand represents one action cycle. Repeatedly completing the same hand-raising action represents multiple action cycles, resulting in multiple waiting information.
[0084] Servo speed is typically expressed in revolutions per minute (RPM) or angular velocity (rad / s). The servo motor's speed can be precisely adjusted using a controller. For example, in equipment like machining centers and 3D printers, the motor can be set to run at a constant speed or according to a specific speed curve. Servo speed affects the equipment's production efficiency. In applications like automated equipment, conveyor belts, and robotics, higher speeds translate to higher efficiency.
[0085] S102: Based on the servo speeds at multiple motion time points, abnormalities are determined to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speeds at multiple motion time points in multiple action cycles.
[0086] S103: Using the trained prediction position network, based on the three-dimensional velocity image and the servo positions at the multiple motion time points, the servo velocity and servo position are used to jointly determine the change in the servo position at the multiple motion time points to obtain a predicted position; the predicted position represents the servo position predicted at the predicted time point;
[0087] In this embodiment, the predicted time point represents the next time point of the latest time point corresponding to the input three-dimensional velocity image.
[0088] S104: Obtain multiple predicted positions corresponding to multiple predicted time points.
[0089] Among them, the relationship between multiple prediction time points and prediction positions is as follows: Figure 2 shown.
[0090] S105: Constructing an abnormality tree based on the multiple predicted time points and the corresponding predicted positions; the abnormality tree represents the predicted positions and actual positions of the multiple predicted time points.
[0091] The actual position at the predicted time point represents the position that the device controlled by the servo motor actually reaches at the predicted time point.
[0092] S106: Based on the abnormal tree and the servo speeds at multiple motion time points, the tree structure is detected to determine whether it is abnormal.
[0093] Optionally, detecting the tree structure based on the abnormal tree and the servo speeds at multiple motion time points to determine whether it is abnormal includes:
[0094] The anomaly tree is converted into an anomaly matrix using a parent representation method.
[0095] 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 of the anomaly tree, and the third column of the anomaly matrix represents whether the node of the anomaly tree is a left node or a right node.
[0096] The transformation process of abnormal tree into abnormal matrix is as follows: Figure 3 In this embodiment, B, C, D, E, F, and G are used to represent the values of the nodes in the abnormal tree, and non-negative integers starting from 0 are used to represent the levels of the abnormal tree. 1 is used to represent the left node of the abnormal tree, and 2 is used to represent the right node of the abnormal tree. Figure 3 As shown, B represents the left node of level 0, C represents the right node of level 0, and D represents the left node of level 1.
[0097] The anomaly matrix uses a hierarchy to represent the corresponding time points, with 2 representing the actual position and 1 representing the predicted position. Features can be added to obtain the difference between the actual position and the predicted position.
[0098] The parent representation is equivalent to a virtual storage rather than an actual computer storage location.
[0099] Based on the abnormal matrix and the servo speeds at multiple motion time points, a first abnormality feature is obtained through the trained first and second convolutional neural networks. The first abnormality feature indicates whether the abnormal matrix that detects abnormal servo speed is also abnormal in position.
[0100] The first convolutional neural network is a convolutional neural network (CNN). The first convolutional neural network outputs two values, one indicating an abnormality and one indicating a normality. The first abnormality feature is a feature that is generated before classification is performed.
[0101] Anomaly matrices at multiple historical time points are obtained and input into a first convolutional neural network to obtain historical anomaly features and historical anomaly values. The historical anomaly values are the values obtained by classifying the historical anomaly features. In this embodiment, a softmax function is used for classification. The historical anomaly values and the labeled anomaly values are used to train the first convolutional neural network to obtain a trained first convolutional neural network. The labeled anomaly value is 1 for anomaly and 0 for normality. A cross-entropy loss function is used to calculate the loss for backward training.
[0102] Based on the anomaly matrix, a change between the predicted position and the actual position is 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.
[0103] Each value in the second abnormal feature represents a feature of a change between a predicted position and an actual position of adjacent motion time points.
[0104] A first historical anomaly feature is obtained; the first historical anomaly feature represents a feature output after the anomaly matrix at a historical time point is input into the trained first convolutional neural network.
[0105] In this embodiment, the latest time point in the anomaly matrix of the historical time point is earlier than the latest time point in the three-dimensional velocity image. The relationship between the historical time point and the predicted time point is as follows: Figure 2 shown.
[0106] The Mahalanobis distance is calculated between the first historical abnormal feature and the first abnormal feature to obtain a first abnormal value; the first abnormal value represents the difference between the state of the servo motor at the current time point and the state of the servo motor at the historical time point.
[0107] In this embodiment, the Mahalanobis distances of the first historical abnormal feature and the value of the first abnormal feature with the same subscript are calculated respectively as the value of the first abnormal value with the same subscript.
[0108] Where DM(x,y)=√(〖(xy)〗^T Σ^(-1) (xy)). x represents the first historical anomaly feature, y represents the first anomaly feature, and x and y are two one-dimensional vectors. Σ is the covariance matrix. Σ^(-1) is the inverse of the covariance matrix. DM(x,y) represents the first outlier.
[0109] The variance of the plurality of values in the second abnormal feature is calculated to obtain a second abnormal value.
[0110] 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.
[0111] If the first abnormal value is less than or equal to a first threshold, or the second abnormal value is less than or equal to a second threshold, it indicates that the state of the servo motor is normal.
[0112] In this embodiment, the first threshold is 1 and the second threshold is 0.5.
[0113] Optionally, the method of using a trained prediction position network to jointly discriminate changes in the servo positions at multiple motion time points using the servo speed and servo position based on the three-dimensional velocity image and the servo positions at multiple motion time points to obtain the predicted position includes:
[0114] Based on the servo positions at multiple motion time points, changes in the servo positions in different motion cycles are detected to obtain multiple time position images; the time position images represent the corresponding servo positions at the same motion time point in multiple motion cycles; the motion time point represents a time point measured from the start time point in the motion cycle;
[0115] The time position image is input into the position convolution network to obtain a position feature map; multiple time position images correspond to multiple position feature maps.
[0116] The position feature graph represents the relationship between the waiting positions of the same motion time point in multiple motion cycles.
[0117] Wherein, the position convolution network is a convolutional neural network (CNN).
[0118] The three-dimensional velocity image is segmented according to the motion time points to obtain a plurality of time velocity images; the time velocity images represent the corresponding skew velocity at the motion time points in a plurality of action cycles.
[0119] The relationship among the time velocity image, the three-dimensional velocity image and the servo velocity image is as follows: Figure 5 shown.
[0120] The time-speed image is input into the speed neural network to detect the relationship between the motion time point and the skating speed in multiple action cycles to obtain a speed feature map; multiple time-speed images correspond to multiple speed feature maps.
[0121] Wherein, the speed neural network is a recurrent neural network (RNN).
[0122] The position feature map and the velocity feature map are fused to obtain the velocity trajectory feature map.
[0123] The velocity trajectory characteristic diagram represents the common changes in position and velocity of multiple motion cycles at the same motion time point.
[0124] In this embodiment, a pyramid structure is used for fusion, and after the position feature maps and speed feature maps of different sizes are converted into the same size, the corresponding positions are averaged.
[0125] Multiple speed trajectory feature maps are obtained corresponding to multiple motion time points.
[0126] According to the time points from early to late, multiple speed trajectory feature maps are sequentially input into the temporal convolutional network to detect the changes in adjacent action cycles and obtain the predicted position.
[0127] For example, 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 first hour, 2 represents the second hour, and so on, 18 represents the eighteenth hour. The first, second, and third action cycles are sequentially input into the temporal convolutional network.
[0128] The temporal convolutional network (TCN) is a time series prediction model based on convolutional neural network (CNN).
[0129] Optionally, the first abnormal feature is obtained based on the abnormal matrix and the servo speeds at multiple motion time points by using a trained first convolutional neural network and a trained second convolutional neural network, including:
[0130] The anomaly matrix is input into a trained first convolutional neural network to detect anomalies as a whole and obtain a first detection feature. The first convolutional neural network includes a 2*2 convolution kernel.
[0131] In this embodiment, the first convolutional neural network is a convolutional neural network (CNN), which includes a 2*2 convolution kernel, traverses the abnormal matrix for convolution with a step size of 2, and makes an overall judgment to obtain the first detection feature.
[0132] Among them, the step of convolving a 2*2 convolution kernel on the labeled anomaly matrix with a step size of 2 means that only the association relationship between the predicted position and the actual position in each layer of the anomaly tree is detected, and the association relationship between adjacent layers is not detected.
[0133] The variance of the waiting speed corresponding to multiple action cycles at the same motion time point in the three-dimensional velocity image is calculated to obtain a velocity offset value; multiple velocity offset values are obtained corresponding to multiple motion time points.
[0134] The motion time points where the speed offset value is greater than the variance threshold are regarded as marked motion time points.
[0135] In this embodiment, the variance threshold is 0.5.
[0136] If the speed offset value is less than or equal to the variance threshold, it indicates that the device controlled by the servo motor operates normally.
[0137] The fact that the speed offset value is greater than the variance threshold value indicates that the speed deviation of the device controlled by the servo motor due to the external force is greater than a preset deviation.
[0138] In the abnormal matrix, the node corresponding to the marked motion time point is extracted to obtain a marked abnormal matrix.
[0139] Wherein, if the marked motion time point is 1, the nodes corresponding to B and C in the abnormal tree are extracted, that is, the first row and the second row in the abnormal matrix are extracted as the marked abnormal matrix.
[0140] The marked abnormal matrix is input into a second convolutional neural network to locally detect abnormalities to obtain a second detection feature.
[0141] Wherein, in the embodiment, the second convolutional neural network is a convolutional neural network (CNN) containing a 2*2 convolution kernel, which traverses the marked abnormal matrix for convolution with a step of 2 to obtain the second detection feature.
[0142] The first detection feature and the second detection feature are fused to obtain a first abnormal feature.
[0143] Wherein, in the 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 the averaged value replaces the value of the second detection feature at the marked motion time point to obtain the first abnormal feature.
[0144] Optionally, the second abnormal feature is obtained by detecting the change of the predicted position and the actual position based on the abnormal matrix, comprising:
[0145] A step value is obtained; the step value is a positive even number;
[0146] A two-dimensional convolution kernel of 2*u is used to perform convolution in the column direction of the abnormal matrix with the step value as the step to find the change of the association between the predicted position and the actual position to obtain a plurality of difference position features.
[0147] Wherein, in the embodiment, the step value being a positive even number is determined by the existence of two nodes in each level.
[0148] Wherein, in the embodiment, the two-dimensional convolution kernel of 2*u corresponds to a convolutional neural network (CNN) outputting two values, one representing abnormality and the other representing normality. The second abnormal feature is the feature before classification. The two-dimensional convolution kernel of 2*u is trained using historical data and the output value of the convolutional neural network (CNN) corresponding to the two-dimensional convolution kernel of 2*u and the labeled abnormal value, wherein the labeled abnormal value is 1 representing abnormality and 0 representing normality. The cross-entropy loss function is used to calculate the loss for backward training.
[0149] The second abnormal feature is obtained by averaging multiple difference position features at the same level.
[0150] u represents the number of columns in the anomaly matrix.
[0151] Wherein, u is a positive integer.
[0152] Optionally, the servo positions at multiple motion time points are detected based on the servo positions in different motion cycles to obtain multiple time position images, including:
[0153] The servo positions of multiple motion time points are fitted according to the motion time point from small to large to obtain a three-dimensional trajectory curve; the three-dimensional trajectory curve represents the position of the motion device controlled by the servo motor at multiple motion time points.
[0154] The positions of the multiple movement time points are three-dimensional positions.
[0155] In this embodiment, the servo position at a motion time point is marked with a 1 in a three-dimensional image. The initial value of the three-dimensional image is 0. The servo position marked 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 acquired at multiple motion time points. The marked positions in the multiple three-dimensional images are fused into a single three-dimensional image. The corresponding positions are fitted sequentially from early to late at multiple time points to obtain a three-dimensional trajectory curve.
[0156] In this embodiment, polynomial fitting is adopted.
[0157] The three-dimensional trajectory curve is drawn in a three-dimensional trajectory image.
[0158] Multiple action cycles correspond to obtaining multiple three-dimensional trajectory images.
[0159] Arrange the multiple three-dimensional trajectory images according to time points from early to late to obtain an arranged trajectory image.
[0160] The arrangement trajectory image is a three-dimensional image, wherein the length of the arrangement trajectory image is equal to the length of the three-dimensional trajectory image, the height of the arrangement trajectory image is equal to the height of the three-dimensional trajectory image, and the width of the arrangement trajectory image is equal to the product of the number of three-dimensional trajectory images and the width of the three-dimensional trajectory image.
[0161] The arrangement trajectory image is segmented at the same motion time point to obtain a plurality of time position images.
[0162] 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.
[0163] The relationship among the time position image, arrangement trajectory image and three-dimensional trajectory image is as follows: Figure 4 shown.
[0164] Optionally, constructing an anomaly tree based on multiple prediction time points and corresponding prediction positions includes:
[0165] Get the root node.
[0166] Multiple actual locations are obtained corresponding to multiple predicted time points.
[0167] A first time point and a second time point are obtained from a plurality of predicted time points; the first time point is earlier than the second time point.
[0168] The predicted position corresponding to the first time point is taken as the left child node of the root node.
[0169] The actual position corresponding to the first time point is used as the right child node of the root node.
[0170] The predicted position corresponding to the second time point is used as the left child node of the node corresponding to the actual position of the first time point.
[0171] The actual position corresponding to the second time point is used as the right child node of the node corresponding to the actual position at the first time point.
[0172] 2v child nodes corresponding to v prediction time points are constructed to obtain an abnormal tree.
[0173] Wherein, v is a positive integer.
[0174] One level of the abnormal tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.
[0175] Optionally, the predicted position network includes a time convolutional network, a velocity neural network and a position convolutional network.
[0176] Backward training of the time convolutional network, velocity neural network and position convolutional network to obtain a trained prediction position network.
[0177] In this embodiment, during training, historical time point information is input into the prediction position network to obtain historical predicted positions. A labeled position is obtained; the labeled position represents the actual position reached by the device controlled by the servo motor corresponding to the historical predicted position. The labeled position and the historical predicted position are compared using a cross-entropy loss function to calculate the loss. The temporal convolutional network, velocity neural network, and position convolutional network are then trained backward to obtain a trained prediction position network.
[0178] Optionally, the abnormality is determined based on the servo speed at multiple motion time points to obtain a three-dimensional speed map, including:
[0179] In the binary image, positions corresponding to servo speeds at multiple motion time points are marked and the values are set to 1 to obtain a servo speed image; the length of the binary image represents the motion time point, and the width represents the servo speed.
[0180] Wherein, the initial values in the binary image are all 0.
[0181] The servo speed image is a discrete point image.
[0182] Multiple action cycles correspond to obtaining multiple servo speed images.
[0183] Among them, one servo speed image corresponds to one action cycle.
[0184] Multiple servo velocity images are superimposed to obtain a three-dimensional velocity image.
[0185] In this embodiment, the servo speed images corresponding to the action cycles from early to late in time are sequentially superimposed.
[0186] Get a 2*n*m three-dimensional convolution kernel.
[0187] n corresponds to the length of the 3D velocity image; m corresponds to the width of the 3D velocity image.
[0188] Wherein, n and m are positive integers.
[0189] With a step size of 2, the 3D convolution kernel is convolved in the high direction of the 3D velocity image to detect the change in servo speed between two adjacent action cycles and determine whether there is an abnormality.
[0190] In this embodiment, the 2*n*m three-dimensional convolution kernel corresponds to a three-dimensional convolutional neural network (3D CNN). The 3D convolutional neural network (3D CNN) corresponding to the 3D convolution kernel is trained using an anomaly labeling method. If an anomaly is present, the anomaly labeling value is 1; if no anomaly is present, the anomaly labeling value is 0.
[0191] If there is no abnormality in the servo speed, a three-dimensional speed image is output; if there is an abnormality in the servo speed, a warning signal is sent.
[0192] Example 2: Based on the above-mentioned servo motor control method with an abnormality detection function, an embodiment of the present invention further provides a servo motor control system with an abnormality detection function, the system comprising:
[0193] An acquisition module is used to obtain multiple servo information; the servo information includes the servo position and servo speed at multiple motion time points; the servo position indicates the position of the device controlled by the servo motor relative to the servo motor; the servo speed indicates the speed of rotation of the servo motor at the current time point; one servo information corresponds to one action cycle; the motion time point indicates the time point counted from the starting time point in the action cycle.
[0194] 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.
[0195] The servo position detection module is used to use a trained prediction position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, to jointly determine the changes in the servo positions at multiple motion time points using servo speed and servo position to obtain a predicted position; the predicted position represents the servo position predicted at the predicted time point; and multiple predicted positions are obtained corresponding to multiple predicted time points.
[0196] 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.
[0197] 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.
[0198] 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 this type of system. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0199] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may 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.
[0200] The various component embodiments of the present invention may be implemented in hardware, as software modules running on one or more processors, or as a combination thereof. Those skilled in the art will appreciate that, in practice, a microprocessor or digital signal processor (DSP) may be used to implement some or all of the functionality of some or all of the components of the apparatus according to the embodiments of the present invention. The present invention may also be implemented as an apparatus or device program (e.g., a computer program or computer program product) for performing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium or in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
Claims
1. A servo motor control method with an abnormality detection function, characterized in that: include: Acquire multiple waiting information; the waiting information includes servo positions and servo speeds at multiple motion time points; the servo position indicates the position of the device controlled by the servo motor relative to the servo motor; the servo speed indicates the speed of the servo motor rotation at the current time point; one waiting information corresponds to one motion cycle; the motion time point indicates a time point measured from the start time point of the motion cycle; Based on the servo speed at multiple motion time points, abnormalities are identified to obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speed at multiple motion time points in multiple action cycles; Using a trained prediction position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, the servo velocity and servo position are used to jointly discriminate changes in the servo positions at the multiple motion time points to obtain a predicted position; the predicted position represents the servo position predicted at the predicted time point; Multiple prediction time points correspond to multiple prediction positions; Constructing an anomaly tree based on multiple predicted time points and corresponding predicted positions; the anomaly tree represents the predicted positions and actual positions of the multiple predicted time points; Based on the abnormal tree and the servo speed of multiple motion time points, the tree structure is detected to determine whether it is abnormal The detecting the tree structure based on the abnormal tree and the servo speeds at multiple motion time points and determining whether it is abnormal includes: Using a parent representation method, the anomaly tree is converted into an anomaly matrix; Based on the abnormal matrix and the servo speeds at multiple motion time points, a first abnormal feature is obtained through the trained first convolutional neural network and the second convolutional neural network; the first abnormal feature indicates whether the abnormal matrix for detecting the abnormal servo speed is also abnormal in position; Based on the anomaly matrix, detecting a change between the predicted position and the actual position to obtain a second anomaly feature; the second anomaly feature represents a difference between the predicted position and the actual position at a time point; Obtaining a first historical anomaly feature; wherein the first historical anomaly feature represents a feature output after an anomaly matrix at a historical time point is input into a trained first convolutional neural network; Calculating the Mahalanobis distance between the first historical abnormal feature and the first abnormal feature to obtain a first abnormal value; the first abnormal value represents the difference 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 abnormal feature to obtain a second abnormal value; the second abnormal value represents the difference between the predicted position and the actual position of the servo motor at multiple movement 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.
2. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The method of obtaining a predicted position by using the trained prediction position network, based on the three-dimensional velocity image and the servo positions at multiple motion time points, and using the servo velocity 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 changes in the servo positions in different motion cycles to obtain multiple time position images; the time position images represent the corresponding servo positions at the same motion time point in multiple motion cycles; The time position image is input into the position convolution network to obtain a position feature map; multiple time position images correspond to multiple position feature maps; Segmenting the three-dimensional velocity image by motion time points to obtain a plurality of time velocity images; the time velocity images represent the corresponding skew velocity at the motion time points in a plurality of action cycles; The time-speed image is input into the speed neural network to detect the relationship between the motion time point and the skew speed in multiple action cycles to obtain a speed feature map; multiple time-speed images correspond to multiple speed feature maps; Fuse the position feature map and the speed feature map to obtain the speed trajectory feature map; Multiple speed trajectory feature maps are obtained corresponding to multiple motion time points; According to the time points from early to late, multiple speed trajectory feature maps are sequentially input into the temporal convolutional network to detect the changes in adjacent action cycles and obtain the predicted position.
3. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The first abnormal feature is obtained based on the abnormal matrix and the servo speeds of multiple motion time points through the trained first convolutional neural network and the second convolutional neural network, including: Inputting the anomaly matrix into a trained first convolutional neural network to detect anomalies as a whole and obtain a first detection feature; the first convolutional neural network includes a 2*2 convolution kernel; Calculate the variance of the waiting speed corresponding to multiple motion cycles at the same motion time point in the three-dimensional velocity image to obtain a velocity offset value; obtain multiple velocity offset values corresponding to multiple motion time points; The movement time point where the speed offset value is greater than the variance threshold is used as the marked movement time point; In the anomaly matrix, the nodes corresponding to the marked motion time points are extracted to obtain the marked anomaly matrix; Inputting the labeled anomaly matrix into a second convolutional neural network, locally detecting anomalies, and obtaining a second detection feature; The first detection feature and the second detection feature are fused to obtain a first abnormal feature.
4. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The detecting a change between the predicted position and the actual position based on the anomaly matrix to obtain a second anomaly feature includes: Obtain a step value; the step value is a positive even number; Use a 2*u two-dimensional convolution kernel with a step value as the step size, perform convolution in the column direction of the anomaly matrix, find the change in the correlation between the predicted position and the actual position, and obtain multiple difference position features; The average value of multiple difference position features at the same level is calculated to obtain the second abnormal feature; u represents the number of columns in the anomaly matrix.
5. The servo motor control method with an abnormality detection function according to claim 2, characterized in that: The method of detecting changes in the servo position in different motion cycles based on the servo position at multiple motion time points to obtain multiple time position images includes: Fitting the servo positions of multiple motion time points in ascending order of motion time points to obtain a three-dimensional trajectory curve; the three-dimensional trajectory curve represents the position of the moving device controlled by the servo motor at the multiple motion time points; Drawing the three-dimensional trajectory curve in a three-dimensional trajectory image; Multiple action cycles correspond to obtaining 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; The arrangement trajectory image is segmented at the same motion time point to obtain a plurality of time position images.
6. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The constructing of an anomaly tree based on multiple prediction time points and corresponding prediction positions includes: Get the root node; Obtain multiple actual locations corresponding to multiple predicted time points; Obtaining a first time point and a second time point from a plurality of predicted time points; the first time point is earlier than the second time point; The predicted position corresponding to the first time point is used as the left node of the root node; The actual position corresponding to the first time point is used as the right node of the root node; The predicted position corresponding to the second time point is used as the left child node of the node corresponding to the actual position at the first time point; The actual position corresponding to the second time point is used as the right child node of the node corresponding to the actual position at the first time point; Construct 2v child nodes corresponding to v prediction time points to obtain an abnormal tree; One level of the abnormal tree corresponds to one prediction time point; adjacent levels represent adjacent prediction time points.
7. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The predicted position network includes a time convolutional network, a velocity neural network and a position convolutional network; Backward training of the time convolutional network, velocity neural network and position convolutional network to obtain a trained prediction position network.
8. The servo motor control method with an abnormality detection function according to claim 1, characterized in that: The method of determining abnormalities based on the servo speeds at multiple motion time points and obtaining a three-dimensional velocity image includes: In the binary image, the positions corresponding to the servo speeds of multiple motion time points are marked as 1 to obtain a servo speed image; the length of the binary image represents the motion time point, and the width represents the servo speed; Multiple action cycles correspond to obtaining multiple servo speed images; Superimposing multiple servo velocity images to obtain a three-dimensional velocity image; Get a 2*n*m three-dimensional convolution kernel; n corresponds to the length of the 3D velocity image; m corresponds to the width of the 3D velocity image; With a step size of 2, the 3D convolution kernel is convolved in the high direction of the 3D velocity image to detect the change in servo speed between two adjacent motion cycles to determine whether there is an abnormality; If there is no abnormality in the servo speed, a three-dimensional speed image is output; if there is an abnormality in the servo speed, a warning signal is sent.
9. A servo motor control system with an abnormality detection function, characterized in that: include: An acquisition module is configured to acquire a plurality of servo information; the servo information includes a servo position and a servo speed at a plurality of motion time points; the servo position indicates the position of a device controlled by the servo motor relative to the servo motor; the servo speed indicates the speed of rotation of the servo motor at a current time point; one servo information corresponds to one motion cycle; and the motion time point indicates a time point measured from the start time point of the motion cycle; A servo speed detection module is used to identify abnormalities based on the servo speed at multiple motion time points and obtain a three-dimensional speed image; the three-dimensional speed image represents the servo speed at multiple motion time points in multiple action cycles; A servo position detection module is configured to use a trained prediction position network to determine changes in the servo position at multiple motion time points using the servo speed and servo position based on the three-dimensional velocity image and the servo positions at multiple motion time points, thereby obtaining a predicted position; the predicted position represents the servo position predicted at the predicted time point; and multiple predicted positions are obtained corresponding to multiple predicted time points. An anomaly tree module, configured to construct an anomaly tree based on multiple predicted time points and corresponding predicted positions; the anomaly tree represents the predicted positions and actual positions of the multiple predicted time points; An anomaly detection module, configured to detect the tree structure and determine whether it is abnormal based on the abnormal tree and the servo speeds at multiple motion time points; The detecting the tree structure based on the abnormal tree and the servo speeds at multiple motion time points and determining whether it is abnormal includes: Using a parent representation method, the anomaly tree is converted into an anomaly matrix; Based on the abnormal matrix and the servo speeds at multiple motion time points, a first abnormal feature is obtained through the trained first convolutional neural network and the second convolutional neural network; the first abnormal feature indicates whether the abnormal matrix for detecting the abnormal servo speed is also abnormal in position; Based on the anomaly matrix, detecting a change between the predicted position and the actual position to obtain a second anomaly feature; the second anomaly feature represents a difference between the predicted position and the actual position at a time point; Obtaining a first historical anomaly feature; wherein the first historical anomaly feature represents a feature output after an anomaly matrix at a historical time point is input into a trained first convolutional neural network; Calculating the Mahalanobis distance between the first historical abnormal feature and the first abnormal feature to obtain a first abnormal value; the first abnormal value represents the difference 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 abnormal feature to obtain a second abnormal value; the second abnormal value represents the difference between the predicted position and the actual position of the servo motor at multiple movement 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.
Citation Information
Patent Citations
Servo motor rotating speed adjusting method and system based on three-dimensional fuzzy control
CN111181467A
Wind driven generator anomaly detection method and system based on SCADA periodic data
CN120042753A