CN110705105A - Modeling method and system for inverse dynamics model of robot - Google Patents
Modeling method and system for inverse dynamics model of robot Download PDFInfo
- Publication number
- CN110705105A CN110705105A CN201910948416.9A CN201910948416A CN110705105A CN 110705105 A CN110705105 A CN 110705105A CN 201910948416 A CN201910948416 A CN 201910948416A CN 110705105 A CN110705105 A CN 110705105A
- Authority
- CN
- China
- Prior art keywords
- layer
- data
- input
- output
- memory unit
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Manipulator (AREA)
Abstract
The invention discloses a modeling method and a system of a robot inverse dynamics model, wherein the method comprises the following steps: building a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate; training an inverse dynamics model of the mechanical arm by using a cyclic neural network; the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is the torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration; the inner-layer memory unit data output by the inner layer in the hidden layer of the recurrent neural network updates the outer-layer memory unit data of the outer layer, so that the time-series memory information is kept for a longer time, and the accuracy of the output of the predicted torque of the inverse dynamics model is improved.
Description
Technical Field
The invention relates to the technical field of intelligent robots, in particular to a modeling method and a system of a robot inverse dynamics model.
Background
In the modern society, the robot plays a very important role in our lives, and can replace people to complete simple mechanical work and even high-altitude dangerous work, and the important part is the control of the robot. The inverse dynamics model of the robot is to calculate the corresponding torque for controlling the motion of the mechanical arm based on the motion state (motion position, motion speed, motion acceleration) of the mechanical arm of the robot, so as to achieve ideal control. However, errors caused by friction force, centripetal force, coriolis force and the like exist in the current physical modeling of the robot inverse dynamics model, so that the established inverse dynamics model cannot be adapted to the motion state of the current mechanical arm, and the accurate practical application cannot be met.
In recent years, with the development of artificial intelligence, the neural network-based method reasonably solves the problems. The neural network-based method has extremely strong nonlinear mapping capability, and the model obtained by training a large amount of data is used for fitting the actual and accurate motion state without considering the influence of uncertain factors, so that the accuracy of model prediction is improved.
The existing method for modeling robot inverse dynamics based on a neural network method includes an Echo State Network (ESN) and a long-term memory network (LSTM). They are also a variant of the Recurrent Neural Network (RNN), which uses its own memory mechanism to keep the motion state of the arm in front of the robot in combination with the current motion state, simulating a complex robot system. However, both cannot retain memory information for a long time, and thus cannot provide a more accurate time-series prediction model.
Disclosure of Invention
The invention aims to provide a modeling method and a system of a robot inverse dynamics model, which can retain longer-time memory information so as to improve the prediction precision of the inverse dynamics model.
In order to achieve the purpose, the invention provides the following scheme:
a method of modeling an inverse kinematics model of a robot, the method comprising:
building a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate;
building a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate;
determining input data and output data of the recurrent neural network, wherein the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration;
the input data are input into the recurrent neural network according to the motion time of the mechanical arm; inputting data output from the input layer to an outer layer of the hidden layer;
the outer-layer forgetting door obtains the outer-layer memory unit data at the current moment according to the data input to the outer layer at the current moment and the outer-layer memory unit data at the previous moment, and inputs the outer-layer memory unit data at the current moment to the inner layer;
the inner-layer forgetting door obtains the inner-layer memory unit data at the current moment according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data at the previous moment;
the inner layer reset gate updates the outer layer memory unit data of the current moment according to the inner layer memory unit data of the current moment;
the updated data of the outer-layer memory unit at the current moment is subjected to jump connection at the outer-layer reset gate to obtain the output data of the hidden layer; the output data of the hidden layer is output after linear transformation is carried out on the output layer;
comparing the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
Optionally, the calculation formula of the outer-layer memory cell data at the current time is as follows: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctOuter memory cell data representing the current time, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftThe data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is shown, t represents the current moment, and t-1 represents the previous moment;
ft=σ(Wfxt+bf),xtdata indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
Optionally, the calculation formula of the data of the inner memory cell at the current time is as follows: the data of the inner layer memory cell indicating the current time,indicating a previous hourThe data of the inner memory cell of the etching,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented;
represents the inner forgetting gate weight,The outer-layer weighting is represented by the outer-layer weighting,indicating the inner forgetting gate bias.
Optionally, the update formula of the outer-layer memory cell data at the current time is as follows: the data of the inner layer memory cell indicating the current time,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function;
Optionally, the output formula of the hidden layer is as follows: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function;
rt=σ(Wrxt+br),Wrrepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
The invention also provides a modeling system of the robot inverse dynamics model, which comprises the following components:
the recurrent neural network building module is used for building a recurrent neural network, the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate;
the input data and output data determining module is used for determining input data and output data of the recurrent neural network, the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration;
the data input module is used for inputting the input data into the recurrent neural network according to the motion time of the mechanical arm; inputting data output from the input layer to an outer layer of the hidden layer;
the outer-layer memory unit data acquisition module is used for acquiring the outer-layer memory unit data of the current moment according to the data input to the outer layer at the current moment and the outer-layer memory unit data of the previous moment by the outer-layer forgetting door and inputting the outer-layer memory unit data of the current moment to the inner layer;
the inner-layer memory unit data acquisition module is used for acquiring the inner-layer memory unit data of the current moment by the inner-layer forgetting gate according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data of the previous moment;
the outer-layer memory unit data updating module is used for updating the outer-layer memory unit data of the current moment by the inner-layer reset door according to the inner-layer memory unit data of the current moment;
the output module is used for acquiring the output data of the hidden layer at the outer layer reset gate through the effect of jump connection by the updated outer layer memory unit data at the current moment; the output data of the hidden layer is output after linear transformation is carried out on the output layer;
the inverse dynamics model acquisition module is used for comparing the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
Optionally, the calculation formula of the outer-layer memory cell data at the current time is as follows: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctIndicating the current timeOuter layer memory cell data, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftThe data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is represented;
ft=σ(Wfxt+bf),xtdata indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
Optionally, the calculation formula of the data of the inner memory cell at the current time is as follows: the data of the inner layer memory cell indicating the current time,indicating the data of the inner layer memory cell at the previous time,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented;
represents the inner forgetting gate weight,The outer-layer weighting is represented by the outer-layer weighting,indicating the inner forgetting gate bias.
Optionally, the update formula of the outer-layer memory cell data at the current time is as follows: the data of the inner layer memory cell indicating the current time,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function;
Optionally, the output formula of the hidden layer is as follows: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function;
rt=σ(Wrxt+br),Wrrepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
According to the invention content provided by the invention, the invention discloses the following technical effects:
the invention discloses a modeling method and a system of a robot inverse dynamics model, wherein the method comprises the following steps: building a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate; training an inverse dynamics model of the mechanical arm by using a cyclic neural network; the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is the torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration; the outer-layer forgetting gate in the recurrent neural network obtains the data of the outer-layer memory unit at the current moment according to the data input to the outer layer at the current moment and the data of the outer-layer memory unit at the previous moment, and inputs the data of the outer-layer memory unit at the current moment to the inner layer, and the inner-layer forgetting gate obtains the data of the inner-layer memory unit at the current moment according to the data of the outer-layer memory unit input at the current moment and the data of the inner-layer memory unit at the previous moment; the inner layer reset gate updates the data of the outer layer memory unit at the current moment according to the data of the inner layer memory unit at the current moment, so that the memory information of the time sequence is kept for a longer time, and the precision of the data output by the inverse dynamics model is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic flow chart of a modeling method of an inverse dynamics model of a robot according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a modeling system of an inverse kinematics model of a robot according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a recurrent neural network according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a hidden layer in a recurrent neural network according to an embodiment of the present invention;
FIG. 5 is a graph comparing predicted joint-output torque and actual torque using an inverse kinematics model according to an embodiment of the present invention;
FIG. 6 is a graph comparing the predicted joint two output torques and the actual torque using an inverse kinematics model according to an embodiment of the present invention;
FIG. 7 is a graph comparing the predicted triple output torque and the actual torque of the joint using an inverse kinematics model according to an embodiment of the present invention;
FIG. 8 is a graph comparing the predicted joint four output torques and the actual torques using an inverse kinematics model according to an embodiment of the present invention;
FIG. 9 is a graph comparing the predicted joint five output torque and the actual torque using an inverse kinematics model according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a modeling method and a system of a robot inverse dynamics model, which can retain longer-time memory information so as to improve the prediction precision of the inverse dynamics model.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 1 is a schematic flow chart of a modeling method of an inverse robot dynamics model according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
step 101: and constructing a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting door and an outer reset door, and the inner layer comprises an inner forgetting door and an inner reset door.
And step 101, building a cyclic neural network of cascade memory for optimizing the target learning function. The recurrent neural network is nested by basic Simple Recurrent Units (SRUs).
Step 102: determining input data and output data of the recurrent neural network, wherein the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration.
Step 102 comprises collecting a data set of inverse dynamics of the robot, wherein the data set corresponds to the motion state of the mechanical arm and the torque corresponding to the motion of the control mechanical arm, and is divided into input (motion state) and input (torque); the resulting data set contains a 15-dimensional input space, i.e., motion position, motion velocity, and motion acceleration, and 5-dimensional torque vectors as output or unknowns, while the collected data set is divided into a training set and a test set.
The mechanical arm of the robot for experiment has joints with 7 degrees of freedom, and only the first five joints are needed in the motion, namely the robot dimension with the first five joints at the tail end of the motion and 5 jointsDegree is R3d*1Where d represents the number of joints 5, and the input to each joint includes three vectors (position, velocity, acceleration), the motion state input at each time is data of dimension 15 x 1. The experiment uses a supervised training approach, so the input data includes both sample data and labels. Each row of input data has 20 columns, the first 15 columns representing position, velocity, acceleration inputs for each joint in 5 degrees of freedom, and the last 5 columns representing torque for each joint corresponding to the input signature.
Constructing an inverse dynamics module consisting of the motion state of the mechanical arm and the corresponding torque:q is the position of the motion,in order to be the speed of the movement,the motion acceleration is adopted, tau is the torque corresponding to the motion of the mechanical arm, and F represents the inverse dynamics model; and setting a target learning function y of the input quantity x according to the inverse dynamics model tau, and expressing the inverse dynamics model in a form of y-f (x), wherein the output y corresponds to the torque tau corresponding to the mechanical arm, the input x corresponds to the motion state of the mechanical arm, and f is the target learning function. Step 102 determines an inverse kinematics model for training a robotic arm using a recurrent neural network.
The recurrent neural network has a structure as shown in FIG. 3, and comprises an input layer 1, a hidden layer 2, and an output layer 3, wherein q istIs the moving position at the current moment,is the speed of the movement at the present moment,acceleration of motion at the current moment, τtThe data transfer relationship of the hidden layer in the recurrent neural network for the torque corresponding to the mechanical arm motion at the current moment is shown in FIG. 4, which is described aboveThe method is characterized in that the forgetting gate and the resetting gate are used, the gating mechanisms of the forgetting gate and the resetting gate on the inner layer and the outer layer are the same, the basic structure of the hidden layer is divided into an inner layer and an outer layer which are formed by combining SRU units, and different from the traditional stacked network, the method that the outer layer memory is used as the inner layer input, and the inner layer output updates the outer layer memory is adopted to form an outer-inner-outer structure.
Step 103: the input data are input into the recurrent neural network according to the motion time of the mechanical arm; data output from the input layer is input to an outer layer of the hidden layer.
In step 103, time is a time step of the movement of the mechanical arm, data in the hidden layer is screened through the outer layer, and meanwhile data input at the current moment is preprocessed.
Step 104: the outer-layer forgetting door obtains the data of the outer-layer memory unit at the current moment according to the data input to the outer layer at the current moment and the data of the outer-layer memory unit at the previous moment, and inputs the data of the outer-layer memory unit at the current moment to the inner layer.
The calculation formula of the outer-layer memory cell data at the current time in step 104 is: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctOuter memory cell data representing the current time, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftThe data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is shown, t represents the current moment, and t-1 represents the previous moment; f. oft=σ(Wfxt+bf),xtData indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
Step 105: and the inner-layer forgetting door obtains the inner-layer memory unit data at the current moment according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data at the previous moment.
In step 105, the calculation formula of the data of the inner memory cell at the current time is: the data of the inner layer memory cell indicating the current time,indicating the data of the inner layer memory cell at the previous time,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented;
represents the inner forgetting gate weight,The outer-layer weighting is represented by the outer-layer weighting,indicating the inner forgetting gate bias.
Step 106: and the inner layer reset gate updates the outer layer memory unit data at the current moment according to the inner layer memory unit data at the current moment.
In step 106, the update formula of the data of the outer-layer memory cell at the current time is as follows: the data of the inner layer memory cell indicating the current time,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function; represents the inner reset gate weight,representing the inner reset gate bias.
Step 107: the updated data of the outer-layer memory unit at the current moment is subjected to jump connection at the outer-layer reset gate to obtain the output data of the hidden layer; and the output data of the hidden layer is output after the output layer is subjected to linear transformation.
The output formula of the hidden layer in step 107 is: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function; in (1-r)t)⊙xtUnder the effect of jump connection, the prediction precision of the inverse power motion model is improved. r ist=σ(Wrxt+br),WrRepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
The formula of the output data of the hidden layer after the output layer is subjected to linear transformation to output the predicted joint torque is as follows: y ist=(Whht+bh),WhA weight representing the output; bhIndicating the output offset value.
Step 108: comparing the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
In step 108, the mean square error training formula is:d represents the number of joints, n represents the number of data (total number of samples in the input data set), j represents the cardinality of the joint accumulation starting from 1, t represents the cardinality of the time step accumulation starting from 1,representing the actual result of the acquisition, i.e. the actual torque, y, of the inputt [j]Representing the torque predicted by the dynamic model, and obtaining the final test result.
Optimizing MSE using Adam optimizer, adjusting formula yt=(Whht+bh) Weight in (1) andand (3) reducing the MSE by the bias, performing 100 times of cyclic operation, applying the obtained optimal model to inverse dynamics, and detecting data of the test set, wherein the graphs in FIGS. 5-9 are comparison graphs of output torques and real torques of the first to fifth joints predicted by the inverse dynamics model, and the predicted results are relatively fitted with real results as can be seen from the graphs in FIGS. 5-9. Adam, which is not an acronym nor a human name. Its name is derived from adaptive moment estimation (adaptive moment estimation).
The invention relates to a robot inverse dynamics modeling method based on a cascade memory neural network, which ensures memory information of a longer time sequence by utilizing the mutual access of inner and outer memory units nested in the network, improves the precision of torque prediction and accurately simulates a complex robot system.
The invention can process data input in parallel, utilizes the nesting processing of the SRU loop unit, reduces the serial problem that the current input of the traditional recurrent neural network needs to wait for the output of the previous moment, has great advantages on the processing time and the sequence related problem, greatly reduces the training time of input signals, completes the training of the trained samples within a few seconds, and improves the efficiency while improving the actual precision of the model.
Fig. 2 is a schematic structural diagram of a modeling system of an inverse robot dynamics model according to an embodiment of the present invention, and as shown in fig. 2, the system includes:
the recurrent neural network building module 201 is used for building a recurrent neural network, the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting door and an outer reset door, and the inner layer comprises an inner forgetting door and an inner reset door.
The input and output data determination module 202 is configured to determine input data and output data of the recurrent neural network, where the input data of the recurrent neural network is a motion state of the mechanical arm, and the output data of the recurrent neural network is a torque for controlling the mechanical arm to generate the motion state, where the motion state includes a motion position, a motion speed, and a motion acceleration.
The input and output data determination module 202 further includes a data set for collecting inverse dynamics of the robot, the data set corresponding to a motion state of the robot arm and a torque corresponding to a motion of the robot arm, and the data set is divided into an input (motion state) and an input (torque); the resulting data set contains a 15-dimensional input space, i.e., motion position, motion velocity, and motion acceleration, and 5-dimensional torque vectors as output or unknowns, while the collected data set is divided into a training set and a test set.
The mechanical arm of the robot for experiments has joints with 7 degrees of freedom, only the first five joints are needed in the motion, namely the first five joints at the tail end of the motion, and the robot dimension of 5 joints is R3d*1Where d represents the number of joints 5, and the input to each joint includes three vectors (position, velocity, acceleration), the motion state input at each time is data of dimension 15 x 1. The experiment uses a supervised training approach, so the input data includes both sample data and labels. Each row of input data has 20 columns, the first 15 columns representing position, velocity, acceleration inputs for each joint in 5 degrees of freedom, and the last 5 columns representing torque for each joint corresponding to the input signature.
Constructing an inverse dynamics module consisting of the motion state of the mechanical arm and the corresponding torque:q is the position of the motion,in order to be the speed of the movement,the motion acceleration is adopted, tau is the torque corresponding to the motion of the mechanical arm, and F represents the inverse dynamics model; and setting a target learning function y of the input quantity x according to the inverse dynamics model tau, and expressing the inverse dynamics model in a form of y-f (x), wherein the output y corresponds to the torque tau corresponding to the mechanical arm, the input x corresponds to the motion state of the mechanical arm, and f is the target learning function. Step 102 determines utilizing a recurrent neural networkAnd training an inverse dynamics model of the mechanical arm.
The data input module 203 is used for inputting the input data into the recurrent neural network according to the motion time of the mechanical arm; data output from the input layer is input to an outer layer of the hidden layer.
The time in the data input module 203 is the time step of the movement of the mechanical arm, the data in the hidden layer is firstly screened through the outer layer, and meanwhile, the data input at the current moment is preprocessed.
The outer-layer memory unit data acquisition module 204 is configured to obtain the outer-layer memory unit data of the current time according to the data input to the outer layer at the current time and the outer-layer memory unit data of the previous time, and input the outer-layer memory unit data of the current time to the inner layer.
The outer-layer memory cell data obtaining module 204 further includes a calculation formula of the outer-layer memory cell data at the current time as follows: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctOuter memory cell data representing the current time, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftAnd the data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is shown.
ft=σ(Wfxt+bf),xtData indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
The inner-layer memory unit data obtaining module 205 is configured to obtain the inner-layer memory unit data of the current moment according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data of the previous moment by the inner-layer forgetting gate.
The inner-layer memory unit data obtaining module 205 further includes that the calculation formula of the inner-layer memory unit data at the current time is: the data of the inner layer memory cell indicating the current time,indicating the data of the inner layer memory cell at the previous time,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,and the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented.
Represents the inner forgetting gate weight,The outer-layer weighting is represented by the outer-layer weighting,indicating the inner forgetting gate bias.
An outer-layer memory cell data updating module 206, configured to update, by the inner-layer reset gate, the outer-layer memory cell data at the current time according to the inner-layer memory cell data at the current time.
The outer-layer memory cell data updating module 206 further includes that the updating formula of the outer-layer memory cell data at the current time is: the data of the inner layer memory cell indicating the current time,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function; represents the inner reset gate weight,representing the inner reset gate bias.
The output module 207 is configured to obtain output data of the hidden layer at the outer layer reset gate through a jump connection function by using the updated outer layer memory unit data at the current time; and the output data of the hidden layer is output after the output layer is subjected to linear transformation.
The output module 207 further includes that the output formula of the hidden layer is: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function; r ist=σ(Wrxt+br),WrRepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
The formula of the output data of the hidden layer after the output layer is subjected to linear transformation to output the predicted joint torque is as follows: y ist=(Whht+bh),WhA weight representing the output; bhIndicating the output offset value.
The inverse dynamics model obtaining module 208 compares the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
In the inverse dynamics model obtaining module 208, the mean square error training formula is:MSE represents the Mean Square Error, known in english as Mean Square Error, d represents the number of joints, n represents the number of data (total number of samples in the input data set), j represents the cardinality of the joint accumulation starting from 1, t represents the cardinality of the time step accumulation starting from 1,representing the actual result of the acquisition, i.e. the actual torque, y, of the inputt [j]Representing the torque predicted by the dynamic model, and obtaining the final test result.
Optimizing MSE using Adam optimizer, adjusting formula yt=(Whht+bh) The MSE is reduced by the weight and the bias in the test set, and 100 times of cyclic operation is performed, so that the obtained optimal model is applied to inverse dynamics to detect the data of the test set.
The method comprises the steps of building a cyclic neural network, training a robot inverse dynamics model by using the cyclic neural network, wherein the cyclic neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate; training an inverse dynamics model of the mechanical arm by using a cyclic neural network; the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is the torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration; the outer-layer forgetting gate in the recurrent neural network obtains the data of the outer-layer memory unit at the current moment according to the data input to the outer layer at the current moment and the data of the outer-layer memory unit at the previous moment, and inputs the data of the outer-layer memory unit at the current moment to the inner layer, and the inner-layer forgetting gate obtains the data of the inner-layer memory unit at the current moment according to the data of the outer-layer memory unit input at the current moment and the data of the inner-layer memory unit at the previous moment; the inner layer reset gate updates the data of the outer layer memory unit at the current moment according to the data of the inner layer memory unit at the current moment, so that the memory information of the time sequence is kept for a longer time, the precision of the data output by the inverse dynamics model is improved, and the predicted torque output by the inverse dynamics model is more accurate.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.
Claims (10)
1. A method of modeling an inverse robotic dynamics model, the method comprising:
building a recurrent neural network, wherein the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate;
determining input data and output data of the recurrent neural network, wherein the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration;
the input data are input into the recurrent neural network according to the motion time of the mechanical arm; inputting data output from the input layer to an outer layer of the hidden layer;
the outer-layer forgetting door obtains the outer-layer memory unit data at the current moment according to the data input to the outer layer at the current moment and the outer-layer memory unit data at the previous moment, and inputs the outer-layer memory unit data at the current moment to the inner layer;
the inner-layer forgetting door obtains the inner-layer memory unit data at the current moment according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data at the previous moment;
the inner layer reset gate updates the outer layer memory unit data of the current moment according to the inner layer memory unit data of the current moment;
the updated data of the outer-layer memory unit at the current moment is subjected to jump connection at the outer-layer reset gate to obtain the output data of the hidden layer; the output data of the hidden layer is output after linear transformation is carried out on the output layer;
comparing the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
2. The modeling method of an inverse robot dynamics model according to claim 1, wherein the calculation formula of the data of the outer memory cell at the current time is: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctOuter memory cell data representing the current time, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftThe data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is shown, t represents the current moment, and t-1 represents the previous moment;
ft=σ(Wfxt+bf),xtdata indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
3. The modeling method of an inverse robot dynamics model according to claim 2, wherein the calculation formula of the data of the inner layer memory cell at the current time is: the data of the inner layer memory cell indicating the current time,indicating the data of the inner layer memory cell at the previous time,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented;
4. The modeling method of an inverse robot dynamics model according to claim 3, wherein the update formula of the data of the outer memory cell at the current time is: the data of the inner layer memory cell indicating the current time,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function;
5. The modeling method of an inverse robot dynamics model according to claim 2, wherein an output formula of the hidden layer is: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function;
rt=σ(Wrxt+br),Wrrepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
6. A modeling system for an inverse robotic dynamics model, the system comprising:
the recurrent neural network building module is used for building a recurrent neural network, the recurrent neural network comprises an input layer, a hidden layer and an output layer, the hidden layer comprises an outer layer and an inner layer, the outer layer comprises an outer forgetting gate and an outer resetting gate, and the inner layer comprises an inner forgetting gate and an inner resetting gate;
the input and output data determining module is used for determining input data and output data of the recurrent neural network, the input data of the recurrent neural network is the motion state of the mechanical arm, the output data of the recurrent neural network is torque for controlling the mechanical arm to generate the motion state, and the motion state comprises a motion position, a motion speed and a motion acceleration;
the data input module is used for inputting the input data into the recurrent neural network according to the motion time of the mechanical arm; inputting data output from the input layer to an outer layer of the hidden layer;
the outer-layer memory unit data acquisition module is used for acquiring the outer-layer memory unit data of the current moment according to the data input to the outer layer at the current moment and the outer-layer memory unit data of the previous moment by the outer-layer forgetting door and inputting the outer-layer memory unit data of the current moment to the inner layer;
the inner-layer memory unit data acquisition module is used for acquiring the inner-layer memory unit data of the current moment by the inner-layer forgetting gate according to the outer-layer memory unit data input at the current moment and the inner-layer memory unit data of the previous moment;
the outer-layer memory unit data updating module is used for updating the outer-layer memory unit data of the current moment by the inner-layer reset door according to the inner-layer memory unit data of the current moment;
the output module is used for acquiring the output data of the hidden layer at the outer layer reset gate through the effect of jump connection by the updated outer layer memory unit data at the current moment; the output data of the hidden layer is output after linear transformation is carried out on the output layer;
the inverse dynamics model acquisition module is used for comparing the output data of the hidden layer with the collected real output data by using a mean square error training formula to obtain a comparison error; and adjusting parameters in the linear transformation, and when the contrast error is smaller than a set threshold value, obtaining an inverse dynamics model of the mechanical arm.
7. The modeling system of an inverse robot dynamics model according to claim 6, wherein the calculation formula of the outer memory cell data of the current time is: c. Ct=ft⊙ct-1+(1-ft)⊙Xt,ctOuter memory cell data representing the current time, ct-1Outer memory cell data representing the previous time, XtData, X, representing the weighted current time input to the outer layert=WxtW denotes the outer weighting, ftThe data proportion applied to the outer-layer forgetting door in the data input to the outer layer at the current moment is represented;
ft=σ(Wfxt+bf),xtdata indicating the current time input to the outer layer, WfRepresenting outer forgetting gate weight, bfRepresents the bias of the outer forgetting gate, and sigma represents the sigmoid activation function.
8. The modeling system of an inverse robot dynamics model according to claim 7, wherein the calculation formula of the data of the inner memory cell at the current time is: the data of the inner layer memory cell indicating the current time,indicating the data of the inner layer memory cell at the previous time,indicating the weighted current time instant of the data input to the inner layer, data indicating the input of the inner layer at the present time, the inner-layer weighting is represented by the inner-layer weighting,the data proportion which is input into the inner-layer data at the current moment and is applied to the inner-layer forgetting gate is represented;
9. The modeling system of an inverse robot dynamics model according to claim 8, wherein the update formula of the outer memory cell data of the current time is: inner memory cell for indicating current timeThe data of the data is transmitted to the data receiver,representing the proportion of data output from the inner layer reset gate at the current moment, wherein g is a tanh activation function;
10. The modeling system of a robot inverse dynamics model according to claim 7, wherein an output formula of the hidden layer is: h ist=rt⊙g(ct)+(1-rt)⊙xt,htOutput data representing the hidden layer at the current time, rtRepresenting the proportion of data output from the outer layer reset gate at the current moment, wherein g is a tanh activation function;
rt=σ(Wrxt+br),Wrrepresenting the outer reset gate weight, brIndicating the outer reset gate bias.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910948416.9A CN110705105B (en) | 2019-10-08 | 2019-10-08 | Modeling method and system for inverse dynamics model of robot |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910948416.9A CN110705105B (en) | 2019-10-08 | 2019-10-08 | Modeling method and system for inverse dynamics model of robot |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110705105A true CN110705105A (en) | 2020-01-17 |
CN110705105B CN110705105B (en) | 2022-06-10 |
Family
ID=69196670
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910948416.9A Active CN110705105B (en) | 2019-10-08 | 2019-10-08 | Modeling method and system for inverse dynamics model of robot |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110705105B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN113156320A (en) * | 2021-03-12 | 2021-07-23 | 山东大学 | Lithium ion battery SOC estimation method and system based on deep learning |
CN113561185A (en) * | 2021-09-23 | 2021-10-29 | 中国科学院自动化研究所 | Robot control method, device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108621159A (en) * | 2018-04-28 | 2018-10-09 | 首都师范大学 | A kind of Dynamic Modeling in Robotics method based on deep learning |
US20190138887A1 (en) * | 2017-11-01 | 2019-05-09 | Board Of Trustees Of Michigan State University | Systems, methods, and media for gated recurrent neural networks with reduced parameter gating signals and/or memory-cell units |
-
2019
- 2019-10-08 CN CN201910948416.9A patent/CN110705105B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190138887A1 (en) * | 2017-11-01 | 2019-05-09 | Board Of Trustees Of Michigan State University | Systems, methods, and media for gated recurrent neural networks with reduced parameter gating signals and/or memory-cell units |
CN108621159A (en) * | 2018-04-28 | 2018-10-09 | 首都师范大学 | A kind of Dynamic Modeling in Robotics method based on deep learning |
Non-Patent Citations (1)
Title |
---|
陈贵亮 等: "下肢外骨骼康复机器人的动力学建模及神经网络辨识仿真", 《机械设计与制造》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111428317A (en) * | 2020-04-06 | 2020-07-17 | 宁波智诚祥科技发展有限公司 | Joint friction torque compensation method based on 5G and recurrent neural network |
CN111428317B (en) * | 2020-04-06 | 2023-06-09 | 宁波智诚祥科技发展有限公司 | Joint friction torque compensation method based on 5G and cyclic neural network |
CN112247992A (en) * | 2020-11-02 | 2021-01-22 | 中国科学院深圳先进技术研究院 | Robot feedforward torque compensation method |
CN113156320A (en) * | 2021-03-12 | 2021-07-23 | 山东大学 | Lithium ion battery SOC estimation method and system based on deep learning |
CN113561185A (en) * | 2021-09-23 | 2021-10-29 | 中国科学院自动化研究所 | Robot control method, device and storage medium |
CN113561185B (en) * | 2021-09-23 | 2022-01-11 | 中国科学院自动化研究所 | Robot control method, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110705105B (en) | 2022-06-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110705105B (en) | Modeling method and system for inverse dynamics model of robot | |
CN108621159B (en) | Robot dynamics modeling method based on deep learning | |
CN111496781B (en) | Mechanical arm modeling, controlling and monitoring integrated system driven by digital twin | |
CN108115681B (en) | Simulation learning method and device for robot, robot and storage medium | |
CN109740742A (en) | A kind of method for tracking target based on LSTM neural network | |
CN106548475A (en) | A kind of Forecasting Methodology of the target trajectory that spins suitable for space non-cooperative | |
CN110728698B (en) | Multi-target tracking system based on composite cyclic neural network system | |
WO2020133721A1 (en) | Method for status estimation of signalized intersection based on non-parametric bayesian framework | |
CN111539132B (en) | Dynamic load time domain identification method based on convolutional neural network | |
CN111310965A (en) | Aircraft track prediction method based on LSTM network | |
CN115688288B (en) | Aircraft pneumatic parameter identification method and device, computer equipment and storage medium | |
CN110443419A (en) | Medium-term and long-term Runoff Forecast method based on ICEEMDAN and extreme learning machine | |
CN111798494A (en) | Maneuvering target robust tracking method under generalized correlation entropy criterion | |
CN109509207B (en) | Method for seamless tracking of point target and extended target | |
CN109857127B (en) | Method and device for calculating training neural network model and aircraft attitude | |
CN1330466C (en) | On-line robot hand and eye calibrating method based on motion selection | |
Chen et al. | Learning trajectories for visual-inertial system calibration via model-based heuristic deep reinforcement learning | |
CN114030008B (en) | Industrial robot practical training energy consumption measurement method based on data driving | |
WO2019095108A1 (en) | Robot imitation learning method and apparatus, robot and storage medium | |
CN115050095A (en) | Human body posture prediction method based on Gaussian process regression and progressive filtering | |
CN115114985A (en) | Sensor system distributed fusion method based on set theory | |
CN111158238B (en) | Force feedback equipment dynamics parameter estimation algorithm based on particle swarm optimization | |
CN113485273B (en) | Dynamic system time delay calculation method and system | |
CN113850366B (en) | Method for predicting target motion based on LSTM | |
CN117591990A (en) | Data-driven multi-sensor track fusion method under cross-correlation observation noise |
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 |