What's new
What's new

calculating angle between two bores

Jshawtoolanddie

Plastic
Joined
Feb 15, 2018
I have a Haas Vf5ss with the renishaw probing system. we use dowel pin holes in our parts to set our work coordinates, due to odd shaped parts. as of now we use one dowel hole to set the coordinates, and another dowel hole to make sure the part is in the correct location based off of measurements when programmed. setting up parts on the mill for remilling takes time because we are having to probe each hole several times and move the part to the correct position. i want to be able to calculate the angle between the first dowel hole stored in g54 and the second dowel hole stored in g55 to plug the angle into g68 and let the machine rotate the coordinates so that i dont have to spend time trying to square the part up. i cant accurately find the angle between the two positions to rotate the coordinates. can anyone help with this issue?
 
I'm new to macros but thought I'd give it a go. From the Haas manual (https://diy.haascnc.com/sites/defau...ll_Operators_Manual_NGC_English.pdf?0=%3F2165) page 214, the G54 and G55 X&Y coordinates are stored in variables:

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

Function "ATAN[]" (page 221) takes decimal arguments and returns degrees.

Code:
#100 = ATAN[(#5241-#5221)/(#5242-#5222)]; 
G68 R#100;

MacroCalc (cool program!) seems to solve that okay. This assumes G55 X&Y are more positive than G54, but you can change the formula around depending on where your G55 is with respect to G54.
 
Or just use basic trig. Difference in Y offsets in g54 & g55 divided by the difference in X offsets in g54 and g55 yields the TANGENT of the angle between the holes. Scientific calculators have an inverse tan function so its easy to read the angle from the calculator.
 








 
Back
Top