CN114670210B - Data acquisition method, pre-training method, device, electronic equipment and storage medium - Google Patents

Data acquisition method, pre-training method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114670210B
CN114670210B CN202210600725.9A CN202210600725A CN114670210B CN 114670210 B CN114670210 B CN 114670210B CN 202210600725 A CN202210600725 A CN 202210600725A CN 114670210 B CN114670210 B CN 114670210B
Authority
CN
China
Prior art keywords
training
friction
data
target data
target
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.)
Active
Application number
CN202210600725.9A
Other languages
Chinese (zh)
Other versions
CN114670210A (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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202210600725.9A priority Critical patent/CN114670210B/en
Publication of CN114670210A publication Critical patent/CN114670210A/en
Application granted granted Critical
Publication of CN114670210B publication Critical patent/CN114670210B/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/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/1605Simulation of manipulator lay-out, design, modelling of manipulator
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the field of data processing, in particular to a data acquisition method, a pre-training device, electronic equipment and a storage medium. The data acquisition method comprises the following steps: acquiring a plurality of simulation state data of the mechanical arm; respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; acquiring a plurality of groups of training data according to each target data and the corresponding target friction value set; the invention comprehensively considers two factors of linear friction and nonlinear friction and combines calculation to obtain a data label closer to a true value, so that the obtained training data is more true and reliable.

Description

Data acquisition method, pre-training method, device, electronic equipment and storage medium
Technical Field
The invention relates to the field of data processing, in particular to a data acquisition method, a pre-training device, electronic equipment and a storage medium.
Background
Pre-training refers to a process of pre-training an initial training model before obtaining a final training model, and aims to train as much training data as possible in the same or similar tasks to extract as much common features as possible from the training data, and when the common features in the model are determined, the model is only required to be placed in an actual application scene for training again to fine-tune other non-common features, so that a more accurate model for the actual application scene is obtained; the training progress can be accelerated by utilizing the pre-training mode, and the stability of the model is improved.
In order to extract the common features accurately, it is often required that the training data used for training the pre-training model can ensure the accuracy of the pre-training model obtained through final training only by ensuring certain accuracy and authenticity, for example, each set of training data includes a data tag, the data tag is a reference value of the set of data, and after the set of data is input into the pre-training model, a result output by the pre-training model is compared with the reference value of the set of data, so as to determine the accuracy of the pre-training model.
For the friction compensation model of the mechanical arm, the output data is generally a specific value of the friction, so the data label used for comparison should also be a specific value of the friction actually required to be compensated, however, the friction actually required to be compensated is difficult to obtain through measurement, and in the prior art, the data label is often obtained only through experience of a person, so that the reliability of training data used for training the pre-training model is low.
Accordingly, the prior art is in need of improvement and development.
Disclosure of Invention
The invention aims to provide a data acquisition method, a pre-training device, electronic equipment and a storage medium, which can effectively acquire a target friction value more in line with the reality as a data label of corresponding target data, so that training data is more real and reliable.
In a first aspect, the present application provides a data acquisition method for acquiring training data of a pre-training model of a mechanical arm friction compensation model, where the data acquisition method includes the following steps:
s1, acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
s2, respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all the joints, and the nonlinear friction value set is a set of nonlinear friction values of all the joints;
s3, calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
s4, acquiring multiple groups of training data according to the target data and the corresponding target friction value sets; each set of training data comprises one target data and a target friction value set corresponding to the target data.
The target friction value of each target data is obtained by comprehensively considering the linear factors and the nonlinear factors, and is used as the label of each target data, so that the obtained training data is more practical, the influence of human factors is avoided, and the reliability of the training data is improved.
Further, the specific steps in step S2 include:
s21, calculating the linear friction value set according to the following formula:
Figure 829157DEST_PATH_IMAGE001
Figure 411710DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 886554DEST_PATH_IMAGE003
is as follows
Figure 536059DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 265111DEST_PATH_IMAGE005
The linear friction value of each joint is measured,
Figure 48260DEST_PATH_IMAGE006
Figure 292290DEST_PATH_IMAGE007
Figure 920718DEST_PATH_IMAGE008
Figure 301015DEST_PATH_IMAGE009
and
Figure 740217DEST_PATH_IMAGE010
are all a first constant which is preset,
Figure 2703DEST_PATH_IMAGE011
is as follows
Figure 982291DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 748253DEST_PATH_IMAGE005
The simulated velocity values of the individual joints,
Figure 342045DEST_PATH_IMAGE012
is as follows
Figure 295089DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 265319DEST_PATH_IMAGE005
The value of the simulated torque for each joint,
Figure 89050DEST_PATH_IMAGE013
is as follows
Figure 650481DEST_PATH_IMAGE004
The first of the target data
Figure 825241DEST_PATH_IMAGE005
The simulated temperature values for the individual joints,
Figure 349895DEST_PATH_IMAGE014
is as follows
Figure 542979DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 494885DEST_PATH_IMAGE005
The simulated position values of the individual joints are,
Figure 140630DEST_PATH_IMAGE015
is as follows
Figure 203395DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 250986DEST_PATH_IMAGE005
Data set of individual joints, the first
Figure 701690DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 511428DEST_PATH_IMAGE005
The data set of each joint includes
Figure 174621DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 453549DEST_PATH_IMAGE005
Simulated velocity values, simulated torque values, simulated temperature values and simulated position values for the individual joints,
Figure 527685DEST_PATH_IMAGE016
is as follows
Figure 898754DEST_PATH_IMAGE004
The number of said target data is one,
Figure 100060DEST_PATH_IMAGE017
is as follows
Figure 591084DEST_PATH_IMAGE004
The set of linear friction values corresponding to each of the target data,
Figure 55694DEST_PATH_IMAGE018
the total number of joints of the mechanical arm;
s22, calculating the nonlinear friction value set according to the following formula:
Figure 428907DEST_PATH_IMAGE020
Figure 637165DEST_PATH_IMAGE021
Figure 982696DEST_PATH_IMAGE022
Figure 414945DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 9875DEST_PATH_IMAGE024
is as follows
Figure 756245DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 487441DEST_PATH_IMAGE005
The value of the non-linear friction force of the individual joints,
Figure 700379DEST_PATH_IMAGE025
in order to maximize the static friction force,
Figure 985866DEST_PATH_IMAGE026
is the coulomb force, and the power is the power,
Figure 332665DEST_PATH_IMAGE027
is a threshold value for the speed of viscous friction,
Figure 403521DEST_PATH_IMAGE028
is a threshold value of the coulomb speed,
Figure 364523DEST_PATH_IMAGE029
in order to obtain a coefficient of viscous friction,
Figure 962075DEST_PATH_IMAGE030
in order to achieve the maximum static friction speed,
Figure 565095DEST_PATH_IMAGE031
is as follows
Figure 490457DEST_PATH_IMAGE004
The set of nonlinear friction values corresponding to the target data;
the specific steps in step S3 include:
s31, calculating a theoretical friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the theoretical friction value set is a set of theoretical friction values of all the joints;
and S32, calculating a target friction value set corresponding to the target data according to the theoretical friction value set.
By combining the linear friction value and the nonlinear friction value, the finally obtained target friction value and the true value can be effectively ensured to have smaller error, so that the accuracy of training data can be ensured, and the precision of a pre-training model can be effectively ensured.
Further, the specific steps in step S31 include:
s311, calculating the theoretical friction value set according to the following formula:
Figure 419098DEST_PATH_IMAGE032
Figure 695490DEST_PATH_IMAGE033
wherein the content of the first and second substances,
Figure 836622DEST_PATH_IMAGE034
is as follows
Figure 413227DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 981612DEST_PATH_IMAGE005
The theoretical friction value of the individual joint,
Figure 745300DEST_PATH_IMAGE035
is a second constant that is preset and is,
Figure 221281DEST_PATH_IMAGE036
is as follows
Figure 121235DEST_PATH_IMAGE004
And the theoretical friction value set corresponding to the target data.
And calculating the theoretical friction value according to the formula, so that the precision of the pre-training model is favorably ensured, and the accuracy of the final output result of the friction compensation model is further ensured.
Further, the specific steps in step S32 include:
s321, calculating a first friction value set corresponding to the target data according to the following formula, wherein the first friction value set is a set of first friction values of all joints:
Figure 594941DEST_PATH_IMAGE037
Figure 377084DEST_PATH_IMAGE038
wherein the content of the first and second substances,
Figure 125597DEST_PATH_IMAGE039
is as follows
Figure 411216DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 586982DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 59683DEST_PATH_IMAGE040
to obtain the first
Figure 346308DEST_PATH_IMAGE004
Time of the target data
Figure 220854DEST_PATH_IMAGE005
The ambient noise value of the environment in which the individual joint is located,
Figure 301942DEST_PATH_IMAGE041
is as follows
Figure 245628DEST_PATH_IMAGE004
The first friction value set corresponding to the target data;
s322, calculating a target friction value set corresponding to the target data according to the first friction value set.
Based on the theoretical friction value, the first friction value which is more in line with objective facts is obtained through further calculation by combining the influence factors of the environmental noise, so that the training data is closer to the real situation, and the accuracy of the output result of the finally obtained friction compensation model in the application process is improved.
Further, the specific step in step S322 includes:
calculating a set of target friction values corresponding to the target data according to the following formula:
Figure 617834DEST_PATH_IMAGE042
Figure 346887DEST_PATH_IMAGE043
Figure 864456DEST_PATH_IMAGE044
wherein the content of the first and second substances,
Figure 842907DEST_PATH_IMAGE045
is as follows
Figure 205756DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 54894DEST_PATH_IMAGE005
The target friction value of the individual joint,
Figure 274523DEST_PATH_IMAGE046
is a preset proportion value, and is a preset proportion value,
Figure 943533DEST_PATH_IMAGE047
is as follows
Figure 110072DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 344875DEST_PATH_IMAGE005
A first value of friction for each joint,
Figure 938668DEST_PATH_IMAGE048
is as follows
Figure 344241DEST_PATH_IMAGE049
The number of said target data is one,
Figure 584643DEST_PATH_IMAGE050
is as follows
Figure 142795DEST_PATH_IMAGE004
The target data and the second
Figure 173068DEST_PATH_IMAGE049
The Euclidean distance of each of the target data,
Figure 347828DEST_PATH_IMAGE051
is a first
Figure 856170DEST_PATH_IMAGE049
The first one corresponding to the target data
Figure 799986DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 532319DEST_PATH_IMAGE052
is as follows
Figure 397638DEST_PATH_IMAGE049
The first of the target data
Figure 709671DEST_PATH_IMAGE053
The number of the elements is one,
Figure 39152DEST_PATH_IMAGE054
is as follows
Figure 411227DEST_PATH_IMAGE004
The first of the target data
Figure 295001DEST_PATH_IMAGE053
The number of the elements is one,
Figure 410724DEST_PATH_IMAGE055
is as follows
Figure 797975DEST_PATH_IMAGE004
The set of target friction values corresponding to the target data,
Figure 606531DEST_PATH_IMAGE056
is as follows
Figure 977600DEST_PATH_IMAGE004
The total number of elements in each of the target data,
Figure 365856DEST_PATH_IMAGE057
is the total amount of the target data.
In a second aspect, the present application further provides a pre-training method for obtaining a final friction compensation model by training a pre-training model of a mechanical arm friction compensation model, including the steps of:
A1. dividing training data obtained by all the data acquisition methods into a training set and a test set according to the ratio of 8: 2;
A2. inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all the test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model which completes training;
A3. and fine-tuning the pre-training model after training to obtain a final friction compensation model.
In a third aspect, the present invention further provides a data acquiring apparatus, configured to acquire training data of a pre-training model of a mechanical arm friction compensation model, where the data acquiring apparatus includes:
the first acquisition module is used for acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
the first calculation module is used for calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data by taking each piece of the simulation state data as the target data; the linear friction value set is a set of linear friction values of all the joints, and the nonlinear friction value set is a set of nonlinear friction values of all the joints;
the second calculation module is used for calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
the second acquisition module is used for acquiring multiple groups of training data according to each target data and the corresponding target friction value set; each set of training data comprises one target data and a target friction value set corresponding to the target data.
Two theoretical frictional forces of the linear frictional force and the nonlinear frictional force are referred to and combined to calculate to obtain the target frictional force, so that the obtained target frictional force is ensured to accord with theoretical facts, and the final output result of the frictional force compensation model is prevented from deviating from a true value too much.
In a fourth aspect, the present invention further provides a pre-training apparatus, configured to train a pre-training model of a mechanical arm friction compensation model to obtain a final friction compensation model, where the pre-training apparatus includes:
the data dividing module is used for dividing the training data obtained by the data acquisition method into a training set and a test set according to the proportion of 8: 2;
the training module is used for inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all the test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model after training;
and the fine adjustment module is used for fine adjusting the pre-training model after training to obtain a final friction compensation model.
Training the initialized pre-training model based on the training data to obtain a pre-training model completing the training, and after the pre-training model completing the training is obtained, performing targeted fine adjustment on different mechanical arms in practical application at a higher speed, so that friction force compensation models corresponding to various mechanical arms are quickly obtained, and meanwhile, the accuracy of a compensation result of the mechanical arm is higher because the friction force compensation models are highly matched with the mechanical arm.
In a fifth aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores computer-readable instructions, which when executed by the processor, perform the steps of the data acquisition method as described above, and/or perform the steps of the pre-training method as described above.
In a sixth aspect, the present invention provides a storage medium having stored thereon a computer program which, when being executed by a processor, performs the steps of the data acquisition method as described above, and/or performs the steps of the pre-training method as described above.
Therefore, the influence of linear friction and nonlinear friction on the mechanical arm in actual application is comprehensively considered by combining with the theoretical basis, the target friction value corresponding to each target data is obtained by combining with calculation and serves as the data label of each target data, compared with the method that the data label is determined only by personal experience, the method has the advantages that human factors are eliminated, the reliability of training data is improved, meanwhile, the training data can be prevented from being excessively deviated by combining with the theoretical calculation, and the method is favorable for ensuring that the training data are more accurate and real.
Drawings
Fig. 1 is a flowchart of a data acquisition method according to an embodiment of the present application.
Fig. 2 is a flowchart of a pre-training method according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a pre-training apparatus according to an embodiment of the present disclosure.
Fig. 5 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 some embodiments, a data acquisition method for acquiring training data of a pre-trained model of a mechanical arm friction compensation model, comprises the steps of:
s1, acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
s2, respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all joints, and the nonlinear friction value set is a set of nonlinear friction values of all joints;
s3, calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
s4, acquiring multiple groups of training data according to the target data and the corresponding target friction value set; each set of training data includes a target data and a set of target friction values corresponding to the target data.
In this embodiment, after determining the working space of the actual mechanical arm, the user may move the mechanical arm in the working space for a period of time at random with a spatial resolution as a sampling interval in the simulation environment, strive to obtain data corresponding to all motion states that the mechanical arm can make in the working space, where the data corresponding to each motion state of the mechanical arm is the simulation state data in this embodiment.
After enough target data are obtained, calculating a linear friction value set and a nonlinear friction value set corresponding to each target data, and combining the data of the two sets to calculate a target friction value set, wherein the target friction value set is a data label of the target data, and each target data and the corresponding data label are combined to form a plurality of training data (training data required by training a pre-training model can be effectively used as training only if the training data comprise characteristic data and the data label, and the pre-training model can normally output a result, which is not described herein again in the prior art); the data label is used as a standard value of the output result of the friction compensation model so as to accurately judge the accuracy of the friction compensation model.
It should be noted that the target data includes simulated velocity values, simulated torque values, simulated temperature values and simulated position values corresponding to all joints of the mechanical arm (hereinafter, the simulated velocity values, the simulated torque values, the simulated temperature values and the simulated position values are collectively referred to as joint data), when calculating the linear friction value and the non-linear friction value, it is necessary to correspond to specific joints, for example, the mechanical arm includes 3 joints, one target data includes joint data of the first joint, joint data of the second joint and joint data of the third joint, respectively calculating the linear friction value and the nonlinear friction value of the first joint, the linear friction value and the nonlinear friction value of the second joint, the linear friction value and the nonlinear friction value of the third joint according to the three groups of joint data, therefore, the actual values obtained by calculation according to the target data are a linear friction value set and a nonlinear friction value set; similarly, the target friction value also corresponds to a specific joint, so that the target friction value set is obtained through calculation.
In some embodiments, the specific steps in step S2 include:
s21, calculating a linear friction value set according to the following formula:
Figure 669930DEST_PATH_IMAGE058
Figure 118229DEST_PATH_IMAGE059
wherein the content of the first and second substances,
Figure 711015DEST_PATH_IMAGE003
is as follows
Figure 902962DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 530384DEST_PATH_IMAGE005
The linear friction value of each joint is measured,
Figure 149584DEST_PATH_IMAGE006
Figure 964087DEST_PATH_IMAGE007
Figure 756463DEST_PATH_IMAGE008
Figure 972811DEST_PATH_IMAGE060
and
Figure 762913DEST_PATH_IMAGE010
are all a first constant which is preset,
Figure 392608DEST_PATH_IMAGE011
is as follows
Figure 191937DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 59530DEST_PATH_IMAGE005
The simulated velocity values of the individual joints,
Figure 782984DEST_PATH_IMAGE012
is as follows
Figure 86927DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 706258DEST_PATH_IMAGE005
The value of the simulated torque for each joint,
Figure 880887DEST_PATH_IMAGE013
is as follows
Figure 294682DEST_PATH_IMAGE004
The first in the individual target data
Figure 351500DEST_PATH_IMAGE005
The simulated temperature values for the individual joints,
Figure 243364DEST_PATH_IMAGE014
is as follows
Figure 272500DEST_PATH_IMAGE004
Corresponding the first in the target data
Figure 840884DEST_PATH_IMAGE005
The simulated position values of the individual joints are,
Figure 604572DEST_PATH_IMAGE015
is as follows
Figure 549394DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 449348DEST_PATH_IMAGE005
Data set of individual joints, the
Figure 454213DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 705197DEST_PATH_IMAGE005
The data set of each joint includes
Figure 719290DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 739329DEST_PATH_IMAGE005
Simulated velocity values, simulated torque values, simulated temperature values and simulated position values for the individual joints,
Figure 649516DEST_PATH_IMAGE016
is a first
Figure 918955DEST_PATH_IMAGE004
The number of the target data is one,
Figure 940001DEST_PATH_IMAGE017
is as follows
Figure 80126DEST_PATH_IMAGE004
A set of linear friction values corresponding to each target data,
Figure 177526DEST_PATH_IMAGE018
the total number of joints of the mechanical arm;
s22, calculating a nonlinear friction value set according to the following formula:
Figure 386791DEST_PATH_IMAGE020
Figure 477106DEST_PATH_IMAGE021
Figure 471738DEST_PATH_IMAGE022
Figure 723728DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 171021DEST_PATH_IMAGE024
is as follows
Figure 65028DEST_PATH_IMAGE004
The first target data corresponds to
Figure 914166DEST_PATH_IMAGE005
The value of the non-linear friction force of the individual joints,
Figure 602636DEST_PATH_IMAGE025
in order to maximize the static friction force,
Figure 802805DEST_PATH_IMAGE026
is the coulomb force, and the power is the power,
Figure 969344DEST_PATH_IMAGE027
is a threshold value for the speed of viscous friction,
Figure 938568DEST_PATH_IMAGE028
is a threshold value of the coulomb speed,
Figure 63519DEST_PATH_IMAGE029
in order to obtain a coefficient of viscous friction,
Figure 473685DEST_PATH_IMAGE030
in order to achieve the maximum static friction speed,
Figure 178336DEST_PATH_IMAGE031
is as follows
Figure 2067DEST_PATH_IMAGE004
A set of nonlinear friction values corresponding to the target data;
the specific steps in step S3 include:
s31, calculating a theoretical friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the theoretical friction force value set is a set of theoretical friction force values of all joints;
and S32, calculating a target friction value set corresponding to the target data according to the theoretical friction value set.
In the embodiment, the friction force is only divided into two categories, one category is linear friction force, the other category is nonlinear friction force, the linear friction force value and the nonlinear friction force value calculated by the formula meet theoretical requirements, the theoretical requirements are a set of applicable theories summarized by human according to natural rules, under the same natural rules, the theoretical values are highly correlated with the true values (the true values generally approach to the theoretical values), and compared with the theoretical values set only by experience, the error between the finally obtained target friction force value and the true values can be effectively ensured to be smaller by combining the theoretical calculation meeting the natural rules, so that the accuracy of the training data can be ensured, the precision of the pre-training model can be effectively ensured, and the accuracy of the final output result of the friction force compensation model can be further ensured.
It should be noted that, in the following description,
Figure 32340DEST_PATH_IMAGE061
Figure 675942DEST_PATH_IMAGE062
Figure 981021DEST_PATH_IMAGE063
and
Figure 393679DEST_PATH_IMAGE064
the value of (c) needs to be set according to the actual application object.
In some embodiments, the specific steps in step S31 include:
s311, calculating a theoretical friction value set according to the following formula:
Figure 594853DEST_PATH_IMAGE032
Figure 725751DEST_PATH_IMAGE065
wherein the content of the first and second substances,
Figure 303363DEST_PATH_IMAGE066
is as follows
Figure 570528DEST_PATH_IMAGE004
The first target data corresponds to
Figure 942603DEST_PATH_IMAGE005
The theoretical friction value of the individual joint,
Figure 357535DEST_PATH_IMAGE035
is a second constant that is preset and is,
Figure 473259DEST_PATH_IMAGE067
is as follows
Figure 391667DEST_PATH_IMAGE004
And (4) a set of theoretical friction values corresponding to the target data.
And according to the formula in the embodiment, the linear friction value and the nonlinear friction value of each joint corresponding to each target datum are combined and calculated to obtain a theoretical friction value set.
It should be noted that, in the following description,
Figure 669065DEST_PATH_IMAGE068
the value of (c) needs to be set according to the actual application object.
In some embodiments, the specific steps in step S32 include:
s321, calculating a first friction value set corresponding to the target data according to the following formula, wherein the first friction value set is a set of first friction values of all joints:
Figure 40134DEST_PATH_IMAGE037
Figure 693970DEST_PATH_IMAGE038
wherein the content of the first and second substances,
Figure 935726DEST_PATH_IMAGE039
is as follows
Figure 915184DEST_PATH_IMAGE004
The first target data corresponds to
Figure 242391DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 965496DEST_PATH_IMAGE040
to obtain the first
Figure 327339DEST_PATH_IMAGE004
Time of individual object data
Figure 212118DEST_PATH_IMAGE005
The ambient noise value of the environment in which the individual joint is located,
Figure 275889DEST_PATH_IMAGE041
is as follows
Figure 287838DEST_PATH_IMAGE004
A first set of friction values corresponding to the individual target data;
s322, calculating a target friction value set corresponding to the target data according to the first friction value set.
In practical application, during the motion process of each joint on the mechanical arm, there are often a plurality of external factors affecting the friction force, such as specifications of grease applied to the joint (different types of grease may affect the friction force between the joints), temperature of the inter-joint structure (expansion and contraction of the structure may also affect the friction force between the joints), wear degree of the inter-joint structure (structural wear may cause an increase or decrease in a contact area between the inter-joint structures, thereby affecting the friction force between the joints), and the like, and the above external factors are collectively referred to as environmental noise, which is not included in the theoretical friction force value, so as to ensure authenticity and reliability of the output result of the friction force compensation model, according to the formula in this embodiment, environmental noise meeting objective facts is added on the basis of the theoretical friction force value, thereby obtaining a first friction force value, which is compared with the theoretical friction force value, the method is more in line with objective facts, so that training data are closer to the real situation, the precision of the pre-training model is further ensured, and the accuracy of the finally obtained friction compensation model is improved.
In some embodiments, the specific step in step S322 includes:
calculating a set of target friction values corresponding to the target data according to the following formula:
Figure 753455DEST_PATH_IMAGE069
Figure 91026DEST_PATH_IMAGE043
Figure 642093DEST_PATH_IMAGE044
wherein the content of the first and second substances,
Figure 192155DEST_PATH_IMAGE070
is a first
Figure 794168DEST_PATH_IMAGE071
The first target data corresponds to
Figure 286330DEST_PATH_IMAGE072
A target friction value for each of the joints,
Figure 324693DEST_PATH_IMAGE073
is a preset proportion value, and is a preset proportion value,
Figure 955743DEST_PATH_IMAGE047
is as follows
Figure 146684DEST_PATH_IMAGE071
Each eyeThe first of the target data corresponds to
Figure 544167DEST_PATH_IMAGE072
A first friction value of the individual joint,
Figure 351717DEST_PATH_IMAGE074
is as follows
Figure 227269DEST_PATH_IMAGE075
The number of the target data is one,
Figure 538296DEST_PATH_IMAGE076
is as follows
Figure 372260DEST_PATH_IMAGE071
Object data and the second
Figure 135948DEST_PATH_IMAGE075
The euclidean distance of the individual target data,
Figure 815191DEST_PATH_IMAGE051
is as follows
Figure 229992DEST_PATH_IMAGE075
The second target data corresponds to
Figure 985589DEST_PATH_IMAGE072
A first friction value of the individual joint,
Figure 485841DEST_PATH_IMAGE052
is as follows
Figure 985086DEST_PATH_IMAGE075
The first in the target data
Figure 270705DEST_PATH_IMAGE077
An element (target data is a set containing a plurality of data, the first
Figure 180892DEST_PATH_IMAGE077
An element refers to the setIn combination with
Figure 450331DEST_PATH_IMAGE077
The set of data, e.g., the first target data, includes: the simulated temperature value of the first joint, the simulated position value of the first joint, the simulated temperature value of the second joint and the simulated position value of the second joint, the 2 nd element in the first target data is the simulated position value of the first joint, the 4 th element is the simulated position value of the second joint,
Figure 471376DEST_PATH_IMAGE054
is as follows
Figure 329611DEST_PATH_IMAGE071
The first in the individual target data
Figure 692590DEST_PATH_IMAGE077
The number of the elements is one,
Figure 901855DEST_PATH_IMAGE078
is a first
Figure 742903DEST_PATH_IMAGE071
A set of target friction values corresponding to the respective target data,
Figure 3114DEST_PATH_IMAGE079
is as follows
Figure 255104DEST_PATH_IMAGE004
The total number of elements in the individual target data,
Figure 951665DEST_PATH_IMAGE080
the total amount of target data.
In practical application, a motion sequence relation always exists between motion states of each time of the mechanical arm, for example, time sequence continuity (namely, time correlation exists between a last motion state and a next motion state) and the like, the motion sequence relation is also one of objectively existing influence factors, and certain intervention can be generated on friction force, so that the target friction force value can better accord with objective facts and is more authentic by simulating the motion sequence relation appearing in actual application and adding the motion sequence relation into a calculation process of the target friction force value, and the self embodiment replaces the time sequence continuity with the space continuity through the formula, converts time sequence characteristics into space characteristics (expressed by joint coordinates) so as to combine the time sequence relation into the calculation process of the target friction force value, greatly increases the authenticity of the target friction force value, and further enables training data to be closer to the real situation, the precision of the pre-training model is effectively ensured, and the accuracy of the output result of the finally obtained friction compensation model in application is improved.
It should be noted that, in the following description,
Figure 330824DEST_PATH_IMAGE081
is an adjustable ratio, generally not less than 0.5.
The application also provides a pre-training method, which is used for training a pre-training model of the mechanical arm friction compensation model to obtain a final friction compensation model and comprises the following steps:
A1. dividing all training data obtained by the data acquisition method into a training set and a test set according to the ratio of 8: 2;
A2. inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model completing training;
A3. and fine-tuning the pre-training model after training to obtain a final friction compensation model.
In this embodiment, after the training data is obtained by the above method, the training data is input into an initialized pre-training model for training, and after the training condition is reached, the pre-training model is considered to have been trained, so as to obtain a pre-training model with the training completed, and finally, the pre-training model with the training completed is subjected to targeted fine adjustment according to a mechanical arm applied in practice, so as to obtain a final friction compensation model.
It should be noted that the gradient descent algorithm is prior art and is not described herein.
In certain embodiments, the specific steps in step a3 include:
A31. deploying a pre-training model which is trained in a mechanical arm to obtain real state data of each joint of the mechanical arm; the real state data comprises a real speed value, a real torque value, a real temperature value and a real position value of the joint;
A32. selecting part of parameters in a pre-training model which is trained to be used as first parameters, and freezing the first parameters; the parameter which is not frozen is a second parameter;
A33. and adjusting the second parameters based on the real state data of each joint of the mechanical arm to obtain a final friction compensation model.
In this embodiment, after training by the training data, a pre-training model with completed training can be obtained, however, because the training data is obtained based on the simulation state data, there is still a certain difference between the simulation state data and the real data actually collected on the robot arm, and this difference increases the error between the output result and the real result of the friction compensation model, so the pre-training model with completed training cannot be directly used as the friction compensation model, in this embodiment, the pre-training model with completed training is deployed on the robot arm as the application object, the real state data of the robot arm is obtained, the real state data is used to calculate the target friction value in the same calculation manner by the data obtaining method, and the training data obtained according to this is input into the pre-training model with completed training again, since the common characteristic of most of the mechanical arms is extracted and determined as the first parameter in the previous training process of the pre-training model with the training completed (the parameter corresponding to the common characteristic in the pre-training model with the training completed is the first parameter mentioned above, since the extracted characteristic data is the characteristic data commonly held by multiple types of mechanical arms, although the pre-training model with the training completed is actually applied to different mechanical arms, the first parameter will not change much, and under different application objects (mechanical arms), the first parameter change is not large or even can be ignored, so the influence on the accuracy of the final output result of the friction compensation model is very small.
According to the embodiment, unnecessary training time can be greatly reduced by freezing the first parameter and then training the pre-training model for completing training, the training time is effectively shortened, and the final friction compensation model highly fitting the mechanical arm can be obtained only by finely adjusting the second parameter aiming at the application object (mechanical arm).
It should be noted that, the method for fine tuning the second parameter is the same as the method for obtaining the first parameter, the real state data is divided into a training set and a testing set (data labels in the training set and the testing set are calculated by using the same calculation formula in the above embodiment, and are not described here again), the training set is input into the pre-training model that completes training to perform iterative training on the pre-training model that completes training, the second parameter is continuously updated in the iterative training process, and when the testing set is input into the pre-training model that completes training, the average variance of all values output by the pre-training model that completes training is smaller than a preset third threshold, or until the training frequency of the pre-training model that completes training exceeds a preset fourth threshold, the optimal second parameter is obtained; and finally, the freezing of the first parameters is removed, wherein the model corresponding to the parameter combination of the first parameters and the optimal second parameters is the final friction compensation model.
In addition, because the first parameter is frozen, the training process is necessarily faster only by performing fine adjustment on the second parameter in the present embodiment (compared to the pre-training process in the pre-training method described above, the present embodiment performs fine adjustment on the pre-training model after training, the convergence speed is faster, and the average variance of all values output by the pre-training model after training can be made smaller than the preset third threshold value in a short time, or the required training times are less).
Referring to fig. 3, fig. 3 is a data acquisition device for acquiring training data of a pre-training model of a mechanical arm friction compensation model, in some embodiments of the present application, the data acquisition device being integrated in a back-end control apparatus of the data acquisition device in the form of a computer program, the data acquisition device including:
a first obtaining module 100, configured to obtain a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
the first calculation module 200 is configured to calculate, by using each simulation state data as target data, a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all joints, and the nonlinear friction value set is a set of nonlinear friction values of all joints;
the second calculating module 300 is configured to calculate a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
a second obtaining module 400, configured to obtain multiple sets of training data according to each set of target data and corresponding set of target friction values; each set of training data includes a target data and a set of target friction values corresponding to the target data.
In some embodiments, the first calculating module 200 is configured to calculate, by using each simulation state data as target data, a corresponding linear friction value set and a corresponding non-linear friction value set according to the target data; the linear friction force value set is a set of linear friction force values of each joint, and the non-linear friction force value set is executed when the non-linear friction force values of each joint are set:
s21, calculating a linear friction value set according to the following formula:
Figure 694810DEST_PATH_IMAGE001
Figure 602854DEST_PATH_IMAGE082
wherein the content of the first and second substances,
Figure 334181DEST_PATH_IMAGE083
is as follows
Figure 500720DEST_PATH_IMAGE004
Corresponding the first in the target data
Figure 453632DEST_PATH_IMAGE005
The linear friction value of each joint is measured,
Figure 329316DEST_PATH_IMAGE006
Figure 734889DEST_PATH_IMAGE007
Figure 709712DEST_PATH_IMAGE008
Figure 64601DEST_PATH_IMAGE009
and
Figure 829295DEST_PATH_IMAGE010
are all a first constant which is preset,
Figure 722164DEST_PATH_IMAGE011
is as follows
Figure 777976DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 190634DEST_PATH_IMAGE005
The simulated velocity values of the individual joints,
Figure 922967DEST_PATH_IMAGE012
is as follows
Figure 53865DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 365898DEST_PATH_IMAGE005
The value of the simulated torque for each joint,
Figure 429800DEST_PATH_IMAGE013
is as follows
Figure 801875DEST_PATH_IMAGE004
The first in the individual target data
Figure 295436DEST_PATH_IMAGE005
The simulated temperature values for the individual joints,
Figure 145580DEST_PATH_IMAGE014
is as follows
Figure 329568DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 872545DEST_PATH_IMAGE005
The simulated position values of the individual joints are,
Figure 712456DEST_PATH_IMAGE015
is as follows
Figure 163029DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 404785DEST_PATH_IMAGE005
Data set of individual joints, the
Figure 853084DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 242608DEST_PATH_IMAGE005
The data set of each joint includes
Figure 434555DEST_PATH_IMAGE004
Corresponding second in the individual target data
Figure 796398DEST_PATH_IMAGE005
Simulated velocity values, simulated torque values, simulated temperature values and simulated position values for the individual joints,
Figure 228647DEST_PATH_IMAGE016
is as follows
Figure 292418DEST_PATH_IMAGE004
The number of the target data is one,
Figure 553635DEST_PATH_IMAGE017
is a first
Figure 504405DEST_PATH_IMAGE004
A set of linear friction values corresponding to each target data,
Figure 825665DEST_PATH_IMAGE018
the total number of joints of the mechanical arm;
s22, calculating a nonlinear friction value set according to the following formula:
Figure 127464DEST_PATH_IMAGE020
Figure 661214DEST_PATH_IMAGE084
Figure 981337DEST_PATH_IMAGE085
Figure 970370DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 8733DEST_PATH_IMAGE086
is as follows
Figure 96906DEST_PATH_IMAGE004
The first target data corresponds to
Figure 537114DEST_PATH_IMAGE005
The value of the non-linear friction force of the individual joints,
Figure 669018DEST_PATH_IMAGE025
in order to maximize the static friction force,
Figure 945410DEST_PATH_IMAGE026
is the coulomb force, and the power is the power,
Figure 86541DEST_PATH_IMAGE027
is a threshold value for the speed of viscous friction,
Figure 866410DEST_PATH_IMAGE028
is a threshold value of the coulomb speed,
Figure 169215DEST_PATH_IMAGE029
in order to obtain a coefficient of viscous friction,
Figure 182170DEST_PATH_IMAGE030
in order to achieve the maximum static friction speed,
Figure 877725DEST_PATH_IMAGE087
is a first
Figure 26947DEST_PATH_IMAGE004
A set of nonlinear friction values corresponding to the target data;
in some embodiments, the second computing module 300 is configured to compute a set of target friction values corresponding to the target data based on the set of linear friction values and the set of non-linear friction values; executing when the target friction value set is a set of target friction values of all joints:
s31, calculating a theoretical friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the theoretical friction force value set is a set of theoretical friction force values of all joints;
and S32, calculating a target friction value set corresponding to the target data according to the theoretical friction value set.
In some embodiments, the second calculation module 300 is configured to calculate a set of theoretical friction values corresponding to the target data from the set of linear friction values and the set of non-linear friction values; the method comprises the following steps of performing the following steps when the theoretical friction value set is a set of theoretical friction values of all joints:
s311, calculating a theoretical friction value set according to the following formula:
Figure 500653DEST_PATH_IMAGE032
Figure 486058DEST_PATH_IMAGE088
wherein the content of the first and second substances,
Figure 968992DEST_PATH_IMAGE089
is as follows
Figure 254611DEST_PATH_IMAGE004
The first target data corresponds to
Figure 899219DEST_PATH_IMAGE005
The theoretical friction value of the individual joint,
Figure 371920DEST_PATH_IMAGE035
is a second constant that is preset and is,
Figure 392965DEST_PATH_IMAGE090
is as follows
Figure 782358DEST_PATH_IMAGE004
And (4) a set of theoretical friction values corresponding to the target data.
In some embodiments, the second calculation module 300 is configured to calculate a set of target friction values corresponding to the target data from the set of theoretical friction values; executing when the target friction value set is a set of target friction values of all joints:
s321, calculating a first friction value set corresponding to the target data according to the following formula, wherein the first friction value set is a set of first friction values of all joints:
Figure 614179DEST_PATH_IMAGE091
Figure 823444DEST_PATH_IMAGE092
wherein the content of the first and second substances,
Figure 133333DEST_PATH_IMAGE093
is as follows
Figure 111654DEST_PATH_IMAGE004
The first target data corresponds to
Figure 363644DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 76516DEST_PATH_IMAGE094
to obtain the first
Figure 173785DEST_PATH_IMAGE004
Time of individual object data
Figure 22923DEST_PATH_IMAGE005
The ambient noise value of the environment in which the individual joint is located,
Figure 445814DEST_PATH_IMAGE095
is as follows
Figure 629671DEST_PATH_IMAGE004
A first set of friction values corresponding to the individual target data;
s322, calculating a target friction value set corresponding to the target data according to the first friction value set.
In some embodiments, the second calculation module 300 performs when calculating the set of target friction values corresponding to the target data from the first set of friction values:
calculating a set of target friction values corresponding to the target data according to the following formula:
Figure 281363DEST_PATH_IMAGE069
Figure 234276DEST_PATH_IMAGE043
Figure 828068DEST_PATH_IMAGE044
wherein the content of the first and second substances,
Figure 984374DEST_PATH_IMAGE096
is as follows
Figure 220183DEST_PATH_IMAGE004
The first target data corresponds to
Figure 778335DEST_PATH_IMAGE005
The target friction value of the individual joint,
Figure 543028DEST_PATH_IMAGE046
is a preset proportion value, and is a preset proportion value,
Figure 435898DEST_PATH_IMAGE047
is as follows
Figure 429393DEST_PATH_IMAGE004
The first target data corresponds to
Figure 356898DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 31506DEST_PATH_IMAGE048
is as follows
Figure 677251DEST_PATH_IMAGE049
The number of the target data is one,
Figure 723705DEST_PATH_IMAGE050
is as follows
Figure 990869DEST_PATH_IMAGE004
Object data and the second
Figure 362945DEST_PATH_IMAGE049
The euclidean distance of the individual target data,
Figure 981139DEST_PATH_IMAGE051
is as follows
Figure 831283DEST_PATH_IMAGE049
The first target data corresponds to
Figure 467801DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 495931DEST_PATH_IMAGE052
is as follows
Figure 585110DEST_PATH_IMAGE049
The first in the individual target data
Figure 238945DEST_PATH_IMAGE053
The number of the elements is one,
Figure 480702DEST_PATH_IMAGE054
is a first
Figure 194580DEST_PATH_IMAGE004
The first in the individual target data
Figure 787366DEST_PATH_IMAGE053
The number of the elements is one,
Figure 979313DEST_PATH_IMAGE097
is as follows
Figure 324844DEST_PATH_IMAGE004
A set of target friction values corresponding to the respective target data,
Figure 960356DEST_PATH_IMAGE056
is as follows
Figure 24127DEST_PATH_IMAGE004
The total number of elements in the individual target data,
Figure 504918DEST_PATH_IMAGE057
the total amount of target data.
Referring to fig. 4, fig. 4 is a pre-training apparatus for obtaining a final friction compensation model by training a pre-training model of a mechanical arm friction compensation model, in some embodiments of the present application, the pre-training apparatus being integrated in a back-end control device of the pre-training apparatus in the form of a computer program, the pre-training apparatus comprising:
a data dividing module 500, configured to divide training data obtained by the data obtaining method into a training set and a test set according to a ratio of 8: 2;
the training module 600 is configured to input the training set into the initialized pre-training model and train the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold when all test sets are input into the pre-training model, or until the training frequency of the pre-training model exceeds a preset second threshold, stop training and obtain the pre-training model with the training completed;
and the fine tuning module 700 is configured to perform fine tuning on the pre-training model after the training is completed to obtain a final friction compensation model.
In some embodiments, the fine tuning module 700 performs the following operations when tuning the pre-trained model after training to obtain the final friction compensation model:
A31. deploying a pre-training model which is trained in a mechanical arm to obtain real state data of each joint of the mechanical arm; the real state data comprises a real speed value, a real torque value, a real temperature value and a real position value of the joint;
A32. selecting part of parameters in a pre-training model which is trained to be used as first parameters, and freezing the first parameters; the parameter which is not frozen is a second parameter;
A33. and adjusting the second parameters based on the real state data of each joint of the mechanical arm to obtain a final friction compensation model.
Referring to fig. 5, fig. 5 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 are interconnected and communicate with each other through a communication bus 1303 and/or other connection mechanisms (not shown), and the memory 1302 stores a computer program executable by the processor 1301, and when the computing device runs, the processor 1301 executes the computer program to execute the data acquisition method in any optional implementation manner of the foregoing embodiments to implement the following functions: acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm; respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all joints, and the nonlinear friction value set is a set of nonlinear friction values of all joints; calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints; acquiring a plurality of groups of training data according to each target data and the corresponding target friction value set; each set of training data includes a target data and a set of target friction values corresponding to the target data.
And/or to perform the pre-training method in any of the alternative implementations of the above embodiments to implement the following functions: dividing training data obtained by the data acquisition method into a training set and a test set according to the ratio of 8: 2; inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model completing training; and fine-tuning the pre-training model after training to obtain a final friction compensation model.
The 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 data acquisition method in any optional implementation manner of the foregoing embodiment is executed, so as to implement the following functions: acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm; respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all joints, and the nonlinear friction value set is a set of nonlinear friction values of all joints; calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints; acquiring a plurality of groups of training data according to each target data and the corresponding target friction value set; each set of training data includes a target data and a set of target friction values corresponding to the target data.
And/or performing the pre-training method in any optional implementation manner of the above embodiment to implement the following functions: dividing training data obtained by the data acquisition method into a training set and a test set according to the ratio of 8: 2; inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model completing training; and fine-tuning the pre-training model after training to obtain a final friction compensation model.
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 data acquisition method is used for acquiring training data of a pre-training model of a mechanical arm friction compensation model, and is characterized by comprising the following steps:
s1, acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
s2, respectively taking each simulation state data as target data, and calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data; the linear friction value set is a set of linear friction values of all the joints, and the nonlinear friction value set is a set of nonlinear friction values of all the joints;
s3, calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
s4, acquiring multiple groups of training data according to the target data and the corresponding target friction value sets; each set of training data comprises one target data and a target friction value set corresponding to the target data.
2. The data acquisition method according to claim 1, wherein the specific steps in step S2 include:
s21, calculating the linear friction value set according to the following formula:
Figure 492504DEST_PATH_IMAGE001
Figure 222694DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 64748DEST_PATH_IMAGE003
is as follows
Figure 538586DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 415275DEST_PATH_IMAGE005
The linear friction value of each joint is measured,
Figure 785208DEST_PATH_IMAGE006
Figure 396449DEST_PATH_IMAGE007
Figure 657666DEST_PATH_IMAGE008
Figure 405173DEST_PATH_IMAGE009
and
Figure 460854DEST_PATH_IMAGE010
are all a first constant which is preset,
Figure 282093DEST_PATH_IMAGE011
is as follows
Figure 81422DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 417856DEST_PATH_IMAGE005
The simulated velocity values of the individual joints,
Figure 910017DEST_PATH_IMAGE012
is as follows
Figure 964692DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 302133DEST_PATH_IMAGE005
The value of the simulated torque for each joint,
Figure 758653DEST_PATH_IMAGE013
is as follows
Figure 156136DEST_PATH_IMAGE004
The first of the target data
Figure 698107DEST_PATH_IMAGE005
The simulated temperature values for the individual joints,
Figure 573659DEST_PATH_IMAGE014
is as follows
Figure 884686DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 453071DEST_PATH_IMAGE005
The simulated position values of the individual joints are,
Figure 200447DEST_PATH_IMAGE015
is as follows
Figure 630422DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 45223DEST_PATH_IMAGE005
Data set of individual joints, the first
Figure 800820DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 35493DEST_PATH_IMAGE005
The data set of each joint includes
Figure 269159DEST_PATH_IMAGE004
A corresponding second one of the target data
Figure 804046DEST_PATH_IMAGE005
Simulated velocity values, simulated torque values, simulated temperature values and simulated position values for the individual joints,
Figure 464965DEST_PATH_IMAGE016
is as follows
Figure 186934DEST_PATH_IMAGE004
The number of said target data is one,
Figure 473558DEST_PATH_IMAGE017
is as follows
Figure 82525DEST_PATH_IMAGE004
The set of linear friction values corresponding to each of the target data,
Figure 429193DEST_PATH_IMAGE018
the total number of joints of the mechanical arm;
s22, calculating the nonlinear friction value set according to the following formula:
Figure 654769DEST_PATH_IMAGE020
Figure 479506DEST_PATH_IMAGE021
Figure 474138DEST_PATH_IMAGE022
Figure 460548DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 157109DEST_PATH_IMAGE024
is as follows
Figure 536269DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 634675DEST_PATH_IMAGE005
The value of the non-linear friction force of the individual joints,
Figure 808298DEST_PATH_IMAGE025
in order to maximize the static friction force,
Figure 992155DEST_PATH_IMAGE026
is the coulomb force, and the power is the power,
Figure 175006DEST_PATH_IMAGE027
is a threshold value for the speed of viscous friction,
Figure 862339DEST_PATH_IMAGE028
is a threshold value of the coulomb speed,
Figure 484162DEST_PATH_IMAGE029
in order to obtain a coefficient of viscous friction,
Figure 889735DEST_PATH_IMAGE030
in order to achieve the maximum static friction speed,
Figure 859965DEST_PATH_IMAGE031
is as follows
Figure 683696DEST_PATH_IMAGE004
The set of nonlinear friction values corresponding to the target data;
the specific steps in step S3 include:
s31, calculating a theoretical friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the theoretical friction value set is a set of theoretical friction values of all the joints;
and S32, calculating a target friction value set corresponding to the target data according to the theoretical friction value set.
3. The data acquisition method according to claim 2, wherein the specific steps in step S31 include:
s311, calculating the theoretical friction value set according to the following formula:
Figure 713969DEST_PATH_IMAGE032
Figure 357571DEST_PATH_IMAGE033
wherein the content of the first and second substances,
Figure 865913DEST_PATH_IMAGE034
is a first
Figure 544150DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 479745DEST_PATH_IMAGE005
The theoretical friction value of each joint is,
Figure 859911DEST_PATH_IMAGE035
is a second constant that is preset and is,
Figure 922676DEST_PATH_IMAGE036
is as follows
Figure 704687DEST_PATH_IMAGE004
And the theoretical friction value set corresponding to the target data.
4. The data acquisition method according to claim 3, wherein the specific steps in step S32 include:
s321, calculating a first friction value set corresponding to the target data according to the following formula, wherein the first friction value set is a set of first friction values of all joints:
Figure 827495DEST_PATH_IMAGE037
Figure 694957DEST_PATH_IMAGE038
wherein the content of the first and second substances,
Figure 561413DEST_PATH_IMAGE039
is as follows
Figure 197930DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 475328DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 580818DEST_PATH_IMAGE040
to obtain the first
Figure 234653DEST_PATH_IMAGE004
Time of the target data
Figure 741989DEST_PATH_IMAGE005
The ambient noise value of the environment in which the individual joint is located,
Figure 190288DEST_PATH_IMAGE041
is as follows
Figure 48654DEST_PATH_IMAGE004
The first friction value set corresponding to the target data;
s322, calculating a target friction value set corresponding to the target data according to the first friction value set.
5. The data acquisition method according to claim 4, wherein the specific step in step S322 comprises:
calculating a set of target friction values corresponding to the target data according to the following formula:
Figure 240601DEST_PATH_IMAGE042
Figure 586132DEST_PATH_IMAGE043
Figure 487223DEST_PATH_IMAGE044
wherein the content of the first and second substances,
Figure 550994DEST_PATH_IMAGE045
is as follows
Figure 562943DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 762980DEST_PATH_IMAGE005
The target friction value of the individual joint,
Figure 834973DEST_PATH_IMAGE046
is a preset proportion value, and is a preset proportion value,
Figure 386040DEST_PATH_IMAGE047
is as follows
Figure 919789DEST_PATH_IMAGE004
The first one corresponding to the target data
Figure 256224DEST_PATH_IMAGE005
A first value of friction for each joint,
Figure 482806DEST_PATH_IMAGE048
is as follows
Figure 271901DEST_PATH_IMAGE049
The number of said target data is one,
Figure 609342DEST_PATH_IMAGE050
is as follows
Figure 65862DEST_PATH_IMAGE004
The target data and the second
Figure 197766DEST_PATH_IMAGE049
The Euclidean distance of each of the target data,
Figure 723425DEST_PATH_IMAGE051
is as follows
Figure 603570DEST_PATH_IMAGE049
The first one corresponding to the target data
Figure 163865DEST_PATH_IMAGE005
A first friction value of the individual joint,
Figure 217402DEST_PATH_IMAGE052
is as follows
Figure 495937DEST_PATH_IMAGE049
The first of the target data
Figure 191492DEST_PATH_IMAGE053
The number of the elements is one,
Figure 606292DEST_PATH_IMAGE054
is as follows
Figure 361890DEST_PATH_IMAGE004
The first of the target data
Figure 862141DEST_PATH_IMAGE053
The number of the elements is one,
Figure 95808DEST_PATH_IMAGE055
is as follows
Figure 365115DEST_PATH_IMAGE004
An instituteThe target friction value set corresponding to the target data,
Figure 26035DEST_PATH_IMAGE056
is as follows
Figure 13582DEST_PATH_IMAGE004
The total number of elements in each of the target data,
Figure 34628DEST_PATH_IMAGE057
is the total amount of the target data.
6. A pre-training method is used for training a pre-training model of a mechanical arm friction compensation model to obtain a final friction compensation model, and is characterized by comprising the following steps:
A1. dividing training data obtained by the data acquisition method according to any one of claims 1 to 5 into a training set and a test set according to a ratio of 8: 2;
A2. inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all the test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model which completes training;
A3. and fine-tuning the pre-training model after training to obtain a final friction compensation model.
7. A data acquisition device for acquiring training data of a pre-training model of a mechanical arm friction compensation model, the data acquisition device comprising:
the first acquisition module is used for acquiring a plurality of simulation state data of the mechanical arm; the simulation state data comprises simulation speed values, simulation torque values, simulation temperature values and simulation position values of all joints of the mechanical arm;
the first calculation module is used for calculating a corresponding linear friction value set and a corresponding nonlinear friction value set according to the target data by taking each piece of the simulation state data as the target data; the linear friction value set is a set of linear friction values of all the joints, and the nonlinear friction value set is a set of nonlinear friction values of all the joints;
the second calculation module is used for calculating a target friction value set corresponding to the target data according to the linear friction value set and the nonlinear friction value set; the target friction value set is a set of target friction values of all joints;
the second acquisition module is used for acquiring multiple groups of training data according to each target data and the corresponding target friction value set; each set of training data comprises one target data and a target friction value set corresponding to the target data.
8. A pre-training apparatus for training a pre-training model of a mechanical arm friction compensation model to obtain a final friction compensation model, the pre-training apparatus comprising:
a data dividing module, configured to divide training data obtained by the data acquisition method according to any one of claims 1 to 5 into a training set and a test set according to a ratio of 8: 2;
the training module is used for inputting the training set into an initialized pre-training model and training the pre-training model by using a gradient descent algorithm until the average variance of all values output by the pre-training model is smaller than a preset first threshold value when all the test sets are input into the pre-training model, or until the training times of the pre-training model exceed a preset second threshold value, stopping training and obtaining the pre-training model after training;
and the fine adjustment module is used for fine adjusting the pre-training model after training to obtain a final friction compensation model.
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 data acquisition method according to any one of claims 1 to 5 and/or perform the steps of the pre-training method according to claim 6.
10. A storage medium having stored thereon a computer program for performing the steps of the data acquisition method according to any one of claims 1-5 and/or for performing the steps of the pre-training method according to claim 6 when the computer program is executed by a processor.
CN202210600725.9A 2022-05-30 2022-05-30 Data acquisition method, pre-training method, device, electronic equipment and storage medium Active CN114670210B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210600725.9A CN114670210B (en) 2022-05-30 2022-05-30 Data acquisition method, pre-training method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210600725.9A CN114670210B (en) 2022-05-30 2022-05-30 Data acquisition method, pre-training method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114670210A CN114670210A (en) 2022-06-28
CN114670210B true CN114670210B (en) 2022-08-02

Family

ID=82081158

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210600725.9A Active CN114670210B (en) 2022-05-30 2022-05-30 Data acquisition method, pre-training method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114670210B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115042191B (en) * 2022-08-12 2022-11-08 季华实验室 Pre-training model fine-tuning training method and device, electronic equipment and storage medium
CN117400268B (en) * 2023-12-13 2024-03-15 苏州康多机器人有限公司 Nonlinear friction force compensation method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015018496A (en) * 2013-07-12 2015-01-29 三菱重工業株式会社 Friction compensation device, friction compensation method and servo control device
CN109702745A (en) * 2019-01-18 2019-05-03 华南理工大学 A kind of modeling method of joint of robot fluctuation moment of friction
CN111639749A (en) * 2020-05-25 2020-09-08 上海智殷自动化科技有限公司 Industrial robot friction force identification method based on deep learning
CN113051673A (en) * 2020-12-14 2021-06-29 华南理工大学 Robot improved Stribeck friction model identification method
CN113128018A (en) * 2019-12-31 2021-07-16 深圳市优必选科技股份有限公司 Friction force calculation method and device, robot and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742880B (en) * 2020-05-27 2024-06-04 台达电子工业股份有限公司 Friction force predicting and compensating method for feeding system and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015018496A (en) * 2013-07-12 2015-01-29 三菱重工業株式会社 Friction compensation device, friction compensation method and servo control device
CN109702745A (en) * 2019-01-18 2019-05-03 华南理工大学 A kind of modeling method of joint of robot fluctuation moment of friction
CN113128018A (en) * 2019-12-31 2021-07-16 深圳市优必选科技股份有限公司 Friction force calculation method and device, robot and readable storage medium
CN111639749A (en) * 2020-05-25 2020-09-08 上海智殷自动化科技有限公司 Industrial robot friction force identification method based on deep learning
CN113051673A (en) * 2020-12-14 2021-06-29 华南理工大学 Robot improved Stribeck friction model identification method

Also Published As

Publication number Publication date
CN114670210A (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN114670210B (en) Data acquisition method, pre-training method, device, electronic equipment and storage medium
Clark et al. Vinet: Visual-inertial odometry as a sequence-to-sequence learning problem
CN106471527B (en) Study is localized from world model
US11822007B2 (en) System and method for identification of an airborne object
US20170061195A1 (en) Real-time pose estimation system using inertial and feature measurements
CN103389472B (en) A kind of Forecasting Methodology of the cycle life of lithium ion battery based on ND-AR model
CN103399281B (en) Based on the ND-AR model of cycle life deterioration stage parameter and the cycle life of lithium ion battery Forecasting Methodology of EKF method
CN103307975A (en) Model generation apparatus, information processing apparatus, model generation method, and information processing method
CN113370221B (en) Robot TCP calibration system, method, device, equipment and storage medium
CN103310188A (en) Method and apparatus for pose recognition
KR20210017342A (en) Time series prediction method and apparatus based on past prediction data
CN112925223A (en) Unmanned aerial vehicle three-dimensional tracking virtual test simulation system based on visual sensing network
CN112330730A (en) Image processing method, device, equipment and storage medium
CN116492634B (en) Standing long jump testing method based on image visual positioning
CN103839280B (en) A kind of human body attitude tracking of view-based access control model information
CN112833919B (en) Management method and system for redundant inertial measurement data
Cassinis et al. Leveraging neural network uncertainty in adaptive unscented Kalman Filter for spacecraft pose estimation
CN116244974A (en) Method and device for evaluating authenticity of simulated traffic flow data
CN106778558B (en) face age estimation method based on deep classification network
CN116893658A (en) Method for controlling a robotic device, control device, computer program and medium
CN109145387A (en) The intelligent identification Method of space Tum bling Target inertia characteristics based on characteristic frequency
Brenner et al. Tracking algorithm in the multiband PCL-PET fusion system
Fioravanti et al. A numerical method to find stability windows and unstable poles for linear neutral time-delay systems
Watterson et al. Probabilistic projections of regional temperature and precipitation extending from observed time series
CN109377514A (en) Method for tracking target, device, equipment and computer readable storage medium

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