A method for positioning a mechanical arm end position deviation fault based on attention response
By employing an attention-response-based method for locating end-effector pose deviations in robotic arms, and utilizing a cross-attention architecture and dual-threshold dynamic calibration, combined with adjacent joint combination judgment, this method solves the problem of difficulty in distinguishing the degree of joint error contribution in existing technologies, and achieves accurate location of faulty joints and cross-model adaptation.
Patent Information
- Application Number
- CN202611570311.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-06
AI Technical Summary
Existing methods for locating joint faults in robotic arms are unable to accurately distinguish the contribution of each joint error to the end-effector pose deviation, resulting in inaccurate fault joint localization. Furthermore, they require a large number of fault samples to train the classifier, making cross-model transfer difficult.
A fault localization method for end-effector pose deviation of a robotic arm based on attention response is adopted. Through cross-attention architecture, dual-threshold dynamic calibration and adjacent joint combination judgment, multi-head attention operation is performed using the time series of joint angular displacement deviation and end-effector pose deviation to generate the attention response sequence of the joint, dynamically calibrate the threshold and number, and combine the kinematic chain position to judge the fault.
It enables accurate location of faulty joints without the need for fault samples, has good generalization and cross-model transfer capabilities, and can quantify the response of joint errors to end-effector pose deviations, thereby improving the accuracy of fault diagnosis.
Smart Images

Figure CN123040148A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotic arm fault detection technology, specifically to a method for locating faults in the end-effector pose deviation of a robotic arm based on attention response. Background Technology
[0002] As the core execution unit in an automated production system, the reliability of the robotic arm's operation directly affects production efficiency and product quality. The robotic arm consists of multiple joints connected in series, each driven by a servo drive unit. The end effector completes the predetermined operation under the coordinated movement of the joints. During long-term operation, the robotic arm joints may malfunction due to mechanical wear, increased transmission clearance, lubrication failure, bearing damage, etc., leading to increased joint angular displacement deviation, which in turn affects the end effector's pose accuracy.
[0003] Existing methods for locating joint faults in robotic arms mainly fall into two categories. One category is based on physical models. These methods establish kinematic or dynamic models of the robotic arm, compare the actual joint operating parameters with the model's predicted parameters, and determine the faulty joint based on the residual. However, during operation, the robotic arm is affected by factors such as load changes, temperature variations, and assembly errors, making it difficult for the model parameters to remain consistent with the actual state, leading to unreliable fault location results. The other category is based on data-driven methods. These methods collect vibration or current signals during the robotic arm's operation and extract time-domain or frequency-domain features, then input these features into a classifier for fault mode recognition. However, this type of method requires collecting a large number of fault samples to train the classifier. In industrial settings, obtaining robotic arm fault samples is difficult, and the fault characteristics of different robotic arm models vary significantly, making it difficult to transfer the trained classifier between different robotic arms.
[0004] Furthermore, existing technologies that directly use joint angular displacement deviations for fault diagnosis cannot describe the nonlinear and temporal coupling effects of different joint errors on the end-effector pose, nor can they distinguish the degree of contribution of each joint error to the end-effector pose deviation, thus limiting the accuracy of fault joint localization. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a fault location method for end-effector pose deviation of robotic arms based on attention response. By combining three core technical features—cross-attention architecture, dual-threshold dynamic calibration, and adjacent joint combination judgment—this invention solves the technical problems of existing technologies, such as difficulty in distinguishing the contribution of each joint error to the end-effector pose deviation and limited accuracy of fault joint location. This achieves the technical effect of accurate fault joint location without the need for fault samples.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for locating pose deviation faults at the end effector of a robotic arm based on attention response, comprising the following steps: S1. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm under normal conditions. Map the end-effector pose deviation time series into a query matrix through the first mapping unit. Map the joint angular displacement deviation time series of each joint into a key matrix and a value matrix through the second mapping unit. Perform multi-head attention operation to generate the attention response sequence of each joint under normal conditions. Based on the attention response sequence of each joint under normal conditions, determine the first threshold, the second threshold, and the first quantity. The first threshold is used to determine whether the joint is continuously abnormal. The second threshold is used to determine whether the adjacent joints are normal. The adjacent joints include the adjacent upstream joints and the adjacent downstream joints. The first quantity is the number of consecutive time moments required to determine the faulty joint. S2. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm in the detection state. Use the first mapping unit to map the end-effector pose deviation time series in the detection state into a query matrix. Use the second mapping unit to map the joint angular displacement deviation time series of each joint in the detection state into a key matrix and a value matrix respectively. Perform multi-head attention operation to generate the attention response sequence of each joint in the detection state. S3. Determine the change in attention value of each joint between adjacent time points based on the attention response sequence of each joint under the detection state. S4. When the change in the attention value of a joint in the detection state is greater than the first threshold for a first number of consecutive moments, the joint is recorded as the target joint, and fault judgment is made based on the position of the target joint in the kinematic chain: If the target joint is located at the beginning of the kinetic chain, check whether the change in attention value of its adjacent downstream joints is less than the second threshold in a first number of consecutive time intervals. If the target joint is located at the end of the kinetic chain, check whether the change in attention value of its adjacent upstream joint is less than the second threshold in a first number of consecutive time intervals. If the target joint is located in the middle of the kinetic chain, then it is checked whether the change in attention value of its adjacent upstream joint and adjacent downstream joint is less than the second threshold in a first number of consecutive time intervals. When the change in attention value of the adjacent joints meets the above conditions, the target joint is identified as a faulty joint; otherwise, if the change in attention value of the adjacent joints is greater than or equal to the second threshold at any time within a first number of consecutive time intervals, the target joint is not identified as a faulty joint.
[0007] As a further improvement, the joint angular displacement deviation time series is obtained by: collecting the actual angular displacement and commanded angular displacement of each joint; subtracting the commanded angular displacement from the actual angular displacement of each joint to obtain the joint angular displacement deviation time series of that joint; the end-effector pose deviation time series is obtained by: collecting the end-effector measured pose and end-effector commanded pose; subtracting the end-effector commanded pose from the end-effector measured pose to obtain the end-effector pose deviation time series.
[0008] As a further improvement, each joint corresponds to a set of independent second mapping unit parameters.
[0009] As a further improvement, the first and second mapping units are trained in the following way: historical data is collected during the fault-free period of the robotic arm as a training set; the training end pose deviation time series is input into the first mapping unit to be trained to obtain a training query matrix; the training joint angular displacement deviation time series of each joint is input into the corresponding second mapping unit to be trained to obtain a training key matrix and a training value matrix; multi-head attention operation is performed to obtain a training attention response sequence; the training attention response sequence and the joint angular displacement deviation sequence corresponding to the training key matrix are weighted and summed to obtain an estimated value of the end pose deviation; the mean square error between the estimated end pose deviation and the true end pose deviation in the training set is used as the loss function, and the linear transformation parameters of the mapping units are updated using the backpropagation algorithm and the gradient descent optimizer; after training, the linear transformation parameters of the first and second mapping units are locked and frozen, and the same parameters are used for forward inference calculation in both normal and detection states.
[0010] As a further improvement, the multi-head attention operation in S1 includes performing a dot product operation between the query matrix and the key matrix of each joint to obtain the original attention score matrix of the joint; scaling the original attention score matrix and normalizing the scaled score matrix by row to obtain the attention weight matrix of the joint; and performing a weighted summation between the attention weight matrix and the value matrix of the joint to obtain the attention response sequence of the joint.
[0011] As a further improvement, the first threshold and the second threshold in S1 are determined in the following way: The attention response sequences of all joints are concatenated by joint number to form a first normal matrix, where rows correspond to joints and columns correspond to time points. Each column of the first normal matrix is normalized so that the sum of the attention values of all joints in each column is a first fixed value, which is a preset constant, resulting in a second normal matrix. For each row of the second normal matrix, the absolute value of the difference between the attention values of adjacent columns is calculated to obtain the change sequence of each joint. All values in the change sequences of all joints are collected into a set, sorted from smallest to largest, and the value at the first quantile after sorting is taken as the second threshold. For the change sequence of each joint, the maximum value in the change sequence is taken as the maximum change of that joint, and the value at the second quantile after sorting the maximum changes of all joints from smallest to largest is taken as the first threshold.
[0012] As a further improvement, the first quantity is determined in the following way: for the change sequence of each joint under normal conditions, the length of each continuous segment formed by consecutive values greater than the second threshold in the change sequence is counted, the maximum value of the length of each continuous segment is taken as the maximum number of consecutive segments of that joint, and the maximum value among the maximum number of consecutive segments of all joints is taken as the first quantity.
[0013] As a further improvement, determining the change in attention value for each joint between adjacent time points in S3 specifically includes: The attention response sequences of each joint under all joint detection states are concatenated by joint number to form a first detection matrix; each column of the first detection matrix is normalized so that the sum of the attention values of all joints in each column is a second fixed value, which is a preset constant, to obtain a second detection matrix; for each row of the second detection matrix, the absolute value of the difference between the attention values of two adjacent columns is calculated to obtain the change in attention value of each joint between adjacent time points.
[0014] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention uses the end pose deviation time series as the query matrix, and the joint angular displacement deviation time series of each joint as the key matrix and value matrix respectively. Through multi-head attention operation, the attention response sequence of each joint is generated, and the response degree and contribution of each joint angular displacement deviation to the end pose deviation are quantitatively characterized. The reverse mapping from "end error" to "joint source" is realized. It can automatically learn the nonlinear and temporal coupling effects of different joint errors on the end pose, and provide an accurate data basis for fault judgment.
[0015] (2) Based on the statistical distribution of attention response changes under normal conditions, this invention dynamically calibrates a first threshold, a second threshold, and a first quantity: the second threshold is used to determine whether adjacent joints are normal, the first threshold is used to determine whether the target joint is continuously abnormal, and the first quantity is used to determine whether the abnormality lasts for a sufficient duration. Parameter calibration can be completed using only normal state data, without requiring a large number of fault samples, and it has good generalization and cross-model transfer capabilities.
[0016] (3) This invention automatically learns the nonlinear and temporal coupling effects of different joint errors on the end pose through a cross-attention architecture, and quantifies the contribution of each joint error to the end pose deviation through attention response sequences, providing an accurate data basis for fault determination.
[0017] Building upon this foundation, the present invention further addresses a technical problem not mentioned in the background art by determining adjacent joint combinations based on kinematic chain position. Upon detecting a persistent anomaly in a candidate joint, the present invention checks whether the changes in attention values of its adjacent downstream joints, adjacent upstream joints, or both adjacent upstream and downstream joints are less than a second threshold, depending on the joint's position in the kinematic chain—at the beginning, end, or middle. Only when the joint is "persistently abnormal" and "all adjacent joints are normal" is it identified as a faulty joint. This determination logic utilizes the physical topology of the robotic arm's serial kinematic chain, effectively distinguishing between joint malfunctions and false positives caused by external disturbances, thus achieving precise location of faulty joints. This technical problem was not explicitly mentioned in the background art, but it is effectively solved through the adjacent joint combination determination rule of the present invention.
[0018] In summary, the three core features of this invention—cross-attention architecture, dual-threshold dynamic calibration and first quantity determination, and adjacent joint combination determination based on kinematic chain position—are interconnected and together form a complete fault localization closed loop: cross-attention provides the data foundation, dual thresholds and the first quantity filter candidate joints with continuous abnormalities in the time dimension, and adjacent joint determination is verified and confirmed in the spatial dimension using kinematic chain topology. The three features work together to achieve the leap from "anomaly detection" to "fault localization". Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for locating pose deviation faults at the end of a robotic arm based on attention response, according to the present invention. Figure 2 This is a flowchart of the attention response sequence calculation for a fault localization method for end-effector pose deviation of a robotic arm based on attention response, according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Reference Figure 1 , Figure 2 This invention provides a method for locating pose deviation faults at the end effector of a robotic arm based on attention response, comprising the following steps: S1. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm under normal conditions. Map the end-effector pose deviation time series to a query matrix through the first mapping unit. Map the joint angular displacement deviation time series of each joint to a key matrix and a value matrix through the second mapping unit. Perform multi-head attention operation to generate the attention response sequence of each joint under normal conditions. Based on the attention response sequence of each joint under normal conditions, determine the first threshold, the second threshold, and the first quantity. The first threshold is used to determine whether the joint is continuously abnormal. The second threshold is used to determine whether the adjacent joints are normal. The adjacent joints include the adjacent upstream joints and the adjacent downstream joints. The first quantity is the number of consecutive time moments required to determine the faulty joint.
[0022] During the period when the robotic arm executes a standard trajectory and is confirmed to be fault-free, the actual and commanded angular displacements of each joint are collected. The standard trajectory refers to the predetermined motion path that the robotic arm repeatedly executes under normal working conditions. The fault-free confirmation is that the robotic arm does not trigger any alarm signals and the end-effector pose deviation is within the normal fluctuation range during the aforementioned period. The actual angular displacement is obtained in real time by angular displacement sensors installed at each joint, and the commanded angular displacement is directly read from the target position commands issued by the robotic arm controller to the servo drive units of each joint. The acquisition process covers the complete execution cycle of the standard trajectory, ensuring that the obtained angular displacement data can characterize the entire motion process of the robotic arm under normal working conditions.
[0023] The time series of joint angular displacement deviations under normal conditions is obtained by subtracting the commanded angular displacement from the actual angular displacement at each joint. The subtraction operation involves subtracting the actual angular displacement value from the commanded angular displacement value at the same moment, and the difference is taken as the angular displacement deviation at that moment. For each joint, the angular displacement deviations at each sampling moment throughout the entire acquisition period are arranged in chronological order to form the joint angular displacement deviation time series. The joint angular displacement deviation time series reflects the fluctuation of the following error of each joint over time under normal conditions.
[0024] During the fault-free period, the measured end-effector pose and the commanded end-effector pose are acquired. The measured end-effector pose is obtained by a pose measurement device installed at the end of the robotic arm or in the workspace. The pose measurement device can be a laser tracker or a vision measurement system. The output of the pose measurement device includes the position coordinates and attitude angles of the end-effector in space. The commanded end-effector pose is calculated by the robotic arm controller according to a standard trajectory planning algorithm. The commanded end-effector pose corresponds synchronously with the aforementioned commanded angular displacement in time. The acquisition process is performed synchronously with the acquisition of joint angular displacement within the same fault-free period to ensure strict alignment of the end-effector pose data and joint angular displacement data on the time axis.
[0025] The time series of end-effector pose deviations under normal conditions is obtained by subtracting the commanded pose from the measured pose at the same moment. The subtraction operation involves subtracting the measured pose from the commanded pose at the same moment. Pose subtraction includes two parts: the difference in position coordinates and the difference in attitude angles. The position coordinate differences and attitude angle differences are normalized separately and then combined into a unified pose deviation. The specific implementation is as follows: First, obtain the position coordinate difference sequence for the entire time period under normal conditions. Calculate the maximum absolute value of the position coordinate difference at all moments in the position coordinate difference sequence, and use this maximum absolute value as the position normalization reference. Next, obtain the attitude angle difference sequence for the entire time period under normal conditions. Calculate the maximum absolute value of the attitude angle difference at all moments in the attitude angle difference sequence, and use this maximum absolute value as the attitude normalization reference. Divide the position coordinate difference at each moment by the position normalization reference to obtain the normalized position deviation; divide the attitude angle difference at each moment by the attitude normalization reference to obtain the normalized attitude deviation. After the above normalization process, the position coordinate difference and the attitude angle difference are mapped to the same numerical order of magnitude.
[0026] The normalized position deviation and normalized attitude deviation are combined into a unified pose deviation. The merging method is as follows: calculate the square root of the sum of the squares of the normalized position deviation and the squares of the normalized attitude deviation, and use the result as the pose deviation at the corresponding time moment. Alternatively, a weighted sum of the normalized position deviation and normalized attitude deviation is performed, and the weighted sum is used as the pose deviation at the corresponding time moment. Arranging the pose deviations at each sampling moment within the entire acquisition period in chronological order constitutes the end-effector pose deviation time series under normal conditions. The end-effector pose deviation time series is used to characterize the change of the overall execution error of the robotic arm's end effector over time under normal conditions.
[0027] The joint angular displacement deviation time series and end pose deviation time series under the above normal conditions are used for subsequent configuration and training of the mapping unit.
[0028] The first mapping unit is used to map the end-effector pose deviation time series into a query matrix. The first mapping unit consists of a set of linear transformation parameters, which are assigned initial values during configuration and optimized through training during subsequent data processing. The specific number of linear transformation parameters is determined by the length of the input time series and the dimension of the required query matrix. After configuration, the first mapping unit has the function of converting any input time series into a fixed-structure query matrix.
[0029] The second mapping unit maps the time series of joint angular displacement deviations of each joint into key and value matrices. The second mapping unit also consists of a set of linear transformation parameters, with each joint corresponding to an independent set of second mapping unit parameters. The second mapping unit parameters for different joints are independent and not shared. The second mapping unit parameters for each joint are assigned initial values during configuration and are optimized through training during subsequent data processing.
[0030] A large amount of historical data was collected during the fault-free period of the robotic arm to serve as the training set. The training set includes the time series of joint angular displacement deviation and the time series of end-effector pose deviation.
[0031] The training end-effector pose deviation time series is input into the first mapping unit to be trained to obtain the training query matrix. The training joint angular displacement deviation time series of each joint is input into the corresponding second mapping unit to be trained to obtain the training key matrix and training value matrix. Multi-head attention operation is performed on the above matrices to obtain the training attention response sequence. The execution process of multi-head attention operation is as follows: First, the training query matrix is multiplied by the training key matrix of each joint to obtain the original training attention score matrix of that joint; then, the original training attention score matrix is scaled and the scaled score matrix is normalized row-wise to obtain the training attention weight matrix of that joint; finally, the training attention weight matrix and the training value matrix of that joint are weighted and summed to obtain the training attention response sequence of that joint.
[0032] The weighted summation of the training attention response sequence and the joint angular displacement deviation sequence corresponding to the training key matrix yields the estimated value of the end-effector pose deviation.
[0033] The mean squared error (MSE) is defined as the loss function, and the MSE between the estimated end-effector pose deviation and the true end-effector pose deviation in the training set is calculated. The linear transformation parameters of the first and second mapping units are updated using backpropagation and a gradient descent optimizer, causing the loss function to gradually decrease. Training of the first and second mapping units is complete when the loss function value converges and falls below a preset threshold.
[0034] After training, all linear transformation parameters of the first and second mapping units are locked and frozen. In subsequent data processing for both normal and detection states, the training-frozen mapping units are directly called for forward inference calculations without further parameter modification. At this point, the attention response sequence reflects the physical contribution of the joint angular displacement deviations learned by the mapping units during training to the end-effector pose deviation.
[0035] The end-effector pose deviation time series under normal conditions is input into the first mapping unit, and a normal query matrix is output. The input operation involves sequentially feeding the deviation values at each moment in the end-effector pose deviation time series into the first mapping unit. The first mapping unit uses its linear transformation parameters to calculate the input sequence, mapping each moment in the time series to a query vector in the corresponding row of the query matrix. All query vectors are arranged in chronological order to form the normal query matrix. The number of rows in the normal query matrix is equal to the length of the end-effector pose deviation time series, and the number of columns is determined by the parameter dimension of the first mapping unit.
[0036] The time series of joint angular displacement deviation of each joint under normal conditions is input into the second mapping unit. Each joint corresponds to a set of independent parameters of the second mapping unit. The normal key matrix and normal value matrix of the corresponding joint are output. The input operation is to send the time series of joint angular displacement deviation of a certain joint into the second mapping unit corresponding to the joint. The second mapping unit performs two different mapping calculations on the input sequence using the independent linear transformation parameters corresponding to the joint. The first mapping calculation outputs the normal key matrix, and the second mapping calculation outputs the normal value matrix. The number of rows of the normal key matrix is equal to the length of the time series of joint angular displacement deviation of the joint. The number of columns of the normal key matrix is determined by the parameter dimension of the second mapping unit. The number of rows and columns of the normal value matrix is the same as the number of rows and columns of the normal key matrix.
[0037] Multi-head attention operations are performed on the normal query matrix, the normal key matrix of each joint, and the normal value matrix to obtain the attention response sequence for each joint. The execution process of the multi-head attention operation is as follows: First, the normal query matrix and the normal key matrix of each joint are multiplied by a dot product to obtain the original attention score matrix of the joint. Then, the original attention score matrix is scaled and normalized row by row to obtain the attention weight matrix of the joint. Finally, the attention weight matrix and the normal value matrix of the joint are weighted and summed to obtain the attention response sequence of the joint. The length of the attention response sequence is the same as the number of rows in the normal query matrix. The value at each position in the attention response sequence represents the degree of response of the joint to the end-effector pose deviation at the given time.
[0038] The attention response sequences of all joints are concatenated in ascending order of joint number to form a first normal matrix. The rows of the first normal matrix correspond to joints, and the columns correspond to time points. The concatenation operation is to treat the attention response sequence of each joint as a row of the matrix. The row order is consistent with the physical connection order of the robotic arm joints, that is, the joint number at the base is the smallest and the joint number at the end is the largest. After concatenation, the element in the i-th row and j-th column of the first normal matrix represents the attention response value of the i-th joint at time j. The number of rows in the first normal matrix is equal to the total number of robotic arm joints, and the number of columns in the first normal matrix is equal to the length of the attention response sequence.
[0039] Normalize each column of the first normal matrix so that the sum of the attention values of all joints in each column of the first normal matrix is equal to a first fixed value, thus obtaining the second normal matrix. The normalization operation is performed column by column: take a column of the first normal matrix, sum the attention values of all joints in the column to obtain the column sum, then divide the attention value of each joint in the column by the column sum, and multiply by the first fixed value to obtain the normalized result of the column. The first fixed value is a preset constant. After normalization, all columns satisfy the constraint that the sum of the attention values in the column is equal to the first fixed value. After column-by-column normalization, the first normal matrix is transformed into the second normal matrix.
[0040] For each row of the second normal matrix, calculate the absolute value of the difference between the attention values of two adjacent columns to obtain the change sequence for each joint. The calculation process is as follows: Take the row corresponding to a certain joint in the second normal matrix, starting from the first column of the row, calculate the attention value of the next column minus the attention value of the previous column, take the absolute value of the difference to obtain a change. Perform the above calculation on all adjacent column pairs of the row, and arrange the obtained changes in chronological order to obtain the change sequence of the joint. The length of the change sequence is equal to the number of columns of the second normal matrix minus one. Each value in the change sequence represents the change range of the attention response value of the joint between two adjacent time points.
[0041] All values in the change sequence of all joints are aggregated into a set. The values in the set are sorted in ascending order. The value at the first quantile after sorting is taken as the second threshold. In this embodiment, the value at the lower quartile after sorting is taken as the first quantile. The value at the first quantile is determined as the second threshold. The aggregation operation is to take all change values in the change sequence of each joint and put them into the same set. The total number of elements in the set is equal to the total number of joints multiplied by the length of the change sequence. The sorting operation arranges all values in the set in ascending order. The value at the first quantile after sorting is extracted as the second threshold. The second threshold is used to characterize the general fluctuation level of the change in attention value under normal conditions.
[0042] For each joint's change sequence, the maximum value in the change sequence is taken as the maximum change of that joint. The maximum value operation involves iterating through all values in the change sequence of that joint and taking the largest value as the maximum change of that joint. Each joint obtains an independent maximum change, which reflects the extreme case of the fluctuation of the attention response value of that joint under normal conditions. The maximum changes of all joints are collected into a set, and the values in the set are sorted from smallest to largest. The value at the second quantile after sorting is taken as the first threshold. The first threshold represents the high-level critical statistical value of the change in attention value of all joints under normal conditions. Changes exceeding the first threshold belong to low-probability abnormal samples under normal conditions. In this embodiment, the value at the high percentile after sorting is selected as the second quantile. When the change in attention value of the target joint under the detection state is greater than the first threshold for a first number of consecutive moments, it is determined that the change sequence has a persistent abnormality that does not appear under normal conditions, and the second quantile is greater than the first quantile.
[0043] For each joint's change sequence, the lengths of consecutive segments formed by values continuously greater than the second threshold are counted. The maximum length of each consecutive segment is taken as the maximum number of consecutive segments for that joint. The maximum value among the maximum number of consecutive segments for all joints is taken as the first quantity. The first quantity is the number of consecutive time intervals required to determine the faulty joint.
[0044] The aforementioned first threshold, second threshold, and first quantity are used for fault determination in subsequent detection states.
[0045] S2. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm in the detection state. Use the first mapping unit to map the end-effector pose deviation time series in the detection state into a query matrix. Use the second mapping unit to map the joint angular displacement deviation time series of each joint in the detection state into a key matrix and a value matrix, respectively. Perform multi-head attention operation to generate the attention response sequence of each joint in the detection state.
[0046] The detection state refers to the period during which the robotic arm executes a standard trajectory and requires fault detection. During this period, the robotic arm may be in a normal state or may have joint malfunctions; the purpose of the detection is to determine whether there are faulty joints and to locate the faulty joints.
[0047] During the period when the robotic arm executes a standard trajectory and requires fault detection, the actual and commanded angular displacements of each joint are collected. The difference between the commanded and actual angular displacements of each joint is calculated to obtain the time series of joint angular displacement deviations under the detection state. The subtraction operation involves subtracting the actual angular displacement value from the commanded angular displacement value at the same moment, and the difference is taken as the angular displacement deviation at that moment. For each joint, the angular displacement deviations at each sampling moment throughout the entire detection period are arranged in chronological order, thus forming the time series of joint angular displacement deviations under the detection state. The time series of joint angular displacement deviations under the detection state reflects the fluctuation of the following error of each joint over time under the current operating state and is one of the basic data for subsequently generating the attention response sequence under the detection state.
[0048] During the period when the robotic arm executes a standard trajectory and requires fault detection, the measured end-effector pose and the commanded end-effector pose are collected. The measured end-effector pose is acquired by a pose measurement device installed at the end of the robotic arm or in the workspace. The output of the pose measurement device includes the position coordinates and attitude angles of the end-effector in space. The commanded end-effector pose is calculated by the robotic arm controller according to the standard trajectory planning algorithm. The commanded end-effector pose and the aforementioned commanded angular displacement are synchronously corresponding in time. The acquisition of the end-effector pose and the acquisition of the joint angular displacement are performed synchronously in the same detection period to ensure that the end-effector pose data and the joint angular displacement data are strictly aligned on the time axis.
[0049] The time series of end-effector pose deviation under the detection state is obtained by subtracting the end-effector command pose from the measured end-effector pose. The subtraction operation refers to subtracting the measured end-effector pose value from the end-effector command pose value at the same moment. The pose difference includes two parts: the difference in position coordinates and the difference in attitude angles. The two differences are combined into a unified pose deviation. The pose deviation values at each sampling moment during the entire detection period are arranged in chronological order to form the end-effector pose deviation time series under the detection state. The end-effector pose deviation time series under the detection state characterizes the change of the overall execution error of the robotic arm end in the current operating state over time.
[0050] The end-effector pose deviation time series under the detection state is input into the first mapping unit, and the output is a detection query matrix. The parameters of the first mapping unit are the same as those used in the normal state. The input operation is to send the deviation values of each time step in the end-effector pose deviation time series under the detection state into the first mapping unit in sequence. The first mapping unit calculates the input sequence using the same linear transformation parameters as in the normal state, and maps each time step in the time series to a query vector in the corresponding row of the detection query matrix. The query vectors of all time steps are arranged in chronological order to form the detection query matrix.
[0051] The number of rows in the detection query matrix is equal to the length of the end pose deviation time series in the detection state. The number of columns in the detection query matrix is the same as the number of columns in the normal query matrix, both determined by the parameter dimension of the first mapping unit. Since the parameters of the first mapping unit remain unchanged after being determined in the normal state, the query vector mapping rule used in the detection state is consistent with the mapping rule in the normal state.
[0052] The joint angular displacement deviation time series of each joint in the detection state is input into the second mapping unit of that joint, and the detection key matrix and detection value matrix of that joint are output. The parameters of the second mapping unit corresponding to each joint are the same as the parameters of the second mapping unit used in the normal state of that joint. The input operation is to send the joint angular displacement deviation time series of a certain joint in the detection state into the second mapping unit corresponding to that joint. The second mapping unit uses the same independent linear transformation parameters as that of the joint in the normal state to perform two different mapping calculations on the input sequence. The first mapping calculation outputs the detection key matrix, and the second mapping calculation outputs the detection value matrix.
[0053] The number of rows in the detection key matrix is equal to the length of the joint angular displacement deviation time series in the detection state. The number of columns in the detection key matrix is the same as the number of columns in the normal key matrix. The number of rows and columns in the detection value matrix is the same as the number of rows and columns in the detection key matrix. Since the second mapping unit parameters of each joint remain unchanged after being determined in the normal state, the mapping rules of the key matrix and value matrix used in the detection state are consistent with the mapping rules in the normal state.
[0054] Multi-head attention operations are performed on the detection query matrix, the detection key matrix for each joint, and the detection value matrix to obtain the detection attention response sequence for each joint. The execution process of the multi-head attention operation is as follows: First, the detection query matrix and the detection key matrix for each joint are multiplied by a dot product to obtain the original detection attention score matrix for that joint. Then, the original detection attention score matrix is scaled and normalized row-wise to obtain the detection attention weight matrix for that joint. Finally, the detection attention weight matrix and the detection value matrix for that joint are weighted and summed to obtain the detection attention response sequence for that joint. The length of the detection attention response sequence is the same as the number of rows in the detection query matrix. The value at each position in the detection attention response sequence represents the degree of response of that joint to the end-effector pose deviation at that moment in the current detection state. Since the mapping unit parameters used in the detection state are the same as those in the normal state, the detection attention response sequence can be compared with the attention response sequence in the normal state under the same benchmark.
[0055] S3. Determine the change in attention value of each joint between adjacent time points based on the attention response sequence of each joint under the detection state.
[0056] The attention response sequences of all joints under the detection state are concatenated in ascending order of joint number to form the first detection matrix. The concatenation operation involves treating the detection attention response sequence obtained by each joint under the detection state as a row of the matrix. The row order corresponds to the physical connection order of the robotic arm joints, with the smallest joint number at the base and the largest at the end effector. After concatenation, the element in the i-th row and j-th column of the first detection matrix represents the detection attention response value of the i-th joint at time j. The number of rows in the first detection matrix equals the total number of robotic arm joints, and the number of columns equals the length of the detection attention response sequence. The length of the detection attention response sequence is the same as the number of rows in the detection query matrix, which is equal to the length of the end effector pose deviation time series under the detection state.
[0057] Normalize each column of the first detection matrix so that the sum of the attention values of all joints in each column equals a second fixed value, resulting in the second detection matrix. The normalization operation is performed column-by-column: For a given column of the first detection matrix, sum the attention values of all joints in that column to obtain a column sum. Then, divide the attention value of each joint in that column by the column sum and multiply by the second fixed value to obtain the column-normalized result. All normalized columns satisfy the constraint that the sum of the attention values within a column equals the second fixed value. After column-by-column normalization, the first detection matrix is transformed into the second detection matrix, with the same number of rows and columns as the first detection matrix.
[0058] For each row of the second detection matrix, the absolute value of the difference between the attention values of two adjacent columns is calculated to obtain the change in attention value of each joint under the detection state. The calculation process is as follows: Take the row corresponding to a certain joint in the second detection matrix, starting from the first column of the row, calculate the attention value of the next column minus the attention value of the previous column, and take the absolute value of the difference to obtain a change. Perform the above calculation on all adjacent column pairs of the above row, and arrange the obtained changes in chronological order to obtain the change in attention value of the joint under the detection state. The length of the change in attention value under the detection state is equal to the number of columns of the second detection matrix minus one. Each value in the change sequence represents the magnitude of change in the attention response value of the joint between two adjacent moments under the detection state.
[0059] S4. When the change in the attention value of a joint in the detection state is greater than the first threshold for a first number of consecutive moments, the joint is recorded as the target joint, and fault judgment is made based on the position of the target joint in the kinematic chain: If the target joint is located at the beginning of the kinetic chain, check whether the change in attention value of its adjacent downstream joints is less than the second threshold in a first number of consecutive time intervals. If the target joint is located at the end of the kinetic chain, check whether the change in attention value of its adjacent upstream joints is less than the second threshold in a first number of consecutive time intervals. If the target joint is located in the middle of the kinetic chain, then check whether the change in attention value of its adjacent upstream joint and adjacent downstream joint is less than the second threshold in a first number of consecutive time intervals. When the change in attention value of adjacent joints meets the above conditions, the target joint is identified as a faulty joint; otherwise, if the change in attention value of adjacent joints is greater than or equal to the second threshold at any time within a first number of consecutive time intervals, the target joint is not identified as a faulty joint.
[0060] After the time-by-time judgment is completed, each joint obtains a label sequence consisting of abnormal times and normal times. The length of the label sequence is equal to the length of the attention value change in the detection state. The first threshold is the second quantile determined based on the maximum change of all joints in the normal state. The first threshold represents the upper limit boundary of the attention value change of all joints in the normal state. Any attention value change greater than the first threshold in the detection state belongs to the case of exceeding the normal high-order statistical range, and is therefore marked as an abnormal time.
[0061] When the change in the attention value of the target joint continuously exceeds the upper limit of the normal state, while the changes in the attention values of the upstream and downstream joints directly adjacent to the target joint in the kinematic chain remain within the normal fluctuation range, it indicates that the abnormal change is concentrated only at the target joint and has not been transmitted or diffused to adjacent joints. In the kinematic transmission chain of the robotic arm, if a joint malfunctions, the contribution relationship between the angular displacement deviation of the corresponding joint and the end-effector pose deviation will fluctuate abnormally, which is reflected in the change in attention value as continuously exceeding the normal upper limit. Since the adjacent joints have not malfunctioned, the corresponding changes in attention value remain within the normal fluctuation range. Therefore, the combination of the continuous abnormal change in the attention value of the target joint and the normal change in the attention value of the adjacent joints can be used to associate the target joint with the faulty joint and realize the localization of the faulty joint.
[0062] A value greater than or equal to the second threshold indicates that the change in attention value has exceeded the normal range of fluctuations and entered the abnormal fluctuation range. The occurrence of this situation in adjacent joints suggests that the abnormal fluctuation is not concentrated in a single joint. The logic behind this exclusion condition is that when adjacent upstream or downstream joints also exhibit an attention value change greater than or equal to the second threshold within the aforementioned consecutive timeframes, it indicates that the abnormal fluctuation in attention value is not concentrated only at the target joint but has spread to adjacent joints. This situation may be caused by various reasons, such as the robotic arm experiencing a systemic external disturbance, a systemic change in the end-effector load, or multiple joints malfunctioning simultaneously. In this case, the abnormal fluctuation in attention value cannot be solely attributed to a fault in the target joint; therefore, the target joint is not identified as the faulty joint.
[0063] When the change in the attention value of a target joint during the detection state equals the first threshold, the target joint is not identified as a faulty joint. An attention value change equal to the first threshold represents an extreme case that has already occurred within the normal fluctuation range and does not exceed the upper limit of the normal state. Excluding cases equal to the first threshold from the fault determination criteria avoids misjudging extreme fluctuations under normal conditions as faults, ensuring the accuracy of fault determination. Only when the change in the attention value is strictly greater than the first threshold is it considered to have exceeded the normal high-level statistical range and is used as a candidate for fault determination.
[0064] The above steps were used to locate the faulty joint.
[0065] In a preferred embodiment, the robotic arm is a six-joint cascaded robotic arm, with joints numbered J1 to J6 from the base to the end effector, where J1 is the beginning of the kinematic chain and J6 is the end effector. The following describes the specific process of training setup, normal baseline statistics, fault settings, and joint judgment of adjacent joints. Unless otherwise specified, data acquisition methods, mapping unit configurations and training processes, attention response sequence generation methods, change calculation methods, and threshold calibration rules are the same as described in S1 to S3 above.
[0066] During the period when the robotic arm is executing a standard trajectory and is confirmed to be fault-free, the actual angular displacement and commanded angular displacement of each joint, as well as the measured pose and commanded pose of the end effector are collected at a sampling frequency of 100Hz.
[0067] The data acquisition method is the same as described in S1 above. Based on the acquired data, a first mapping unit and a second mapping unit are configured, with both the first fixed value and the second fixed value set to 1. The output dimension of both the first mapping unit and the second mapping unit is 64-dimensional, and the number of attention heads is 4.
[0068] Training uses only fault-free data. The optimizer type is a mini-batch stochastic gradient descent optimizer with momentum, a momentum coefficient of 0.9, and a learning rate of 0.001, which remains constant in this typical configuration. The batch size is 32 time-series samples, each containing both the end-effector pose deviation sequence and the angular displacement deviation sequences of 6 joints. The maximum number of iterations is 200 epochs, where one epoch refers to a complete traversal of the training set. Parameters are updated after each batch, and training terminates early when the convergence condition is met. 200 epochs is the upper limit of training and does not guarantee convergence. The convergence condition is the mean squared error (MSE) between the estimated and actual end-effector pose deviations. Under a fixed normalization scale, the average training loss of the most recent 10 epochs is less than 1 × 10⁻⁶. ⁻4 Furthermore, the absolute value of the difference in average loss between adjacent rounds is less than 1×10. ⁻6 If the convergence condition is met, the training configuration should be adjusted. If the condition is not met even after reaching the maximum number of rounds, the training configuration should be adjusted.
[0069] After training is complete, the mapping parameters are frozen, and this set of parameters is used for both normal benchmark statistics and fault detection.
[0070] The methods for attention response generation, change calculation, and threshold calibration in this step are the same as those described in S1 above. The specific numerical values in this embodiment are as follows: The first and second fixed values are both set to 1. The sum of the normalized attention values of the six joints at each moment is 1; the change in attention value is the absolute value of the difference between the normalized attention values of adjacent moments of the same joint, and both are dimensionless values.
[0071] The second threshold is set to 0.004 (simulation value). According to the lower quartile rule in the instruction manual, the changes in all joints under normal conditions are combined and sorted in ascending order, and the 25th percentile is taken.
[0072] The first threshold is set to 0.032 (simulation value). First, the maximum change of each joint under normal conditions is calculated, then the 95th percentile of the six maximum values is taken. This example uses the nearest rank method: the number of samples is multiplied by the quantile percentage and rounded up to obtain the index of the selected element.
[0073] The first quantity is taken as 5 consecutive time points (simulation values). For the normal change sequence of each joint, the longest segment that is continuously and strictly greater than the second threshold of 0.004 is counted, and then the maximum value of the length of the longest segment of all joints is taken; in this example, no additional 1 is added.
[0074] Table 1 below shows the simulated values of the statistics under normal conditions:
[0075] The six maximum values, in ascending order, are 0.024, 0.024, 0.028, 0.028, 0.032, and 0.032. 95% × 6 = 5.7, rounded up to 6, therefore the first threshold is the sixth value, 0.032. The maximum value for the longest consecutive number of values is 5. The second threshold comes from all changes, while the first threshold comes from the maximum values of each joint; the two thresholds use different statistical methods.
[0076] Faulty joint: J3 (typical setup). The robotic arm is numbered J1 to J6 sequentially from the base to the end effector. J3 is located in the middle of the kinematic chain, with J2 as the adjacent upstream joint and J4 as the adjacent downstream joint. The "target joint" in the instruction manual refers to the joint to be evaluated, which corresponds to J3 in this example, and does not necessarily refer to the fixed number J1.
[0077] Fault type: Periodic angular displacement deviation caused by abnormal joint servo tracking (typical setting), described by superimposing the periodic deviation on the actual motion of J3.
[0078] Fault start time: detection time axis t=10.00s; typical detection period is 0~20s, sampling frequency is 100Hz, and the interval between adjacent sampling times is 0.01s.
[0079] Fault severity: Starting at 10.00s, a sinusoidal disturbance with an amplitude of 0.5°, a frequency of 5Hz, and an initial phase of π / 2 is superimposed on the normal angular displacement deviation of J3, ending at 20s; the additional disturbance before the fault is 0. The amplitude of 0.5° is approximately 0.00873rad, and the peak-to-peak value is 1.0° (both are simulation values).
[0080] In this embodiment, the deviation is uniformly calculated by subtracting the measured value from the command value, that is, joint angular displacement deviation = commanded angular displacement - actual angular displacement, and end effector pose deviation = end effector command pose - end effector measured pose. Therefore, when injecting a positive additional angular displacement deviation, the actual angular displacement of J3 should be reduced accordingly; no additional faults are injected into J1, J2, J4, J5, and J6.
[0081] Data processing remains consistent with the instruction manual: command values and measured values for each joint and end effector are acquired synchronously; position and attitude deviations are normalized using a fixed benchmark determined from normal data, and then synthesized into end effector pose deviations. The same synthesis method and scale are used for normal and detection states.
[0082] If physical simulation is performed, the synchronous end-effector pose should be determined based on the disturbed joint motion to form a complete model input. The attention response values in the next section are used to demonstrate the decision-making logic and are not considered as the output calculated by the trained model from the aforementioned disturbance.
[0083] The changes in attention values for the adjacent upstream joint J2 are: 0.001, 0.002, 0.001, 0.002, 0.001; the changes for the adjacent downstream joint J4 are: 0.002, 0.001, 0.002, 0.001, 0.002 (all simulated values). Both sets of data correspond to the same continuous decision interval of 10.00–10.04 s, and all values are strictly less than the second threshold of 0.004.
[0084] Table 2 below shows the simulated values of attention value changes within the same decision interval:
[0085] Table 2 shows the changes in attention values for J2, J3, and J4 within the same decision interval. To facilitate verification of the calculation of the changes, Table 3 lists the normalized attention values for all joints at the corresponding time points.
[0086] Table 3 below shows the normalized attention values used to verify the changes:
[0087] Each row in Table 3 represents a time point, and the sum of the values for the six joints is 1. When representing this as a matrix as described above, the joint data in this table should be transposed so that "rows correspond to joints and columns correspond to time points". For example, the change in J3 at 10.00s is |0.240-0.200|=0.040.
[0088] Normalization causes the response values of other joints to change with the allocation ratio. J1, J5, and J6 in Table 3 also show slight changes, but their changes do not exceed the first threshold of 0.032; J2 and J4 simultaneously satisfy the adjacent joint conditions.
[0089] Whether the faulty joint was successfully located: Under the typical numerical example above, J3 was identified as the faulty joint, consistent with the preset fault location. This conclusion is the result obtained by applying the rules in the specification to the given attention data.
[0090] Candidate joint condition: The changes in J3 at 10.00s, 10.01s, 10.02s, 10.03s, and 10.04s are 0.040, 0.042, 0.044, 0.043, and 0.041, respectively. All five consecutive values are strictly greater than the first threshold of 0.032, reaching the first quantity of 5.
[0091] Adjacent joint condition: J3 is located in the middle of the kinematic chain, and J2 and J4 are checked simultaneously. Within the same group of 5 consecutive time points, the changes in both are strictly less than the second threshold of 0.004, thus satisfying the joint judgment condition, and the faulty joint number J3 is output.
[0092] Decision Timing: If sufficient historical input data has been obtained before detection, and no valid candidate continuous segments have been formed before the fault, then in this example, the fifth abnormal change is accumulated at 10.04s, at which point a decision can be made. This time is 0.04s from 10.00s; the five changes involve six attention sampling values from 9.99s to 10.04s. This time only reflects the sampling and counting process of the example and does not include model inference, data transmission, and window waiting time.
[0093] Boundary handling: When the change in a candidate joint is less than or equal to the first threshold, the candidate segment is interrupted; when the change in an adjacent joint at any time within the decision interval is greater than or equal to the second threshold, the candidate joint is not identified as a faulty joint within that interval. If the candidate is located at the beginning J1, only J2 is checked; if it is located at the end J6, only J5 is checked.
[0094] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
Claims
1. An attention response-based mechanical arm end position deviation fault positioning method, characterized in that, Includes the following steps: S1. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm under normal conditions. Map the end-effector pose deviation time series into a query matrix through the first mapping unit. Map the joint angular displacement deviation time series of each joint into a key matrix and a value matrix through the second mapping unit. Perform multi-head attention operation to generate the attention response sequence of each joint under normal conditions. Based on the attention response sequence of each joint under normal conditions, a first threshold, a second threshold, and a first quantity are determined; The first threshold is used to determine whether the joint is continuously abnormal, and the second threshold is used to determine whether the adjacent joints are normal. The adjacent joints include the adjacent upstream joints and the adjacent downstream joints. The first number is the number of consecutive moments required to determine the faulty joint. S2. Obtain the joint angular displacement deviation time series and end-effector pose deviation time series of the robotic arm in the detection state. Use the first mapping unit to map the end-effector pose deviation time series in the detection state into a query matrix. Use the second mapping unit to map the joint angular displacement deviation time series of each joint in the detection state into a key matrix and a value matrix respectively. Perform multi-head attention operation to generate the attention response sequence of each joint in the detection state. S3. Determine the change in attention value of each joint between adjacent time points based on the attention response sequence of each joint under the detection state. S4. When the change in the attention value of a joint in the detection state is greater than the first threshold for a first number of consecutive moments, the joint is recorded as the target joint, and fault judgment is made based on the position of the target joint in the kinematic chain: If the target joint is located at the beginning of the kinetic chain, check whether the change in attention value of its adjacent downstream joints is less than the second threshold in a first number of consecutive time intervals. If the target joint is located at the end of the kinetic chain, check whether the change in attention value of its adjacent upstream joint is less than the second threshold in a first number of consecutive time intervals. If the target joint is located in the middle of the kinetic chain, then it is checked whether the change in attention value of its adjacent upstream joint and adjacent downstream joint is less than the second threshold in a first number of consecutive time intervals. When the change in attention value of the adjacent joints meets the above conditions, the target joint is identified as a faulty joint; otherwise, if the change in attention value of the adjacent joints is greater than or equal to the second threshold at any time within a first number of consecutive time intervals, the target joint is not identified as a faulty joint.
2. The method of claim 1, wherein, The joint angular displacement deviation time series is obtained by: collecting the actual angular displacement and commanded angular displacement of each joint; subtracting the commanded angular displacement from the actual angular displacement of each joint to obtain the joint angular displacement deviation time series of that joint; the end-effector pose deviation time series is obtained by: collecting the end-effector measured pose and end-effector commanded pose; subtracting the end-effector commanded pose from the end-effector measured pose to obtain the end-effector pose deviation time series.
3. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response as described in claim 1, characterized in that, Each joint corresponds to a set of independent second mapping unit parameters.
4. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response according to claim 1, characterized in that, The first and second mapping units are trained in the following way: historical data is collected during the fault-free period of the robotic arm as a training set; the training end pose deviation time series is input into the first mapping unit to be trained to obtain the training query matrix. The training joint angular displacement deviation time series of each joint is input into the corresponding second mapping unit to be trained to obtain the training key matrix and training value matrix; multi-head attention operation is performed to obtain the training attention response sequence; The weighted summation of the training attention response sequence and the joint angular displacement deviation sequence corresponding to the training key matrix yields the estimated value of the end pose deviation. The mean square error between the estimated end pose deviation and the actual end pose deviation in the training set is used as the loss function, and the linear transformation parameters of the mapping unit are updated using the backpropagation algorithm and the gradient descent optimizer. After training is completed, the linear transformation parameters of the first and second mapping units are locked and frozen, and the same parameters are used for forward inference calculation in both normal and detection states.
5. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response according to claim 1, characterized in that, In S1, the multi-head attention operation includes performing a dot product operation between the query matrix and the key matrix of each joint to obtain the original attention score matrix of the joint; scaling the original attention score matrix and normalizing the scaled score matrix by row to obtain the attention weight matrix of the joint. The attention weight matrix and the value matrix of the joint are weighted and summed to obtain the attention response sequence of the joint.
6. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response according to claim 1, characterized in that, The first threshold and the second threshold in S1 are determined in the following manner: The attention response sequences of all joints are concatenated according to joint number to form the first normal matrix. The rows of the first normal matrix correspond to joints and the columns correspond to time points. Normalize each column of the first normal matrix so that the sum of the attention values of all joints in each column is a first fixed value. The first fixed value is a preset constant, thus obtaining the second normal matrix. For each row of the second normal matrix, calculate the absolute value of the difference between the attention values of two adjacent columns to obtain the change sequence of each joint; gather all the values in the change sequence of all joints into a set, sort them in ascending order, and take the value at the first quantile after sorting as the second threshold; For each joint's change sequence, the maximum value in the change sequence is taken as the maximum change of that joint. The value at the second quantile after sorting all the maximum changes of the joints from smallest to largest is taken as the first threshold.
7. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response according to claim 6, characterized in that, The first quantity is determined by the following method: for the change sequence of each joint under normal conditions, the length of each continuous segment formed by consecutive values greater than the second threshold in the change sequence is counted, the maximum value of the length of each continuous segment is taken as the maximum number of consecutive segments of that joint, and the maximum value among the maximum number of consecutive segments of all joints is taken as the first quantity.
8. The method for locating pose deviation faults at the end effector of a robotic arm based on attention response according to claim 1, characterized in that, The determination of the change in attention value of each joint between adjacent time points in S3 specifically includes: concatenating the attention response sequences of each joint in the detection state of all joints according to the joint number to form a first detection matrix; normalizing each column of the first detection matrix so that the sum of the attention values of all joints in each column is a second fixed value, the second fixed value being a preset constant, to obtain a second detection matrix; for each row of the second detection matrix, calculating the absolute value of the difference between the attention values of two adjacent columns to obtain the change in attention value of each joint between adjacent time points.
