You are on page 1of 16

Another Fine Mess

Equations to Matrices
a x ... a x
11 1

Some basic Linear Algebra first:


Matrix: What is the purpose?

a 11
.

a m1

a 1n

a mn

1n n

k1

.
.
an1 x1 ... ann xn k n
If k1..kn are 0, then it is a
Homogeneous Matrix and
there are some special
properties.

Computing Determinants

Example

Never thought youd ever use


Determinants?
Problem :
5w1 7 w2 4w3 0
2w2 w3 0
w1 w2 w3 0
5 7 4
D 10
1

2
1

1 0
1

if determinant is 0 then, infinite solutions exist.


w2 can be chosen. w1 3w2 ; w3 2 w2

Determinants used to find a


solution
k1 a11 ...a1n

a11k1...a1n

.
.
.
.
D1
D2
.
.
.
.
k n an1...ann
an1.k n ..ann
x1 D1 / D; x2 D2 / D

...

xn Dn / D

Example

Why
multiply
matrices?
These systems come up in many topics
especially robot kinematics.

When two matrices are multiplied, and the


matrix solved, the answer is the solution to
the system of two simultaneous equations.

Consider two systems of


simultaneous
equations
a u ... a u y
11 1

1p n

am1u1 ... amp u n ym


b11 x1 ... b1 p xn u1
bm1 x1 ... bmp xn u p
So,
y1 a11u1 ... a1 p ...Substitution
a11 (b11 x1 ... b1n xn ) ... a1 p (b p1 x1 ... b pn xn )
(a11b11 ... a1 p b p1 ) x1 ... (a11b1n ...a1 p b pn ) xn
...Hence...the product of a matrix is...
a b
c d

e
h

f
i

ae bh af bi ag bj

j ce dh cf di cg dj

Rx
Ry
Rz

Yp

Zi

Yi

Xp

Oi

Op
Zp

Patient
Space

Tx,
Ty
Tz

Image
Space

Xi

Transformation Between Two


Coordinate Systems
The transformation between two coordinate systems (say between
two joints of a robot) is represented by a translation vector (T) and
a Rotation vector (R). These entities form the homogeneous 4x4
transformation matrix.

How does one transform a point in one coordinate to another?

Point Transformation
r00 r01 r02 t0 p x
r r r t py

10 11 12 1
r20 r21 r22 t 2 p x


0 0 0 1 1
T

px
p
y

p
x

But, how do we get the


rotation (r) matrix?

Do you remember 2D
geometry?
R=Sqrt(x2+y2);
Polar to Cartesian
Coordinates?
Theta=ArcTan(Y/X);
Cartesian From Polar:
X= R*cos(Theta)
Y= R*sin(Theta)
Y
R

(R, Theta) or
(X,Y)
Theta
X

Rotations
Given a rotation vector which represents rotations around the x, y
and z axes respectively, a rotation matrix can be computed which
relates two orthogonal coordinate systems having the same origin
but differing in these rotation angles. Each individual rotation is
given by the following three sets of equations:
cos sin 0
Rx ( ) sin cos 0
0
0
1

cos 0 sin
0

1
0

Ry ( )
sin 0 cos

cos sin 0
R z ( ) sin cos 0
0
0
1

The combined effect of these rotation matricies is given by the following equation :
cos cos sin sin
Rz ( ) Ry ( ) Rx ( ) cos cos sin sin cos

cos sin

sin cos cos cos sin


sin cos sin cos cos
sin sin

sin cos
sin sin
cos

Convert from a Matrix back to


position and angles.
cos cos sin sin
Rz ( ) Ry ( ) Rx ( ) cos cos sin sin cos

cos sin

sin cos cos cos sin


sin cos sin cos cos
sin sin

sin cos
sin sin
cos

In order to convert a matrix back to Euler angles:


one has to work form the components of the above matrix
and convert the direction cosine values back to angles.
For instance, the last component of the third row (2,2) (indexing
starts at 0) of the cosine matrix can be used to get the beta value.
From which we can use beta to compute alpha by using component
(2,0) of the above matrix.
Then use beta again to get gamma by using components (2,1).

Each of the transformation matrices described above is a


homogeneous transform which has both the rotation
component and a translational component as specified by
the equation below.
The unique features of the homogeneous transform are that
the vectors of the rotation matrix (unit vectors) of the
transformed coordinate system are referenced in the row
vectors of the matrix in the base coordinate system.
In other words, the inverse of the matrix is simply the
transpose of the rotational matrix and the negation of the
translational vector and makes them mathematically elegant.
Rotation

Tx xx

r00 r01 r02 t0


r r r t
10 11 12 1

r20 r21 r22 t2

0 0 0 1

r00 r10 r20 t0


r r r t
01 11 21 1

Translationn

Tx1xx

r02 r12 r22 t2


0 0 0 1

What does this have to do with


Medical robotics??
TB EE TB J 0 TJ 0 J 1

J2

TJ 1 J 2 TJ 2 J 3 TJ 3 EE

J3

TJ1-J2
TJ2-J3
TJ3-EE
EE

But,
How do you calculate the individual
transformationslike Tb-jo??

J1

TJ0-J1
J0

TB-J0

*TB-EE
B

You have to know what D-H


Parameters are. Which will be covered
shortly.

You might also like