CN114074332A - Friction compensation method and device, electronic equipment and storage medium - Google Patents

Friction compensation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114074332A
CN114074332A CN202210061632.3A CN202210061632A CN114074332A CN 114074332 A CN114074332 A CN 114074332A CN 202210061632 A CN202210061632 A CN 202210061632A CN 114074332 A CN114074332 A CN 114074332A
Authority
CN
China
Prior art keywords
learner
primary
training
mechanical arm
inputting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210061632.3A
Other languages
Chinese (zh)
Other versions
CN114074332B (en
Inventor
张校志
许泳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ji Hua Laboratory
Original Assignee
Ji Hua Laboratory
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ji Hua Laboratory filed Critical Ji Hua Laboratory
Priority to CN202210061632.3A priority Critical patent/CN114074332B/en
Publication of CN114074332A publication Critical patent/CN114074332A/en
Application granted granted Critical
Publication of CN114074332B publication Critical patent/CN114074332B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1628Programme controls characterised by the control loop
    • B25J9/1641Programme controls characterised by the control loop compensation for backlash, friction, compliance, elasticity in the joints
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J13/00Controls for manipulators
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1628Programme controls characterised by the control loop
    • B25J9/163Programme controls characterised by the control loop learning, adaptive, model based, rule based expert control

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Automation & Control Theory (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention relates to the field of mechanical arm control, in particular to a friction force compensation method and device, electronic equipment and a storage medium. The friction force compensation method comprises the following steps: acquiring state data of each shaft of the mechanical arm; the state data comprises planning parameters and historical parameters; inputting the state data into the prediction model after training is completed, and obtaining a prediction torque correction value; the prediction model comprises at least one primary learner and one secondary learner; inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value; the invention can combine the planning parameter and the historical parameter to make the factors considered by the output result of the prediction model more sufficient and comprehensive, thereby effectively reducing the risk of uncertainty; meanwhile, by arranging the two learners, the output result of the model is more accurate.

Description

Friction compensation method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of mechanical arm control, in particular to a friction force compensation method and device, electronic equipment and a storage medium.
Background
The mechanical arm is inevitably influenced by the friction force between mechanisms in the motion process to cause structural wear and generate motion errors, so that how to build a model to eliminate (compensate) the influence of the friction force on the motion process of the mechanical arm becomes a hotspot problem of optimizing the dynamic performance of the mechanical arm under the condition of considering the friction force of the mechanical arm.
In the prior art, most mechanical arm prediction models established based on friction only consider the motion parameters of the current mechanical arm to predict the influence of the friction on the mechanical arm, and do not fully consider the historical motion state of the mechanical arm.
In addition, most prediction models employ only a single learning algorithm (learner), so that generalization capability is poor.
Accordingly, the prior art is in need of improvement and development.
Disclosure of Invention
The invention aims to provide a friction compensation method, a friction compensation device, an electronic device and a storage medium, which can improve the accuracy of friction compensation and effectively improve the generalization capability of a prediction model.
In a first aspect, the present application provides a friction compensation method for a robot arm control system, the friction compensation method comprising the steps of:
s1, acquiring state data of each shaft of the mechanical arm; the status data comprises planning parameters and historical parameters;
s2, inputting the state data into a prediction model after training is completed, and obtaining a prediction torque correction value; the predictive model includes at least one primary learner and one secondary learner;
and S3, inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
On the first hand, historical actual state data of all axes of the mechanical arm and currently planned state data of all axes of the mechanical arm are simultaneously taken as input, and factors which may influence friction force are fully considered; in the second aspect, the established model consists of a two-stage learning algorithm (a learner), and data which fully considers the historical parameters of the mechanical arm is input into the model for training, so that the model can refer to more characteristic dimensions, and the accuracy of the output data of the model is improved; in the third aspect, the data are analyzed and predicted sequentially through two layers of learning algorithms, and compared with the single learning algorithm, the output friction compensation value (predicted torque correction value) can be further ensured to be more accurate.
Further, the trained prediction model is obtained by training in the following manner:
s21, obtaining a plurality of original sample data, wherein each original sample data comprises state data and a corresponding calibration torque correction value;
s22, presetting a plurality of hyper-parameter combinations for each primary learner based on the algorithm model used by each primary learner;
s23, training the primary learners by a cross validation method based on the original sample data and the super-parameter combination to obtain a plurality of preferred primary learners;
s24, training each optimized primary learner based on the original sample data to obtain a plurality of final primary learners;
s25, respectively inputting a plurality of original sample data into the final primary learner to obtain output values of the final primary learner, and taking each output value and the corresponding calibration torque correction value as a primary sample to obtain a plurality of primary samples;
s26, training the secondary learner by using all the primary samples to obtain a final secondary learner.
The output of the primary learner is used as the input training of the secondary learner, and under the condition that the output data of the primary learner has certain accuracy after the primary learner finishes training, the secondary learner is trained by utilizing the output data of the primary learner, so that the trained secondary learner can output more accurate data.
Further, step S23 includes:
s231, dividing the original sample data into a plurality of mutually exclusive subsets;
s232, obtaining a plurality of folds according to the subsets, wherein each fold comprises a first test set consisting of one subset and a first training set consisting of the rest subsets; the first test set of each of the folds is different;
s233, for each primary learner, executing:
inputting each of the above-mentioned folds into the primary learner based on various hyper-parameter combinations, respectively, so as to obtain evaluation results corresponding to various hyper-parameter combinations;
s234, obtaining the preferred primary learner according to all the evaluation results.
The primary learner is trained through data, the optimal hyper-parameter combination of the corresponding algorithm of the primary learner is found, the primary learner can complete training more quickly, and meanwhile, the sufficient accuracy of the primary learner can be guaranteed.
Further, step S26 includes:
dividing the primary sample into a second test set and a second training set;
training the secondary learner with the second training set;
testing the trained secondary learner using the second test set.
Further, the step of training the secondary learner using the second training set includes:
and stopping training when the deviation between the output errors of two adjacent training of the secondary learner is smaller than a first preset threshold value.
Further, the prediction model comprises the primary learner, and the primary learner is a learner based on an XGboost algorithm or a learner based on a neural network algorithm;
the secondary learner is a learner based on a multi-response linear regression algorithm.
Further, the prediction model comprises two primary learners, wherein one primary learner is a learner based on an XGboost algorithm, and the other primary learner is a learner based on a neural network algorithm;
the secondary learner is a learner based on a multi-response linear regression algorithm.
In a second aspect, the present invention further provides a friction compensation device for a robot arm control system, the friction compensation device comprising:
the first acquisition module is used for acquiring state data of each shaft of the mechanical arm; the status data comprises planning parameters and historical parameters;
the second acquisition module is used for inputting the state data into the prediction model after training is finished and acquiring a prediction torque correction value; the predictive model includes at least one primary learner and one secondary learner;
and the execution module is used for inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
The historical parameters are used as part of input data, so that the characteristic dimensionality can be effectively increased, various influence factors can be more fully considered in the finally obtained prediction model, and the output result of the prediction model is more comprehensive and accurate; meanwhile, the prediction model is provided with two learners, so that the generalization capability of the prediction model is improved.
In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, perform the steps of the friction compensation method as described above.
In a fourth aspect, the invention provides a storage medium having stored thereon a computer program which, when being executed by a processor, performs the steps of the friction compensation method as described above.
According to the method, on one hand, historical parameters of the mechanical arm are acquired and used as data to be input into the prediction model for model training, and the influence of historical factors on the motion of the mechanical arm is fully considered, so that the reference characteristic dimension of the prediction model is more, and the friction compensation value output by the prediction model is more accurate; on the other hand, the prediction model is established by two layers of learning algorithms (learners), the two learning algorithms are arranged in series (the data output after the training of the two learning algorithms is used for the training of the learning algorithms), and the state data are input into the trained model to obtain progressive analysis (analysis and prediction are carried out again after one layer of analysis and prediction), so that the finally output friction compensation value (prediction torque correction value) is more accurate, and the mechanical arm is effectively optimized.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
Fig. 1 is a flowchart of a friction compensation method according to an embodiment of the present disclosure.
Fig. 2 is a schematic structural diagram of a friction compensation device according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
In practical application, the friction force is generated by various factors such as abrasion among gears in the motion process of the mechanical arm, the action process is complex, and the friction force comprises static friction, sliding friction, viscous friction and the like. During the movement of the robot arm, the friction forces can have the following adverse effects: planning errors are caused by the friction force of meshing among a plurality of gears of the speed reducer with each shaft, the local abrasion of the gears caused by repeated actions along with time, the planning errors are caused by the gear clearance caused by the process of the speed reducer, and the like.
Therefore, most of the time, only the speed and the moment of each axis are considered as input data of the prediction model, the characteristic dimensions of the prediction model are too few, the risk of uncertainty possibly exists due to the fact that partial characteristics are lost, and finally the data output by the prediction model cannot show excellent optimization effect on the motion of the mechanical arm; when training, too few feature dimensions are not enough to fully train the prediction model, so that the accuracy of the final prediction model is not high.
In certain preferred embodiments, a friction force compensation method is used for a robot arm control system, wherein the friction force compensation method comprises the steps of:
s1, acquiring state data of each shaft of the mechanical arm; the state data comprises planning parameters and historical parameters;
s2, inputting the state data into the prediction model after training is completed, and obtaining a prediction torque correction value; the prediction model comprises at least one primary learner and one secondary learner;
and S3, inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
In this embodiment, the planning parameters represent parameters planned by each axis of the mechanical arm at the current time, such as a planning speed, a planning position, a planning acceleration, a calculation torque, and a motor temperature of each axis measured by a temperature sensor; the historical parameters represent parameters actually measured by each axis of the mechanical arm at historical time, such as the actually measured speed, the actually measured position, the actually measured acceleration, the actually measured torque of all the axes, the motor temperature of each axis measured by a temperature sensor, and the like before one control period (generally, milliseconds is a unit, such as 4ms is common).
On the first hand, the current-time mechanical arm state data and the historical-time mechanical arm state data can contain more characteristics related to the current time than the current-time mechanical arm state data alone, for example, whether each joint of the mechanical arm is in an acceleration, deceleration or uniform speed state is judged, and the acceleration at the current time is calculated;
in the second aspect, the states (speed, position and the like) of the mechanical arm are continuously changed due to the motion characteristics of the mechanical arm, sudden change does not occur, strong correlation exists between the states, and the hidden correlation can be helped to be learned by inputting historical parameters into a prediction model;
in the third aspect, after the input data contain the historical parameters, the independence between the input data is enhanced, the data independent distribution principle of machine learning is better met, and the learning of a prediction model is facilitated (because the same mechanical arm state may occur at different moments, but the situation that the two historical mechanical arm states are also the same is difficult to occur).
It should be noted that the state data input into the predictive model for training is not limited to the planning parameters and the historical parameters, and may include data of other characteristic dimensions, and correspondingly, the state data acquired in step S1 also includes data of other characteristic dimensions, such as robot arm load data.
In the embodiment, data of various characteristic dimensions are used as input data of the prediction model, the considered influence factors are more sufficient and comprehensive, and the risk of uncertainty is reduced, so that the motion of the mechanical arm can be better optimized by the data output by the prediction model.
In this embodiment, when the prediction model is trained, considering that the states of the mechanical arms are variable and the training data set is large, a learning strategy is adopted as a combination strategy, that is, a primary learner is configured to integrate the XGBoost and/or the neural network, and then another secondary learner is configured to combine various output results (output results of the XGBoost and output results of the neural network) of the primary learner. Based on the design, the prediction model comprises two layers of learners, the two layers of learners are sequentially trained through data to obtain a prediction model after final training is finished, and finally the prediction model after the training is used for obtaining a prediction torque correction value (the prediction torque correction value is directly compensated on the output torque of the driving source on the mechanical arm and is equivalent to overcoming the influence of friction on the mechanical arm).
In the embodiment, the prediction model is trained by using data of various characteristic dimensions, so that the prediction model can be fully trained to improve the accuracy of output data of the prediction model; and the accuracy of the output data of the prediction model is further improved by combining the combination strategy; and finally, inputting the output data (the torque correction value) into the mechanical arm as a torque feedforward value, so that the mechanical arm can work according to the torque feedforward value (the torque feedforward value is compensated into the output torque of the mechanical arm as compensation, so that the mechanical arm executes corresponding actions according to the compensated output torque).
In some embodiments, the trained predictive model is trained by:
s21, obtaining a plurality of original sample data, wherein each original sample data comprises state data and a corresponding calibration torque correction value;
s22, presetting a plurality of hyper-parameter combinations for each primary learner based on the algorithm model used by each primary learner;
s23, training the primary learners by a cross validation method based on original sample data and super-parameter combinations to obtain a plurality of optimal primary learners;
s24, training each optimized primary learner based on original sample data to obtain a plurality of final primary learners;
s25, respectively inputting a plurality of original sample data into a final primary learner to obtain the output values of the final primary learner, and taking each output value and the corresponding calibration torque correction value as a primary sample to obtain a plurality of primary samples;
and S26, training the secondary learner by using all the primary samples to obtain a final secondary learner.
In this embodiment, the hyper-parameters and the normal parameters (including the hyper-parameters and the normal parameters, which are prior art and are not described herein again) of the algorithm model (i.e., the algorithm itself) used by each primary learner are not confirmed before training, but before training the prediction model, a user may preset a plurality of sets of hyper-parameter combinations (generally preset according to experience) for each algorithm in advance, and simultaneously preset a set of normal parameters for each algorithm, for example, the XGBoost algorithm includes the hyper-parameters A, B and C, and the normal parameters are set to d, e, and f; the neural network algorithm comprises hyper-parameters G, H and J, and common parameters are set as k, m and n; at this time, two sets of hyper-parameter combinations are preset for the XGboost algorithm: the first group of hyper-parameters is a, b and c; the second set of hyper-parameters is a ', b ' and c '; similarly, three sets of hyper-parameter combinations are preset for the neural network algorithm: the first group of hyper-parameters is g, h and j; the second set of hyper-parameters is combined as g ', h ' and j '; the third set of sets of hyper-parameters is g '', h '', and j ''. That is, the hyperparameter A, B, C, G, H, J is unknown, and A can be a and a'; the values of B may be B and B'; the value of C may be C and C'; the value of G may be G, G ' and G ' '; the value of H may be H, H ' and H ' '; the value of J may be J, J ' and J ' '.
And then inputting original sample data into each primary learner by using a cross verification method to obtain the optimal hyper-parameter combination of the algorithm corresponding to each primary learner, determining the hyper-parameters of the algorithm corresponding to each primary learner, then inputting the original sample data again to train each primary learner again, aiming at adjusting the common parameters of the algorithm corresponding to each primary learner, adjusting the common parameters according to actual training instead of preset values, and finally finishing training to obtain the final primary learner (namely, the hyper-parameters and the common parameters are set to be optimal).
In certain embodiments, step S23 includes:
s231, dividing original sample data into a plurality of mutually exclusive subsets;
s232, obtaining a plurality of folds according to the subsets, wherein each fold comprises a first test set consisting of one subset and a first training set consisting of the rest subsets; the first test set of each fold is different;
s233, for each primary learner, executing:
respectively inputting the various sections into a primary learner based on various hyper-parameter combinations to obtain evaluation results corresponding to the various hyper-parameter combinations;
and S234, obtaining a preferred primary learner according to all the evaluation results.
In this embodiment, the cross validation method is used to input original sample data into each primary learner to obtain the optimal hyper-parameter combination of the algorithms corresponding to each primary learner, for example, the original sample data is input into the primary learner of the XGBoost algorithm based on the hyper-parameter combinations a, b, and c, and the evaluation result of the hyper-parameter combination is X after training; inputting original sample data into a primary learner of an XGboost algorithm based on hyper-parameter combinations a ', b ' and c ', and training to obtain an evaluation result of the hyper-parameter combination as Y; comparing X with Y to optimize X with better evaluation result, and correspondingly, taking the hyper-parameter combinations of a, b and c as the optimal hyper-parameter combination of the corresponding algorithm of the primary learner; and the primary learners with the hyper-parameters a, b and c are called preferred primary learners.
It should be noted that the cross-validation method is the prior art, and the specific process steps thereof are not described herein again.
In certain embodiments, step S26 includes:
dividing the primary sample into a second test set and a second training set;
training the secondary learner using the second training set;
the trained secondary learner is tested using a second test set.
In some embodiments, the step of training the secondary learner with the second training set comprises:
and stopping training when the deviation between the output errors of two adjacent training of the secondary learner is smaller than a first preset threshold value.
In this embodiment, when the final output value of each primary learner is input into the secondary learner to train the secondary learner, each time training is performed, the output value of the secondary learner is compared with the calibration torque correction value, so as to obtain the output error of the secondary learner (the output error of the secondary learner refers to the difference between the output value of the secondary learner and the calibration torque correction value), when training is performed for the second time, if the deviation between the output error of the secondary learner trained for the second time and the output error of the secondary learner trained for the first time is smaller than the first preset threshold, it may be considered that training is completed, and the final secondary learner is obtained, otherwise, the secondary learner continues to train until the deviation between the output errors of two adjacent times is smaller than the first preset threshold.
It should be noted that as the training progresses, if the deviation between the output errors of two adjacent training approaches the first preset threshold (for example, the first preset threshold is 0.5, the deviation between the output error of the secondary learner trained for the second time and the output error of the secondary learner trained for the first time is 2, and the deviation between the output error of the secondary learner trained for the fourth time and the output error of the secondary learner trained for the third time is 1), it is proved that the secondary learner is being effectively trained.
In some embodiments, the step of training the secondary learner with the second training set comprises:
and stopping training when the training times exceed a first preset time.
In certain embodiments, step S24 includes:
dividing original sample data into a third test set and a third training set;
training the preferred primary learner using the third training set;
the trained preferred primary learner is tested using a third test set.
In some embodiments, the step of training the preferred primary learner using the third training set comprises:
the training is stopped when the deviation between the output errors of two adjacent training of the preferred primary learner is less than a second preset threshold.
In this embodiment, when the original sample data is inputted into each of the preferred primary learners to train the preferred primary learner, each time training is performed, the respective output values of the preferred primary learner are compared with the calibration torque correction values, respectively, to obtain the output error of the preferred primary learner (the output error of the preferred primary learner refers to the difference between the output value of the preferred primary learner and the calibration torque correction value), when the output error of the preferred primary learner is less than the second preset threshold, the output error of the preferred primary learner is compared with the output error of the preferred primary learner, the training may be considered complete and the final primary learner is obtained, otherwise the training of the primary learner continues until the deviation between the output errors of two consecutive training of the preferred primary learner is less than the second preset threshold.
It should be noted that, as the training progresses, if the deviation between the output errors of two adjacent training approaches the second preset threshold (for example, the first preset threshold is 0.5, the deviation between the output error of the primary learner for the second training and the output error of the primary learner for the first training is 2, and the deviation between the output error of the primary learner for the fourth training and the output error of the primary learner for the third training is 1), it is proved that the primary learner is being effectively trained.
In some embodiments, the step of training the preferred primary learner using the third training set comprises:
and stopping training when the training times exceed a second preset time.
In some embodiments, the prediction model comprises a primary learner, the primary learner is a learner based on the XGBoost algorithm or a learner based on the neural network algorithm;
the secondary learner is a learner based on a multi-response linear regression algorithm.
In some embodiments, the predictive model includes two primary learners, wherein one primary learner is an XGBoost algorithm-based learner and the other primary learner is a neural network algorithm-based learner;
the secondary learner is a learner based on a multi-response linear regression algorithm.
Referring to fig. 2, fig. 2 is a friction compensation device for a robot arm control system according to some embodiments of the present application, the friction compensation device is integrated in a back end control apparatus of the friction compensation device in the form of a computer program, and the friction compensation device includes:
a first obtaining module 100, configured to obtain state data of each axis of the mechanical arm; the state data comprises planning parameters and historical parameters;
the second obtaining module 200 is configured to input the state data into the prediction model after the training is completed, and obtain a predicted torque correction value; the prediction model comprises at least one primary learner and one secondary learner;
and the execution module 300 is configured to input the predicted torque correction value into a torque feedforward value of the mechanical arm, so that the mechanical arm operates according to the torque feedforward value.
In some embodiments, the friction force compensation device further comprises:
the training module is used for training in the following mode to obtain a trained prediction model:
s21, obtaining a plurality of original sample data, wherein each original sample data comprises state data and a corresponding calibration torque correction value;
s22, presetting a plurality of hyper-parameter combinations for each primary learner based on the algorithm model used by each primary learner;
s23, training the primary learners by a cross validation method based on original sample data and super-parameter combinations to obtain a plurality of optimal primary learners;
s24, training each optimized primary learner based on original sample data to obtain a plurality of final primary learners;
s25, respectively inputting a plurality of original sample data into a final primary learner to obtain the output values of the final primary learner, and taking each output value and the corresponding calibration torque correction value as a primary sample to obtain a plurality of primary samples;
and S26, training the secondary learner by using all the primary samples to obtain a final secondary learner.
In some embodiments, the training module performs when training the primary learner by cross-validation based on the original sample data and the hyper-parameter combinations, obtaining a plurality of preferred primary learners:
s231, dividing original sample data into a plurality of mutually exclusive subsets;
s232, obtaining a plurality of folds according to the subsets, wherein each fold comprises a first test set consisting of one subset and a first training set consisting of the rest subsets; the first test set of each fold is different;
s233, for each primary learner, executing:
respectively inputting the various sections into a primary learner based on various hyper-parameter combinations to obtain evaluation results corresponding to the various hyper-parameter combinations;
and S234, obtaining a preferred primary learner according to all the evaluation results.
In some embodiments, the training module performs when training the secondary learner using all of the primary samples to obtain a final secondary learner:
dividing the primary sample into a second test set and a second training set;
training the secondary learner using the second training set;
the trained secondary learner is tested using a second test set.
In some embodiments, the training module performs, while training the secondary learner with the second training set:
and stopping training when the deviation between the output errors of two adjacent training of the secondary learner is smaller than a first preset threshold value.
In some embodiments, the training module performs, while training the secondary learner with the second training set:
and stopping training when the training times exceed a first preset time.
In some embodiments, the training module performs, when training each of the preferred primary learners based on the original sample data to obtain a plurality of final primary learners:
dividing original sample data into a third test set and a third training set;
training the preferred primary learner using the third training set;
the trained preferred primary learner is tested using a third test set.
In some embodiments, the training module performs, while training the preferred primary learner using the third training set:
the training is stopped when the deviation between the output errors of two adjacent training of the preferred primary learner is less than a second preset threshold.
In some embodiments, the training module performs, while training the preferred primary learner using the third training set:
and stopping training when the training times exceed a second preset time.
In some embodiments, the prediction model comprises a primary learner, the primary learner is a learner based on the XGBoost algorithm or a learner based on the neural network algorithm;
the secondary learner includes a multi-response linear regression algorithm.
In some embodiments, the predictive model includes two primary learners, wherein one primary learner is an XGBoost algorithm-based learner and the other primary learner is a neural network algorithm-based learner;
the secondary learner includes a multi-response linear regression algorithm.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the present disclosure provides an electronic device, including: the processor 1301 and the memory 1302, the processor 1301 and the memory 1302 being interconnected and communicating with each other via a communication bus 1303 and/or other form of connection mechanism (not shown), the memory 1302 storing a computer program executable by the processor 1301, the processor 1301 executing the computer program when the computing device is running to perform the friction force compensation method in any of the alternative implementations of the embodiments of the first aspect described above to implement the following functions: acquiring state data of each shaft of the mechanical arm; the state data comprises planning parameters and historical parameters; inputting the state data into the prediction model after training is completed, and obtaining a prediction torque correction value; the prediction model comprises at least one primary learner and one secondary learner; and inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
An embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for compensating friction in any optional implementation manner of the embodiment of the first aspect is executed, so as to implement the following functions: acquiring state data of each shaft of the mechanical arm; the state data comprises planning parameters and historical parameters; inputting the state data into the prediction model after training is completed, and obtaining a prediction torque correction value; the prediction model comprises at least one primary learner and one secondary learner; and inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A friction force compensation method for a mechanical arm control system is characterized by comprising the following steps:
s1, acquiring state data of each shaft of the mechanical arm; the status data comprises planning parameters and historical parameters;
s2, inputting the state data into a prediction model after training is completed, and obtaining a prediction torque correction value; the predictive model includes at least one primary learner and one secondary learner;
and S3, inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
2. A friction compensation method according to claim 1, wherein the predictive model is trained by:
s21, obtaining a plurality of original sample data, wherein each original sample data comprises state data and a corresponding calibration torque correction value;
s22, presetting a plurality of hyper-parameter combinations for each primary learner based on the algorithm model used by each primary learner;
s23, training the primary learners by a cross validation method based on the original sample data and the super-parameter combination to obtain a plurality of preferred primary learners;
s24, training each optimized primary learner based on the original sample data to obtain a plurality of final primary learners;
s25, respectively inputting a plurality of original sample data into the final primary learner to obtain output values of the final primary learner, and taking each output value and the corresponding calibration torque correction value as a primary sample to obtain a plurality of primary samples;
s26, training the secondary learner by using all the primary samples to obtain a final secondary learner.
3. The friction force compensation method according to claim 2, wherein step S23 includes:
s231, dividing the original sample data into a plurality of mutually exclusive subsets;
s232, obtaining a plurality of folds according to the subsets, wherein each fold comprises a first test set consisting of one subset and a first training set consisting of the rest subsets; the first test set of each of the folds is different;
s233, for each primary learner, executing:
inputting each of the above-mentioned folds into the primary learner based on various hyper-parameter combinations, respectively, so as to obtain evaluation results corresponding to various hyper-parameter combinations;
s234, obtaining the preferred primary learner according to all the evaluation results.
4. The friction force compensation method according to claim 2, wherein step S26 includes:
dividing the primary sample into a second test set and a second training set;
training the secondary learner with the second training set;
testing the trained secondary learner using the second test set.
5. A friction compensation method as recited in claim 4 wherein the step of training the secondary learner with the second training set comprises:
and stopping training when the deviation between the output errors of two adjacent training of the secondary learner is smaller than a first preset threshold value.
6. A friction compensation method according to claim 1, wherein the predictive model comprises one of the primary learners, the primary learner being an XGBoost algorithm-based learner or a neural network algorithm-based learner;
the secondary learner is a learner based on a multi-response linear regression algorithm.
7. The friction compensation method according to claim 1, wherein the prediction model comprises two primary learners, wherein one of the primary learners is a learner based on an XGBoost algorithm, and the other of the primary learners is a learner based on a neural network algorithm;
the secondary learner is a learner based on a multi-response linear regression algorithm.
8. A friction force compensating device for a robot arm control system, the friction force compensating device comprising:
the first acquisition module is used for acquiring state data of each shaft of the mechanical arm; the status data comprises planning parameters and historical parameters;
the second acquisition module is used for inputting the state data into the prediction model after training is finished and acquiring a prediction torque correction value; the predictive model includes at least one primary learner and one secondary learner;
and the execution module is used for inputting the predicted torque correction value into a torque feedforward value of the mechanical arm so that the mechanical arm works according to the torque feedforward value.
9. An electronic device comprising a processor and a memory, said memory storing computer readable instructions which, when executed by said processor, perform the steps of the method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the method according to any one of claims 1-7.
CN202210061632.3A 2022-01-19 2022-01-19 Friction compensation method and device, electronic equipment and storage medium Active CN114074332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210061632.3A CN114074332B (en) 2022-01-19 2022-01-19 Friction compensation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210061632.3A CN114074332B (en) 2022-01-19 2022-01-19 Friction compensation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114074332A true CN114074332A (en) 2022-02-22
CN114074332B CN114074332B (en) 2022-04-22

Family

ID=80284709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210061632.3A Active CN114074332B (en) 2022-01-19 2022-01-19 Friction compensation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114074332B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114474078A (en) * 2022-04-12 2022-05-13 季华实验室 Friction force compensation method and device for mechanical arm, electronic equipment and storage medium
CN116460859A (en) * 2023-06-19 2023-07-21 广东隆崎机器人有限公司 SCARA robot motion compensation method, SCARA robot motion compensation device, SCARA robot motion compensation equipment and SCARA robot motion compensation storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951695A (en) * 2017-03-09 2017-07-14 杭州安脉盛智能技术有限公司 Plant equipment remaining life computational methods and system under multi-state
CN111428317A (en) * 2020-04-06 2020-07-17 宁波智诚祥科技发展有限公司 Joint friction torque compensation method based on 5G and recurrent neural network
CN112247992A (en) * 2020-11-02 2021-01-22 中国科学院深圳先进技术研究院 Robot feedforward torque compensation method
CN113313211A (en) * 2021-06-28 2021-08-27 中国平安财产保险股份有限公司 Text classification method and device, electronic equipment and storage medium
US11169288B1 (en) * 2017-12-07 2021-11-09 Triad National Security, Llc Failure prediction and estimation of failure parameters

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951695A (en) * 2017-03-09 2017-07-14 杭州安脉盛智能技术有限公司 Plant equipment remaining life computational methods and system under multi-state
US11169288B1 (en) * 2017-12-07 2021-11-09 Triad National Security, Llc Failure prediction and estimation of failure parameters
CN111428317A (en) * 2020-04-06 2020-07-17 宁波智诚祥科技发展有限公司 Joint friction torque compensation method based on 5G and recurrent neural network
CN112247992A (en) * 2020-11-02 2021-01-22 中国科学院深圳先进技术研究院 Robot feedforward torque compensation method
CN113313211A (en) * 2021-06-28 2021-08-27 中国平安财产保险股份有限公司 Text classification method and device, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114474078A (en) * 2022-04-12 2022-05-13 季华实验室 Friction force compensation method and device for mechanical arm, electronic equipment and storage medium
CN114474078B (en) * 2022-04-12 2022-06-17 季华实验室 Friction force compensation method and device for mechanical arm, electronic equipment and storage medium
CN116460859A (en) * 2023-06-19 2023-07-21 广东隆崎机器人有限公司 SCARA robot motion compensation method, SCARA robot motion compensation device, SCARA robot motion compensation equipment and SCARA robot motion compensation storage medium
CN116460859B (en) * 2023-06-19 2023-10-03 广东隆崎机器人有限公司 SCARA robot motion compensation method, SCARA robot motion compensation device, SCARA robot motion compensation equipment and SCARA robot motion compensation storage medium

Also Published As

Publication number Publication date
CN114074332B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN114074332B (en) Friction compensation method and device, electronic equipment and storage medium
CN113153521B (en) System and method for predicting vehicle engine torque by using artificial neural network
Rivas et al. A predictive maintenance model using recurrent neural networks
EP2107439A1 (en) Method and system for the design and implementation of optimal multivariable model predictive controllers for fast-sampling constrained dynamic systems
US7089221B2 (en) Feedback control of problem solving
USRE45815E1 (en) Method for simplified real-time diagnoses using adaptive modeling
CN109100990A (en) Control device, record media and control system
Liu et al. Predicting the position-dependent dynamics of machine tools using progressive network
EP3008359B1 (en) Energy exchange systems having actuators with multi-parametric control
CN106227910A (en) A kind of accelerated degradation test reliability estimation method based on gray system theory
US20230153640A1 (en) Prediction Model Learning Method, Apparatus and System for an Industrial System
JP2017120587A (en) Machine learning device learning cache lock, industrial machinery system, manufacturing system, machine learning method, and machine learning program
CN113946990A (en) Modeling method and migration learning method of STO-BTCN thermal error prediction model
Inga et al. Online inverse linear-quadratic differential games applied to human behavior identification in shared control
Galiullin et al. Development of a neuro-fuzzy diagnostic system mathematical model for internal combustion engines
Kozjek et al. Multi-objective adjustment of remaining useful life predictions based on reinforcement learning
Bai et al. Novel direct remaining useful life estimation of aero-engines with randomly assigned hidden nodes
Liu et al. Geometric-thermal error control system for gear profile grinding machine
US20200333795A1 (en) Method and apparatus for controlling movement of real object using intelligent agent trained in virtual environment
Esfahani et al. A new hybrid model for RUL prediction through machine learning
Malikopoulos et al. A real-time computational learning model for sequential decision-making problems under uncertainty
Khaziev et al. Intelligent diagnostic system for hydraulic actuator
Dursun et al. Data pooling for multiple single-component systems under population heterogeneity
CN117444978B (en) Position control method, system and equipment for pneumatic soft robot
US20190179272A1 (en) A method, system, computer program product and computer data-base for controlling an industrial process or machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant