G112 breakdown

1. Plastic
Join Date
May 2017
Country
UNITED STATES
State/Province
Minnesota
Posts
15
Post Thanks / Like
Likes (Given)
5
1

## G112 breakdown

Hey everybody, so a little slow at the shop. trying to learn some new stuff. so i understand the concept, ive taken a sample program from haas and run it in the machine. the issues im having is the math so i can program differnt things. i'd like to get a program that can be edited for different sizes, making either a sqaure, flats, or a hex. Can anyone provide a breakdown of how you find the numbers for X and Y? Looking at the sample program i still cant figure out how they got the numbers. It's the 1.732(or something close) hex using g112. if anyone can help it would really be appreciated, also i understand that a forum isnt the best place to teach so thanks in advance to anyone who tries.

2. Diamond
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
4,661
Post Thanks / Like
Likes (Given)
845
2535
You should post what machine and control you are using.

3. Aluminum
Join Date
Oct 2014
Country
UNITED STATES
State/Province
Ohio
Posts
188
Post Thanks / Like
Likes (Given)
785
43
1 2 3 4 5 6 7 8 9 10

4. Aluminum
Join Date
Oct 2014
Country
UNITED STATES
State/Province
Ohio
Posts
188
Post Thanks / Like
Likes (Given)
785
43
distance across corners of a square is 1.4142 * distance across flats.

distance across corners of a hex is 1.1547 * distance across flats.

NB: 1.4142 = square root of 2

5. G112 (Polar Interpolation) can be hard to learn considering there really aren't many resources out there to teach you, assuming you're trying to program long hand. Do you have any experience programming a 3-axis mill? If you do, you'll find the two quite similar. The biggest stumbling block I had was remembering to double the X value when you're programming.

6. Plastic
Join Date
May 2017
Country
UNITED STATES
State/Province
Minnesota
Posts
15
Post Thanks / Like
Likes (Given)
5
1
forgot about machine, using a haas st30 w/ live tooling (obviously). controllers are haas but i think same as fanuc? bear with me as im not up to date on all the jargon. im not so much looking for a post but how to figure out the dimensions i need the tool to run across. i haven't gotten to long hand program mills, and i understand that knowledge would be very beneficial. what would be perfect, lets say a program to cut a square, using G112, with sidenotes explaining where the numbers were gotten from.. i.e. x1.5y.5; (notes x1.5 because thats the lowest point..) or something like that where i can kinda reverse it and breakdown. i appreciate the responses, there is not much out there usinbg G112 that doesnt involve CAM software.

7. Aluminum
Join Date
Oct 2014
Country
UNITED STATES
State/Province
Ohio
Posts
188
Post Thanks / Like
Likes (Given)
785
43
Have you tried this workbook? https://www.productivity.com/wp-cont..._DS-Manual.pdf (others in the series available here: Haas CNC Machine Tool Training | Mill + Lathe Programming Manuals , I've also seen the answer books floating around; try Google)

8. Plastic
Join Date
May 2017
Country
UNITED STATES
State/Province
Minnesota
Posts
15
Post Thanks / Like
Likes (Given)
5
1
yeah, thats where i got the program i was referring to. if you look in it they show a diagram of the hex, but i couldnt figure out how they got their numbers. the added rad. for the corners didnt help.

9. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,724
Post Thanks / Like
Likes (Given)
0
1469
Originally Posted by AirLakeMachine
yeah, thats where i got the program i was referring to. if you look in it they show a diagram of the hex, but i couldnt figure out how they got their numbers. the added rad. for the corners didnt help.
Hello AirLakeMachine,
Each point on the hex is indexed by 60degs. Apart from that, the only known in the drawing is the AF and half AF.

1. Using the half AF dimension of 0.866 as one side of a triangle and an included angle of 30deg (half the index angle) between the hypotenuse and the 0.866 side of the triangle, all dimensions to construct the hex can be obtained.

2. The hypotenuse (the half distance Across the Points) can be calculated with:

H=0.866 / Cos(30)
H=0.99997
Where H is the hypotenuse

3. Half the length of each flat can be calculated with:

X=Tan(30) x .866
X=0.49998
Where X is half the Length of the Flat.

Once you have the coordinates of the points of the Hex, the tangent points for the 0.06 rads and the sides of the Hex can be calculated using Trig.

Normally when using Polar Interpolation on a lathe, the X coordinates are specified in the same Diameter manner as in turning operations (unless the control is set to use radius values for X). I’m not aware that this is not the case with HAAS, but their example G112 program is using Radius values for X. Notwithstanding this, their example using radius values for X makes following the program easier because you don’t have to divide the X value by 2 to make sense of the coordinates and from a programming point of view, one would program the tool path in the same manner as with a machining centre, where X/Y Zero is the centre of the Hex.

Regards,

Bill

10. Cast Iron
Join Date
Sep 2008
Country
UNITED STATES
State/Province
Florida
Posts
361
Post Thanks / Like
Likes (Given)
30
94
I am 99% sure that Haas uses radius for X axis in polar.

11. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,724
Post Thanks / Like
Likes (Given)
0
1469
Originally Posted by rainman
I am 99% sure that Haas uses radius for X axis in polar.
Yes, I've found out that if the HAAS control is set to Fanuc Mode, G12.1 is used to call Polar Interpolation, X coordinates are specified in terms of diameter and the "C" address is specified as a virtual "Y". In HAAS Mode, X coordinates are specified in Radius Values and a "Y" address is used for the virtual "Y" move.

Regards,

Bill

12. Originally Posted by angelw
Yes, I've found out that if the HAAS control is set to Fanuc Mode, G12.1 is used to call Polar Interpolation, X coordinates are specified in terms of diameter and the "C" address is specified as a virtual "Y".
I wonder if that's why there's a G12.1 and a G112, to specify between radial and axial programming?

13. Cast Iron
Join Date
Sep 2008
Country
UNITED STATES
State/Province
Florida
Posts
361
Post Thanks / Like
Likes (Given)
30
94
In some Fanuc controls (our 18i for one) G12.1 and G112 are interchangeable.

14. Plastic
Join Date
May 2017
Country
UNITED STATES
State/Province
Minnesota
Posts
15
Post Thanks / Like
Likes (Given)
5
1
Hey, I appreciate the response and explanation. i did the math and still am not understanding this.. i think the issue is coming because of the radius on the corners of the hex. does anyone have a hex program they could post similar to this one that i could try to work off of? again thanks you guys

O52025 (XY TO XC INTERPOLATION)

G53 G00 X-5. Z-10.

G00 G54
T505
M154
C0.
G97 P3000 M133
G98
G17
G112
Z0.1
G01 Z-0.2 F10.
G00 X1.5 Y0.
G01 G41 X1. Y0.
X0.9827 Y-0.03
X0.5173 Y-0.836
G02 X0.4653 Y-0.866 R0.06
G01 X-0.4654 Y-0.866
G02 X-0.5173 Y-0.836 R0.06
G01 X-0.9827 Y-0.03
G02 X-0.9827 Y0.03 R0.06
G01 X-0.5173 Y0.836
G02 X-0.4654 Y0.866 R0.06
G01 X0.465 Y0.866
G02 X0.5173 Y0.836 R0.06
G01 X0.9827 Y0.03
G02 X0.9827 Y-0.03 R0.06
G01 G40 X1.35 Y0.
G113
G18
G53 G00 X0.
G99 M135
M155
M30

15. Cast Iron
Join Date
Sep 2008
Country
UNITED STATES
State/Province
Florida
Posts
361
Post Thanks / Like
Likes (Given)
30
94
Well, for one thing, you can't do rapid moves in polar mode. And, you must start at C0 before you enter polar mode. What I do is rapid to X something (like X0), C0 Z in front of the part. Then, code G112 and XY (or XC, depending upon the control) to the beginning of the path at a high feedrate. Then feed Z down and go your merry way.

16. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,724
Post Thanks / Like
Likes (Given)
0
1469
Originally Posted by AirLakeMachine
Hey, I appreciate the response and explanation. i did the math and still am not understanding this.. i think the issue is coming because of the radius on the corners of the hex. does anyone have a hex program they could post similar to this one that i could try to work off of? again thanks you guys

Hello AirLakeMachine,
Following is your same program for a 1.732 AF Hex, without corner rads.

Regards,

Bill

G00 G54
T505
M154
C0.
G97 P3000 M133
G98
G17
G112
Z0.1
G01 Z-0.2 F10.
G00 X1.5 Y0.
G01 G41 X1.0000 Y0.0000
G01 X0.5000 Y-0.8660
G01 X-0.5000 Y-0.8660
G01 X-1.0000 Y0.0000
G01 X-0.5000 Y0.8660
G01 X0.5000 Y0.8660
G01 X1.0000 Y0.0000
G01 G40 X1.5000 Y0.0000
G113
G18
G53 G00 X0.
G99 M135
M155
M30

17. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,724
Post Thanks / Like
Likes (Given)
0
1469
Originally Posted by rainman
Well, for one thing, you can't do rapid moves in polar mode. And, you must start at C0 before you enter polar mode. What I do is rapid to X something (like X0), C0 Z in front of the part. Then, code G112 and XY (or XC, depending upon the control) to the beginning of the path at a high feedrate. Then feed Z down and go your merry way.
Hello rainman,
For sure with a Fanuc control, G00 is not permitted in Polar Interpolation Mode. However, whether its a Typo in the HAAS Manual, the example program posted by AirLakeMachine is straight out of the book, with a G00 move after entering Polar Mode.

Also with a Fanuc control, the virtual axis is at coordinate 0.0 immediately after Polar Interpolation is specified. Accordingly, unless there was a timing issue with another feature of the workpiece, the C axis can be at any position prior to Polar Mode being specified; only the program code needs to start at virtual axis Zero.

Regards,

Bill

18. Cast Iron
Join Date
Sep 2008
Country
UNITED STATES
State/Province
Florida
Posts
361
Post Thanks / Like
Likes (Given)
30
94
Well, that may well be, but I've had very unreliable results if I don't position to C0 prior to entering polar mode. Maybe it's just our machine, but the only way to get predictable results is to start at C0, then enter polar mode.

19. Cast Iron
Join Date
Sep 2008
Country
UNITED STATES
State/Province
Florida
Posts
361
Post Thanks / Like
Likes (Given)
30
94
Straight from Fanuc manual:

1.The following G codes may be used when G112 is active: G1, G2, G3, G40, G41, G42, G65, and G98.
2.G0 positioning is not allowed when G112 is active.
3.When using G2 or G3, the arc radius is specified using the R word.
4.M40 C axis mode must be active before commanding polar coordinate interpolation.
5.The spindle should be oriented to C0 degrees before commanding polar coordinate interpolation.
6.If machining in the X axis only, do not activate polar coordinate interpolation.
7.The unit of command for the C axis, when polar coordinate interpolation is used, is MM or inches, not degrees.
8.When using cutter compensation during polar coordinate interpolation, the same basic TNRC rules apply as with normal lathe programming. However, the following rules must also be observed:-
The tool radius and the quadrant must be loaded into the geometry offset file. For polar coordinate interpolation, the X tool offset represents the centre of the cutter and the tool tip location (Quadrant) will be set to 9.

Straight from Haas manual:

%
O00018 (G112)
(CUTS 1.732 HEX)
(2.0 ROUND STOCK)
(T1=.5IN ENDMILL)
(ON TOOL OFFSET PAGE)
G53 G00 Y0.
G53 G00 X0.
G00 G54
T101
M154 (ENGAGE C AXIS)
G28 H0 (HOME C AXIS)
G97 M133 P3000
G98 (IN PER MIN)
G17 (SELECTS G17 XY PLANE)
G112 (XY-XC INTERPOLATION)
N2 Z0.1 (CLEARANCE PLANE)
N3 G01 Z-0.25 F10. (Z FINAL DEPTH)
etc.......