I want to draw the workspace of a gripper finger

6 ビュー (過去 30 日間)
Ahmed
Ahmed 2022 年 10 月 23 日
コメント済み: Ahmed 2022 年 10 月 27 日
Greetings, friends.
My goal is to draw the workspace of the gripper finger with two joints.
It is common knowledge that the workspace is the set of points that can be reached with the fingertip. Therefore, I have the necessary math equations to draw the points and visualize the area that the finger can reach.
It is possible for me to draw all the points using the equations I derived from the mechanism, but I cannot rotate the points to simulate the rotation of the finger. You can see the red-marked area that needs to be rotated.
And this is the code used to draw the figure above.
clc;
oe=48.218;
j4p=166.696;
pb=86.488;
theta1=28.219;
j3j4=42.219;
j2j3=42;
hold on
for theta3=30:0.5:120;
for pb=110:-1:20
rdash=pb;
% rotation of the finger calculation
theta7=((90-theta3)*3.14159265359)/180; %theta 7 is radian
x=rdash*cos(theta7);
y=rdash*sin(theta7);
tb=y;
pt=pb-y;
theta5=atan(pt/x); %*180)/3.14159265359; theta 5 is radian
thetapp=theta7+theta5;
theta3rad=(theta3*3.14159265359)/180; %theta 3 is radian
% thetapprad=(thetapp*3.14159265359)/180;
pp=(pb*sin(theta3rad))/sin(thetapp);
pa=pb-oe;
j4a=sqrt(j4p^2-pa^2);
phi1=atan(pa/j4a)*180/3.14159265359;
%let px+x be p_x
p_x=j4a+24.658;
op=sqrt(pb^2+p_x^2);
phi2=atan(pb/p_x)*180/3.14159265359;
theta2=theta1-phi1;
theta2rad=(theta2*3.14159265359)/180;
j3d=j3j4*sin(theta2rad);
j4d=j3j4*cos(theta2rad);
j3g=j4d+24.668;
j3h=oe-j3d;
j2h=sqrt(j2j3^2-j3h^2);
j3f=p_x-j3g;
px=j3f+j2h;
x=p_x-px;
grid on
plot3(pp,p_x,pb,'b.');
end
end

回答 (1 件)

William Rose
William Rose 2022 年 10 月 24 日
@Ahmed, your code follows:
clc;
oe=48.218;
j4p=166.696;
pb=86.488;
theta1=28.219;
j3j4=42.219;
j2j3=42;
hold on
for theta3=30:0.5:120;
for pb=110:-1:20
rdash=pb;
% rotation of the finger calculation
theta7=((90-theta3)*3.14159265359)/180; %theta 7 is radian
x=rdash*cos(theta7);
y=rdash*sin(theta7);
tb=y;
pt=pb-y;
theta5=atan(pt/x); %*180)/3.14159265359; theta 5 is radian
thetapp=theta7+theta5;
theta3rad=(theta3*3.14159265359)/180; %theta 3 is radian
% thetapprad=(thetapp*3.14159265359)/180;
pp=(pb*sin(theta3rad))/sin(thetapp);
pa=pb-oe;
j4a=sqrt(j4p^2-pa^2);
phi1=atan(pa/j4a)*180/3.14159265359;
%let px+x be p_x
p_x=j4a+24.658;
op=sqrt(pb^2+p_x^2);
phi2=atan(pb/p_x)*180/3.14159265359;
theta2=theta1-phi1;
theta2rad=(theta2*3.14159265359)/180;
j3d=j3j4*sin(theta2rad);
j4d=j3j4*cos(theta2rad);
j3g=j4d+24.668;
j3h=oe-j3d;
j2h=sqrt(j2j3^2-j3h^2);
j3f=p_x-j3g;
px=j3f+j2h;
x=p_x-px;
grid on
plot3(pp,p_x,pb,'b.');
end
end
Pease indent your code in the normal way, to make it more readable. I have done so.
The script does not generate the red lines. Therefore I don;t know how to do a rotation that the red lines supposedly represent.
Please describe the mechanics of your finger more precisely so that we can understand how you generated the points you have genrated, and what exactly is going to rotate, relative to what. I suspect figures would help.
You said your finger has 2 joints. Does that mean there are 3 segments, and the proximal segment is mounted on a platform? Are the joints hinge joints, axial joints, ball joints, or something else? If they are hinge or axial joints, then each joint is characterized by a single angle. If they are hinge or axial joints, then please specify (as a vector) the axis of each joint. What is the length of each segment, measured from joint center to joint center, and the length of the distal segment (which has no joint center at its tip)?
One possibility that I can imagine is that you have a 3-segment finger with 2 hinge joints, and you want to add an axial joint at the base of the proximal segment, where that segment attaches to a mounting platform. This would allow the proximal segment (and the rest of the finger) to rotate about the long axis of the proximal segment. Tell us if that is your plan.
I recommend that you make your code more readable by adding clear useful comments and by defining variables that correspond to the physical quantities of interest, such as: L1, L2, L3=length of proximal, middle, and distal segments; theta12, theta23 = angles between segments 1 and 2, and between segments 2 and 3; n1, n2 = unit vectors for the axis orientations of joints 1 and 2; r1, r2 = position vectors for the current joint center locations. Such definitions will allow the writer, readers, and users of the code to have a much clearer understanding the model. Then, if you add rotation at the base, you will need to add theta01 (scalar), n0 (vector), and r0 (vector) for the angle, axis orientaiton, and joint center location, respectively.
If the joints between segments are ball joints, then you should consider quaternions to represent joint angles.
The script calls plot3() 16,471 times (=91*181). A single blue point is plotted on each call, at location x,y,z=pp, p_x, pb, where pp, p_b, px are scalars. This works, but it is not very efficient. A more efficient approach would be to make vectors of length 181, and call plot3() 91 times. The mesh() command could be useful and could prodce a visually pleasing result.
I am somewhat familiar with fitting finger reaching data. I wrote code to fit a convex hull and the best-fit cone around the points which a subject could reach with the tip of the thumb, while the rest of the hand was fixed. Reflective markers were placed at the joints and thumb tip. A 3D motion capture system was used to collect the set of reachable points. Thumb joint workspace, in steradians, was also computed.
  12 件のコメント
William Rose
William Rose 2022 年 10 月 26 日
I chose to limit angle 2 to values that reach the centerline, and which go out far enough to reach the level of the top of the fixed base of support.
You could go father than the centerline with angle 2. Then you will reach across the centerline. Here is a plot with angle 2 minimum (a2min) = -pi/4 = -45 degrees:
Ahmed
Ahmed 2022 年 10 月 27 日
Thank you very much, Sir
It has been noted, and thank you for your support.
Regards

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by