Code covered by the BSD License  

Highlights from
Inverse Optimal Functions for Motoman HP-3 Tip Precision

image thumbnail

Inverse Optimal Functions for Motoman HP-3 Tip Precision

by

 

A population based optimization increases pointing precision for a planar robotic arm.

Delta_X=PSO_OptFun_CostDescent_Armijo_1(Particles,Options)
function Delta_X=PSO_OptFun_CostDescent_Armijo_1(Particles,Options)
% For use by PSO_Function_Try6 and greater versions
% Rev 2, scale to gamma after removing orthogonal component

% Find cost gradient for every particle
Grad_Cost1=Options.Grad_J(Particles);
% Find the length of gradient; if less than MinGrad_Cost, use MinGrad_Cost
% When the gradient is less than MinGrad_Cost, motion slows until
% extremum is reached or gradient picks up
tempF1=max(sum(Grad_Cost1.^2,1).^.5,Options.MinGrad_Cost*ones(1,size(Particles,2)));
% Normalize gradient (1 unit in input space, <= 1 unit in Cost) and
% then scale for a Ganna_Cost change in cost
Grad_Cost2=Grad_Cost1./repmat(tempF1,size(Particles,1),1);
% Find output gradient for every particle
Grad_Out1=Options.Grad_Y(Particles);
% Find length of gradient; if less than MinGrad_Out, use MinGrad_Out
% This removes instabilities where the output gradient isn't well
% defined
tempF2=max(sum(Grad_Out1.^2,1).^.5,Options.MinGrad_Out*ones(1,size(Particles,2)));
% Normalize gradient, as the length of Grad_Out1 goes to zero, there is
% no adjustment to Grad_Cost2, so any motion is acceptable and will
% result in negligable change to Y
Grad_Out2=Grad_Out1./repmat(tempF2,size(Particles,1),1);
% Remove component of Grad_Cost2 in the Grad_Out2 direction
Delta_X=-Grad_Cost2+repmat(sum(Grad_Out2.*Grad_Cost2,1),size(Particles,1),1).*Grad_Out2;
tempF3=max(sum(Delta_X.^2,1).^.5,Options.MinGrad_Final*ones(1,size(Particles,2)));
Delta_X=Options.Gamma_Cost*Delta_X./repmat(tempF3,size(Particles,1),1);

%% Add check to see that X_range is not violated
% done in main program

Contact us