Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

The problem relates to machine tool setup.

Suppose we have cartesian axes X, Y & Z and a rectangular right angled prism with adjacent sides a, b & c, has lines at angles A, B, C on each surface respectively all intersecting at the common corner. The requirement is to orient the prism such that the plane containing lines at angles A and B is parallel to X-Y.

I have been able to derive this. Twist the prism such that line at angle A is parallel to X-Y, then using this line as an axis tilt the prism by angle atan(tanBcosA) X-Y (compound angle problem).

Next the block must be rotated about Z by some angle so that a vertical plane containing the line at angle C is parallel or perpendicular to X - Z or Y - Z.

How to find this angle eludes me.

Help or a link that shows how will be much appreciated.

Thanks, John.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi Machinist60

Not sure I've fully understood your problem. Here's how I picture it.

Is this correct?

Please say what you mean by angle A. eg A = POY or whatever.

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Yes Bob that is the gist of it. I should have made a diagram but am only capable of drawing on paper with a pencil and then scanning it.

Angle A would be ROX, B YOQ and C POY.

The verical jaw face of the vice is the XZ plane. The prism would be twisted about the Y axis such that OR coincides with OX.

Next the vice is tilted around axis X so that OQ lies in plane XY. This angle is given by atan(tanBcosA). This is the common compound angle problem found in miter cuts for crown moldings and the like.

The third rotation about the Z axis is to bring line OP into the YZ plane.

Rotation of the prism about OY and OX will shorten the projection of OP on the XY plane. So it seems to me that the third angle of rotation about OZ must be some function of A, B and C.

With my rather rusty high school trig I don't seem to be able to figure this angle out.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

OK, thanks. I'll need a while to think on this. Meanwhile for future diagrams, how about a free download of 'geogebra'. I use 'sketchpad' which costs, but geogebra is pretty good for a freebie. Both these programs are 2D so you cannot actually 'do' the rotations you describe. I've seen others using a google download that does allow 3D rotations. Might try to track it down. Doubt it will solve the angle though; I'll try that by rotational matrices first.

Bob

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

My method will work although I wouldn't like to have to explain it as it involves matrices and vectors.

But I have a sign mistake somewhere as I got atan(-tanBcosA) for the angle around the x axis.

I cannot decide why this has happened so, if you can be patient another 24 hours, I try to figure this out, before giving my final result.

My final angle expression is pretty nasty; I doubt I could get it by high school trig alone. But it is a function of sine/cos/tan on the three angles as you thought.

Bob

ps. Do you have a known answer for some values of A, B and C, so I can test it?

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob I did suspect it would be much easier using matrices and vectors. I did some introductory courses in linear algebra about 25 years ago but have never had to use it, so its gone now. I am now retired from working in the airborne geophysical business searching mainly for metal deposits and mapping geology. One of my hobbies is metal machining by traditional hand operated methods. I am sure this problem comes up often and is no doubt solved in software in CAD/CAM and CNC machining packages.

You may not have a mistake with the sign because I did not pay any particular attention to signs of angles, I am really interested in magnitude because when viewing the actual part one can see from layout lines how it should be oriented.

I have made carefull measurement of C in one case only. The error would be about +/- 0.25 degrees.

A=12°, B=20°, C=10°. θ=atan(tanBcosA)=19.5966°. Rotation about Z, Φ=~5.4°(measured)

Intuitively if A=B and C=45° then Φ=45°. If A=B=0° or 90° then something most likely will be undefined. I suspect there may be trouble if C>45° also.

Take your time, I've been messing with this for about 3 weeks now.

John.

*Last edited by machinist60 (2010-07-04 14:43:11)*

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John

I, too, am retired. Was a maths teacher for 37 years plus some ICT in recent years.

Values helped a lot.

The negative sign is correct. To turn as required needs -19.5966 to go towards the plane. Might seem unimportant but the final formula is complicated and may give the wrong angle if I use the wrong sign at this stage.

What I have is tan E = (cosAsinC) / (cos DcosC + sinDsinAsinC)

where tanD = -cosAtanB

I'm still not 100% certain on this as it doesn't give 5.4 with your values.

Would you like to see the matrices? I can include a reminder of matrix multiplication for you.

Explaining it properly might help to validate it or highlight any error.

Bob

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob I tried your function for E and made some more measurements as follows:

A B C D (Calc) E (Meas) E (Calc)

12 20 10 -19.60 ~ 5.4 10.51

18 25 33 -23.92 ~24.9 36.56

32 14 20 -11.94 ~15.2 17.13

I am not sure what to make of this. I am pretty certain that my statement "Intuitively if A=B and C=45° then Φ=45°." is wrong.

I have been assigning angles as positive as measured from their respective axis. If I understand the usual convention YOQ is the only positive angle measured from 0, maybe this is the problem. I am interpreting your diagram above as having X coming forwards and the corner formed by the three planes as concave.

Could you post the notation you are using, or a refence to it, defining the sense in which angles are positive and the matrices plus the multiplication reminder.

Thanks, John.

*Last edited by machinist60 (2010-07-05 15:07:25)*

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

OK, here we go.

General background:

In transformation geometry the transform is usually shown before the thing it operates on.

So that forces us to use position vectors (3 rows by 1 column) rather than coordinates.

A 3 by 3 matrix will transform a 3 by 1 vector to produce another 3 by 1 vector.

As M x 0 = 0 only transformations that leave the origin invariant are possible. (rotations around O, reflections if the line goes through O, stretches and enlargements centred on O and shears where the invariant line goes through O)

Multplication reminder:

If M = a b c and V = p

d e f q

g h i r

then transformed V = V' = ap + bq + cr

dp + eq + fr

gp + hq + ir

Sorry, cannot put large brackets; hope the alignment reaches you as it leaves me.

I looked up the rotations on Wiki at http://en.wikipedia.org/wiki/Rotational_matrix#Three_dimensions

Below the three rotations, it defines the direction of rotation.

As you want a relationship between angles, it doesn't matter how long OR and the rest are so I chose all to be 1 unit.

(OP = OQ = OR =1)

That gives OP = sin C OQ = 0 OR = cos A

cos C cos B 0

0 sin B sin A

In my diagram, I'm imagining OX coming towards me, OY to the right and OZ straight up.

To rotate R onto OX use M = cos A 0 sin A

0 1 0

-sin A 0 cos A

This gives That gives OP' = cosAsin C OQ' = sinAsinB OR' = 1

cos C cos B 0

-sinAsinC cosAsin B 0

Next to rotate OQ' onto the XY plane. Call the angle D.

M = 1 0 0

0 cosD -sinD

0 sinD cosD

and we only need to work out the Z component of OQ'' and set it equal to zero

sinDcosB + cosDcosAsinB = 0 => tan D = -cosAtanB

After checking the direction of rotation the minus is Ok because the + direction is from Y towards Z, and we want OQ' to drop down onto the plane.

Now to figure out the final rotation around OZ of angle size E.

Apply D to P' to give P'' = cosAsinC

cosDcosC + sinDsinAsinC

sinDcosC - cosDsinAsinC

We only need to calculate ther x component and set it to zero

M = cos E -sin E 0

sin E cos E 0

0 0 1

=> cosEcosAsinC - sinEcosDcosc - sinEsinDsinAsinC = 0

=> tan E = cosAsinC / (cosDcosC + sinDsinAsinC)

And that's where I've got to. As my formula doesn't agree with your values, either I've slipped up somewhere or you're not talking about the same angle as me. Please have a look and see if (i) it makes sense, (ii) you can spot what's wrong. By all means come back to me for any clarifications. Whatever, the method will work; it's just a case of ironing out the bugs.

Bob

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob many thanks for all the info. and the Wiki link, it is going to take me some time to digest all this. I'll let you know.

John.

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

The matrix revision was great, it turned out to be pretty simple really given the 3 rotation matrices. I would not thought of the way of evaluating angles D and E by setting the appropriate components to 0. I worked through it all and I believe there is a mistake in evaluating tan E.

cosEcosAsinC - sinEcosDcosc - sinEsinDsinAsinC = 0 is correct but this

=> tan E = cosAtanC / (cosD + sinAtanCsinD)

I recalculated E with the following results:

A B C D (Calc) E (Meas) E (Calc) E (Recalc)

12 20 10 -19.60 ~ 5.4 10.51 11.04

18 25 33 -23.92 ~24.9 36.56 36.56 (why this is the same I am not sure)

32 14 20 -11.94 ~15.2 17.13 18.21

The correction has not made a huge difference. I set up two of these examples in the mill and made some cuts. I cannot measure any significant differences from angles A, B and C so I beleive all is well. I guess I have to conclude that my ability to measure some of the angles is quite poor. Makes sense when trying to measure the orientation of a line of intersection of two planes at small angles to each other.

I quite enjoyed the exercise and many thanks for your assistance.

John.

*Last edited by machinist60 (2010-07-09 14:00:49)*

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

We both have the same formula. TAN C = SIN C / COS C. Yours is just a simplification of mine.

Still the variation in values though?

So I got EXCEL to work. (image below)

My formulas for E are pretty complex because you have to convert to RADIANS then back to DEGREES.

E (Bobs) is =DEGREES(ATAN(COS(RADIANS(A3))*SIN(RADIANS(C3))/(COS(RADIANS(D3))*COS(RADIANS(C3))+SIN(RADIANS(D3))*SIN(RADIANS(A3))*SIN(RADIANS(C3)))))

and E (Johns) is =DEGREES(ATAN(COS(RADIANS(A3))*TAN(RADIANS(C3))/(COS(RADIANS(D3))+SIN(RADIANS(A3))*TAN(RADIANS(C3))*SIN(RADIANS(D3)))))

As you can see they give the same values.

Hope that helps

Bob

*Last edited by bob bundy (2010-07-11 20:58:26)*

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Hi Bob,

Thanks for checking my arithmetic. I was going to check that our two formulae were equivalent but it slipped my mind. Too bad there wasn't some error that explains the descrepancies, I fear this is not a trivial problem.

Careful setup, milling and measurenment still seems to show the theory is not fitting the practice.

I have been doing a little reading and it appears we may not treating the problem properly. Consider what happens when we do the two rotations to make plane ROQ cincident with the XY plane. These two totations can be combined into one whose axis lies in the XY plane so determining D works ok. The next step is to rotate OP around Z so that it lies in the YZ plane. The three discreet rotations can be combined in to one whose axis in general will not lie in the XY plane. This means that the angles used for the first two rotations will change.

Check this link

http://www.euclideanspace.com/maths/algebra/matrix/orthogonal/rotation/index.htm

If this is too complicated I'll just set my object up by eye and call it good enough.

John.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

The problem for me is I'm just coming at this from a pure mathematician's viewpoint. I don't know what your machine tool setup is like and how you are able to rotate things in practice. Would you be able to take some digital shots of what you are doing at each stage? I have a suspicion we're not yet talking about exactly the same thing.

Bob

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob,

Here are a couple of photos of the milling setup. Shown is a trial cut in a piece of wood.

1. The block of wood is twisted by angle A around an axis parallel to the lenght of the vice.

2. The vice body is tilted by angle D to the XY plane. This is done by placing a spacer of thickness 4" x sine E under one end of the vice. The centres of the cylindrical surfaces are 4" apart. This gets our A and B angled lines parallel to the XY plane (vice base).

3. The vice is rotated around Z by angle E from the transverse axis of the macine. This is parallel to the riser blocks you see under the vice.

This whole assembly can be translated in / out (X) and left / right (Y). The quill carrying the end mill cutter above the block of wood can be moved up and down (Z).

Hope this is clear.

John.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

It's been a while .... I've been thinking and checking.

I downloaded Google Sketchup. Try it; it's free and I think you'll find it useful.

I constructed a cube and did the rotations on it. It went according to plan ... no anomalies found.

Then I added matrix multiplication to my Excel of your trial angles to check the points move as required. They do.

You can get a copy of my cube and Excel from www.bundy.demon.co.uk/Puzzles/PuzzleIndex.htm

You'll also find my email on this site if you want to communicate directly.

Bob

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob I checked out your cube and Excel sheet, thanks. No doubt the math works.

I made another test model with the first values for A, B and C (photo included).

You can see angle C (10°) lies on the XY'' plane. I machined a small area of this plane so the angle can be seen. This is all just as it should be.

After making this it became apparent that I have been missing the fact that what is desired is the line of intersection of one vertical wall of the slot (plane XZ''') and the top surface of the cube (plane XY) be at 10° to plane XZ measured in plane XY. This turns out to be close to 15° in the current test, I would like it to be the angle C (10°).

I have spent most of the day trying to figure out how to achieve this without any result yet.

John.

I must add that I did not define the problem correctly in the beginning. It should now be clearer with an image. The last edit probably muddied the waters some more. What is desired is a skewed groove in the rectangular block oriented such that the bottom surface of the groove extends onto two adjacent sides at angles A and B and that a groove side wall intersects the top surface at angle C (measured in the top surface) to the side in which B is, or its complement (to the side containing B).

John.

*Last edited by machinist60 (2010-07-23 00:38:57)*

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

I think we may be at the crux of the matter; 'Are mathematicians and engineers speaking the same language?' Some might wonder; 'Do we occupy the same universe?'

But, not to worry; I've enjoyed exercising the grey matter; it helps to stop me going senile!

So, let's start over with a fresh look at the problem. The image below is my new attempt at a diagram based on your last photo. I've re-defined points to fit.

So point O (origin) and S (top front) are directly in front of us; with the Y axis off to the left, Z going straight up and X back into the picture.

I'm then thinking that A (12) = PRS ; B (20) = PQS.

But which is now C?

Would you have a look; decide if my interpretation fits; and let me know where C is.

Hope this gets us somewhere.

Bob

*Last edited by bob bundy (2010-07-22 22:26:13)*

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Bob I have edited my last post, my fuzzy thinking got it wrong. I hope you were not confused by it. May be it has something to do with having emigrated from Australia to Canada 43 years ago and still not having my world turned around!

Your diagram above is correct. C is the angle between a line from S and plane XZ on the top surface of the prism. A side wall of the groove is the plane normal to surface PQR and containing the line from S.

We were close the first go around but C turned out to be in PQR and not in the top surface of the prism.

John.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

I think I may have had a breakthrough!

See diagram below. Is this what you want?

The angle C is to the X axis whereas before it was to the Y axis. So I tried recomputing using 90 - C instead of C. I then noticed that the results for E agree well if you replace E by 90 - E. Here's what I mean in the table.

A B C D E 90-E measured

12 20 80 -19.5965742 84.37256573 5.627434266 5.4

18 25 57 -23.91656506 63.78097927 26.21902073 24.9

32 14 70 -11.93889455 73.79421699 16.20578301 15.2

Do you think this might be it?

Bob

*Last edited by bob bundy (2010-07-24 07:45:53)*

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Hi Bob,

I believe I did have X and Y axes mixed up so you are right. I also had not realised we are rotating the axes and not the object if I understand the conventions correctly.

I made another model according to your last diagram (Johns+box+v3).

This time the angles are A = -15, B = 20, C = 30. Photos attached. I set A -ve because if I have it correct +ve angles are X->Y, Y->Z and Z->X. I calculated D = -19.3701 and E = 29.3200. Using these numbers I set up a test block and milled a fin (inverse of a groove). Still the results don't seem to quite agree, particularly in XZ plane this time. PR should have been 15 to X but turns out to be ~20.4. ST should have been at 30 to X in the XY plane but turns out to be ~27.2. The differences can be seen in the photos.

I really don't get what is going on.

John.

*Last edited by machinist60 (2010-07-30 13:12:48)*

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

The large difference in A was bothering me because this was correct before. I have reworked the math referring to diagram Johns+box+v3. I have also decided that we are rotating the object, not the axes, I suspect that I have my signs/notations mixed somewhere, see below.

Rotate PQ onto OY around X by angle -B

Rot(-B)x Q R T Q' R' T'

[ 1 0 0 ] [ 0 cosA cosC ] [ 0 cosA cosC ]

[ 0 cosB sinB ] x [ cosB 0 sinC ] = [ 1 sinAsinB cosBsinC ]

[ 0 -sinB cosB ] [ sinB sinA 0 ] [ 0 cosBsinA -sinBsinC ]

In order to make Q' lie on the Y axis I seem to have to reverse the X rotation matrix. I don't understand why and the sign of D is also reversed althought the magnitude is correct.

Vice angle D = angle between plane Q'R'T' and OX in plane XOZ

tanD = R'z / R'x = sinAcosB / cosA = tanAcosB

Next make P'Q'R' parallel to XOY by rotating around Y by angle D. I think the mistake before was using angle C whose projection onto plane XOZ has been reduced to D by the first rotation B. This gave rise to the error in the horizontal vice rotation about Z.

Rot(D)y T' T''

[ cosD 0 sinD ] [ cosC ] [ cosCcosD - sinDsinBsinC ]

[ 0 1 0 ] x [ cosBsinC ] = [ cosBsinC ]

[ -sinD 0 cosD ] [ -sinBsinC ] [ -sinDcosC - cosDsinBsinC ]

Rotate vice about Z by angle E = angle between plane ZST'' and plane XOZ

tanE = T''y / T''x = cosBsinC / (cosCcosD - sinBsinCsinD)

I made another model with these angles:

A B C D E measured C

20 -60 -30 10.3141 -17.8894 ~ -30.0

Best I can tell this seems to work apart from the problems above.

When time permits I will work through the other models to check.

John.

*Last edited by machinist60 (2010-08-01 03:39:06)*

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

I have been through the other examples and all check out when set up on the mill.

A B C D E Measured C

20 -60 -30 10.3141 -17.8894 ~ -30.0

15 -20 -30 14.1327 -30.4869 ~ -30.0

12 -20 -10 11.2955 -9.7052 ~ -10.0

18 -25 -33 16.4085 -33.7231 ~ -33.0

32 -41 -20 31.228 -23.5713 ~ -20.0

Now just need to clear up the sign/sense problems in Rot(-B)x.

John.

Offline

**bob bundy****Administrator**- Registered: 2010-06-20
- Posts: 8,354

Hi John,

The rotation of angle B looks to me to be counter to the Y -> Z sense so the minus seems ok.

Further, as COS (-B) = COS (B) it shouldn't affect angle D.

Your last post has C measured agreeing with C chosen for lots of trials, so does that mean the search is over?

Meanwhile, I re-worked the problem using vector equations for the plane PQR, the normal to the plane and a vector equation for the line ST.

Then I checked that the rotations gave the plane as lying parallel to XY, the normal lying in the Z direction and the value of E (for the line).

All came out with the previous values, adding another confirmation of the formulas.

I think they're good (athough I wouldn't risk putting a man on the moon using them).

Best wishes for happy milling,

Bob

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Offline

**machinist60****Member**- Registered: 2010-07-01
- Posts: 14

Hi Bob,

Many thanks for your assistance, this has been great revision for me. I am happy with the results using

tanE = cosBsinC / (cosCcosD - sinBsinCsinD).

The problem is solved just fine and is "close enough for government work".

I can now go ahead and finish my project.

Thanks again, John.

Offline

Pages: **1**