Method for online in-situ calibration of dynamic torque sensor
Through the online in-situ calibration of dynamic torque sensor method, automatic calibration is performed using the prediction model, which solves the problem of low accuracy and inability to reflect the actual working state of the traditional calibration method, and achieves higher accuracy calibration.
Patent Information
- Application Number
- CN202510023702.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The calibration of traditional torque sensors requires disassembly and cannot fully reflect the actual working state, and the calibration accuracy is not high.
An online in-situ calibration dynamic torque sensor method is provided, which determines whether the torque sensor needs calibration through the prediction model and carries out automated calibration based on installation position and environmental factors.
The torque sensor is automated and in-situ calibration is realized, the calibration accuracy is improved, and the impact of installation position and environmental factors is taken into account.
Smart Images

Figure CN120043686A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of torque sensor calibration, and more specifically, it relates to a method for online in-situ calibration of a dynamic torque sensor. Background Art
[0002] A torque sensor is a device used to measure rotational or torsional forces and is commonly applied in fields such as mechanical engineering, the automotive industry, robotics, and other areas that require precise control and monitoring of rotational motion. Torque sensors are mainly divided into contact type and non-contact type. For example, the contact type strain gauge torque sensor detects deformation through strain gauges fixed to the sensor body. When torque is applied, the strain gauges will deform accordingly, thereby changing the resistance value. The Wheatstone bridge circuit connected to the strain gauges can convert the change in resistance into a voltage output, and then calculate the magnitude of the applied torque. For example, the non-contact magnetoelastic torque sensor, the magnetic permeability of the magnetoelastic material changes with the change of the applied stress. By detecting the change in the magnetic field through a built-in inductor (such as a Hall effect sensor, etc.), the magnitude of the applied torque can be calculated.
[0003] The calibration of traditional torque sensors usually first places them in a torque-free state, adjusts the output signal to zero to eliminate the offset error of the sensor itself, and then gradually calibrates the sensor through a standard torque source with known accuracy (such as an electric or hydraulic torque wrench, etc.). However, the traditional calibration method requires the torque sensor to be disassembled for calibration. The disassembled torque sensor cannot fully reflect its actual working state, such as being affected by the installation position and environmental factors. And the traditional calibration method is usually linear calibration, that is, there is a fixed scale factor between the output value and the calibration value of the sensor, resulting in low calibration accuracy. Summary of the Invention
[0004] The present invention provides a method for online in-situ calibration of a dynamic torque sensor to solve the technical problems in the above background art.
[0005] The present invention provides a method for online in-situ calibration of a dynamic torque sensor, including the following steps: Step S101, within a preset first time period T1, collect the state parameters of the torque sensor at a preset first time interval t1, and perform preprocessing to generate a first feature sequence; The first feature sequence includes M sequence units. The m-th sequence unit represents the state parameters of the torque sensor collected at the m-th time point after preprocessing, where 1 ≤ m ≤ M, M = T1 / t1. The state parameters include: position information, temperature and humidity, vibration data, rotation direction, and the torque value output by the torque sensor. Among them, the vibration data is represented by a time-domain waveform diagram, the horizontal axis represents the acquisition time point, and the vertical axis represents the acceleration; Step S102: Input the first feature sequence into the first prediction model, and the output value represents the balance coefficient of the torque sensor within the first future time period G1. The value range of the balance coefficient is between 0 and 1. Step S103: If it is determined that the balance coefficient is less than the first threshold, the torque sensor does not need to be calibrated. If it is determined that the balance coefficient is greater than or equal to the first threshold and less than the second threshold, then proceed to step S104. If it is determined that the balance coefficient is greater than or equal to the second threshold and less than the third threshold, then proceed to step S106. Step S104: Within the preset second time period T2, collect the state parameters of the torque sensor at the preset second time interval t2, and perform preprocessing to generate the second feature sequence. The second feature sequence includes N sequence units, and each sequence unit of the second feature sequence represents the same as each sequence unit of the first feature sequence, where N = T2 / t2. Step S105: Input the second feature sequence into the second prediction model, and the output value represents the calibration coefficient of the torque sensor within the second future time period G2, and multiply the torque value output by the torque sensor within the second future time period G2 by the calibration coefficient to obtain the calibration value. Step S106: Collect the state parameters of the torque sensor in real time, perform preprocessing to generate the feature vector, and input the feature vector into the third prediction model, and the output value represents the calibration value of the torque sensor.
[0006] Furthermore, the preset first time period T1, the preset first time interval t1, the first future time period G1, the preset second time period T2, the preset second time interval t2, the second future time period G2, the first threshold, the second threshold, and the third threshold are all user-defined parameters.
[0007] Furthermore, the preprocessing of the state parameters to generate the first feature sequence includes the following steps: Step S201: Convert the position information and the rotation direction into numerical representations. The position information is represented by the distance between the torque sensor and the calibration position, where the calibration position is a user-defined parameter. The rotation direction is represented by an integer with a value of 0 or 1, where 0 represents the rotation direction is clockwise and 1 represents the rotation direction is counterclockwise. Step S202: For the missing values in the state parameters, perform interpolation filling processing by taking the average of the state parameters at the two adjacent time points of the missing value. Step S203: Extract the characteristic parameters of the vibration data, and splice them with other state parameters that do not include vibration data to obtain a combined vector. The characteristic parameters include: the maximum value, the minimum value, the average value, the skewness, and the kurtosis of the acceleration. Step S204, normalize the combined vector at each time point by the Z-score method to generate a first feature sequence.
[0008] Furthermore, the method for preprocessing the state parameters to generate a second feature sequence is the same as the method for preprocessing the state parameters to generate a first feature sequence, and the feature vector generated by preprocessing the state parameters is the same as the combined vector normalized by the Z-score method.
[0009] Furthermore, the first prediction model consists of 3 attention mechanism layers, 1 splicing layer, 1 vector conversion layer, and 1 first classifier; Each attention mechanism layer consists of 1 local attention mechanism layer, 1 global attention mechanism layer, and 1 matrix fusion layer; The local attention mechanism layer inputs the first feature sequence and outputs a local feature matrix; The local feature matrix output by the local attention mechanism layer of the i-th attention mechanism layer The calculation formula of includes: ; ; where 1 ≤ i ≤ 3, 1 ≤ u ≤ M, 1 ≤ v ≤ M, X represents the first feature sequence, M represents the number of sequence units of the first feature sequence, S represents a sparse matrix of M rows and M columns, and the element values of S are represented by 0 or 1, represents the element value of the u-th row and v-th column of the sparse matrix, , and respectively represent the first weight parameter, the second weight parameter, and the third weight parameter of the i-th attention mechanism layer, represents element-wise multiplication, softmax represents the softmax activation function, and T represents the transpose operation; The global attention mechanism layer inputs the first feature sequence and outputs a global feature matrix; The global feature matrix output by the global attention mechanism layer of the i-th attention mechanism layer The calculation formula of includes: ; where , and respectively represent the fourth weight parameter, the fifth weight parameter, and the sixth weight parameter of the i-th attention mechanism layer, and Swish represents the Swish activation function; The matrix fusion layer is used to fuse the local feature matrix output by the local attention mechanism layer and the global feature matrix output by the global attention mechanism layer to obtain the first hybrid matrix; The first hybrid matrix output by the matrix fusion layer of the i-th attention mechanism layer The calculation formula is as follows: ; The splicing layer is used to splice the first hybrid matrices output by the 3 attention mechanism layers to obtain the second hybrid matrix; The vector conversion layer is used to convert the second hybrid matrix into a vector representation; The calculation formula of the vector representation Vector of the second hybrid matrix output by the vector conversion layer is as follows: ; Where represents the second hybrid matrix, and the first hybrid matrices output by the 3 attention mechanism layers are respectively , and , W represents the weight parameter, and Concat represents the splicing function; The first classifier inputs the vector representation of the second hybrid matrix, and the classification space of the first classifier represents the balance coefficient of the torque sensor in the future first time period G1.
[0010] Furthermore, the calibrated torque sensor and the current torque sensor are used to obtain the standard torque value and the current torque value in the future first time period G1 respectively, and the number of deviation times, the maximum deviation value and the average deviation value between the two are calculated, and the balance coefficient is calculated as the sample label of the training sample for training the first prediction model; The calculation formula of the balance coefficient balance is as follows: ; Where , and respectively represent the number of deviation times, the maximum deviation value and the average deviation value, , and respectively represent the custom first weight coefficient, second weight coefficient and third weight coefficient, and , and The sum value of is 1.
[0011] Furthermore, the second prediction model consists of N hidden layers. The n-th hidden layer inputs the n-th sequence unit of the second feature sequence and outputs an update vector, where 1 ≤ n ≤ N; The second classifier inputs the updated vector output by the Nth hidden layer, and the classification space of the second classifier represents the calibration coefficient of the torque sensor within the future second time period G2; The updated vector output by the nth hidden layer The calculation formula is as follows: ; Where represents the updated vector output by the (n - 1)th hidden layer , is assigned a value of 0, represents the nth sequence unit of the second feature sequence input to the nth hidden layer, and respectively represent the first weight parameter and the second weight parameter of the nth hidden layer, represents the bias parameter of the nth hidden layer, and sigmoid represents the sigmoid activation function.
[0012] Furthermore, the standard torque value and the current torque value within the future second time period G2 are obtained through the calibrated torque sensor and the current torque sensor respectively, and the calibration coefficient is obtained by dividing the standard torque value by the current torque value as the sample label of the training sample for training the second prediction model.
[0013] Furthermore, the third prediction model is composed of a matrix conversion layer, a first convolutional layer, a first channel max pooling layer, a second convolutional layer, a second channel max pooling layer, an unfolding and splicing layer, and a third classifier; The matrix conversion layer is used to convert the feature vector into a matrix representation, and the number of rows and columns of this matrix is the same as the number of dimensions of the feature vector; The first convolutional layer inputs the matrix representation of the feature vector and outputs the first feature map; The first convolutional layer includes 5 convolutional kernels each with a size of 3×3, and the stride of the convolutional kernel is 1, and the padding method is VALID, then the size of the first feature map is 8×8×5, where 5 represents the number of channels; The first channel max pooling layer inputs the first feature map, takes the maximum value of each channel in the first feature map, and outputs the second feature map, then the size of the second feature map is 8×8; The second convolutional layer inputs the matrix representation of the feature vector and outputs the third feature map; The second convolutional layer includes 5 convolutional kernels each with a size of 2×2, and the stride of the convolutional kernel is 1, and the padding method is VALID, then the size of the third feature map is 9×9×5, where 5 represents the number of channels; The second channel max pooling layer inputs the third feature map, takes the maximum value of each channel in the third feature map, and outputs the fourth feature map, then the size of the fourth feature map is 9×9; The expansion and splicing layer is used to expand the second feature map and the fourth feature map into vector representations and then splice them to obtain a mixed vector. The number of dimensions of the mixed vector is 8×8 + 9×9 = 145; The third classifier inputs the mixed vector, and the classification space of the third classifier represents the calibration value of the torque sensor.
[0014] Furthermore, the calibrated torque sensor is used to obtain a standard torque value as the sample label of the training sample for training the third prediction model.
[0015] The beneficial effects of the present invention are as follows: The present invention uses the first prediction model to preliminarily determine whether the torque sensor needs to be calibrated and the calibration granularity, uses the second prediction model to complete non-real-time coarse-grained calibration, and uses the third prediction model to complete real-time fine-grained calibration. Moreover, the above prediction models all consider the influence of the installation position and environmental factors, thereby realizing the automatic and in-situ calibration of the torque sensor. Brief Description of the Drawings
[0016] Figure 1 is a flowchart of a method for online in-situ calibration of a dynamic torque sensor according to the present invention; Figure 2 is a flowchart of preprocessing to generate the first feature sequence according to the present invention. Detailed Embodiments
[0017] Now, the subject matter described herein will be discussed with reference to example embodiments. It should be understood that discussing these embodiments is only to enable those skilled in the art to better understand and thus implement the subject matter described herein. Without departing from the scope of protection of the content of this specification, changes can be made to the functions and arrangements of the elements discussed. Each example can omit, substitute, or add various processes or components as needed. Additionally, the features described in relation to some examples can also be combined in other examples.
[0018] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of the present invention should have the ordinary meanings understood by those of ordinary skill in the field to which the present invention pertains. In one or more embodiments of the present invention, the terms "first", "second" and similar words do not denote any order, quantity or importance, but are only used to distinguish different components. Words such as "including" or "comprising" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0019] As Figures 1 to 2 shown, a method for online in-situ calibration of a dynamic torque sensor includes the following steps: Step S101, within a preset first time period T1, collect the state parameters of the torque sensor at a preset first time interval t1, and perform preprocessing to generate a first feature sequence; The first feature sequence includes M sequence units. The m-th sequence unit represents the state parameters of the torque sensor collected at the m-th time point after preprocessing, where 1 ≤ m ≤ M, M = T1 / t1. The state parameters include: position information, temperature and humidity, vibration data, rotation direction, and the torque value output by the torque sensor. Among them, the vibration data is represented by a time-domain waveform diagram, with the horizontal axis representing the acquisition time point and the vertical axis representing the acceleration; Step S102, input the first feature sequence into the first prediction model, and the output value represents the balance coefficient of the torque sensor within a future first time period G1; The value range of the balance coefficient is between 0 and 1; Step S103, if it is determined that the balance coefficient is less than the first threshold, the torque sensor does not need to be calibrated. If it is determined that the balance coefficient is greater than or equal to the first threshold and less than the second threshold, then go to step S104. If it is determined that the balance coefficient is greater than or equal to the second threshold and less than the third threshold, then go to step S106; Step S104, within a preset second time period T2, collect the state parameters of the torque sensor at a preset second time interval t2, and perform preprocessing to generate a second feature sequence; The second feature sequence includes N sequence units. Each sequence unit of the second feature sequence has the same representation as each sequence unit of the first feature sequence, where N = T2 / t2; Step S105: Input the second feature sequence into the second prediction model. The output value represents the calibration coefficient of the torque sensor within the future second time period G2. Multiply the torque value output by the torque sensor within the future second time period G2 by the calibration coefficient to obtain the calibration value. Step S106: Collect the state parameters of the torque sensor in real time, preprocess them to generate a feature vector, and input the feature vector into the third prediction model. The output value represents the calibration value of the torque sensor.
[0020] It should be noted that the above torque sensor can be a contact torque sensor or a non-contact torque sensor, which is not limited herein. And in the present invention, the first prediction model is first used to preliminarily determine whether the torque sensor needs calibration and the calibration granularity. The second prediction model is used to complete the non-real-time coarse-grained calibration, and the third prediction model is used to complete the real-time fine-grained calibration, so as to realize the automatic calibration of the torque sensor. In addition, a switch can also be set separately to allow the user to set whether to calibrate and the calibration method, which will not be elaborated herein.
[0021] In an embodiment of the present invention, the preset first time period T1, the preset first time interval t1, the future first time period G1, the preset second time period T2, the preset second time interval t2, the future second time period G2, the first threshold, the second threshold, and the third threshold are all user-defined parameters. Preferably, the preset first time period T1 is set to 10 minutes, the preset first time interval t1 is set to 30 seconds, then M = T1 / t1 = 20, the future first time period G1 is set to 10 minutes, the preset second time period T2 is set to 30 minutes, the preset second time interval t2 is set to 1 minute, then N = T2 / t2 = 30, the future second time period G2 is set to 30 minutes, the first threshold is set to 0.2, the second threshold is set to 0.6, and the third threshold is set to 1.
[0022] In an embodiment of the present invention, as Figure 2 shown, the preprocessing of the state parameters to generate the first feature sequence includes the following steps: Step S201: Convert the position information and the rotation direction into numerical representations. The position information is represented by the distance between the torque sensor and the calibration position, where the calibration position is a user-defined parameter. For example, the calibration position can be the left endpoint or the right endpoint of the transmission shaft. The rotation direction is represented by an integer with a value of 0 or 1, where 0 indicates that the rotation direction is clockwise and 1 indicates that the rotation direction is counterclockwise. Step S202: For the missing values in the state parameters, perform interpolation filling processing by taking the average value of the state parameters at the two adjacent time points of the missing value. Step S203: Extract the characteristic parameters of the vibration data, and splice them with other state parameters that do not include vibration data to obtain a combined vector; The characteristic parameters include: the maximum value, minimum value, average value, skewness, and kurtosis of the acceleration; Step S204: Normalize the combined vector at each time point by the Z-score method to generate a first feature sequence.
[0023] It should be noted that the dimension number of the combined vector is 10, which respectively correspond to the position information, temperature, humidity, maximum value, minimum value, average value, skewness, kurtosis, rotation direction, and torque value output by the torque sensor.
[0024] In an embodiment of the present invention, the method for preprocessing the state parameters to generate a second feature sequence is the same as the method for preprocessing the state parameters to generate a first feature sequence, and the feature vector generated by preprocessing the state parameters is the same as the combined vector normalized by the Z-score method.
[0025] In an embodiment of the present invention, the first prediction model is composed of 3 attention mechanism layers, 1 splicing layer, 1 vector conversion layer, and 1 first classifier; Each attention mechanism layer is composed of 1 local attention mechanism layer, 1 global attention mechanism layer, and 1 matrix fusion layer; The local attention mechanism layer inputs the first feature sequence and outputs a local feature matrix; The global attention mechanism layer inputs the first feature sequence and outputs a global feature matrix; The matrix fusion layer is used to fuse the local feature matrix output by the local attention mechanism layer and the global feature matrix output by the global attention mechanism layer to obtain a first hybrid matrix; The splicing layer is used to splice the first hybrid matrices output by the 3 attention mechanism layers to obtain a second hybrid matrix; The vector conversion layer is used to convert the second hybrid matrix into a vector representation; The first classifier inputs the vector representation of the second hybrid matrix, and the classification space of the first classifier represents the balance coefficient of the torque sensor within the first time period G1 in the future.
[0026] In an embodiment of the present invention, the calculation formula of the first prediction model includes: The local feature matrix output by the local attention mechanism layer of the i-th attention mechanism layer The calculation formula of ; ; where \(1\leq i\leq3\), \(1\leq u\leq M\), \(1\leq v\leq M\), \(X\) represents the first feature sequence, \(M\) represents the number of sequence units of the first feature sequence, \(S\) represents a sparse matrix of \(M\) rows and \(M\) columns, and the element values of \(S\) are represented by 0 or 1. represents the element value of the \(u\)-th row and \(v\)-th column of the sparse matrix. 、 and respectively represent the first weight parameter, the second weight parameter, and the third weight parameter of the \(i\)-th attention mechanism layer. represents element-wise multiplication, softmax represents the softmax activation function, and \(T\) represents the transpose operation. It should be noted that the weight parameters in the first prediction model are all learnable hyperparameters. The first feature sequence includes \(M\) sequence units, and the number of dimensions of the combined vector corresponding to each sequence unit is 10, so the size of \(X\) is \(M\times10\). 、 and are all designed as matrices of size \(10\times A\), then 、 and all result in matrices of size \(M\times A\), then multiplied by results in a matrix of size \(M\times M\), and then multiplied by results in a matrix of size \(M\times A\), that is, the size of the local feature matrix is \(M\times A\), where \(A\) is a user-defined parameter. Preferably, \(A\) is set to 16. The global feature matrix output by the global attention mechanism layer of the \(i\)-th attention mechanism layer has the following calculation formula: ; where 、 and respectively represent the fourth weight parameter, the fifth weight parameter, and the sixth weight parameter of the \(i\)-th attention mechanism layer, and Swish represents the Swish activation function. Similarly, 、 and are all designed as matrices of size \(10\times A\), so the size of the global feature matrix is \(M\times A\). The calculation formula for the first hybrid matrix output by the matrix fusion layer of the \(i\)-th attention mechanism layer is as follows: ; According to the above content, the size of the first hybrid matrix can be obtained as \(M\times A\). The calculation formula for the vector representation Vector of the second hybrid matrix output by the vector conversion layer is as follows: ; where represents the second mixing matrix, and the first mixing matrices output by the 3 attention mechanism layers are respectively , and , W represents the weight parameter, and Concat represents the concatenation function; According to the above content, the size of the second mixing matrix is M×3A. W is designed as a vector of size 1×M, then the size of Vector is 1×3A.
[0027] In an embodiment of the present invention, a calibrated torque sensor and a current torque sensor are respectively used to obtain a standard torque value and a current torque value within a first future time period G1, and the number of deviation times, the maximum deviation value, and the average deviation value between the two are calculated, and a balance coefficient is calculated as the sample label of the training sample for training the first prediction model; The calculation formula of the balance coefficient balance is as follows: ; where , and respectively represent the number of deviation times, the maximum deviation value, and the average deviation value, , and respectively represent the custom first weight coefficient, second weight coefficient, and third weight coefficient, and , and The sum value of is set to 0.2, is set to 0.4, is set to 0.4.
[0028] In an embodiment of the present invention, the second prediction model is composed of N hidden layers. The nth hidden layer inputs the nth sequence unit of the second feature sequence and outputs an update vector, where 1≤n≤N; The second classifier inputs the update vector output by the Nth hidden layer, and the classification space of the second classifier represents the calibration coefficient of the torque sensor within a second future time period G2.
[0029] In an embodiment of the present invention, the update vector output by the nth hidden layer ; where represents the update vector output by the (n - 1)th hidden layer , is assigned a value of 0, represents the nth sequence unit of the second feature sequence input to the nth hidden layer, and respectively represent the first weight parameter and the second weight parameter of the nth hidden layer, represents the bias parameter of the nth hidden layer, and sigmoid represents the sigmoid activation function.
[0030] It should be noted that the weight parameters and bias parameters in the second prediction model are both learnable hyperparameters. For example, if the update vector is designed as a vector of size 1×B, and each sequence unit of the second feature sequence is a vector of size 1×10, then needs to be designed as a matrix of size 10×B, needs to be designed as a matrix of size B×B, needs to be designed as a vector of size 1×B, where B is a user-defined parameter. Preferably, B is set to 8.
[0031] In an embodiment of the present invention, a standard torque value and a current torque value within a future second time period G2 are respectively obtained through a calibrated torque sensor and a current torque sensor, and the standard torque value is divided by the current torque value to obtain a calibration coefficient as the sample label of the training sample for training the second prediction model.
[0032] In an embodiment of the present invention, the third prediction model is composed of a matrix conversion layer, a first convolutional layer, a first channel max pooling layer, a second convolutional layer, a second channel max pooling layer, an unfolding and splicing layer, and a third classifier; The matrix conversion layer is used to convert the feature vector into a matrix representation, and the number of rows and columns of the matrix is the same as the number of dimensions of the feature vector; For example, if the size of the feature vector is 1×10, and the weight parameter in the matrix conversion layer is also designed as a vector of size 1×10, then the matrix obtained by multiplying the transpose of the feature vector by the weight parameter in the matrix conversion layer has a size of 10×10; The first convolutional layer inputs the matrix representation of the feature vector and outputs the first feature map; The first convolutional layer includes 5 convolutional kernels each of size 3×3, and the stride of the convolutional kernel is 1, and the padding method is VALID, then the size of the first feature map is 8×8×5, where 5 represents the number of channels; The first channel max pooling layer inputs the first feature map, takes the maximum value of each channel in the first feature map, and outputs the second feature map, then the size of the second feature map is 8×8; The second convolutional layer inputs the matrix representation of the feature vector and outputs the third feature map; The second convolutional layer includes 5 convolutional kernels each with a size of 2×2, and the stride of the convolutional kernels is 1, and the padding method is VALID. Then the size of the third feature map is 9×9×5, where 5 represents the number of channels; The second-channel max pooling layer takes the third feature map as input, takes the maximum value of each channel in the third feature map, and outputs the fourth feature map. Then the size of the fourth feature map is 9×9; The expansion and concatenation layer is used to expand the second feature map and the fourth feature map into vector representations and then concatenate them to obtain a mixed vector. Then the number of dimensions of the mixed vector is 8×8 + 9×9 = 145; The third classifier takes the mixed vector as input, and the classification space of the third classifier represents the calibration value of the torque sensor.
[0033] In an embodiment of the present invention, a standard torque value is obtained through the calibrated torque sensor as the sample label of the training sample for training the third prediction model.
[0034] In an embodiment of the present invention, as shown in the following table, the calibration of 10 groups of torque values is completed through the second prediction model and the third prediction model respectively. The mean absolute errors (MAEs) of the second prediction model and the third prediction model are 1.62 and 0.2 respectively. Therefore, the calibration accuracy of the third prediction model provided by the present invention is higher.
[0035]
[0036] The above has described the embodiments of this embodiment, but this embodiment is not limited to the above specific implementation manners. The above specific implementation manners are only illustrative and not restrictive. Under the inspiration of this embodiment, those of ordinary skill in the art can also make many forms, all of which fall within the protection scope of this embodiment.
Claims
1. A method for online in-situ calibration of a dynamic torque sensor, characterized in that: The following steps are involved: Step S101, within a preset first time period T1, collecting state parameters of the torque sensor according to a preset first time interval t1, and performing preprocessing to generate a first characteristic sequence; The first feature sequence includes M sequence units, the mth sequence unit represents the state parameters of the torque sensor collected at the mth time point after preprocessing, where 1≤m≤M, M=T1 / t1, and the state parameters include: position information, temperature and humidity, vibration data, rotation direction and torque value output by the torque sensor, where the vibration data is represented by a time domain waveform graph, the horizontal axis represents the collection time point, and the vertical axis represents acceleration; Step S102, inputting the first characteristic sequence into the first prediction model, and the output value represents the balance coefficient of the torque sensor in the first future time period G1; The value range of the balance coefficient is between 0 and 1; Step S103: if the balance coefficient is less than the first threshold, the torque sensor does not need to be calibrated; if the balance coefficient is greater than or equal to the first threshold and less than the second threshold, the process proceeds to step S104; if the balance coefficient is greater than or equal to the second threshold and less than the third threshold, the process proceeds to step S106; Step S104, within a preset second time period T2, collecting state parameters of the torque sensor according to a preset second time interval t2, and performing preprocessing to generate a second characteristic sequence; The second feature sequence includes N sequence units, and each sequence unit of the second feature sequence has the same representation as each sequence unit of the first feature sequence, wherein N=T2 / t2; Step S105, inputting the second characteristic sequence into the second prediction model, the output value represents the calibration coefficient of the torque sensor in the future second time period G2, and multiplying the torque value output by the torque sensor in the future second time period G2 by the calibration coefficient to obtain a calibration value; Step S106, collecting state parameters of the torque sensor in real time, performing preprocessing to generate a feature vector, and inputting the feature vector into the third prediction model. The output value represents the calibration value of the torque sensor.
2. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The preset first time period T1, the preset first time interval t1, the future first time period G1, the preset second time period T2, the preset second time interval t2, the future second time period G2, the first threshold, the second threshold and the third threshold are all custom parameters.
3. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: Preprocessing the state parameters to generate a first feature sequence includes the following steps: Step S201, converting the position information and the rotation direction into numerical representation; The position information is represented by the distance between the torque sensor and the calibration position, where the calibration position is a custom parameter; The rotation direction is represented by an integer with a value of 0 or 1, where 0 represents the rotation direction is clockwise and 1 represents the rotation direction is counterclockwise; Step S202: for missing values in the state parameters, interpolation filling is performed by taking the average value of the state parameters of two adjacent time points of the missing values; Step S203, extracting characteristic parameters of the vibration data, and concatenating the characteristic parameters with other state parameters not including the vibration data to obtain a combined vector; The characteristic parameters include: maximum value, minimum value, average value, skewness and kurtosis of acceleration; Step S204: normalize the combination vector at each time point by using a Z-score method to generate a first feature sequence.
4. The method for online in-situ calibration of a dynamic torque sensor according to claim 3, characterized in that: The method of preprocessing the state parameters to generate the second feature sequence is the same as the method of preprocessing the state parameters to generate the first feature sequence, and the feature vector generated by preprocessing the state parameters is the same as the combination vector normalized by the Z-score method.
5. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The first prediction model consists of 3 attention mechanism layers, 1 concatenation layer, 1 vector conversion layer and 1 first classifier; Each attention mechanism layer consists of 1 local attention mechanism layer, 1 global attention mechanism layer and 1 matrix fusion layer; The local attention mechanism layer inputs the first feature sequence and outputs a local feature matrix; The local feature matrix output by the local attention layer of the i-th attention mechanism layer The calculation formula include: ; ; Where 1≤i≤3, 1≤u≤M, 1≤v≤M, X represents the first feature sequence, M represents the number of sequence units of the first feature sequence, S represents a sparse matrix of M rows and M columns, and the element value of S is represented by 0 or 1, Represents the element value of the u-th row and v-th column of the sparse matrix, , and They represent the first weight parameter, the second weight parameter and the third weight parameter of the i-th attention mechanism layer respectively, represents element-by-element multiplication, softmax represents the softmax activation function, and T represents the transposition operation; The global attention mechanism layer inputs the first feature sequence and outputs the global feature matrix; The global feature matrix output by the global attention mechanism layer of the i-th attention mechanism layer The calculation formula includes: ; in , and They respectively represent the fourth weight parameter, the fifth weight parameter and the sixth weight parameter of the i-th attention mechanism layer, and Swish represents the Swish activation function; The matrix fusion layer is used to fuse the local feature matrix output by the local attention mechanism layer and the global feature matrix output by the global attention mechanism layer to obtain a first mixed matrix; The first mixed matrix output by the matrix fusion layer of the i-th attention mechanism layer The calculation formula is as follows: ; The concatenation layer is used to concatenate the first mixing matrices output by the three attention mechanism layers to obtain the second mixing matrix; The vector conversion layer is used to convert the second mixing matrix into a vector representation; The calculation formula of the vector representation Vector of the second mixing matrix output by the vector conversion layer is as follows: ; in represents the second mixing matrix, and the first mixing matrices output by the three attention mechanism layers are , and , W represents the weight parameter, Concat represents the concatenation function; The first classifier inputs the vector representation of the second mixing matrix, and the classification space of the first classifier represents the balance coefficient of the torque sensor in the future first time period G1.
6. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The standard torque value and the current torque value in the first future time period G1 are obtained by the calibrated torque sensor and the current torque sensor respectively, and the number of deviations, the maximum deviation value and the average deviation value between the two are calculated, and the balance coefficient is calculated as the sample label of the training sample for training the first prediction model; The calculation formula of the balance coefficient is as follows: ; in , and They represent the number of deviations, the maximum deviation value and the average deviation value respectively. , and represent the first, second and third custom weight coefficients, respectively, and , and The sum of is 1.
7. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The second prediction model consists of N hidden layers, the nth hidden layer inputs the nth sequence unit of the second feature sequence and outputs an update vector, where 1≤n≤N; The second classifier inputs the update vector output by the Nth hidden layer, and the classification space of the second classifier represents the calibration coefficient of the torque sensor in the future second time period G2; Update vector for the output of the nth hidden layer The calculation formula is as follows: ; in represents the update vector of the output of the n-1th hidden layer , Assign a value of 0, represents the nth sequence unit of the nth hidden layer inputting the second feature sequence, and Respectively represent the first weight parameter and the second weight parameter of the nth hidden layer, represents the bias parameter of the nth hidden layer, and sigmoid represents the sigmoid activation function.
8. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The standard torque value and the current torque value in the future second time period G2 are obtained respectively through the calibrated torque sensor and the current torque sensor, and the calibration coefficient is obtained by dividing the standard torque value by the current torque value as the sample label of the training sample for training the second prediction model.
9. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The third prediction model consists of a matrix conversion layer, a first convolution layer, a first channel maximum pooling layer, a second convolution layer, a second channel maximum pooling layer, an expansion splicing layer, and a third classifier; The matrix conversion layer is used to convert the feature vector into a matrix representation, where the number of rows and columns of the matrix is the same as the number of dimensions of the feature vector; The first convolutional layer inputs the matrix representation of the feature vector and outputs the first feature map; The first convolutional layer includes 5 convolution kernels of size 3×3, and the stride of the convolution kernel is 1, and the padding mode is VALID, so the size of the first feature map is 8×8×5, where 5 represents the number of channels; The first channel maximum pooling layer inputs the first feature map, takes the maximum value of each channel in the first feature map, and outputs the second feature map. The size of the second feature map is 8×8. The second convolutional layer inputs the matrix representation of the feature vector and outputs the third feature map; The second convolutional layer includes 5 convolution kernels of size 2×2, and the stride of the convolution kernel is 1, and the padding mode is VALID, then the size of the third feature map is 9×9×5, where 5 represents the number of channels; The second channel maximum pooling layer inputs the third feature map, takes the maximum value of each channel in the third feature map, and outputs the fourth feature map. The size of the fourth feature map is 9×9. The expansion concatenation layer is used to expand the second feature map and the fourth feature map into vector representations and then concatenate them to obtain a mixed vector. The number of dimensions of the mixed vector is 8×8+9×9=145. The third classifier inputs the mixed vector, and the classification space of the third classifier represents the calibration value of the torque sensor.
10. The method for online in-situ calibration of a dynamic torque sensor according to claim 1, characterized in that: The standard torque value is obtained by the calibrated torque sensor as the sample label of the training sample for training the third prediction model.