# Convert from unit vector to (maybe) special euler angles on a machine tool

1. Mar 13, 2009

### fennex

Hello,

I am trying to extract the 3 angles from a unit vector to position a part on a 5 axis milling machine:

This machine has 3 linear axes (x,y,z), direct coordinate system
It has 2 rotary axes:
A turns about the x (called 'tilt')
C is carried on the A axis (called 'rotary')
See picture of an example of such machine.

I want to machine a feature (ex: drill a hole) on a randomly oriented face
My CAD software gives me the unit matrix of the 'local' coordinate system:

x1 x2 x3
y1 y2 y3
z1 z2 z3

See the 2nd picture:
- blue face is the face (local xy plane) that has to be positionned parallel to the machine (brown lines) XY plane
-The machine only has 2 rotations so the best it can do is to make the local coordinate system Z axis parallel to the machine's Z axis (spindle)
Then I need to add the 3rd rotation by rotating (or mapping) the local coordinates around Z to express them in the machine's XYZ.

I am able to extract the 'A' value:
A=atan2( sqrt(z1*z1+ z2*z2),z3)

In the example picture, the cube is 2x2x1
In this particular case:
A = 35.264
C= 135

That brings the blue face (or the local z axis) parallel to the machine's Z axis.
But the part is rotated 180 degrees around z.
I can easily rotate the coordinates with a rotation matrix. This is the 3rd angle that is not physically there (like an Euler type machine) but can be implemented via matrices.

How do I extract the 'C' move?
How do I extract the 3rd angle?

Thank you,
Paul

#### Attached Files:

File size:
23.1 KB
Views:
107
• ###### 5X-example.gif
File size:
14 KB
Views:
107
2. Mar 16, 2009

### fennex

Hello,

I found the answers, pretty easy actually after a few good nights thinking about it.

P

3. Sep 28, 2010

### Dan B

I have this exact same issue. Could you, or someone, show how this is done? I can find the rotation of the A axis fairly easily, but I'm stuck trying to determine the C rotation.