![Logitech Magellan/SPACE MOUSE Classic Programmer'S Manual Download Page 18](http://html1.mh-extra.com/html/logitech/magellan-space-mouse-classic/magellan-space-mouse-classic_programmers-manual_1937109018.webp)
18
<cs 1,0>
The checksum is also
transmitted in two bytes, with
six significant bits per byte. The
checksum is calculated with the
following formula:
<cs> = <cs1> * 64 + <cs0>
For an error-free transmission,
the checksum is equal to the
sum of the transmitted data
bytes of all six inputs. The TSM
performs a check by calculating
this value (each data byte is
interpreted as an unsigned
integer):
<cs> = <tx1> + <tx0> +
<ty1> + <ty0> +
<tz1> + <tz0> +
<ra1> + <ra0> +
<rb1> + <rb0> +
<rc1> + <tc0>
As an example, suppose the TSM transmits
the following data packet:
dí
╢
¢q
α
Ç
₧
j
₧║
Zà
▄
B\r
The corresponding values are as follows.
Input Char.
Nibbles (Hex.)
Lower 6
Bits
(Hex.)
Dec.
Calc’d
Input
Value
x
í
╢
A1,B6
21,36
33,54
118
y
¢q
9B,71
1B,3B
27,49
-271
z
α
Ç
E0,80
20,00
32,0
0
a
₧
j
9E,6A
1E,2A
30,42
-86
b
₧║
9E,BA
1E,3A
30,58
-70
c
Zà
5A,85
1A,05
26,5
-379
cs
▄
B
DC,42
1C,02
28,2
1794
cs = A1 + B6 + 9B + 71 + E0 + 80 +
9E + 6A + 9E + BA + 5A + 85
= 702
(Hex.)
=
1794
(Dec.)
Mathematics of 3D Motion Control
This appendix outlines the mathematics
necessary for describing arbitrary translational
and rotational motion of an object. A cube
serves as a good example for demonstrating
the steps involved in the computations.
Suppose the center of the cube is originally
aligned with the origin of the xyz-coordinate
system and its faces are parallel to the xy-, yz-
and xz-planes. If the cube has an edge length
of 2 units, its corners are given by the
following set of eight points:
P
1 old
(1, 1, 1)
P
2 old
(-1, 1, 1)
P
3 old
(-1, -1, 1)
P
4 old
(1, -1, 1)
P
5 old
(1, 1, -1)
P
6 old
(-1, 1, -1)
P
7 old
(-1, -1, -1)
P
8 old
(1, -1, -1)
Note that a physical unit of length is not
required.
One-Step Motion
If the cube is moved due to a translational or
rotational displacement of the Magellan/SPACE
MOUSE cap, eight new points must be
generated using the eight old points. To
accomplish this, the Magellan/SPACE MOUSE
sends the six values X, Y, Z, A, B and C.
For the cube's translational motion, the values
X, Y and Z have to be added to the original
coordinates of the corner points. Thus a new
point P
new
is generated from an old point P
old
using the equation
P
new
= P
old
+ T
XYZ
Shown explicitly, this formula consists of the
following three equations:
P
new X
= P
old X
+ X
P
new Y
= P
old Y
+ Y
P
new Z
= P
old Z
+ Z
For the cube's rotational motion, the values A,
B and C have to be incorporated into a 3x3
rotation matrix R.
R =
ú
ú
ú
û
ù
ê
ê
ê
ë
é
33
32
31
23
22
21
13
12
11
R
R
R
R
R
R
R
R
R
The matrix elements are computed as follows:
R
11
= (cos A)(cos B)
R
12
= (sin A)(cos C) – (cos A)(sin B)(sin C)
R
13
= (sin A)(sin C) + (cos A)(sin B)(cos C)
R
21
= -(sin A)(cos B)
R
22
= (cos A)(cos C) + (sin A)(sin B)(sin C)
R
23
= (cos A)(sin C) – (sin A)(sin B)(cos C)
R
31
= -(sin B)
R
32
= -(cos B)(sin C)
R
33
= (cos B)(cos C)
Using this rotation matrix, the effects of
rotation are calculated with the formula
P
new
= [R](P
old
)
Shown explicitly, this formula consists of the
following three equations:
P
new X
= (R
11
)(P
old X
) + (R
12
)(P
old Y
) + (R
13
)(P
old Z
)
P
new Y
= (R
21
)(P
old X
) + (R
22
)(P
old Y
) + (R
23
)(P
old Z
)
P
new Z
= (R
31
)(P
old X
) + (R
32
)(P
old Y
) + (R
33
)(P
old Z
)
Combining the equations for translational and
rotational motion yields the equation
Summary of Contents for Magellan/SPACE MOUSE Classic
Page 1: ......