How to manage the Inverse Kinematics in a Robotic Arm with 3 joints?

조회 수: 6 (최근 30일)
Ercong Shang
Ercong Shang 2016년 3월 11일
답변: Junhao Jiang 2020년 4월 22일
The example with 2 joints is given in: http://uk.mathworks.com/help/fuzzy/examples/modeling-inverse-kinematics-in-a-robotic-arm.html?refresh=true; and I've already modified the original code into a 3-joint-robotic arms:
l1 = 10; % length of first arm
l2 = 7; % length of second arm
l3 = 6;
theta1 = 0:0.1:pi/2;% all possible theta1 values
theta2 = 0:0.1:pi;% all possible theta2 values
theta3 = 0:0.1:pi;
[THETA1, THETA2, THETA3] = meshgrid(theta1, theta2,theta3); % generate a grid of theta1 and theta2 values
X = l1 * cos(THETA1) + l2 * cos(THETA1+THETA2) + l3 * cos(THETA1+THETA2+THETA3) ; % compute x coordinates
Y = l1 * sin(THETA1) + l2 * sin(THETA1+THETA2) + l3 * sin(THETA1+THETA2+THETA3) ;
X1 = reshape(X, size(X,1), size(X,2)*size(X,3));
Y1 = reshape(Y, size(Y,1), size(Y,2)*size(Y,3));
plot(X1, Y1);
U = l1 * cos(THETA1) + l2 * cos(THETA1+THETA2);
V = l1 * sin(THETA1) + l2 * sin(THETA1+THETA2);
U1 = reshape(U, size(U,1), size(U,2)*size(U,3));
V1 = reshape(V, size(V,1), size(V,2)*size(V,3));
The code is CORRECT and it be can successfully plotted. I am now confused with how to set the data as well as the following steps such as ANFIS network training and the equation of 3-joint-robotic arm. At first I guessed that the angle of the joint theta 1,2,3 as well as the position of the final joint (U,V) and the tip(X,Y) is needed so I typed:
data1 = [X(:) Y(:) U(:) V(:) THETA1(:)]; % create x-y-theta1 dataset
data2 = [X(:) Y(:) U(:) V(:) THETA2(:)]; % create x-y-theta2 dataset
data3 = [X(:) Y(:) U(:) V(:) THETA3(:)]; % create x-y-theta2 dataset
When I tried to train the ANFIS network the system broke down because the data were to large.
Anyone can show me an improved commands?
  댓글 수: 1
Humaira Aslam Mian
Humaira Aslam Mian 2020년 4월 21일
Hey, did you find the soultion??
I m also finding for this...When I had to calculate the value of "phi".

댓글을 달려면 로그인하십시오.

답변 (1개)

Junhao Jiang
Junhao Jiang 2020년 4월 22일
if it doesn't solve in mathmatic euqation, neural network maybe a good way to approximate the model

카테고리

Help CenterFile Exchange에서 Robotics에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by