This MATLAB-guided project explores the approximation of joint angles in a robotic system using data-driven methods. The process involves generating function mappings to represent joint angles as inputs and tool positions as outputs. Users can input their target functions and specify parameters for generating paired data samples. The method utilizes adaptive networks and single-layer perceptrons to minimize error through mean square error calculations. The ultimate goal is to facilitate both forward and inverse kinematics for powerful robotic control.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
One link Given Xt what is the joint angle P Y xt P x
Plot1d Plot a function that maps joint angle P to tool position Xt clear all fstr=input('input a function: x.^2+cos(x) :','s'); fx=inline(fstr); range=2*pi; x=linspace(-range,range); y=fx(x); max_y=max(abs(y)); plot(x,y/max_y); hold on;
Black box Black box Xt P range=2*pi; linspace(-range,range); observation N=input('keyin sample size:'); x=rand(1,N)*2*range-range; n=rand(1,N)*0.1-0.05; y=fx(x)/max_y+n; figure plot(x,y,'.');
Procedure 2: Mean square error • Input x,y,a,b,r • Set E to zero • Set n to the length of x • For i=1:n • Calculate the square error of approximating y(i) by f(x;r,a,b) • Add the error to E • Return E
Matlab code mean_square_error2.m function E=mean_square_error2(x,y,a,b,r) E=0; M=length(a); n=length(x); for i=1:n s_err=(y(i)-eval_MLP(x(i),r,a,b,M)).^2; E=E+s_err; end E=E/n; return
Construction of inverse kinematics • Procedure • Input a 1d forward kinematics • Sampling to form paired data • Input-output swapping • Rescaling • Learning
Data preparation Black box plot1d.m Xt P observation Create paired data sampling.m Rescaling temp=x; x=y; y=temp; swapping max_y=max(y); y=y/max_y; plot(x,y,'.')
Matlab code fa1d_inv.m MSE for training data 0.336461
ME for training data 0.490247 Unacceptable training errors
Multiple outputs • Inverse kinematics • Conflicts of I/O relation • Two distinct outcomes for the same input
First order derivative • Forward kinematics should be characterized by two outputs for construction of inverse kinematics Two observations Xt Black box plot1d.m P Derivative
Symbolic differentiation demo_diff.m function demo_diff() % input a string to specify a function % plot its derivative ss=input('function of x:','s'); fx=inline(ss); x=sym('x'); ss=['diff(' ss ')']; ss1=eval([sprintf(ss)]); fx1=inline(ss1) x=linspace(-pi,pi); plot(x,fx(x),'b');hold on; plot(x,fx1(x),'r'); return
Data preparation Two observations Xt Black box plot1dd.m P Dt Derivative
Reverse kinematics Xt Reverse Kinematics P Dt Derivative plot3(y1,y2,ix)
Inverse kinematics At the position level, the problem is stated as, "Given the desired position of the robot's hand, what must be the angles at all of the robots joints? "