Derivation
Derivation
These below are the steps used to obtain the equations of motion for the 3 degree of freedom RRR
robot arm to use them to make the simulation in Mathematica.
This was written in version 10.02 and the simulation uses Manipulate. You can adjust the speed of the
simulation, the torque applied to each joint, and the damping at each joint.
Nasser M. Abbasi
4/2/2015
Forward kinematics
The following diagram (thanks to lecture notes by Professor Zinn, UW Madison) shows the geometry of
the problem. In the derivation below, I used xi in place of qi . There are 3 degrees of freedom. (RRR
robot arm)
The first step is to determine the transformation matrices between each frame and the base.
Now that we found the transformation matrices between each frame, we find the transformation
between each frame and the base
v3 = Simplify[v3]
{- (L2 Cos[x2[t]] + L3 Cos[x2[t] + x3[t]]) Sin[x1[t]] x1′ [t] - Cos[x1[t]]
((L2 Sin[x2[t]] + L3 Sin[x2[t] + x3[t]]) x2′ [t] + L3 Sin[x2[t] + x3[t]] x3′ [t]),
Cos[x1[t]] (L2 Cos[x2[t]] + L3 Cos[x2[t] + x3[t]]) x1′ [t] - Sin[x1[t]]
((L2 Sin[x2[t]] + L3 Sin[x2[t] + x3[t]]) x2′ [t] + L3 Sin[x2[t] + x3[t]] x3′ [t]),
(L2 Cos[x2[t]] + L3 Cos[x2[t] + x3[t]]) x2′ [t] + L3 Cos[x2[t] + x3[t]] x3′ [t]}
o01c = T01c〚1 ;; 3, 4〛
L1
0, 0,
2
o02c = T02c〚1 ;; 3, 4〛
o03c = T03c〚1 ;; 3, 4〛
T02〚1 ;; 3, 4〛
Coriolis terms
d[i_, j_, k_] := D[massMatrix〚i, j〛, ToExpression["x" <> ToString[k] <> "[t]"]];
b[i_, j_, k_] := 1 2 (d[i, j, k] + d[i, k, j] - d[j, k, i])
B0 = {{2 b[1, 1, 2], 2 b[1, 1, 3], 2 b[1, 2, 3]},
{2 b[2, 1, 2], 2 b[2, 1, 3], 2 b[2, 2, 3]}, {2 b[3, 1, 2], 2 b[3, 1, 3], 2 b[3, 2, 3]}};
MatrixForm[Simplify @ B0]
centrifugal terms
C0 = {{b[1, 1, 1], b[1, 2, 2], b[1, 3, 3]},
{ b[2, 1, 1], b[2, 2, 2], b[2, 3, 3]}, { b[3, 1, 1], b[3, 2, 2], b[3, 3, 3]}};
MatrixForm[Simplify @ C0]
Gravity
gvector = {0, 0, - g};
G0 = - Transpose @ jv1c.m1 gvector +
Transpose @ jv2c.m2 gvector + Transpose @ jv3c.m3 gvector;
MatrixForm[Simplify[G0]]