What's new
What's new

Trig Advice on Making Bore Probing Macro for G68

Joined
Nov 2, 2018
I'm currently machining modular fixture plate for my Haas Minimill. I wanted it to cover the whole bed So I split it between 3x 12" x 12" x .8" 4140 plates. This presents a challenge with indicating since this takes up all my Y travel. I have the 9x holes/counterbores machined for the fasteners that will be mounting them to the bed and will be using them as my datum for the remaining ops. So the idea is to get XY from the bore and rotate the WCS "square" to the plates with G68.

For my first plate, I probed one counterbore to G54(also used as axis of rotation) and another counterbore that is co-linear to the previous in X to G55. I drew the bore positions up in CAD to measure the angle I needed for G68. It worked but it also took way too long.

I know from previous posts that my probing solution is a trig function but I am woefully awful at math. Could someone maybe walk me through the trig and/or how I might write a probing cycle that will determine both the direction and value for rotation? Many thanks
 
This presents a challenge with indicating since this takes up all my Y travel.

How so? Mag base indicators have arms for a reason.

You can use ether a Tan (opposite and adjacent) trig function
Code:
Tanθ=opposite/adjacent

θ=arctan(2nd function tan) x opposite/adjacent

Then is should be a simple matter of if the 2nd Y value is greater or lesser than the first to determine positive or negative rotation.
 
How so? Mag base indicators have arms for a reason.

Sorry- Maybe indicating wasn't the word. I just meant to say that initially I didn't really have anything to touch off of for Y at first. So I had to use the center of the middle t-slot for Y and do my best to indicate it square for the contouring of the more-critical X edges. So stacked the plates, indicated both, then drilled through both to establish my datum between plates for the fixturing holes. TMI, I know.

Thanks for the formula. However I think I might be missing some pre-requisite information to make sense of those terms. Do you think you could do an example? :) I know the probing sub-program and where the variables are stored and all that. Just trying to understand the function itself
 
So I think what Hazzert was trying to explain might be easier with this diagram. I would also use TAN.



Your X as you stand in front of the machine is the X distance between the two holes (Adjacent in this triangle), Let's say it's 10.0
Your Y is the distance between the two holes (The Opposite of the angle), Let's say it is 5.0.

So to now work out your Angle
Tan of the angle = Opposite divided by Adjacent.

so it is TAN (-) = 5/10
TAN (-) = 0.5
Then to work out your angle you need the inverse of TAN because it is on the Left side of the equation so you need to shift it over to the right. The inverse of TAN is ARCTAN or COT. which is actually TAN to the power of negative 1.

So to work out angle (-) = ARCTAN 0.5
This is where you whip out your scientific calculator (I use a Sharp and to get the inverse of TAN you hit "SECOND FUNCTION" and then "TAN")
Angle (-) = 26.565 degrees.

Remember that the included angles of a triangle are 180 degrees. So if you want the top angle, since you have a 90 deg in the one corner it is 180-90-26.565 = 63.435 degrees
 

Attachments

  • maxresdefault.jpg
    maxresdefault.jpg
    61.9 KB · Views: 65
Point your pointer finger to the left and stick your thumb straight up so you have a little right triangle. Set it up so that the tip of your finger is the angle you want to find.

Your thumb is the opposite side.
You index is the adjacent side.
The imaginary line running from the tip of your index to your thumb is the hypotenuse.

The old mnemonic device SOH CAH TOA means Sineθ=Opp/Hypot Cosineθ=Adj/Hyp and Tangentθ=Opp/Adj

So with a little multiplication and division you can isolate whatever variable to solve for either two different sides of a triangle or an angle provided you have enough information to fill in the remainder in any one of those three formulas.

edit:
Nast's example has pictures
 
Last edited:
Arctan is not the same thing as Cotangent. Both tangent and cotangent are ratios derived from an angle, arctangent is an angle derived from the ratio of opposite over adjacent.
 
Point your pointer finger to the left and stick your thumb straight up so you have a little right triangle.

Your thumb is the opposite side.
You index is the adjacent side.
The imaginary line running from the tip of your index to your thumb is the hypotenuse.

The old mnemonic device SOH CAH TOA means Sineθ=Opp/Hypot Cosineθ=Adj/Hyp and Tangentθ=Opp/Adj

So with a little multiplication and division you can isolate whatever variable to solve for either two different sides of a triangle or an angle provided you have enough information to fill in the remainder in any one of those three formulas.

edit:
Nast's example has pictures


S(ine)ome Old Hens, C(os)ackle and howl, T(an)ill old age :sulk:
 
Thanks for the answers all-Great stuff. Wasn't able to go to this last week. So just to make sure I am keeping up:

Any given right-angle triangle has three distinguishable angles(sin., cos., tan.) and line segments (hyp., adj., opp.) So I identify the angle I want to figure out, then use the corresponding ratio of line segments(SOH/CAH/TOAH) to find the angle(?). Then to get my actual degree value for rotation, I invert it i.e. x^-1.

If my previous statements are correct, I have another question for the programming. Using my original example(see screenshot)of probing two holes that are colinear in X, how would you guys recommend handling the direction of rotation?
View attachment 259623
 

Attachments

  • edited.jpg
    edited.jpg
    88.9 KB · Views: 74
If you use the correct sign (+/-) of each leg you should end up with the correct (+/-) angle.

ie: top triangle +X, +Y gives +angle
Botton +X, -Y gives -angle.
 
If you use the correct sign (+/-) of each leg you should end up with the correct (+/-) angle.

ie: top triangle +X, +Y gives +angle
Botton +X, -Y gives -angle.

Ok I think I follow now. So this one seems to work both ways for the two angles I'd be trying to solve. Everything look right?

Code:
#5221 G54 X
#5241 G55 X
#5222 G54 Y
#5242 G55 Y

#100 = ATAN[(#5242 - #5222) / (#5241 - #5221)]; 
G68 X0. Y0. R#100;
 
Thanks for the help everyone! It's been working great!
 

Attachments

  • 65459597_720148598403861_1313643450020659200_n.jpg
    65459597_720148598403861_1313643450020659200_n.jpg
    98 KB · Views: 64








 
Back
Top