Jacobian computation

From velocity recursion

j1 = Jacobian1[DH, 0, 3] //Simplify ; j1 // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...                                      0            1                                              1

From differentiation of forward kinematics

j2 = Jacobian2[DH, 0, 3] ;  j2 //  TF

(                                                                                      ... θ2) + sin (θ1) cos (θ2) + cos (θ1) sin (θ2) + sin (θ1) sin (θ2)

Are they the same?

j1 // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...                                      0            1                                              1

j2b = j2 // Simplify ; j2b // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...                                      0            1                                              1

j1  j2b

True

Step-by-step derivation of Jacobian from forward kinematics

Homogeneous transform

T03 = T[DH, 0, 3] // FullSimplify ; T03 // TF

( cos(θ1 + θ2)                        -sin(θ1 + θ2)                ...      0                                             0                                             1

Position vector from homogeneous transform

P03 = PFromT[T03] ;  P03 //Nice

( L1 cos(θ1) + L2 cos(θ1 + θ2) )            L1 sin(θ1) + L2 sin(θ1 + θ2)            0

Differentiation of position vector ( 3x2 linear velocity submatrix of Jacobian)

vj2 = Outer[D, P03, {θ1, θ2}] ;  vj2 // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...  θ2)    L2 cos(θ1 + θ2)            0                                              0

Rotation matrix from homogeneous transform

R03 = RFromT[T03] ;  R03 // TF

( cos(θ1 + θ2)    -sin(θ1 + θ2)   0                        ... 2)    cos(θ1 + θ2)    0            0                         0                         1

S(Ω) =  Overscript[R, .] R^T(3x3 angular velocity, skew-symmetric matrix)

SΩ = Dt[R03, t] . Transpose[R03] ;  SΩ // TF

(                          θ1   θ2                           ...                                                                                                  0

S(Ω) =  Overscript[R, .] R^T(simplified)

SΩ = SΩ // FullSimplify ;  SΩ // TF

(                                       θ1   θ2              ...         0              0                                    0                                    0

Corresponding angular acceleration vector

Ω = {SΩ[[3, 2]], SΩ[[1, 3]], SΩ[[2, 1]]} ; Ω // Nice

(                                   )            0              0            & ... 63308;θ2           --------------- + ---------------              t         t

3x2 angular velocity submatrix of Jacobian

ωj2 = Transpose[Coefficient[Ω, Dt[#, t]] & /@ {θ1, θ2}] ; ωj2 // TF

( 0   0 )            0   0            1   1

Put linear and angular velocity Jacobian together

j2b = Join[vj2, ωj2] ;  j2b // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...                                      0            1                                              1

Compare to previous result

j1 // TF

( -L1 sin(θ1) - L2 sin(θ1 + θ2)   -L2 sin(θ1 + θ2)            ...                                      0            1                                              1


Created by Mathematica  (October 1, 2003)